Fixed textures

This commit is contained in:
Henry Mao 2012-12-29 23:58:16 +08:00
parent 9cc32fd692
commit 56a9ff0add
10 changed files with 34 additions and 20 deletions

View file

@ -30,6 +30,7 @@ public class ClientProxy extends CommonProxy
public void preInit() public void preInit()
{ {
MinecraftForgeClient.preloadTexture(AssemblyLine.BLOCK_TEXTURE_PATH); MinecraftForgeClient.preloadTexture(AssemblyLine.BLOCK_TEXTURE_PATH);
MinecraftForgeClient.preloadTexture(AssemblyLine.ITEM_TEXTURE_PATH);
RenderingRegistry.registerBlockHandler(new BlockRenderingHandler()); RenderingRegistry.registerBlockHandler(new BlockRenderingHandler());
} }

View file

@ -10,7 +10,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.Vector3;
import assemblyline.common.machine.filter.ItemFilter; import assemblyline.common.machine.filter.ItemImprinter;
import assemblyline.common.machine.filter.TileEntityFilterable; 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) if (objectPosition.blockX == tileFilterable.xCoord && objectPosition.blockY == tileFilterable.yCoord && objectPosition.blockZ == tileFilterable.zCoord)
{ {
ArrayList<ItemStack> filters = ItemFilter.getFilters(filter); ArrayList<ItemStack> filters = ItemImprinter.getFilters(filter);
for (int i = 0; i < filters.size(); i++) 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); 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);

View file

@ -20,7 +20,7 @@ import assemblyline.common.machine.BlockManipulator;
import assemblyline.common.machine.belt.BlockConveyorBelt; import assemblyline.common.machine.belt.BlockConveyorBelt;
import assemblyline.common.machine.detector.BlockDetector; import assemblyline.common.machine.detector.BlockDetector;
import assemblyline.common.machine.filter.BlockImprinter; 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 assemblyline.common.machine.machine.BlockRejector;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod; 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 TEXTURE_PATH = RESOURCE_PATH + "textures/";
public static final String LANGUAGE_PATH = RESOURCE_PATH + "language/"; public static final String LANGUAGE_PATH = RESOURCE_PATH + "language/";
public static final String BLOCK_TEXTURE_PATH = TEXTURE_PATH + "blocks.png"; 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" }; 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); blockDetector = new BlockDetector(CONFIGURATION.getBlock("Detector", BLOCK_ID_PREFIX + 5).getInt(), 1);
blockRejector = new BlockRejector(CONFIGURATION.getBlock("Rejector", BLOCK_ID_PREFIX + 6).getInt()); 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(); CONFIGURATION.save();
NetworkRegistry.instance().registerGuiHandler(this, this.proxy); NetworkRegistry.instance().registerGuiHandler(this, this.proxy);

View file

@ -14,7 +14,7 @@ import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.Vector3;
import universalelectricity.prefab.TranslationHelper; import universalelectricity.prefab.TranslationHelper;
import universalelectricity.prefab.network.PacketManager; import universalelectricity.prefab.network.PacketManager;
import assemblyline.common.machine.filter.ItemFilter; import assemblyline.common.machine.filter.ItemImprinter;
import assemblyline.common.machine.filter.TileEntityFilterable; import assemblyline.common.machine.filter.TileEntityFilterable;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.PacketDispatcher;

View file

@ -10,7 +10,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import universalelectricity.prefab.network.PacketManager; import universalelectricity.prefab.network.PacketManager;
import assemblyline.common.AssemblyLine; import assemblyline.common.AssemblyLine;
import assemblyline.common.machine.filter.ItemFilter; import assemblyline.common.machine.filter.ItemImprinter;
import assemblyline.common.machine.filter.TileEntityFilterable; import assemblyline.common.machine.filter.TileEntityFilterable;
public class TileEntityDetector extends TileEntityFilterable public class TileEntityDetector extends TileEntityFilterable

View file

@ -55,7 +55,7 @@ public abstract class BlockFilterable extends BlockMachine
{ {
if (player.getCurrentEquippedItem() != null) if (player.getCurrentEquippedItem() != null)
{ {
if (player.getCurrentEquippedItem().getItem() instanceof ItemFilter) if (player.getCurrentEquippedItem().getItem() instanceof ItemImprinter)
{ {
((IFilterable) tileEntity).setFilter(player.getCurrentEquippedItem()); ((IFilterable) tileEntity).setFilter(player.getCurrentEquippedItem());
player.inventory.setInventorySlotContents(player.inventory.currentItem, null); player.inventory.setInventorySlotContents(player.inventory.currentItem, null);

View file

@ -13,7 +13,7 @@ public class BlockImprinter extends BlockMachine
public BlockImprinter(int id, int texture) public BlockImprinter(int id, int texture)
{ {
super(id, Material.wood); super(id, Material.wood);
this.blockIndexInTexture = 0; this.blockIndexInTexture = 4;
this.setBlockName("imprinter"); this.setBlockName("imprinter");
this.setCreativeTab(UETab.INSTANCE); this.setCreativeTab(UETab.INSTANCE);
this.setTextureFile(AssemblyLine.BLOCK_TEXTURE_PATH); 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 * 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;
} }
/** /**

View file

@ -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) != 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(); ItemStack outputStack = this.getStackInSlot(0).copy();
outputStack.stackSize = 1; outputStack.stackSize = 1;
ArrayList<ItemStack> filters = ItemFilter.getFilters(outputStack); ArrayList<ItemStack> filters = ItemImprinter.getFilters(outputStack);
boolean filteringItemExists = false; boolean filteringItemExists = false;
for (ItemStack filteredStack : filters) for (ItemStack filteredStack : filters)
@ -224,7 +224,7 @@ public class ContainerImprinter extends Container implements IInventory, ISlotWa
filters.add(this.getStackInSlot(1)); filters.add(this.getStackInSlot(1));
} }
ItemFilter.setFilters(outputStack, filters); ItemImprinter.setFilters(outputStack, filters);
this.setInventorySlotContents(2, outputStack); this.setInventorySlotContents(2, outputStack);
didStamp = true; didStamp = true;
} }
@ -240,9 +240,9 @@ public class ContainerImprinter extends Container implements IInventory, ISlotWa
if (this.getStackInSlot(3) != null) if (this.getStackInSlot(3) != null)
{ {
if (this.getStackInSlot(3).getItem() instanceof ItemFilter) if (this.getStackInSlot(3).getItem() instanceof ItemImprinter)
{ {
ArrayList<ItemStack> filters = ItemFilter.getFilters(this.getStackInSlot(3)); ArrayList<ItemStack> filters = ItemImprinter.getFilters(this.getStackInSlot(3));
if (filters.size() > 0) if (filters.size() > 0)
{ {

View file

@ -3,6 +3,8 @@ package assemblyline.common.machine.filter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import assemblyline.common.AssemblyLine;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -10,15 +12,16 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import universalelectricity.prefab.UETab; import universalelectricity.prefab.UETab;
public class ItemFilter extends Item public class ItemImprinter extends Item
{ {
public ItemFilter(int id) public ItemImprinter(int id)
{ {
super(id); super(id);
this.setItemName("filter"); this.setItemName("imprint");
this.setIconIndex(58); this.setIconIndex(1);
this.setCreativeTab(UETab.INSTANCE); this.setCreativeTab(UETab.INSTANCE);
this.setHasSubtypes(true); this.setHasSubtypes(true);
this.setTextureFile(AssemblyLine.ITEM_TEXTURE_PATH);
} }
@Override @Override

View file

@ -36,7 +36,7 @@ public abstract class TileEntityFilterable extends TileEntityAssemblyNetwork imp
{ {
if (this.getFilter() != null && itemStack != null) if (this.getFilter() != null && itemStack != null)
{ {
ArrayList<ItemStack> checkStacks = ItemFilter.getFilters(getFilter()); ArrayList<ItemStack> checkStacks = ItemImprinter.getFilters(getFilter());
if (checkStacks != null) if (checkStacks != null)
{ {