This commit is contained in:
nossr50
2020-09-25 11:36:42 -07:00
parent adbcf11c15
commit 8451f84083
5 changed files with 45 additions and 6 deletions

View File

@ -0,0 +1,40 @@
//package com.gmail.nossr50.listeners;
//
//import com.gmail.nossr50.datatypes.player.McMMOPlayer;
//import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
//import com.gmail.nossr50.mcMMO;
//import com.gmail.nossr50.util.player.UserManager;
//import com.gmail.nossr50.util.skills.SkillUtils;
//import org.bukkit.Bukkit;
//import org.bukkit.entity.Player;
//import org.bukkit.event.EventHandler;
//import org.bukkit.event.EventPriority;
//import org.bukkit.event.Listener;
//import org.bukkit.event.player.PlayerCommandPreprocessEvent;
//
//public class CommandListener implements Listener {
//
// private final mcMMO pluginRef;
//
// public CommandListener(mcMMO plugin) {
// this.pluginRef = plugin;
// }
//
// @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
// public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
// Player player = event.getPlayer();
//
// SkillUtils.removeAbilityBoostsFromInventory(player);
//
// McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
//
// if(mmoPlayer == null)
// return;
//
// Bukkit.getServer().getScheduler().runTaskLater(pluginRef, () -> {
// if(mmoPlayer.getAbilityMode(SuperAbilityType.GIGA_DRILL_BREAKER) || mmoPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER)) {
// SkillUtils.handleAbilitySpeedIncrease(player);
// }
// }, 5);
// }
//}

View File

@ -555,6 +555,7 @@ public class mcMMO extends JavaPlugin {
pluginManager.registerEvents(new InventoryListener(this), this);
pluginManager.registerEvents(new SelfListener(this), this);
pluginManager.registerEvents(new WorldListener(this), this);
// pluginManager.registerEvents(new CommandListener(this), this);
}
/**

View File

@ -198,10 +198,6 @@ public class SkillUtils {
}
public static void removeAbilityBoostsFromInventory(@NotNull Player player) {
if (!HiddenConfig.getInstance().useEnchantmentBuffs()) {
return;
}
for (ItemStack itemStack : player.getInventory().getContents()) {
removeAbilityBuff(itemStack);
}