Skip to content

Commit

Permalink
Check for SHORT_GRASS before using it. #2283
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jan 23, 2024
1 parent 13bd1bb commit 787424b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

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;
Expand All @@ -34,7 +35,9 @@ public MaterialTypeAdapter() {
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
Expand Down

0 comments on commit 787424b

Please sign in to comment.