use of logisticspipes.network.abstractpackets.ModernPacket in project LogisticsPipes by RS485.
the class PipeFluidSatellite method setPrevId.
public void setPrevId(EntityPlayer player) {
satelliteId = findId(-1);
ensureAllSatelliteStatus();
if (MainProxy.isClient(player.worldObj)) {
final ModernPacket packet = PacketHandler.getPacket(SatPipePrev.class).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
MainProxy.sendPacketToServer(packet);
} else {
final ModernPacket packet = PacketHandler.getPacket(SatPipeSetID.class).setSatID(satelliteId).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
MainProxy.sendPacketToPlayer(packet, player);
}
updateWatchers();
}
use of logisticspipes.network.abstractpackets.ModernPacket in project LogisticsPipes by RS485.
the class PipeFluidSatellite method setNextId.
public void setNextId(EntityPlayer player) {
satelliteId = findId(1);
ensureAllSatelliteStatus();
if (MainProxy.isClient(player.worldObj)) {
final ModernPacket packet = PacketHandler.getPacket(SatPipeNext.class).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
MainProxy.sendPacketToServer(packet);
} else {
final ModernPacket packet = PacketHandler.getPacket(SatPipeSetID.class).setSatID(satelliteId).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
MainProxy.sendPacketToPlayer(packet, player);
}
updateWatchers();
}
use of logisticspipes.network.abstractpackets.ModernPacket in project LogisticsPipes by RS485.
the class ModuleItemSink method setIgnoreNBT.
public void setIgnoreNBT(int slot, EntityPlayer player) {
if (slot < 0 || slot >= 9) {
return;
}
if (MainProxy.isClient(_world.getWorld())) {
if (player == null) {
MainProxy.sendPacketToServer(PacketHandler.getPacket(ItemSinkFuzzy.class).setPos(slot).setNBT(true).setModulePos(this));
}
} else {
ignoreNBT.set(slot, !ignoreNBT.get(slot));
ModernPacket pak = PacketHandler.getPacket(ItemSinkFuzzy.class).setIgnoreData(ignoreData).setIgnoreNBT(ignoreNBT).setModulePos(this);
if (player != null) {
MainProxy.sendPacketToPlayer(pak, player);
}
MainProxy.sendPacketToAllWatchingChunk(getX(), getZ(), MainProxy.getDimensionForWorld(_world.getWorld()), pak);
}
}
use of logisticspipes.network.abstractpackets.ModernPacket in project LogisticsPipes by RS485.
the class PacketHandler method onPacketData.
//hacky callback to process packets coming from by the packetbufferhandler decompressors
//TODO replace with proper netty implementation
public static void onPacketData(final LPDataInput data, final EntityPlayer player) {
if (player == null) {
return;
}
final int packetID = data.readShort();
final ModernPacket packet = PacketHandler.packetlist.get(packetID).template();
packet.setDebugId(data.readInt());
packet.readData(data);
PacketHandler.onPacketData(packet, player);
}
use of logisticspipes.network.abstractpackets.ModernPacket in project LogisticsPipes by RS485.
the class PipeFluidSatellite method playerStartWatching.
@Override
public void playerStartWatching(EntityPlayer player, int mode) {
if (mode == 1) {
localModeWatchers.add(player);
final ModernPacket packet = PacketHandler.getPacket(SatPipeSetID.class).setSatID((this).satelliteId).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
MainProxy.sendPacketToPlayer(packet, player);
updateInv(true);
} else {
super.playerStartWatching(player, mode);
}
}
Aggregations