Fixed Encoder Gui Render Issues

This commit is contained in:
Henry Mao 2013-01-05 23:07:35 +08:00
parent 351478ade7
commit 0d978d5de4
14 changed files with 52 additions and 49 deletions

View file

@ -1 +1 @@
41
42

View file

@ -37,3 +37,4 @@ Minecraft 1.4.5
@ AssemblyLine_v0.2.1.39.jar AssemblyLine_v0.2.1.39_api.zip
* AssemblyLine_v0.2.1.40.jar AssemblyLine_v0.2.1.40_api.zip
@ AssemblyLine_v0.2.2.41.jar AssemblyLine_v0.2.2.41_api.zip
@ AssemblyLine_v0.2.2.42.jar AssemblyLine_v0.2.2.42_api.zip

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -63,11 +63,11 @@ public class GuiEncoder extends GuiContainer implements IInventoryWatcher
this.containerWidth = (this.width - this.xSize) / 2;
this.containerHeight = (this.height - this.ySize) / 2;
this.addButton = new GuiButton(0, containerWidth + (xSize - 25), containerHeight + 128, 18, 20, "+");
this.delButton = new GuiButton(1, containerWidth + (xSize - 43), containerHeight + 128, 18, 20, "-");
this.pUpButton = new GuiButton(2, containerWidth + (xSize - 25), containerHeight + 48, 18, 20, "");
this.pDnButton = new GuiButton(3, containerWidth + (xSize - 25), containerHeight + 108, 18, 20, "");
this.commandField = new GuiTextField(fontRenderer, 8, 129, xSize - 52, 18);
this.addButton = new GuiButton(0, containerWidth + (xSize - 25), containerHeight + 128 + ContainerEncoder.Y_OFFSET, 18, 20, "+");
this.delButton = new GuiButton(1, containerWidth + (xSize - 43), containerHeight + 128 + ContainerEncoder.Y_OFFSET, 18, 20, "-");
this.pUpButton = new GuiButton(2, containerWidth + (xSize - 25), containerHeight + 48 + ContainerEncoder.Y_OFFSET, 18, 20, "");
this.pDnButton = new GuiButton(3, containerWidth + (xSize - 25), containerHeight + 108 + ContainerEncoder.Y_OFFSET, 18, 20, "");
this.commandField = new GuiTextField(fontRenderer, 8, 129 + ContainerEncoder.Y_OFFSET, xSize - 52, 18);
// commandList = new GuiCommandList(mc, xSize - 7, 128, 7, 120, 170, 20);
this.controlList.add(addButton);
@ -140,12 +140,12 @@ public class GuiEncoder extends GuiContainer implements IInventoryWatcher
{
glColor4f(1, 1, 1, 1);
glDisable(GL_LIGHTING);
this.fontRenderer.drawString(TranslationHelper.getLocal("tile.encoder.name"), 68, 6, 4210752);
this.fontRenderer.drawString("Disk:", 56, 28, 4210752);
this.fontRenderer.drawString(TranslationHelper.getLocal("tile.encoder.name"), 68, 6 + ContainerEncoder.Y_OFFSET, 4210752);
this.fontRenderer.drawString("Disk:", 56, 28 + ContainerEncoder.Y_OFFSET, 4210752);
// render page up and page down buttons
glPushMatrix();
glTranslatef(pUpButton.xPosition - containerWidth + 6, pUpButton.yPosition - containerHeight + 7, 0);
glTranslatef(pUpButton.xPosition - containerWidth + 6, pUpButton.yPosition - containerHeight + 7 , 0);
this.fontRenderer.drawString("^", 1, 1, 0x444444);
this.fontRenderer.drawString("^", 0, 0, 0xFFFFFF);
glPopMatrix();
@ -208,8 +208,8 @@ public class GuiEncoder extends GuiContainer implements IInventoryWatcher
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize);
drawOutlineRect(containerWidth + 7, containerHeight + 48, containerWidth + (xSize - 25), containerHeight + 48 + 80, 0, 0, 0, 0.5f, 0.5f, 0.5f);
this.drawTexturedModalRect(containerWidth, containerHeight + ContainerEncoder.Y_OFFSET, 0, 0, this.xSize, this.ySize);
drawOutlineRect(containerWidth + 7, containerHeight + 48 + ContainerEncoder.Y_OFFSET, containerWidth + (xSize - 25), containerHeight + 48 + 80 + ContainerEncoder.Y_OFFSET, 0, 0, 0, 0.5f, 0.5f, 0.5f);
}
public static void drawOutlineRect(int x1, int y1, int x2, int y2, float rR, float rG, float rB, float lR, float lG, float lB)

View file

@ -18,7 +18,6 @@ import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11;
import assemblyline.common.block.TileEntityCrate;
import assemblyline.common.machine.imprinter.ItemImprinter;
public class RenderCrate extends TileEntitySpecialRenderer
{

View file

@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import assemblyline.common.machine.imprinter.ItemImprinter;
import assemblyline.common.machine.imprinter.TileEntityImprintable;
import assemblyline.common.machine.imprinter.TileEntityFilterable;
/**
* @author Briman0094
@ -21,9 +21,9 @@ public abstract class RenderImprintable extends TileEntitySpecialRenderer
{
if (tileEntity != null)
{
if (tileEntity instanceof TileEntityImprintable)
if (tileEntity instanceof TileEntityFilterable)
{
TileEntityImprintable tileFilterable = (TileEntityImprintable) tileEntity;
TileEntityFilterable tileFilterable = (TileEntityFilterable) tileEntity;
ItemStack filter = tileFilterable.getFilter();
@ -39,7 +39,7 @@ public abstract class RenderImprintable extends TileEntitySpecialRenderer
ArrayList<ItemStack> filters = ItemImprinter.getFilters(filter);
for (int i = 0; i < filters.size(); i++)
{
if (((TileEntityImprintable) tileEntity).isInverted())
if (((TileEntityFilterable) tileEntity).isInverted())
{
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, 0xFF8888);
}

View file

@ -13,7 +13,6 @@ import universalelectricity.prefab.network.IPacketReceiver;
import universalelectricity.prefab.network.PacketManager;
import universalelectricity.prefab.tile.TileEntityAdvanced;
import assemblyline.common.AssemblyLine;
import assemblyline.common.machine.imprinter.ItemImprinter;
import com.google.common.io.ByteArrayDataInput;

View file

@ -15,12 +15,12 @@ import universalelectricity.core.vector.Vector3;
import universalelectricity.prefab.implement.IRedstoneReceptor;
import universalelectricity.prefab.network.PacketManager;
import assemblyline.api.IManipulator;
import assemblyline.common.machine.imprinter.TileEntityImprintable;
import assemblyline.common.machine.imprinter.TileEntityFilterable;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.relauncher.Side;
public class TileEntityManipulator extends TileEntityImprintable implements IRedstoneReceptor, IManipulator
public class TileEntityManipulator extends TileEntityFilterable implements IRedstoneReceptor, IManipulator
{
public boolean selfPulse = false;

View file

@ -11,14 +11,14 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.vector.Vector3;
import universalelectricity.prefab.network.PacketManager;
import assemblyline.common.machine.imprinter.TileEntityImprintable;
import assemblyline.common.machine.imprinter.TileEntityFilterable;
/**
*
* @author Darkguardsman
*
*/
public class TileEntityRejector extends TileEntityImprintable
public class TileEntityRejector extends TileEntityFilterable
{
/**
* should the piston fire, or be extended

View file

@ -10,9 +10,9 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.prefab.network.PacketManager;
import assemblyline.common.AssemblyLine;
import assemblyline.common.machine.imprinter.TileEntityImprintable;
import assemblyline.common.machine.imprinter.TileEntityFilterable;
public class TileEntityDetector extends TileEntityImprintable
public class TileEntityDetector extends TileEntityFilterable
{
private boolean powering = false;

View file

@ -5,22 +5,22 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import universalelectricity.core.vector.Vector3;
public class ContainerEncoder extends Container
{
public static final int Y_OFFSET = 9;
private ItemStack[] containingItems = new ItemStack[1];
private InventoryPlayer inventoryPlayer;
private TileEntityEncoder encoder;
private TileEntityEncoder tileEntity;
public ContainerEncoder(InventoryPlayer inventoryPlayer, TileEntityEncoder encoder)
{
this.inventoryPlayer = inventoryPlayer;
this.encoder = encoder;
this.tileEntity = encoder;
// Disk
this.addSlotToContainer(new Slot(encoder, 0, 80, 17));
this.addSlotToContainer(new Slot(encoder, 0, 80, 24 + Y_OFFSET));
int var3;
@ -28,20 +28,20 @@ public class ContainerEncoder extends Container
{
for (int var4 = 0; var4 < 9; ++var4)
{
this.addSlotToContainer(new Slot(inventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 155 + var3 * 18));
this.addSlotToContainer(new Slot(inventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 155 + var3 * 18 + Y_OFFSET));
}
}
for (var3 = 0; var3 < 9; ++var3)
{
this.addSlotToContainer(new Slot(inventoryPlayer, var3, 8 + var3 * 18, 213));
this.addSlotToContainer(new Slot(inventoryPlayer, var3, 8 + var3 * 18, 213 + Y_OFFSET));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return encoder.isUseableByPlayer(player);
return this.tileEntity.isUseableByPlayer(player);
}
/**

View file

@ -153,15 +153,18 @@ public class TileEntityEncoder extends TileEntityAdvanced implements IPacketRece
{
this.disk = ItemStack.loadItemStackFromNBT(diskNBT);
}
}
@Override
public void handlePacketData(INetworkManager network, int packetType, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
{
try
{
if (!this.worldObj.isRemote)
{
/**
* Only the server receives this from the client's button click action.
* New command action
*/
String newCommand = dataStream.readUTF();
@ -181,6 +184,7 @@ public class TileEntityEncoder extends TileEntityAdvanced implements IPacketRece
ItemDisk.setCommands(this.disk, tempCmds);
}
}
}
catch (Exception e)
{
e.printStackTrace();

View file

@ -77,9 +77,9 @@ public abstract class BlockImprintable extends BlockMachine
if (tileEntity != null)
{
if (tileEntity instanceof TileEntityImprintable)
if (tileEntity instanceof TileEntityFilterable)
{
((TileEntityImprintable) tileEntity).toggleInversion();
((TileEntityFilterable) tileEntity).toggleInversion();
world.markBlockForRenderUpdate(x, y, z);
}
}

View file

@ -24,7 +24,7 @@ import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
public abstract class TileEntityImprintable extends TileEntityAssemblyNetwork implements IRotatable, IFilterable, IPacketReceiver
public abstract class TileEntityFilterable extends TileEntityAssemblyNetwork implements IRotatable, IFilterable, IPacketReceiver
{
private ItemStack filterItem;
private boolean inverted;