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() { public Disguise clone() {
Disguise disguise = new Disguise(getType(), replaceSounds()); Disguise disguise = new Disguise(getType(), replaceSounds());
disguise.watcher = watcher.clone();
return disguise; return disguise;
} }

View File

@ -37,6 +37,12 @@ public class FlagWatcher {
this.entityId = 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) { public List<WatchableObject> convert(List<WatchableObject> list) {
Iterator<WatchableObject> itel = list.iterator(); Iterator<WatchableObject> itel = list.iterator();
List<WatchableObject> newList = new ArrayList<WatchableObject>(); List<WatchableObject> newList = new ArrayList<WatchableObject>();

View File

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

View File

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