Add more commenting, add addEntityAnimations to flagwatcher clone

This commit is contained in:
libraryaddict 2013-12-04 07:44:33 +13:00
parent 063b916c25
commit c6ff4dafe7
3 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,9 @@ public enum AnimalColor {
value = newValue;
}
/**
* The color ID as defined by nms internals.
*/
public int getId() {
return value;
}

View File

@ -48,12 +48,15 @@ public abstract class Disguise {
@Override
public abstract Disguise clone();
/**
* Seems I do this method so I can make cleaner constructors on disguises..
*/
protected void createDisguise(DisguiseType newType, boolean doSounds) {
if (getWatcher() != null)
return;
if (newType.getEntityType() == null) {
throw new RuntimeException("DisguiseType " + newType
+ " was used to attempt to construct a disguise, but this version of craftbukkit does not have that entity");
+ " was used in a futile attempt to construct a disguise, but this version of craftbukkit does not have that entity");
}
// Set the disguise type
disguiseType = newType;

View File

@ -67,6 +67,7 @@ public class FlagWatcher {
cloned.entityValues = (HashMap<Integer, Object>) entityValues.clone();
cloned.items = items.clone();
cloned.modifiedEntityAnimations = (HashSet) modifiedEntityAnimations.clone();
cloned.addEntityAnimations = addEntityAnimations;
return cloned;
}