diff --git a/src/com/massivecraft/massivecore/store/Coll.java b/src/com/massivecraft/massivecore/store/Coll.java index 1b9c9a9c..c71b2483 100644 --- a/src/com/massivecraft/massivecore/store/Coll.java +++ b/src/com/massivecraft/massivecore/store/Coll.java @@ -344,7 +344,6 @@ public class Coll> extends CollAbstract // Then attach! this.attach(entity, id, false); - // On creation it might be modified by addition or removal of new/old fields. // So we must do a check for that. // this.putIdentifiedModificationFixed(id, Modification.UNKNOWN); diff --git a/src/com/massivecraft/massivecore/store/EntityContainerAbstract.java b/src/com/massivecraft/massivecore/store/EntityContainerAbstract.java index e819fc23..ef8c701e 100644 --- a/src/com/massivecraft/massivecore/store/EntityContainerAbstract.java +++ b/src/com/massivecraft/massivecore/store/EntityContainerAbstract.java @@ -244,8 +244,8 @@ public abstract class EntityContainerAbstract> imple protected synchronized String attach(E entity, Object oid, boolean noteModification) { // Check entity - if (entity == null) return null; - if (entity.attached()) return entity.getId(); + if (entity == null) throw new NullPointerException("entity"); + if (entity.attached()) throw new IllegalArgumentException("already attached"); String id; // Check/Fix id @@ -259,7 +259,7 @@ public abstract class EntityContainerAbstract> imple if (id == null) return null; if (this.getIdToEntity().containsKey(id)) return null; } - + // PRE this.preAttach(entity, id); @@ -269,7 +269,6 @@ public abstract class EntityContainerAbstract> imple // Attach this.getIdToEntityRaw().put(id, entity); - // Identify Modification if (noteModification) {