make larger crafting grids possible
This commit is contained in:
parent
aa0ff6cf96
commit
8bd9370bab
11 changed files with 97 additions and 102 deletions
|
@ -1,42 +1,22 @@
|
|||
package client.gui.container;
|
||||
|
||||
import common.block.BlockWorkbench;
|
||||
import common.inventory.ContainerWorkbench;
|
||||
import common.inventory.InventoryPlayer;
|
||||
import common.util.BlockPos;
|
||||
import common.world.World;
|
||||
|
||||
public class GuiCrafting extends GuiContainer
|
||||
{
|
||||
// private static final String craftingTableGuiTextures = "textures/gui/crafting_table.png";
|
||||
public class GuiCrafting extends GuiContainer {
|
||||
private final BlockWorkbench type;
|
||||
|
||||
public GuiCrafting(InventoryPlayer playerInv, World worldIn, BlockWorkbench type) {
|
||||
super(new ContainerWorkbench(playerInv, worldIn, BlockPos.ORIGIN, type));
|
||||
this.type = type;
|
||||
this.ySize = 112 + 18 * this.type.getSize();
|
||||
}
|
||||
|
||||
public GuiCrafting(InventoryPlayer playerInv, World worldIn)
|
||||
{
|
||||
this(playerInv, worldIn, BlockPos.ORIGIN);
|
||||
}
|
||||
|
||||
public GuiCrafting(InventoryPlayer playerInv, World worldIn, BlockPos blockPosition)
|
||||
{
|
||||
super(new ContainerWorkbench(playerInv, worldIn, blockPosition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the foreground layer for the GuiContainer (everything in front of the items). Args : mouseX, mouseY
|
||||
*/
|
||||
public void drawGuiContainerForegroundLayer()
|
||||
{
|
||||
this.drawString("Handwerk", 28, 6);
|
||||
this.drawString("Inventar", 8, this.ySize - 96 + 2);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Args : renderPartialTicks, mouseX, mouseY
|
||||
// */
|
||||
// protected void drawGuiContainerBackgroundLayer(int mouseX, int mouseY)
|
||||
// {
|
||||
// GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
// this.gm.getTextureManager().bindTexture(craftingTableGuiTextures);
|
||||
// int i = (this.width - this.xSize) / 2;
|
||||
// int j = (this.height - this.ySize) / 2;
|
||||
//// this.rect(i, j, 0, 0, this.xSize, this.ySize);
|
||||
// }
|
||||
public void drawGuiContainerForegroundLayer() {
|
||||
this.drawString("Handwerk (" + this.type.getDisplay() + ")", 26, 6);
|
||||
this.drawString("Inventar", 8, this.ySize - 96 + 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ import common.attributes.Attribute;
|
|||
import common.attributes.AttributeInstance;
|
||||
import common.attributes.AttributeMap;
|
||||
import common.attributes.AttributeModifier;
|
||||
import common.block.Block;
|
||||
import common.block.BlockWorkbench;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.dimension.Dimension;
|
||||
|
@ -47,6 +49,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.entity.npc.PlayerCharacter;
|
||||
import common.entity.projectile.EntityProjectile;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.EntityRegistry;
|
||||
import common.init.ItemRegistry;
|
||||
import common.init.SoundEvent;
|
||||
|
@ -2047,11 +2050,11 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
|
|||
public void displayGui(IInteractionObject guiOwner, InventoryPlayer inventory, World worldObj) {
|
||||
String s = guiOwner.getGuiID();
|
||||
|
||||
if ("crafting_table".equals(s))
|
||||
{
|
||||
this.gameController.displayGuiScreen(new GuiCrafting(inventory, worldObj));
|
||||
}
|
||||
else if ("enchanting_table".equals(s))
|
||||
Block block = BlockRegistry.getRegisteredBlock(s);
|
||||
if(block instanceof BlockWorkbench) {
|
||||
this.gameController.displayGuiScreen(new GuiCrafting(inventory, worldObj, (BlockWorkbench)block));
|
||||
}
|
||||
else if ("enchanting_table".equals(s))
|
||||
{
|
||||
this.gameController.displayGuiScreen(new GuiEnchant(inventory, worldObj, guiOwner));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue