mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-10 09:21:31 +01:00
Check for SHORT_GRASS before using it. #2283
This commit is contained in:
parent
13bd1bb8f3
commit
787424b999
@ -8,6 +8,7 @@ import java.util.Map;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import com.google.common.base.Enums;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonToken;
|
||||
@ -34,7 +35,9 @@ public final class MaterialTypeAdapter extends TypeAdapter<Material>
|
||||
Arrays.stream(Material.values()).forEach(mat -> this.materialMap.put(mat.name(), mat));
|
||||
|
||||
// Put in renamed material values.
|
||||
this.materialMap.put("GRASS", Material.SHORT_GRASS);
|
||||
if (Enums.getIfPresent(Material.class, "SHORT_GRASS").isPresent()) {
|
||||
this.materialMap.put("GRASS", Material.SHORT_GRASS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user