aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0989-Entity-Activation-Range-2.0.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0989-Entity-Activation-Range-2.0.patch')
-rw-r--r--patches/server/0989-Entity-Activation-Range-2.0.patch33
1 files changed, 17 insertions, 16 deletions
diff --git a/patches/server/0989-Entity-Activation-Range-2.0.patch b/patches/server/0989-Entity-Activation-Range-2.0.patch
index c26295b371..b0eff05afa 100644
--- a/patches/server/0989-Entity-Activation-Range-2.0.patch
+++ b/patches/server/0989-Entity-Activation-Range-2.0.patch
@@ -111,7 +111,7 @@ index bd8c96e914b156284bdbb960f168e63e1f122920..abb4c32e8b35de332fa517523e8c598e
} else {
passenger.stopRiding();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 3f620c4b8415f09a8d4664481b2d41d421ee836e..132ab49c02b83c37e1a64fc19f9bdfc04f52f2ed 100644
+index b108f779abe3d9798c0bcbc983f41d48b33aa153..a66fe080ee73171090abec48352ad0bd457a2a6f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -412,6 +412,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -183,10 +183,10 @@ index d6393210cfee53685f83c8491bea8b9c13b01eea..3d95257d2203fe40bb1fab58ad2a1f9e
public float getWalkTargetValue(BlockPos pos) {
return this.getWalkTargetValue(pos, this.level());
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
-index 07c1ca01c38d5d7d0a95ad5004b5df9f4a222935..e5995d0db5dcfba59a873ff439601894fdacd556 100644
+index 9be9a6a59666297e05a9fc19d9345ae7d5f3bf40..040d62effc651d14d3557f8ff582cb078b74ae1e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
-@@ -33,6 +33,7 @@ public class GoalSelector {
+@@ -34,6 +34,7 @@ public class GoalSelector {
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class);
private int tickCount;
private int newGoalRate = 3;
@@ -194,8 +194,8 @@ index 07c1ca01c38d5d7d0a95ad5004b5df9f4a222935..e5995d0db5dcfba59a873ff439601894
public GoalSelector(Supplier<ProfilerFiller> profiler) {
this.profiler = profiler;
-@@ -49,6 +50,20 @@ public class GoalSelector {
- });
+@@ -48,6 +49,20 @@ public class GoalSelector {
+ this.availableGoals.removeIf(goal -> predicate.test(goal.getGoal()));
}
+ // Paper start
@@ -213,10 +213,10 @@ index 07c1ca01c38d5d7d0a95ad5004b5df9f4a222935..e5995d0db5dcfba59a873ff439601894
+ }
+ // Paper end
public void removeGoal(Goal goal) {
- this.availableGoals.stream().filter((wrappedGoal) -> {
- return wrappedGoal.getGoal() == goal;
+ this.availableGoals.stream().filter(wrappedGoal -> wrappedGoal.getGoal() == goal).filter(WrappedGoal::isRunning).forEach(WrappedGoal::stop);
+ this.availableGoals.removeIf(wrappedGoal -> wrappedGoal.getGoal() == goal);
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
-index 9fc374c17f6b3ee4ab3c582d05e96321b772f2d6..07519c817cc6de04a98198c43a0c2b02ba3141eb 100644
+index 7b276b37433f054513e3eff88362424686eddebc..de7c3654b5d134e380c0d7e8800beb6c10d8a22a 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
@@ -23,6 +23,14 @@ public abstract class MoveToBlockGoal extends Goal {
@@ -234,7 +234,7 @@ index 9fc374c17f6b3ee4ab3c582d05e96321b772f2d6..07519c817cc6de04a98198c43a0c2b02
public MoveToBlockGoal(PathfinderMob mob, double speed, int range, int maxYDifference) {
this.mob = mob;
-@@ -114,6 +122,7 @@ public abstract class MoveToBlockGoal extends Goal {
+@@ -113,6 +121,7 @@ public abstract class MoveToBlockGoal extends Goal {
mutableBlockPos.setWithOffset(blockPos, m, k - 1, n);
if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
this.blockPos = mutableBlockPos;
@@ -302,7 +302,7 @@ index fa2569fecefb3e3af3264928a3c7a347710deedf..24044795d8e0f1fb15a4f2f5401f4489
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
-index b149e8bcac034bb3fc118a9adcb0de45e18ed5e9..fc35cfc9d045f3e5b6a50af1d0ba83b6e322091f 100644
+index eaafb57c14ead01ffd2650fdec9ca75406201e41..761142374f793a1cd4228936b21a68d7a0458894 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
@@ -52,6 +52,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
@@ -310,23 +310,24 @@ index b149e8bcac034bb3fc118a9adcb0de45e18ed5e9..fc35cfc9d045f3e5b6a50af1d0ba83b6
this.setEnabled(bl);
}
+ this.immunize(); // Paper
-
}
-@@ -89,10 +90,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
+ public boolean isEnabled() {
+@@ -87,11 +88,13 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
public boolean suckInItems() {
if (HopperBlockEntity.suckInItems(this.level(), this)) {
+ this.immunize(); // Paper
return true;
} else {
- for(ItemEntity itemEntity : this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.25D, 0.0D, 0.25D), EntitySelector.ENTITY_STILL_ALIVE)) {
+ for (ItemEntity itemEntity : this.level()
+ .getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.25, 0.0, 0.25), EntitySelector.ENTITY_STILL_ALIVE)) {
if (HopperBlockEntity.addItem(this, itemEntity)) {
+ this.immunize(); // Paper
return true;
}
}
-@@ -122,4 +125,11 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
+@@ -121,4 +124,11 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) {
return new HopperMenu(syncId, playerInventory, this);
}
@@ -356,10 +357,10 @@ index 5c209e323a5559480231c6d99357ba8b89edb027..4bedd5801cc8ce14387f02dfb361a00a
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
// Paper start - add paper world config
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
-index b1061db1d9b3bfde61d5016e10556c4320095827..c71690dbc3dc52803945f1608f0ee3ba94146354 100644
+index 7415011211925e962dcd1a3fdfde2c9bb6ec8335..5c59550db0ed7a6c1cf654fd5b251c3ba1e762fb 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
-@@ -143,6 +143,10 @@ public class PistonMovingBlockEntity extends BlockEntity {
+@@ -147,6 +147,10 @@ public class PistonMovingBlockEntity extends BlockEntity {
}
entity.setDeltaMovement(e, g, h);