diff --git a/patches/server/Collision-optimisations.patch b/patches/server/Collision-optimisations.patch index b08003b50d..58079e2532 100644 --- a/patches/server/Collision-optimisations.patch +++ b/patches/server/Collision-optimisations.patch @@ -3024,7 +3024,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement { this.instrument = blockbase_info.instrument; this.replaceable = blockbase_info.replaceable; - this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper + this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper + // Paper start - optimise collisions + this.id1 = it.unimi.dsi.fastutil.HashCommon.murmurHash3(it.unimi.dsi.fastutil.HashCommon.murmurHash3(ID_GENERATOR.getAndIncrement() + RANDOM_OFFSET) + RANDOM_OFFSET); + this.id2 = it.unimi.dsi.fastutil.HashCommon.murmurHash3(it.unimi.dsi.fastutil.HashCommon.murmurHash3(ID_GENERATOR.getAndIncrement() + RANDOM_OFFSET) + RANDOM_OFFSET); diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index a53b3cbac1..83fff88501 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -5926,26 +5926,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public static long getEpochMillis() { -diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/core/BlockPos.java -+++ b/src/main/java/net/minecraft/core/BlockPos.java -@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i { - } - } - -+ // Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep - @Override - public BlockPos.MutableBlockPos setX(int i) { - super.setX(i); -@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i { - super.setZ(i); - return this; - } -+ // Paper end - - @Override - public BlockPos immutable() { diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/nbt/CompoundTag.java @@ -6985,14 +6965,6 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -0,0 +0,0 @@ import org.bukkit.event.weather.LightningStrikeEvent; - import org.bukkit.event.world.GenericGameEvent; - import org.bukkit.event.world.TimeSkipEvent; - // CraftBukkit end -+import it.unimi.dsi.fastutil.ints.IntArrayList; // Paper - - public class ServerLevel extends Level implements WorldGenLevel { - @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { return this.convertable.dimensionType; } @@ -7358,11 +7330,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return longKey; // Paper } -- public static long asLong(int chunkX, int chunkZ) { -+ public static long asLong(int chunkX, int chunkZ) { - return (long)chunkX & 4294967295L | ((long)chunkZ & 4294967295L) << 32; - } - + public static long asLong(int chunkX, int chunkZ) { diff --git a/src/main/java/net/minecraft/world/level/EmptyBlockGetter.java b/src/main/java/net/minecraft/world/level/EmptyBlockGetter.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/EmptyBlockGetter.java @@ -7543,26 +7511,6 @@ diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement { - - public abstract static class BlockStateBase extends StateHolder { - -- private final int lightEmission; -- private final boolean useShapeForLightOcclusion; -+ private final int lightEmission; public final int getEmittedLight() { return this.lightEmission; } // Paper - OBFHELPER -+ private final boolean useShapeForLightOcclusion; public final boolean isTransparentOnSomeFaces() { return this.useShapeForLightOcclusion; } // Paper - OBFHELPER - private final boolean isAir; - private final boolean ignitedByLava; - /** @deprecated */ -@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement { - private final MapColor mapColor; - public final float destroySpeed; - private final boolean requiresCorrectToolForDrops; -- private final boolean canOcclude; -+ private final boolean canOcclude; public final boolean isOpaque() { return this.canOcclude; } // Paper - OBFHELPER - private final BlockBehaviour.StatePredicate isRedstoneConductor; - private final BlockBehaviour.StatePredicate isSuffocating; - private final BlockBehaviour.StatePredicate isViewBlocking; @@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement { } } @@ -7752,14 +7700,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public FluidState getFluidState(BlockPos pos) { return this.getFluidState(pos.getX(), pos.getY(), pos.getZ()); @@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { - return this.getBlockEntity(pos, LevelChunk.EntityCreationType.CHECK); - } - -+ @Deprecated @Nullable public final BlockEntity getTileEntityImmediately(BlockPos pos) { return this.getBlockEntity(pos, EntityCreationType.IMMEDIATE); } // Paper - OBFHELPER - @Nullable - public BlockEntity getBlockEntity(BlockPos pos, LevelChunk.EntityCreationType creationType) { - // CraftBukkit start -@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { // CraftBukkit start public void loadCallback() { diff --git a/patches/server/Manually-inline-methods-in-BlockPosition.patch b/patches/server/Manually-inline-methods-in-BlockPosition.patch index 4cd5936ee4..6b512cea73 100644 --- a/patches/server/Manually-inline-methods-in-BlockPosition.patch +++ b/patches/server/Manually-inline-methods-in-BlockPosition.patch @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public class BlockPos extends Vec3i { - // Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep + @Override public BlockPos.MutableBlockPos setX(int i) { - super.setX(i); @@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.z = i; // Paper return this; } - // Paper end + diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/core/Vec3i.java diff --git a/patches/server/Optimize-CraftBlockData-Creation.patch b/patches/server/Optimize-CraftBlockData-Creation.patch index 945fc3f725..e5f1313956 100644 --- a/patches/server/Optimize-CraftBlockData-Creation.patch +++ b/patches/server/Optimize-CraftBlockData-Creation.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java @@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement { this.replaceable = blockbase_info.replaceable; - this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper + this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper } + // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time + private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; diff --git a/patches/server/Starlight.patch b/patches/server/Starlight.patch index 54a61f9404..eb09402336 100644 --- a/patches/server/Starlight.patch +++ b/patches/server/Starlight.patch @@ -4890,7 +4890,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.spawnTerrainParticles = blockbase_info.spawnTerrainParticles; this.instrument = blockbase_info.instrument; this.replaceable = blockbase_info.replaceable; -+ this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper ++ this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper } private boolean calculateSolid() {