use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class NEISPH method processCreativeInv.
public static void processCreativeInv(EntityPlayerMP sender, boolean open) {
if (open) {
ServerUtils.openSMPContainer(sender, new ContainerCreativeInv(sender, new ExtendedCreativeInv(NEIServerConfig.forPlayer(sender.getName()), Side.SERVER)), new IGuiPacketSender() {
@Override
public void sendPacket(EntityPlayerMP player, int windowId) {
PacketCustom packet = new PacketCustom(channel, 23);
packet.writeBoolean(true);
packet.writeByte(windowId);
packet.sendToPlayer(player);
}
});
} else {
sender.closeContainer();
PacketCustom packet = new PacketCustom(channel, 23);
packet.writeBoolean(false);
packet.sendToPlayer(sender);
}
}
use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class ContainerSynchronised method sendContainerAndContentsToPlayer.
@Override
public void sendContainerAndContentsToPlayer(Container container, List<ItemStack> list, List<EntityPlayerMP> playerCrafters) {
super.sendContainerAndContentsToPlayer(container, list, playerCrafters);
for (int i = 0; i < syncVars.size(); i++) {
IContainerSyncVar var = syncVars.get(i);
PacketCustom packet = createSyncPacket();
packet.writeByte(i);
var.writeChange(packet);
var.reset();
for (EntityPlayerMP player : playerCrafters) {
packet.sendToPlayer(player);
}
}
}
Aggregations