mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 06:28:54 +00:00
Avoid using default methods with null values (#754)
This commit is contained in:
1 parent
58b7b0d685
commit
2fab19d325
2 files changed
+9
-3
No files matched your search
+8
@@ -52,6 +52,14 @@ public final class LocalPlayerChangePacket extends CarbonPacket {
|
|||||||
this.changeType = changeType;
|
this.changeType = changeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AssistedInject
|
||||||
|
public LocalPlayerChangePacket(final @ServerId UUID serverId, final @Assisted UUID playerId) {
|
||||||
|
super(serverId);
|
||||||
|
this.playerId = playerId;
|
||||||
|
this.playerName = null;
|
||||||
|
this.changeType = ChangeType.REMOVE;
|
||||||
|
}
|
||||||
|
|
||||||
public LocalPlayerChangePacket(final UUID sender, final ByteBuf data) {
|
public LocalPlayerChangePacket(final UUID sender, final ByteBuf data) {
|
||||||
super(sender);
|
super(sender);
|
||||||
this.read(data);
|
this.read(data);
|
||||||
|
|||||||
@@ -45,9 +45,7 @@ public interface PacketFactory {
|
|||||||
return this.localPlayerChangePacket(id, name, LocalPlayerChangePacket.ChangeType.ADD);
|
return this.localPlayerChangePacket(id, name, LocalPlayerChangePacket.ChangeType.ADD);
|
||||||
}
|
}
|
||||||
|
|
||||||
default LocalPlayerChangePacket removeLocalPlayerPacket(final UUID id) {
|
LocalPlayerChangePacket removeLocalPlayerPacket(final UUID id);
|
||||||
return this.localPlayerChangePacket(id, null, LocalPlayerChangePacket.ChangeType.REMOVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
WhisperPacket whisperPacket(@Assisted("from") UUID from, @Assisted("to") UUID to, Component msg);
|
WhisperPacket whisperPacket(@Assisted("from") UUID from, @Assisted("to") UUID to, Component msg);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user