2012-04-27 11:47:11 +02:00
|
|
|
package com.gmail.nossr50.util;
|
|
|
|
|
2019-01-15 07:11:58 +01:00
|
|
|
import com.gmail.nossr50.commands.party.PartySubcommandType;
|
|
|
|
import com.gmail.nossr50.datatypes.skills.ItemType;
|
|
|
|
import com.gmail.nossr50.datatypes.skills.MaterialType;
|
2019-01-13 08:54:53 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
2019-01-15 07:11:58 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
2019-01-09 04:52:52 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
|
2019-01-15 07:11:58 +01:00
|
|
|
import com.gmail.nossr50.mcMMO;
|
2013-02-19 06:56:25 +01:00
|
|
|
import org.bukkit.Material;
|
2013-02-20 17:43:23 +01:00
|
|
|
import org.bukkit.Server;
|
|
|
|
import org.bukkit.World;
|
2013-08-30 19:50:34 +02:00
|
|
|
import org.bukkit.entity.EntityType;
|
2013-02-19 06:56:25 +01:00
|
|
|
import org.bukkit.permissions.Permissible;
|
2013-02-04 00:40:29 +01:00
|
|
|
import org.bukkit.permissions.Permission;
|
2013-02-20 17:43:23 +01:00
|
|
|
import org.bukkit.permissions.PermissionDefault;
|
2013-02-04 00:40:29 +01:00
|
|
|
import org.bukkit.plugin.PluginManager;
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-01-26 23:01:55 +01:00
|
|
|
public final class Permissions {
|
|
|
|
private Permissions() {}
|
2013-01-07 02:52:31 +01:00
|
|
|
|
|
|
|
/*
|
2013-02-19 06:56:25 +01:00
|
|
|
* GENERAL
|
2013-01-07 02:52:31 +01:00
|
|
|
*/
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean motd(Permissible permissible) { return permissible.hasPermission("mcmmo.motd"); }
|
2013-04-05 04:11:11 +02:00
|
|
|
public static boolean mobHealthDisplay(Permissible permissible) { return permissible.hasPermission("mcmmo.mobhealthdisplay"); }
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean updateNotifications(Permissible permissible) {return permissible.hasPermission("mcmmo.tools.updatecheck"); }
|
|
|
|
public static boolean chimaeraWing(Permissible permissible) { return permissible.hasPermission("mcmmo.item.chimaerawing"); }
|
2014-02-17 16:31:59 +01:00
|
|
|
public static boolean showversion(Permissible permissible) { return permissible.hasPermission("mcmmo.showversion"); }
|
2013-01-07 02:52:31 +01:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* BYPASS */
|
|
|
|
public static boolean hardcoreBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.hardcoremode"); }
|
|
|
|
public static boolean arcaneBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.arcanebypass"); }
|
2013-05-15 23:35:07 +02:00
|
|
|
public static boolean krakenBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.kraken"); }
|
2013-11-02 19:29:36 +01:00
|
|
|
public static boolean trapsBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.fishingtraps"); }
|
2013-01-07 02:52:31 +01:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* CHAT */
|
|
|
|
public static boolean partyChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.partychat"); }
|
|
|
|
public static boolean adminChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.adminchat"); }
|
2013-01-07 02:52:31 +01:00
|
|
|
|
|
|
|
/*
|
2013-02-19 06:56:25 +01:00
|
|
|
* COMMANDS
|
2013-01-07 02:52:31 +01:00
|
|
|
*/
|
|
|
|
|
2019-01-10 10:17:47 +01:00
|
|
|
public static boolean mmoinfo(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoinfo"); }
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean addlevels(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels"); }
|
|
|
|
public static boolean addlevelsOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels.others"); }
|
2013-01-07 02:52:31 +01:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean addxp(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addxp"); }
|
|
|
|
public static boolean addxpOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addxp.others"); }
|
2013-01-07 02:52:31 +01:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean hardcoreModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.hardcore.modify"); }
|
|
|
|
public static boolean hardcoreToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.hardcore.toggle"); }
|
2013-01-07 02:52:31 +01:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean inspect(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect")); }
|
|
|
|
public static boolean inspectFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.far")); }
|
2013-06-02 12:42:18 +02:00
|
|
|
public static boolean inspectHidden(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.hidden")); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-05-03 22:14:03 +02:00
|
|
|
public static boolean kraken(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken"); }
|
|
|
|
public static boolean krakenOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken.others"); }
|
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean mcability(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability")); }
|
|
|
|
public static boolean mcabilityOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability.others")); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2019-01-03 10:26:08 +01:00
|
|
|
public static boolean adminChatSpy(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcchatspy");}
|
|
|
|
public static boolean adminChatSpyOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcchatspy.others");}
|
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean mcgod(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcgod"); }
|
|
|
|
public static boolean mcgodOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcgod.others"); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean mcmmoDescription(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcmmo.description"); }
|
|
|
|
public static boolean mcmmoHelp(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcmmo.help"); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean mcrank(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank")); }
|
|
|
|
public static boolean mcrankOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others")); }
|
|
|
|
public static boolean mcrankFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others.far")); }
|
|
|
|
public static boolean mcrankOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others.offline")); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean mcrefresh(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh")); }
|
|
|
|
public static boolean mcrefreshOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh.others")); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
public static boolean mctop(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase()); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean mmoedit(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit"); }
|
|
|
|
public static boolean mmoeditOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit.others"); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean skillreset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset"); }
|
2019-01-13 08:54:53 +01:00
|
|
|
public static boolean skillreset(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase()); }
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean skillresetOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset.others"); }
|
2019-01-13 08:54:53 +01:00
|
|
|
public static boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase()); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
public static boolean xplock(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase()); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean xprateSet(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.set"); }
|
|
|
|
public static boolean xprateReset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.reset"); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean vampirismModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.modify"); }
|
|
|
|
public static boolean vampirismToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.toggle"); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-28 14:58:59 +01:00
|
|
|
public static boolean mcpurge(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcpurge"); }
|
|
|
|
public static boolean mcremove(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcremove"); }
|
|
|
|
public static boolean mmoupdate(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoupdate"); }
|
2019-04-30 20:19:55 +02:00
|
|
|
public static boolean reloadlocale(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.reloadlocale"); }
|
2013-02-28 14:58:59 +01:00
|
|
|
|
2012-04-27 11:47:11 +02:00
|
|
|
/*
|
2013-02-19 06:56:25 +01:00
|
|
|
* PERKS
|
2012-04-27 11:47:11 +02:00
|
|
|
*/
|
|
|
|
|
2019-04-13 22:17:28 +02:00
|
|
|
/* BYPASS PERKS */
|
|
|
|
|
|
|
|
public static boolean hasRepairEnchantBypassPerk(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.bypass.repairenchant"); }
|
|
|
|
public static boolean hasSalvageEnchantBypassPerk(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.bypass.salvageenchant"); }
|
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
public static boolean lucky(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase()); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* XP PERKS */
|
2019-01-13 08:54:53 +01:00
|
|
|
public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase()); }
|
|
|
|
public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase()); }
|
|
|
|
public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase()); }
|
|
|
|
public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase()); }
|
|
|
|
public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase()); }
|
|
|
|
public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase()); }
|
|
|
|
public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase()); }
|
2012-04-30 14:26:37 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* ACTIVATION PERKS */
|
|
|
|
public static boolean twelveSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); }
|
|
|
|
public static boolean eightSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.eightseconds"); }
|
|
|
|
public static boolean fourSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.fourseconds"); }
|
2012-04-30 14:26:37 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* COOLDOWN PERKS */
|
|
|
|
public static boolean halvedCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.halved"); }
|
|
|
|
public static boolean thirdedCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.thirded"); }
|
|
|
|
public static boolean quarteredCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.quartered"); }
|
2013-01-30 19:24:56 +01:00
|
|
|
|
2012-04-27 11:47:11 +02:00
|
|
|
/*
|
2013-02-19 06:56:25 +01:00
|
|
|
* SKILLS
|
2012-04-27 11:47:11 +02:00
|
|
|
*/
|
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); }
|
|
|
|
public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".vanillaxpboost"); }
|
2019-01-09 04:52:52 +01:00
|
|
|
public static boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) { return permissible.hasPermission(subSkillType.getPermissionNodeAddress()); }
|
|
|
|
public static boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { return permissible.hasPermission(abstractSubSkill.getPermissionNode()); }
|
2019-01-13 08:54:53 +01:00
|
|
|
public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage"); }
|
2013-11-16 00:21:00 +01:00
|
|
|
|
|
|
|
/* ACROBATICS */
|
|
|
|
public static boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); }
|
|
|
|
public static boolean gracefulRoll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.gracefulroll"); }
|
|
|
|
public static boolean roll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.roll"); }
|
|
|
|
|
|
|
|
/* ALCHEMY */
|
|
|
|
public static boolean catalysis(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.catalysis"); }
|
|
|
|
public static boolean concoctions(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.concoctions"); }
|
|
|
|
|
|
|
|
/* ARCHERY */
|
|
|
|
public static boolean arrowRetrieval(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.trackarrows"); }
|
|
|
|
public static boolean daze(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.daze"); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* AXES */
|
|
|
|
public static boolean skullSplitter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.skullsplitter"); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* EXCAVATION */
|
|
|
|
public static boolean gigaDrillBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.excavation.gigadrillbreaker"); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* HERBALISM */
|
|
|
|
public static boolean greenTerra(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); }
|
|
|
|
public static boolean greenThumbBlock(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase()); }
|
|
|
|
public static boolean greenThumbPlant(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); }
|
2012-04-27 11:47:11 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* MINING */
|
|
|
|
public static boolean biggerBombs(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); }
|
|
|
|
public static boolean demolitionsExpertise(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.demolitionsexpertise"); }
|
|
|
|
public static boolean remoteDetonation(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.detonate"); }
|
|
|
|
public static boolean superBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); }
|
2012-05-01 19:52:44 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* REPAIR */
|
2013-12-14 14:27:50 +01:00
|
|
|
public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair"); }
|
|
|
|
public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { return permissible.hasPermission("mcmmo.ability.repair." + repairMaterialType.toString().toLowerCase() + "repair"); }
|
2013-02-19 06:56:25 +01:00
|
|
|
|
2013-03-06 18:31:48 +01:00
|
|
|
/* SALVAGE */
|
|
|
|
public static boolean advancedSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.advancedsalvage"); }
|
|
|
|
public static boolean arcaneSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); }
|
|
|
|
|
2013-12-14 14:27:50 +01:00
|
|
|
public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage"); }
|
|
|
|
public static boolean salvageMaterialType(Permissible permissible, MaterialType salvageMaterialType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageMaterialType.toString().toLowerCase() + "salvage"); }
|
|
|
|
|
2013-03-06 18:31:48 +01:00
|
|
|
/* SMELTING */
|
|
|
|
public static boolean fluxMining(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fluxmining"); }
|
|
|
|
public static boolean fuelEfficiency(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fuelefficiency"); }
|
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* SWORDS */
|
|
|
|
public static boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); }
|
|
|
|
|
|
|
|
/* TAMING */
|
2013-08-30 19:50:34 +02:00
|
|
|
public static boolean callOfTheWild(Permissible permissible, EntityType type) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase()); }
|
2013-09-17 00:55:38 +02:00
|
|
|
|
2013-02-19 06:56:25 +01:00
|
|
|
/* UNARMED */
|
|
|
|
public static boolean berserk(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); }
|
|
|
|
|
|
|
|
/* WOODCUTTING */
|
|
|
|
public static boolean treeFeller(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); }
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PARTY
|
|
|
|
*/
|
2019-01-11 15:17:07 +01:00
|
|
|
public static boolean partySizeBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.partylimit" ); }
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean party(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.party"); }
|
2013-04-04 22:21:13 +02:00
|
|
|
public static boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase()); }
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean friendlyFire(Permissible permissible) { return permissible.hasPermission("mcmmo.party.friendlyfire"); }
|
|
|
|
|
|
|
|
/* TELEPORT */
|
2013-04-04 22:20:19 +02:00
|
|
|
public static boolean partyTeleportSend(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.send"); }
|
2013-02-19 06:56:25 +01:00
|
|
|
public static boolean partyTeleportAccept(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.accept"); }
|
|
|
|
public static boolean partyTeleportAcceptAll(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.acceptall"); }
|
|
|
|
public static boolean partyTeleportToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.toggle"); }
|
|
|
|
|
2013-02-20 17:43:23 +01:00
|
|
|
public static boolean partyTeleportAllWorlds(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.world.all"); }
|
|
|
|
public static boolean partyTeleportWorld(Permissible permissible, World world) { return permissible.hasPermission("mcmmo.commands.ptp.world." + world.getName()); }
|
2013-01-23 22:34:01 +01:00
|
|
|
|
2013-02-20 17:43:23 +01:00
|
|
|
public static void generateWorldTeleportPermissions() {
|
|
|
|
Server server = mcMMO.p.getServer();
|
|
|
|
PluginManager pluginManager = server.getPluginManager();
|
2013-02-08 00:46:41 +01:00
|
|
|
|
2013-02-20 17:43:23 +01:00
|
|
|
for (World world : server.getWorlds()) {
|
|
|
|
addDynamicPermission("mcmmo.commands.ptp.world." + world.getName(), PermissionDefault.OP, pluginManager);
|
2013-02-19 06:56:25 +01:00
|
|
|
}
|
2013-02-20 17:43:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private static void addDynamicPermission(String permissionName, PermissionDefault permissionDefault, PluginManager pluginManager) {
|
|
|
|
Permission permission = new Permission(permissionName);
|
|
|
|
permission.setDefault(permissionDefault);
|
|
|
|
pluginManager.addPermission(permission);
|
2013-02-08 00:46:41 +01:00
|
|
|
}
|
2012-04-27 11:47:11 +02:00
|
|
|
}
|