diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeAllDaizuli_solid.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeAllDaizuli_solid.png new file mode 100644 index 00000000..b3fc1e55 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeAllDaizuli_solid.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_black.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_black.png new file mode 100644 index 00000000..5b11202f Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_black.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_blue.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_blue.png new file mode 100644 index 00000000..82ed8bfb Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_blue.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_brown.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_brown.png new file mode 100644 index 00000000..934beba4 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_brown.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_cyan.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_cyan.png new file mode 100644 index 00000000..9b9091cd Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_cyan.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_gray.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_gray.png new file mode 100644 index 00000000..49184309 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_gray.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_green.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_green.png new file mode 100644 index 00000000..2ae2e5e9 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_green.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lightblue.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lightblue.png new file mode 100644 index 00000000..415f0e47 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lightblue.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lightgray.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lightgray.png new file mode 100644 index 00000000..8a4f2d25 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lightgray.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lime.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lime.png new file mode 100644 index 00000000..eb45a3bb Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_lime.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_magenta.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_magenta.png new file mode 100644 index 00000000..c3300589 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_magenta.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_orange.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_orange.png new file mode 100644 index 00000000..25779c36 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_orange.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_pink.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_pink.png new file mode 100644 index 00000000..581c5d4d Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_pink.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_purple.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_purple.png new file mode 100644 index 00000000..b57d9bb5 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_purple.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_red.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_red.png new file mode 100644 index 00000000..4a945764 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_red.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_white.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_white.png new file mode 100644 index 00000000..e39d7a08 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_white.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_yellow.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_yellow.png new file mode 100644 index 00000000..9c7c2a27 Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsDaizuli_yellow.png differ diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisBlack.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_black.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisBlack.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_black.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisBlue.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_blue.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisBlue.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_blue.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisBrown.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_brown.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisBrown.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_brown.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisCyan.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_cyan.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisCyan.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_cyan.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisGray.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_gray.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisGray.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_gray.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisGreen.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_green.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisGreen.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_green.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisLightBlue.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_lightblue.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisLightBlue.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_lightblue.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisLightGray.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_lightgray.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisLightGray.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_lightgray.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisLime.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_lime.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisLime.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_lime.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisMagenta.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_magenta.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisMagenta.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_magenta.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisOrange.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_orange.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisOrange.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_orange.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisPink.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_pink.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisPink.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_pink.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisPurple.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_purple.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisPurple.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_purple.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisRed.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_red.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisRed.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_red.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisWhite.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_white.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisWhite.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_white.png diff --git a/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisYellow.png b/buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_yellow.png similarity index 100% rename from buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapisYellow.png rename to buildcraft_resources/assets/buildcraft/textures/blocks/pipeItemsLapis_yellow.png diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index 9e5310bd..22d35e0b 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -49,6 +49,7 @@ import buildcraft.transport.pipes.PipeFluidsStone; import buildcraft.transport.pipes.PipeFluidsVoid; import buildcraft.transport.pipes.PipeFluidsWood; import buildcraft.transport.pipes.PipeItemsCobblestone; +import buildcraft.transport.pipes.PipeItemsDaizuli; import buildcraft.transport.pipes.PipeItemsDiamond; import buildcraft.transport.pipes.PipeItemsEmerald; import buildcraft.transport.pipes.PipeItemsGold; @@ -95,6 +96,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import net.minecraft.block.Block; import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.Configuration; @@ -123,6 +125,7 @@ public class BuildCraftTransport { public static Item pipeItemsDiamond; public static Item pipeItemsObsidian; public static Item pipeItemsLapis; + public static Item pipeItemsDaizuli; public static Item pipeItemsVoid; public static Item pipeItemsSandstone; public static Item pipeFluidsWood; @@ -266,7 +269,7 @@ public class BuildCraftTransport { pipeWaterproof.setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); LanguageRegistry.addName(pipeWaterproof, "Pipe Waterproof"); genericPipeBlock = new BlockGenericPipe(genericPipeId.getInt()); - GameRegistry.registerBlock(genericPipeBlock); + CoreProxy.proxy.registerBlock(genericPipeBlock.setUnlocalizedName("pipeBlock"), ItemBlock.class); // Fixing retro-compatiblity pipeItemsWood = buildPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", "plankWood", Block.glass, "plankWood"); @@ -278,7 +281,8 @@ public class BuildCraftTransport { pipeItemsGold = buildPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, Block.glass, Item.ingotGold); pipeItemsDiamond = buildPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", Item.diamond, Block.glass, Item.diamond); pipeItemsObsidian = buildPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Block.obsidian, Block.glass, Block.obsidian); - pipeItemsLapis = buildPipe(DefaultProps.PIPE_ITEMS_LAPIS_ID, PipeItemsLapis.class, "Lapis Transport Pipe", Block.blockLapis, Block.glass, Block.blockLapis); + pipeItemsLapis = buildPipe(DefaultProps.PIPE_ITEMS_LAPIS_ID, PipeItemsLapis.class, "Lapis Transport Pipe", Block.blockLapis, Block.glass, Block.blockLapis); + pipeItemsDaizuli = buildPipe(DefaultProps.PIPE_ITEMS_DAIZULI_ID, PipeItemsDaizuli.class, "Daizuli Transport Pipe", Block.blockLapis, Block.glass, Item.diamond); pipeItemsSandstone = buildPipe(DefaultProps.PIPE_ITEMS_SANDSTONE_ID, PipeItemsSandstone.class, "Sandstone Transport Pipe", Block.sandStone, Block.glass, Block.sandStone); pipeItemsVoid = buildPipe(DefaultProps.PIPE_ITEMS_VOID_ID, PipeItemsVoid.class, "Void Transport Pipe", "dyeBlack", Block.glass, Item.redstone); @@ -402,8 +406,8 @@ public class BuildCraftTransport { @EventHandler public void postInit(FMLPostInitializationEvent evt) { ItemFacade.initialize(); - - for(EnumColor color : EnumColor.VALUES){ + + for (EnumColor color : EnumColor.VALUES) { actionPipeColor[color.ordinal()] = new ActionPipeColor(-1, color); } } @@ -423,9 +427,9 @@ public class BuildCraftTransport { } CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1), - new Object[] { "wdw", "wcw", "wpw", Character.valueOf('w'), "plankWood", Character.valueOf('d'), - BuildCraftTransport.pipeItemsDiamond, Character.valueOf('c'), Block.chest, Character.valueOf('p'), - Block.pistonBase }); + new Object[]{"wdw", "wcw", "wpw", Character.valueOf('w'), "plankWood", Character.valueOf('d'), + BuildCraftTransport.pipeItemsDiamond, Character.valueOf('c'), Block.chest, Character.valueOf('p'), + Block.pistonBase}); //Facade turning helper GameRegistry.addRecipe(facadeItem.new FacadeRecipe()); diff --git a/common/buildcraft/core/DefaultProps.java b/common/buildcraft/core/DefaultProps.java index 7b103a44..32cfffd8 100644 --- a/common/buildcraft/core/DefaultProps.java +++ b/common/buildcraft/core/DefaultProps.java @@ -62,6 +62,7 @@ public class DefaultProps { public static int PIPE_ITEMS_EMERALD_ID = 19167; public static int PIPE_ITEMS_QUARTZ_ID = 19168; public static int PIPE_ITEMS_LAPIS_ID = 19169; + public static int PIPE_ITEMS_DAIZULI_ID = 19170; public static int PIPE_LIQUIDS_WOOD_ID = 19180; public static int PIPE_LIQUIDS_COBBLESTONE_ID = 19181; @@ -73,6 +74,7 @@ public class DefaultProps { public static int PIPE_LIQUIDS_EMERALD_ID = 19187; public static int PIPE_LIQUIDS_QUARTZ_ID = 19188; public static int PIPE_LIQUIDS_LAPIS_ID = 19189; + public static int PIPE_LIQUIDS_DIAZULI_ID = 19110; public static int PIPE_POWER_WOOD_ID = 19200; public static int PIPE_POWER_COBBLESTONE_ID = 19201; @@ -84,6 +86,7 @@ public class DefaultProps { public static int PIPE_POWER_EMERALD_ID = 19207; public static int PIPE_POWER_QUARTZ_ID = 19208; public static int PIPE_POWER_LAPIS_ID = 19209; + public static int PIPE_POWER_DIAZULI_ID = 19210; public static int PIPE_ITEMS_VOID_ID = 19220; public static int PIPE_LIQUIDS_VOID_ID = 19221; diff --git a/common/buildcraft/transport/IPipeTransportItemsHook.java b/common/buildcraft/transport/IPipeTransportItemsHook.java index d3e73464..68ca2f55 100644 --- a/common/buildcraft/transport/IPipeTransportItemsHook.java +++ b/common/buildcraft/transport/IPipeTransportItemsHook.java @@ -15,7 +15,7 @@ import net.minecraftforge.common.ForgeDirection; public interface IPipeTransportItemsHook { - public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, IPipedItem item); + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityData data); public void entityEntered(IPipedItem item, ForgeDirection orientation); diff --git a/common/buildcraft/transport/PipeIconProvider.java b/common/buildcraft/transport/PipeIconProvider.java index bcacef37..1f1714ec 100644 --- a/common/buildcraft/transport/PipeIconProvider.java +++ b/common/buildcraft/transport/PipeIconProvider.java @@ -22,22 +22,40 @@ public class PipeIconProvider implements IIconProvider { PipeItemsDiamond_West("pipeItemsDiamond_west"), PipeItemsDiamond_East("pipeItemsDiamond_east"), // - PipeItemsLapis_Black("pipeItemsLapisBlack"), - PipeItemsLapis_Red("pipeItemsLapisRed"), - PipeItemsLapis_Green("pipeItemsLapisGreen"), - PipeItemsLapis_Brown("pipeItemsLapisBrown"), - PipeItemsLapis_Blue("pipeItemsLapisBlue"), - PipeItemsLapis_Purple("pipeItemsLapisPurple"), - PipeItemsLapis_Cyan("pipeItemsLapisCyan"), - PipeItemsLapis_LightGray("pipeItemsLapisLightGray"), - PipeItemsLapis_Gray("pipeItemsLapisGray"), - PipeItemsLapis_Pink("pipeItemsLapisPink"), - PipeItemsLapis_Lime("pipeItemsLapisLime"), - PipeItemsLapis_Yellow("pipeItemsLapisYellow"), - PipeItemsLapis_LightBlue("pipeItemsLapisLightBlue"), - PipeItemsLapis_Magenta("pipeItemsLapisMagenta"), - PipeItemsLapis_Orange("pipeItemsLapisOrange"), - PipeItemsLapis_White("pipeItemsLapisWhite"), + PipeItemsLapis_Black("pipeItemsLapis_black"), + PipeItemsLapis_Red("pipeItemsLapis_red"), + PipeItemsLapis_Green("pipeItemsLapis_green"), + PipeItemsLapis_Brown("pipeItemsLapis_brown"), + PipeItemsLapis_Blue("pipeItemsLapis_blue"), + PipeItemsLapis_Purple("pipeItemsLapis_purple"), + PipeItemsLapis_Cyan("pipeItemsLapis_cyan"), + PipeItemsLapis_LightGray("pipeItemsLapis_lightgray"), + PipeItemsLapis_Gray("pipeItemsLapis_gray"), + PipeItemsLapis_Pink("pipeItemsLapis_pink"), + PipeItemsLapis_Lime("pipeItemsLapis_lime"), + PipeItemsLapis_Yellow("pipeItemsLapis_yellow"), + PipeItemsLapis_LightBlue("pipeItemsLapis_lightblue"), + PipeItemsLapis_Magenta("pipeItemsLapis_magenta"), + PipeItemsLapis_Orange("pipeItemsLapis_orange"), + PipeItemsLapis_White("pipeItemsLapis_white"), + // + PipeItemsDaizuli_Black("pipeItemsDaizuli_black"), + PipeItemsDaizuli_Red("pipeItemsDaizuli_red"), + PipeItemsDaizuli_Green("pipeItemsDaizuli_green"), + PipeItemsDaizuli_Brown("pipeItemsDaizuli_brown"), + PipeItemsDaizuli_Blue("pipeItemsDaizuli_blue"), + PipeItemsDaizuli_Purple("pipeItemsDaizuli_purple"), + PipeItemsDaizuli_Cyan("pipeItemsDaizuli_cyan"), + PipeItemsDaizuli_LightGray("pipeItemsDaizuli_lightgray"), + PipeItemsDaizuli_Gray("pipeItemsDaizuli_gray"), + PipeItemsDaizuli_Pink("pipeItemsDaizuli_pink"), + PipeItemsDaizuli_Lime("pipeItemsDaizuli_lime"), + PipeItemsDaizuli_Yellow("pipeItemsDaizuli_yellow"), + PipeItemsDaizuli_LightBlue("pipeItemsDaizuli_lightblue"), + PipeItemsDaizuli_Magenta("pipeItemsDaizuli_magenta"), + PipeItemsDaizuli_Orange("pipeItemsDaizuli_orange"), + PipeItemsDaizuli_White("pipeItemsDaizuli_white"), + PipeAllDaizuli_Solid("pipeAllDaizuli_solid"), // PipeItemsWood_Standard("pipeItemsWood_standard"), PipeAllWood_Solid("pipeAllWood_solid"), diff --git a/common/buildcraft/transport/PipeTransportItems.java b/common/buildcraft/transport/PipeTransportItems.java index 92b1913a..98300290 100644 --- a/common/buildcraft/transport/PipeTransportItems.java +++ b/common/buildcraft/transport/PipeTransportItems.java @@ -233,7 +233,7 @@ public class PipeTransportItems extends PipeTransport { if (this.container.pipe instanceof IPipeTransportItemsHook) { Position pos = new Position(container.xCoord, container.yCoord, container.zCoord, data.input); - result = ((IPipeTransportItemsHook) this.container.pipe).filterPossibleMovements(result, pos, data.item); + result = ((IPipeTransportItemsHook) this.container.pipe).filterPossibleMovements(result, pos, data); } return result; diff --git a/common/buildcraft/transport/TransportProxyClient.java b/common/buildcraft/transport/TransportProxyClient.java index 37371326..7c3ea24b 100644 --- a/common/buildcraft/transport/TransportProxyClient.java +++ b/common/buildcraft/transport/TransportProxyClient.java @@ -38,6 +38,7 @@ public class TransportProxyClient extends TransportProxy { MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsObsidian.itemID, pipeItemRenderer); MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsEmerald.itemID, pipeItemRenderer); MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsLapis.itemID, pipeItemRenderer); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDaizuli.itemID, pipeItemRenderer); MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsWood.itemID, pipeItemRenderer); MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsCobblestone.itemID, pipeItemRenderer); diff --git a/common/buildcraft/transport/pipes/PipeItemsDaizuli.java b/common/buildcraft/transport/pipes/PipeItemsDaizuli.java new file mode 100644 index 00000000..339bc158 --- /dev/null +++ b/common/buildcraft/transport/pipes/PipeItemsDaizuli.java @@ -0,0 +1,188 @@ +/** + * BuildCraft is open-source. It is distributed under the terms of the + * BuildCraft Open Source License. It grants rights to read, modify, compile or + * run the code. It does *NOT* grant the right to redistribute this software or + * its modifications in any form, binary or source, except if expressively + * granted by the copyright holder. + */ +package buildcraft.transport.pipes; + +import buildcraft.BuildCraftTransport; +import buildcraft.api.core.IIconProvider; +import buildcraft.api.core.Position; +import buildcraft.api.gates.IAction; +import buildcraft.api.tools.IToolWrench; +import buildcraft.core.network.TileNetworkData; +import buildcraft.core.utils.EnumColor; +import buildcraft.core.utils.Utils; +import buildcraft.transport.EntityData; +import buildcraft.transport.IPipeTransportItemsHook; +import buildcraft.transport.IPipedItem; +import buildcraft.transport.Pipe; +import buildcraft.transport.PipeIconProvider; +import buildcraft.transport.PipeTransportItems; +import buildcraft.transport.TileGenericPipe; +import buildcraft.transport.triggers.ActionPipeColor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; + +public class PipeItemsDaizuli extends Pipe implements IPipeTransportItemsHook { + + private int standardIconIndex = PipeIconProvider.TYPE.PipeItemsDaizuli_Black.ordinal(); + private int solidIconIndex = PipeIconProvider.TYPE.PipeAllDaizuli_Solid.ordinal(); + @TileNetworkData + private int color = EnumColor.WHITE.ordinal(); + private PipeLogicIron logic = new PipeLogicIron(this) { + @Override + protected boolean isValidFacing(ForgeDirection facing) { + TileEntity tile = pipe.container.getTile(facing); + if (tile instanceof TileGenericPipe) { + Pipe otherPipe = ((TileGenericPipe) tile).pipe; + if (otherPipe instanceof PipeItemsWood) + return false; + if (otherPipe.transport instanceof PipeTransportItems) + return true; + return false; + } + if (tile instanceof IInventory) + return true; + return false; + } + }; + + public PipeItemsDaizuli(int itemID) { + super(new PipeTransportItems(), itemID); + + transport.allowBouncing = true; + } + + public EnumColor getColor() { + return EnumColor.fromId(color); + } + + public void setColor(EnumColor c) { + if (color != c.ordinal()) { + this.color = c.ordinal(); + container.scheduleRenderUpdate(); + container.markBlockForUpdate(); + } + } + + @Override + public boolean blockActivated(EntityPlayer player) { + Item equipped = player.getCurrentEquippedItem() != null ? player.getCurrentEquippedItem().getItem() : null; + if (player.isSneaking() && equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(player, container.xCoord, container.yCoord, container.zCoord)) { + setColor(getColor().getNext()); + ((IToolWrench) equipped).wrenchUsed(player, container.xCoord, container.yCoord, container.zCoord); + return true; + } + + return logic.blockActivated(player); + } + + @Override + public void onNeighborBlockChange(int blockId) { + logic.onNeighborBlockChange(blockId); + super.onNeighborBlockChange(blockId); + } + + @Override + public void onBlockPlaced() { + logic.onBlockPlaced(); + super.onBlockPlaced(); + } + + @Override + public void initialize() { + logic.initialize(); + super.initialize(); + } + + @Override + public int getIconIndex(ForgeDirection direction) { + if (container != null && container.getBlockMetadata() == direction.ordinal()) + return solidIconIndex; + return standardIconIndex + color; + } + + @Override + @SideOnly(Side.CLIENT) + public IIconProvider getIconProvider() { + return BuildCraftTransport.instance.pipeIconProvider; + } + + @Override + public boolean canConnectRedstone() { + return true; + } + + @Override + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityData data) { + LinkedList newMovements = new LinkedList(); + EnumColor c = getColor(); + for (ForgeDirection dir : possibleOrientations) { + if (data.color == c) { + if (dir.ordinal() == container.getBlockMetadata()) + newMovements.add(dir); + } else if (dir.ordinal() != container.getBlockMetadata()) { + newMovements.add(dir); + } + } + return newMovements; + } + + @Override + public void entityEntered(IPipedItem item, ForgeDirection orientation) { + } + + @Override + public void readjustSpeed(IPipedItem item) { + if (item.getSpeed() > Utils.pipeNormalSpeed) { + item.setSpeed(item.getSpeed() - Utils.pipeNormalSpeed / 4.0F); + } + + if (item.getSpeed() < Utils.pipeNormalSpeed) { + item.setSpeed(Utils.pipeNormalSpeed); + } + } + + @Override + protected void actionsActivated(Map actions) { + super.actionsActivated(actions); + + for (Map.Entry action : actions.entrySet()) { + if (action.getKey() instanceof ActionPipeColor && action.getValue() != null && action.getValue()) { + setColor(((ActionPipeColor) action.getKey()).color); + break; + } + } + } + + @Override + public LinkedList getActions() { + LinkedList result = super.getActions(); + result.addAll(Arrays.asList(BuildCraftTransport.actionPipeColor)); + return result; + } + + @Override + public void writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setByte("color", (byte) color); + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + color = data.getByte("color"); + } +} diff --git a/common/buildcraft/transport/pipes/PipeItemsDiamond.java b/common/buildcraft/transport/pipes/PipeItemsDiamond.java index 980a071b..81433cd0 100644 --- a/common/buildcraft/transport/pipes/PipeItemsDiamond.java +++ b/common/buildcraft/transport/pipes/PipeItemsDiamond.java @@ -16,6 +16,7 @@ import buildcraft.core.inventory.SimpleInventory; import buildcraft.core.network.IClientState; import buildcraft.core.proxy.CoreProxy; import buildcraft.transport.BlockGenericPipe; +import buildcraft.transport.EntityData; import buildcraft.transport.IPipeTransportItemsHook; import buildcraft.transport.Pipe; import buildcraft.transport.PipeIconProvider; @@ -89,7 +90,7 @@ public class PipeItemsDiamond extends Pipe implements IPipeT } @Override - public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, IPipedItem item) { + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityData data) { LinkedList filteredOrientations = new LinkedList(); LinkedList defaultOrientations = new LinkedList(); @@ -107,10 +108,10 @@ public class PipeItemsDiamond extends Pipe implements IPipeT foundFilter = true; } - if (stack != null && stack.itemID == item.getItemStack().itemID) - if ((Item.itemsList[item.getItemStack().itemID].isDamageable())) { + if (stack != null && stack.itemID == data.item.getItemStack().itemID) + if ((Item.itemsList[data.item.getItemStack().itemID].isDamageable())) { filteredOrientations.add(dir); - } else if (stack.getItemDamage() == item.getItemStack().getItemDamage()) { + } else if (stack.getItemDamage() == data.item.getItemStack().getItemDamage()) { filteredOrientations.add(dir); } } diff --git a/common/buildcraft/transport/pipes/PipeItemsGold.java b/common/buildcraft/transport/pipes/PipeItemsGold.java index 2b905e81..1b326f66 100644 --- a/common/buildcraft/transport/pipes/PipeItemsGold.java +++ b/common/buildcraft/transport/pipes/PipeItemsGold.java @@ -12,6 +12,7 @@ import buildcraft.api.core.IIconProvider; import buildcraft.api.core.Position; import buildcraft.transport.IPipedItem; import buildcraft.core.utils.Utils; +import buildcraft.transport.EntityData; import buildcraft.transport.IPipeTransportItemsHook; import buildcraft.transport.Pipe; import buildcraft.transport.PipeIconProvider; @@ -39,7 +40,7 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook { } @Override - public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, IPipedItem item) { + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityData data) { return possibleOrientations; } diff --git a/common/buildcraft/transport/pipes/PipeItemsLapis.java b/common/buildcraft/transport/pipes/PipeItemsLapis.java index a11a1015..64253810 100644 --- a/common/buildcraft/transport/pipes/PipeItemsLapis.java +++ b/common/buildcraft/transport/pipes/PipeItemsLapis.java @@ -48,7 +48,7 @@ public class PipeItemsLapis extends Pipe implements IItemTra @Override public int getIconIndex(ForgeDirection direction) { - if (direction == ForgeDirection.UNKNOWN) + if (container == null) return PipeIconProvider.TYPE.PipeItemsLapis_White.ordinal(); return PipeIconProvider.TYPE.PipeItemsLapis_Black.ordinal() + container.getBlockMetadata(); } @@ -102,7 +102,7 @@ public class PipeItemsLapis extends Pipe implements IItemTra } @Override - public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, IPipedItem item) { + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityData data) { return possibleOrientations; } diff --git a/common/buildcraft/transport/pipes/PipeItemsQuartz.java b/common/buildcraft/transport/pipes/PipeItemsQuartz.java index f91d7061..5f8040a5 100644 --- a/common/buildcraft/transport/pipes/PipeItemsQuartz.java +++ b/common/buildcraft/transport/pipes/PipeItemsQuartz.java @@ -12,6 +12,7 @@ import buildcraft.api.core.IIconProvider; import buildcraft.api.core.Position; import buildcraft.transport.IPipedItem; import buildcraft.core.utils.Utils; +import buildcraft.transport.EntityData; import buildcraft.transport.IPipeTransportItemsHook; import buildcraft.transport.Pipe; import buildcraft.transport.PipeIconProvider; @@ -51,7 +52,7 @@ public class PipeItemsQuartz extends Pipe implements IPipeTransportItemsHook { } @Override - public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, IPipedItem item) { + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityData data) { return possibleOrientations; } diff --git a/common/buildcraft/transport/pipes/PipeItemsStone.java b/common/buildcraft/transport/pipes/PipeItemsStone.java index ec7a68c6..91843552 100644 --- a/common/buildcraft/transport/pipes/PipeItemsStone.java +++ b/common/buildcraft/transport/pipes/PipeItemsStone.java @@ -12,6 +12,7 @@ import buildcraft.api.core.IIconProvider; import buildcraft.api.core.Position; import buildcraft.transport.IPipedItem; import buildcraft.core.utils.Utils; +import buildcraft.transport.EntityData; import buildcraft.transport.IPipeTransportItemsHook; import buildcraft.transport.Pipe; import buildcraft.transport.PipeIconProvider; @@ -50,7 +51,7 @@ public class PipeItemsStone extends Pipe implements IPipeTransportItemsHook { } @Override - public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, IPipedItem item) { + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityData data) { return possibleOrientations; }