mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02: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:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user