HDPE Blocks! 64 new cosmetic blocks for the low low price of just 4 new textures!

This commit is contained in:
Ben Spiers 2014-04-10 03:05:28 +01:00
parent 9e799ce603
commit 04668a16a0
21 changed files with 490 additions and 18 deletions

View file

@ -13,7 +13,7 @@ public enum EnumColor
DARK_BLUE("\u00a71", "darkBlue", new int[] {0, 0, 170}, 4),
DARK_GREEN("\u00a72", "darkGreen", new int[] {0, 170, 0}, 2),
DARK_AQUA("\u00a73", "darkAqua", new int[] {0, 170, 170}, 6),
DARK_RED("\u00a74", "darkRed", new int[] {170, 0, 0}, 1),
DARK_RED("\u00a74", "darkRed", new int[] {170, 0, 0}, -1),
PURPLE("\u00a75", "purple", new int[] {170, 0, 170}, 5),
ORANGE("\u00a76", "orange", new int[] {255, 170, 0}, 14),
GREY("\u00a77", "grey", new int[] {170, 170, 170}, 7),
@ -21,12 +21,15 @@ public enum EnumColor
INDIGO("\u00a79", "indigo", new int[] {85, 85, 255}, 12),
BRIGHT_GREEN("\u00a7a", "brightGreen", new int[] {85, 255, 85}, 10),
AQUA("\u00a7b", "aqua", new int[] {85, 255, 255}, -1),
RED("\u00a7c", "red", new int[] {255, 85, 85}, 13),
PINK("\u00a7d", "pink", new int[] {255, 85, 255}, 9),
RED("\u00a7c", "red", new int[] {255, 85, 85}, 1),
PINK("\u00a7d", "pink", new int[] {255, 85, 255}, 13),
YELLOW("\u00a7e", "yellow", new int[] {255, 255, 85}, 11),
WHITE("\u00a7f", "white", new int[] {255, 255, 255}, 15);
WHITE("\u00a7f", "white", new int[] {255, 255, 255}, 15),
//Extras for dye-completeness
BROWN("\u00a73", "brown", new int[] {150, 75, 0}, 3),
BRIGHT_PINK("\u00a7d", "brightPink", new int[] {255, 192, 203}, 9);
public static EnumColor[] DYES = new EnumColor[] {BLACK, DARK_RED, DARK_GREEN, null, DARK_BLUE, PURPLE, DARK_AQUA, GREY, DARK_GREY, PINK, BRIGHT_GREEN, YELLOW, INDIGO, RED, ORANGE, WHITE};
public static EnumColor[] DYES = new EnumColor[] {BLACK, RED, DARK_GREEN, BROWN, DARK_BLUE, PURPLE, DARK_AQUA, GREY, DARK_GREY, BRIGHT_PINK, BRIGHT_GREEN, YELLOW, INDIGO, PINK, ORANGE, WHITE};
/** The color code that will be displayed */
public final String code;
@ -55,6 +58,11 @@ public enum EnumColor
return StatCollector.translateToLocal("color." + unlocalizedName);
}
public String getDyeName()
{
return StatCollector.translateToLocal("dye." + unlocalizedName);
}
/**
* Gets the name of this color with it's color prefix code.
* @return the color's name and color prefix
@ -64,6 +72,11 @@ public enum EnumColor
return code + getLocalizedName();
}
public String getDyedName()
{
return code + getDyeName();
}
/**
* Gets the 0-1 of this color's RGB value by dividing by 255 (used for OpenGL coloring).
* @param index - R:0, G:1, B:2

View file

@ -70,6 +70,7 @@ import mekanism.client.render.tileentity.RenderGasTank;
import mekanism.client.render.tileentity.RenderLogisticalSorter;
import mekanism.client.render.tileentity.RenderMetallurgicInfuser;
import mekanism.client.render.tileentity.RenderObsidianTNT;
import mekanism.client.render.tileentity.RenderPlastic;
import mekanism.client.render.tileentity.RenderRotaryCondensentrator;
import mekanism.client.render.tileentity.RenderSalinationController;
import mekanism.client.render.tileentity.RenderTeleporter;
@ -117,12 +118,11 @@ import mekanism.common.tile.TileEntityMetallurgicInfuser;
import mekanism.common.tile.TileEntityObsidianTNT;
import mekanism.common.tile.TileEntityOsmiumCompressor;
import mekanism.common.tile.TileEntityPRC;
import mekanism.common.tile.TileEntityPlasticBlock;
import mekanism.common.tile.TileEntityPrecisionSawmill;
import mekanism.common.tile.TileEntityPurificationChamber;
import mekanism.common.tile.TileEntityRotaryCondensentrator;
import mekanism.common.tile.TileEntitySalinationController;
import mekanism.common.tile.TileEntitySalinationTank;
import mekanism.common.tile.TileEntitySalinationValve;
import mekanism.common.tile.TileEntitySeismicVibrator;
import mekanism.common.tile.TileEntityTeleporter;
import net.minecraft.client.Minecraft;
@ -312,13 +312,12 @@ public class ClientProxy extends CommonProxy
ClientRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityElectrolyticSeparator.class, "ElectrolyticSeparator", new RenderElectrolyticSeparator());
ClientRegistry.registerTileEntity(TileEntitySalinationController.class, "SalinationController", new RenderSalinationController());
GameRegistry.registerTileEntity(TileEntitySalinationValve.class, "SalinationValve");
GameRegistry.registerTileEntity(TileEntitySalinationTank.class, "SalinationTank");
ClientRegistry.registerTileEntity(TileEntityPrecisionSawmill.class, "PrecisionSawmill", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityChemicalDissolutionChamber.class, "ChemicalDissolutionChamber", new RenderChemicalDissolutionChamber());
ClientRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher", new RenderChemicalWasher());
ClientRegistry.registerTileEntity(TileEntityChemicalCrystalizer.class, "ChemicalCrystalizer", new RenderChemicalCrystalizer());
GameRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber");
ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityPlasticBlock.class, "PlasticBlock", new RenderPlastic());
}
@Override

View file

@ -286,8 +286,6 @@ public class RenderPartTransmitter implements IIconRegister
MekanismRenderer.glowOn(fluid.getLuminosity());
CCRenderState.changeTexture(MekanismRenderer.getBlocksTexture());
GL11.glTranslated(pos.x, pos.y, pos.z);
boolean gas = fluid.isGaseous();

View file

@ -0,0 +1,48 @@
package mekanism.client.render.tileentity;
import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.render.MekanismRenderer.Model3D;
import mekanism.common.Mekanism;
import mekanism.common.tile.TileEntityPlasticBlock;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderPlastic extends TileEntitySpecialRenderer
{
public static Model3D toRender;
static
{
toRender = new Model3D();
toRender.setBlockBounds(0,0,0,1,1,1);
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
{
renderAModelAt((TileEntityPlasticBlock) tileEntity, x, y, z, partialTick);
}
public void renderAModelAt(TileEntityPlasticBlock plastic, double x, double y, double z, float partialTick)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) x, (float) y, (float) z);
bindTexture(MekanismRenderer.getBlocksTexture());
toRender.setTexture(Mekanism.BlockHDPE.getBlockTexture(plastic.worldObj, plastic.xCoord, plastic.yCoord, plastic.zCoord, 0));
EnumColor color = EnumColor.DYES[plastic.colour];
float[] colour = {color.getColor(0), color.getColor(1), color.getColor(2)};
GL11.glColor3f(colour[0], colour[1], colour[2]);
RenderHelper.disableStandardItemLighting();
MekanismRenderer.renderObject(toRender);
GL11.glPopMatrix();
}
}

View file

@ -65,6 +65,7 @@ import mekanism.common.tile.TileEntityMetallurgicInfuser;
import mekanism.common.tile.TileEntityObsidianTNT;
import mekanism.common.tile.TileEntityOsmiumCompressor;
import mekanism.common.tile.TileEntityPRC;
import mekanism.common.tile.TileEntityPlasticBlock;
import mekanism.common.tile.TileEntityPrecisionSawmill;
import mekanism.common.tile.TileEntityPurificationChamber;
import mekanism.common.tile.TileEntityRotaryCondensentrator;
@ -125,12 +126,12 @@ public class CommonProxy
GameRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber");
GameRegistry.registerTileEntity(TileEntityElectrolyticSeparator.class, "ElectrolyticSeparator");
GameRegistry.registerTileEntity(TileEntitySalinationController.class, "SalinationController");
GameRegistry.registerTileEntity(TileEntitySalinationValve.class, "SalinationValve");
GameRegistry.registerTileEntity(TileEntitySalinationTank.class, "SalinationTank");
GameRegistry.registerTileEntity(TileEntityPrecisionSawmill.class, "PrecisionSawmill");
GameRegistry.registerTileEntity(TileEntityChemicalDissolutionChamber.class, "ChemicalDissolutionChamber");
GameRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher");
GameRegistry.registerTileEntity(TileEntityChemicalCrystalizer.class, "ChemicalCrystalizer");
GameRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber");
GameRegistry.registerTileEntity(TileEntityPlasticBlock.class, "PlasticBlock");
}
/**
@ -188,6 +189,8 @@ public class CommonProxy
Mekanism.energyCubeID = Mekanism.configuration.getBlock("EnergyCube", Mekanism.BLOCK_ID++).getInt();
Mekanism.gasTankID = Mekanism.configuration.getBlock("GasTank", Mekanism.BLOCK_ID++).getInt();
Mekanism.boundingBlockID = Mekanism.configuration.getBlock("BoundingBlock", Mekanism.BLOCK_ID++).getInt();
Mekanism.plasticID = Mekanism.configuration.getBlock("PlasticBlock", Mekanism.BLOCK_ID++).getInt();
Mekanism.plasticFenceID = Mekanism.configuration.getBlock("PlasticFenceBlock", Mekanism.BLOCK_ID++).getInt();
Mekanism.osmiumGenerationEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OsmiumGenerationEnabled", true).getBoolean(true);
Mekanism.copperGenerationEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "CopperGenerationEnabled", true).getBoolean(true);

View file

@ -48,6 +48,8 @@ import mekanism.common.block.BlockGasTank;
import mekanism.common.block.BlockMachine;
import mekanism.common.block.BlockObsidianTNT;
import mekanism.common.block.BlockOre;
import mekanism.common.block.BlockPlastic;
import mekanism.common.block.BlockPlasticFence;
import mekanism.common.entity.EntityBalloon;
import mekanism.common.entity.EntityObsidianTNT;
import mekanism.common.entity.EntityRobit;
@ -61,6 +63,7 @@ import mekanism.common.item.ItemBlockEnergyCube;
import mekanism.common.item.ItemBlockGasTank;
import mekanism.common.item.ItemBlockMachine;
import mekanism.common.item.ItemBlockOre;
import mekanism.common.item.ItemBlockPlastic;
import mekanism.common.item.ItemClump;
import mekanism.common.item.ItemConfigurator;
import mekanism.common.item.ItemCrystal;
@ -72,6 +75,7 @@ import mekanism.common.item.ItemEnergized;
import mekanism.common.item.ItemFilterCard;
import mekanism.common.item.ItemFreeRunners;
import mekanism.common.item.ItemGasMask;
import mekanism.common.item.ItemHDPE;
import mekanism.common.item.ItemIngot;
import mekanism.common.item.ItemJetpack;
import mekanism.common.item.ItemMachineUpgrade;
@ -121,6 +125,8 @@ import mekanism.common.tile.TileEntityBoundingBlock;
import mekanism.common.tile.TileEntityCardboardBox;
import mekanism.common.tile.TileEntityElectricBlock;
import mekanism.common.tile.TileEntityEnergizedSmelter;
import mekanism.common.tile.TileEntitySalinationTank;
import mekanism.common.tile.TileEntitySalinationValve;
import mekanism.common.tile.TileEntitySeismicVibrator;
import mekanism.common.transporter.TransporterManager;
import mekanism.common.util.MekanismUtils;
@ -241,7 +247,9 @@ public class Mekanism
public static int boundingBlockID;
public static int gasTankID;
public static int cardboardBoxID;
public static int plasticID;
public static int plasticFenceID;
//Items
public static ItemElectricBow ElectricBow;
public static Item EnrichedAlloy;
@ -290,6 +298,8 @@ public class Mekanism
public static Block BoundingBlock;
public static Block GasTank;
public static Block CardboardBox;
public static Block BlockHDPE;
public static Block BlockHDPEFence;
//Multi-ID Items
public static Item Dust;
@ -640,6 +650,15 @@ public class Mekanism
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(PartTransmitter, 2, 8), new Object[] {
"RRR", "SBS", "RRR", Character.valueOf('R'), Item.redstone, Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Block.fenceIron
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Polyethene, 1, 1), new Object[] {
"PP", "PP", "PP", Character.valueOf('P'), new ItemStack(Polyethene, 1, 0)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Polyethene, 1, 2), new Object[] {
"PPP", "P P", "PPP", Character.valueOf('P'), new ItemStack(Polyethene, 1, 0)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Polyethene, 1, 3), new Object[] {
"R", "R", Character.valueOf('R'), new ItemStack(Polyethene, 1, 1)
}));
for(int i = 0; i < EnumColor.DYES.length; i++)
{
@ -878,7 +897,7 @@ public class Mekanism
Balloon = new ItemBalloon(configuration.getItem("Balloon", ITEM_ID++).getInt()).setUnlocalizedName("Balloon");
ItemProxy = new ItemProxy(configuration.getItem("ItemProxy", ITEM_ID++).getInt()).setUnlocalizedName("ItemProxy");
Substrate = new ItemMekanism(configuration.getItem("Substrate", ITEM_ID++).getInt()).setUnlocalizedName("Substrate");
Polyethene = new ItemMekanism(configuration.getItem("HDPE", ITEM_ID++).getInt()).setUnlocalizedName("HDPE");
Polyethene = new ItemHDPE(configuration.getItem("HDPE", ITEM_ID++).getInt()).setUnlocalizedName("HDPE");
BioFuel = new ItemMekanism(Mekanism.configuration.getItem("BioFuel", ITEM_ID++).getInt()).setUnlocalizedName("BioFuel");
configuration.save();
@ -945,7 +964,9 @@ public class Mekanism
BoundingBlock = (BlockBounding) new BlockBounding(boundingBlockID).setUnlocalizedName("BoundingBlock");
GasTank = new BlockGasTank(gasTankID).setUnlocalizedName("GasTank");
CardboardBox = new BlockCardboardBox(cardboardBoxID).setUnlocalizedName("CardboardBox");
BlockHDPE = new BlockPlastic(plasticID).setUnlocalizedName("PlasticBlock");
BlockHDPEFence = new BlockPlasticFence(plasticFenceID).setUnlocalizedName("PlasticFence");
//Registrations
GameRegistry.registerBlock(BasicBlock, ItemBlockBasic.class, "BasicBlock");
GameRegistry.registerBlock(BasicBlock2, ItemBlockBasic.class, "BasicBlock2");
@ -957,6 +978,8 @@ public class Mekanism
GameRegistry.registerBlock(BoundingBlock, "BoundingBlock");
GameRegistry.registerBlock(GasTank, ItemBlockGasTank.class, "GasTank");
GameRegistry.registerBlock(CardboardBox, ItemBlockCardboardBox.class, "CardboardBox");
GameRegistry.registerBlock(BlockHDPE, ItemBlockPlastic.class, "PlasticBlock");
GameRegistry.registerBlock(BlockHDPEFence, "PlasticFence");
}
/**
@ -1118,7 +1141,9 @@ public class Mekanism
GameRegistry.registerTileEntity(TileEntityAdvancedBoundingBlock.class, "AdvancedBoundingBlock");
GameRegistry.registerTileEntity(TileEntityCardboardBox.class, "CardboardBox");
GameRegistry.registerTileEntity(TileEntitySeismicVibrator.class, "SeismicVibrator");
GameRegistry.registerTileEntity(TileEntitySalinationValve.class, "SalinationValve");
GameRegistry.registerTileEntity(TileEntitySalinationTank.class, "SalinationTank");
//Load tile entities that have special renderers.
proxy.registerSpecialTileEntities();
}

View file

@ -0,0 +1,127 @@
package mekanism.common.block;
import java.util.List;
import mekanism.common.Mekanism;
import mekanism.common.tile.TileEntityPlasticBlock;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPlastic extends Block
{
public Icon[] icons = new Icon[256];
public int numColours = 16;
public String[] names = {"PlasticBlock", "SlickPlasticBlock", "GlowPlasticBlock", "ReinforcedPlasticBlock"};
public BlockPlastic(int id)
{
super(id, Material.clay);
setHardness(5F);
setResistance(10F);
setCreativeTab(Mekanism.tabMekanism);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister register)
{
icons[0] = register.registerIcon("mekanism:PlasticBlock");
icons[1] = register.registerIcon("mekanism:SlickPlasticBlock");
icons[2] = register.registerIcon("mekanism:GlowPlasticBlock");
icons[3] = register.registerIcon("mekanism:ReinforcedPlasticBlock");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
{
return icons[world.getBlockMetadata(x,y,z)];
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int side, int meta)
{
return icons[meta>>4];
}
@Override
public int damageDropped(int i)
{
return i;
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(int id, CreativeTabs creativetabs, List list)
{
for(int i = 0; i < numColours*4; i++)
{
list.add(new ItemStack(id, 1, i));
}
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public int getRenderType()
{
return -1;
}
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z)
{
int metadata = world.getBlockMetadata(x, y, z);
if(metadata == 2)
{
return 10;
}
return 0;
}
@Override
public boolean hasTileEntity(int metadata)
{
return true;
}
@Override
public TileEntity createTileEntity(World world, int metadata)
{
return new TileEntityPlasticBlock();
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
TileEntityPlasticBlock tile = (TileEntityPlasticBlock)world.getBlockTileEntity(x, y, z);
return new ItemStack(blockID, 1, tile.getItemMeta());
}
}

View file

@ -0,0 +1,15 @@
package mekanism.common.block;
import mekanism.common.Mekanism;
import net.minecraft.block.BlockFence;
import net.minecraft.block.material.Material;
public class BlockPlasticFence extends BlockFence
{
public BlockPlasticFence(int id)
{
super(id, "mekanism:PlasticFence", Material.clay);
setCreativeTab(Mekanism.tabMekanism);
}
}

View file

@ -0,0 +1,92 @@
package mekanism.common.item;
import java.util.List;
import mekanism.api.EnumColor;
import mekanism.common.tile.TileEntityPlasticBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBlockPlastic extends ItemBlock
{
public Block metaBlock;
public ItemBlockPlastic(int id, Block block)
{
super(id);
metaBlock = block;
setHasSubtypes(true);
}
@Override
public int getMetadata(int i)
{
return i >> 4;
}
@Override
public Icon getIconFromDamage(int i)
{
return metaBlock.getIcon(2, i >> 4);
}
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
switch(itemstack.getItemDamage() >> 4)
{
case 0:
name = "PlasticBlock";
break;
case 1:
name = "SlickPlasticBlock";
break;
case 2:
name = "GlowPlasticBlock";
break;
case 3:
name = "ReinforcedPlasticBlock";
break;
default:
name = "Unknown";
break;
}
return getUnlocalizedName() + "." + name;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean flag)
{
EnumColor colour = EnumColor.DYES[stack.getItemDamage()&15];
info.add(colour.getDyedName());
}
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
{
if(super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata))
{
TileEntity tile = world.getBlockTileEntity(x, y, z);
if(tile instanceof TileEntityPlasticBlock)
{
((TileEntityPlasticBlock)tile).setColour(stack.getItemDamage() & 15);
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,72 @@
package mekanism.common.item;
import java.util.List;
import mekanism.common.Mekanism;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
public class ItemHDPE extends ItemMekanism
{
public Icon[] icons = new Icon[256];
public ItemHDPE(int id)
{
super(id);
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@Override
public void registerIcons(IconRegister register)
{
for(int i = 0; i < PlasticItem.values().length; i++)
{
icons[i] = register.registerIcon("mekanism:" + PlasticItem.values()[i].getName());
}
}
@Override
public Icon getIconFromDamage(int meta)
{
return icons[meta];
}
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
{
for(int counter = 0; counter < PlasticItem.values().length; counter++)
{
itemList.add(new ItemStack(this, 1, counter));
}
}
@Override
public String getUnlocalizedName(ItemStack item)
{
return "item." + PlasticItem.values()[item.getItemDamage()].getName();
}
public enum PlasticItem
{
PELLET("HDPEPellet"),
ROD("HDPERod"),
SHEET("HDPESheet"),
STICK("PlaStick");
private String name;
private PlasticItem(String itemName)
{
name = itemName;
}
public String getName()
{
return name;
}
}
}

View file

@ -0,0 +1,68 @@
package mekanism.common.tile;
import java.util.ArrayList;
import mekanism.api.Coord4D;
import mekanism.common.ITileNetwork;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketDataRequest;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityPlasticBlock extends TileEntity implements ITileNetwork
{
public int colour;
public int getItemMeta()
{
return getBlockMetadata()*16+colour;
}
public void setColour(int newColour)
{
colour = newColour;
}
@Override
public void validate()
{
super.validate();
if(worldObj.isRemote)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDataRequest().setParams(Coord4D.get(this)));
}
}
@Override
public void handlePacketData(ByteArrayDataInput dataStream) throws Exception
{
colour = dataStream.readInt();
}
@Override
public ArrayList getNetworkedData(ArrayList data)
{
data.add(colour);
return data;
}
@Override
public void readFromNBT(NBTTagCompound nbtTagCompound)
{
super.readFromNBT(nbtTagCompound);
colour = nbtTagCompound.getInteger("colour");
}
@Override
public void writeToNBT(NBTTagCompound nbtTagCompound)
{
super.writeToNBT(nbtTagCompound);
nbtTagCompound.setInteger("colour", colour);
}
}

View file

@ -35,6 +35,11 @@ item.FreeRunners.name=Free Runners
item.ArmoredJetpack.name=Armored Jetpack
item.FilterCard.name=Filter Card
item.SeismicReader.name=Seismic Reader
item.HDPEPellet.name=HDPE Pellet
item.HDPERod.name=HDPE Rod
item.HDPESheet.name=HDPE Sheet
item.PlaStick.name=PlaStick
item.Substrate.name=Substrate
//Gas Tank
tile.GasTank.GasTank.name=Gas Tank
@ -93,6 +98,7 @@ tile.MachineBlock2.ChemicalDissolutionChamber.name=Chemical Dissolution Chamber
tile.MachineBlock2.ChemicalWasher.name=Chemical Washer
tile.MachineBlock2.ChemicalCrystalizer.name=Chemical Crystalizer
tile.MachineBlock2.SeismicVibrator.name=Seismic Vibrator
tile.MachineBlock2.PressurizedReactionChamber.name=Pressurized Reaction Chamber
//Infuse types
infuse.carbon=Carbon
@ -198,6 +204,7 @@ gas.sulfuricAcid=Sulfuric Acid
gas.hydrogenChloride=Hydrogen Chloride
gas.liquidOsmium=Liquid Osmium
gas.liquidStone=Liquid Stone
gas.ethene=Ethylene
gas.iron=Iron Slurry
gas.gold=Gold Slurry
@ -217,6 +224,10 @@ gas.cleanSilver=Clean Silver Slurry
gas.cleanObsidian=Clean Obsidian Slurry
gas.cleanLead=Clean Lead Slurry
//BC Fuel Gases
gas.fuel=Vaporized Fuel
gas.oil=Vaporized Oil
//Fluids
fluid.hydrogen=Liquid Hydrogen
fluid.oxygen=Liquid Oxygen
@ -226,6 +237,7 @@ fluid.sulfurTrioxideGas=Liquid Sulfur Trioxide
fluid.sulfuricAcid=Liquid Sulfuric Acid
fluid.hydrogenChloride=Liquid Hydrogen Chloride
fluid.brine=Brine
fluid.ethene=Liquid Ethylene
//OreGas names
oregas.iron=Iron Ore

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B