Initial iteration of steel pipe.

This commit is contained in:
SirSengir 2012-05-14 19:07:16 +02:00
parent 73e04b24b1
commit 2d1e11fc81
6 changed files with 89 additions and 11 deletions

View file

@ -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(

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,5 @@
package net.minecraft.src.buildcraft.transport;
public class PipeLogicSteel extends PipeLogic {
}

View file

@ -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;
}
}

View file

@ -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;
}
}