Java Code Examples for codechicken.lib.packet.PacketCustom#writeShort()
The following examples show how to use
codechicken.lib.packet.PacketCustom#writeShort() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WRCoreSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendSetFreqOwner(int freq, String username) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 9); packet.writeShort(freq); packet.writeString(username); packet.sendToClients(); }
Example 2
Source File: WRCoreCPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendSetFreqInfo(int freq, String name, int colourid) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 4); packet.writeShort((short) freq); packet.writeString(name); packet.writeByte((byte) colourid); packet.sendToServer(); }
Example 3
Source File: WRCoreSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendSharedFrequencyTo(EntityPlayer player, int freq) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 2); packet.writeShort(freq); packet.writeByte(2); packet.sendToPlayer(player); }
Example 4
Source File: WRAddonCPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendSyncTriang(int freq, boolean required) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 52); packet.writeShort(freq); packet.writeBoolean(required); packet.sendToServer(); }
Example 5
Source File: WRAddonSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendThrowTracker(EntityWirelessTracker tracker, EntityPlayer thrower) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 61); packet.writeBoolean(true); packet.writeInt(tracker.getEntityId()); packet.writeInt(thrower.getEntityId()); packet.writeShort(tracker.freq); packet.sendToChunk(thrower.worldObj, (int) thrower.posX >> 4, (int) thrower.posZ >> 4); }
Example 6
Source File: WRCoreSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendFreqOwnerTo(EntityPlayer player, ArrayList<Integer> freqsWithOwners) { if (freqsWithOwners.size() == 0) return; PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 10); packet.writeShort(freqsWithOwners.size()); for (int freq : freqsWithOwners) { packet.writeShort(freq); packet.writeString(RedstoneEther.get(false).getFreqOwner(freq)); } packet.sendToPlayer(player); }
Example 7
Source File: WRAddonSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendMapInfoTo(EntityPlayer player, int mapno, MapData mapdata) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 56); packet.writeShort((short) mapno); packet.writeInt(mapdata.xCenter); packet.writeInt(mapdata.zCenter); packet.writeByte(mapdata.scale); packet.sendToPlayer(player); }
Example 8
Source File: WRAddonSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendTriangAngleTo(EntityPlayer player, int freq, float angle) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 55); packet.writeShort((short) freq); packet.writeFloat(angle); packet.sendToPlayer(player); }
Example 9
Source File: WRCoreSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendSetFreqInfoTo(EntityPlayer player, int freq, String name, int colourid) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 4); packet.writeShort(freq); packet.writeByte(colourid); packet.writeString(name); packet.sendToPlayer(player); }
Example 10
Source File: WRAddonSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendUpdateSnifferTo(EntityPlayer player, int freq, boolean on) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 53); packet.writeShort((short) freq); packet.writeBoolean(on); packet.sendToPlayer(player); }
Example 11
Source File: WRCoreSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendFreqInfoTo(EntityPlayer player, ArrayList<Integer> freqsWithInfo) { if (freqsWithInfo.size() == 0) return; PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 1); packet.writeShort(freqsWithInfo.size()); for (int freq : freqsWithInfo) { packet.writeShort(freq); packet.writeByte(RedstoneEther.get(false).getFreqColourId(freq)); packet.writeString(RedstoneEther.get(false).getFreqName(freq)); } packet.sendToPlayer(player); }
Example 12
Source File: WRCoreSPH.java From WirelessRedstone with MIT License | 5 votes |
public static void sendPublicFrequencyTo(EntityPlayer player, int freq) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 2); packet.writeShort(freq); packet.writeByte(1); packet.sendToPlayer(player); }
Example 13
Source File: TankSynchroniser.java From EnderStorage with MIT License | 5 votes |
@Override public void sendSyncPacket() { if(!tracking) return; PacketCustom packet = new PacketCustom(EnderStorageSPH.channel, 4); packet.writeShort(storage.freq); packet.writeString(storage.owner); packet.writeFluidStack(s_liquid); packet.sendToPlayer(player); }
Example 14
Source File: TileFrequencyOwner.java From EnderStorage with MIT License | 5 votes |
@Override public final Packet getDescriptionPacket() { PacketCustom packet = new PacketCustom(EnderStorageSPH.channel, 1); packet.writeCoord(xCoord, yCoord, zCoord); packet.writeShort(freq); packet.writeString(owner); writeToPacket(packet); return packet.toPacket(); }
Example 15
Source File: EnderStorageSPH.java From EnderStorage with MIT License | 5 votes |
public static void sendOpenUpdateTo(EntityPlayer player, String owner, int freq, boolean open) { PacketCustom packet = new PacketCustom(channel, 3); packet.writeString(owner); packet.writeShort(freq); packet.writeBoolean(open); packet.sendToPlayer(player); }
Example 16
Source File: TankSynchroniser.java From EnderStorage with MIT License | 5 votes |
public void update() { for (Map.Entry<String, PlayerItemTankState> entry : tankStates.entrySet()) { entry.getValue().update(client); } if (client) { Sets.SetView<Frequency> new_visible = Sets.difference(a_visible, b_visible); Sets.SetView<Frequency> old_visible = Sets.difference(b_visible, a_visible); if (!new_visible.isEmpty() || !old_visible.isEmpty()) { PacketCustom packet = new PacketCustom(EnderStorageNetwork.NET_CHANNEL, 1); packet.writeShort(new_visible.size()); new_visible.forEach(freq -> freq.writeToPacket(packet)); packet.writeShort(old_visible.size()); old_visible.forEach(freq -> freq.writeToPacket(packet)); packet.sendToServer(); } HashSet<Frequency> temp = b_visible; temp.clear(); b_visible = a_visible; a_visible = temp; } }
Example 17
Source File: WRCoreCPH.java From WirelessRedstone with MIT License | 4 votes |
public static void sendSetItemFreq(int slot, int freq) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 2); packet.writeShort(slot); packet.writeShort(freq); packet.sendToServer(); }
Example 18
Source File: NEIClientPacketHandler.java From NotEnoughItems with MIT License | 4 votes |
public static void sendDummySlotSet(int slotNumber, ItemStack stack) { PacketCustom packet = new PacketCustom(channel, 25); packet.writeShort(slotNumber); packet.writeItemStack(stack); packet.sendToServer(); }
Example 19
Source File: WRCoreCPH.java From WirelessRedstone with MIT License | 4 votes |
public static void sendDecrementSlot(int slot) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 5); packet.writeShort(slot); packet.sendToServer(); }
Example 20
Source File: WRCoreCPH.java From WirelessRedstone with MIT License | 4 votes |
public static void sendSetFreqOwner(int freq, String username) { PacketCustom packet = new PacketCustom(WirelessRedstoneCore.channel, 9); packet.writeShort(freq); packet.writeString(username); packet.sendToServer(); }