-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Methods in TheEndBiomeData
that query the intended type.
#2369
base: 1.19
Are you sure you want to change the base?
Conversation
I am mot sure if the "intended" naming is good. |
We could use |
public static boolean isIntendedForEndMidlands(RegistryKey<Biome> biome){ | ||
return END_MIDLANDS_MAP.containsKey(biome); | ||
} | ||
|
||
/** | ||
* Returns true if the given biome was added as barrens biome in the end, considering the Vanilla end biomes, | ||
* and any biomes added to the End as barrens biome by mods. | ||
*/ | ||
public static boolean isIntendedForEndBarrens(RegistryKey<Biome> biome){ | ||
return END_BARRENS_MAP.containsKey(biome); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be the correct way to do it, the midlands and barrens map has the highland biome as the key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just realized that here quiqueck/BCLib#13
I think it would be better if WeightedPicker stored the entries as sets, etc. @deirn what do you think? |
TheEndBiomeData
that query the intended type.TheEndBiomeData
that query the intended type.
It's still too verbose imo, I'd just named it like the
I'm not really sure how |
Optional<WeightedEntry<T>> getAny(T element){ | ||
return entries.stream().filter(w -> w.entry==element).findAny(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, you might want to look into changing TheEndBiomeData#ADDED_BIOMES
into a Map<RegistryKey<Biome>, RegistryKey<Biome>>
instead, with vanilla biome as its value. Then you can check if the value is equal to the vanilla biome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is much cleaner. I'll include the suggested patch...
I think the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few checkstyle issues, other than that, LGTM.
fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/TheEndBiomes.java
Outdated
Show resolved
Hide resolved
fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/TheEndBiomes.java
Outdated
Show resolved
Hide resolved
fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/TheEndBiomes.java
Outdated
Show resolved
Hide resolved
fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/TheEndBiomes.java
Outdated
Show resolved
Hide resolved
fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/TheEndBiomes.java
Outdated
Show resolved
Hide resolved
@quiqueck The suggestion was to use both a set and a list. Anyway, seems like it was solved. |
…e/v1/TheEndBiomes.java Co-authored-by: deirn <[email protected]>
…e/v1/TheEndBiomes.java Co-authored-by: deirn <[email protected]>
…e/v1/TheEndBiomes.java Co-authored-by: deirn <[email protected]>
…e/v1/TheEndBiomes.java Co-authored-by: deirn <[email protected]>
…e/v1/TheEndBiomes.java Co-authored-by: deirn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could there be a case where a biome replaces multiple end biomes, and does that need to be accounted for?
Looks good otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the review above - as far as I understand one biome can in fact replace multiple biomes.
When implementing a custom BiomeSource for the End, we need to know what the intended placement of an End-biome was. This PR adds Methods to
TheEndBiomeData
that are similar toNetherBiomes.canGenerateInNether
.