mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Fixed custom tools not handling the Ability_Enabled flag properly.
This commit is contained in:
parent
9789143c6d
commit
189f23f407
@ -18,6 +18,7 @@ Version 1.3.10-dev
|
|||||||
= Fixed admin chat being seen by everyone
|
= Fixed admin chat being seen by everyone
|
||||||
= Fixed issue with UTFDataFormatException occurring on occasion when trying to load Chunklets
|
= Fixed issue with UTFDataFormatException occurring on occasion when trying to load Chunklets
|
||||||
= Fixed ArrayIndexOutOfBounds error caused when trying to use /xplock after logging in but before gaining XP
|
= Fixed ArrayIndexOutOfBounds error caused when trying to use /xplock after logging in but before gaining XP
|
||||||
|
= Fixed custom tools not properly respecting the Ability_Enabled flag.
|
||||||
|
|
||||||
Version 1.3.09
|
Version 1.3.09
|
||||||
+ Added compatibility with AntiCheat (Which I highly recommend to prevent cheating)
|
+ Added compatibility with AntiCheat (Which I highly recommend to prevent cheating)
|
||||||
|
@ -207,14 +207,7 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getAbilityMode(AbilityType.TREE_FELLER) && permInstance.treeFeller(player) && ItemChecks.isAxe(inHand)) {
|
if (PP.getAbilityMode(AbilityType.TREE_FELLER) && permInstance.treeFeller(player) && ItemChecks.isAxe(inHand)) {
|
||||||
if (ModChecks.isCustomTool(inHand)) {
|
WoodCutting.treeFeller(event);
|
||||||
if (ModChecks.getToolFromItemStack(inHand).isAbilityEnabled()) {
|
|
||||||
WoodCutting.treeFeller(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
WoodCutting.treeFeller(event);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,29 +302,12 @@ public class BlockListener implements Listener {
|
|||||||
* ABILITY TRIGGER CHECKS
|
* ABILITY TRIGGER CHECKS
|
||||||
*/
|
*/
|
||||||
if (PP.getAbilityMode(AbilityType.GREEN_TERRA) && permInstance.greenTerra(player) && BlockChecks.makeMossy(block)) {
|
if (PP.getAbilityMode(AbilityType.GREEN_TERRA) && permInstance.greenTerra(player) && BlockChecks.makeMossy(block)) {
|
||||||
if (ModChecks.isCustomTool(inHand)) {
|
Herbalism.greenTerra(player, block);
|
||||||
if (ModChecks.getToolFromItemStack(inHand).isAbilityEnabled()) {
|
|
||||||
Herbalism.greenTerra(player, block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Herbalism.greenTerra(player, block);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (PP.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) {
|
else if (PP.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) {
|
||||||
if (configInstance.getExcavationRequiresTool()) {
|
if (configInstance.getExcavationRequiresTool() && ItemChecks.isShovel(inHand)) {
|
||||||
if (ItemChecks.isShovel(inHand)) {
|
event.setInstaBreak(true);
|
||||||
if (ModChecks.isCustomTool(inHand)) {
|
Excavation.gigaDrillBreaker(player, block);
|
||||||
if (ModChecks.getToolFromItemStack(inHand).isAbilityEnabled()) {
|
|
||||||
event.setInstaBreak(true);
|
|
||||||
Excavation.gigaDrillBreaker(player, block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
event.setInstaBreak(true);
|
|
||||||
Excavation.gigaDrillBreaker(player, block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
event.setInstaBreak(true);
|
event.setInstaBreak(true);
|
||||||
@ -351,19 +327,9 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (PP.getAbilityMode(AbilityType.SUPER_BREAKER) && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) {
|
else if (PP.getAbilityMode(AbilityType.SUPER_BREAKER) && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) {
|
||||||
if (configInstance.getMiningRequiresTool()) {
|
if (configInstance.getMiningRequiresTool() && ItemChecks.isPickaxe(inHand)) {
|
||||||
if (ItemChecks.isPickaxe(inHand)) {
|
event.setInstaBreak(true);
|
||||||
if (ModChecks.isCustomTool(inHand)) {
|
Mining.superBreakerBlockCheck(player, block);
|
||||||
if (ModChecks.getToolFromItemStack(inHand).isAbilityEnabled()) {
|
|
||||||
event.setInstaBreak(true);
|
|
||||||
Mining.superBreakerBlockCheck(player, block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
event.setInstaBreak(true);
|
|
||||||
Mining.superBreakerBlockCheck(player, block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
event.setInstaBreak(true);
|
event.setInstaBreak(true);
|
||||||
|
@ -323,12 +323,6 @@ public class Combat {
|
|||||||
* @param type The type of skill being used
|
* @param type The type of skill being used
|
||||||
*/
|
*/
|
||||||
public static void applyAbilityAoE(Player attacker, LivingEntity target, int damage, SkillType type) {
|
public static void applyAbilityAoE(Player attacker, LivingEntity target, int damage, SkillType type) {
|
||||||
ItemStack inHand = attacker.getItemInHand();
|
|
||||||
|
|
||||||
if (ModChecks.isCustomTool(inHand) && !ModChecks.getToolFromItemStack(inHand).isAbilityEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int numberOfTargets = Misc.getTier(attacker.getItemInHand()); //The higher the weapon tier, the more targets you hit
|
int numberOfTargets = Misc.getTier(attacker.getItemInHand()); //The higher the weapon tier, the more targets you hit
|
||||||
int damageAmount = damage;
|
int damageAmount = damage;
|
||||||
|
|
||||||
|
@ -101,6 +101,10 @@ public class Skills {
|
|||||||
ToolType tool = skill.getTool();
|
ToolType tool = skill.getTool();
|
||||||
ItemStack inHand = player.getItemInHand();
|
ItemStack inHand = player.getItemInHand();
|
||||||
|
|
||||||
|
if (ModChecks.isCustomTool(inHand) && !ModChecks.getToolFromItemStack(inHand).isAbilityEnabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if any abilities are active */
|
/* Check if any abilities are active */
|
||||||
if (!PP.getAbilityUse()) {
|
if (!PP.getAbilityUse()) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user