mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 21:37:28 +01:00
Do not re-wrap vanilla goals (#10751)
There is no need to rewrap vanilla goals when they're being reregistered, this breaks some expectations around behavior outside of general wasting of resources. Resolves: #10743
This commit is contained in:
parent
d644dfaa27
commit
e04d670f1d
1 changed files with 9 additions and 1 deletions
|
@ -483,7 +483,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ @Override
|
||||
+ public <T extends Mob> void addGoal(T mob, int priority, Goal<T> goal) {
|
||||
+ CraftMob craftMob = (CraftMob) mob;
|
||||
+ getHandle(craftMob, goal.getTypes()).addGoal(priority, new PaperCustomGoal<>(goal));
|
||||
+ net.minecraft.world.entity.ai.goal.Goal mojangGoal;
|
||||
+
|
||||
+ if (goal instanceof PaperVanillaGoal vanillaGoal) {
|
||||
+ mojangGoal = vanillaGoal.getHandle();
|
||||
+ } else {
|
||||
+ mojangGoal = new PaperCustomGoal<>(goal);
|
||||
+ }
|
||||
+
|
||||
+ getHandle(craftMob, goal.getTypes()).addGoal(priority, mojangGoal);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
|
Loading…
Add table
Reference in a new issue