fix crash on dedicated server
This commit is contained in:
parent
40eb6be20f
commit
2e2b7d0d22
@ -1,16 +1,19 @@
|
|||||||
package com.jenny.enhancedexplosives;
|
package com.jenny.enhancedexplosives;
|
||||||
|
|
||||||
|
import com.jenny.enhancedexplosives.entities.entities;
|
||||||
import com.jenny.enhancedexplosives.particles.ArrowParticle;
|
import com.jenny.enhancedexplosives.particles.ArrowParticle;
|
||||||
import com.jenny.enhancedexplosives.particles.particles;
|
import com.jenny.enhancedexplosives.particles.particles;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.client.event.RegisterParticleProvidersEvent;
|
import net.minecraftforge.client.event.RegisterParticleProvidersEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
|
|
||||||
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
||||||
|
|
||||||
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||||
public class eventBusEvents {
|
public class ClientEvents {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void registerParticleFactories(final RegisterParticleProvidersEvent event) {
|
public static void registerParticleFactories(final RegisterParticleProvidersEvent event) {
|
||||||
Minecraft.getInstance().particleEngine.register(particles.CONCUSSIVE_ARROW_PARTICLE.get(),
|
Minecraft.getInstance().particleEngine.register(particles.CONCUSSIVE_ARROW_PARTICLE.get(),
|
||||||
@ -22,4 +25,9 @@ public class eventBusEvents {
|
|||||||
Minecraft.getInstance().particleEngine.register(particles.TUNNEL_ARROW_PARTICLE.get(),
|
Minecraft.getInstance().particleEngine.register(particles.TUNNEL_ARROW_PARTICLE.get(),
|
||||||
ArrowParticle.Provider::new);
|
ArrowParticle.Provider::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onClientSetup(FMLClientSetupEvent event) {
|
||||||
|
entities.registerRenderers();
|
||||||
|
}
|
||||||
}
|
}
|
@ -7,7 +7,6 @@ import com.jenny.enhancedexplosives.entities.entities;
|
|||||||
import com.jenny.enhancedexplosives.items.items;
|
import com.jenny.enhancedexplosives.items.items;
|
||||||
import com.jenny.enhancedexplosives.particles.particles;
|
import com.jenny.enhancedexplosives.particles.particles;
|
||||||
import com.mojang.logging.LogUtils;
|
import com.mojang.logging.LogUtils;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.server.ServerStartingEvent;
|
import net.minecraftforge.event.server.ServerStartingEvent;
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
@ -15,7 +14,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||||||
import net.minecraftforge.fml.ModLoadingContext;
|
import net.minecraftforge.fml.ModLoadingContext;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.config.ModConfig;
|
import net.minecraftforge.fml.config.ModConfig;
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -54,14 +52,4 @@ public class EnhancedExplosives {
|
|||||||
public void onServerStarting(ServerStartingEvent event) {
|
public void onServerStarting(ServerStartingEvent event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
|
|
||||||
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
|
||||||
public static class ClientModEvents {
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public static void onClientSetup(FMLClientSetupEvent event) {
|
|
||||||
entities.registerRenderers();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -43,7 +43,6 @@ public class tntArrow extends baseArrow {
|
|||||||
@Override
|
@Override
|
||||||
public void spawnParticles(float partialTicks) {
|
public void spawnParticles(float partialTicks) {
|
||||||
for (int i = 1; i <= ConfigClient.calcPCount(5); i++) {
|
for (int i = 1; i <= ConfigClient.calcPCount(5); i++) {
|
||||||
double m = (double) level().getRandom().nextIntBetweenInclusive(- 100, 100) / 100;
|
|
||||||
Vec3 DeltaMovement = getDeltaMovement();
|
Vec3 DeltaMovement = getDeltaMovement();
|
||||||
Vec3 pos = particlePos(0.5);
|
Vec3 pos = particlePos(0.5);
|
||||||
level().addParticle(particles.TNT_ARROW_PARTICLE.get(), pos.x, pos.y, pos.z, DeltaMovement.x, DeltaMovement.y, DeltaMovement.z);
|
level().addParticle(particles.TNT_ARROW_PARTICLE.get(), pos.x, pos.y, pos.z, DeltaMovement.x, DeltaMovement.y, DeltaMovement.z);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user