public static Packet131MapData getTileInfoPacket(TileEntity tile) { if (!(tile instanceof IEntityAdditionalSpawnData)) throw new IllegalArgumentException("Tile information packets require a TileEntity implementing IEntityAdditionalSpawnData"); IEntityAdditionalSpawnData data = (IEntityAdditionalSpawnData)tile; ByteArrayDataOutput os = ByteStreams.newDataOutput(); os.writeInt(tile.xCoord); os.writeInt(tile.yCoord); os.writeInt(tile.zCoord); data.writeSpawnData(os); return PacketDispatcher.getTinyPacket(MiscPeripherals.instance, (short)3, os.toByteArray()); }
public static Packet131MapData getModulePacket(Module module, byte[] data) { ByteArrayDataOutput os = ByteStreams.newDataOutput(); os.writeUTF(module.getClass().getSimpleName().substring(6)); os.write(data); return PacketDispatcher.getTinyPacket(MiscPeripherals.instance, (short)6, os.toByteArray()); }
public void func_72494_a(Packet131MapData p_72494_1_) { if(p_72494_1_.field_73438_a == Item.field_77744_bd.field_77779_bT) { ItemMap.func_77874_a(p_72494_1_.field_73436_b, this.field_72563_h.field_71441_e).func_76192_a(p_72494_1_.field_73437_c); } else { this.field_72563_h.func_98033_al().func_98236_b("Unknown itemid: " + p_72494_1_.field_73436_b); } }
@Override /** * Contains logic for handling packets containing arbitrary unique item data. Currently this is only for maps. */ public void handleMapData(Packet131MapData par1Packet131MapData) { FMLNetworkHandler.handlePacket131Packet(this, par1Packet131MapData); }
public void fmlPacket131Callback(Packet131MapData par1Packet131MapData) { if (par1Packet131MapData.itemID == Item.map.itemID) { ItemMap.getMPMapData(par1Packet131MapData.uniqueID, this.mc.theWorld).updateMPMapData(par1Packet131MapData.itemData); } else { this.mc.getLogAgent().logWarning("Unknown itemid: " + par1Packet131MapData.uniqueID); } }
@Override public void handle(NetHandler handler, Packet131MapData mapData) { int id = mapData.uniqueID; if(handler instanceof NetServerHandler) { handleServerPacket((NetServerHandler)handler, mapData.uniqueID, mapData.itemData, (EntityPlayerMP)handler.getPlayer()); } else { handleClientPacket((NetClientHandler)handler, mapData.uniqueID, mapData.itemData); } }
@Override public void handle(NetHandler handler, Packet131MapData mapData) { if (handler instanceof NetServerHandler) ChiselEventHandler.place(handler.getPlayer(), handler.getPlayer().worldObj); }
@Override public void handleMapData(Packet131MapData par1Packet131MapData) { nch.handleMapData(par1Packet131MapData); }
public void fmlPacket131Callback(Packet131MapData par1Packet131MapData) { nch.fmlPacket131Callback(par1Packet131MapData); }
@Override public void handleTinyPacket(NetHandler handler, Packet131MapData mapData) { ((NetClientHandler)handler).fmlPacket131Callback(mapData); }
@Override public void handleTinyPacket(NetHandler handler, Packet131MapData mapData) { // NOOP on server }
public static Packet131MapData getTinyPacket(Object mod, short tag, byte[] data) { NetworkModHandler nmh = FMLNetworkHandler.instance().findNetworkModHandler(mod); return new Packet131MapData((short) nmh.getNetworkId(), tag, data); }
public void handleTinyPacket(NetHandler handler, Packet131MapData mapData) { sidedDelegate.handleTinyPacket(handler, mapData); }
public void func_72494_a(Packet131MapData p_72494_1_) { this.func_72509_a(p_72494_1_); }
public Packet func_77871_c(ItemStack p_77871_1_, World p_77871_2_, EntityPlayer p_77871_3_) { byte[] var4 = this.func_77873_a(p_77871_1_, p_77871_2_).func_76193_a(p_77871_1_, p_77871_2_, p_77871_3_); return var4 == null?null:new Packet131MapData((short)Item.field_77744_bd.field_77779_bT, (short)p_77871_1_.func_77960_j(), var4); }
@Override public void handle(NetHandler handler, Packet131MapData mapData) { }
/** * returns null if no update is to be sent */ public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { byte[] abyte = this.getMapData(par1ItemStack, par2World).getUpdatePacketData(par1ItemStack, par2World, par3EntityPlayer); return abyte == null ? null : new Packet131MapData((short)Item.map.itemID, (short)par1ItemStack.getItemDamage(), abyte); }
/** * Contains logic for handling packets containing arbitrary unique item data. Currently this is only for maps. */ public void handleMapData(Packet131MapData par1Packet131MapData) { FMLNetworkHandler.handlePacket131Packet(this, par1Packet131MapData); }
public void fmlPacket131Callback(Packet131MapData mapData) { }
void handleTinyPacket(NetHandler handler, Packet131MapData mapData);