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

@ -36,6 +36,12 @@ public class FlagWatcher {
protected FlagWatcher(int entityId) {
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();

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, "");
}