mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Actually use the particle event to register the particles
This commit is contained in:
parent
fc7032fa4d
commit
9ec20f4895
2 changed files with 6 additions and 15 deletions
|
@ -52,10 +52,8 @@ import net.neoforged.fml.ModLoadingContext;
|
||||||
import net.neoforged.fml.common.Mod;
|
import net.neoforged.fml.common.Mod;
|
||||||
import net.neoforged.fml.config.ModConfig;
|
import net.neoforged.fml.config.ModConfig;
|
||||||
import net.neoforged.fml.event.config.ModConfigEvent;
|
import net.neoforged.fml.event.config.ModConfigEvent;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
|
||||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
import net.neoforged.fml.loading.FMLEnvironment;
|
import net.neoforged.fml.loading.FMLEnvironment;
|
||||||
import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
|
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
import net.neoforged.neoforge.common.conditions.ICondition;
|
import net.neoforged.neoforge.common.conditions.ICondition;
|
||||||
import net.neoforged.neoforge.common.world.BiomeModifier;
|
import net.neoforged.neoforge.common.world.BiomeModifier;
|
||||||
|
@ -132,9 +130,9 @@ public class ActuallyAdditions {
|
||||||
eventBus.addListener(this::setup);
|
eventBus.addListener(this::setup);
|
||||||
|
|
||||||
if (FMLEnvironment.dist.isClient()) {
|
if (FMLEnvironment.dist.isClient()) {
|
||||||
eventBus.addListener(this::clientSetup);
|
eventBus.addListener(ActuallyAdditionsClient::setup);
|
||||||
eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders);
|
eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders);
|
||||||
eventBus.addListener(this::particleFactoryRegister);
|
eventBus.addListener(ActuallyAdditionsClient::registerParticleFactories);
|
||||||
eventBus.register(new ClientRegistryHandler());
|
eventBus.register(new ClientRegistryHandler());
|
||||||
}
|
}
|
||||||
IFarmerBehavior.initBehaviors();
|
IFarmerBehavior.initBehaviors();
|
||||||
|
@ -168,14 +166,6 @@ public class ActuallyAdditions {
|
||||||
CommonConfig.Other.relayConfigureItem = item2 != null?item2: Items.AIR;
|
CommonConfig.Other.relayConfigureItem = item2 != null?item2: Items.AIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clientSetup(FMLClientSetupEvent event) {
|
|
||||||
ActuallyAdditionsClient.setup(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void particleFactoryRegister(RegisterParticleProvidersEvent event) {
|
|
||||||
ActuallyAdditionsClient.registerParticleFactories();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void serverStarted(ServerStartedEvent event) {
|
public void serverStarted(ServerStartedEvent event) {
|
||||||
// TODO: [port] check if this is needed
|
// TODO: [port] check if this is needed
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
|
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
|
||||||
|
import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
|
|
||||||
public class ActuallyAdditionsClient {
|
public class ActuallyAdditionsClient {
|
||||||
|
@ -135,9 +136,9 @@ public class ActuallyAdditionsClient {
|
||||||
event.registerEntityRenderer(ActuallyAdditions.ENTITY_WORM.get(), RenderWorm::new);
|
event.registerEntityRenderer(ActuallyAdditions.ENTITY_WORM.get(), RenderWorm::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerParticleFactories() {
|
public static void registerParticleFactories(RegisterParticleProvidersEvent event) {
|
||||||
Minecraft.getInstance().particleEngine.register(ActuallyParticles.LASER_ITEM.get(), ParticleLaserItem.Factory::new);
|
event.registerSpriteSet(ActuallyParticles.LASER_ITEM.get(), ParticleLaserItem.Factory::new);
|
||||||
Minecraft.getInstance().particleEngine.register(ActuallyParticles.BEAM.get(), ParticleBeam.Factory::new);
|
event.registerSpriteSet(ActuallyParticles.BEAM.get(), ParticleBeam.Factory::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: [port] validate that this works
|
// TODO: [port] validate that this works
|
||||||
|
|
Loading…
Reference in a new issue