Skip to content

Commit

Permalink
Fix biome tag checks, add test case for cold biome tags. Fixes #52
Browse files Browse the repository at this point in the history
  • Loading branch information
alcatrazEscapee committed Jun 20, 2020
1 parent 0416e49 commit 6f8409c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import net.minecraft.util.JSONUtils;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
Expand All @@ -35,7 +36,7 @@ protected BiomeRule createSingleRule(JsonObject json, String typeName)
{
if ("tag".equals(typeName))
{
final BiomeDictionary.Type type = BiomeDictionary.Type.getType(typeName);
final BiomeDictionary.Type type = BiomeDictionary.Type.getType(JSONUtils.getString(json, "biomes"));
return biome -> BiomeDictionary.getTypes(biome).contains(type);
}
else if ("biome".equals(typeName))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "sphere",
"stone": "minecraft:air",
"ore": "minecraft:black_concrete",
"rarity": 10,
"max_y": 100,
"min_y": 60,
"biomes": {
"type": "tag",
"biomes": "cold"
}
}

0 comments on commit 6f8409c

Please sign in to comment.