mirror of
https://github.com/Auxilor/EcoArmor.git
synced 2025-12-27 02:49:22 +00:00
Fixed crystal crafting
This commit is contained in:
@@ -140,6 +140,10 @@ public class ArmorUtils {
|
||||
*/
|
||||
@Nullable
|
||||
public static String getCrystalTier(@NotNull final ItemStack itemStack) {
|
||||
if (itemStack == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemMeta meta = itemStack.getItemMeta();
|
||||
|
||||
if (meta == null) {
|
||||
@@ -287,10 +291,10 @@ public class ArmorUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get if item is advanced.
|
||||
* Get the set from a shard.
|
||||
*
|
||||
* @param itemStack The item to check.
|
||||
* @return If advanced.
|
||||
* @return The set, or null if not a shard.
|
||||
*/
|
||||
@Nullable
|
||||
public static ArmorSet getShardSet(@NotNull final ItemStack itemStack) {
|
||||
|
||||
@@ -103,7 +103,12 @@ public class UpgradeCrystal {
|
||||
|
||||
List<String> recipeStrings = EcoArmorConfigs.TIERS.getStrings(tier + ".crystal-recipe");
|
||||
|
||||
RecipePartUtils.registerLookup("ecoarmor:upgrade_crystal_" + tier, s -> new ComplexRecipePart(test -> Objects.equals(tier, ArmorUtils.getCrystalTier(test)), out));
|
||||
RecipePartUtils.registerLookup("ecoarmor:upgrade_crystal_" + tier, s -> new ComplexRecipePart(test -> {
|
||||
if (ArmorUtils.getCrystalTier(test) == null) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(tier, ArmorUtils.getCrystalTier(test));
|
||||
}, out));
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
builder.setRecipePart(i, RecipePartUtils.lookup(recipeStrings.get(i)));
|
||||
|
||||
Reference in New Issue
Block a user