mirror of
https://github.com/NEZNAMY/TAB.git
synced 2026-11-26 10:29:49 -05:00
added missing @Override annotations
This commit is contained in:
1 parent
3687533073
commit
a6c226190b
8 files changed
+41
No files matched your search
@@ -72,6 +72,7 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
packet.createWorldFog = createWorldFog;
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutBoss CREATE(UUID id, String name, float pct, BarColor color, BarStyle overlay) {
|
||||
PacketPlayOutBoss packet = new PacketPlayOutBoss();
|
||||
packet.operation = Action.ADD;
|
||||
@@ -82,12 +83,14 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
packet.overlay = overlay;
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutBoss REMOVE(UUID id) {
|
||||
PacketPlayOutBoss packet = new PacketPlayOutBoss();
|
||||
packet.operation = Action.REMOVE;
|
||||
packet.id = id;
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutBoss UPDATE_PCT(UUID id, float pct) {
|
||||
PacketPlayOutBoss packet = new PacketPlayOutBoss();
|
||||
packet.operation = Action.UPDATE_PCT;
|
||||
@@ -95,6 +98,7 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
packet.pct = pct;
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutBoss UPDATE_NAME(UUID id, String name) {
|
||||
PacketPlayOutBoss packet = new PacketPlayOutBoss();
|
||||
packet.operation = Action.UPDATE_NAME;
|
||||
@@ -102,6 +106,7 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
packet.name = name;
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutBoss UPDATE_STYLE(UUID id, BarColor color, BarStyle overlay) {
|
||||
PacketPlayOutBoss packet = new PacketPlayOutBoss();
|
||||
packet.operation = Action.UPDATE_STYLE;
|
||||
@@ -110,6 +115,7 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
packet.overlay = overlay;
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutBoss UPDATE_PROPERTIES(UUID id, boolean darkenScreen, boolean playMusic, boolean createWorldFog) {
|
||||
PacketPlayOutBoss packet = new PacketPlayOutBoss();
|
||||
packet.operation = Action.UPDATE_PROPERTIES;
|
||||
@@ -120,6 +126,7 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toNMS(ProtocolVersion clientVersion) throws Exception {
|
||||
Object packet = newPacketPlayOutBoss.newInstance();
|
||||
UUID.set(packet, id);
|
||||
@@ -141,6 +148,8 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
if (clientVersion.getMinorVersion() < 9) return null;
|
||||
BossBar packet = new BossBar(id, operation.toBungee());
|
||||
@@ -159,6 +168,8 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
if (clientVersion.getMinorVersion() < 9) return null;
|
||||
com.velocitypowered.proxy.protocol.packet.BossBar packet = new com.velocitypowered.proxy.protocol.packet.BossBar();
|
||||
@@ -179,6 +190,7 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
|
||||
private byte getFlags(){
|
||||
byte value = 0;
|
||||
if (darkenScreen) value += 1;
|
||||
|
||||
@@ -68,6 +68,7 @@ public class PacketPlayOutChat extends UniversalPacketPlayOut{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toNMS(ProtocolVersion clientVersion) throws Exception {
|
||||
if (ProtocolVersion.SERVER_VERSION.getMinorVersion() >= 16) {
|
||||
return newPacketPlayOutChat.newInstance(NMSHook.stringToComponent(message.toString(clientVersion)), type.toNMS(), UUID.randomUUID());
|
||||
@@ -87,6 +88,7 @@ public class PacketPlayOutChat extends UniversalPacketPlayOut{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
Chat chat = new Chat(message.toString(clientVersion), type.getId());
|
||||
try {
|
||||
@@ -97,6 +99,7 @@ public class PacketPlayOutChat extends UniversalPacketPlayOut{
|
||||
return chat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
return new com.velocitypowered.proxy.protocol.packet.Chat(message.toString(clientVersion), type.getId(), UUID.randomUUID());
|
||||
}
|
||||
|
||||
@@ -285,6 +285,7 @@ public class PacketPlayOutPlayerInfo extends UniversalPacketPlayOut {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toNMS(ProtocolVersion clientVersion) throws Exception{
|
||||
if (ProtocolVersion.SERVER_VERSION.getMinorVersion() >= 8) {
|
||||
Object packet = newPacketPlayOutPlayerInfo2.newInstance(action.toNMS(), Collections.EMPTY_LIST);
|
||||
@@ -308,6 +309,7 @@ public class PacketPlayOutPlayerInfo extends UniversalPacketPlayOut {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
PlayerListItem packet = new PlayerListItem();
|
||||
packet.setAction((Action) action.toBungee());
|
||||
@@ -319,6 +321,7 @@ public class PacketPlayOutPlayerInfo extends UniversalPacketPlayOut {
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
List items = new ArrayList();
|
||||
for (PlayerInfoData data : entries) {
|
||||
|
||||
@@ -35,19 +35,26 @@ public class PacketPlayOutPlayerListHeaderFooter extends UniversalPacketPlayOut
|
||||
this.header = IChatBaseComponent.optimizedComponent(header);
|
||||
this.footer = IChatBaseComponent.optimizedComponent(footer);
|
||||
}
|
||||
|
||||
public PacketPlayOutPlayerListHeaderFooter(IChatBaseComponent header, IChatBaseComponent footer) {
|
||||
this.header = header;
|
||||
this.footer = footer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toNMS(ProtocolVersion clientVersion) throws Exception {
|
||||
Object packet = newPacketPlayOutPlayerListHeaderFooter.newInstance();
|
||||
HEADER.set(packet, NMSHook.stringToComponent(header.toString(clientVersion)));
|
||||
FOOTER.set(packet, NMSHook.stringToComponent(footer.toString(clientVersion)));
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
return new PlayerListHeaderFooter(header.toString(clientVersion), footer.toString(clientVersion));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
return new HeaderAndFooter(header.toString(clientVersion), footer.toString(clientVersion));
|
||||
}
|
||||
|
||||
+3
@@ -37,6 +37,7 @@ public class PacketPlayOutScoreboardDisplayObjective extends UniversalPacketPlay
|
||||
this.objectiveName = objectiveName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toNMS(ProtocolVersion clientVersion) throws Exception {
|
||||
Object packet = newPacketPlayOutScoreboardDisplayObjective.newInstance();
|
||||
POSITION.set(packet, slot);
|
||||
@@ -44,10 +45,12 @@ public class PacketPlayOutScoreboardDisplayObjective extends UniversalPacketPlay
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
return new ScoreboardDisplay((byte)slot, objectiveName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
return new me.neznamy.tab.platforms.velocity.protocol.ScoreboardDisplay((byte)slot, objectiveName);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ public class PacketPlayOutScoreboardObjective extends UniversalPacketPlayOut{
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toNMS(ProtocolVersion clientVersion) throws Exception {
|
||||
String displayName = this.displayName;
|
||||
if (clientVersion.getMinorVersion() < 13) {
|
||||
@@ -101,6 +102,7 @@ public class PacketPlayOutScoreboardObjective extends UniversalPacketPlayOut{
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
String displayName = this.displayName;
|
||||
if (clientVersion.getMinorVersion() >= 13) {
|
||||
@@ -111,6 +113,7 @@ public class PacketPlayOutScoreboardObjective extends UniversalPacketPlayOut{
|
||||
return new ScoreboardObjective(objectiveName, displayName, renderType == null ? null : renderType.toBungee(), (byte)method);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
String displayName = this.displayName;
|
||||
if (clientVersion.getMinorVersion() >= 13) {
|
||||
|
||||
@@ -63,6 +63,8 @@ public class PacketPlayOutScoreboardScore extends UniversalPacketPlayOut{
|
||||
this.player = player;
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toNMS(ProtocolVersion clientVersion) throws Exception {
|
||||
Object packet;
|
||||
if (ProtocolVersion.SERVER_VERSION.getMinorVersion() >= 13) {
|
||||
@@ -80,12 +82,17 @@ public class PacketPlayOutScoreboardScore extends UniversalPacketPlayOut{
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
return new ScoreboardScore(player, action.toBungee(), objectiveName, score);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
return new me.neznamy.tab.platforms.velocity.protocol.ScoreboardScore(player, action.toBungee(), objectiveName, score);
|
||||
}
|
||||
|
||||
public enum Action{
|
||||
|
||||
CHANGE((byte) 0),
|
||||
|
||||
@@ -138,6 +138,7 @@ public class PacketPlayOutScoreboardTeam extends UniversalPacketPlayOut {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toNMS(ProtocolVersion clientVersion) throws Exception {
|
||||
if (name == null || name.length() == 0) throw new IllegalArgumentException("Team name cannot be null/empty");
|
||||
String prefix = this.playerPrefix;
|
||||
@@ -166,6 +167,7 @@ public class PacketPlayOutScoreboardTeam extends UniversalPacketPlayOut {
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
if (name == null || name.length() == 0) throw new IllegalArgumentException("Team name cannot be null/empty");
|
||||
String teamDisplay = name;
|
||||
@@ -184,6 +186,7 @@ public class PacketPlayOutScoreboardTeam extends UniversalPacketPlayOut {
|
||||
return new Team(name, (byte)method, teamDisplay, prefix, suffix, nametagVisibility, collisionRule, color, (byte)options, players.toArray(new String[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
if (name == null || name.length() == 0) throw new IllegalArgumentException("Team name cannot be null/empty");
|
||||
String teamDisplay = name;
|
||||
|
||||
Reference in new issue
Block a user