use of buildcraft.robotics.gui.ContainerZonePlan in project BuildCraft by BuildCraft.
the class TileZonePlan method importMap.
private void importMap(ItemStack stack) {
if (stack != null && stack.getItem() instanceof IMapLocation) {
final IZone zone = ((IMapLocation) stack.getItem()).getZone(stack);
if (zone != null && zone instanceof ZonePlan) {
selectedAreas[currentSelectedArea] = (ZonePlan) zone;
for (EntityPlayerMP e : MinecraftServer.getServer().getConfigurationManager().playerEntityList) {
if (e.openContainer != null && e.openContainer instanceof ContainerZonePlan && ((ContainerZonePlan) e.openContainer).getTile() == this) {
Packet p = new PacketCommand(e.openContainer, "areaLoaded", new CommandWriter() {
@Override
public void write(ByteBuf data) {
((ZonePlan) zone).writeData(data);
}
});
BuildCraftCore.instance.sendToPlayer(e, p);
}
}
}
}
}
use of buildcraft.robotics.gui.ContainerZonePlan in project BuildCraft by BuildCraft.
the class RoboticsGuiHandler method getServerGuiElement.
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
BlockPos pos = new BlockPos(x, y, z);
if (!world.isBlockLoaded(pos)) {
return null;
}
TileEntity tile = world.getTileEntity(pos);
switch(id) {
case GuiIds.MAP:
if (!(tile instanceof TileZonePlan)) {
return null;
} else {
return new ContainerZonePlan(player, (TileZonePlan) tile);
}
case GuiIds.REQUESTER:
if (!(tile instanceof TileRequester)) {
return null;
} else {
return new ContainerRequester(player, (TileRequester) tile);
}
default:
return null;
}
}
Aggregations