Skip to content

Commit

Permalink
Changed back the biome checking for fish spawns, to how it was done p…
Browse files Browse the repository at this point in the history
…reviously. #185
  • Loading branch information
GirafiStudios committed Dec 30, 2020
1 parent 8ad4b0b commit aa6fd62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
minecraft_version=1.16.4
forge_version=35.1.11
mappings=20201028-1.16.3
mod_version=2.1.9
mod_version=2.1.10
jei_version=7.6.0.58

org.gradle.jvmargs=-Xmx4G
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ public boolean test(ServerWorld world, float x, float y, float z) {
}
}

public static List<Biome> getValidBiomes(CheckType checkType) { //Can't add biome as a parameter, since this is called elsewhere where world is not available
public static List<Biome> getValidBiomes(CheckType checkType) {
return getValidBiomes(checkType.getInclude(), checkType.getExclude(), checkType.isAnd());
}

public static List<Biome> getValidBiomes(List<BiomeDictionary.Type> includeList, List<BiomeDictionary.Type> excludeList, boolean and) { //Can't add biome as a parameter, since this is called elsewhere where world is not available
List<Biome> biomes = Lists.newArrayList();
List<BiomeDictionary.Type> includeList = checkType.getInclude();
List<BiomeDictionary.Type> excludeList = checkType.getExclude();
boolean and = checkType.isAnd();

if (includeList.isEmpty() && !excludeList.isEmpty()) { //Add all BiomeDictionary tags, when only excluding biomes
Set<BiomeDictionary.Type> validTypes = new HashSet<>(BiomeDictionary.Type.getAll());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static List<Biome> getSpawnableBiomes(JsonElement predicate) {
and = predicate.getAsJsonObject().get("and").getAsBoolean();
}

biomes.addAll(BiomeTagPredicate.getValidBiomes(BiomeTagPredicate.CheckType.getOrCreate(includeList, excludeList, and)));
biomes.addAll(BiomeTagPredicate.getValidBiomes(includeList, excludeList, and));
return biomes;
}

Expand Down

0 comments on commit aa6fd62

Please sign in to comment.