Fix for missing clone of pig attributes.
This commit is contained in:
parent
29592823b6
commit
0c13d0d3e3
@ -42,7 +42,27 @@ public class VehicleCloner
|
||||
boat.setWorkOnLand(parentBoat.getWorkOnLand());
|
||||
boat.setVelocity(parentBoat.getVelocity());
|
||||
}
|
||||
else if (clone instanceof Horse) {
|
||||
else if (clone instanceof Animals) {
|
||||
Animals animal = (Animals)clone;
|
||||
Animals parentAnimal = (Animals)parent;
|
||||
|
||||
animal.setMaxHealth(parentAnimal.getMaxHealth());
|
||||
animal.setHealth(parentAnimal.getMaxHealth());
|
||||
animal.setRemainingAir(parentAnimal.getRemainingAir());
|
||||
animal.setMaximumAir(parentAnimal.getMaximumAir());
|
||||
animal.setMaximumNoDamageTicks(parentAnimal.getMaximumNoDamageTicks());
|
||||
animal.setLastDamage(parentAnimal.getLastDamage());
|
||||
animal.setNoDamageTicks(parentAnimal.getNoDamageTicks());
|
||||
animal.addPotionEffects(parentAnimal.getActivePotionEffects());
|
||||
animal.setRemoveWhenFarAway(parentAnimal.getRemoveWhenFarAway());
|
||||
animal.setCanPickupItems(parentAnimal.getCanPickupItems());
|
||||
animal.setCustomName(parentAnimal.getCustomName());
|
||||
animal.setCustomNameVisible(parentAnimal.isCustomNameVisible());
|
||||
animal.setTarget(parentAnimal.getTarget());
|
||||
animal.setAge(parentAnimal.getAge());
|
||||
animal.setAgeLock(parentAnimal.getAgeLock());
|
||||
|
||||
if (clone instanceof Horse) {
|
||||
Horse horse = (Horse)clone;
|
||||
Horse parentHorse = (Horse)parent;
|
||||
|
||||
@ -58,21 +78,6 @@ public class VehicleCloner
|
||||
horse.setStyle(parentHorse.getStyle());
|
||||
horse.setColor(parentHorse.getColor());
|
||||
horse.setVariant(parentHorse.getVariant());
|
||||
horse.setMaxHealth(parentHorse.getMaxHealth());
|
||||
horse.setHealth(parentHorse.getMaxHealth());
|
||||
horse.setRemainingAir(parentHorse.getRemainingAir());
|
||||
horse.setMaximumAir(parentHorse.getMaximumAir());
|
||||
horse.setMaximumNoDamageTicks(parentHorse.getMaximumNoDamageTicks());
|
||||
horse.setLastDamage(parentHorse.getLastDamage());
|
||||
horse.setNoDamageTicks(parentHorse.getNoDamageTicks());
|
||||
horse.addPotionEffects(parentHorse.getActivePotionEffects());
|
||||
horse.setRemoveWhenFarAway(parentHorse.getRemoveWhenFarAway());
|
||||
horse.setCanPickupItems(parentHorse.getCanPickupItems());
|
||||
horse.setCustomName(parentHorse.getCustomName());
|
||||
horse.setCustomNameVisible(parentHorse.isCustomNameVisible());
|
||||
horse.setTarget(parentHorse.getTarget());
|
||||
horse.setAge(parentHorse.getAge());
|
||||
horse.setAgeLock(parentHorse.getAgeLock());
|
||||
|
||||
if (parentHorse.isAdult()) {
|
||||
horse.setAdult();
|
||||
@ -83,6 +88,13 @@ public class VehicleCloner
|
||||
|
||||
horse.setBreed(parentHorse.canBreed());
|
||||
}
|
||||
else if (clone instanceof Pig) {
|
||||
Pig pig = (Pig)clone;
|
||||
Pig parentPig = (Pig)parent;
|
||||
|
||||
pig.setSaddle(parentPig.hasSaddle());
|
||||
}
|
||||
}
|
||||
else if (clone instanceof Minecart) {
|
||||
Minecart minecart = (Minecart)clone;
|
||||
Minecart parentMinecart = (Minecart)parent;
|
||||
@ -94,12 +106,6 @@ public class VehicleCloner
|
||||
minecart.setDamage(parentMinecart.getDamage());
|
||||
minecart.setVelocity(parentMinecart.getVelocity());
|
||||
}
|
||||
else if (clone instanceof Pig) {
|
||||
Pig pig = (Pig)clone;
|
||||
Pig parentPig = (Pig)parent;
|
||||
|
||||
pig.setSaddle(parentPig.hasSaddle());
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user