diff --git a/paper-server/nms-patches/net/minecraft/server/players/PlayerList.patch b/paper-server/nms-patches/net/minecraft/server/players/PlayerList.patch index f4b02439b8..f7122713bc 100644 --- a/paper-server/nms-patches/net/minecraft/server/players/PlayerList.patch +++ b/paper-server/nms-patches/net/minecraft/server/players/PlayerList.patch @@ -421,13 +421,13 @@ + if (this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile)) { + event.disallow(PlayerLoginEvent.Result.KICK_FULL, "The server is full"); + } - } ++ } + + cserver.getPluginManager().callEvent(event); + if (event.getResult() != PlayerLoginEvent.Result.ALLOWED) { + loginlistener.disconnect(event.getKickMessage()); + return null; -+ } + } + return entity; } @@ -766,7 +766,7 @@ } advancementdataplayer.setPlayer(entityplayer); -@@ -932,13 +1236,20 @@ +@@ -932,15 +1236,28 @@ } public void reloadResources() { @@ -787,4 +787,12 @@ + // CraftBukkit end this.broadcastAll(new ClientboundUpdateTagsPacket(TagNetworkSerialization.serializeTagsToNetwork(this.registries))); ++ // CraftBukkit start ++ reloadRecipes(); ++ } ++ ++ public void reloadRecipes() { ++ // CraftBukkit end CraftingManager craftingmanager = this.server.getRecipeManager(); + PacketPlayOutRecipeUpdate packetplayoutrecipeupdate = new PacketPlayOutRecipeUpdate(craftingmanager.getSynchronizedItemProperties(), craftingmanager.getSynchronizedStonecutterRecipes()); + Iterator iterator1 = this.players.iterator(); diff --git a/paper-server/nms-patches/net/minecraft/world/item/crafting/CraftingManager.patch b/paper-server/nms-patches/net/minecraft/world/item/crafting/CraftingManager.patch index 3653f81f89..e69ac74e7d 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/crafting/CraftingManager.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/crafting/CraftingManager.patch @@ -1,17 +1,18 @@ --- a/net/minecraft/world/item/crafting/CraftingManager.java +++ b/net/minecraft/world/item/crafting/CraftingManager.java -@@ -38,6 +38,10 @@ +@@ -38,6 +38,11 @@ import net.minecraft.world.level.World; import org.slf4j.Logger; +// CraftBukkit start +import java.util.Collections; ++import net.minecraft.server.MinecraftServer; +// CraftBukkit end + public class CraftingManager extends ResourceDataAbstract implements RecipeAccess { private static final Logger LOGGER = LogUtils.getLogger(); -@@ -109,7 +113,23 @@ +@@ -109,7 +114,25 @@ CraftingManager.LOGGER.info("Loaded {} recipes", recipemap.values().size()); } @@ -26,6 +27,8 @@ + public void finalizeRecipeLoading() { + if (featureflagset != null) { + finalizeRecipeLoading(featureflagset); ++ ++ MinecraftServer.getServer().getPlayerList().reloadRecipes(); + } + } + @@ -35,7 +38,7 @@ List> list = new ArrayList(); List list1 = CraftingManager.RECIPE_PROPERTY_SETS.entrySet().stream().map((entry) -> { return new CraftingManager.b((ResourceKey) entry.getKey(), (CraftingManager.c) entry.getValue()); -@@ -128,7 +148,7 @@ +@@ -128,7 +151,7 @@ RecipeStonecutting recipestonecutting = (RecipeStonecutting) irecipe; if (isIngredientEnabled(featureflagset, recipestonecutting.input()) && recipestonecutting.resultDisplay().isEnabled(featureflagset)) { @@ -44,7 +47,7 @@ } } -@@ -170,7 +190,10 @@ +@@ -170,7 +193,10 @@ } public > Optional> getRecipeFor(Recipes recipes, I i0, World world) { @@ -56,7 +59,7 @@ } public Optional> byKey(ResourceKey> resourcekey) { -@@ -181,7 +204,7 @@ +@@ -181,7 +207,7 @@ private > RecipeHolder byKeyTyped(Recipes recipes, ResourceKey> resourcekey) { RecipeHolder recipeholder = this.recipes.byKey(resourcekey); @@ -65,7 +68,7 @@ } public Map, RecipePropertySet> getSynchronizedItemProperties() { -@@ -229,6 +252,22 @@ +@@ -229,6 +255,22 @@ return new RecipeHolder<>(resourcekey, irecipe); }