#2978: Allow sending messages from specific UUIDs

This commit is contained in:
Gerrygames
2020-10-17 17:46:01 +11:00
committed by md_5
parent c987ee199d
commit 8fffa206e4
3 changed files with 51 additions and 22 deletions

View File

@@ -2,7 +2,6 @@ package net.md_5.bungee.protocol.packet;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@@ -12,7 +11,6 @@ import net.md_5.bungee.protocol.ProtocolConstants;
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class Chat extends DefinedPacket
{
@@ -32,6 +30,13 @@ public class Chat extends DefinedPacket
this( message, position, EMPTY_UUID );
}
public Chat(String message, byte position, UUID sender)
{
this.message = message;
this.position = position;
this.sender = sender == null ? EMPTY_UUID : sender;
}
@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{