mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Added option to disable Herbalism hunger bonuses
This commit is contained in:
parent
b75e7470ae
commit
4e9333e823
@ -43,7 +43,7 @@ public class LoadProperties {
|
||||
diamondArmor, woodenTools, stoneTools, ironTools, goldTools,
|
||||
diamondTools, enderPearl, blazeRod, records, glowstoneDust,
|
||||
fishingDiamonds, aDisplayNames, pDisplayNames, enableSmoothToMossy,
|
||||
enableDirtToGrass, statsTracking, eventCallback;
|
||||
enableDirtToGrass, statsTracking, eventCallback, herbalismHungerBonus;
|
||||
|
||||
public static String MySQLtablePrefix, MySQLuserName,
|
||||
MySQLserverName, MySQLdbName, MySQLdbPass, nWood, nStone,
|
||||
@ -248,6 +248,7 @@ public class LoadProperties {
|
||||
mnetherwart = readInteger("Experience.Herbalism.Nether_Wart", 50);
|
||||
mlilypad = readInteger("Experience.Herbalism.Lily_Pads", 100);
|
||||
mvines = readInteger("Experience.Herbalism.Vines", 10);
|
||||
herbalismHungerBonus = readBoolean("Skills.Herbalism.Hunger_Bonus", true);
|
||||
|
||||
mpine = readInteger("Experience.Woodcutting.Pine", 70);
|
||||
mbirch = readInteger("Experience.Woodcutting.Birch", 80);
|
||||
|
@ -243,40 +243,43 @@ public class mcEntityListener implements Listener
|
||||
@EventHandler (priority = EventPriority.LOW)
|
||||
public void onFoodLevelChange(FoodLevelChangeEvent event)
|
||||
{
|
||||
if(event.getEntity() instanceof Player)
|
||||
if(LoadProperties.herbalismHungerBonus)
|
||||
{
|
||||
Player player = (Player) event.getEntity();
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int currentFoodLevel = player.getFoodLevel();
|
||||
int newFoodLevel = event.getFoodLevel();
|
||||
|
||||
if(newFoodLevel > currentFoodLevel)
|
||||
if(event.getEntity() instanceof Player)
|
||||
{
|
||||
int food = player.getItemInHand().getTypeId();
|
||||
|
||||
if(food == 297 || food == 357 || food == 360 || food == 282)
|
||||
Player player = (Player) event.getEntity();
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int currentFoodLevel = player.getFoodLevel();
|
||||
int newFoodLevel = event.getFoodLevel();
|
||||
|
||||
if(newFoodLevel > currentFoodLevel)
|
||||
{
|
||||
int foodChange = newFoodLevel - currentFoodLevel;
|
||||
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
||||
|
||||
if(herbLevel < 200)
|
||||
foodChange = foodChange + 1;
|
||||
if(herbLevel >= 200 && herbLevel < 400)
|
||||
foodChange = foodChange + 2;
|
||||
if(herbLevel >= 400 && herbLevel < 600)
|
||||
foodChange = foodChange + 3;
|
||||
if(herbLevel >= 600 && herbLevel < 800)
|
||||
foodChange = foodChange + 4;
|
||||
if(herbLevel >= 800 && herbLevel < 1000)
|
||||
foodChange = foodChange + 5;
|
||||
if(herbLevel >= 1000)
|
||||
foodChange = foodChange + 6;
|
||||
|
||||
newFoodLevel = currentFoodLevel + foodChange;
|
||||
if(newFoodLevel > 20)
|
||||
event.setFoodLevel(20);
|
||||
if(newFoodLevel <= 20)
|
||||
event.setFoodLevel(newFoodLevel);
|
||||
int food = player.getItemInHand().getTypeId();
|
||||
|
||||
if(food == 297 || food == 357 || food == 360 || food == 282)
|
||||
{
|
||||
int foodChange = newFoodLevel - currentFoodLevel;
|
||||
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
||||
|
||||
if(herbLevel < 200)
|
||||
foodChange = foodChange + 1;
|
||||
if(herbLevel >= 200 && herbLevel < 400)
|
||||
foodChange = foodChange + 2;
|
||||
if(herbLevel >= 400 && herbLevel < 600)
|
||||
foodChange = foodChange + 3;
|
||||
if(herbLevel >= 600 && herbLevel < 800)
|
||||
foodChange = foodChange + 4;
|
||||
if(herbLevel >= 800 && herbLevel < 1000)
|
||||
foodChange = foodChange + 5;
|
||||
if(herbLevel >= 1000)
|
||||
foodChange = foodChange + 6;
|
||||
|
||||
newFoodLevel = currentFoodLevel + foodChange;
|
||||
if(newFoodLevel > 20)
|
||||
event.setFoodLevel(20);
|
||||
if(newFoodLevel <= 20)
|
||||
event.setFoodLevel(newFoodLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -121,6 +121,7 @@ Skills:
|
||||
Cobble_To_Mossy: true
|
||||
SmoothBrick_To_MossyBrick: true
|
||||
Dirt_To_Grass: true
|
||||
Hunger_Bonus: true
|
||||
Mining:
|
||||
Level_Cap: 0
|
||||
Requires_Pickaxe: true
|
||||
|
Loading…
Reference in New Issue
Block a user