mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-23 02:55:40 +01:00
Disallow uncraftable items in trial mode
This commit is contained in:
parent
cbccaf91c7
commit
4f1c55c299
@ -21,6 +21,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import me.blackvein.quests.Quests;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -462,6 +463,15 @@ public class ItemStackPrompt extends QuestsEditorNumericPrompt {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidName"));
|
||||
return new ItemNamePrompt(context);
|
||||
} else {
|
||||
if (context.getPlugin() instanceof Quests) {
|
||||
final Quests plugin = (Quests)context.getPlugin();
|
||||
if (plugin.hasLimitedAccess(context.getForWhom())) {
|
||||
if (plugin.getServer().getRecipesFor(new ItemStack(mat)).isEmpty()) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("noPermission"));
|
||||
return new ItemStackPrompt(context, oldPrompt);
|
||||
}
|
||||
}
|
||||
}
|
||||
context.setSessionData("tempName", mat.name());
|
||||
context.setSessionData("tempAmount", 1);
|
||||
return new ItemStackPrompt(context, oldPrompt);
|
||||
|
Loading…
Reference in New Issue
Block a user