From 921fbc5f60a4e6a8ced122c001fab2d541851ec6 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 9 Aug 2024 07:00:00 +1000 Subject: [PATCH] Update to Minecraft 1.21.1 By: md_5 --- .../commands/arguments/ArgumentEntity.patch | 12 +++++----- .../selector/ArgumentParserSelector.patch | 8 +++---- .../world/level/block/entity/TileEntity.patch | 10 ++++----- .../block/entity/TileEntityBeehive.patch | 8 ++----- .../entity/trialspawner/TrialSpawner.patch | 22 ------------------- .../minecraft/world/level/chunk/Chunk.patch | 12 +++++----- paper-server/pom.xml | 2 +- .../org/bukkit/craftbukkit/CraftServer.java | 2 +- .../bukkit/craftbukkit/util/ApiVersion.java | 2 +- .../craftbukkit/util/CraftMagicNumbers.java | 2 +- 10 files changed, 27 insertions(+), 53 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/commands/arguments/ArgumentEntity.patch b/paper-server/nms-patches/net/minecraft/commands/arguments/ArgumentEntity.patch index fe7d5cb425..9f83ef9131 100644 --- a/paper-server/nms-patches/net/minecraft/commands/arguments/ArgumentEntity.patch +++ b/paper-server/nms-patches/net/minecraft/commands/arguments/ArgumentEntity.patch @@ -1,17 +1,17 @@ --- a/net/minecraft/commands/arguments/ArgumentEntity.java +++ b/net/minecraft/commands/arguments/ArgumentEntity.java -@@ -94,9 +94,15 @@ +@@ -102,9 +102,15 @@ } - public EntitySelector parse(StringReader stringreader) throws CommandSyntaxException { + private EntitySelector parse(StringReader stringreader, boolean flag) throws CommandSyntaxException { + // CraftBukkit start -+ return parse(stringreader, false); ++ return parse(stringreader, flag, false); + } + -+ public EntitySelector parse(StringReader stringreader, boolean overridePermissions) throws CommandSyntaxException { ++ public EntitySelector parse(StringReader stringreader, boolean flag, boolean overridePermissions) throws CommandSyntaxException { + // CraftBukkit end - boolean flag = false; - ArgumentParserSelector argumentparserselector = new ArgumentParserSelector(stringreader); + boolean flag1 = false; + ArgumentParserSelector argumentparserselector = new ArgumentParserSelector(stringreader, flag); - EntitySelector entityselector = argumentparserselector.parse(); + EntitySelector entityselector = argumentparserselector.parse(overridePermissions); // CraftBukkit diff --git a/paper-server/nms-patches/net/minecraft/commands/arguments/selector/ArgumentParserSelector.patch b/paper-server/nms-patches/net/minecraft/commands/arguments/selector/ArgumentParserSelector.patch index 438808bdf8..0a3f633207 100644 --- a/paper-server/nms-patches/net/minecraft/commands/arguments/selector/ArgumentParserSelector.patch +++ b/paper-server/nms-patches/net/minecraft/commands/arguments/selector/ArgumentParserSelector.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/commands/arguments/selector/ArgumentParserSelector.java +++ b/net/minecraft/commands/arguments/selector/ArgumentParserSelector.java -@@ -147,7 +147,7 @@ +@@ -158,7 +158,7 @@ axisalignedbb = this.createAabb(this.deltaX == null ? 0.0D : this.deltaX, this.deltaY == null ? 0.0D : this.deltaY, this.deltaZ == null ? 0.0D : this.deltaZ); } @@ -9,7 +9,7 @@ if (this.x == null && this.y == null && this.z == null) { function = (vec3d) -> { -@@ -204,8 +204,10 @@ +@@ -215,8 +215,10 @@ }; } @@ -22,7 +22,7 @@ this.suggestions = this::suggestSelector; if (!this.reader.canRead()) { throw ArgumentParserSelector.ERROR_MISSING_SELECTOR_TYPE.createWithContext(this.reader); -@@ -494,6 +496,12 @@ +@@ -505,6 +507,12 @@ } public EntitySelector parse() throws CommandSyntaxException { @@ -35,7 +35,7 @@ this.startPosition = this.reader.getCursor(); this.suggestions = this::suggestNameOrSelector; if (this.reader.canRead() && this.reader.peek() == '@') { -@@ -502,7 +510,7 @@ +@@ -513,7 +521,7 @@ } this.reader.skip(); diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntity.patch b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntity.patch index e9e164dbf1..d1005ab871 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntity.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntity.patch @@ -19,7 +19,7 @@ private static final Logger LOGGER = LogUtils.getLogger(); private final TileEntityTypes type; @Nullable -@@ -62,7 +72,16 @@ +@@ -75,7 +85,16 @@ return this.level != null; } @@ -37,7 +37,7 @@ public final void loadWithComponents(NBTTagCompound nbttagcompound, HolderLookup.a holderlookup_a) { this.loadAdditional(nbttagcompound, holderlookup_a); -@@ -102,6 +121,11 @@ +@@ -115,6 +134,11 @@ }).ifPresent((nbtbase) -> { nbttagcompound.merge((NBTTagCompound) nbtbase); }); @@ -49,7 +49,7 @@ return nbttagcompound; } -@@ -260,12 +284,18 @@ +@@ -276,12 +300,18 @@ } public final void applyComponents(DataComponentMap datacomponentmap, DataComponentPatch datacomponentpatch) { @@ -69,7 +69,7 @@ @Nullable @Override public T get(DataComponentType datacomponenttype) { -@@ -283,6 +313,10 @@ +@@ -299,6 +329,10 @@ DataComponentPatch datacomponentpatch1 = datacomponentpatch.forget(set::contains); this.components = datacomponentpatch1.split().added(); @@ -80,7 +80,7 @@ } protected void collectImplicitComponents(DataComponentMap.a datacomponentmap_a) {} -@@ -317,6 +351,15 @@ +@@ -333,6 +367,15 @@ } } diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeehive.patch b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeehive.patch index 2da5258eb2..ca50649d6b 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeehive.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeehive.patch @@ -11,12 +11,8 @@ public class TileEntityBeehive extends TileEntity { private static final Logger LOGGER = LogUtils.getLogger(); -@@ -52,9 +56,10 @@ - private static final int MIN_TICKS_BEFORE_REENTERING_HIVE = 400; - private static final int MIN_OCCUPATION_TICKS_NECTAR = 2400; - public static final int MIN_OCCUPATION_TICKS_NECTARLESS = 600; -- private final List stored = Lists.newArrayList(); -+ private List stored = Lists.newArrayList(); +@@ -55,6 +59,7 @@ + private List stored = Lists.newArrayList(); @Nullable public BlockPosition savedFlowerPos; + public int maxBees = 3; // CraftBukkit - allow setting max amount of bees a hive can hold diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.patch b/paper-server/nms-patches/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.patch index 08c6f72496..d4d7f2842e 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.patch @@ -1,27 +1,5 @@ --- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java +++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java -@@ -57,16 +57,16 @@ - private static final int MAX_MOB_TRACKING_DISTANCE = 47; - private static final int MAX_MOB_TRACKING_DISTANCE_SQR = MathHelper.square(47); - private static final float SPAWNING_AMBIENT_SOUND_CHANCE = 0.02F; -- private final TrialSpawnerConfig normalConfig; -- private final TrialSpawnerConfig ominousConfig; -+ public TrialSpawnerConfig normalConfig; // PAIL - private->public, -final -+ public TrialSpawnerConfig ominousConfig; // PAIL - private->public, -final - private final TrialSpawnerData data; -- private final int requiredPlayerRange; -- private final int targetCooldownLength; -+ public int requiredPlayerRange; // PAIL - private->public, -final -+ public int targetCooldownLength; // PAIL - private->public, -final - public final TrialSpawner.b stateAccessor; - private PlayerDetector playerDetector; - private final PlayerDetector.a entitySelector; - private boolean overridePeacefulAndMobSpawnRule; -- private boolean isOminous; -+ public boolean isOminous; // PAIL - private->public - - public Codec codec() { - return RecordCodecBuilder.create((instance) -> { @@ -219,13 +219,18 @@ } diff --git a/paper-server/nms-patches/net/minecraft/world/level/chunk/Chunk.patch b/paper-server/nms-patches/net/minecraft/world/level/chunk/Chunk.patch index 9793fde0c3..4df6567e6e 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/chunk/Chunk.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/chunk/Chunk.patch @@ -68,7 +68,7 @@ iblockdata.onPlace(this.level, blockposition, iblockdata1, flag); } -@@ -340,7 +357,12 @@ +@@ -345,7 +362,12 @@ @Nullable public TileEntity getBlockEntity(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { @@ -82,7 +82,7 @@ if (tileentity == null) { NBTTagCompound nbttagcompound = (NBTTagCompound) this.pendingBlockEntities.remove(blockposition); -@@ -412,6 +434,7 @@ +@@ -417,6 +439,7 @@ if (!iblockdata.hasBlockEntity()) { Chunk.LOGGER.warn("Trying to set block entity {} at position {}, but state {} does not allow it", new Object[]{tileentity, blockposition, iblockdata}); @@ -90,7 +90,7 @@ } else { IBlockData iblockdata1 = tileentity.getBlockState(); -@@ -465,6 +488,12 @@ +@@ -470,6 +493,12 @@ if (this.isInLevel()) { TileEntity tileentity = (TileEntity) this.blockEntities.remove(blockposition); @@ -103,7 +103,7 @@ if (tileentity != null) { World world = this.level; -@@ -518,6 +547,57 @@ +@@ -523,6 +552,57 @@ } @@ -161,7 +161,7 @@ public boolean isEmpty() { return false; } -@@ -713,7 +793,7 @@ +@@ -718,7 +798,7 @@ private void updateBlockEntityTicker(T t0) { IBlockData iblockdata = t0.getBlockState(); @@ -170,7 +170,7 @@ if (blockentityticker == null) { this.removeBlockEntityTicker(t0.getBlockPos()); -@@ -798,7 +878,7 @@ +@@ -803,7 +883,7 @@ private boolean loggedInvalidBlockState; a(final TileEntity tileentity, final BlockEntityTicker blockentityticker) { diff --git a/paper-server/pom.xml b/paper-server/pom.xml index d470178509..3d0a759a1f 100644 --- a/paper-server/pom.xml +++ b/paper-server/pom.xml @@ -4,7 +4,7 @@ org.bukkit craftbukkit jar - 1.21-R0.1-SNAPSHOT + 1.21.1-R0.1-SNAPSHOT CraftBukkit https://www.spigotmc.org/ diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 8506dc885b..117b47715e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2505,7 +2505,7 @@ public final class CraftServer implements Server { try { StringReader reader = new StringReader(selector); - nms = arg.parse(reader, true).findEntities(VanillaCommandWrapper.getListener(sender)); + nms = arg.parse(reader, true, true).findEntities(VanillaCommandWrapper.getListener(sender)); Preconditions.checkArgument(!reader.canRead(), "Spurious trailing data in selector: %s", selector); } catch (CommandSyntaxException ex) { throw new IllegalArgumentException("Could not parse selector: " + selector, ex); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/util/ApiVersion.java b/paper-server/src/main/java/org/bukkit/craftbukkit/util/ApiVersion.java index 85ade9e375..e9599da68d 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/util/ApiVersion.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/util/ApiVersion.java @@ -16,7 +16,7 @@ public final class ApiVersion implements Comparable, Serializable { static { versions = new HashMap<>(); - CURRENT = getOrCreateVersion("1.21"); + CURRENT = getOrCreateVersion("1.21.1"); FLATTENING = getOrCreateVersion("1.13"); FIELD_NAME_PARITY = getOrCreateVersion("1.20.5"); NONE = getOrCreateVersion("none"); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index f56b0d5fc0..80ab7eaf29 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -226,7 +226,7 @@ public final class CraftMagicNumbers implements UnsafeValues { * @return string */ public String getMappingsVersion() { - return "229d7afc75b70a6c388337687ac4da1f"; + return "7092ff1ff9352ad7e2260dc150e6a3ec"; } @Override