Clone de watcher her hitler!

This commit is contained in:
Andrew 2013-07-16 22:31:16 +12:00
parent 5eca9c9d12
commit 996fe4a31e
4 changed files with 13 additions and 2 deletions

View file

@ -46,6 +46,7 @@ public class Disguise {
public Disguise clone() {
Disguise disguise = new Disguise(getType(), replaceSounds());
disguise.watcher = watcher.clone();
return disguise;
}

View file

@ -37,6 +37,12 @@ public class FlagWatcher {
this.entityId = entityId;
}
public FlagWatcher clone() {
FlagWatcher cloned = new FlagWatcher(entityId);
cloned.entityValues = (HashMap<Integer, Object>) entityValues.clone();
return cloned;
}
public List<WatchableObject> convert(List<WatchableObject> list) {
Iterator<WatchableObject> itel = list.iterator();
List<WatchableObject> newList = new ArrayList<WatchableObject>();

View file

@ -9,8 +9,6 @@ public class ItemFrameWatcher extends FlagWatcher {
public ItemFrameWatcher(int entityId) {
super(entityId);
// setValue(2, CraftItemStack.asCraftCopy(new ItemStack(0)));
// setValue(3, (byte) 0);
}
public ItemStack getItemStack() {

View file

@ -25,6 +25,12 @@ public class LivingWatcher extends FlagWatcher {
sendPotionEffects();
}
public LivingWatcher clone() {
LivingWatcher clone = this.clone();
clone.potionEffects = (HashSet<MobEffect>) potionEffects.clone();
return clone;
}
public String getCustomName() {
return (String) getValue(10, "");
}