use of logisticspipes.network.abstractpackets.CoordinatesPacket in project LogisticsPipes by RS485.
the class ModuleCrafter method setPrevSatellite.
public void setPrevSatellite(EntityPlayer player) {
if (MainProxy.isClient(player.worldObj)) {
final CoordinatesPacket packet = PacketHandler.getPacket(CPipePrevSatellite.class).setModulePos(this);
MainProxy.sendPacketToServer(packet);
} else {
satelliteId = getNextConnectSatelliteId(true, -1);
final CoordinatesPacket packet = PacketHandler.getPacket(CPipeSatelliteId.class).setPipeId(satelliteId).setModulePos(this);
MainProxy.sendPacketToPlayer(packet, player);
}
}
use of logisticspipes.network.abstractpackets.CoordinatesPacket in project LogisticsPipes by RS485.
the class ModuleCrafter method setNextSatellite.
public void setNextSatellite(EntityPlayer player) {
if (MainProxy.isClient(player.worldObj)) {
final CoordinatesPacket packet = PacketHandler.getPacket(CPipeNextSatellite.class).setModulePos(this);
MainProxy.sendPacketToServer(packet);
} else {
satelliteId = getNextConnectSatelliteId(false, -1);
final CoordinatesPacket packet = PacketHandler.getPacket(CPipeSatelliteId.class).setPipeId(satelliteId).setModulePos(this);
MainProxy.sendPacketToPlayer(packet, player);
}
}
use of logisticspipes.network.abstractpackets.CoordinatesPacket in project LogisticsPipes by RS485.
the class ModuleCrafter method importFromCraftingTable.
public void importFromCraftingTable(EntityPlayer player) {
if (MainProxy.isClient(getWorld())) {
// Send packet asking for import
final CoordinatesPacket packet = PacketHandler.getPacket(CPipeSatelliteImport.class).setModulePos(this);
MainProxy.sendPacketToServer(packet);
} else {
WorldCoordinatesWrapper worldCoordinates = new WorldCoordinatesWrapper(getWorld(), getX(), getY(), getZ());
for (AdjacentTileEntity adjacent : worldCoordinates.getConnectedAdjacentTileEntities(ConnectionPipeType.ITEM).collect(Collectors.toList())) {
for (ICraftingRecipeProvider provider : SimpleServiceLocator.craftingRecipeProviders) {
if (provider.importRecipe(adjacent.tileEntity, _dummyInventory)) {
if (provider instanceof IFuzzyRecipeProvider) {
((IFuzzyRecipeProvider) provider).importFuzzyFlags(adjacent.tileEntity, _dummyInventory, fuzzyCraftingFlagArray, outputFuzzyFlags);
}
// ToDo: break only out of the inner loop?
break;
}
}
}
// Send inventory as packet
final CoordinatesPacket packet = PacketHandler.getPacket(CPipeSatelliteImportBack.class).setInventory(_dummyInventory).setModulePos(this);
if (player != null) {
MainProxy.sendPacketToPlayer(packet, player);
}
MainProxy.sendPacketToAllWatchingChunk(getX(), getZ(), MainProxy.getDimensionForWorld(getWorld()), packet);
}
}
Aggregations