Skip to content

Commit

Permalink
feat: add Bloody Claw Attack Particle
Browse files Browse the repository at this point in the history
Co-authored-by: RhinoW <[email protected]>
  • Loading branch information
Elenterius and RhinoWarlord committed Jun 13, 2023
1 parent c241276 commit 8fb9bc3
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public BiomancyMod() {
ModLoot.GLOBAL_MODIFIERS.register(modEventBus);

ModSoundEvents.SOUND_EVENTS.register(modEventBus);
ModParticleTypes.PARTICLE_TYPES.register(modEventBus);

ModsCompatHandler.onBiomancyInit(modEventBus);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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<ParticleType<?>> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, BiomancyMod.MOD_ID);
public static final RegistryObject<SimpleParticleType> BLOODY_CLAWS_ATTACK = register("bloody_claws_attack", true);

private ModParticleTypes() {}

private static RegistryObject<SimpleParticleType> register(String name, boolean overrideLimiter) {
return PARTICLE_TYPES.register(name, () -> new SimpleParticleType(overrideLimiter));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8fb9bc3

Please sign in to comment.