geforkt von Mirrors/Velocity
Turn StatusRequest into a singleton.
Dieser Commit ist enthalten in:
Ursprung
f973ded4ee
Commit
2bfb7061ee
@ -23,7 +23,7 @@ public enum StateRegistry {
|
|||||||
},
|
},
|
||||||
STATUS {
|
STATUS {
|
||||||
{
|
{
|
||||||
SERVERBOUND.register(StatusRequest.class, StatusRequest::new,
|
SERVERBOUND.register(StatusRequest.class, () -> StatusRequest.INSTANCE,
|
||||||
genericMappings(0x00));
|
genericMappings(0x00));
|
||||||
SERVERBOUND.register(StatusPing.class, StatusPing::new,
|
SERVERBOUND.register(StatusPing.class, StatusPing::new,
|
||||||
genericMappings(0x01));
|
genericMappings(0x01));
|
||||||
|
@ -5,6 +5,12 @@ import com.velocitypowered.proxy.protocol.MinecraftPacket;
|
|||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
public class StatusRequest implements MinecraftPacket {
|
public class StatusRequest implements MinecraftPacket {
|
||||||
|
public static final StatusRequest INSTANCE = new StatusRequest();
|
||||||
|
|
||||||
|
private StatusRequest() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void decode(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) {
|
public void decode(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) {
|
||||||
|
|
||||||
@ -14,4 +20,9 @@ public class StatusRequest implements MinecraftPacket {
|
|||||||
public void encode(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) {
|
public void encode(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "StatusRequest";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren