9
0
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:
Auxilor
2021-01-20 11:40:16 +00:00
parent 17709b6280
commit a6156de8ff
2 changed files with 12 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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)));