File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/main/java/pers/yufiria/craftorithm/recipe Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,10 @@ public void start() {
368368
369369 public void end () {
370370 this .cancel ();
371+ //1.20.1以上paper端环境下,加载完配方给玩家更新配方信息
372+ if (CrypticLibBukkit .isPaper () && MinecraftVersion .current ().afterOrEquals (MinecraftVersion .V1_20_1 )) {
373+ Bukkit .updateRecipes ();
374+ }
371375 BukkitMsgSender .INSTANCE .debug ("Loaded " + craftorithmRecipes .size () + " recipes ,took " + useTick + " ticks" );
372376 if (callback != null ) {
373377 callback .run ();
Original file line number Diff line number Diff line change 11package pers .yufiria .craftorithm .recipe .register ;
22
3+ import crypticlib .CrypticLibBukkit ;
4+ import crypticlib .MinecraftVersion ;
35import org .bukkit .Bukkit ;
46import org .bukkit .NamespacedKey ;
57import org .bukkit .inventory .Recipe ;
@@ -11,11 +13,17 @@ public enum BukkitRecipeRegister implements RecipeRegister {
1113
1214 @ Override
1315 public boolean registerRecipe (Recipe recipe ) {
14- return Bukkit .addRecipe (recipe );
16+ if (CrypticLibBukkit .isPaper () && MinecraftVersion .current ().afterOrEquals (MinecraftVersion .V1_20_1 )) {
17+ //1.20.1以上paper端在添加配方时不对玩家进行更新,等加载完毕后统一更新
18+ return Bukkit .addRecipe (recipe , false );
19+ } else {
20+ return Bukkit .addRecipe (recipe );
21+ }
1522 }
1623
1724 @ Override
1825 public boolean unregisterRecipe (NamespacedKey recipeKey ) {
1926 return Bukkit .removeRecipe (recipeKey );
2027 }
28+
2129}
You can’t perform that action at this time.
0 commit comments