mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 17:07:34 +01:00
add back Optimize collision to not load chunks
This commit is contained in:
parent
c280dbeed0
commit
f331ac28e0
@ -6177,7 +6177,7 @@ index 208a713ec4b7b592801eb26860b7b81a2b3f7aa2..df787c12053f799b111c539d866ff8c7
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||||
index 76251b5adf41f8e5bf2c07145abe3108fcde8669..03e0254813b977d0342171a37762fec9629afbad 100644
|
index 76251b5adf41f8e5bf2c07145abe3108fcde8669..a60b8043540cacfa8cc3baba0872eefd4fc9464d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
|
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||||
@@ -9,10 +9,12 @@ import javax.annotation.Nullable;
|
@@ -9,10 +9,12 @@ import javax.annotation.Nullable;
|
||||||
@ -6198,7 +6198,7 @@ index 76251b5adf41f8e5bf2c07145abe3108fcde8669..03e0254813b977d0342171a37762fec9
|
|||||||
|
|
||||||
BlockState getBlockState(BlockPos pos);
|
BlockState getBlockState(BlockPos pos);
|
||||||
+ // Paper start - if loaded util
|
+ // Paper start - if loaded util
|
||||||
+ BlockState getTypeIfLoaded(BlockPos blockposition);
|
+ @Nullable BlockState getTypeIfLoaded(BlockPos blockposition);
|
||||||
+ default Material getMaterialIfLoaded(BlockPos blockposition) {
|
+ default Material getMaterialIfLoaded(BlockPos blockposition) {
|
||||||
+ BlockState type = this.getTypeIfLoaded(blockposition);
|
+ BlockState type = this.getTypeIfLoaded(blockposition);
|
||||||
+ return type == null ? null : type.getMaterial();
|
+ return type == null ? null : type.getMaterial();
|
||||||
@ -6278,7 +6278,7 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..c7d499bfc22152e0a49f50a2a8133f31
|
|||||||
public BlockState getBlockState(BlockPos pos) {
|
public BlockState getBlockState(BlockPos pos) {
|
||||||
return Blocks.AIR.defaultBlockState();
|
return Blocks.AIR.defaultBlockState();
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index e2b9c20a82630f1991228c6194acef5ef6a7b8b0..d449516a2aafebe3cda9810b7d1ee97e61e8f399 100644
|
index e2b9c20a82630f1991228c6194acef5ef6a7b8b0..8427d08ca3b61cce9d7bbdfdcf5946e1f459a21f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -85,6 +85,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
@@ -85,6 +85,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
||||||
@ -6289,7 +6289,7 @@ index e2b9c20a82630f1991228c6194acef5ef6a7b8b0..d449516a2aafebe3cda9810b7d1ee97e
|
|||||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||||
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||||
@@ -271,18 +272,50 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -271,18 +272,51 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return y < -20000000 || y >= 20000000;
|
return y < -20000000 || y >= 20000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6314,6 +6314,7 @@ index e2b9c20a82630f1991228c6194acef5ef6a7b8b0..d449516a2aafebe3cda9810b7d1ee97e
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
+ @Nullable
|
||||||
+ public final BlockState getTypeIfLoaded(BlockPos blockposition) {
|
+ public final BlockState getTypeIfLoaded(BlockPos blockposition) {
|
||||||
+ // CraftBukkit start - tree generation
|
+ // CraftBukkit start - tree generation
|
||||||
+ if (captureTreeGeneration) {
|
+ if (captureTreeGeneration) {
|
||||||
@ -6344,7 +6345,7 @@ index e2b9c20a82630f1991228c6194acef5ef6a7b8b0..d449516a2aafebe3cda9810b7d1ee97e
|
|||||||
ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create);
|
ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create);
|
||||||
|
|
||||||
if (ichunkaccess == null && create) {
|
if (ichunkaccess == null && create) {
|
||||||
@@ -293,7 +326,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -293,7 +327,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -6353,7 +6354,7 @@ index e2b9c20a82630f1991228c6194acef5ef6a7b8b0..d449516a2aafebe3cda9810b7d1ee97e
|
|||||||
return this.setBlock(pos, state, flags, 512);
|
return this.setBlock(pos, state, flags, 512);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -598,7 +631,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -598,7 +632,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
if (this.isOutsideBuildHeight(pos)) {
|
if (this.isOutsideBuildHeight(pos)) {
|
||||||
return Blocks.VOID_AIR.defaultBlockState();
|
return Blocks.VOID_AIR.defaultBlockState();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1041,7 +1041,7 @@ index 4dd57007af218ba1c0e666117a49939c5884f2c6..a6cb949b6f048455acc50c897fdd93d3
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 3f938d953daee7a5551a62df25f2e0fb487733ec..cab03a81a97d851db61e517cfe3a43fa8afd32b2 100644
|
index 6e5a25db47b0de69303060ad172eae7c9b8b0905..66416d761cc71b2d57acb840b781870dc3180c46 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1,8 +1,10 @@
|
@@ -1,8 +1,10 @@
|
||||||
@ -1582,7 +1582,7 @@ index 010d7a0dc97c7bdd3fbafe974aa73f3dba106d4d..906c23068d1f5be76a6985b7255f6f15
|
|||||||
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
|
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
|
||||||
this.hurt(DamageSource.DROWN, 1.0F);
|
this.hurt(DamageSource.DROWN, 1.0F);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index d449516a2aafebe3cda9810b7d1ee97e61e8f399..99685c3ad91ca0e3bf20fb6ca100466ec14b7a0f 100644
|
index 8427d08ca3b61cce9d7bbdfdcf5946e1f459a21f..2bee54c8008e9c5a353b971c40d0a11722cd5eff 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -83,7 +83,6 @@ import org.bukkit.Bukkit;
|
@@ -83,7 +83,6 @@ import org.bukkit.Bukkit;
|
||||||
@ -1611,7 +1611,7 @@ index d449516a2aafebe3cda9810b7d1ee97e61e8f399..99685c3ad91ca0e3bf20fb6ca100466e
|
|||||||
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
|
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
|
||||||
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
|
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
|
||||||
}
|
}
|
||||||
@@ -728,15 +727,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -729,15 +728,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
timings.tileEntityTick.stopTiming(); // Spigot
|
timings.tileEntityTick.stopTiming(); // Spigot
|
||||||
this.tickingBlockEntities = false;
|
this.tickingBlockEntities = false;
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity and entity crashes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index e112598c854a2c93a8e6b6bda3cfdd4ee4091980..1195a4b79103d62ed4f8c91dd36ccd77fa561f01 100644
|
index 0fa0bd695cc6d71eaba1565a408a2a0c257c3838..f5dd0965b8194aa6e6b82ac22238f7c78690110e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -737,11 +737,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -738,11 +738,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
try {
|
try {
|
||||||
tickConsumer.accept(entity);
|
tickConsumer.accept(entity);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index d8da1dfdc58726eda01e1bfb059c144e98ce7fe8..8e06ce1d838b9eaa71a699a999e91dcd5d596a7b 100644
|
index 809f1ac0aca97d484e2f92ebf38a0303499f08ae..db226fe9515e904b8520a063b6dcde62b315a9b1 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -703,9 +703,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -704,9 +704,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// Spigot start
|
// Spigot start
|
||||||
// Iterator iterator = this.blockEntityTickers.iterator();
|
// Iterator iterator = this.blockEntityTickers.iterator();
|
||||||
int tilesThisCycle = 0;
|
int tilesThisCycle = 0;
|
||||||
|
@ -108,7 +108,7 @@ index 4cde8d630a0951f297622af4ef781f5b3fabf9af..7044d8c71e85551e11bf2d96b767e088
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 8e06ce1d838b9eaa71a699a999e91dcd5d596a7b..79764895307139b34f2b018f3be86d6610503b64 100644
|
index db226fe9515e904b8520a063b6dcde62b315a9b1..4060b72729609f66e5ad7b14f4aafa3c6a79a0e1 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -1,5 +1,10 @@
|
@@ -1,5 +1,10 @@
|
||||||
@ -122,7 +122,7 @@ index 8e06ce1d838b9eaa71a699a999e91dcd5d596a7b..79764895307139b34f2b018f3be86d66
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.mojang.serialization.Codec;
|
import com.mojang.serialization.Codec;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -739,6 +744,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -740,6 +745,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// Paper start - Prevent tile entity and entity crashes
|
// Paper start - Prevent tile entity and entity crashes
|
||||||
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||||
MinecraftServer.LOGGER.error(msg, throwable);
|
MinecraftServer.LOGGER.error(msg, throwable);
|
||||||
|
@ -19,10 +19,10 @@ index 032e1e08413f2d0f601cdc32fe12145e2c1fec5f..19c97a14cbf23130db2de80e3f7f6e0c
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 79764895307139b34f2b018f3be86d6610503b64..507d38a8e7b643712fe235c73f440c0a52b6d8b2 100644
|
index 4060b72729609f66e5ad7b14f4aafa3c6a79a0e1..a4c0b2ee7a5c6a11ed2f93c63106570f1dfb2072 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -313,11 +313,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -314,11 +314,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,10 +30,10 @@ index 9f7bbd602c19f317d05cd8b72453c2e37d8acff5..bd53d00db453767fb43ba0e50c0dc0a7
|
|||||||
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
|
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
|
||||||
return this.chunkSource.getChunk(x, z, false);
|
return this.chunkSource.getChunk(x, z, false);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index b6f2be487720e31a548a3cee4cd73319f402f6ff..bb6083b40e211964730f88057df509f6d860bc11 100644
|
index f652b3f04ee80b1bc8ac6873cb93e8ea34082cdc..2cc265cb984160047a44261ebbf5ff718bdf6b0c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -474,7 +474,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -475,7 +475,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
|
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
|
||||||
CraftWorld world = ((ServerLevel) this).getWorld();
|
CraftWorld world = ((ServerLevel) this).getWorld();
|
||||||
@ -42,7 +42,7 @@ index b6f2be487720e31a548a3cee4cd73319f402f6ff..bb6083b40e211964730f88057df509f6
|
|||||||
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
|
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
|
||||||
this.getCraftServer().getPluginManager().callEvent(event);
|
this.getCraftServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
@@ -587,7 +587,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -588,7 +588,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
try {
|
try {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
CraftWorld world = ((ServerLevel) this).getWorld();
|
CraftWorld world = ((ServerLevel) this).getWorld();
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index bb6083b40e211964730f88057df509f6d860bc11..7c0437929964d95797c13b690a6167f2bce95736 100644
|
index 2cc265cb984160047a44261ebbf5ff718bdf6b0c..2cec48979dafd3edf8c6744e2f5f65a922537b0f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -545,6 +545,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -546,6 +546,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public void setBlocksDirty(BlockPos pos, BlockState old, BlockState updated) {}
|
public void setBlocksDirty(BlockPos pos, BlockState old, BlockState updated) {}
|
||||||
|
|
||||||
public void updateNeighborsAt(BlockPos pos, Block block) {
|
public void updateNeighborsAt(BlockPos pos, Block block) {
|
||||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z
|
|||||||
Reduce method invocations for World.isLoaded(BlockPosition)Z
|
Reduce method invocations for World.isLoaded(BlockPosition)Z
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 8142f6c2d3bd17aec313d46141910f0743c6345e..ca2e81b9eace4124b83588c604a88a0e5595c6e6 100644
|
index 11cd3fc535717f074c20a39b4248d623176f7445..7a392ab56a95bba28aca33be6a738136a6803e0c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -320,6 +320,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -321,6 +321,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return chunk == null ? null : chunk.getFluidState(blockposition);
|
return chunk == null ? null : chunk.getFluidState(blockposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 8fbf239cdc5bc2f1ec7b91eaee85d032e65f250f..8844a6d3e06d5a29013fdf78072109cc50819d71 100644
|
index d6a7e8ea664143f0a85f977bcecc93de4681c39b..515ca01ac46df23399ff49ca53d336db68b5a898 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -731,6 +731,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -732,6 +732,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// Spigot start
|
// Spigot start
|
||||||
// Iterator iterator = this.blockEntityTickers.iterator();
|
// Iterator iterator = this.blockEntityTickers.iterator();
|
||||||
int tilesThisCycle = 0;
|
int tilesThisCycle = 0;
|
||||||
@ -17,7 +17,7 @@ index 8fbf239cdc5bc2f1ec7b91eaee85d032e65f250f..8844a6d3e06d5a29013fdf78072109cc
|
|||||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||||
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
|
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
|
||||||
@@ -738,7 +740,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -739,7 +741,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
if (tickingblockentity == null) {
|
if (tickingblockentity == null) {
|
||||||
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
|
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
|
||||||
tilesThisCycle--;
|
tilesThisCycle--;
|
||||||
@ -25,7 +25,7 @@ index 8fbf239cdc5bc2f1ec7b91eaee85d032e65f250f..8844a6d3e06d5a29013fdf78072109cc
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Spigot end
|
// Spigot end
|
||||||
@@ -746,12 +747,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -747,12 +748,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
if (tickingblockentity.isRemoved()) {
|
if (tickingblockentity.isRemoved()) {
|
||||||
// Spigot start
|
// Spigot start
|
||||||
tilesThisCycle--;
|
tilesThisCycle--;
|
||||||
|
@ -18,7 +18,7 @@ the blockstate that will be valid for restoration, as opposed to dropping
|
|||||||
information on restoration when the event is cancelled.
|
information on restoration when the event is cancelled.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 8844a6d3e06d5a29013fdf78072109cc50819d71..21491224a8383cef2d41b0da2e7de9362fe1d27f 100644
|
index 515ca01ac46df23399ff49ca53d336db68b5a898..04d5c09def0901ad36bab682a333bc41278dadf9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -142,7 +142,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -142,7 +142,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -30,7 +30,7 @@ index 8844a6d3e06d5a29013fdf78072109cc50819d71..21491224a8383cef2d41b0da2e7de936
|
|||||||
public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>();
|
public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>();
|
||||||
public List<ItemEntity> captureDrops;
|
public List<ItemEntity> captureDrops;
|
||||||
public long ticksPerAnimalSpawns;
|
public long ticksPerAnimalSpawns;
|
||||||
@@ -362,7 +362,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -363,7 +363,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
|
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
|
||||||
// CraftBukkit start - tree generation
|
// CraftBukkit start - tree generation
|
||||||
if (this.captureTreeGeneration) {
|
if (this.captureTreeGeneration) {
|
||||||
@ -39,7 +39,7 @@ index 8844a6d3e06d5a29013fdf78072109cc50819d71..21491224a8383cef2d41b0da2e7de936
|
|||||||
if (blockstate == null) {
|
if (blockstate == null) {
|
||||||
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
|
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
|
||||||
this.capturedBlockStates.put(pos.immutable(), blockstate);
|
this.capturedBlockStates.put(pos.immutable(), blockstate);
|
||||||
@@ -382,7 +382,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -383,7 +383,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// CraftBukkit start - capture blockstates
|
// CraftBukkit start - capture blockstates
|
||||||
boolean captured = false;
|
boolean captured = false;
|
||||||
if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) {
|
if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) {
|
||||||
@ -49,7 +49,7 @@ index 8844a6d3e06d5a29013fdf78072109cc50819d71..21491224a8383cef2d41b0da2e7de936
|
|||||||
this.capturedBlockStates.put(pos.immutable(), blockstate);
|
this.capturedBlockStates.put(pos.immutable(), blockstate);
|
||||||
captured = true;
|
captured = true;
|
||||||
}
|
}
|
||||||
@@ -651,7 +652,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -652,7 +653,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public BlockState getBlockState(BlockPos pos) {
|
public BlockState getBlockState(BlockPos pos) {
|
||||||
// CraftBukkit start - tree generation
|
// CraftBukkit start - tree generation
|
||||||
if (this.captureTreeGeneration) {
|
if (this.captureTreeGeneration) {
|
||||||
|
@ -31,10 +31,10 @@ index 138422903dcb3056cd011a72e0625a1a225b4280..b92c2d5f9ad3936f619b51c79379983e
|
|||||||
|
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 21491224a8383cef2d41b0da2e7de9362fe1d27f..0e71e1cb15640d397b4da9a8cfef4fdf0a61ec51 100644
|
index 04d5c09def0901ad36bab682a333bc41278dadf9..ee5ee37dd8445b4e1efb5484918ff8ed337808ed 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -775,6 +775,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -776,6 +776,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ floating in the air.
|
|||||||
This can replace many uses of BlockPhysicsEvent
|
This can replace many uses of BlockPhysicsEvent
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 0663aa74688104c551e8ef52b01947dacf95bb22..f7fccb4761e829a2a1d431f56cfb4288ae0bbd2d 100644
|
index 2f77678e48b6b73d3fc13862623103d3ec61090f..bd81eea401b582447a1e03c76a8356d94b2891d6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -28,6 +28,7 @@ import net.minecraft.nbt.CompoundTag;
|
@@ -28,6 +28,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||||
@ -22,7 +22,7 @@ index 0663aa74688104c551e8ef52b01947dacf95bb22..f7fccb4761e829a2a1d431f56cfb4288
|
|||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.level.ChunkHolder;
|
import net.minecraft.server.level.ChunkHolder;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
@@ -564,8 +565,20 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -565,8 +566,20 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
FluidState fluid = this.getFluidState(pos);
|
FluidState fluid = this.getFluidState(pos);
|
||||||
|
@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to
|
|||||||
just do a get call since the value can never be null.
|
just do a get call since the value can never be null.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index f7fccb4761e829a2a1d431f56cfb4288ae0bbd2d..faaa93e77523fbb942690491687410df48899ddb 100644
|
index bd81eea401b582447a1e03c76a8356d94b2891d6..a3f6fd658b24c4c68644482bba2ac5dcdb1707ce 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -875,9 +875,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -876,9 +876,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public BlockEntity getBlockEntity(BlockPos blockposition, boolean validate) {
|
public BlockEntity getBlockEntity(BlockPos blockposition, boolean validate) {
|
||||||
|
@ -14,10 +14,10 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
|
|||||||
Combined, this adds up a lot.
|
Combined, this adds up a lot.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index de7abae207b0a565a25fa4ed2f66b94c6b0cdcf9..6ec5a6239b6144b2e3f9edcafdfd6fed6de6cbcd 100644
|
index 04ef0245877ab7e6978149209549151e4f157920..de069f9f7af5ff3e346d68e254ae7138fb19f3f3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -984,7 +984,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -985,7 +985,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ movement will load only the chunk the player enters anyways and avoids loading
|
|||||||
massive amounts of surrounding chunks due to large AABB lookups.
|
massive amounts of surrounding chunks due to large AABB lookups.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index c0e8e863708ac794b7271765cdae99dc4df14caa..142e5bc63ede1593662ef1d502d05c0965c1a798 100644
|
index 494b18a3dfa05b5e6ecbb9b99abf06bfe6e1d166..5c54bc74c668778161ae47c9160f8c4c9a566847 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -792,6 +792,7 @@ public abstract class PlayerList {
|
@@ -791,6 +791,7 @@ public abstract class PlayerList {
|
||||||
entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@ -26,10 +26,10 @@ index c0e8e863708ac794b7271765cdae99dc4df14caa..142e5bc63ede1593662ef1d502d05c09
|
|||||||
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index f8c611a6a55dd56e5231834c9481c61727b628e9..1164fc5915f0121b697ea10fac73919597902026 100644
|
index c7581c1b306d9c6498e18456d67f5acd067357e6..82068b1ccc958fd9c1ba6887cf3ffad1c0660f07 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -172,6 +172,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -172,6 +172,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
||||||
@ -37,45 +37,31 @@ index f8c611a6a55dd56e5231834c9481c61727b628e9..1164fc5915f0121b697ea10fac739195
|
|||||||
private CraftEntity bukkitEntity;
|
private CraftEntity bukkitEntity;
|
||||||
|
|
||||||
public net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper
|
public net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/CollisionGetter.java b/src/main/java/net/minecraft/world/level/CollisionGetter.java
|
diff --git a/src/main/java/net/minecraft/world/level/BlockCollisions.java b/src/main/java/net/minecraft/world/level/BlockCollisions.java
|
||||||
index b980c26ab5cac02e03525177a9dc4fb0b6a2f9f6..2a784a8342e708e0813c7076a2ca8e429446ffd3 100644
|
index 301b0545e40b95497e6f35ae0fbfdf72f63e4a1a..b0ac1457c61e8831da77a54030f124f4c2c1c8b9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/CollisionGetter.java
|
--- a/src/main/java/net/minecraft/world/level/BlockCollisions.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/CollisionGetter.java
|
+++ b/src/main/java/net/minecraft/world/level/BlockCollisions.java
|
||||||
@@ -55,7 +55,9 @@ public interface CollisionGetter extends BlockGetter {
|
@@ -66,22 +66,41 @@ public class BlockCollisions extends AbstractIterator<VoxelShape> {
|
||||||
}
|
protected VoxelShape computeNext() {
|
||||||
|
|
||||||
default boolean noCollision(@Nullable Entity entity, AABB box, Predicate<Entity> filter) {
|
|
||||||
+ try { if (entity != null) entity.collisionLoadChunks = true; // Paper
|
|
||||||
return this.getCollisions(entity, box, filter).allMatch(VoxelShape::isEmpty);
|
|
||||||
+ } finally { if (entity != null) entity.collisionLoadChunks = false; } // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
Stream<VoxelShape> getEntityCollisions(@Nullable Entity entity, AABB box, Predicate<Entity> predicate);
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
|
||||||
index e6190bfb893de12e87e1da49001ebd963b3d6318..e4122469b839103f5c0fce38822d408a903dc0a5 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
|
||||||
@@ -64,21 +64,42 @@ public class CollisionSpliterator extends AbstractSpliterator<VoxelShape> {
|
|
||||||
boolean collisionCheck(Consumer<? super VoxelShape> action) {
|
|
||||||
while(true) {
|
while(true) {
|
||||||
if (this.cursor.advance()) {
|
if (this.cursor.advance()) {
|
||||||
- int i = this.cursor.nextX();
|
- int i = this.cursor.nextX();
|
||||||
- int j = this.cursor.nextY();
|
- int j = this.cursor.nextY();
|
||||||
- int k = this.cursor.nextZ();
|
- int k = this.cursor.nextZ();
|
||||||
+ int i = this.cursor.nextX(); final int x = i;
|
+ int i = this.cursor.nextX(); final int x = i; // Paper
|
||||||
+ int j = this.cursor.nextY(); final int y = j;
|
+ int j = this.cursor.nextY(); final int y = j; // Paper
|
||||||
+ int k = this.cursor.nextZ(); final int z = k;
|
+ int k = this.cursor.nextZ(); final int z = k; // Paper
|
||||||
int l = this.cursor.getNextType();
|
int l = this.cursor.getNextType();
|
||||||
if (l == 3) {
|
if (l == 3) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
+ // Paper start - ensure we don't load chunks
|
||||||
|
+ final @Nullable Entity source = this.context instanceof net.minecraft.world.phys.shapes.EntityCollisionContext entityContext ? entityContext.getEntity() : null;
|
||||||
|
+ boolean far = source != null && net.minecraft.server.MCUtil.distanceSq(source.getX(), y, source.getZ(), x, y, z) > 14;
|
||||||
|
+ this.pos.set(x, y, z);
|
||||||
|
|
||||||
- BlockGetter blockGetter = this.getChunk(i, k);
|
- BlockGetter blockGetter = this.getChunk(i, k);
|
||||||
- if (blockGetter == null) {
|
- if (blockGetter == null) {
|
||||||
+ // Paper start - ensure we don't load chunks
|
|
||||||
+ boolean far = this.source != null && net.minecraft.server.MCUtil.distanceSq(this.source.getX(), y, this.source.getZ(), x, y, z) > 14;
|
|
||||||
+ this.pos.set(x, y, z);
|
|
||||||
+
|
|
||||||
+ BlockState blockState;
|
+ BlockState blockState;
|
||||||
+ if (this.collisionGetter instanceof net.minecraft.server.level.WorldGenRegion) {
|
+ if (this.collisionGetter instanceof net.minecraft.server.level.WorldGenRegion) {
|
||||||
+ BlockGetter blockGetter = this.getChunk(x, z);
|
+ BlockGetter blockGetter = this.getChunk(x, z);
|
||||||
@ -83,30 +69,48 @@ index e6190bfb893de12e87e1da49001ebd963b3d6318..e4122469b839103f5c0fce38822d408a
|
|||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ blockState = blockGetter.getBlockState(this.pos);
|
+ blockState = blockGetter.getBlockState(this.pos);
|
||||||
+ } else if ((!far && this.source instanceof net.minecraft.server.level.ServerPlayer) || (this.source != null && this.source.collisionLoadChunks)) {
|
+ } else if ((!far && source instanceof net.minecraft.server.level.ServerPlayer) || (source != null && source.collisionLoadChunks)) {
|
||||||
+ blockState = this.collisionGetter.getBlockState(this.pos);
|
+ blockState = this.collisionGetter.getBlockState(this.pos);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ blockState = this.collisionGetter.getTypeIfLoaded(this.pos);
|
+ blockState = this.collisionGetter.getTypeIfLoaded(this.pos);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (blockState == null) {
|
+ if (blockState == null) {
|
||||||
+ if (!(this.source instanceof net.minecraft.server.level.ServerPlayer) || this.source.level.paperConfig.preventMovingIntoUnloadedChunks) {
|
+ if (!(source instanceof net.minecraft.server.level.ServerPlayer) || source.level.paperConfig.preventMovingIntoUnloadedChunks) {
|
||||||
+ VoxelShape voxelshape3 = Shapes.create(far ? this.source.getBoundingBox() : new AABB(new BlockPos(x, y, z)));
|
+ return Shapes.create(far ? source.getBoundingBox() : new AABB(new BlockPos(x, y, z)));
|
||||||
+ action.accept(voxelshape3);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
+ }
|
||||||
|
+ // Paper end
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
+ // Paper - moved up
|
|
||||||
+ // Paper end
|
|
||||||
|
|
||||||
- this.pos.set(i, j, k);
|
- this.pos.set(i, j, k);
|
||||||
- BlockState blockState = blockGetter.getBlockState(this.pos);
|
- BlockState blockState = blockGetter.getBlockState(this.pos);
|
||||||
if (!this.predicate.test(blockState, this.pos) || l == 1 && !blockState.hasLargeCollisionShape() || l == 2 && !blockState.is(Blocks.MOVING_PISTON)) {
|
- if (this.onlySuffocatingBlocks && !blockState.isSuffocating(blockGetter, this.pos) || l == 1 && !blockState.hasLargeCollisionShape() || l == 2 && !blockState.is(Blocks.MOVING_PISTON)) {
|
||||||
|
+ // Paper - moved up
|
||||||
|
+ if (/*this.onlySuffocatingBlocks && (!blockState.isSuffocating(blockGetter, this.pos)) ||*/ l == 1 && !blockState.hasLargeCollisionShape() || l == 2 && !blockState.is(Blocks.MOVING_PISTON)) { // Paper - onlySuffocatingBlocks is only true on the client, so we don't care about it here
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/CollisionGetter.java b/src/main/java/net/minecraft/world/level/CollisionGetter.java
|
||||||
|
index 4c373d6c8ddd9f5db88888cd8dbbfc24eb5df793..56d94c94fb0d4dc468bb5d69be655ddd5c6b5360 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/CollisionGetter.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/CollisionGetter.java
|
||||||
|
@@ -44,11 +44,13 @@ public interface CollisionGetter extends BlockGetter {
|
||||||
|
}
|
||||||
|
|
||||||
|
default boolean noCollision(@Nullable Entity entity, AABB box) {
|
||||||
|
+ try { if (entity != null) entity.collisionLoadChunks = true; // Paper
|
||||||
|
for(VoxelShape voxelShape : this.getBlockCollisions(entity, box)) {
|
||||||
|
if (!voxelShape.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ } finally { if (entity != null) entity.collisionLoadChunks = false; } // Paper
|
||||||
|
|
||||||
|
if (!this.getEntityCollisions(entity, box).isEmpty()) {
|
||||||
|
return false;
|
||||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
index 5af90e0f7222356cb0e905a9b6e0c4eac5617a41..ee5fa14d2232b145806aefcaffb5c6348a08058a 100644
|
index 48812329969b7192acd948db974bb77bb546f979..5b1e0ea40dea6c7d787699ed25160c8b75ab3bf3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
@@ -237,7 +237,8 @@ public final class Shapes {
|
@@ -237,7 +237,8 @@ public final class Shapes {
|
@ -32,7 +32,7 @@ index fd609c7b757b570206c17444867f786c1767aa69..d507adcb538933fcf36e9a4bfb561106
|
|||||||
this.gameMode.setLevel((ServerLevel) world);
|
this.gameMode.setLevel((ServerLevel) world);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index 494b18a3dfa05b5e6ecbb9b99abf06bfe6e1d166..af93692bb5cc232397cec69ce2bd836a956550ef 100644
|
index 5c54bc74c668778161ae47c9160f8c4c9a566847..8901bb31524613bf3fbec3cc5d3c228f8b3f43a4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -210,6 +210,8 @@ public abstract class PlayerList {
|
@@ -210,6 +210,8 @@ public abstract class PlayerList {
|
@ -274,7 +274,7 @@ index 847d1b447e3796cc03e26df46b92815a76707b81..0758f0983c17e7e4b5b5aea64ea12e99
|
|||||||
list.stream().map((playerchunk) -> {
|
list.stream().map((playerchunk) -> {
|
||||||
CompletableFuture completablefuture;
|
CompletableFuture completablefuture;
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index af93692bb5cc232397cec69ce2bd836a956550ef..fd0aea068fe4bec0bd02a372afd7475314ceb88a 100644
|
index 8901bb31524613bf3fbec3cc5d3c228f8b3f43a4..4e26475bf0f541d6b2f8b6eccfeaeb9ee5b4b2b8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -512,7 +512,7 @@ public abstract class PlayerList {
|
@@ -512,7 +512,7 @@ public abstract class PlayerList {
|
||||||
@ -299,10 +299,10 @@ index 7bf4bf5cb2c1b54a7e2733091f48f3a824336d36..dcce05d2f4ab16424db4ab103a12188e
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 6ec5a6239b6144b2e3f9edcafdfd6fed6de6cbcd..46adef4de2f9e5888dce1e669619dd0386b90470 100644
|
index de069f9f7af5ff3e346d68e254ae7138fb19f3f3..b74a92acd890e63d88d5841391f4ee56fca94676 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -830,6 +830,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -831,6 +831,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
try {
|
try {
|
||||||
tickConsumer.accept(entity);
|
tickConsumer.accept(entity);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Broadcast join message to console
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index fd0aea068fe4bec0bd02a372afd7475314ceb88a..ccf03feb976d22f8c4ca4f60b6bc1d1d773c485f 100644
|
index 4e26475bf0f541d6b2f8b6eccfeaeb9ee5b4b2b8..7889f6bb645694b715eb832eb0675f79d80f09e8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -293,7 +293,9 @@ public abstract class PlayerList {
|
@@ -293,7 +293,9 @@ public abstract class PlayerList {
|
@ -52,7 +52,7 @@ index cdb0eb8e21299ca70ed7ed5c1195d07f44e47838..6d59a813aa752b4233dbe1894cfc8273
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
|
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index ccf03feb976d22f8c4ca4f60b6bc1d1d773c485f..492fc4e450b961e4d3421da88fcf8c1737bc3ded 100644
|
index 7889f6bb645694b715eb832eb0675f79d80f09e8..792e2a4407dfcee691f53f1bc1342da2c2cebbb4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -276,6 +276,12 @@ public abstract class PlayerList {
|
@@ -276,6 +276,12 @@ public abstract class PlayerList {
|
@ -96,7 +96,7 @@ index bb767f5b626225e70a8af273384bb74dbd21430d..301042e7a0d372a914f27ec0988dd938
|
|||||||
try {
|
try {
|
||||||
ServerPlayer entityplayer1 = this.server.getPlayerList().getPlayerForLogin(this.gameProfile, s); // CraftBukkit - add player reference
|
ServerPlayer entityplayer1 = this.server.getPlayerList().getPlayerForLogin(this.gameProfile, s); // CraftBukkit - add player reference
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index 492fc4e450b961e4d3421da88fcf8c1737bc3ded..c2cc59f476a67224774503009439fec2ad1ec62d 100644
|
index 792e2a4407dfcee691f53f1bc1342da2c2cebbb4..30fa9ac91be2ecc55efeee9222835cbedc53acff 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -39,6 +39,7 @@ import net.minecraft.network.protocol.Packet;
|
@@ -39,6 +39,7 @@ import net.minecraft.network.protocol.Packet;
|
@ -7,10 +7,10 @@ The code following this has better support for null worlds to move
|
|||||||
them back to the world spawn.
|
them back to the world spawn.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index c7581c1b306d9c6498e18456d67f5acd067357e6..5a26fe2b8c468063618dd02056da43f001173812 100644
|
index 82068b1ccc958fd9c1ba6887cf3ffad1c0660f07..1bc7c52e8de4325315f9d2204400e3447cfe7f4f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2038,9 +2038,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -2039,9 +2039,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
bworld = server.getWorld(worldName);
|
bworld = server.getWorld(worldName);
|
||||||
}
|
}
|
||||||
|
|
@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the
|
|||||||
same item twice because the source was destroyed.
|
same item twice because the source was destroyed.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 5a26fe2b8c468063618dd02056da43f001173812..640ea4522419fe90a0a390c2cf0379aab8d060b2 100644
|
index 1bc7c52e8de4325315f9d2204400e3447cfe7f4f..1e23785eb13082037b982886b27c460219f2cb0c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2188,11 +2188,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -2189,11 +2189,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
} else {
|
} else {
|
||||||
// CraftBukkit start - Capture drops for death event
|
// CraftBukkit start - Capture drops for death event
|
||||||
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
|
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
|
||||||
@ -34,7 +34,7 @@ index 5a26fe2b8c468063618dd02056da43f001173812..640ea4522419fe90a0a390c2cf0379aa
|
|||||||
|
|
||||||
entityitem.setDefaultPickUpDelay();
|
entityitem.setDefaultPickUpDelay();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -2943,6 +2944,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -2944,6 +2945,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
@Nullable
|
@Nullable
|
||||||
public Entity teleportTo(ServerLevel worldserver, BlockPos location) {
|
public Entity teleportTo(ServerLevel worldserver, BlockPos location) {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@ -47,7 +47,7 @@ index 5a26fe2b8c468063618dd02056da43f001173812..640ea4522419fe90a0a390c2cf0379aa
|
|||||||
if (this.level instanceof ServerLevel && !this.isRemoved()) {
|
if (this.level instanceof ServerLevel && !this.isRemoved()) {
|
||||||
this.level.getProfiler().push("changeDimension");
|
this.level.getProfiler().push("changeDimension");
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -2963,6 +2970,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -2964,6 +2971,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.level.getProfiler().popPush("reloading");
|
this.level.getProfiler().popPush("reloading");
|
||||||
@ -59,7 +59,7 @@ index 5a26fe2b8c468063618dd02056da43f001173812..640ea4522419fe90a0a390c2cf0379aa
|
|||||||
Entity entity = this.getType().create(worldserver);
|
Entity entity = this.getType().create(worldserver);
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
@@ -2976,10 +2988,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -2977,10 +2989,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
// CraftBukkit start - Forward the CraftEntity to the new entity
|
// CraftBukkit start - Forward the CraftEntity to the new entity
|
||||||
this.getBukkitEntity().setHandle(entity);
|
this.getBukkitEntity().setHandle(entity);
|
||||||
entity.bukkitEntity = this.getBukkitEntity();
|
entity.bukkitEntity = this.getBukkitEntity();
|
||||||
@ -70,7 +70,7 @@ index 5a26fe2b8c468063618dd02056da43f001173812..640ea4522419fe90a0a390c2cf0379aa
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3100,7 +3108,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -3101,7 +3109,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canChangeDimensions() {
|
public boolean canChangeDimensions() {
|
@ -68,10 +68,10 @@ index 9e0afab2329e560c4b2512548dd4b02dd1a2e69f..06662dbff8180751a8684841aa35f709
|
|||||||
this.firstIndices = new int[k];
|
this.firstIndices = new int[k];
|
||||||
this.secondIndices = new int[k];
|
this.secondIndices = new int[k];
|
||||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
index 48812329969b7192acd948db974bb77bb546f979..f7708920c62ea3040ba5c931d2141fa1d6ff613d 100644
|
index 5b1e0ea40dea6c7d787699ed25160c8b75ab3bf3..e29ed24999ae483c7d3e358a1e86fef99d67ef0c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
@@ -337,9 +337,21 @@ public final class Shapes {
|
@@ -338,9 +338,21 @@ public final class Shapes {
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@ -94,7 +94,7 @@ index 48812329969b7192acd948db974bb77bb546f979..f7708920c62ea3040ba5c931d2141fa1
|
|||||||
if (first instanceof CubePointRange && second instanceof CubePointRange) {
|
if (first instanceof CubePointRange && second instanceof CubePointRange) {
|
||||||
long l = lcm(i, j);
|
long l = lcm(i, j);
|
||||||
if ((long)size * l <= 256L) {
|
if ((long)size * l <= 256L) {
|
||||||
@@ -347,13 +359,22 @@ public final class Shapes {
|
@@ -348,13 +360,22 @@ public final class Shapes {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -54,10 +54,10 @@ index 548f103e648d9670d7434182c6598dc29ae77b57..f0c789d339fe8402c9c2a684d7e0415f
|
|||||||
|
|
||||||
this.level.getProfiler().push("explosion_blocks");
|
this.level.getProfiler().push("explosion_blocks");
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 46adef4de2f9e5888dce1e669619dd0386b90470..9d628996437959e79348679e2c85e07bc138475e 100644
|
index b74a92acd890e63d88d5841391f4ee56fca94676..4f97f11c248cbb06dbd604da0e88d9570e641af7 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -413,6 +413,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -414,6 +414,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
|
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
|
||||||
// CraftBukkit start - tree generation
|
// CraftBukkit start - tree generation
|
||||||
if (this.captureTreeGeneration) {
|
if (this.captureTreeGeneration) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 640ea4522419fe90a0a390c2cf0379aab8d060b2..4c506e2bf241ba9d6dd53b54def09be09303664b 100644
|
index 1e23785eb13082037b982886b27c460219f2cb0c..7bf34e0fc2658d56c8515e7acd68c6f36692e451 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -555,8 +555,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -556,8 +556,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPos(double x, double y, double z) {
|
public void setPos(double x, double y, double z) {
|
||||||
@ -19,7 +19,7 @@ index 640ea4522419fe90a0a390c2cf0379aab8d060b2..4c506e2bf241ba9d6dd53b54def09be0
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected AABB makeBoundingBox() {
|
protected AABB makeBoundingBox() {
|
||||||
@@ -3770,6 +3770,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -3771,6 +3771,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setPosRaw(double x, double y, double z) {
|
public final void setPosRaw(double x, double y, double z) {
|
||||||
@ -31,7 +31,7 @@ index 640ea4522419fe90a0a390c2cf0379aab8d060b2..4c506e2bf241ba9d6dd53b54def09be0
|
|||||||
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
||||||
this.position = new Vec3(x, y, z);
|
this.position = new Vec3(x, y, z);
|
||||||
int i = Mth.floor(x);
|
int i = Mth.floor(x);
|
||||||
@@ -3792,6 +3797,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -3793,6 +3798,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add entity liquid API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 4c506e2bf241ba9d6dd53b54def09be09303664b..91e034f54deb2aa084527aaa001e48ddcc2e9cd1 100644
|
index 7bf34e0fc2658d56c8515e7acd68c6f36692e451..e4dff1ee8329694ed42e4f3c66d896ea32f62747 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1359,7 +1359,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -1360,7 +1360,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
return this.isInWater() || this.isInRain();
|
return this.isInWater() || this.isInRain();
|
||||||
}
|
}
|
||||||
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Spawn player in correct world on login
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index c2cc59f476a67224774503009439fec2ad1ec62d..0ac5ba6bc7b582d1ab02a90c9418c9b899175d93 100644
|
index 30fa9ac91be2ecc55efeee9222835cbedc53acff..4710c9d12feb12b75c497373c172ce0d4f4ab96e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -196,7 +196,18 @@ public abstract class PlayerList {
|
@@ -196,7 +196,18 @@ public abstract class PlayerList {
|
@ -10,7 +10,7 @@ This fixes that by checking if the modified spawn location is
|
|||||||
still at a respawn anchor.
|
still at a respawn anchor.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index 0ac5ba6bc7b582d1ab02a90c9418c9b899175d93..06a38986775b99faca2deddf1bcbea3c691c6521 100644
|
index 4710c9d12feb12b75c497373c172ce0d4f4ab96e..724c503da333ac4dd8ed865ba48cac9dcb1a0da8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -78,6 +78,7 @@ import net.minecraft.world.level.GameRules;
|
@@ -78,6 +78,7 @@ import net.minecraft.world.level.GameRules;
|
||||||
@ -52,7 +52,7 @@ index 0ac5ba6bc7b582d1ab02a90c9418c9b899175d93..06a38986775b99faca2deddf1bcbea3c
|
|||||||
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
||||||
isRespawn = true; // Paper
|
isRespawn = true; // Paper
|
||||||
} else {
|
} else {
|
||||||
@@ -919,8 +926,12 @@ public abstract class PlayerList {
|
@@ -920,8 +927,12 @@ public abstract class PlayerList {
|
||||||
}
|
}
|
||||||
// entityplayer1.initInventoryMenu();
|
// entityplayer1.initInventoryMenu();
|
||||||
entityplayer1.setHealth(entityplayer1.getHealth());
|
entityplayer1.setHealth(entityplayer1.getHealth());
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user