3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-22 14:28:09 +01:00
Paper/patches/removed/1.17/0372-Reduce-sync-loads.patch

34 Zeilen
1.8 KiB
Diff

These hunks are for getEntities, which Mojang rewrote in 1.17.
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 3a1b9f1ba19b28cebdafeb3b2476217d47213862..3e2cd6c7a34c1a792d7346019a8b039d1f4a7c04 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1130,7 +1130,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
2021-06-11 14:02:28 +02:00
for (int i1 = i; i1 <= j; ++i1) {
for (int j1 = k; j1 <= l; ++j1) {
- LevelChunk chunk = ichunkprovider.getChunk(i1, j1, false);
+ LevelChunk chunk = (LevelChunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper
2021-06-11 14:02:28 +02:00
if (chunk != null) {
chunk.getEntities(except, box, list, predicate);
@@ -1151,7 +1151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
2021-06-11 14:02:28 +02:00
for (int i1 = i; i1 < j; ++i1) {
for (int j1 = k; j1 < l; ++j1) {
- LevelChunk chunk = this.getChunkSource().getChunk(i1, j1, false);
+ LevelChunk chunk = (LevelChunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper
2021-06-11 14:02:28 +02:00
if (chunk != null) {
chunk.getEntities(type, box, list, predicate);
@@ -1174,7 +1174,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
2021-06-11 14:02:28 +02:00
for (int i1 = i; i1 < j; ++i1) {
for (int j1 = k; j1 < l; ++j1) {
- LevelChunk chunk = ichunkprovider.getChunk(i1, j1, false);
+ LevelChunk chunk = (LevelChunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper
2021-06-11 14:02:28 +02:00
if (chunk != null) {
chunk.getEntitiesOfClass(entityClass, box, list, predicate);