mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-25 01:39:25 +00:00
Fix pushEntities causing a crash when there's an enderdragon in the world
This commit is contained in:
@@ -83,7 +83,7 @@ index 7554c109c35397bc1a43dd80e87764fd78645bbf..d60f30f7afb15cc90c1bd4b816136d00
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index 4dd2c4110d85bb7e6575b325196329900d719c64..b4a8a81f1fa091e45f1f39fdb69c61871d7dc6b9 100644
|
||||
index 9217983e973fb522776babe0588dd419653e3b39..e0341e79c87fe115732aab1aa0bd1d8c514ba7b8 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -1791,10 +1791,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -91,10 +91,10 @@ index 4dd2c4110d85bb7e6575b325196329900d719c64..b4a8a81f1fa091e45f1f39fdb69c6187
|
||||
}
|
||||
|
||||
- // Paper start - rewrite chunk system
|
||||
+ // Sakura start - add maxSearch to getEntities
|
||||
public <T extends Entity> void getEntities(final EntityTypeTest<Entity, T> entityTypeTest,
|
||||
final AABB boundingBox, final Predicate<? super T> predicate,
|
||||
final List<? super T> into, final int maxCount) {
|
||||
+ // Sakura start - add maxSearch to getEntities
|
||||
+ this.getEntities(entityTypeTest, boundingBox, predicate, into, maxCount, Integer.MAX_VALUE);
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Use maxEntityCollision limit for entity retrieval
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 7ed355448ff6fbcf585d82a88d456908f9eb3ae6..e7b92681e5d65892da00699cc29c713219c9db8c 100644
|
||||
index 7ed355448ff6fbcf585d82a88d456908f9eb3ae6..d0c013df89bb18ce0267b62461c69aaaec44e8c3 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3640,7 +3640,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3640,7 +3640,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return;
|
||||
}
|
||||
// Paper end - don't run getEntities if we're not going to use its result
|
||||
@@ -17,7 +17,11 @@ index 7ed355448ff6fbcf585d82a88d456908f9eb3ae6..e7b92681e5d65892da00699cc29c7132
|
||||
+ int limit = Math.max(_int, this.level().paperConfig().collisions.maxEntityCollisions);
|
||||
+ int search = limit * limit;
|
||||
+ List<Entity> entities = new ArrayList<>();
|
||||
+ this.level().getEntities(null, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule), entities, limit, search); // Paper - Climbing should not bypass cramming gamerule
|
||||
+ this.level().getEntities(
|
||||
+ EntityTypeTest.forClass(Entity.class), this.getBoundingBox(),
|
||||
+ EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule), // Paper - Climbing should not bypass cramming gamerule
|
||||
+ entities, limit, search
|
||||
+ );
|
||||
+ // Sakura end - use maxEntityCollision limit for entity retrieval
|
||||
if (!entities.isEmpty()) {
|
||||
// Paper - don't run getEntities if we're not going to use its result; moved up
|
||||
|
||||
Reference in New Issue
Block a user