Prevent registering recipes if crafting is disabled.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment
2019-10-06 16:59:30 +00:00
parent 2f53082a4f
commit 6de3207b0e
16 changed files with 120 additions and 12 deletions

View File

@@ -16,6 +16,7 @@
*/
package handlers.itemhandlers;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.data.xml.impl.RecipeData;
import org.l2jmobius.gameserver.handler.IItemHandler;
import org.l2jmobius.gameserver.model.RecipeList;
@@ -39,6 +40,12 @@ public class Recipes implements IItemHandler
return false;
}
if (!Config.IS_CRAFTING_ENABLED)
{
playable.sendMessage("Crafting is disabled, you cannot register this recipe.");
return false;
}
final PlayerInstance player = playable.getActingPlayer();
if (player.isCrafting())
{