diff --git a/patches/unapplied/server/API-for-an-entity-s-scoreboard-name.patch b/patches/server/API-for-an-entity-s-scoreboard-name.patch similarity index 100% rename from patches/unapplied/server/API-for-an-entity-s-scoreboard-name.patch rename to patches/server/API-for-an-entity-s-scoreboard-name.patch diff --git a/patches/unapplied/server/API-for-updating-recipes-on-clients.patch b/patches/server/API-for-updating-recipes-on-clients.patch similarity index 100% rename from patches/unapplied/server/API-for-updating-recipes-on-clients.patch rename to patches/server/API-for-updating-recipes-on-clients.patch diff --git a/patches/unapplied/server/Add-Listing-API-for-Player.patch b/patches/server/Add-Listing-API-for-Player.patch similarity index 95% rename from patches/unapplied/server/Add-Listing-API-for-Player.patch rename to patches/server/Add-Listing-API-for-Player.patch index 718bfd0b4..6ca22cbff 100644 --- a/patches/unapplied/server/Add-Listing-API-for-Player.patch +++ b/patches/server/Add-Listing-API-for-Player.patch @@ -57,14 +57,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.entries = buf.readList((buf2) -> { @@ -0,0 +0,0 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { diff --git a/patches/unapplied/server/Don-t-tick-signs.patch b/patches/server/Don-t-tick-signs.patch similarity index 100% rename from patches/unapplied/server/Don-t-tick-signs.patch rename to patches/server/Don-t-tick-signs.patch diff --git a/patches/unapplied/server/Expand-Pose-API.patch b/patches/server/Expand-Pose-API.patch similarity index 100% rename from patches/unapplied/server/Expand-Pose-API.patch rename to patches/server/Expand-Pose-API.patch diff --git a/patches/unapplied/server/ExperienceOrb-should-call-EntitySpawnEvent.patch b/patches/server/ExperienceOrb-should-call-EntitySpawnEvent.patch similarity index 100% rename from patches/unapplied/server/ExperienceOrb-should-call-EntitySpawnEvent.patch rename to patches/server/ExperienceOrb-should-call-EntitySpawnEvent.patch diff --git a/patches/unapplied/server/Expose-clicked-BlockFace-during-BlockDamageEvent.patch b/patches/server/Expose-clicked-BlockFace-during-BlockDamageEvent.patch similarity index 100% rename from patches/unapplied/server/Expose-clicked-BlockFace-during-BlockDamageEvent.patch rename to patches/server/Expose-clicked-BlockFace-during-BlockDamageEvent.patch diff --git a/patches/unapplied/server/Expose-hand-during-BlockCanBuildEvent.patch b/patches/server/Expose-hand-during-BlockCanBuildEvent.patch similarity index 100% rename from patches/unapplied/server/Expose-hand-during-BlockCanBuildEvent.patch rename to patches/server/Expose-hand-during-BlockCanBuildEvent.patch diff --git a/patches/unapplied/server/Fire-entity-death-event-for-ender-dragon.patch b/patches/server/Fire-entity-death-event-for-ender-dragon.patch similarity index 100% rename from patches/unapplied/server/Fire-entity-death-event-for-ender-dragon.patch rename to patches/server/Fire-entity-death-event-for-ender-dragon.patch diff --git a/patches/unapplied/server/Fix-BanList-API.patch b/patches/server/Fix-BanList-API.patch similarity index 100% rename from patches/unapplied/server/Fix-BanList-API.patch rename to patches/server/Fix-BanList-API.patch diff --git a/patches/unapplied/server/Fix-NPE-on-Boat-getStatus.patch b/patches/server/Fix-NPE-on-Boat-getStatus.patch similarity index 100% rename from patches/unapplied/server/Fix-NPE-on-Boat-getStatus.patch rename to patches/server/Fix-NPE-on-Boat-getStatus.patch diff --git a/patches/unapplied/server/Fix-custom-statistic-criteria-creation.patch b/patches/server/Fix-custom-statistic-criteria-creation.patch similarity index 100% rename from patches/unapplied/server/Fix-custom-statistic-criteria-creation.patch rename to patches/server/Fix-custom-statistic-criteria-creation.patch diff --git a/patches/unapplied/server/Fix-inventory-desync.patch b/patches/server/Fix-inventory-desync.patch similarity index 100% rename from patches/unapplied/server/Fix-inventory-desync.patch rename to patches/server/Fix-inventory-desync.patch diff --git a/patches/unapplied/server/Fix-possible-NPE-on-painting-creation.patch b/patches/server/Fix-possible-NPE-on-painting-creation.patch similarity index 100% rename from patches/unapplied/server/Fix-possible-NPE-on-painting-creation.patch rename to patches/server/Fix-possible-NPE-on-painting-creation.patch diff --git a/patches/unapplied/server/Fix-rotation-when-spawning-display-entities.patch b/patches/server/Fix-rotation-when-spawning-display-entities.patch similarity index 100% rename from patches/unapplied/server/Fix-rotation-when-spawning-display-entities.patch rename to patches/server/Fix-rotation-when-spawning-display-entities.patch diff --git a/patches/unapplied/server/Fix-silent-equipment-change-for-mobs.patch b/patches/server/Fix-silent-equipment-change-for-mobs.patch similarity index 100% rename from patches/unapplied/server/Fix-silent-equipment-change-for-mobs.patch rename to patches/server/Fix-silent-equipment-change-for-mobs.patch diff --git a/patches/unapplied/server/Fix-spigot-s-Forced-Stats.patch b/patches/server/Fix-spigot-s-Forced-Stats.patch similarity index 100% rename from patches/unapplied/server/Fix-spigot-s-Forced-Stats.patch rename to patches/server/Fix-spigot-s-Forced-Stats.patch diff --git a/patches/unapplied/server/Implement-OfflinePlayer-isConnected.patch b/patches/server/Implement-OfflinePlayer-isConnected.patch similarity index 100% rename from patches/unapplied/server/Implement-OfflinePlayer-isConnected.patch rename to patches/server/Implement-OfflinePlayer-isConnected.patch diff --git a/patches/unapplied/server/Implement-PlayerFailMoveEvent.patch b/patches/server/Implement-PlayerFailMoveEvent.patch similarity index 92% rename from patches/unapplied/server/Implement-PlayerFailMoveEvent.patch rename to patches/server/Implement-PlayerFailMoveEvent.patch index 8b1bdd601..c8537b4da 100644 --- a/patches/unapplied/server/Implement-PlayerFailMoveEvent.patch +++ b/patches/server/Implement-PlayerFailMoveEvent.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -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 d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); final double toZ = d2; // Paper - OBFHELPER @@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.player.isPassenger()) { this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1); -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper start - Prevent moving into unloaded chunks if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) { @@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // Paper end -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // CraftBukkit end @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl boolean flag2 = false; if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot @@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // Paper start - optimise out extra getCubes -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (didCollide || !axisalignedbb.equals(newBox)) { // note: only call after setLocation, or else getBoundingBox is wrong teleportBack = this.hasNewCollision(worldserver, this.player, axisalignedbb, newBox); @@ -83,7 +83,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // else: no collision at all detected, why do we care? } if (!this.player.noPhysics && !this.player.isSleeping() && teleportBack) { // Paper end - optimise out extra getCubes -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } diff --git a/patches/unapplied/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch similarity index 100% rename from patches/unapplied/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch rename to patches/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch diff --git a/patches/unapplied/server/Improve-performance-of-mass-crafts.patch b/patches/server/Improve-performance-of-mass-crafts.patch similarity index 72% rename from patches/unapplied/server/Improve-performance-of-mass-crafts.patch rename to patches/server/Improve-performance-of-mass-crafts.patch index 851d88bcf..6c5a43d00 100644 --- a/patches/unapplied/server/Improve-performance-of-mass-crafts.patch +++ b/patches/server/Improve-performance-of-mass-crafts.patch @@ -27,12 +27,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!world.isClientSide) { ServerPlayer entityplayer = (ServerPlayer) player; ItemStack itemstack = ItemStack.EMPTY; -- Optional optional = world.getServer().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingInventory, world); -+ final Recipe currentRecipe = craftingInventory.getCurrentRecipe(); // Paper - check last recipe used first -+ Optional optional = currentRecipe == null ? world.getServer().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingInventory, world) : world.getServer().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingInventory, world, currentRecipe.getId()).map(com.mojang.datafixers.util.Pair::getSecond); // Paper - check last recipe used first +- Optional> optional = world.getServer().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingInventory, world); ++ final RecipeHolder currentRecipe = craftingInventory.getCurrentRecipe(); // Paper - check last recipe used first ++ Optional> optional = currentRecipe == null ? world.getServer().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingInventory, world) : world.getServer().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingInventory, world, currentRecipe.id()).map(com.mojang.datafixers.util.Pair::getSecond); // Paper - check last recipe used first if (optional.isPresent()) { - CraftingRecipe recipecrafting = (CraftingRecipe) optional.get(); + RecipeHolder recipeholder = (RecipeHolder) optional.get(); diff --git a/src/main/java/net/minecraft/world/inventory/ResultSlot.java b/src/main/java/net/minecraft/world/inventory/ResultSlot.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/inventory/ResultSlot.java @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void onTake(Player player, ItemStack stack) { this.checkTakeAchievements(stack); - NonNullList nonNullList = player.level().getRecipeManager().getRemainingItemsFor(RecipeType.CRAFTING, this.craftSlots, player.level()); -+ NonNullList nonNullList = player.level().getRecipeManager().getRemainingItemsFor(RecipeType.CRAFTING, this.craftSlots, player.level(), this.craftSlots.getCurrentRecipe() != null ? this.craftSlots.getCurrentRecipe().getId() : null); // Paper - check last recipe used first ++ NonNullList nonNullList = player.level().getRecipeManager().getRemainingItemsFor(RecipeType.CRAFTING, this.craftSlots, player.level(), this.craftSlots.getCurrentRecipe() != null ? this.craftSlots.getCurrentRecipe().id() : null); // Paper - check last recipe used first for(int i = 0; i < nonNullList.size(); ++i) { ItemStack itemStack = this.craftSlots.getItem(i); @@ -51,33 +51,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java @@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { - T t0 = map.get(id); // CraftBukkit - decompile error + RecipeHolder recipeholder = (RecipeHolder) map.get(id); - if (t0 != null && t0.matches(inventory, world)) { -+ inventory.setCurrentRecipe(t0); // Paper - return Optional.of(Pair.of(id, t0)); + if (recipeholder != null && recipeholder.value().matches(inventory, world)) { ++ inventory.setCurrentRecipe(recipeholder); // Paper + return Optional.of(Pair.of(id, recipeholder)); } } + inventory.setCurrentRecipe(null); // Paper - clear before it might be set again return map.entrySet().stream().filter((entry) -> { - return ((Recipe) entry.getValue()).matches(inventory, world); + return ((RecipeHolder) entry.getValue()).value().matches(inventory, world); }).findFirst().map((entry) -> { + inventory.setCurrentRecipe(entry.getValue()); // Paper - return Pair.of((ResourceLocation) entry.getKey(), entry.getValue()); // CraftBukkit - decompile error + return Pair.of((ResourceLocation) entry.getKey(), (RecipeHolder) entry.getValue()); }); } @@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { } public > NonNullList getRemainingItemsFor(RecipeType type, C inventory, Level world) { -- Optional optional = this.getRecipeFor(type, inventory, world); +- Optional> optional = this.getRecipeFor(type, inventory, world); + // Paper start - check last recipe used first + return this.getRemainingItemsFor(type, inventory, world, null); + } + public > NonNullList getRemainingItemsFor(RecipeType type, C inventory, Level world, @Nullable ResourceLocation firstToCheck) { -+ Optional optional = firstToCheck == null ? this.getRecipeFor(type, inventory, world) : this.getRecipeFor(type, inventory, world, firstToCheck).map(Pair::getSecond); ++ Optional> optional = firstToCheck == null ? this.getRecipeFor(type, inventory, world) : this.getRecipeFor(type, inventory, world, firstToCheck).map(Pair::getSecond); + // Paper end if (optional.isPresent()) { - return ((Recipe) optional.get()).getRemainingItems(inventory); + return ((RecipeHolder) optional.get()).value().getRemainingItems(inventory); diff --git a/patches/unapplied/server/Make-Amethyst-throw-both-Spread-and-Grow-Events.patch b/patches/server/Make-Amethyst-throw-both-Spread-and-Grow-Events.patch similarity index 100% rename from patches/unapplied/server/Make-Amethyst-throw-both-Spread-and-Grow-Events.patch rename to patches/server/Make-Amethyst-throw-both-Spread-and-Grow-Events.patch diff --git a/patches/unapplied/server/More-DragonBattle-API.patch b/patches/server/More-DragonBattle-API.patch similarity index 100% rename from patches/unapplied/server/More-DragonBattle-API.patch rename to patches/server/More-DragonBattle-API.patch diff --git a/patches/unapplied/server/Only-capture-actual-tree-growth.patch b/patches/server/Only-capture-actual-tree-growth.patch similarity index 100% rename from patches/unapplied/server/Only-capture-actual-tree-growth.patch rename to patches/server/Only-capture-actual-tree-growth.patch diff --git a/patches/unapplied/server/Only-erase-allay-memory-on-non-item-targets.patch b/patches/server/Only-erase-allay-memory-on-non-item-targets.patch similarity index 100% rename from patches/unapplied/server/Only-erase-allay-memory-on-non-item-targets.patch rename to patches/server/Only-erase-allay-memory-on-non-item-targets.patch diff --git a/patches/unapplied/server/Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch b/patches/server/Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch similarity index 100% rename from patches/unapplied/server/Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch rename to patches/server/Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch diff --git a/patches/unapplied/server/Optimize-nearest-structure-border-iteration.patch b/patches/server/Optimize-nearest-structure-border-iteration.patch similarity index 100% rename from patches/unapplied/server/Optimize-nearest-structure-border-iteration.patch rename to patches/server/Optimize-nearest-structure-border-iteration.patch diff --git a/patches/unapplied/server/Properly-handle-BlockBreakEvent-isDropItems.patch b/patches/server/Properly-handle-BlockBreakEvent-isDropItems.patch similarity index 100% rename from patches/unapplied/server/Properly-handle-BlockBreakEvent-isDropItems.patch rename to patches/server/Properly-handle-BlockBreakEvent-isDropItems.patch diff --git a/patches/unapplied/server/Remove-UpgradeData-neighbour-ticks-outside-of-range.patch b/patches/server/Remove-UpgradeData-neighbour-ticks-outside-of-range.patch similarity index 100% rename from patches/unapplied/server/Remove-UpgradeData-neighbour-ticks-outside-of-range.patch rename to patches/server/Remove-UpgradeData-neighbour-ticks-outside-of-range.patch diff --git a/patches/unapplied/server/Respect-randomizeData-on-more-entities-when-spawning.patch b/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch similarity index 100% rename from patches/unapplied/server/Respect-randomizeData-on-more-entities-when-spawning.patch rename to patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch diff --git a/patches/unapplied/server/SculkCatalyst-bloom-API.patch b/patches/server/SculkCatalyst-bloom-API.patch similarity index 100% rename from patches/unapplied/server/SculkCatalyst-bloom-API.patch rename to patches/server/SculkCatalyst-bloom-API.patch diff --git a/patches/unapplied/server/Skip-POI-finding-if-stuck-in-vehicle.patch b/patches/server/Skip-POI-finding-if-stuck-in-vehicle.patch similarity index 100% rename from patches/unapplied/server/Skip-POI-finding-if-stuck-in-vehicle.patch rename to patches/server/Skip-POI-finding-if-stuck-in-vehicle.patch diff --git a/patches/unapplied/server/Suppress-Item-Meta-Validation-Checks.patch b/patches/server/Suppress-Item-Meta-Validation-Checks.patch similarity index 98% rename from patches/unapplied/server/Suppress-Item-Meta-Validation-Checks.patch rename to patches/server/Suppress-Item-Meta-Validation-Checks.patch index 945fd5c81..38eed3aec 100644 --- a/patches/unapplied/server/Suppress-Item-Meta-Validation-Checks.patch +++ b/patches/server/Suppress-Item-Meta-Validation-Checks.patch @@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) { this.setProfile(NbtUtils.readGameProfile(tag.getCompound(SKULL_OWNER.NBT))); } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !tag.getString(SKULL_OWNER.NBT).isEmpty()) { - this.setProfile(new GameProfile(null, tag.getString(SKULL_OWNER.NBT))); + this.setProfile(new CraftGameProfile(null, tag.getString(SKULL_OWNER.NBT))); } + } catch (Exception ignored) {} // Paper diff --git a/patches/unapplied/server/Use-correct-seed-on-api-world-load.patch b/patches/server/Use-correct-seed-on-api-world-load.patch similarity index 100% rename from patches/unapplied/server/Use-correct-seed-on-api-world-load.patch rename to patches/server/Use-correct-seed-on-api-world-load.patch diff --git a/patches/unapplied/server/Use-correct-source-for-mushroom-block-spread-event.patch b/patches/server/Use-correct-source-for-mushroom-block-spread-event.patch similarity index 100% rename from patches/unapplied/server/Use-correct-source-for-mushroom-block-spread-event.patch rename to patches/server/Use-correct-source-for-mushroom-block-spread-event.patch diff --git a/patches/unapplied/server/Configurable-Region-Compression-Format.patch b/patches/unapplied/skipped/Configurable-Region-Compression-Format.patch similarity index 100% rename from patches/unapplied/server/Configurable-Region-Compression-Format.patch rename to patches/unapplied/skipped/Configurable-Region-Compression-Format.patch