Added gui calls to all new machines
Added new gui to matter fab Added container and slots to matter fab
This commit is contained in:
parent
30ceed031c
commit
7c1e72076b
12 changed files with 282 additions and 2 deletions
|
@ -2,6 +2,8 @@ package techreborn.blocks;
|
|||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileGrinder;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -9,6 +11,7 @@ import net.minecraft.block.BlockContainer;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
@ -38,6 +41,16 @@ public class BlockGrinder extends BlockMachineBase{
|
|||
return new TileGrinder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.grinderID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister icon)
|
||||
|
|
|
@ -2,6 +2,8 @@ package techreborn.blocks;
|
|||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileImplosionCompressor;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -9,6 +11,7 @@ import net.minecraft.block.BlockContainer;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
@ -38,6 +41,16 @@ public class BlockImplosionCompressor extends BlockMachineBase{
|
|||
return new TileImplosionCompressor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.compresserID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister icon)
|
||||
|
|
|
@ -2,6 +2,8 @@ package techreborn.blocks;
|
|||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileMatterFabricator;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -9,6 +11,7 @@ import net.minecraft.block.BlockContainer;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
@ -38,6 +41,16 @@ public class BlockMatterFabricator extends BlockMachineBase{
|
|||
return new TileMatterFabricator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.matterfabID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister icon)
|
||||
|
|
|
@ -5,6 +5,9 @@ import net.minecraft.world.World;
|
|||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.client.container.ContainerBlastFurnace;
|
||||
import techreborn.client.container.ContainerCentrifuge;
|
||||
import techreborn.client.container.ContainerGrinder;
|
||||
import techreborn.client.container.ContainerImplosionCompressor;
|
||||
import techreborn.client.container.ContainerMatterFabricator;
|
||||
import techreborn.client.container.ContainerQuantumChest;
|
||||
import techreborn.client.container.ContainerQuantumTank;
|
||||
import techreborn.client.container.ContainerRollingMachine;
|
||||
|
@ -12,6 +15,9 @@ import techreborn.client.container.ContainerThermalGenerator;
|
|||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.client.gui.GuiGrinder;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.client.gui.GuiMatterFabricator;
|
||||
import techreborn.client.gui.GuiQuantumChest;
|
||||
import techreborn.client.gui.GuiQuantumTank;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
|
@ -20,6 +26,9 @@ import techreborn.pda.GuiPda;
|
|||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
import techreborn.tiles.TileCentrifuge;
|
||||
import techreborn.tiles.TileGrinder;
|
||||
import techreborn.tiles.TileImplosionCompressor;
|
||||
import techreborn.tiles.TileMatterFabricator;
|
||||
import techreborn.tiles.TileQuantumChest;
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
|
@ -35,7 +44,10 @@ public class GuiHandler implements IGuiHandler {
|
|||
public static final int rollingMachineID = 4;
|
||||
public static final int blastFurnaceID = 5;
|
||||
public static final int alloySmelterID = 6;
|
||||
public static final int pdaID = 7;
|
||||
public static final int grinderID = 7;
|
||||
public static final int compresserID = 8;
|
||||
public static final int matterfabID = 9;
|
||||
public static final int pdaID = 10;
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world,
|
||||
|
@ -69,6 +81,18 @@ public class GuiHandler implements IGuiHandler {
|
|||
{
|
||||
return new ContainerAlloySmelter(
|
||||
(TileAlloySmelter) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == grinderID)
|
||||
{
|
||||
return new ContainerGrinder(
|
||||
(TileGrinder) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == compresserID)
|
||||
{
|
||||
return new ContainerImplosionCompressor(
|
||||
(TileImplosionCompressor) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == matterfabID)
|
||||
{
|
||||
return new ContainerMatterFabricator(
|
||||
(TileMatterFabricator) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == pdaID)
|
||||
{
|
||||
return null;
|
||||
|
@ -109,6 +133,19 @@ public class GuiHandler implements IGuiHandler {
|
|||
{
|
||||
return new GuiAlloySmelter(player,
|
||||
(TileAlloySmelter) world.getTileEntity(x, y, z));
|
||||
} else if (ID == grinderID)
|
||||
{
|
||||
return new GuiGrinder(player,
|
||||
(TileGrinder) world.getTileEntity(x, y, z));
|
||||
} else if (ID == compresserID)
|
||||
{
|
||||
return new GuiImplosionCompressor(player,
|
||||
(TileImplosionCompressor) world.getTileEntity(x, y, z));
|
||||
} else if (ID == matterfabID)
|
||||
{
|
||||
return new GuiMatterFabricator(player,
|
||||
(TileMatterFabricator) world.getTileEntity(x, y, z));
|
||||
|
||||
} else if (ID == pdaID)
|
||||
{
|
||||
return new GuiPda(player);
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import techreborn.tiles.TileGrinder;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class ContainerGrinder extends TechRebornContainer{
|
||||
|
||||
public ContainerGrinder(TileGrinder tileEntity, EntityPlayer player)
|
||||
{
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import techreborn.tiles.TileGrinder;
|
||||
import techreborn.tiles.TileImplosionCompressor;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class ContainerImplosionCompressor extends TechRebornContainer{
|
||||
|
||||
public ContainerImplosionCompressor(TileImplosionCompressor tilecompresser,
|
||||
EntityPlayer player)
|
||||
{
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import techreborn.client.SlotOutput;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileMatterFabricator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
public class ContainerMatterFabricator extends TechRebornContainer{
|
||||
|
||||
EntityPlayer player;
|
||||
|
||||
TileMatterFabricator tile;
|
||||
|
||||
public int tickTime;
|
||||
|
||||
public ContainerMatterFabricator(TileMatterFabricator tileMatterfab,
|
||||
EntityPlayer player)
|
||||
{
|
||||
tile = tileMatterfab;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 0, 33, 17));
|
||||
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 1, 33, 35));
|
||||
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 2, 33, 53));
|
||||
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 3, 51, 17));
|
||||
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 4, 51, 35));
|
||||
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 5, 51, 53));
|
||||
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileMatterfab.inventory, 6,
|
||||
116, 35));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(player.inventory, j + i * 9
|
||||
+ 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18,
|
||||
142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
29
src/main/java/techreborn/client/gui/GuiGrinder.java
Normal file
29
src/main/java/techreborn/client/gui/GuiGrinder.java
Normal file
|
@ -0,0 +1,29 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.client.container.ContainerGrinder;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileGrinder;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
public class GuiGrinder extends GuiContainer{
|
||||
|
||||
TileGrinder tilegrinder;
|
||||
|
||||
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder)
|
||||
{
|
||||
super(new ContainerGrinder(tilegrinder, player));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import techreborn.client.container.ContainerGrinder;
|
||||
import techreborn.client.container.ContainerImplosionCompressor;
|
||||
import techreborn.tiles.TileImplosionCompressor;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
public class GuiImplosionCompressor extends GuiContainer{
|
||||
|
||||
TileImplosionCompressor tilecompresser;
|
||||
|
||||
public GuiImplosionCompressor(EntityPlayer player, TileImplosionCompressor tilecompresser)
|
||||
{
|
||||
super(new ContainerImplosionCompressor(tilecompresser, player));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
48
src/main/java/techreborn/client/gui/GuiMatterFabricator.java
Normal file
48
src/main/java/techreborn/client/gui/GuiMatterFabricator.java
Normal file
|
@ -0,0 +1,48 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import techreborn.client.container.ContainerImplosionCompressor;
|
||||
import techreborn.client.container.ContainerMatterFabricator;
|
||||
import techreborn.tiles.TileImplosionCompressor;
|
||||
import techreborn.tiles.TileMatterFabricator;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GuiMatterFabricator extends GuiContainer{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/matterfabricator.png");
|
||||
|
||||
TileMatterFabricator matterfab;
|
||||
|
||||
public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab)
|
||||
{
|
||||
super(new ContainerMatterFabricator(tilematterfab, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
matterfab = tilematterfab;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_)
|
||||
{
|
||||
this.fontRendererObj.drawString("Matta Fabricator", 60, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.format("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
|
@ -11,7 +11,7 @@ public class TileMatterFabricator extends TileMachineBase implements IWrenchable
|
|||
|
||||
public int tickTime;
|
||||
public BasicSink energy;
|
||||
public Inventory inventory = new Inventory(5, "TileMatterFabricator", 64);
|
||||
public Inventory inventory = new Inventory(7, "TileMatterFabricator", 64);
|
||||
|
||||
|
||||
@Override
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Loading…
Add table
Reference in a new issue