diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java index 1171335703..239ceca0eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java @@ -113,4 +113,25 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective return getScoreboard(); } + + @Override + public int hashCode() { + int hash = 7; + hash = 31 * hash + (this.objective != null ? this.objective.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CraftObjective other = (CraftObjective) obj; + return !(this.objective != other.objective && (this.objective == null || !this.objective.equals(other.objective))); + } + + } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java index 5584353bf2..c4db4621b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -194,4 +194,25 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { return getScoreboard(); } + + @Override + public int hashCode() { + int hash = 7; + hash = 43 * hash + (this.team != null ? this.team.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CraftTeam other = (CraftTeam) obj; + return !(this.team != other.team && (this.team == null || !this.team.equals(other.team))); + } + + }