[ci skip] Add more patch identifying comments, merge related patches

This commit is contained in:
Nassim Jahnke
2024-01-14 16:31:39 +01:00
parent 0cb53bb7af
commit 44f3ecd436
42 changed files with 460 additions and 584 deletions

View File

@@ -12,13 +12,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public void reloadResources() {
+ // Paper start - split this method up into separate methods
+ // Paper start - API for updating recipes on clients
+ this.reloadAdvancementData();
+ this.reloadTagData();
+ this.reloadRecipeData();
+ }
+ public void reloadAdvancementData() {
+ // Paper end
+ // Paper end - API for updating recipes on clients
// CraftBukkit start
/*Iterator iterator = this.advancements.values().iterator();
@@ -26,15 +26,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
// CraftBukkit end
+ // Paper start
+ // Paper start - API for updating recipes on clients
+ }
+ public void reloadTagData() {
+ // Paper end
+ // Paper end - API for updating recipes on clients
this.broadcastAll(new ClientboundUpdateTagsPacket(TagNetworkSerialization.serializeTagsToNetwork(this.registries)));
+ // Paper start
+ // Paper start - API for updating recipes on clients
+ }
+ public void reloadRecipeData() {
+ // Paper end
+ // Paper end - API for updating recipes on clients
ClientboundUpdateRecipesPacket packetplayoutrecipeupdate = new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getRecipes());
Iterator iterator1 = this.players.iterator();
@@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ReloadCommand.reload(this.console);
}
+ // Paper start
+ // Paper start - API for updating recipes on clients
+ @Override
+ public void updateResources() {
+ this.playerList.reloadResources();
@@ -56,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public void updateRecipes() {
+ this.playerList.reloadRecipeData();
+ }
+ // Paper end
+ // Paper end - API for updating recipes on clients
+
private void loadIcon() {
this.icon = new CraftIconCache(null);
@@ -65,13 +65,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public boolean addRecipe(Recipe recipe) {
+ // Paper start
+ // Paper start - API for updating recipes on clients
+ return this.addRecipe(recipe, false);
+ }
+
+ @Override
+ public boolean addRecipe(Recipe recipe, boolean resendRecipes) {
+ // Paper end
+ // Paper end - API for updating recipes on clients
CraftRecipe toAdd;
if (recipe instanceof CraftRecipe) {
toAdd = (CraftRecipe) recipe;
@@ -79,11 +79,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
toAdd.addToCraftingManager();
+ // Paper start
+ // Paper start - API for updating recipes on clients
+ if (resendRecipes) {
+ this.playerList.reloadRecipeData();
+ }
+ // Paper end
+ // Paper end - API for updating recipes on clients
return true;
}
@@ -91,13 +91,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public boolean removeRecipe(NamespacedKey recipeKey) {
+ // Paper start
+ // Paper start - API for updating recipes on clients
+ return this.removeRecipe(recipeKey, false);
+ }
+
+ @Override
+ public boolean removeRecipe(NamespacedKey recipeKey, boolean resendRecipes) {
+ // Paper end
+ // Paper end - API for updating recipes on clients
Preconditions.checkArgument(recipeKey != null, "recipeKey == null");
ResourceLocation mcKey = CraftNamespacedKey.toMinecraft(recipeKey);