mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +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;
|
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 */
|
/* Arcane Forging */
|
||||||
public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Arcane_Forging.Downgrades.Enabled", true); }
|
public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Arcane_Forging.Downgrades.Enabled", true); }
|
||||||
public int getArcaneForgingDowngradeChanceRank1() { return config.getInt("Arcane_Forging.Downgrades.Chance.Rank_1", 75); }
|
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.entity.Player;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
@ -33,6 +34,9 @@ public class AcrobaticsManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Config.getInstance().getAcrobaticsAFKDisabled() && player.isInsideVehicle())
|
||||||
|
return;
|
||||||
|
|
||||||
RollEventHandler eventHandler = new RollEventHandler(this, event);
|
RollEventHandler eventHandler = new RollEventHandler(this, event);
|
||||||
|
|
||||||
int randomChance = 1000;
|
int randomChance = 1000;
|
||||||
|
@ -80,6 +80,9 @@ public class Herbalism {
|
|||||||
* @param plugin mcMMO plugin instance
|
* @param plugin mcMMO plugin instance
|
||||||
*/
|
*/
|
||||||
public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
|
public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
|
||||||
|
if(player == null)
|
||||||
|
return;
|
||||||
|
|
||||||
final PlayerProfile profile = Users.getProfile(player);
|
final PlayerProfile profile = Users.getProfile(player);
|
||||||
final int MAX_BONUS_LEVEL = 1000;
|
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);
|
Skills.xpProcessing(player, profile, SkillType.HERBALISM, xp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ Skills:
|
|||||||
Acrobatics:
|
Acrobatics:
|
||||||
Enabled_For_PVP: true
|
Enabled_For_PVP: true
|
||||||
Enabled_For_PVE: true
|
Enabled_For_PVE: true
|
||||||
|
Prevent_AFK_Leveling: true
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Archery:
|
Archery:
|
||||||
Enabled_For_PVP: true
|
Enabled_For_PVP: true
|
||||||
@ -149,6 +150,7 @@ Skills:
|
|||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Herbalism:
|
Herbalism:
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
|
Prevent_AFK_Leveling: true
|
||||||
Green_Thumb:
|
Green_Thumb:
|
||||||
Cobble_To_Mossy: true
|
Cobble_To_Mossy: true
|
||||||
CobbleWall_To_MossyWall: true
|
CobbleWall_To_MossyWall: true
|
||||||
|
Loading…
Reference in New Issue
Block a user