generated from tilera/1710mod
fix: crash on server
This commit is contained in:
parent
b22426842e
commit
183494cb20
|
@ -4,6 +4,9 @@ import cpw.mods.fml.client.FMLClientHandler;
|
|||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import mffs.base.PacketFxs;
|
||||
import mffs.base.PacketFxsHandler;
|
||||
import mffs.gui.GuiBiometricIdentifier;
|
||||
import mffs.gui.GuiCoercionDeriver;
|
||||
import mffs.gui.GuiForceFieldProjector;
|
||||
|
@ -26,6 +29,7 @@ import mffs.tileentity.TileEntityForceFieldProjector;
|
|||
import mffs.tileentity.TileEntityForceManipulator;
|
||||
import mffs.tileentity.TileEntityFortronCapacitor;
|
||||
import mffs.tileentity.TileEntityInterdictionMatrix;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -36,6 +40,14 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
|||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ModularForceFieldSystem.channel.registerMessage(PacketFxsHandler.class, PacketFxs.class,
|
||||
1, Side.CLIENT);
|
||||
super.preInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
|
@ -128,4 +140,10 @@ public class ClientProxy extends CommonProxy {
|
|||
FMLClientHandler.instance().getClient().effectRenderer.addEffect((
|
||||
EntityFX) new FXHologramMoving(world, position, red, green, blue, age));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSneaking() {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
return player.isSneaking();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,4 +91,8 @@ public class CommonProxy implements IGuiHandler {
|
|||
public void renderHologramMoving(final World world, final Vector3 position,
|
||||
final float red, final float green,
|
||||
final float blue, final int age) {}
|
||||
|
||||
public boolean isSneaking() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -258,7 +258,6 @@ public class ModularForceFieldSystem {
|
|||
"tileInterdictionMatrix");
|
||||
GameRegistry.registerTileEntity(TileEntityForceManipulator.class,
|
||||
"tileForceManipulator");
|
||||
ModularForceFieldSystem.proxy.preInit();
|
||||
|
||||
FluidRegistry.registerFluid(FortronHelper.FLUID_FORTRON);
|
||||
|
||||
|
@ -304,12 +303,9 @@ public class ModularForceFieldSystem {
|
|||
|
||||
channel =
|
||||
NetworkRegistry.INSTANCE.newSimpleChannel("ModularForceFieldSystem");
|
||||
|
||||
int pkgDiscriminator = 0;
|
||||
ModularForceFieldSystem.proxy.preInit();
|
||||
channel.registerMessage(PacketTileHandler.class, PacketTile.class,
|
||||
pkgDiscriminator++, Side.SERVER);
|
||||
channel.registerMessage(PacketFxsHandler.class, PacketFxs.class,
|
||||
pkgDiscriminator++, Side.CLIENT);
|
||||
0, Side.SERVER);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
|
|
@ -116,8 +116,7 @@ public class BlockForceField
|
|||
final int x, final int y,
|
||||
final int z) {
|
||||
if (world.isRemote) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (player.isSneaking()) {
|
||||
if (ModularForceFieldSystem.proxy.isSneaking()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue