mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Handle all the buff removal in BlockDamage. Also removes the config
option for using Mining & Excavation without tools.
This commit is contained in:
parent
a9ed1a1850
commit
4071f259ad
@ -90,7 +90,8 @@ Version 1.4.00-dev
|
|||||||
- Removed Party "master/apprentice" system. Replaced with the new party XP share feature.
|
- Removed Party "master/apprentice" system. Replaced with the new party XP share feature.
|
||||||
- Removed unused "healthbar" files from the resources
|
- Removed unused "healthbar" files from the resources
|
||||||
- Removed config options for disabling commands from the config.yml. This should instead be done through permissions.
|
- Removed config options for disabling commands from the config.yml. This should instead be done through permissions.
|
||||||
- Removed /mcc command. Replaced with /mcmmo [?|help|commands]
|
- Removed /mcc command. Replaced with /mcmmo [?|help|commands]
|
||||||
|
- Removed options to allow Mining & Excavation without a tool due to the changes to their abilities
|
||||||
|
|
||||||
Version 1.3.14
|
Version 1.3.14
|
||||||
+ Added new Hylian Luck skill to Herbalism.
|
+ Added new Hylian Luck skill to Herbalism.
|
||||||
|
@ -8,7 +8,6 @@ import org.bukkit.entity.Player;
|
|||||||
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.utilities.SkillTools;
|
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class McrefreshCommand implements CommandExecutor {
|
public class McrefreshCommand implements CommandExecutor {
|
||||||
@ -33,7 +32,6 @@ public class McrefreshCommand implements CommandExecutor {
|
|||||||
profile.resetCooldowns();
|
profile.resetCooldowns();
|
||||||
profile.resetToolPrepMode();
|
profile.resetToolPrepMode();
|
||||||
profile.resetAbilityMode();
|
profile.resetAbilityMode();
|
||||||
SkillTools.handleAbilitySpeedDecrease((Player) sender); //Remove enchants left over
|
|
||||||
|
|
||||||
sender.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
sender.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||||
return true;
|
return true;
|
||||||
@ -69,7 +67,6 @@ public class McrefreshCommand implements CommandExecutor {
|
|||||||
profile.resetCooldowns();
|
profile.resetCooldowns();
|
||||||
profile.resetToolPrepMode();
|
profile.resetToolPrepMode();
|
||||||
profile.resetAbilityMode();
|
profile.resetAbilityMode();
|
||||||
SkillTools.handleAbilitySpeedDecrease(player); //Remove enchants left over
|
|
||||||
|
|
||||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", args[0]));
|
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", args[0]));
|
||||||
|
@ -150,8 +150,6 @@ public class Config extends ConfigLoader {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Tool Requirements */
|
/* Tool Requirements */
|
||||||
public boolean getMiningRequiresTool() { return config.getBoolean("Skills.Mining.Requires_Pickaxe", true); }
|
|
||||||
public boolean getExcavationRequiresTool() { return config.getBoolean("Skills.Excavation.Requires_Shovel", true); }
|
|
||||||
public boolean getWoodcuttingRequiresTool() { return config.getBoolean("Skills.Woodcutting.Requires_Axe", true); }
|
public boolean getWoodcuttingRequiresTool() { return config.getBoolean("Skills.Woodcutting.Requires_Axe", true); }
|
||||||
|
|
||||||
/* Excavation */
|
/* Excavation */
|
||||||
|
@ -30,7 +30,6 @@ import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
|||||||
import com.gmail.nossr50.runnables.StickyPistonTracker;
|
import com.gmail.nossr50.runnables.StickyPistonTracker;
|
||||||
import com.gmail.nossr50.skills.excavation.Excavation;
|
import com.gmail.nossr50.skills.excavation.Excavation;
|
||||||
import com.gmail.nossr50.skills.herbalism.Herbalism;
|
import com.gmail.nossr50.skills.herbalism.Herbalism;
|
||||||
import com.gmail.nossr50.skills.mining.Mining;
|
|
||||||
import com.gmail.nossr50.skills.mining.MiningManager;
|
import com.gmail.nossr50.skills.mining.MiningManager;
|
||||||
import com.gmail.nossr50.skills.repair.Repair;
|
import com.gmail.nossr50.skills.repair.Repair;
|
||||||
import com.gmail.nossr50.skills.repair.Salvage;
|
import com.gmail.nossr50.skills.repair.Salvage;
|
||||||
@ -169,24 +168,12 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* MINING */
|
/* MINING */
|
||||||
else if (BlockChecks.canBeSuperBroken(block) && player.hasPermission("mcmmo.skills.mining") && !mcMMO.placeStore.isTrue(block)) {
|
else if (BlockChecks.canBeSuperBroken(block) && ItemChecks.isPickaxe(heldItem) && player.hasPermission("mcmmo.skills.mining") && !mcMMO.placeStore.isTrue(block)) {
|
||||||
if (Mining.requiresTool) {
|
MiningManager miningManager = new MiningManager(mcMMOPlayer);
|
||||||
if (ItemChecks.isPickaxe(heldItem)) {
|
miningManager.miningBlockCheck(block);
|
||||||
MiningManager miningManager = new MiningManager(mcMMOPlayer);
|
|
||||||
miningManager.miningBlockCheck(block);
|
|
||||||
|
|
||||||
if (profile.getAbilityMode(AbilityType.SUPER_BREAKER)) {
|
if (profile.getAbilityMode(AbilityType.SUPER_BREAKER)) {
|
||||||
miningManager.miningBlockCheck(block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
MiningManager miningManager = new MiningManager(mcMMOPlayer);
|
|
||||||
miningManager.miningBlockCheck(block);
|
miningManager.miningBlockCheck(block);
|
||||||
|
|
||||||
if (profile.getAbilityMode(AbilityType.SUPER_BREAKER)) {
|
|
||||||
miningManager.miningBlockCheck(block);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,22 +195,11 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* EXCAVATION */
|
/* EXCAVATION */
|
||||||
else if (BlockChecks.canBeGigaDrillBroken(block) && player.hasPermission("mcmmo.skills.excavation") && !mcMMO.placeStore.isTrue(block)) {
|
else if (BlockChecks.canBeGigaDrillBroken(block) && ItemChecks.isShovel(heldItem) && player.hasPermission("mcmmo.skills.excavation") && !mcMMO.placeStore.isTrue(block)) {
|
||||||
if (Excavation.requiresTool) {
|
Excavation.excavationProcCheck(block, mcMMOPlayer);
|
||||||
if (ItemChecks.isShovel(heldItem)) {
|
|
||||||
Excavation.excavationProcCheck(block, mcMMOPlayer);
|
|
||||||
|
|
||||||
if (profile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)) {
|
if (profile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)) {
|
||||||
Excavation.gigaDrillBreaker(mcMMOPlayer, block);
|
Excavation.gigaDrillBreaker(mcMMOPlayer, block);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Excavation.excavationProcCheck(block, mcMMOPlayer);
|
|
||||||
|
|
||||||
if (profile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)) {
|
|
||||||
Excavation.gigaDrillBreaker(mcMMOPlayer, block);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,6 +266,10 @@ public class BlockListener implements Listener {
|
|||||||
if (BlockChecks.canActivateAbilities(block)) {
|
if (BlockChecks.canActivateAbilities(block)) {
|
||||||
ItemStack heldItem = player.getItemInHand();
|
ItemStack heldItem = player.getItemInHand();
|
||||||
|
|
||||||
|
if ((ItemChecks.isPickaxe(heldItem) && !profile.getAbilityMode(AbilityType.SUPER_BREAKER)) || (ItemChecks.isShovel(heldItem) && !profile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER))) {
|
||||||
|
SkillTools.removeAbilityBuff(heldItem);
|
||||||
|
}
|
||||||
|
|
||||||
if (profile.getToolPreparationMode(ToolType.HOE) && ItemChecks.isHoe(heldItem) && (BlockChecks.canBeGreenTerra(block) || BlockChecks.canMakeMossy(block)) && player.hasPermission("mcmmo.ability.herbalism.greenterra")) {
|
if (profile.getToolPreparationMode(ToolType.HOE) && ItemChecks.isHoe(heldItem) && (BlockChecks.canBeGreenTerra(block) || BlockChecks.canMakeMossy(block)) && player.hasPermission("mcmmo.ability.herbalism.greenterra")) {
|
||||||
SkillTools.abilityCheck(player, SkillType.HERBALISM);
|
SkillTools.abilityCheck(player, SkillType.HERBALISM);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.inventory.FurnaceBurnEvent;
|
import org.bukkit.event.inventory.FurnaceBurnEvent;
|
||||||
import org.bukkit.event.inventory.FurnaceExtractEvent;
|
import org.bukkit.event.inventory.FurnaceExtractEvent;
|
||||||
import org.bukkit.event.inventory.FurnaceSmeltEvent;
|
import org.bukkit.event.inventory.FurnaceSmeltEvent;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
|
||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
@ -20,7 +19,6 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
||||||
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
||||||
import com.gmail.nossr50.skills.utilities.SkillTools;
|
|
||||||
import com.gmail.nossr50.util.ItemChecks;
|
import com.gmail.nossr50.util.ItemChecks;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
@ -130,10 +128,4 @@ public class InventoryListener implements Listener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
|
||||||
public void onInventoryClickEvent(InventoryClickEvent event) {
|
|
||||||
ItemStack item = event.getCurrentItem();
|
|
||||||
SkillTools.removeAbilityBuff(item); //Remove enchants if they try to move them in an inventory
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -58,28 +58,6 @@ public class PlayerListener implements Listener {
|
|||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle PlayerDeath events where the event is modified.
|
|
||||||
*
|
|
||||||
* @param event The event to modify
|
|
||||||
*/
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
|
||||||
public void onPlayerDeathHigher(PlayerDeathEvent event) {
|
|
||||||
Player player = event.getEntity();
|
|
||||||
|
|
||||||
if (Misc.isNPCPlayer(player)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PlayerProfile playerProfile = Users.getPlayer(player).getProfile();
|
|
||||||
|
|
||||||
if (playerProfile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) || playerProfile.getAbilityMode(AbilityType.SUPER_BREAKER)) {
|
|
||||||
for (ItemStack item : event.getDrops()) {
|
|
||||||
SkillTools.removeAbilityBuff(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monitor PlayerDeath events.
|
* Monitor PlayerDeath events.
|
||||||
*
|
*
|
||||||
@ -245,8 +223,6 @@ public class PlayerListener implements Listener {
|
|||||||
if (plugin.isXPEventEnabled()) {
|
if (plugin.isXPEventEnabled()) {
|
||||||
player.sendMessage(LocaleLoader.getString("XPRate.Event", Config.getInstance().getExperienceGainsGlobalMultiplier()));
|
player.sendMessage(LocaleLoader.getString("XPRate.Event", Config.getInstance().getExperienceGainsGlobalMultiplier()));
|
||||||
}
|
}
|
||||||
|
|
||||||
SkillTools.handleAbilitySpeedDecrease(player); //Remove enchants left over in case of disconnect or server crash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,7 +19,6 @@ import com.gmail.nossr50.util.Misc;
|
|||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
public class Excavation {
|
public class Excavation {
|
||||||
public static boolean requiresTool = Config.getInstance().getExcavationRequiresTool();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to see if treasures were found.
|
* Check to see if treasures were found.
|
||||||
|
@ -24,7 +24,6 @@ public class Mining {
|
|||||||
public static double doubleDropsMaxChance = advancedConfig.getMiningDoubleDropChance();
|
public static double doubleDropsMaxChance = advancedConfig.getMiningDoubleDropChance();
|
||||||
public static boolean doubleDropsDisabled = config.miningDoubleDropsDisabled();
|
public static boolean doubleDropsDisabled = config.miningDoubleDropsDisabled();
|
||||||
|
|
||||||
public static boolean requiresTool = Config.getInstance().getMiningRequiresTool();
|
|
||||||
|
|
||||||
public static final int DIAMOND_TOOL_TIER = 4;
|
public static final int DIAMOND_TOOL_TIER = 4;
|
||||||
public static final int IRON_TOOL_TIER = 3;
|
public static final int IRON_TOOL_TIER = 3;
|
||||||
|
@ -140,7 +140,6 @@ Skills:
|
|||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Excavation:
|
Excavation:
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Requires_Shovel: true
|
|
||||||
Fishing:
|
Fishing:
|
||||||
Drops_Enabled: true
|
Drops_Enabled: true
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
@ -154,7 +153,6 @@ Skills:
|
|||||||
Dirt_To_Grass: true
|
Dirt_To_Grass: true
|
||||||
Mining:
|
Mining:
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Requires_Pickaxe: true
|
|
||||||
Detonator_ID: 259
|
Detonator_ID: 259
|
||||||
Repair:
|
Repair:
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
|
Loading…
Reference in New Issue
Block a user