use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class ContainerSynchronised method detectAndSendChanges.
@Override
public final void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < syncVars.size(); i++) {
IContainerSyncVar var = syncVars.get(i);
if (var.changed()) {
PacketCustom packet = createSyncPacket();
packet.writeByte(i);
var.writeChange(packet);
sendContainerPacket(packet);
var.reset();
}
}
}
use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class ContainerPotionCreator method setPotionEffect.
public void setPotionEffect(int effectID, int duration, int amplifier) {
PacketCustom packet = NEICPH.createContainerPacket();
packet.writeBoolean(true);
packet.writeByte(effectID);
packet.writeInt(duration);
packet.writeByte(amplifier);
packet.sendToServer();
}
use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class ContainerPotionCreator method removePotionEffect.
public void removePotionEffect(int effectID) {
PacketCustom packet = NEICPH.createContainerPacket();
packet.writeBoolean(false);
packet.writeByte(effectID);
packet.sendToServer();
}
use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class NEISPH method sendAddMagneticItemTo.
public static void sendAddMagneticItemTo(EntityPlayerMP player, EntityItem item) {
PacketCustom packet = new PacketCustom(channel, 13);
packet.writeInt(item.getEntityId());
packet.sendToPlayer(player);
}
use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.
the class NEISPH method sendHasServerSideTo.
public static void sendHasServerSideTo(EntityPlayerMP player) {
NEIServerConfig.logger.debug("Sending serverside check to: " + player.getName());
PacketCustom packet = new PacketCustom(channel, 1);
packet.writeByte(NEIActions.protocol);
packet.writeString(player.worldObj.getWorldInfo().getWorldName());
packet.sendToPlayer(player);
}
Aggregations