Class BungeeMessageOut
java.lang.Object
me.cooleg.bungeemessaging.OutgoingMessages.BungeeMessageOut
- All Implemented Interfaces:
com.google.common.io.ByteArrayDataOutput,DataOutput
- Direct Known Subclasses:
ForwardMessageOut
Simplified way to write data out to a BungeeCord message.
Should work for basically any message except for the ForwardMessages.
For any messages that you need to add additional data, like a username for example, ByteArrayDataOutput methods are here for that.
-
Constructor Summary
ConstructorsConstructorDescriptionBungeeMessageOut(org.bukkit.entity.Player player, MessageType type) Create a new BungeeMessageOut to be sent. -
Method Summary
Modifier and TypeMethodDescriptionvoidMakes a new data output, and writes the MessageType string and your written data to it.static voidsetPlugin(org.bukkit.plugin.Plugin sendingPlugin) Deprecated.byte[]voidwrite(byte[] bytes) voidwrite(byte[] bytes, int i, int i1) voidwrite(int i) voidwriteBoolean(boolean b) voidwriteByte(int i) voidwriteBytes(String s) voidwriteChar(int i) voidwriteChars(String s) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int i) voidwriteLong(long l) voidwriteShort(int i) void
-
Constructor Details
-
BungeeMessageOut
Create a new BungeeMessageOut to be sent. If the message type you have doesn't need additional data, you can just send it right after creating this!- Parameters:
player- The player you want the message to be sent through. Doesn't matter in most cases.type- The type of message you are going to send.
-
-
Method Details
-
sendMessage
public void sendMessage()Makes a new data output, and writes the MessageType string and your written data to it. If you haven't written any data to this class, it won't write any additional data. -
setPlugin
Deprecated.For internal use only. -
write
public void write(int i) - Specified by:
writein interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writein interfaceDataOutput
-
write
public void write(@Nonnull byte[] bytes) - Specified by:
writein interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writein interfaceDataOutput
-
write
public void write(@Nonnull byte[] bytes, int i, int i1) - Specified by:
writein interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writein interfaceDataOutput
-
writeBoolean
public void writeBoolean(boolean b) - Specified by:
writeBooleanin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeBooleanin interfaceDataOutput
-
writeByte
public void writeByte(int i) - Specified by:
writeBytein interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeBytein interfaceDataOutput
-
writeShort
public void writeShort(int i) - Specified by:
writeShortin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeShortin interfaceDataOutput
-
writeChar
public void writeChar(int i) - Specified by:
writeCharin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeCharin interfaceDataOutput
-
writeInt
public void writeInt(int i) - Specified by:
writeIntin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeIntin interfaceDataOutput
-
writeLong
public void writeLong(long l) - Specified by:
writeLongin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeLongin interfaceDataOutput
-
writeFloat
public void writeFloat(float v) - Specified by:
writeFloatin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeFloatin interfaceDataOutput
-
writeDouble
public void writeDouble(double v) - Specified by:
writeDoublein interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeDoublein interfaceDataOutput
-
writeChars
- Specified by:
writeCharsin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeCharsin interfaceDataOutput
-
writeUTF
- Specified by:
writeUTFin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeUTFin interfaceDataOutput
-
writeBytes
- Specified by:
writeBytesin interfacecom.google.common.io.ByteArrayDataOutput- Specified by:
writeBytesin interfaceDataOutput
-
toByteArray
@Nonnull public byte[] toByteArray()- Specified by:
toByteArrayin interfacecom.google.common.io.ByteArrayDataOutput
-