PC-599
This commit is contained in:
parent
66e3a7ad5c
commit
99534e19c5
@ -312,38 +312,19 @@ public class UtilEnt
|
||||
|
||||
public static void removeGoalSelectors(Entity entity)
|
||||
{
|
||||
try
|
||||
if (((CraftEntity)entity).getHandle() instanceof EntityInsentient)
|
||||
{
|
||||
if (_goalSelector == null)
|
||||
{
|
||||
_goalSelector = EntityInsentient.class.getDeclaredField("goalSelector");
|
||||
_goalSelector.setAccessible(true);
|
||||
}
|
||||
|
||||
if (((CraftEntity)entity).getHandle() instanceof EntityInsentient)
|
||||
{
|
||||
EntityInsentient creature = (EntityInsentient)((CraftEntity)entity).getHandle();
|
||||
|
||||
PathfinderGoalSelector goalSelector = new PathfinderGoalSelector(((CraftWorld)entity.getWorld()).getHandle().methodProfiler);
|
||||
|
||||
_goalSelector.set(creature, goalSelector);
|
||||
}
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
EntityInsentient creature = (EntityInsentient)((CraftEntity)entity).getHandle();
|
||||
creature.goalSelector = new PathfinderGoalSelector(((CraftWorld)entity.getWorld()).getHandle().methodProfiler);
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeTargetSelectors(Entity entity)
|
||||
{
|
||||
if (((CraftEntity)entity).getHandle() instanceof EntityInsentient)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (NoSuchFieldException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (SecurityException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
EntityInsentient creature = (EntityInsentient)((CraftEntity)entity).getHandle();
|
||||
creature.targetSelector = new PathfinderGoalSelector(((CraftWorld)entity.getWorld()).getHandle().methodProfiler);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,8 @@ public class MountSlime extends Mount<SingleEntityMountData<Slime>>
|
||||
|
||||
mount.getEntity().setCustomName(player.getName() + "'s " + getName());
|
||||
|
||||
UtilEnt.removeTargetSelectors(mount.getEntity());
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(getName()) + "."));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user