mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 00:30:07 +01:00
Adding the option to negate experience earned for Acrobatics or Herbalism while in a minecart to prevent afk leveling.
This commit is contained in:
parent
b8d37cb223
commit
d1f683b8a5
@ -300,6 +300,10 @@ public class Config extends ConfigLoader {
|
||||
return disabled;
|
||||
}
|
||||
|
||||
/* AFK Leveling */
|
||||
public boolean getAcrobaticsAFKDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
|
||||
public boolean getHerbalismAFKDisabled() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
|
||||
|
||||
/* Arcane Forging */
|
||||
public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Arcane_Forging.Downgrades.Enabled", true); }
|
||||
public int getArcaneForgingDowngradeChanceRank1() { return config.getInt("Arcane_Forging.Downgrades.Chance.Rank_1", 75); }
|
||||
|
@ -3,6 +3,7 @@ package com.gmail.nossr50.skills.acrobatics;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
@ -33,6 +34,9 @@ public class AcrobaticsManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if(Config.getInstance().getAcrobaticsAFKDisabled() && player.isInsideVehicle())
|
||||
return;
|
||||
|
||||
RollEventHandler eventHandler = new RollEventHandler(this, event);
|
||||
|
||||
int randomChance = 1000;
|
||||
|
@ -80,6 +80,9 @@ public class Herbalism {
|
||||
* @param plugin mcMMO plugin instance
|
||||
*/
|
||||
public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
final PlayerProfile profile = Users.getProfile(player);
|
||||
final int MAX_BONUS_LEVEL = 1000;
|
||||
|
||||
@ -363,6 +366,9 @@ public class Herbalism {
|
||||
}
|
||||
}
|
||||
|
||||
if(Config.getInstance().getHerbalismAFKDisabled() && player.isInsideVehicle())
|
||||
return;
|
||||
|
||||
Skills.xpProcessing(player, profile, SkillType.HERBALISM, xp);
|
||||
}
|
||||
|
||||
|
@ -133,6 +133,7 @@ Skills:
|
||||
Acrobatics:
|
||||
Enabled_For_PVP: true
|
||||
Enabled_For_PVE: true
|
||||
Prevent_AFK_Leveling: true
|
||||
Level_Cap: 0
|
||||
Archery:
|
||||
Enabled_For_PVP: true
|
||||
@ -149,6 +150,7 @@ Skills:
|
||||
Level_Cap: 0
|
||||
Herbalism:
|
||||
Level_Cap: 0
|
||||
Prevent_AFK_Leveling: true
|
||||
Green_Thumb:
|
||||
Cobble_To_Mossy: true
|
||||
CobbleWall_To_MossyWall: true
|
||||
|
Loading…
Reference in New Issue
Block a user