Files
Electro-Magic-Tools/src/main/java/emt/proxy/CommonProxy.java
T

59 lines
1.8 KiB
Java
Raw Normal View History

2016-03-16 17:49:28 +03:00
package emt.proxy;
2014-03-29 12:13:50 +01:00
import cpw.mods.fml.common.network.IGuiHandler;
2016-03-16 17:49:28 +03:00
import emt.client.gui.GuiEtherealMacerator;
import emt.client.gui.GuiIndustrialWandRecharger;
import emt.client.gui.container.ContainerEtheralMacerator;
import emt.client.gui.container.ContainerIndustrialWandRecharge;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
2014-03-29 12:13:50 +01:00
2014-04-17 22:27:40 +02:00
public class CommonProxy implements IGuiHandler {
2014-03-29 12:13:50 +01:00
2015-12-06 19:47:41 +03:00
public void load() {
registerRenders();
}
public void registerRenders() {
/* Empty in base proxy */
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getTileEntity(x, y, z);
switch (ID) {
2016-04-05 13:41:09 +03:00
case 0:
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) {
return new ContainerIndustrialWandRecharge(player.inventory, (TileEntityIndustrialWandRecharge) entity);
}
case 1:
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
return new ContainerEtheralMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
}
default:
return null;
2015-12-06 19:47:41 +03:00
}
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getTileEntity(x, y, z);
switch (ID) {
2016-04-05 13:41:09 +03:00
case 0:
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) {
return new GuiIndustrialWandRecharger(player.inventory, (TileEntityIndustrialWandRecharge) entity);
}
case 1:
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
return new GuiEtherealMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
}
default:
return null;
2015-12-06 19:47:41 +03:00
}
}
2014-03-29 12:13:50 +01:00
}