2013-05-23 21:07:28 -07:00
|
|
|
package magicbees.client.gui;
|
2013-04-21 15:38:52 -07:00
|
|
|
|
2022-10-12 21:09:45 +02:00
|
|
|
import cpw.mods.fml.common.network.IGuiHandler;
|
2013-05-23 21:07:28 -07:00
|
|
|
import magicbees.tileentity.TileEntityEffectJar;
|
2015-03-20 16:52:42 -07:00
|
|
|
import magicbees.tileentity.TileEntityMagicApiary;
|
2013-04-21 15:38:52 -07:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
2022-10-12 21:09:45 +02:00
|
|
|
public class GUIHandler implements IGuiHandler {
|
2013-04-21 15:38:52 -07:00
|
|
|
|
2022-10-12 21:09:45 +02:00
|
|
|
@Override
|
|
|
|
|
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
|
|
|
|
Object value = null;
|
2015-01-16 22:06:02 +01:00
|
|
|
|
2022-10-12 21:09:45 +02:00
|
|
|
if (ID == UIScreens.EFFECT_JAR.ordinal()) {
|
|
|
|
|
value = new ContainerEffectJar((TileEntityEffectJar) world.getTileEntity(x, y, z), player);
|
|
|
|
|
} else if (ID == UIScreens.THAUMIC_APIARY.ordinal()) {
|
2015-03-20 16:52:42 -07:00
|
|
|
TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
|
|
|
|
|
value = new ContainerMagicApiary(player.inventory, tileEntityThaumicApiary);
|
2015-01-16 22:06:02 +01:00
|
|
|
}
|
2013-04-21 15:38:52 -07:00
|
|
|
|
2022-10-12 21:09:45 +02:00
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
|
|
|
|
if (ID == UIScreens.EFFECT_JAR.ordinal()) {
|
|
|
|
|
return new GUIEffectJar((TileEntityEffectJar) world.getTileEntity(x, y, z), player);
|
|
|
|
|
} else if (ID == UIScreens.THAUMIC_APIARY.ordinal()) {
|
2015-03-20 16:52:42 -07:00
|
|
|
TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
|
2022-10-12 21:09:45 +02:00
|
|
|
return new GuiMagicApiary(player.inventory, tileEntityThaumicApiary);
|
2022-03-13 20:51:11 +08:00
|
|
|
} else {
|
2022-10-12 21:09:45 +02:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-04-21 15:38:52 -07:00
|
|
|
}
|