From 56a9ff0add560e96835410f9381fa1565b4fafc7 Mon Sep 17 00:00:00 2001 From: Henry Mao Date: Sat, 29 Dec 2012 23:58:16 +0800 Subject: [PATCH] Fixed textures --- .../assemblyline/client/ClientProxy.java | 1 + .../client/render/RenderFilterable.java | 4 ++-- .../assemblyline/common/AssemblyLine.java | 5 +++-- .../common/machine/TileEntityRejector.java | 2 +- .../machine/detector/TileEntityDetector.java | 2 +- .../common/machine/filter/BlockFilterable.java | 2 +- .../common/machine/filter/BlockImprinter.java | 15 ++++++++++++--- .../common/machine/filter/ContainerImprinter.java | 10 +++++----- .../{ItemFilter.java => ItemImprinter.java} | 11 +++++++---- .../machine/filter/TileEntityFilterable.java | 2 +- 10 files changed, 34 insertions(+), 20 deletions(-) rename src/minecraft/assemblyline/common/machine/filter/{ItemFilter.java => ItemImprinter.java} (89%) diff --git a/src/minecraft/assemblyline/client/ClientProxy.java b/src/minecraft/assemblyline/client/ClientProxy.java index 8157e4a0f..5711d0d4c 100644 --- a/src/minecraft/assemblyline/client/ClientProxy.java +++ b/src/minecraft/assemblyline/client/ClientProxy.java @@ -30,6 +30,7 @@ public class ClientProxy extends CommonProxy public void preInit() { MinecraftForgeClient.preloadTexture(AssemblyLine.BLOCK_TEXTURE_PATH); + MinecraftForgeClient.preloadTexture(AssemblyLine.ITEM_TEXTURE_PATH); RenderingRegistry.registerBlockHandler(new BlockRenderingHandler()); } diff --git a/src/minecraft/assemblyline/client/render/RenderFilterable.java b/src/minecraft/assemblyline/client/render/RenderFilterable.java index 7ccee14de..e9e40c264 100644 --- a/src/minecraft/assemblyline/client/render/RenderFilterable.java +++ b/src/minecraft/assemblyline/client/render/RenderFilterable.java @@ -10,7 +10,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import universalelectricity.core.vector.Vector3; -import assemblyline.common.machine.filter.ItemFilter; +import assemblyline.common.machine.filter.ItemImprinter; import assemblyline.common.machine.filter.TileEntityFilterable; /** @@ -36,7 +36,7 @@ public abstract class RenderFilterable extends TileEntitySpecialRenderer { if (objectPosition.blockX == tileFilterable.xCoord && objectPosition.blockY == tileFilterable.yCoord && objectPosition.blockZ == tileFilterable.zCoord) { - ArrayList filters = ItemFilter.getFilters(filter); + ArrayList filters = ItemImprinter.getFilters(filter); for (int i = 0; i < filters.size(); i++) { RenderHelper.renderFloatingText(filters.get(i).getTooltip(player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips).get(0).toString(), (float) x + 0.5f, ((float) y + (i * 0.25f)) - 1f, (float) z + 0.5f); diff --git a/src/minecraft/assemblyline/common/AssemblyLine.java b/src/minecraft/assemblyline/common/AssemblyLine.java index b40d2ede1..87a92ff17 100644 --- a/src/minecraft/assemblyline/common/AssemblyLine.java +++ b/src/minecraft/assemblyline/common/AssemblyLine.java @@ -20,7 +20,7 @@ import assemblyline.common.machine.BlockManipulator; import assemblyline.common.machine.belt.BlockConveyorBelt; import assemblyline.common.machine.detector.BlockDetector; import assemblyline.common.machine.filter.BlockImprinter; -import assemblyline.common.machine.filter.ItemFilter; +import assemblyline.common.machine.filter.ItemImprinter; import assemblyline.common.machine.machine.BlockRejector; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; @@ -54,6 +54,7 @@ public class AssemblyLine public static final String TEXTURE_PATH = RESOURCE_PATH + "textures/"; public static final String LANGUAGE_PATH = RESOURCE_PATH + "language/"; public static final String BLOCK_TEXTURE_PATH = TEXTURE_PATH + "blocks.png"; + public static final String ITEM_TEXTURE_PATH = TEXTURE_PATH + "items.png"; private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" }; @@ -87,7 +88,7 @@ public class AssemblyLine blockDetector = new BlockDetector(CONFIGURATION.getBlock("Detector", BLOCK_ID_PREFIX + 5).getInt(), 1); blockRejector = new BlockRejector(CONFIGURATION.getBlock("Rejector", BLOCK_ID_PREFIX + 6).getInt()); - itemFilter = new ItemFilter(CONFIGURATION.getBlock("Filter", ITEM_ID_PREFIX).getInt()); + itemFilter = new ItemImprinter(CONFIGURATION.getBlock("Filter", ITEM_ID_PREFIX).getInt()); CONFIGURATION.save(); NetworkRegistry.instance().registerGuiHandler(this, this.proxy); diff --git a/src/minecraft/assemblyline/common/machine/TileEntityRejector.java b/src/minecraft/assemblyline/common/machine/TileEntityRejector.java index a587b366e..1865d22f7 100644 --- a/src/minecraft/assemblyline/common/machine/TileEntityRejector.java +++ b/src/minecraft/assemblyline/common/machine/TileEntityRejector.java @@ -14,7 +14,7 @@ import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; import universalelectricity.prefab.TranslationHelper; import universalelectricity.prefab.network.PacketManager; -import assemblyline.common.machine.filter.ItemFilter; +import assemblyline.common.machine.filter.ItemImprinter; import assemblyline.common.machine.filter.TileEntityFilterable; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.PacketDispatcher; diff --git a/src/minecraft/assemblyline/common/machine/detector/TileEntityDetector.java b/src/minecraft/assemblyline/common/machine/detector/TileEntityDetector.java index 476ac8896..0c0b1f5ae 100644 --- a/src/minecraft/assemblyline/common/machine/detector/TileEntityDetector.java +++ b/src/minecraft/assemblyline/common/machine/detector/TileEntityDetector.java @@ -10,7 +10,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; import universalelectricity.prefab.network.PacketManager; import assemblyline.common.AssemblyLine; -import assemblyline.common.machine.filter.ItemFilter; +import assemblyline.common.machine.filter.ItemImprinter; import assemblyline.common.machine.filter.TileEntityFilterable; public class TileEntityDetector extends TileEntityFilterable diff --git a/src/minecraft/assemblyline/common/machine/filter/BlockFilterable.java b/src/minecraft/assemblyline/common/machine/filter/BlockFilterable.java index 3a1c9c15f..5b3385c16 100644 --- a/src/minecraft/assemblyline/common/machine/filter/BlockFilterable.java +++ b/src/minecraft/assemblyline/common/machine/filter/BlockFilterable.java @@ -55,7 +55,7 @@ public abstract class BlockFilterable extends BlockMachine { if (player.getCurrentEquippedItem() != null) { - if (player.getCurrentEquippedItem().getItem() instanceof ItemFilter) + if (player.getCurrentEquippedItem().getItem() instanceof ItemImprinter) { ((IFilterable) tileEntity).setFilter(player.getCurrentEquippedItem()); player.inventory.setInventorySlotContents(player.inventory.currentItem, null); diff --git a/src/minecraft/assemblyline/common/machine/filter/BlockImprinter.java b/src/minecraft/assemblyline/common/machine/filter/BlockImprinter.java index 0b43ebb22..3c3d37153 100644 --- a/src/minecraft/assemblyline/common/machine/filter/BlockImprinter.java +++ b/src/minecraft/assemblyline/common/machine/filter/BlockImprinter.java @@ -13,7 +13,7 @@ public class BlockImprinter extends BlockMachine public BlockImprinter(int id, int texture) { super(id, Material.wood); - this.blockIndexInTexture = 0; + this.blockIndexInTexture = 4; this.setBlockName("imprinter"); this.setCreativeTab(UETab.INSTANCE); this.setTextureFile(AssemblyLine.BLOCK_TEXTURE_PATH); @@ -22,9 +22,18 @@ public class BlockImprinter extends BlockMachine /** * Returns the block texture based on the side being looked at. Args: side */ - public int getBlockTextureFromSide(int par1) + public int getBlockTextureFromSide(int side) { - return this.blockIndexInTexture; + if (side == 0) + { + return this.blockIndexInTexture; + + } + else if (side == 1) { return this.blockIndexInTexture + 1; + + } + + return this.blockIndexInTexture + 2; } /** diff --git a/src/minecraft/assemblyline/common/machine/filter/ContainerImprinter.java b/src/minecraft/assemblyline/common/machine/filter/ContainerImprinter.java index 3e90f7679..5241422cc 100644 --- a/src/minecraft/assemblyline/common/machine/filter/ContainerImprinter.java +++ b/src/minecraft/assemblyline/common/machine/filter/ContainerImprinter.java @@ -202,11 +202,11 @@ public class ContainerImprinter extends Container implements IInventory, ISlotWa if (this.getStackInSlot(0) != null && this.getStackInSlot(1) != null) { - if (this.getStackInSlot(0).getItem() instanceof ItemFilter) + if (this.getStackInSlot(0).getItem() instanceof ItemImprinter) { ItemStack outputStack = this.getStackInSlot(0).copy(); outputStack.stackSize = 1; - ArrayList filters = ItemFilter.getFilters(outputStack); + ArrayList filters = ItemImprinter.getFilters(outputStack); boolean filteringItemExists = false; for (ItemStack filteredStack : filters) @@ -224,7 +224,7 @@ public class ContainerImprinter extends Container implements IInventory, ISlotWa filters.add(this.getStackInSlot(1)); } - ItemFilter.setFilters(outputStack, filters); + ItemImprinter.setFilters(outputStack, filters); this.setInventorySlotContents(2, outputStack); didStamp = true; } @@ -240,9 +240,9 @@ public class ContainerImprinter extends Container implements IInventory, ISlotWa if (this.getStackInSlot(3) != null) { - if (this.getStackInSlot(3).getItem() instanceof ItemFilter) + if (this.getStackInSlot(3).getItem() instanceof ItemImprinter) { - ArrayList filters = ItemFilter.getFilters(this.getStackInSlot(3)); + ArrayList filters = ItemImprinter.getFilters(this.getStackInSlot(3)); if (filters.size() > 0) { diff --git a/src/minecraft/assemblyline/common/machine/filter/ItemFilter.java b/src/minecraft/assemblyline/common/machine/filter/ItemImprinter.java similarity index 89% rename from src/minecraft/assemblyline/common/machine/filter/ItemFilter.java rename to src/minecraft/assemblyline/common/machine/filter/ItemImprinter.java index ffb9dd173..2b11eab56 100644 --- a/src/minecraft/assemblyline/common/machine/filter/ItemFilter.java +++ b/src/minecraft/assemblyline/common/machine/filter/ItemImprinter.java @@ -3,6 +3,8 @@ package assemblyline.common.machine.filter; import java.util.ArrayList; import java.util.List; +import assemblyline.common.AssemblyLine; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -10,15 +12,16 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import universalelectricity.prefab.UETab; -public class ItemFilter extends Item +public class ItemImprinter extends Item { - public ItemFilter(int id) + public ItemImprinter(int id) { super(id); - this.setItemName("filter"); - this.setIconIndex(58); + this.setItemName("imprint"); + this.setIconIndex(1); this.setCreativeTab(UETab.INSTANCE); this.setHasSubtypes(true); + this.setTextureFile(AssemblyLine.ITEM_TEXTURE_PATH); } @Override diff --git a/src/minecraft/assemblyline/common/machine/filter/TileEntityFilterable.java b/src/minecraft/assemblyline/common/machine/filter/TileEntityFilterable.java index f6b76834f..3e2f8da1d 100644 --- a/src/minecraft/assemblyline/common/machine/filter/TileEntityFilterable.java +++ b/src/minecraft/assemblyline/common/machine/filter/TileEntityFilterable.java @@ -36,7 +36,7 @@ public abstract class TileEntityFilterable extends TileEntityAssemblyNetwork imp { if (this.getFilter() != null && itemStack != null) { - ArrayList checkStacks = ItemFilter.getFilters(getFilter()); + ArrayList checkStacks = ItemImprinter.getFilters(getFilter()); if (checkStacks != null) {