Fix a NPE with getFlowerAndGrassXp()

Fixes #1975
This commit is contained in:
TfT_02 2014-06-23 21:04:45 +02:00
parent 0de1187012
commit 4b20f12eff
2 changed files with 8 additions and 1 deletions

View File

@ -26,6 +26,7 @@ Version 1.5.01-dev
= Fixed bug where SaveTimerTask would produce an IndexOutOfBoundsException
= Fixed bug where Alchemy would not fire BrewEvents
= Fixed bug with setting custom names and lore in treasures config
= Fixed bug which would cause a NullPointerException with getFlowerAndGrassXp()
! Changed player data saving. Save tasks are now asynchronous
! Vanished players no longer get hit by AoE effects
! Changed Alchemy config option 'Prevent_Hopper_Transfer' renamed to 'Prevent_Hopper_Transfer_Ingredients'

View File

@ -3,6 +3,7 @@ package com.gmail.nossr50.config.experience;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.GrassSpecies;
import org.bukkit.Material;
import org.bukkit.TreeSpecies;
import org.bukkit.entity.EntityType;
@ -267,7 +268,12 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
}
else if (type == Material.LONG_GRASS) {
switch (((LongGrass) data).getSpecies()) {
GrassSpecies species = ((LongGrass) data).getSpecies();
if (species == null) {
return 0;
}
switch (species) {
case DEAD:
return config.getInt("Experience.Herbalism.Dead_Bush", 30);