diff --git a/common/buildcraft/core/EntityBlock.java b/common/buildcraft/core/EntityBlock.java index 2ca8871f..66d6fc67 100644 --- a/common/buildcraft/core/EntityBlock.java +++ b/common/buildcraft/core/EntityBlock.java @@ -19,7 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class EntityBlock extends Entity { @SideOnly(Side.CLIENT) - public Icon texture = null; + public Icon texture; public float shadowSize = 0; public float rotationX = 0; @@ -51,11 +51,6 @@ public class EntityBlock extends Entity { this.motionZ = 0.0; } - public EntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, Icon texture) { - this(world, i, j, k, iSize, jSize, kSize); - this.texture = texture; - } - @Override public void setPosition(double d, double d1, double d2) { super.setPosition(d, d1, d2); diff --git a/common/buildcraft/core/proxy/CoreProxy.java b/common/buildcraft/core/proxy/CoreProxy.java index 558b62b4..88da7541 100644 --- a/common/buildcraft/core/proxy/CoreProxy.java +++ b/common/buildcraft/core/proxy/CoreProxy.java @@ -28,6 +28,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.oredict.ShapedOreRecipe; +import buildcraft.api.core.LaserKind; +import buildcraft.core.EntityBlock; import buildcraft.core.ItemBlockBuildCraft; import buildcraft.core.network.BuildCraftPacket; import cpw.mods.fml.common.Loader; @@ -234,5 +236,8 @@ public class CoreProxy { return CoreProxy.buildCraftPlayer; } - + + public EntityBlock newEntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, LaserKind laserKind) { + return new EntityBlock(world, i, j, k, iSize, jSize, kSize); + } } diff --git a/common/buildcraft/core/proxy/CoreProxyClient.java b/common/buildcraft/core/proxy/CoreProxyClient.java index bdf36723..0e23290a 100644 --- a/common/buildcraft/core/proxy/CoreProxyClient.java +++ b/common/buildcraft/core/proxy/CoreProxyClient.java @@ -27,6 +27,7 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.StringTranslate; import net.minecraft.world.World; import buildcraft.BuildCraftCore; +import buildcraft.api.core.LaserKind; import buildcraft.core.EntityBlock; import buildcraft.core.EntityEnergyLaser; import buildcraft.core.EntityPowerLaser; @@ -169,5 +170,23 @@ public class CoreProxyClient extends CoreProxy { return CoreProxy.buildCraftPlayer; } + + @Override + public EntityBlock newEntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, LaserKind laserKind) { + EntityBlock eb = super.newEntityBlock(world, i, j, k, iSize, jSize, kSize, laserKind); + switch (laserKind) { + case Blue: + eb.texture = BuildCraftCore.blueLaserTexture; + break; + case Red: + eb.texture = BuildCraftCore.redLaserTexture; + break; + + case Stripes: + eb.texture = BuildCraftCore.stripesLaserTexture; + break; + } + return eb; + } } diff --git a/common/buildcraft/core/utils/Utils.java b/common/buildcraft/core/utils/Utils.java index 54eab2cb..fe02cdcc 100644 --- a/common/buildcraft/core/utils/Utils.java +++ b/common/buildcraft/core/utils/Utils.java @@ -21,7 +21,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; @@ -316,23 +315,7 @@ public class Utils { jSize = 0.10; } - Icon texture = BuildCraftCore.redLaserTexture; - - switch (kind) { - case Blue: - texture = BuildCraftCore.blueLaserTexture; - break; - - case Red: - texture = BuildCraftCore.redLaserTexture; - break; - - case Stripes: - texture = BuildCraftCore.stripesLaserTexture; - break; - } - - EntityBlock block = new EntityBlock(world, i, j, k, iSize, jSize, kSize, texture); + EntityBlock block = CoreProxy.proxy.newEntityBlock(world, i, j, k, iSize, jSize, kSize, kind); world.spawnEntityInWorld(block);