diff --git a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Objective.java b/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Objective.java deleted file mode 100644 index ff0486d98..000000000 --- a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Objective.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.velocitypowered.proxy.data.scoreboard; - -import net.kyori.text.Component; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class Objective { - private final String id; - private Component displayName; - private ObjectiveMode type; - private final List teams = new ArrayList<>(); - private final Map scores = new HashMap<>(); - - public Objective(String id) { - this.id = id; - } - - public String getId() { - return id; - } - - public Component getDisplayName() { - return displayName; - } - - public void setDisplayName(Component displayName) { - this.displayName = displayName; - } - - public ObjectiveMode getType() { - return type; - } - - public void setType(ObjectiveMode type) { - this.type = type; - } - - public List getTeams() { - return teams; - } - - public Map getScores() { - return scores; - } - - @Override - public String toString() { - return "Objective{" + - "id='" + id + '\'' + - ", displayName='" + displayName + '\'' + - ", type='" + type + '\'' + - ", teams=" + teams + - ", scores=" + scores + - '}'; - } -} diff --git a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/ObjectiveMode.java b/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/ObjectiveMode.java deleted file mode 100644 index 90c82de05..000000000 --- a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/ObjectiveMode.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.velocitypowered.proxy.data.scoreboard; - -public enum ObjectiveMode { - INTEGER, - HEARTS -} diff --git a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Score.java b/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Score.java deleted file mode 100644 index 40a95bb2d..000000000 --- a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Score.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.velocitypowered.proxy.data.scoreboard; - -import java.util.Objects; - -public class Score { - private final String target; - private final int value; - - public Score(String target, int value) { - this.target = target; - this.value = value; - } - - public String getTarget() { - return target; - } - - public int getValue() { - return value; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Score score = (Score) o; - return value == score.value && - Objects.equals(target, score.target); - } - - @Override - public int hashCode() { - return Objects.hash(target, value); - } - - @Override - public String toString() { - return "Score{" + - "target='" + target + '\'' + - ", value=" + value + - '}'; - } -} diff --git a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Scoreboard.java b/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Scoreboard.java deleted file mode 100644 index b4d9d8535..000000000 --- a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Scoreboard.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.velocitypowered.proxy.data.scoreboard; - -import java.util.HashMap; -import java.util.Map; - -public class Scoreboard { - private String displayName; - private byte position; - private final Map objectives = new HashMap<>(); - private final Map teams = new HashMap<>(); - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public byte getPosition() { - return position; - } - - public void setPosition(byte position) { - this.position = position; - } - - public Map getObjectives() { - return objectives; - } - - public Map getTeams() { - return teams; - } - - @Override - public String toString() { - return "Scoreboard{" + - "displayName='" + displayName + '\'' + - ", position=" + position + - ", objectives=" + objectives + - ", teams=" + teams + - '}'; - } -} diff --git a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Team.java b/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Team.java deleted file mode 100644 index a03f3b1fd..000000000 --- a/proxy/src/main/java/com/velocitypowered/proxy/data/scoreboard/Team.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.velocitypowered.proxy.data.scoreboard; - -import java.util.Collection; -import java.util.HashSet; - -public class Team { - private final String id; - private String prefix; - private String suffix; - private byte flags; - private String nameTagVisibility; - private String collision; - private byte color; - private final Collection players = new HashSet<>(); - - public Team(String id) { - this.id = id; - } - - public String getId() { - return id; - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public String getSuffix() { - return suffix; - } - - public void setSuffix(String suffix) { - this.suffix = suffix; - } - - public byte getFlags() { - return flags; - } - - public void setFlags(byte flags) { - this.flags = flags; - } - - public String getNameTagVisibility() { - return nameTagVisibility; - } - - public void setNameTagVisibility(String nameTagVisibility) { - this.nameTagVisibility = nameTagVisibility; - } - - public String getCollision() { - return collision; - } - - public void setCollision(String collision) { - this.collision = collision; - } - - public byte getColor() { - return color; - } - - public void setColor(byte color) { - this.color = color; - } - - public Collection getPlayers() { - return players; - } - - @Override - public String toString() { - return "Team{" + - "id='" + id + '\'' + - ", prefix='" + prefix + '\'' + - ", suffix='" + suffix + '\'' + - ", flags=" + flags + - ", nameTagVisibility='" + nameTagVisibility + '\'' + - ", collision='" + collision + '\'' + - ", color=" + color + - ", players=" + players + - '}'; - } -} diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ScoreboardObjective.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ScoreboardObjective.java index f27bd94a1..1234e0831 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ScoreboardObjective.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ScoreboardObjective.java @@ -1,6 +1,5 @@ package com.velocitypowered.proxy.protocol.packet; -import com.velocitypowered.proxy.data.scoreboard.ObjectiveMode; import com.velocitypowered.proxy.protocol.MinecraftPacket; import com.velocitypowered.proxy.protocol.ProtocolConstants; import com.velocitypowered.proxy.protocol.ProtocolUtils; @@ -86,4 +85,9 @@ public class ScoreboardObjective implements MinecraftPacket { } } } + + public enum ObjectiveMode { + INTEGER, + HEARTS + } } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/ScoreboardProtocolUtil.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/ScoreboardProtocolUtil.java index d87156623..0cc15a61b 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/ScoreboardProtocolUtil.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/ScoreboardProtocolUtil.java @@ -1,22 +1,22 @@ package com.velocitypowered.proxy.protocol.util; -import com.velocitypowered.proxy.data.scoreboard.ObjectiveMode; +import com.velocitypowered.proxy.protocol.packet.ScoreboardObjective; public class ScoreboardProtocolUtil { private ScoreboardProtocolUtil() { throw new AssertionError(); } - public static ObjectiveMode getMode(String mode) { - return ObjectiveMode.valueOf(mode.toUpperCase()); + public static ScoreboardObjective.ObjectiveMode getMode(String mode) { + return ScoreboardObjective.ObjectiveMode.valueOf(mode.toUpperCase()); } - public static ObjectiveMode getMode(int enumVal) { + public static ScoreboardObjective.ObjectiveMode getMode(int enumVal) { switch (enumVal) { case 0: - return ObjectiveMode.INTEGER; + return ScoreboardObjective.ObjectiveMode.INTEGER; case 1: - return ObjectiveMode.HEARTS; + return ScoreboardObjective.ObjectiveMode.HEARTS; default: throw new IllegalStateException("Unknown mode " + enumVal); }