From 90d4f9c1f7a9ee09fc1beea9e5e2bae02350e91f Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 1 Sep 2017 16:43:43 +0100 Subject: [PATCH] Make mounts use permissions --- .../Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java | 4 ++++ .../mineplex/core/gadget/gadgets/mount/types/MountDragon.java | 3 ++- .../mineplex/core/gadget/gadgets/mount/types/MountTitan.java | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 362f530ba..a6893e7b4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -324,8 +324,10 @@ public class GadgetManager extends MiniPlugin TITAN_PARTICLE_EFFECT, HERO_MORPH_BLAZE, HERO_MORPH_CREEPER, + HERO_MOUNT, ULTRA_MORPH, TITAN_MORPH, + TITAN_MOUNT, LEGEND_MORPH, AMMO_COMMAND, LOCK_INFUSED_COMMAND, @@ -409,6 +411,8 @@ public class GadgetManager extends MiniPlugin PermissionGroup.TITAN.setPermission(Perm.TITAN_PARTICLE_EFFECT, true, true); PermissionGroup.HERO.setPermission(Perm.HERO_MORPH_BLAZE, true, true); PermissionGroup.HERO.setPermission(Perm.HERO_MORPH_CREEPER, true, true); + PermissionGroup.HERO.setPermission(Perm.HERO_MOUNT, true, true); + PermissionGroup.TITAN.setPermission(Perm.TITAN_MOUNT, true, true); PermissionGroup.ULTRA.setPermission(Perm.ULTRA_MORPH, true, true); PermissionGroup.TITAN.setPermission(Perm.TITAN_MORPH, true, true); PermissionGroup.LEGEND.setPermission(Perm.LEGEND_MORPH, true, true); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/mount/types/MountDragon.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/mount/types/MountDragon.java index 6c00ae6e8..fd3ec4459 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/mount/types/MountDragon.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/mount/types/MountDragon.java @@ -15,6 +15,7 @@ import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.GadgetManager.Perm; import mineplex.core.gadget.gadgets.mount.DragonData; import mineplex.core.gadget.gadgets.mount.DragonMount; import mineplex.core.gadget.util.CostConstants; @@ -110,7 +111,7 @@ public class MountDragon extends DragonMount @EventHandler public void HeroOwner(PlayerJoinEvent event) { - if (Manager.getClientManager().Get(event.getPlayer()).hasPermission(MountManager.Perm.HERO_MOUNT)) + if (Manager.getClientManager().Get(event.getPlayer()).hasPermission(Perm.HERO_MOUNT)) { Manager.getDonationManager().Get(event.getPlayer()).addOwnedUnknownSalesPackage(getName()); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/mount/types/MountTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/mount/types/MountTitan.java index 412b0fbe9..31e3d30fe 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/mount/types/MountTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/mount/types/MountTitan.java @@ -5,13 +5,13 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerJoinEvent; -import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.GadgetManager.Perm; import mineplex.core.gadget.gadgets.mount.Mount; import mineplex.core.gadget.util.CostConstants; import mineplex.core.updater.UpdateType; @@ -77,7 +77,7 @@ public class MountTitan extends Mount @EventHandler public void titanOwner(PlayerJoinEvent event) { - if (Manager.getClientManager().hasRank(event.getPlayer(), Rank.TITAN)) + if (Manager.getClientManager().Get(event.getPlayer()).hasPermission(Perm.TITAN_MOUNT)) { Manager.getDonationManager().Get(event.getPlayer()).addOwnedUnknownSalesPackage(getName()); }