diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerData.java b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerData.java index cd6ce9784..1c7a54c2f 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerData.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerData.java @@ -153,7 +153,6 @@ public class PlayerData { * * @param map target map * @throws UnexpectedValueException when values are outside of expected norms - * @throws Exception when values are outside of expected norms */ private void validateRootSkillMap(Map map) throws UnexpectedValueException, NullPointerException { //TODO: Check for missing/unregistered diff --git a/src/main/java/com/gmail/nossr50/party/PersistentPartyData.java b/src/main/java/com/gmail/nossr50/party/PersistentPartyData.java index 943348697..8946dca90 100644 --- a/src/main/java/com/gmail/nossr50/party/PersistentPartyData.java +++ b/src/main/java/com/gmail/nossr50/party/PersistentPartyData.java @@ -1,58 +1,7 @@ package com.gmail.nossr50.party; -import com.google.common.base.Objects; -import com.neetgames.mcmmo.party.PartyMember; -import com.neetgames.neetlib.dirtydata.DirtyData; -import com.neetgames.neetlib.dirtydata.DirtySet; -import com.neetgames.neetlib.mutableprimitives.MutableBoolean; -import com.neetgames.neetlib.mutableprimitives.MutableString; -import org.jetbrains.annotations.NotNull; - -import java.util.HashSet; -import java.util.Set; public class PersistentPartyData { + private int hashCodeCache; //TODO: T&C wire this up later, see PlayerData for example - private final @NotNull MutableBoolean dirtyFlag; //Dirty values in this class will change this flag as needed - private final @NotNull DirtyData partyName; - private final @NotNull DirtySet partyMembers; //TODO: Add cache for subsets - - public PersistentPartyData(@NotNull String partyName, @NotNull Set partyMembers) throws RuntimeException { - dirtyFlag = new MutableBoolean(false); - this.partyName = new DirtyData<>(new MutableString(partyName), dirtyFlag); - this.partyMembers = new DirtySet<>(new HashSet<>(partyMembers), dirtyFlag); - } - - public @NotNull String getPartyName() { - return partyName.getData().getImmutableCopy(); - } - - public @NotNull Set getPartyMembers() { - return partyMembers; - } - - public boolean isDataDirty() { - return dirtyFlag.getImmutableCopy(); - } - - @Override - public String toString() { - return "PersistentPartyData{" + - "partyName=" + partyName + - ", partyMembers=" + partyMembers + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - PersistentPartyData that = (PersistentPartyData) o; - return Objects.equal(partyName, that.partyName) && Objects.equal(partyMembers, that.partyMembers); - } - - @Override - public int hashCode() { - return Objects.hashCode(partyName, partyMembers); - } }