diff options
author | miozune <miozune@gmail.com> | 2023-05-05 13:38:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 06:38:10 +0200 |
commit | 506c8bd707bf69662176c684e439e7963f6711a8 (patch) | |
tree | 31927947118576f9e8dfa60cb2f6e9363ec23f1b /src | |
parent | 416fd7087745d0598a3ab22a00d02e48f831fc0a (diff) | |
download | GT5-Unofficial-506c8bd707bf69662176c684e439e7963f6711a8.tar.gz GT5-Unofficial-506c8bd707bf69662176c684e439e7963f6711a8.tar.bz2 GT5-Unofficial-506c8bd707bf69662176c684e439e7963f6711a8.zip |
Fix NPE with Radio Hatch (#317)
* Fix NPE with Radio Hatch
* spotlessApply (#318)
Co-authored-by: GitHub GTNH Actions <>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Former-commit-id: 568f57922469539b06da1444c8c35db4dea25748
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 42772e483e..f709ece0b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -58,6 +58,7 @@ import gregtech.api.interfaces.modularui.IAddGregtechLogo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.ItemData; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -190,8 +191,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem this.colorForGUI = new short[] { 0x37, 0x37, 0x37 }; return; } else { - Materials mat = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; - this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] }; + ItemData itemData = GT_OreDictUnificator.getAssociation(lStack); + if (itemData != null) { + Materials mat = itemData.mMaterial.mMaterial; + this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] }; + } else { + this.colorForGUI = new short[] { 0x37, 0x37, 0x37 }; + } } if (this.lastFail && GT_Utility.areStacksEqual(this.lastUsedItem, lStack, true)) { |