3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Do it to the message event too

Dieser Commit ist enthalten in:
Andrew Steinborn 2021-04-17 05:00:16 -04:00
Ursprung 47c354e6ee
Commit 0ed8352012
2 geänderte Dateien mit 12 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -22,17 +22,17 @@ import java.io.ByteArrayInputStream;
*/
public interface PluginMessageEvent extends ResultedEvent<PluginMessageEvent.ForwardResult> {
ChannelMessageSource getSource();
ChannelMessageSource source();
ChannelMessageSink getTarget();
ChannelMessageSink sink();
ChannelIdentifier getIdentifier();
ChannelIdentifier channel();
byte[] getData();
byte[] rawMessage();
ByteArrayInputStream dataAsInputStream();
ByteArrayInputStream messageAsInputStream();
ByteArrayDataInput dataAsDataStream();
ByteArrayDataInput messageAsDataInput();
/**
* A result determining whether or not to forward this message on.

Datei anzeigen

@ -58,32 +58,32 @@ public final class PluginMessageEventImpl implements PluginMessageEvent {
}
@Override
public ChannelMessageSource getSource() {
public ChannelMessageSource source() {
return source;
}
@Override
public ChannelMessageSink getTarget() {
public ChannelMessageSink sink() {
return target;
}
@Override
public ChannelIdentifier getIdentifier() {
public ChannelIdentifier channel() {
return identifier;
}
@Override
public byte[] getData() {
public byte[] rawMessage() {
return Arrays.copyOf(data, data.length);
}
@Override
public ByteArrayInputStream dataAsInputStream() {
public ByteArrayInputStream messageAsInputStream() {
return new ByteArrayInputStream(data);
}
@Override
public ByteArrayDataInput dataAsDataStream() {
public ByteArrayDataInput messageAsDataInput() {
return ByteStreams.newDataInput(data);
}