1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-04-28 06:39:20 +02:00

Readd last API patch (with TODO)

This commit is contained in:
Nassim Jahnke 2024-10-27 09:43:00 +01:00
parent bcf52fe5fd
commit 348c855096
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F
301 changed files with 42 additions and 44 deletions
patches
api
0400-API-for-updating-recipes-on-clients.patch0401-Add-PlayerFailMoveEvent.patch0402-Fix-custom-statistic-criteria-creation.patch0403-SculkCatalyst-bloom-API.patch0404-API-for-an-entity-s-scoreboard-name.patch0405-Deprecate-and-replace-methods-with-old-StructureType.patch0406-Add-Listing-API-for-Player.patch0407-Expose-clicked-BlockFace-during-BlockDamageEvent.patch0408-Fix-NPE-on-Boat-getStatus.patch0409-Expand-Pose-API.patch0410-MerchantRecipe-add-copy-constructor.patch0411-More-DragonBattle-API.patch0412-Add-PlayerPickItemEvent.patch0413-Allow-trident-custom-damage.patch0414-Expose-hand-during-BlockCanBuildEvent.patch0415-Limit-setBurnTime-to-valid-short-values.patch0416-Add-OfflinePlayer-isConnected.patch0417-Add-titleOverride-to-InventoryOpenEvent.patch0418-Allow-proper-checking-of-empty-item-stacks.patch0419-Fix-PlayerSwapHandItemsEvent-throwing-exception-when.patch0420-Add-player-idle-duration-API.patch0421-Add-API-to-get-the-collision-shape-of-a-block-before.patch0422-Add-predicate-for-blocks-when-raytracing.patch0423-Add-hand-to-fish-event-for-all-player-interactions.patch0424-Attribute-Modifier-API-improvements.patch0425-Expand-LingeringPotion-API.patch0426-Remove-unnecessary-durability-check-in-ItemStack-isS.patch0427-Add-Structure-check-API.patch0428-Experimental-annotations-change.patch0429-Add-more-scoreboard-API.patch0430-Improve-Registry.patch0431-Add-experience-points-API.patch0432-Add-missing-InventoryType.patch0433-Add-drops-to-shear-events.patch0434-Add-HiddenPotionEffect-API.patch0435-Add-PlayerShieldDisableEvent.patch0436-Return-null-for-empty-String-in-NamespacedKey.fromSt.patch0437-Add-BlockStateMeta-clearBlockState.patch0438-Expose-LootTable-of-DecoratedPot.patch0439-Add-ShulkerDuplicateEvent.patch0440-Add-api-for-spawn-egg-texture-colors.patch0441-Add-Lifecycle-Event-system.patch0442-ItemStack-Tooltip-API.patch0443-Add-getChunkSnapshot-includeLightData-parameter.patch0444-Add-FluidState-API.patch0445-add-number-format-api.patch0446-improve-BanList-types.patch0447-Suspicious-Effect-Entry-API.patch0448-Fix-DamageSource-API.patch0449-Expanded-Hopper-API.patch0450-Clone-mutables-to-prevent-unexpected-issues.patch0451-Add-BlockBreakProgressUpdateEvent.patch0452-Deprecate-ItemStack-setType.patch0453-Item-Mutation-Fixes.patch0454-API-for-checking-sent-chunks.patch0455-Add-CartographyItemEvent.patch0456-More-Raid-API.patch0457-Fix-SpawnerEntry-Equipment-API.patch0458-Fix-ItemFlags.patch0459-Allow-modifying-library-loader-jars-bytecode.patch0460-Add-hook-to-remap-library-jars.patch0461-Add-GameMode-isInvulnerable.patch0462-Expose-hasColor-to-leather-armor.patch0463-Added-API-to-get-player-ha-proxy-address.patch0464-More-Chest-Block-API.patch0465-Brigadier-based-command-API.patch0466-Fix-issues-with-recipe-API.patch0467-Fix-equipment-slot-and-group-API.patch0468-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch0469-General-ItemMeta-fixes.patch0470-Add-missing-fishing-event-state.patch0471-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch0472-Registry-Modification-API.patch0473-Introduce-registry-entry-and-builders.patch0474-Proxy-ItemStack-to-CraftItemStack.patch0475-Make-a-PDC-view-accessible-directly-from-ItemStack.patch0476-Fix-HelpCommand-searching.patch0477-add-Plugin-getDataPath.patch0478-Fix-PickupStatus-getting-reset.patch0479-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch0480-Improve-StandardMessenger-exception-messages.patch0481-Add-even-more-Enchantment-API.patch0482-Leashable-API.patch0483-Add-enchantment-seed-update-API.patch0484-Deprecate-for-removal-all-OldEnum-related-methods.patch0485-Add-FeatureFlag-API.patch0486-Tag-Lifecycle-Events.patch0487-Item-serialization-as-json.patch0488-create-TileStateInventoryHolder.patch0489-Add-enchantWithLevels-with-enchantment-registry-set.patch0490-Improve-entity-effect-API.patch0491-Add-recipeBrewTime.patch0492-Add-PlayerInsertLecternBookEvent.patch0493-Void-damage-configuration-API.patch0494-Add-Offline-PDC-API.patch0495-Add-AnvilView-bypassEnchantmentLevelRestriction.patch0496-fix-DamageTypeTags-init.patch
server

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Deprecate and replace methods with old StructureType
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 50efe16bb80c618c3dfae03b70c8c165183af8ec..85ad1f7f0de9a6f9048981c3ee509b42ddbeef1a 100644
index 52c601328bbf5c1642aa620c8bb466a9d2d231be..c8fa12acaf52cd3923a7a8702ccc50cfdc9170a2 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -949,9 +949,6 @@ public final class Bukkit {
@ -84,7 +84,7 @@ index 50efe16bb80c618c3dfae03b70c8c165183af8ec..85ad1f7f0de9a6f9048981c3ee509b42
/**
* Reloads the server, refreshing settings and plugin information.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 1b8d6a3333a4fa9155b79644e683e2343c134e12..640ef81d204f480f4af83d420c7e968ce569a38d 100644
index 8ba2fbaab7428a42b506fd000fbc162f68ddaed1..50ffca9bccfb582d58ccb13f0decf66e5d91aef3 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -817,16 +817,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi

View file

@ -70,10 +70,10 @@ index a77c0411a68a9bad33ddfb335b7a996a843e478c..739d9d3ec789e58c10c8d818a9ca59ce
/**
* Banned player names
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 85ad1f7f0de9a6f9048981c3ee509b42ddbeef1a..2d466b308b2f8bd31c50f5d05416eadf20c9cb71 100644
index c8fa12acaf52cd3923a7a8702ccc50cfdc9170a2..e20e4239a5a1f952e1c70e899549989d5e42f73c 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1611,11 +1611,27 @@ public final class Bukkit {
@@ -1663,11 +1663,27 @@ public final class Bukkit {
* @param <T> The ban target
*
* @return a ban list of the specified type
@ -102,10 +102,10 @@ index 85ad1f7f0de9a6f9048981c3ee509b42ddbeef1a..2d466b308b2f8bd31c50f5d05416eadf
/**
* Gets a set containing all player operators.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 640ef81d204f480f4af83d420c7e968ce569a38d..20750c09d819d62f32491db8672936b929e1098e 100644
index 50ffca9bccfb582d58ccb13f0decf66e5d91aef3..6246251caf2c6f025c824b8e7a944b8d48751fa1 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1374,10 +1374,25 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1425,10 +1425,25 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @param <T> The ban target
*
* @return a ban list of the specified type

View file

@ -5,10 +5,10 @@ Subject: [PATCH] API for updating recipes on clients
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 2912b15ccda373cf52cec020b0e06ac2c5cf2950..a6caf3a0df22f124a4ee1cfb3981bbeb23a8630e 100644
index a9063533ea4b2b349d476127b99c822203d7dfcb..a1228d09b91dca3989a4be3120f9724a6e138040 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1490,6 +1490,13 @@ public abstract class PlayerList {
@@ -1450,6 +1450,13 @@ public abstract class PlayerList {
}
public void reloadResources() {
@ -22,27 +22,25 @@ index 2912b15ccda373cf52cec020b0e06ac2c5cf2950..a6caf3a0df22f124a4ee1cfb3981bbeb
// CraftBukkit start
/*Iterator iterator = this.advancements.values().iterator();
@@ -1505,7 +1512,15 @@ public abstract class PlayerList {
@@ -1465,7 +1472,13 @@ public abstract class PlayerList {
}
// CraftBukkit end
+ // Paper start - API for updating recipes on clients
+ }
+ public void reloadTagData() {
+ // Paper end - API for updating recipes on clients
this.broadcastAll(new ClientboundUpdateTagsPacket(TagNetworkSerialization.serializeTagsToNetwork(this.registries)));
+ // Paper start - API for updating recipes on clients
+ }
+ public void reloadRecipeData() {
+ // Paper end - API for updating recipes on clients
ClientboundUpdateRecipesPacket packetplayoutrecipeupdate = new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getOrderedRecipes());
RecipeManager craftingmanager = this.server.getRecipeManager();
ClientboundUpdateRecipesPacket packetplayoutrecipeupdate = new ClientboundUpdateRecipesPacket(craftingmanager.getSynchronizedItemProperties(), craftingmanager.getSynchronizedStonecutterRecipes());
Iterator iterator1 = this.players.iterator();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index bb89247a87067a74d793a1acc1eb95b98ace3d9e..75c222e592d676e98b293767d00de54a61411ae7 100644
index 3cf3b353cfb4337abdbb3b6842fd8fa128271948..0433de3c2455cf18584d5ab651843f8d1d874036 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1176,6 +1176,18 @@ public final class CraftServer implements Server {
@@ -1179,6 +1179,18 @@ public final class CraftServer implements Server {
ReloadCommand.reload(this.console);
}
@ -61,7 +59,7 @@ index bb89247a87067a74d793a1acc1eb95b98ace3d9e..75c222e592d676e98b293767d00de54a
private void loadIcon() {
this.icon = new CraftIconCache(null);
try {
@@ -1555,6 +1567,13 @@ public final class CraftServer implements Server {
@@ -1558,6 +1570,13 @@ public final class CraftServer implements Server {
@Override
public boolean addRecipe(Recipe recipe) {
@ -75,19 +73,19 @@ index bb89247a87067a74d793a1acc1eb95b98ace3d9e..75c222e592d676e98b293767d00de54a
CraftRecipe toAdd;
if (recipe instanceof CraftRecipe) {
toAdd = (CraftRecipe) recipe;
@@ -1584,6 +1603,11 @@ public final class CraftServer implements Server {
@@ -1589,6 +1608,11 @@ public final class CraftServer implements Server {
}
}
toAdd.addToCraftingManager();
+ // Paper start - API for updating recipes on clients
+ if (resendRecipes) {
+ if (true || resendRecipes) { // Always needs to be resent now... TODO
+ this.playerList.reloadRecipeData();
+ }
+ // Paper end - API for updating recipes on clients
return true;
}
@@ -1764,10 +1788,23 @@ public final class CraftServer implements Server {
@@ -1769,9 +1793,23 @@ public final class CraftServer implements Server {
@Override
public boolean removeRecipe(NamespacedKey recipeKey) {
@ -100,15 +98,15 @@ index bb89247a87067a74d793a1acc1eb95b98ace3d9e..75c222e592d676e98b293767d00de54a
+ // Paper end - API for updating recipes on clients
Preconditions.checkArgument(recipeKey != null, "recipeKey == null");
ResourceLocation mcKey = CraftNamespacedKey.toMinecraft(recipeKey);
- return this.getServer().getRecipeManager().removeRecipe(mcKey);
- return this.getServer().getRecipeManager().removeRecipe(CraftRecipe.toMinecraft(recipeKey));
+ // Paper start - resend recipes on successful removal
+ boolean removed = this.getServer().getRecipeManager().removeRecipe(mcKey);
+ if (removed && resendRecipes) {
+ final ResourceKey<net.minecraft.world.item.crafting.Recipe<?>> minecraftKey = CraftRecipe.toMinecraft(recipeKey);
+ final boolean removed = this.getServer().getRecipeManager().removeRecipe(minecraftKey);
+ if (removed/* && resendRecipes*/) { // TODO Always need to resend them rn - deprecate this method?
+ this.playerList.reloadRecipeData();
+ }
+ return removed;
+ // Paper end
+ // Paper end - resend recipes on successful removal
}
@Override

Some files were not shown because too many files have changed in this diff Show more