mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Updated permissions for more control over Call of the Wild.
This commit is contained in:
parent
2c8b9334b6
commit
7523afffb5
@ -1,5 +1,7 @@
|
|||||||
package com.gmail.nossr50.commands.skills;
|
package com.gmail.nossr50.commands.skills;
|
||||||
|
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
@ -36,7 +38,7 @@ public class TamingCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck() {
|
protected void permissionsCheck() {
|
||||||
canBeastLore = Permissions.beastLore(player);
|
canBeastLore = Permissions.beastLore(player);
|
||||||
canCallWild = Permissions.callOfTheWild(player);
|
canCallWild = Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
|
||||||
canEnvironmentallyAware = Permissions.environmentallyAware(player);
|
canEnvironmentallyAware = Permissions.environmentallyAware(player);
|
||||||
canFastFood = Permissions.fastFoodService(player);
|
canFastFood = Permissions.fastFoodService(player);
|
||||||
canGore = Permissions.gore(player);
|
canGore = Permissions.gore(player);
|
||||||
|
@ -572,7 +572,7 @@ public class PlayerListener implements Listener {
|
|||||||
case LEFT_CLICK_BLOCK:
|
case LEFT_CLICK_BLOCK:
|
||||||
|
|
||||||
/* CALL OF THE WILD CHECKS */
|
/* CALL OF THE WILD CHECKS */
|
||||||
if (player.isSneaking() && Permissions.callOfTheWild(player)) {
|
if (player.isSneaking()) {
|
||||||
Material type = heldItem.getType();
|
Material type = heldItem.getType();
|
||||||
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
|
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
|
||||||
|
|
||||||
|
@ -130,6 +130,10 @@ public class TamingManager extends SkillManager {
|
|||||||
* Summon an ocelot to your side.
|
* Summon an ocelot to your side.
|
||||||
*/
|
*/
|
||||||
public void summonOcelot() {
|
public void summonOcelot() {
|
||||||
|
if (!Permissions.callOfTheWild(getPlayer(), EntityType.OCELOT)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
callOfTheWild(EntityType.OCELOT, Config.getInstance().getTamingCOTWOcelotCost());
|
callOfTheWild(EntityType.OCELOT, Config.getInstance().getTamingCOTWOcelotCost());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,6 +141,10 @@ public class TamingManager extends SkillManager {
|
|||||||
* Summon a wolf to your side.
|
* Summon a wolf to your side.
|
||||||
*/
|
*/
|
||||||
public void summonWolf() {
|
public void summonWolf() {
|
||||||
|
if (!Permissions.callOfTheWild(getPlayer(), EntityType.WOLF)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
callOfTheWild(EntityType.WOLF, Config.getInstance().getTamingCOTWWolfCost());
|
callOfTheWild(EntityType.WOLF, Config.getInstance().getTamingCOTWWolfCost());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package com.gmail.nossr50.util;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.permissions.Permissible;
|
import org.bukkit.permissions.Permissible;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
@ -196,8 +197,8 @@ public final class Permissions {
|
|||||||
|
|
||||||
/* TAMING */
|
/* TAMING */
|
||||||
public static boolean beastLore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.beastlore"); }
|
public static boolean beastLore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.beastlore"); }
|
||||||
public static boolean callOfTheWild(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild"); }
|
public static boolean callOfTheWild(Permissible permissible, EntityType type) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase()); }
|
||||||
public static boolean renamePets(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild_renamepets"); }
|
public static boolean renamePets(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild.renamepets"); }
|
||||||
public static boolean environmentallyAware(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.environmentallyaware"); }
|
public static boolean environmentallyAware(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.environmentallyaware"); }
|
||||||
public static boolean fastFoodService(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.fastfoodservice"); }
|
public static boolean fastFoodService(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.fastfoodservice"); }
|
||||||
public static boolean gore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.gore"); }
|
public static boolean gore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.gore"); }
|
||||||
|
@ -525,8 +525,7 @@ permissions:
|
|||||||
description: Allows access to all Taming abilities
|
description: Allows access to all Taming abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.taming.beastlore: true
|
mcmmo.ability.taming.beastlore: true
|
||||||
mcmmo.ability.taming.callofthewild: true
|
mcmmo.ability.taming.callofthewild.all: true
|
||||||
mcmmo.ability.taming.callofthewild_renamepets: true
|
|
||||||
mcmmo.ability.taming.environmentallyaware: true
|
mcmmo.ability.taming.environmentallyaware: true
|
||||||
mcmmo.ability.taming.fastfoodservice: true
|
mcmmo.ability.taming.fastfoodservice: true
|
||||||
mcmmo.ability.taming.gore: true
|
mcmmo.ability.taming.gore: true
|
||||||
@ -536,10 +535,33 @@ permissions:
|
|||||||
mcmmo.ability.taming.thickfur: true
|
mcmmo.ability.taming.thickfur: true
|
||||||
mcmmo.ability.taming.beastlore:
|
mcmmo.ability.taming.beastlore:
|
||||||
description: Allows access to the Beast Lore ability
|
description: Allows access to the Beast Lore ability
|
||||||
mcmmo.ability.taming.callofthewild:
|
mcmmo.ability.taming.callofthewild.*:
|
||||||
|
default: false
|
||||||
description: Allows access to the Call of the Wild ability
|
description: Allows access to the Call of the Wild ability
|
||||||
|
children:
|
||||||
|
mcmmo.ability.taming.callofthewild.all: true
|
||||||
|
mcmmo.ability.taming.callofthewild:
|
||||||
|
default: false
|
||||||
|
description: Allows access to the Call of the Wild ability
|
||||||
|
children:
|
||||||
|
mcmmo.ability.taming.callofthewild.all: true
|
||||||
|
mcmmo.ability.taming.callofthewild.all:
|
||||||
|
description: Allows access to the Call of the Wild abilities
|
||||||
|
children:
|
||||||
|
mcmmo.ability.taming.callofthewild.ocelot: true
|
||||||
|
mcmmo.ability.taming.callofthewild.renamepets: true
|
||||||
|
mcmmo.ability.taming.callofthewild.wolf: true
|
||||||
|
mcmmo.ability.taming.callofthewild.ocelot:
|
||||||
|
description: Allows players to summon Ocelots with Call of the Wild
|
||||||
|
mcmmo.ability.taming.callofthewild.renamepets:
|
||||||
|
description: Allows players to rename pets with Call of the Wild
|
||||||
|
mcmmo.ability.taming.callofthewild.wolf:
|
||||||
|
description: Allows players to summon Wolves with Call of the Wild
|
||||||
mcmmo.ability.taming.callofthewild_renamepets:
|
mcmmo.ability.taming.callofthewild_renamepets:
|
||||||
|
default: false
|
||||||
description: Pets spawned with Call of the Wild will have custom names
|
description: Pets spawned with Call of the Wild will have custom names
|
||||||
|
children:
|
||||||
|
mcmmo.ability.taming.callofthewild.renamepets: true
|
||||||
mcmmo.ability.taming.environmentallyaware:
|
mcmmo.ability.taming.environmentallyaware:
|
||||||
description: Allows access to the Environmentally Aware ability
|
description: Allows access to the Environmentally Aware ability
|
||||||
mcmmo.ability.taming.fastfoodservice:
|
mcmmo.ability.taming.fastfoodservice:
|
||||||
|
Loading…
Reference in New Issue
Block a user