use of buildcraft.core.lib.network.PacketSlotChange in project BuildCraft by BuildCraft.
the class PacketHandlerTransport method channelRead0.
/**
* TODO: A lot of this is based on the player to retrieve the world. Passing a dimension id would be more
* appropriate. More generally, it seems like a lot of these packets could be replaced with tile-based RPCs.
*/
// @Override
@Deprecated
protected void channelRead0(ChannelHandlerContext ctx, Packet packet) {
// super.channelRead0(ctx, packet);
try {
INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
EntityPlayer player = CoreProxy.proxy.getPlayerFromNetHandler(netHandler);
// packet.getID();
int packetID = 0;
switch(packetID) {
case PacketIds.PIPE_POWER:
// onPacketPower(player, (PacketPowerUpdate) packet);
break;
case PacketIds.PIPE_LIQUID:
// action will have happened already at read time
break;
case PacketIds.PIPE_TRAVELER:
{
// onPipeTravelerUpdate(player, (PacketPipeTransportTraveler) packet);
break;
}
case PacketIds.PIPE_ITEMSTACK:
{
// action will have happened already at read time
break;
}
/**
* SERVER SIDE *
*/
case PacketIds.DIAMOND_PIPE_SELECT:
{
onDiamondPipeSelect(player, (PacketSlotChange) packet);
break;
}
case PacketIds.EMERALD_PIPE_SELECT:
{
onEmeraldPipeSelect(player, (PacketSlotChange) packet);
break;
}
case PacketIds.PIPE_ITEMSTACK_REQUEST:
{
((PacketPipeTransportItemStackRequest) packet).sendDataToPlayer(player);
break;
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
use of buildcraft.core.lib.network.PacketSlotChange in project BuildCraft by BuildCraft.
the class TileAdvancedCraftingTable method updateCraftingMatrix.
@Override
public void updateCraftingMatrix(int slot, ItemStack stack) {
craftingSlots.setInventorySlotContents(slot, stack);
updateRecipe();
if (worldObj.isRemote) {
PacketSlotChange packet = new PacketSlotChange(this, slot, stack);
BuildCraftSilicon.instance.sendToServer(packet);
}
}
Aggregations