use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class NEICPH method sendOpenEnchantmentWindow.
public static void sendOpenEnchantmentWindow() {
PacketCustom packet = new PacketCustom(channel, 21);
packet.sendToServer();
}
use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class NEICPH method sendToggleRain.
public static void sendToggleRain() {
PacketCustom packet = new PacketCustom(channel, 9);
packet.sendToServer();
}
use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class NEICPH method sendSetPropertyDisabled.
public static void sendSetPropertyDisabled(String name, boolean enable) {
PacketCustom packet = new PacketCustom(channel, 12);
packet.writeString(name);
packet.writeBoolean(enable);
packet.sendToServer();
}
use of codechicken.lib.packet.PacketCustom 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.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class NEISPH method sendLoginState.
private void sendLoginState(EntityPlayerMP player) {
LinkedList<String> actions = new LinkedList<String>();
LinkedList<String> disabled = new LinkedList<String>();
LinkedList<String> enabled = new LinkedList<String>();
LinkedList<ItemStack> bannedItems = new LinkedList<ItemStack>();
PlayerSave playerSave = NEIServerConfig.forPlayer(player.getName());
for (String name : NEIActions.nameActionMap.keySet()) {
if (NEIServerConfig.canPlayerPerformAction(player.getName(), name)) {
actions.add(name);
}
if (NEIServerConfig.isActionDisabled(player.dimension, name)) {
disabled.add(name);
}
if (playerSave.isActionEnabled(name)) {
enabled.add(name);
}
}
for (ItemStackMap.Entry<Set<String>> entry : NEIServerConfig.bannedItems.entries()) {
if (!NEIServerConfig.isPlayerInList(player.getName(), entry.value, true)) {
bannedItems.add(entry.key);
}
}
PacketCustom packet = new PacketCustom(channel, 10);
packet.writeByte(actions.size());
for (String s : actions) {
packet.writeString(s);
}
packet.writeByte(disabled.size());
for (String s : disabled) {
packet.writeString(s);
}
packet.writeByte(enabled.size());
for (String s : enabled) {
packet.writeString(s);
}
packet.writeInt(bannedItems.size());
for (ItemStack stack : bannedItems) {
packet.writeItemStack(stack);
}
packet.sendToPlayer(player);
}
Aggregations