diff --git a/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java b/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java index 83fe1e50..b48bfc36 100644 --- a/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java +++ b/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java @@ -52,6 +52,9 @@ public class mod_BuildCraftTransport extends NetworkMod implements IItemRenderer MinecraftForgeClient.registerItemRenderer( BuildCraftTransport.pipeItemsObsidian.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer( + BuildCraftTransport.pipeItemsSteel.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer( BuildCraftTransport.pipeLiquidsWood.shiftedIndex, this); MinecraftForgeClient.registerItemRenderer( diff --git a/common/net/minecraft/src/BuildCraftTransport.java b/common/net/minecraft/src/BuildCraftTransport.java index 3e6065ff..d4747961 100644 --- a/common/net/minecraft/src/BuildCraftTransport.java +++ b/common/net/minecraft/src/BuildCraftTransport.java @@ -44,6 +44,7 @@ import net.minecraft.src.buildcraft.transport.pipes.PipeItemsDiamond; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsGold; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsIron; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsObsidian; +import net.minecraft.src.buildcraft.transport.pipes.PipeItemsSteel; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsStone; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsStripes; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsWood; @@ -87,6 +88,8 @@ public class BuildCraftTransport { public static Item pipeItemsDiamond; public static Item pipeItemsObsidian; + public static Item pipeItemsSteel; + public static Item pipeLiquidsWood; public static Item pipeLiquidsCobblestone; public static Item pipeLiquidsStone; @@ -202,19 +205,21 @@ public class BuildCraftTransport { mod_BuildCraftTransport.registerTilePipe(TileGenericPipe.class, "net.minecraft.src.buildcraft.transport.GenericPipe"); - pipeItemsWood = createPipe (DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", Block.planks, Block.glass, Block.planks); + pipeItemsWood = createPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", Block.planks, Block.glass, Block.planks); pipeItemsCobblestone = createPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, "Cobblestone Transport Pipe", Block.cobblestone, Block.glass, Block.cobblestone); - pipeItemsStone = createPipe (DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", Block.stone, Block.glass, Block.stone); - pipeItemsIron = createPipe (DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron, Block.glass, Item.ingotIron); - pipeItemsGold = createPipe (DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, Block.glass, Item.ingotGold); - pipeItemsDiamond = createPipe (DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", Item.diamond, Block.glass, Item.diamond); - pipeItemsObsidian = createPipe (DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Block.obsidian, Block.glass, Block.obsidian); + pipeItemsStone = createPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", Block.stone, Block.glass, Block.stone); + pipeItemsIron = createPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron, Block.glass, Item.ingotIron); + pipeItemsGold = createPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, Block.glass, Item.ingotGold); + pipeItemsDiamond = createPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", Item.diamond, Block.glass, Item.diamond); + pipeItemsObsidian = createPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Block.obsidian, Block.glass, Block.obsidian); - pipeLiquidsWood = createPipe (DefaultProps.PIPE_LIQUIDS_WOOD_ID, PipeLiquidsWood.class, "Wooden Waterproof Pipe", pipeWaterproof, pipeItemsWood, null); - pipeLiquidsCobblestone = createPipe (DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, PipeLiquidsCobblestone.class, "Cobblestone Waterproof Pipe", pipeWaterproof, pipeItemsCobblestone, null); - pipeLiquidsStone = createPipe (DefaultProps.PIPE_LIQUIDS_STONE_ID, PipeLiquidsStone.class, "Stone Waterproof Pipe", pipeWaterproof, pipeItemsStone, null); - pipeLiquidsIron = createPipe (DefaultProps.PIPE_LIQUIDS_IRON_ID, PipeLiquidsIron.class, "Iron Waterproof Pipe", pipeWaterproof, pipeItemsIron, null); - pipeLiquidsGold = createPipe (DefaultProps.PIPE_LIQUIDS_GOLD_ID, PipeLiquidsGold.class, "Golden Waterproof Pipe", pipeWaterproof, pipeItemsGold, null); + pipeItemsSteel = createPipe(DefaultProps.PIPE_ITEMS_STEEL_ID, PipeItemsSteel.class, "Steel Transport Pipe", Item.clay, Block.glass, Item.clay); + + pipeLiquidsWood = createPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID, PipeLiquidsWood.class, "Wooden Waterproof Pipe", pipeWaterproof, pipeItemsWood, null); + pipeLiquidsCobblestone = createPipe(DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, PipeLiquidsCobblestone.class, "Cobblestone Waterproof Pipe", pipeWaterproof, pipeItemsCobblestone, null); + pipeLiquidsStone = createPipe(DefaultProps.PIPE_LIQUIDS_STONE_ID, PipeLiquidsStone.class, "Stone Waterproof Pipe", pipeWaterproof, pipeItemsStone, null); + pipeLiquidsIron = createPipe(DefaultProps.PIPE_LIQUIDS_IRON_ID, PipeLiquidsIron.class, "Iron Waterproof Pipe", pipeWaterproof, pipeItemsIron, null); + pipeLiquidsGold = createPipe(DefaultProps.PIPE_LIQUIDS_GOLD_ID, PipeLiquidsGold.class, "Golden Waterproof Pipe", pipeWaterproof, pipeItemsGold, null); // diamond // obsidian diff --git a/common/net/minecraft/src/buildcraft/core/DefaultProps.java b/common/net/minecraft/src/buildcraft/core/DefaultProps.java index 9156e734..20c81313 100644 --- a/common/net/minecraft/src/buildcraft/core/DefaultProps.java +++ b/common/net/minecraft/src/buildcraft/core/DefaultProps.java @@ -45,6 +45,7 @@ public class DefaultProps { public static int PIPE_ITEMS_GOLD_ID = 4054; public static int PIPE_ITEMS_DIAMOND_ID = 4055; public static int PIPE_ITEMS_OBSIDIAN_ID = 4056; + public static int PIPE_ITEMS_STEEL_ID = 4073; public static int PIPE_LIQUIDS_WOOD_ID = 4057; public static int PIPE_LIQUIDS_COBBLESTONE_ID = 4058; @@ -64,6 +65,8 @@ public class DefaultProps { public static int PIPE_ITEMS_STRIPES_ID = 4071; public static int PIPE_STRUCTURE_COBBLESTONE_ID = 4072; + + /// 4073 = PIPE_ITEMS_STEEL_ID public static int WOODEN_PIPE_ID = 145; // LEGACY public static int STONE_PIPE_ID = 146; // LEGACY diff --git a/common/net/minecraft/src/buildcraft/transport/PipeLogicSteel.java b/common/net/minecraft/src/buildcraft/transport/PipeLogicSteel.java new file mode 100644 index 00000000..0eec8bbf --- /dev/null +++ b/common/net/minecraft/src/buildcraft/transport/PipeLogicSteel.java @@ -0,0 +1,5 @@ +package net.minecraft.src.buildcraft.transport; + +public class PipeLogicSteel extends PipeLogic { + +} diff --git a/common/net/minecraft/src/buildcraft/transport/PipeTransportSecure.java b/common/net/minecraft/src/buildcraft/transport/PipeTransportSecure.java new file mode 100644 index 00000000..3a35a50d --- /dev/null +++ b/common/net/minecraft/src/buildcraft/transport/PipeTransportSecure.java @@ -0,0 +1,25 @@ +package net.minecraft.src.buildcraft.transport; + +import net.minecraft.src.IInventory; +import net.minecraft.src.TileEntity; +import net.minecraft.src.buildcraft.api.IPipeEntry; +import net.minecraft.src.buildcraft.core.IMachine; +import net.minecraft.src.buildcraft.core.utils.IOwnable; + +public class PipeTransportSecure extends PipeTransportItems { + + @Override + public boolean isPipeConnected(TileEntity tile) { + if(!(tile instanceof IOwnable)) + return false; + + IOwnable ownable = (IOwnable)tile; + return ownable.getOwnerName().equals(container.getOwnerName()); + } + + @Override + public boolean allowsConnect(PipeTransport with) { + return with instanceof PipeTransportSecure; + } + +} diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsSteel.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsSteel.java new file mode 100644 index 00000000..c0f25776 --- /dev/null +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsSteel.java @@ -0,0 +1,37 @@ +package net.minecraft.src.buildcraft.transport.pipes; + +import net.minecraft.src.buildcraft.api.Orientations; +import net.minecraft.src.buildcraft.transport.Pipe; +import net.minecraft.src.buildcraft.transport.PipeLogicSteel; +import net.minecraft.src.buildcraft.transport.PipeTransportSecure; + +public class PipeItemsSteel extends Pipe { + + private int baseTexture = 1 * 16 + 2; + private int plainTexture = 1 * 16 + 3; + private int nextTexture = baseTexture; + + public PipeItemsSteel(int itemID) { + super(new PipeTransportSecure(), new PipeLogicSteel(), itemID); + } + + @Override + public void prepareTextureFor(Orientations connection) { + if (connection == Orientations.Unknown) + nextTexture = baseTexture; + else { + int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + + if (metadata == connection.ordinal()) + nextTexture = baseTexture; + else + nextTexture = plainTexture; + } + } + + @Override + public int getMainBlockTexture() { + return nextTexture; + } + +}