mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-09 09:57:33 +01:00
Fix horse subclasses
This commit is contained in:
parent
afb7e13ee6
commit
728930a09f
@ -6,7 +6,6 @@ import org.bukkit.craftbukkit.v1_11_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftDonkey;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity;
|
||||
import org.bukkit.entity.Donkey;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
@ -37,7 +36,7 @@ public class HorseDonkeyController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public void spawn(Location at, NPC npc) {
|
||||
npc.getTrait(HorseModifiers.class);
|
||||
npc.addTrait(HorseModifiers.class);
|
||||
super.spawn(at, npc);
|
||||
}
|
||||
|
||||
@ -53,7 +52,7 @@ public class HorseDonkeyController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
NMSImpl.clearGoals(goalSelector, targetSelector);
|
||||
((Horse) getBukkitEntity()).setDomestication(((Horse) getBukkitEntity()).getMaxDomestication());
|
||||
((Donkey) getBukkitEntity()).setDomestication(((Donkey) getBukkitEntity()).getMaxDomestication());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@ import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftMule;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.Mule;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -53,7 +52,7 @@ public class HorseMuleController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
NMSImpl.clearGoals(goalSelector, targetSelector);
|
||||
((Horse) getBukkitEntity()).setDomestication(((Horse) getBukkitEntity()).getMaxDomestication());
|
||||
((Mule) getBukkitEntity()).setDomestication(((Mule) getBukkitEntity()).getMaxDomestication());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@ import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftSkeletonHorse;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.SkeletonHorse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -53,7 +52,8 @@ public class HorseSkeletonController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
NMSImpl.clearGoals(goalSelector, targetSelector);
|
||||
((Horse) getBukkitEntity()).setDomestication(((Horse) getBukkitEntity()).getMaxDomestication());
|
||||
((SkeletonHorse) getBukkitEntity())
|
||||
.setDomestication(((SkeletonHorse) getBukkitEntity()).getMaxDomestication());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@ import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftZombieHorse;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.ZombieHorse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -53,7 +52,8 @@ public class HorseZombieController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
NMSImpl.clearGoals(goalSelector, targetSelector);
|
||||
((Horse) getBukkitEntity()).setDomestication(((Horse) getBukkitEntity()).getMaxDomestication());
|
||||
((ZombieHorse) getBukkitEntity())
|
||||
.setDomestication(((ZombieHorse) getBukkitEntity()).getMaxDomestication());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user