diff --git a/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java b/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java index b48bfc36..08345c45 100644 --- a/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java +++ b/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java @@ -54,6 +54,8 @@ public class mod_BuildCraftTransport extends NetworkMod implements IItemRenderer MinecraftForgeClient.registerItemRenderer( BuildCraftTransport.pipeItemsSteel.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer( + BuildCraftTransport.pipeItemsRedstone.shiftedIndex, this); MinecraftForgeClient.registerItemRenderer( BuildCraftTransport.pipeLiquidsWood.shiftedIndex, this); diff --git a/common/net/minecraft/src/BuildCraftTransport.java b/common/net/minecraft/src/BuildCraftTransport.java index cd27c9ce..ff52114b 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.PipeItemsRedstone; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsSteel; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsStone; import net.minecraft.src.buildcraft.transport.pipes.PipeItemsStripes; @@ -89,6 +90,7 @@ public class BuildCraftTransport { public static Item pipeItemsObsidian; public static Item pipeItemsSteel; + public static Item pipeItemsRedstone; public static Item pipeLiquidsWood; public static Item pipeLiquidsCobblestone; @@ -214,6 +216,7 @@ public class BuildCraftTransport { pipeItemsObsidian = createPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Block.obsidian, Block.glass, Block.obsidian); pipeItemsSteel = createPipe(DefaultProps.PIPE_ITEMS_STEEL_ID, PipeItemsSteel.class, "Steel Transport Pipe", Item.clay, Block.glass, Item.clay); + pipeItemsRedstone = createPipe(DefaultProps.PIPE_ITEMS_REDSTONE_ID, PipeItemsRedstone.class, "Redstone Transport Pipe", Item.redstone, Block.glass, Item.redstone); 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); diff --git a/common/net/minecraft/src/buildcraft/core/utils/IOwnable.java b/common/net/minecraft/src/buildcraft/api/pipes/IOwnable.java similarity index 75% rename from common/net/minecraft/src/buildcraft/core/utils/IOwnable.java rename to common/net/minecraft/src/buildcraft/api/pipes/IOwnable.java index db3ec39b..8ce0b1a3 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/IOwnable.java +++ b/common/net/minecraft/src/buildcraft/api/pipes/IOwnable.java @@ -1,4 +1,4 @@ -package net.minecraft.src.buildcraft.core.utils; +package net.minecraft.src.buildcraft.api.pipes; import net.minecraft.src.EntityPlayer; diff --git a/common/net/minecraft/src/buildcraft/core/utils/ISecuredInventory.java b/common/net/minecraft/src/buildcraft/api/pipes/ISecuredInventory.java similarity index 74% rename from common/net/minecraft/src/buildcraft/core/utils/ISecuredInventory.java rename to common/net/minecraft/src/buildcraft/api/pipes/ISecuredInventory.java index d38e8b39..b1fcbfeb 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/ISecuredInventory.java +++ b/common/net/minecraft/src/buildcraft/api/pipes/ISecuredInventory.java @@ -1,12 +1,13 @@ -package net.minecraft.src.buildcraft.core.utils; +package net.minecraft.src.buildcraft.api.pipes; +import net.minecraft.src.EntityPlayer; import net.minecraft.src.ItemStack; import net.minecraft.src.buildcraft.api.ISpecialInventory; import net.minecraft.src.buildcraft.api.Orientations; public interface ISecuredInventory extends ISpecialInventory { - public String getOwnerName(); + boolean allowsInteraction(String username); public boolean addItem (ItemStack stack, boolean doAdd, Orientations from, String owner); public ItemStack extractItem(boolean doRemove, Orientations from, String owner); diff --git a/common/net/minecraft/src/buildcraft/core/DefaultProps.java b/common/net/minecraft/src/buildcraft/core/DefaultProps.java index 20c81313..579756c2 100644 --- a/common/net/minecraft/src/buildcraft/core/DefaultProps.java +++ b/common/net/minecraft/src/buildcraft/core/DefaultProps.java @@ -46,6 +46,7 @@ public class DefaultProps { 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_ITEMS_REDSTONE_ID = 4074; public static int PIPE_LIQUIDS_WOOD_ID = 4057; public static int PIPE_LIQUIDS_COBBLESTONE_ID = 4058; @@ -67,6 +68,7 @@ public class DefaultProps { public static int PIPE_STRUCTURE_COBBLESTONE_ID = 4072; /// 4073 = PIPE_ITEMS_STEEL_ID + /// 4074 = PIPE_ITEMS_REDSTONE_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/PipeTransportSecure.java b/common/net/minecraft/src/buildcraft/transport/PipeTransportSecure.java index fc913d4b..5fd633e9 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeTransportSecure.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeTransportSecure.java @@ -3,9 +3,9 @@ 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.api.pipes.IOwnable; +import net.minecraft.src.buildcraft.api.pipes.ISecuredInventory; import net.minecraft.src.buildcraft.core.IMachine; -import net.minecraft.src.buildcraft.core.utils.IOwnable; -import net.minecraft.src.buildcraft.core.utils.ISecuredInventory; public class PipeTransportSecure extends PipeTransportSolids { @@ -20,7 +20,8 @@ public class PipeTransportSecure extends PipeTransportSolids { if(tile instanceof ISecuredInventory) { ISecuredInventory inventory = (ISecuredInventory)tile; - return inventory.getOwnerName().equals(container.getOwnerName()); + if(inventory.allowsInteraction(container.getOwnerName())) + return true; } return false; @@ -32,9 +33,6 @@ public class PipeTransportSecure extends PipeTransportSolids { if(with instanceof PipeTransportSecure) return true; - if(with.container.pipe.logic instanceof PipeLogicWood) - return true; - return false; } diff --git a/common/net/minecraft/src/buildcraft/transport/TileGenericPipe.java b/common/net/minecraft/src/buildcraft/transport/TileGenericPipe.java index a3dd3b60..daa74873 100644 --- a/common/net/minecraft/src/buildcraft/transport/TileGenericPipe.java +++ b/common/net/minecraft/src/buildcraft/transport/TileGenericPipe.java @@ -34,6 +34,7 @@ import net.minecraft.src.buildcraft.api.PowerProvider; import net.minecraft.src.buildcraft.api.SafeTimeTracker; import net.minecraft.src.buildcraft.api.TileNetworkData; import net.minecraft.src.buildcraft.api.Trigger; +import net.minecraft.src.buildcraft.api.pipes.IOwnable; import net.minecraft.src.buildcraft.core.BlockIndex; import net.minecraft.src.buildcraft.core.CoreProxy; import net.minecraft.src.buildcraft.core.IDropControlInventory; @@ -47,7 +48,6 @@ import net.minecraft.src.buildcraft.core.network.PacketPayload; import net.minecraft.src.buildcraft.core.network.PacketPipeDescription; import net.minecraft.src.buildcraft.core.network.PacketTileUpdate; import net.minecraft.src.buildcraft.core.network.PacketUpdate; -import net.minecraft.src.buildcraft.core.utils.IOwnable; public class TileGenericPipe extends TileEntity implements IPowerReceptor, ILiquidContainer, ISpecialInventory, IPipeEntry, ISynchronizedTile, @@ -71,7 +71,8 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); - nbttagcompound.setString("owner", owner); + if(owner != null && !owner.isEmpty()) + nbttagcompound.setString("owner", owner); if (pipe != null) { nbttagcompound.setInteger("pipeId", pipe.itemID); pipe.writeToNBT(nbttagcompound); diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsRedstone.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsRedstone.java new file mode 100644 index 00000000..4fc43bcd --- /dev/null +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsRedstone.java @@ -0,0 +1,12 @@ +package net.minecraft.src.buildcraft.transport.pipes; + +import net.minecraft.src.buildcraft.transport.PipeTransportSecure; +import net.minecraft.src.buildcraft.transport.PipeTransportSolids; + +public class PipeItemsRedstone extends PipeItemsWood { + + public PipeItemsRedstone(int itemID) { + super(itemID, new PipeTransportSecure()); + } + +} diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsWood.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsWood.java index 9c049b0f..0d243032 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsWood.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsWood.java @@ -25,6 +25,7 @@ import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.buildcraft.transport.Pipe; import net.minecraft.src.buildcraft.transport.PipeLogicWood; import net.minecraft.src.buildcraft.transport.PipeTransportItems; +import net.minecraft.src.buildcraft.transport.PipeTransportSolids; import net.minecraft.src.forge.ISidedInventory; public class PipeItemsWood extends Pipe implements IPowerReceptor { @@ -35,7 +36,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor { private int plainTexture = 1 * 16 + 15; private int nextTexture = baseTexture; - protected PipeItemsWood(int itemID, PipeTransportItems transport) { + protected PipeItemsWood(int itemID, PipeTransportSolids transport) { super(transport, new PipeLogicWood(), itemID); powerProvider = PowerFramework.currentFramework.createPowerProvider(); @@ -122,7 +123,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor { EntityPassiveItem entity = new EntityPassiveItem(w, entityPos.x, entityPos.y, entityPos.z, stack); - ((PipeTransportItems) transport).entityEntering(entity, + ((PipeTransportSolids) transport).entityEntering(entity, entityPos.orientation); } }