diff --git a/src/datagen/java/com/github/elenterius/biomancy/datagen/DataGenerators.java b/src/datagen/java/com/github/elenterius/biomancy/datagen/DataGenerators.java index fdc64fb9d..f1e5a09b1 100644 --- a/src/datagen/java/com/github/elenterius/biomancy/datagen/DataGenerators.java +++ b/src/datagen/java/com/github/elenterius/biomancy/datagen/DataGenerators.java @@ -8,6 +8,7 @@ import com.github.elenterius.biomancy.datagen.models.ModBlockStateProvider; import com.github.elenterius.biomancy.datagen.models.ModItemModelProvider; import com.github.elenterius.biomancy.datagen.modonomicon.GuideBookProvider; +import com.github.elenterius.biomancy.datagen.particles.ModParticleSpriteProvider; import com.github.elenterius.biomancy.datagen.recipes.ModRecipeProvider; import com.github.elenterius.biomancy.datagen.tags.*; import net.minecraft.data.DataGenerator; @@ -49,6 +50,9 @@ public static void gatherData(final GatherDataEvent event) { //sounds generator.addProvider(true, new ModSoundProvider(generator, existingFileHelper)); + //particles + generator.addProvider(true, new ModParticleSpriteProvider(generator, existingFileHelper)); + //translations EnglishLangProvider translationProvider = new EnglishLangProvider(generator); diff --git a/src/datagen/java/com/github/elenterius/biomancy/datagen/particles/ModParticleSpriteProvider.java b/src/datagen/java/com/github/elenterius/biomancy/datagen/particles/ModParticleSpriteProvider.java new file mode 100644 index 000000000..ce938c53d --- /dev/null +++ b/src/datagen/java/com/github/elenterius/biomancy/datagen/particles/ModParticleSpriteProvider.java @@ -0,0 +1,18 @@ +package com.github.elenterius.biomancy.datagen.particles; + +import com.github.elenterius.biomancy.BiomancyMod; +import com.github.elenterius.biomancy.init.ModParticleTypes; +import net.minecraft.data.DataGenerator; +import net.minecraftforge.common.data.ExistingFileHelper; + +public class ModParticleSpriteProvider extends ParticleSpriteProvider { + public ModParticleSpriteProvider(DataGenerator generator, ExistingFileHelper fileHelper) { + super(generator, BiomancyMod.MOD_ID, fileHelper); + } + + @Override + public void registerParticles() { + addParticle(ModParticleTypes.BLOODY_CLAWS_ATTACK, 8, 1); + } + +} diff --git a/src/main/java/com/github/elenterius/biomancy/BiomancyMod.java b/src/main/java/com/github/elenterius/biomancy/BiomancyMod.java index 7cff0a768..5f50ce94c 100644 --- a/src/main/java/com/github/elenterius/biomancy/BiomancyMod.java +++ b/src/main/java/com/github/elenterius/biomancy/BiomancyMod.java @@ -53,6 +53,7 @@ public BiomancyMod() { ModLoot.GLOBAL_MODIFIERS.register(modEventBus); ModSoundEvents.SOUND_EVENTS.register(modEventBus); + ModParticleTypes.PARTICLE_TYPES.register(modEventBus); ModsCompatHandler.onBiomancyInit(modEventBus); } diff --git a/src/main/java/com/github/elenterius/biomancy/init/ModParticleTypes.java b/src/main/java/com/github/elenterius/biomancy/init/ModParticleTypes.java new file mode 100644 index 000000000..f6d432cb8 --- /dev/null +++ b/src/main/java/com/github/elenterius/biomancy/init/ModParticleTypes.java @@ -0,0 +1,21 @@ +package com.github.elenterius.biomancy.init; + +import com.github.elenterius.biomancy.BiomancyMod; +import net.minecraft.core.particles.ParticleType; +import net.minecraft.core.particles.SimpleParticleType; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.RegistryObject; + +public final class ModParticleTypes { + + public static final DeferredRegister> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, BiomancyMod.MOD_ID); + public static final RegistryObject BLOODY_CLAWS_ATTACK = register("bloody_claws_attack", true); + + private ModParticleTypes() {} + + private static RegistryObject register(String name, boolean overrideLimiter) { + return PARTICLE_TYPES.register(name, () -> new SimpleParticleType(overrideLimiter)); + } + +} diff --git a/src/main/java/com/github/elenterius/biomancy/init/client/ClientSetupHandler.java b/src/main/java/com/github/elenterius/biomancy/init/client/ClientSetupHandler.java index 7a5d63119..3aabf76ff 100644 --- a/src/main/java/com/github/elenterius/biomancy/init/client/ClientSetupHandler.java +++ b/src/main/java/com/github/elenterius/biomancy/init/client/ClientSetupHandler.java @@ -19,16 +19,14 @@ import com.github.elenterius.biomancy.client.render.entity.WitherProjectileRenderer; import com.github.elenterius.biomancy.client.render.entity.fleshblob.FleshBlobRenderer; import com.github.elenterius.biomancy.client.render.entity.fleshblob.MalignantFleshBlobRenderer; -import com.github.elenterius.biomancy.init.ModBlockEntities; -import com.github.elenterius.biomancy.init.ModBlocks; -import com.github.elenterius.biomancy.init.ModEntityTypes; -import com.github.elenterius.biomancy.init.ModItems; +import com.github.elenterius.biomancy.init.*; import com.github.elenterius.biomancy.integration.ModsCompatHandler; import com.github.elenterius.biomancy.tooltip.EmptyLineTooltipComponent; import com.github.elenterius.biomancy.tooltip.HrTooltipComponent; import com.github.elenterius.biomancy.tooltip.StorageSacTooltipComponent; import com.mojang.blaze3d.platform.InputConstants; import net.minecraft.client.KeyMapping; +import net.minecraft.client.particle.AttackSweepParticle; import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.ThrownItemRenderer; @@ -117,6 +115,11 @@ private static void setBlockRenderLayers() { //ItemBlockRenderTypes.setRenderLayer(ModBlocks.FOOBAR.get(), renderType -> renderType == RenderType.getCutout() || renderType == RenderType.getTranslucent()); } + @SubscribeEvent + public static void registerParticles(final RegisterParticleProvidersEvent event) { + event.register(ModParticleTypes.BLOODY_CLAWS_ATTACK.get(), AttackSweepParticle.Provider::new); + } + @SubscribeEvent public static void registerLayerDefinitions(final EntityRenderersEvent.RegisterLayerDefinitions event) { event.registerLayerDefinition(WitherProjectileRenderer.MODEL_LAYER, WitherSkullRenderer::createSkullLayer); diff --git a/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_1.png b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_1.png new file mode 100644 index 000000000..2ff33d476 Binary files /dev/null and b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_1.png differ diff --git a/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_2.png b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_2.png new file mode 100644 index 000000000..109584d74 Binary files /dev/null and b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_2.png differ diff --git a/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_3.png b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_3.png new file mode 100644 index 000000000..6ec678ba7 Binary files /dev/null and b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_3.png differ diff --git a/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_4.png b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_4.png new file mode 100644 index 000000000..8d2aee4b8 Binary files /dev/null and b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_4.png differ diff --git a/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_5.png b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_5.png new file mode 100644 index 000000000..1a56c6a0e Binary files /dev/null and b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_5.png differ diff --git a/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_6.png b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_6.png new file mode 100644 index 000000000..d01b0dda3 Binary files /dev/null and b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_6.png differ diff --git a/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_7.png b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_7.png new file mode 100644 index 000000000..cf76bf2bc Binary files /dev/null and b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_7.png differ diff --git a/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_8.png b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_8.png new file mode 100644 index 000000000..87a8431cf Binary files /dev/null and b/src/main/resources/assets/biomancy/textures/particle/bloody_claws_attack_8.png differ