mirror of
https://github.com/NEZNAMY/TAB.git
synced 2026-11-26 10:29:49 -05:00
more appropriate variable/function names
This commit is contained in:
1 parent
36d6bcc1cb
commit
ec31f4e35a
2 files changed
+29
-29
No files matched your search
@@ -152,7 +152,7 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
if (clientVersion.getMinorVersion() < 9) return null;
|
||||
BossBar packet = new BossBar(id, operation.toBungee());
|
||||
BossBar packet = new BossBar(id, operation.getNetworkId());
|
||||
if (operation == Action.UPDATE_PCT || operation == Action.ADD) {
|
||||
packet.setHealth(pct);
|
||||
}
|
||||
@@ -160,8 +160,8 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
packet.setTitle(IChatBaseComponent.optimizedComponent(name).toString(clientVersion));
|
||||
}
|
||||
if (operation == Action.UPDATE_STYLE || operation == Action.ADD) {
|
||||
packet.setColor(color.toBungee());
|
||||
packet.setDivision(overlay.toBungee());
|
||||
packet.setColor(color.getNetworkId());
|
||||
packet.setDivision(overlay.getNetworkId());
|
||||
}
|
||||
if (operation == Action.UPDATE_PROPERTIES || operation == Action.ADD) {
|
||||
packet.setFlags(getFlags());
|
||||
@@ -174,7 +174,7 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
if (clientVersion.getMinorVersion() < 9) return null;
|
||||
com.velocitypowered.proxy.protocol.packet.BossBar packet = new com.velocitypowered.proxy.protocol.packet.BossBar();
|
||||
packet.setUuid(id);
|
||||
packet.setAction(operation.toBungee());
|
||||
packet.setAction(operation.getNetworkId());
|
||||
if (operation == Action.UPDATE_PCT || operation == Action.ADD) {
|
||||
packet.setPercent(pct);
|
||||
}
|
||||
@@ -182,8 +182,8 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
packet.setName(IChatBaseComponent.optimizedComponent(name).toString(clientVersion));
|
||||
}
|
||||
if (operation == Action.UPDATE_STYLE || operation == Action.ADD) {
|
||||
packet.setColor(color.toBungee());
|
||||
packet.setOverlay(overlay.toBungee());
|
||||
packet.setColor(color.getNetworkId());
|
||||
packet.setOverlay(overlay.getNetworkId());
|
||||
}
|
||||
if (operation == Action.UPDATE_PROPERTIES || operation == Action.ADD) {
|
||||
packet.setFlags(getFlags());
|
||||
@@ -208,11 +208,11 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
UPDATE_STYLE(4),
|
||||
UPDATE_PROPERTIES(5);
|
||||
|
||||
private int bungeeEquivalent;
|
||||
private int networkId;
|
||||
private Object nmsEquivalent;
|
||||
|
||||
private Action(int bungeeEquivalent) {
|
||||
this.bungeeEquivalent = bungeeEquivalent;
|
||||
private Action(int networkId) {
|
||||
this.networkId = networkId;
|
||||
if (Action_ != null) {
|
||||
nmsEquivalent = Enum.valueOf(Action_, toString());
|
||||
}
|
||||
@@ -220,8 +220,8 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
public Object toNMS() {
|
||||
return nmsEquivalent;
|
||||
}
|
||||
public int toBungee() {
|
||||
return bungeeEquivalent;
|
||||
public int getNetworkId() {
|
||||
return networkId;
|
||||
}
|
||||
}
|
||||
public enum BarColor {
|
||||
@@ -234,11 +234,11 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
PURPLE(5),
|
||||
WHITE(6);
|
||||
|
||||
private int bungeeEquivalent;
|
||||
private int networkId;
|
||||
private Object nmsEquivalent;
|
||||
|
||||
private BarColor(int bungeeEquivalent) {
|
||||
this.bungeeEquivalent = bungeeEquivalent;
|
||||
private BarColor(int networkId) {
|
||||
this.networkId = networkId;
|
||||
if (BarColor != null) {
|
||||
nmsEquivalent = Enum.valueOf((Class<Enum>)BarColor, toString());
|
||||
}
|
||||
@@ -246,8 +246,8 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
public Object toNMS() {
|
||||
return nmsEquivalent;
|
||||
}
|
||||
public int toBungee() {
|
||||
return bungeeEquivalent;
|
||||
public int getNetworkId() {
|
||||
return networkId;
|
||||
}
|
||||
}
|
||||
public enum BarStyle {
|
||||
@@ -258,11 +258,11 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
NOTCHED_12(3),
|
||||
NOTCHED_20(4);
|
||||
|
||||
private int bungeeEquivalent;
|
||||
private int networkId;
|
||||
private Object nmsEquivalent;
|
||||
|
||||
private BarStyle(int bungeeEquivalent) {
|
||||
this.bungeeEquivalent = bungeeEquivalent;
|
||||
private BarStyle(int networkId) {
|
||||
this.networkId = networkId;
|
||||
if (BarStyle != null) {
|
||||
nmsEquivalent = Enum.valueOf((Class<Enum>)BarStyle, toString());
|
||||
}
|
||||
@@ -270,8 +270,8 @@ public class PacketPlayOutBoss extends UniversalPacketPlayOut {
|
||||
public Object toNMS() {
|
||||
return nmsEquivalent;
|
||||
}
|
||||
public int toBungee() {
|
||||
return bungeeEquivalent;
|
||||
public int getNetworkId() {
|
||||
return networkId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,12 +85,12 @@ public class PacketPlayOutScoreboardScore extends UniversalPacketPlayOut{
|
||||
|
||||
@Override
|
||||
public Object toBungee(ProtocolVersion clientVersion) {
|
||||
return new ScoreboardScore(player, action.toBungee(), objectiveName, score);
|
||||
return new ScoreboardScore(player, action.getNetworkId(), objectiveName, score);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toVelocity(ProtocolVersion clientVersion) {
|
||||
return new me.neznamy.tab.platforms.velocity.protocol.ScoreboardScore(player, action.toBungee(), objectiveName, score);
|
||||
return new me.neznamy.tab.platforms.velocity.protocol.ScoreboardScore(player, action.getNetworkId(), objectiveName, score);
|
||||
}
|
||||
|
||||
public enum Action{
|
||||
@@ -98,24 +98,24 @@ public class PacketPlayOutScoreboardScore extends UniversalPacketPlayOut{
|
||||
CHANGE((byte) 0),
|
||||
REMOVE((byte) 1);
|
||||
|
||||
private byte ordinal;
|
||||
private byte networkId;
|
||||
private Object nmsEquivalent;
|
||||
|
||||
private Action(byte ordinal) {
|
||||
this.ordinal = ordinal;
|
||||
private Action(byte networkId) {
|
||||
this.networkId = networkId;
|
||||
if (EnumScoreboardAction != null) {
|
||||
//1.8+
|
||||
nmsEquivalent = Enum.valueOf(EnumScoreboardAction, toString());
|
||||
} else {
|
||||
//1.7-
|
||||
nmsEquivalent = ordinal;
|
||||
nmsEquivalent = networkId;
|
||||
}
|
||||
}
|
||||
public Object toNMS() {
|
||||
return nmsEquivalent;
|
||||
}
|
||||
public byte toBungee() {
|
||||
return ordinal;
|
||||
public byte getNetworkId() {
|
||||
return networkId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user