Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-23 23:00:08 +01:00
Fix setting entity's target. Fixes BUKKIT-1358
Setting the goal target overrides the entity's will to do something else. This makes it so entities like wolves with attack another player with .setTarget(), instead of hanging next to their owner.
Dieser Commit ist enthalten in:
Ursprung
4c9bf34bf3
Commit
941650b9b2
@ -15,9 +15,11 @@ public class CraftCreature extends CraftLivingEntity implements Creature {
|
|||||||
EntityCreature entity = getHandle();
|
EntityCreature entity = getHandle();
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
entity.target = null;
|
entity.target = null;
|
||||||
|
entity.setGoalTarget(null);
|
||||||
} else if (target instanceof CraftLivingEntity) {
|
} else if (target instanceof CraftLivingEntity) {
|
||||||
entity.target = ((CraftLivingEntity) target).getHandle();
|
entity.target = ((CraftLivingEntity) target).getHandle();
|
||||||
entity.pathEntity = entity.world.findPath(entity, entity.target, 16.0F, true, false, false, true);
|
entity.pathEntity = entity.world.findPath(entity, entity.target, 16.0F, true, false, false, true);
|
||||||
|
entity.setGoalTarget(((CraftLivingEntity) target).getHandle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren