use of com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWContainer in project artisan-worktables by codetaylor.
the class Util method anyPlayerHasContainerOpen.
public static boolean anyPlayerHasContainerOpen(WorldServer world, BlockPos pos) {
MinecraftServer minecraftServer = world.getMinecraftServer();
PlayerList playerList = minecraftServer.getPlayerList();
List<EntityPlayerMP> players = playerList.getPlayers();
for (EntityPlayerMP entityPlayerMP : players) {
if (entityPlayerMP.openContainer instanceof AWContainer) {
TileEntityBase tile = ((AWContainer) entityPlayerMP.openContainer).getTile();
if (tile.getPos().equals(pos)) {
return true;
}
}
}
return false;
}
use of com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWContainer in project artisan-worktables by codetaylor.
the class SCPacketWorktableContainerJoinedBlockBreak method onMessage.
@SideOnly(Side.CLIENT)
@Override
public IMessage onMessage(SCPacketWorktableContainerJoinedBlockBreak message, MessageContext ctx) {
Minecraft minecraft = Minecraft.getMinecraft();
EntityPlayerSP player = minecraft.player;
WorldClient world = minecraft.world;
if (player.openContainer instanceof AWContainer) {
((AWContainer) player.openContainer).onJoinedBlockBreak(world, message.blockPos);
}
return null;
}
Aggregations