Fixed crash with assume abstract BiomeSources
This commit is contained in:
parent
92ff27f2f8
commit
5fd087d8b7
2 changed files with 6 additions and 6 deletions
|
@ -3,17 +3,17 @@ package org.betterx.worlds.together.biomesource;
|
|||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface BiomeSourceFromRegistry {
|
||||
public interface BiomeSourceFromRegistry<T extends BiomeSource> {
|
||||
Registry<Biome> getBiomeRegistry();
|
||||
Set<Holder<Biome>> possibleBiomes();
|
||||
|
||||
default boolean sameRegistryButDifferentBiomes(BiomeSourceFromRegistry other) {
|
||||
default <R extends BiomeSource> boolean sameRegistryButDifferentBiomes(BiomeSourceFromRegistry<R> other) {
|
||||
if (other.getBiomeRegistry() == getBiomeRegistry()) {
|
||||
Set<Holder<Biome>> mySet = this.possibleBiomes();
|
||||
Set<Holder<Biome>> otherSet = other.possibleBiomes();
|
||||
Set<Holder<Biome>> mySet = ((T) this).possibleBiomes();
|
||||
Set<Holder<Biome>> otherSet = ((R) other).possibleBiomes();
|
||||
if (otherSet.size() != mySet.size()) return true;
|
||||
for (Holder<Biome> b : mySet) {
|
||||
if (!otherSet.contains(b))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue