mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 20:52:26 +00:00
Fix NPE making gold casts while they are disabled (#132)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
4604856878
commit
a7e02d584a
1 file changed
+7
-4
@@ -1,5 +1,7 @@
|
||||
package tconstruct.library.crafting;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@@ -32,14 +34,15 @@ public class CastingRecipe {
|
||||
this(replacement, metal, cast, consume, delay, props, false);
|
||||
}
|
||||
|
||||
public boolean matches(FluidStack metal, ItemStack inputCast) {
|
||||
if (castingMetal.isFluidEqual(metal)) {
|
||||
if (cast != null && cast.getItemDamage() == OreDictionary.WILDCARD_VALUE
|
||||
public boolean matches(@Nullable FluidStack metal, @Nullable ItemStack inputCast) {
|
||||
if (metal != null && castingMetal.isFluidEqual(metal)) {
|
||||
if (inputCast != null && cast != null
|
||||
&& cast.getItemDamage() == OreDictionary.WILDCARD_VALUE
|
||||
&& inputCast.getItem() == cast.getItem()) {
|
||||
return true;
|
||||
} else if (!ignoreNBT && ItemStack.areItemStacksEqual(cast, inputCast)) {
|
||||
return true;
|
||||
} else return ignoreNBT && cast != null && inputCast != null && cast.isItemEqual(inputCast);
|
||||
} else return ignoreNBT && inputCast != null && cast != null && cast.isItemEqual(inputCast);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user