mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Made tile checking when opening a GUI better
This commit is contained in:
parent
0ad50a3e62
commit
3e0996b3da
1 changed files with 15 additions and 5 deletions
|
@ -25,7 +25,7 @@ public class GuiHandler implements IGuiHandler{
|
||||||
@Override
|
@Override
|
||||||
public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){
|
public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){
|
||||||
TileEntityBase tile = null;
|
TileEntityBase tile = null;
|
||||||
if(id != GuiTypes.CRAFTER.ordinal() && id != GuiTypes.DRILL.ordinal() && id != GuiTypes.BOOK.ordinal()){
|
if(GuiTypes.values()[id].checkTileEntity){
|
||||||
tile = (TileEntityBase)world.getTileEntity(x, y, z);
|
tile = (TileEntityBase)world.getTileEntity(x, y, z);
|
||||||
}
|
}
|
||||||
switch(GuiTypes.values()[id]){
|
switch(GuiTypes.values()[id]){
|
||||||
|
@ -85,7 +85,7 @@ public class GuiHandler implements IGuiHandler{
|
||||||
@Override
|
@Override
|
||||||
public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){
|
public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){
|
||||||
TileEntityBase tile = null;
|
TileEntityBase tile = null;
|
||||||
if(id != GuiTypes.CRAFTER.ordinal() && id != GuiTypes.DRILL.ordinal() && id != GuiTypes.BOOK.ordinal()){
|
if(GuiTypes.values()[id].checkTileEntity){
|
||||||
tile = (TileEntityBase)world.getTileEntity(x, y, z);
|
tile = (TileEntityBase)world.getTileEntity(x, y, z);
|
||||||
}
|
}
|
||||||
switch(GuiTypes.values()[id]){
|
switch(GuiTypes.values()[id]){
|
||||||
|
@ -147,7 +147,7 @@ public class GuiHandler implements IGuiHandler{
|
||||||
public enum GuiTypes{
|
public enum GuiTypes{
|
||||||
FEEDER,
|
FEEDER,
|
||||||
GIANT_CHEST,
|
GIANT_CHEST,
|
||||||
CRAFTER,
|
CRAFTER(false),
|
||||||
GRINDER,
|
GRINDER,
|
||||||
GRINDER_DOUBLE,
|
GRINDER_DOUBLE,
|
||||||
FURNACE_DOUBLE,
|
FURNACE_DOUBLE,
|
||||||
|
@ -163,13 +163,23 @@ public class GuiHandler implements IGuiHandler{
|
||||||
PHANTOM_PLACER,
|
PHANTOM_PLACER,
|
||||||
FLUID_COLLECTOR,
|
FLUID_COLLECTOR,
|
||||||
COFFEE_MACHINE,
|
COFFEE_MACHINE,
|
||||||
DRILL,
|
DRILL(false),
|
||||||
ENERGIZER,
|
ENERGIZER,
|
||||||
ENERVATOR,
|
ENERVATOR,
|
||||||
XP_SOLIDIFIER,
|
XP_SOLIDIFIER,
|
||||||
ORE_MAGNET,
|
ORE_MAGNET,
|
||||||
CLOUD,
|
CLOUD,
|
||||||
BOOK
|
BOOK(false);
|
||||||
|
|
||||||
|
public boolean checkTileEntity;
|
||||||
|
|
||||||
|
GuiTypes(boolean checkTileEntity){
|
||||||
|
this.checkTileEntity = checkTileEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
GuiTypes(){
|
||||||
|
this(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
|
|
Loading…
Reference in a new issue