From 98775ea8e5af4879754e5aa5ff6eda4923c63378 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke <nassim@njahnke.dev> Date: Fri, 26 Jan 2024 19:41:41 +0100 Subject: [PATCH] [ci skip] Fixup a few bad comments --- ...event-players-from-moving-into-unloa.patch | 2 +- ...actus-bamboo-and-reed-growth-height.patch} | 20 +++++++++---------- ...r-redstone-torch-rapid-clock-removal.patch | 2 +- .../Implement-PlayerFailMoveEvent.patch | 2 +- patches/server/Optimize-DataBits.patch | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) rename patches/server/{Configurable-cactus-bamboo-and-reed-growth-heights.patch => Configurable-cactus-bamboo-and-reed-growth-height.patch} (94%) diff --git a/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch index a742525d5c..c67a861eb6 100644 --- a/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); - double d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); + double d0 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX(this.player.getX())); final double toX = d0; // Paper - OBFHELPER -+ double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1; ++ double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1; // Paper - OBFHELPER + double d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); final double toZ = d2; // Paper - OBFHELPER float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); diff --git a/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/Configurable-cactus-bamboo-and-reed-growth-height.patch similarity index 94% rename from patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch rename to patches/server/Configurable-cactus-bamboo-and-reed-growth-height.patch index 5e012e8bf8..15f86f314d 100644 --- a/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch +++ b/patches/server/Configurable-cactus-bamboo-and-reed-growth-height.patch @@ -1,9 +1,9 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Tue, 1 Mar 2016 13:02:51 -0600 -Subject: [PATCH] Configurable cactus bamboo and reed growth heights +Subject: [PATCH] Configurable cactus bamboo and reed growth height -Bamboo - Both the minimum fully-grown heights and the maximum are configurable +Bamboo - Both the minimum fully-grown height and the maximum are configurable - Machine_Maker diff --git a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int i = this.getHeightBelowUpToMax(world, pos) + 1; - if (i < 16) { -+ if (i < world.paperConfig().maxGrowthHeight.bamboo.max) { // Paper - Configurable cactus/bamboo/reed growth heights ++ if (i < world.paperConfig().maxGrowthHeight.bamboo.max) { // Paper - Configurable cactus/bamboo/reed growth height this.growBamboo(state, world, pos, random, i); } } @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int j = this.getHeightBelowUpToMax(world, pos); - return i + j + 1 < 16 && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; -+ return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; // Paper - Configurable cactus/bamboo/reed growth heights ++ return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; // Paper - Configurable cactus/bamboo/reed growth height } @Override @@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BlockState iblockdata1 = world.getBlockState(blockposition1); - if (k >= 16 || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here -+ if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus/bamboo/reed growth heights ++ if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus/bamboo/reed growth height return; } @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int j = (Integer) state.getValue(BambooStalkBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1; - int k = (height < 11 || random.nextFloat() >= 0.25F) && height != 15 ? 0 : 1; -+ int k = (height < world.paperConfig().maxGrowthHeight.bamboo.min || random.nextFloat() >= 0.25F) && height != (world.paperConfig().maxGrowthHeight.bamboo.max - 1) ? 0 : 1; // Paper - Configurable cactus/bamboo/reed growth heights ++ int k = (height < world.paperConfig().maxGrowthHeight.bamboo.min || random.nextFloat() >= 0.25F) && height != (world.paperConfig().maxGrowthHeight.bamboo.max - 1) ? 0 : 1; // Paper - Configurable cactus/bamboo/reed growth height // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooStalkBlock.AGE, j)).setValue(BambooStalkBlock.LEAVES, blockpropertybamboosize)).setValue(BambooStalkBlock.STAGE, k), 3)) { @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int i; - for (i = 0; i < 16 && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { -+ for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper - Configurable cactus/bamboo/reed growth heights ++ for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper - Configurable cactus/bamboo/reed growth height ; } @@ -60,7 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int i; - for (i = 0; i < 16 && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { -+ for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper - Configurable cactus/bamboo/reed growth heights ++ for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper - Configurable cactus/bamboo/reed growth height ; } @@ -73,7 +73,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - if (i < 3) { -+ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable cactus/bamboo/reed growth heightst ++ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable cactus/bamboo/reed growth heightt int j = (Integer) state.getValue(CactusBlock.AGE); int modifier = world.spigotConfig.cactusModifier; // Spigot - SPIGOT-7159: Better modifier resolution @@ -86,7 +86,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - if (i < 3) { -+ if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable cactus/bamboo/reed growth heights ++ if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable cactus/bamboo/reed growth height int j = (Integer) state.getValue(SugarCaneBlock.AGE); int modifier = world.spigotConfig.caneModifier; // Spigot - SPIGOT-7159: Better modifier resolution diff --git a/patches/server/Faster-redstone-torch-rapid-clock-removal.patch b/patches/server/Faster-redstone-torch-rapid-clock-removal.patch index 8eda83cc2f..50295c134f 100644 --- a/patches/server/Faster-redstone-torch-rapid-clock-removal.patch +++ b/patches/server/Faster-redstone-torch-rapid-clock-removal.patch @@ -62,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (list == null) { + list = world.redstoneUpdateInfos = new java.util.ArrayDeque<>(); + } -+ ++ // Paper end - Faster redstone torch rapid clock removal if (addNew) { list.add(new RedstoneTorchBlock.Toggle(pos.immutable(), world.getGameTime())); diff --git a/patches/server/Implement-PlayerFailMoveEvent.patch b/patches/server/Implement-PlayerFailMoveEvent.patch index a7c20560a0..03a71c4b25 100644 --- a/patches/server/Implement-PlayerFailMoveEvent.patch +++ b/patches/server/Implement-PlayerFailMoveEvent.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d0 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX(this.player.getX())); final double toX = d0; // Paper - OBFHELPER - double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1; + double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1; // Paper - OBFHELPER double d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); final double toZ = d2; // Paper - OBFHELPER - float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); - float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); diff --git a/patches/server/Optimize-DataBits.patch b/patches/server/Optimize-DataBits.patch index e3ae8f867c..45a2120269 100644 --- a/patches/server/Optimize-DataBits.patch +++ b/patches/server/Optimize-DataBits.patch @@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - public int get(int index) { - Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); + public final int get(int index) { // Paper - Perf: Optimize SimpleBitStorage -+ //Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); - Perf: Optimize SimpleBitStorage ++ //Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); // Paper - Perf: Optimize SimpleBitStorage int i = this.cellIndex(index); long l = this.data[i]; int j = (index - i * this.valuesPerLong) * this.bits;