diff options
author | Nassim Jahnke <[email protected]> | 2024-01-12 21:58:54 +0100 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-01-12 21:58:54 +0100 |
commit | a0ffb577450102506101069bbcf51c2c44a711c3 (patch) | |
tree | d7538dd89638ef0e875da970a49c8bea8af2b1fe /patches/server/0009-MC-Utils.patch | |
parent | f28caff92752681593137edea91b8fa908995d8e (diff) | |
download | Paper-a0ffb577450102506101069bbcf51c2c44a711c3.tar.gz Paper-a0ffb577450102506101069bbcf51c2c44a711c3.zip |
[ci skip] Small cleanup to mc utils patch
Diffstat (limited to 'patches/server/0009-MC-Utils.patch')
-rw-r--r-- | patches/server/0009-MC-Utils.patch | 78 |
1 files changed, 9 insertions, 69 deletions
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index 912cf207d3..3701ba05fa 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -5926,26 +5926,6 @@ index d3afd54f546ae81f1c6d1a3ca9ee4e8e5c786ae4..114f4017c4133042178c57d424f10079 } 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 2bb5e51f71cbf66819d198505aa4a5ecffd246c6..1834f3efb05fd70c8c1c67733bff514829ae1154 100644 ---- a/src/main/java/net/minecraft/core/BlockPos.java -+++ b/src/main/java/net/minecraft/core/BlockPos.java -@@ -562,6 +562,7 @@ 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); -@@ -579,6 +580,7 @@ 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 c77fc9b93f3213655b2cc89f4afdec893f1cd22d..c77a6bb6885ffaaa4d9e1aa9d4770d5e847a590b 100644 --- a/src/main/java/net/minecraft/nbt/CompoundTag.java @@ -6982,18 +6962,10 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..7cacfceed5ef9276a19123a8a9079579 ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 9cf839be15126444d4d2ffdb7faa637859941d6b..3bd2bddb782d29e647a1f1b362a39d224151f8b1 100644 +index 9cf839be15126444d4d2ffdb7faa637859941d6b..cb6fbb3a1512d69a3f1192c969c3d5c78c046cef 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -178,6 +178,7 @@ 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 { - -@@ -230,6 +231,98 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -230,6 +230,98 @@ public class ServerLevel extends Level implements WorldGenLevel { return this.convertable.dimensionType; } @@ -7319,7 +7291,7 @@ index 1c71d2c1b16bdba1e14a8230787e4cb4ad530163..d6d8bbc98fc71997cb52521d59ebb59d FluidState getFluidState(BlockPos pos); diff --git a/src/main/java/net/minecraft/world/level/ChunkPos.java b/src/main/java/net/minecraft/world/level/ChunkPos.java -index 43bb3f5a617f4a6d719b02023a71edcb12aa9d05..34457c8afb4575d2395148f0a2bde6a96ec5e797 100644 +index 43bb3f5a617f4a6d719b02023a71edcb12aa9d05..2f47004a34f28a58965b1c47e78fb07ae15770cb 100644 --- a/src/main/java/net/minecraft/world/level/ChunkPos.java +++ b/src/main/java/net/minecraft/world/level/ChunkPos.java @@ -20,6 +20,7 @@ public class ChunkPos { @@ -7350,7 +7322,7 @@ index 43bb3f5a617f4a6d719b02023a71edcb12aa9d05..34457c8afb4575d2395148f0a2bde6a9 } public static ChunkPos minFromRegion(int x, int z) { -@@ -48,10 +52,10 @@ public class ChunkPos { +@@ -48,7 +52,7 @@ public class ChunkPos { } public long toLong() { @@ -7358,11 +7330,7 @@ index 43bb3f5a617f4a6d719b02023a71edcb12aa9d05..34457c8afb4575d2395148f0a2bde6a9 + 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 3c707d6674b2594b09503b959a31c1f4ad3981e6..db61b6b0158a9bcc0e1d735e34fe3671f8c89e21 100644 --- a/src/main/java/net/minecraft/world/level/EmptyBlockGetter.java @@ -7540,29 +7508,9 @@ index 249b3ed33672a9a9529bd14de978722b62019314..0f1025495237aebe30132ace0832aa57 public WorldBorder getWorldBorder() { return this.level.getWorldBorder(); diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index 171956fbe47032cfac8811ab7fbe94415560304b..07e41b936f5f229876cf9ff5cd8d6278088eee48 100644 +index 171956fbe47032cfac8811ab7fbe94415560304b..b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf 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 -@@ -821,8 +821,8 @@ public abstract class BlockBehaviour implements FeatureElement { - - public abstract static class BlockStateBase extends StateHolder<Block, BlockState> { - -- 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 */ -@@ -835,7 +835,7 @@ 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; @@ -896,12 +896,20 @@ public abstract class BlockBehaviour implements FeatureElement { } } @@ -7619,7 +7567,7 @@ index 532a0cae6db0d830e720a72e9021aa7a8ed0f106..e5e562f75e7d4b6a750f192842940c5e this.levelHeightAccessor = heightLimitView; this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()]; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 57805b84054e44a3d7c95cf269316a42205bb99c..17d36b53ec8efbc60b0648764f7195003e40fdcc 100644 +index 57805b84054e44a3d7c95cf269316a42205bb99c..e9670e43a146288ad0e5a33dfc02b90fc1eee95b 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -114,6 +114,109 @@ public class LevelChunk extends ChunkAccess { @@ -7751,15 +7699,7 @@ index 57805b84054e44a3d7c95cf269316a42205bb99c..17d36b53ec8efbc60b0648764f719500 @Override public FluidState getFluidState(BlockPos pos) { return this.getFluidState(pos.getX(), pos.getY(), pos.getZ()); -@@ -355,6 +470,7 @@ 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 -@@ -537,7 +653,25 @@ public class LevelChunk extends ChunkAccess { +@@ -537,7 +652,25 @@ public class LevelChunk extends ChunkAccess { // CraftBukkit start public void loadCallback() { @@ -7785,7 +7725,7 @@ index 57805b84054e44a3d7c95cf269316a42205bb99c..17d36b53ec8efbc60b0648764f719500 if (server != null) { /* * If it's a new world, the first few chunks are generated inside -@@ -578,6 +712,22 @@ public class LevelChunk extends ChunkAccess { +@@ -578,6 +711,22 @@ public class LevelChunk extends ChunkAccess { server.getPluginManager().callEvent(unloadEvent); // note: saving can be prevented, but not forced if no saving is actually required this.mustNotSave = !unloadEvent.isSaveChunk(); |