From 5f504183821b2d48b1c9be11f6fcdce90623499f Mon Sep 17 00:00:00 2001 From: SpaceToad Date: Sun, 16 Mar 2014 14:15:00 +0100 Subject: [PATCH] minor fixes --- common/buildcraft/BuildCraftTransport.java | 1 - common/buildcraft/builders/RenderBuilder.java | 2 +- common/buildcraft/builders/TileBuilder.java | 9 +++++- common/buildcraft/core/Box.java | 28 +++++++++++++++++++ common/buildcraft/core/EntityLaser.java | 6 ++-- .../transport/TransportProxyClient.java | 1 + 6 files changed, 42 insertions(+), 5 deletions(-) diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index 68a9d7ef..fb797c1b 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -162,7 +162,6 @@ public class BuildCraftTransport extends BuildCraftMod { public static Item plugItem; public static Item robotStationItem; public static BlockFilteredBuffer filteredBufferBlock; - // public static Item pipeItemsStipes; public static Item pipeStructureCobblestone; public static int groupItemsTrigger; public static String[] facadeBlacklist; diff --git a/common/buildcraft/builders/RenderBuilder.java b/common/buildcraft/builders/RenderBuilder.java index c393af68..313432d3 100755 --- a/common/buildcraft/builders/RenderBuilder.java +++ b/common/buildcraft/builders/RenderBuilder.java @@ -43,7 +43,7 @@ public class RenderBuilder extends RenderBoxProvider { RenderLaser .doRenderLaser( TileEntityRendererDispatcher.instance.field_147553_e, - laser, EntityLaser.LASER_TEXTURES[3]); + laser, EntityLaser.LASER_TEXTURES[4]); GL11.glPopMatrix(); } } diff --git a/common/buildcraft/builders/TileBuilder.java b/common/buildcraft/builders/TileBuilder.java index d10b80a1..f0369c91 100644 --- a/common/buildcraft/builders/TileBuilder.java +++ b/common/buildcraft/builders/TileBuilder.java @@ -654,7 +654,14 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IM @Override public AxisAlignedBB getRenderBoundingBox() { - return new Box (this).extendToEncompass(box).getBoundingBox(); + Box renderBox = new Box (this).extendToEncompass(box); + + for (LaserData l : pathLasers) { + renderBox = renderBox.extendToEncompass(l.head); + renderBox = renderBox.extendToEncompass(l.tail); + } + + return renderBox.getBoundingBox(); } public void debugForceBlueprintCompletion () { diff --git a/common/buildcraft/core/Box.java b/common/buildcraft/core/Box.java index 99926764..8d778a65 100644 --- a/common/buildcraft/core/Box.java +++ b/common/buildcraft/core/Box.java @@ -321,4 +321,32 @@ public class Box implements IBox { return AxisAlignedBB.getBoundingBox(xMin, yMin, zMin, xMax, yMax, zMax); } + + public Box extendToEncompass(Position toBeContained) { + if (toBeContained.x < xMin) { + xMin = (int) toBeContained.x - 1; + } + + if (toBeContained.y < yMin) { + yMin = (int) toBeContained.y - 1; + } + + if (toBeContained.z < zMin) { + zMin = (int) toBeContained.z - 1; + } + + if (toBeContained.x > xMax) { + xMax = (int) toBeContained.x + 1; + } + + if (toBeContained.y > yMax) { + yMax = (int) toBeContained.y + 1; + } + + if (toBeContained.z > zMax) { + zMax = (int) toBeContained.z + 1; + } + + return this; + } } diff --git a/common/buildcraft/core/EntityLaser.java b/common/buildcraft/core/EntityLaser.java index b4a45755..906e93fc 100644 --- a/common/buildcraft/core/EntityLaser.java +++ b/common/buildcraft/core/EntityLaser.java @@ -20,7 +20,8 @@ public abstract class EntityLaser extends Entity { new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_1.png"), new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_2.png"), new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_3.png"), - new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_4.png")}; + new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_4.png"), + new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/stripes.png")}; public LaserData data = new LaserData(); @@ -63,8 +64,9 @@ public abstract class EntityLaser extends Entity { @Override public void onUpdate() { - if (data.head == null || data.tail == null) + if (data.head == null || data.tail == null) { return; + } if (!worldObj.isRemote && needsUpdate) { updateDataServer(); diff --git a/common/buildcraft/transport/TransportProxyClient.java b/common/buildcraft/transport/TransportProxyClient.java index edd6a7d2..9a0b456b 100644 --- a/common/buildcraft/transport/TransportProxyClient.java +++ b/common/buildcraft/transport/TransportProxyClient.java @@ -53,6 +53,7 @@ public class TransportProxyClient extends TransportProxy { MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsLapis, pipeItemRenderer); MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDaizuli, pipeItemRenderer); MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsEmzuli, pipeItemRenderer); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStripes, pipeItemRenderer); MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsWood, pipeItemRenderer); MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsCobblestone, pipeItemRenderer);