From b0039e5229d0026d3da8479843a3a88813b690bb Mon Sep 17 00:00:00 2001 From: LemADEC Date: Sun, 7 Feb 2016 13:00:47 +0100 Subject: [PATCH] Updated client/server check --- src/main/java/cr0s/warpdrive/EntityJump.java | 3 +-- .../warpdrive/block/TileEntityAbstractEnergy.java | 3 +-- .../warpdrive/block/TileEntityAbstractLaser.java | 3 +-- .../warpdrive/block/TileEntityAirGenerator.java | 3 +-- .../warpdrive/block/TileEntityLaserMedium.java | 3 +-- .../block/building/TileEntityShipScanner.java | 3 +-- .../block/collection/TileEntityLaserTreeFarm.java | 3 +-- .../block/collection/TileEntityMiningLaser.java | 3 +-- .../block/detection/TileEntityCloakingCore.java | 3 +-- .../block/detection/TileEntityMonitor.java | 3 +-- .../block/detection/TileEntityRadar.java | 3 +-- .../energy/TileEntityIC2reactorLaserMonitor.java | 3 +-- .../warpdrive/block/movement/TileEntityLift.java | 3 +-- .../block/movement/TileEntityShipController.java | 3 +-- .../block/movement/TileEntityShipCore.java | 7 +++---- .../cr0s/warpdrive/block/passive/BlockAir.java | 15 +++++++-------- .../block/weapon/TileEntityLaserCamera.java | 3 +-- .../java/cr0s/warpdrive/event/LivingHandler.java | 3 +-- .../cr0s/warpdrive/network/PacketHandler.java | 5 ++--- .../java/cr0s/warpdrive/render/EntityCamera.java | 3 +-- .../java/cr0s/warpdrive/world/EntityStarCore.java | 3 +-- 21 files changed, 30 insertions(+), 51 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/EntityJump.java b/src/main/java/cr0s/warpdrive/EntityJump.java index e56b381e..804cd933 100644 --- a/src/main/java/cr0s/warpdrive/EntityJump.java +++ b/src/main/java/cr0s/warpdrive/EntityJump.java @@ -33,7 +33,6 @@ import net.minecraftforge.common.ForgeChunkManager; import net.minecraftforge.common.ForgeChunkManager.Ticket; import net.minecraftforge.common.ForgeChunkManager.Type; import net.minecraftforge.common.util.Constants; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.block.movement.TileEntityShipCore; import cr0s.warpdrive.config.Dictionary; @@ -163,7 +162,7 @@ public class EntityJump extends Entity { @Override public void onUpdate() { - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java index 6fe45c66..b2c6a15c 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java @@ -16,7 +16,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.StatCollector; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.config.WarpDriveConfig; import cr0s.warpdrive.data.UpgradeType; @@ -206,7 +205,7 @@ public abstract class TileEntityAbstractEnergy extends TileEntityAbstractInterfa public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractLaser.java b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractLaser.java index 3ac993a1..ff2cff50 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractLaser.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractLaser.java @@ -6,7 +6,6 @@ import java.util.List; import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.config.WarpDriveConfig; import dan200.computercraft.api.lua.ILuaContext; @@ -41,7 +40,7 @@ public abstract class TileEntityAbstractLaser extends TileEntityAbstractInterfac public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAirGenerator.java b/src/main/java/cr0s/warpdrive/block/TileEntityAirGenerator.java index 1539bc70..37aec795 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAirGenerator.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAirGenerator.java @@ -3,7 +3,6 @@ package cr0s.warpdrive.block; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.config.WarpDriveConfig; @@ -21,7 +20,7 @@ public class TileEntityAirGenerator extends TileEntityAbstractEnergy { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityLaserMedium.java b/src/main/java/cr0s/warpdrive/block/TileEntityLaserMedium.java index 442532c8..1416ecd5 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityLaserMedium.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityLaserMedium.java @@ -2,7 +2,6 @@ package cr0s.warpdrive.block; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cr0s.warpdrive.config.WarpDriveConfig; public class TileEntityLaserMedium extends TileEntityAbstractEnergy { @@ -16,7 +15,7 @@ public class TileEntityLaserMedium extends TileEntityAbstractEnergy { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/building/TileEntityShipScanner.java b/src/main/java/cr0s/warpdrive/block/building/TileEntityShipScanner.java index 0b84b26e..3199116d 100644 --- a/src/main/java/cr0s/warpdrive/block/building/TileEntityShipScanner.java +++ b/src/main/java/cr0s/warpdrive/block/building/TileEntityShipScanner.java @@ -18,7 +18,6 @@ import net.minecraft.nbt.NBTTagString; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.block.TileEntityAbstractEnergy; @@ -66,7 +65,7 @@ public class TileEntityShipScanner extends TileEntityAbstractEnergy { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) + if (worldObj.isRemote) return; if (++searchTicks > 20) { diff --git a/src/main/java/cr0s/warpdrive/block/collection/TileEntityLaserTreeFarm.java b/src/main/java/cr0s/warpdrive/block/collection/TileEntityLaserTreeFarm.java index 675be384..9d4bb3c9 100644 --- a/src/main/java/cr0s/warpdrive/block/collection/TileEntityLaserTreeFarm.java +++ b/src/main/java/cr0s/warpdrive/block/collection/TileEntityLaserTreeFarm.java @@ -9,7 +9,6 @@ import java.util.LinkedList; import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import net.minecraft.block.Block; import net.minecraft.inventory.IInventory; @@ -96,7 +95,7 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/collection/TileEntityMiningLaser.java b/src/main/java/cr0s/warpdrive/block/collection/TileEntityMiningLaser.java index ff6e5d0c..af030e4c 100644 --- a/src/main/java/cr0s/warpdrive/block/collection/TileEntityMiningLaser.java +++ b/src/main/java/cr0s/warpdrive/block/collection/TileEntityMiningLaser.java @@ -11,7 +11,6 @@ import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.config.Dictionary; @@ -68,7 +67,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractMiner { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/detection/TileEntityCloakingCore.java b/src/main/java/cr0s/warpdrive/block/detection/TileEntityCloakingCore.java index cb5ac22b..4ddb82ca 100644 --- a/src/main/java/cr0s/warpdrive/block/detection/TileEntityCloakingCore.java +++ b/src/main/java/cr0s/warpdrive/block/detection/TileEntityCloakingCore.java @@ -10,7 +10,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.block.TileEntityAbstractEnergy; @@ -64,7 +63,7 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/detection/TileEntityMonitor.java b/src/main/java/cr0s/warpdrive/block/detection/TileEntityMonitor.java index 16addfa1..3ae55847 100644 --- a/src/main/java/cr0s/warpdrive/block/detection/TileEntityMonitor.java +++ b/src/main/java/cr0s/warpdrive/block/detection/TileEntityMonitor.java @@ -5,7 +5,6 @@ import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.IVideoChannel; @@ -35,7 +34,7 @@ public class TileEntityMonitor extends TileEntityAbstractInterfaced implements I public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + if (!worldObj.isRemote) { packetSendTicks--; if (packetSendTicks <= 0) { packetSendTicks = PACKET_SEND_INTERVAL_TICKS; diff --git a/src/main/java/cr0s/warpdrive/block/detection/TileEntityRadar.java b/src/main/java/cr0s/warpdrive/block/detection/TileEntityRadar.java index 1b726df7..5e48a409 100644 --- a/src/main/java/cr0s/warpdrive/block/detection/TileEntityRadar.java +++ b/src/main/java/cr0s/warpdrive/block/detection/TileEntityRadar.java @@ -8,7 +8,6 @@ import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.block.TileEntityAbstractEnergy; @@ -45,7 +44,7 @@ public class TileEntityRadar extends TileEntityAbstractEnergy { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/energy/TileEntityIC2reactorLaserMonitor.java b/src/main/java/cr0s/warpdrive/block/energy/TileEntityIC2reactorLaserMonitor.java index 61654823..f5227f74 100644 --- a/src/main/java/cr0s/warpdrive/block/energy/TileEntityIC2reactorLaserMonitor.java +++ b/src/main/java/cr0s/warpdrive/block/energy/TileEntityIC2reactorLaserMonitor.java @@ -15,7 +15,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.block.TileEntityAbstractEnergy; import cr0s.warpdrive.config.WarpDriveConfig; @@ -120,7 +119,7 @@ public class TileEntityIC2reactorLaserMonitor extends TileEntityAbstractEnergy { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityLift.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityLift.java index 50786911..e1cceae3 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityLift.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityLift.java @@ -11,7 +11,6 @@ import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.block.TileEntityAbstractEnergy; import cr0s.warpdrive.config.WarpDriveConfig; @@ -49,7 +48,7 @@ public class TileEntityLift extends TileEntityAbstractEnergy { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java index 39563151..6c5cf824 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java @@ -11,7 +11,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; import net.minecraft.util.StatCollector; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.block.TileEntityAbstractInterfaced; @@ -86,7 +85,7 @@ public class TileEntityShipController extends TileEntityAbstractInterfaced { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java index b967d779..05cbda02 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java @@ -22,7 +22,6 @@ import net.minecraft.util.Vec3; import net.minecraft.world.WorldServer; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.FMLCommonHandler; import cr0s.warpdrive.EntityJump; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.block.TileEntityAbstractEnergy; @@ -106,7 +105,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy { public void updateEntity() { super.updateEntity(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } @@ -1130,7 +1129,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy { public void validate() { super.validate(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { return; } @@ -1139,7 +1138,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy { @Override public void invalidate() { - if (!FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (!worldObj.isRemote) { WarpDrive.starMap.removeFromRegistry(new StarMapEntry(this)); } super.invalidate(); diff --git a/src/main/java/cr0s/warpdrive/block/passive/BlockAir.java b/src/main/java/cr0s/warpdrive/block/passive/BlockAir.java index bbada216..cd71123d 100644 --- a/src/main/java/cr0s/warpdrive/block/passive/BlockAir.java +++ b/src/main/java/cr0s/warpdrive/block/passive/BlockAir.java @@ -2,7 +2,6 @@ package cr0s.warpdrive.block.passive; import java.util.Random; -import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -127,22 +126,22 @@ public class BlockAir extends Block { * Ticks the block if it's been scheduled */ @Override - public void updateTick(World par1World, int x, int y, int z, Random par5Random) { - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + public void updateTick(World world, int x, int y, int z, Random par5Random) { + if (world.isRemote) { return; } - int concentration = par1World.getBlockMetadata(x, y, z); - boolean isInSpaceWorld = par1World.provider.dimensionId == WarpDriveConfig.G_SPACE_DIMENSION_ID || par1World.provider.dimensionId == WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID; + int concentration = world.getBlockMetadata(x, y, z); + boolean isInSpaceWorld = world.provider.dimensionId == WarpDriveConfig.G_SPACE_DIMENSION_ID || world.provider.dimensionId == WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID; // Remove air block to vacuum block if (concentration <= 0 || !isInSpaceWorld) { - par1World.setBlock(x, y, z, Blocks.air, 0, 3); // replace our air block to vacuum block + world.setBlock(x, y, z, Blocks.air, 0, 3); // replace our air block to vacuum block } else { // Try to spread the air - spreadAirBlock(par1World, x, y, z, concentration); + spreadAirBlock(world, x, y, z, concentration); } - par1World.scheduleBlockUpdate(x, y, z, this, 30 + 2 * concentration); + world.scheduleBlockUpdate(x, y, z, this, 30 + 2 * concentration); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/weapon/TileEntityLaserCamera.java b/src/main/java/cr0s/warpdrive/block/weapon/TileEntityLaserCamera.java index 771c1494..38b9c8f1 100644 --- a/src/main/java/cr0s/warpdrive/block/weapon/TileEntityLaserCamera.java +++ b/src/main/java/cr0s/warpdrive/block/weapon/TileEntityLaserCamera.java @@ -6,7 +6,6 @@ import li.cil.oc.api.machine.Context; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraft.world.ChunkPosition; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.IVideoChannel; @@ -41,7 +40,7 @@ public class TileEntityLaserCamera extends TileEntityLaser implements IVideoChan super.updateEntity(); // Update video channel on clients (recovery mechanism, no need to go too fast) - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + if (!worldObj.isRemote) { packetSendTicks--; if (packetSendTicks <= 0) { packetSendTicks = PACKET_SEND_INTERVAL_TICKS; diff --git a/src/main/java/cr0s/warpdrive/event/LivingHandler.java b/src/main/java/cr0s/warpdrive/event/LivingHandler.java index 61a9a686..d09d53ed 100644 --- a/src/main/java/cr0s/warpdrive/event/LivingHandler.java +++ b/src/main/java/cr0s/warpdrive/event/LivingHandler.java @@ -15,7 +15,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingFallEvent; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.IBreathingHelmet; @@ -45,7 +44,7 @@ public class LivingHandler { @SubscribeEvent public void onLivingUpdate(LivingUpdateEvent event) { - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (event.entityLiving == null || event.entityLiving.worldObj.isRemote) { return; } diff --git a/src/main/java/cr0s/warpdrive/network/PacketHandler.java b/src/main/java/cr0s/warpdrive/network/PacketHandler.java index 5093469f..501d886f 100644 --- a/src/main/java/cr0s/warpdrive/network/PacketHandler.java +++ b/src/main/java/cr0s/warpdrive/network/PacketHandler.java @@ -12,7 +12,6 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; @@ -49,7 +48,7 @@ public class PacketHandler { // Beam effect sent to client side public static void sendBeamPacket(World worldObj, Vector3 source, Vector3 target, float red, float green, float blue, int age, int energy, int radius) { - assert(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER); + assert(!worldObj.isRemote); MessageBeamEffect beamMessage = new MessageBeamEffect(source, target, red, green, blue, age, energy); @@ -82,7 +81,7 @@ public class PacketHandler { } public static void sendBeamPacketToPlayersInArea(World worldObj, Vector3 source, Vector3 target, float red, float green, float blue, int age, int energy, AxisAlignedBB aabb) { - assert(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER); + assert(!worldObj.isRemote); MessageBeamEffect beamMessage = new MessageBeamEffect(source, target, red, green, blue, age, energy); // Send packet to all players within cloaked area diff --git a/src/main/java/cr0s/warpdrive/render/EntityCamera.java b/src/main/java/cr0s/warpdrive/render/EntityCamera.java index 8312388b..b1bb57b5 100644 --- a/src/main/java/cr0s/warpdrive/render/EntityCamera.java +++ b/src/main/java/cr0s/warpdrive/render/EntityCamera.java @@ -13,7 +13,6 @@ import net.minecraft.world.World; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; -import cpw.mods.fml.common.FMLCommonHandler; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.network.PacketHandler; @@ -65,7 +64,7 @@ public final class EntityCamera extends EntityLivingBase { @Override public void onEntityUpdate() { - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (worldObj.isRemote) { if (player == null || player.isDead) { WarpDrive.logger.error(this + " Player is null or dead, closing camera..."); closeCamera(); diff --git a/src/main/java/cr0s/warpdrive/world/EntityStarCore.java b/src/main/java/cr0s/warpdrive/world/EntityStarCore.java index bf98f75b..d9f932de 100644 --- a/src/main/java/cr0s/warpdrive/world/EntityStarCore.java +++ b/src/main/java/cr0s/warpdrive/world/EntityStarCore.java @@ -9,7 +9,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import cpw.mods.fml.common.FMLCommonHandler; import cr0s.warpdrive.WarpDrive; public final class EntityStarCore extends Entity @@ -119,7 +118,7 @@ public final class EntityStarCore extends Entity @Override public void onUpdate() { - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) + if (worldObj.isRemote) { return; }