use of codechicken.core.IGuiPacketSender in project Galacticraft by micdoodle8.
the class NEISPH method openPotionGui.
private void openPotionGui(EntityPlayerMP player, PacketCustom packet) {
InventoryBasic b = new InventoryBasic("potionStore", true, 9);
for (int i = 0; i < b.getSizeInventory(); i++) {
b.setInventorySlotContents(i, packet.readItemStack());
}
ServerUtils.openSMPContainer(player, new ContainerPotionCreator(player.inventory, b), new IGuiPacketSender() {
@Override
public void sendPacket(EntityPlayerMP player, int windowId) {
PacketCustom packet = new PacketCustom(channel, 24);
packet.writeByte(windowId);
packet.sendToPlayer(player);
}
});
}
use of codechicken.core.IGuiPacketSender 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);
}
}
Aggregations