fix stone strata fall back variant

This commit is contained in:
Relentless 2023-04-06 15:06:45 +02:00
parent 107e01d5fc
commit 0c0e9a47b2
No known key found for this signature in database
GPG key ID: 50C5FD225130D790
2 changed files with 14 additions and 1 deletions

View file

@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog],
and this project adheres to [Semantic Versioning].
## [0.3.8] - 2023-04-06
### Fixed
- stone strata fallback variant for clean stone
## [0.3.7] - 2023-04-02
Initial 1.19.4 release!

View file

@ -50,7 +50,8 @@ public class StoneStrataHandler {
* Use {@link #isStoneStrataTag(UnifyTag)} to fill this requirement.
*
* @param item The item to get the stone strata from.
* @return The stone strata of the item. Returning empty string means clean-stone strata.
* @return The stone strata of the item. Clean stone strata returns an empty string for later sorting as a
* fallback variant.
*/
public String getStoneStrata(ResourceLocation item) {
String strata = stoneStrataTagMap
@ -64,12 +65,19 @@ public class StoneStrataHandler {
return i == -1 ? null : s.substring(i + 1);
})
.orElse(null);
if (strata != null) {
if (strata.equals("stone")) {
return "";
}
return strata;
}
for (String stone : stoneStrata) {
if (item.getPath().contains(stone + "_")) {
if (stone.equals("stone")) {
return "";
}
return stone;
}
}