From ccd6ffc0d3354225efd73aa8850f6ea51a952cb7 Mon Sep 17 00:00:00 2001 From: antropod Date: Wed, 27 Dec 2023 02:48:53 +0600 Subject: [PATCH] Fix low power laser converter exploding after being painted and placed back in the world (#383) --- .../tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index e1f69d8c0..ce6c44e1f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -98,7 +98,9 @@ public void saveNBTData(NBTTagCompound nbtTagCompound) { @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent(tag -> this.AMPERES = tag.getLong("AMPERES")); + if (nbtTagCompound != null && nbtTagCompound.hasKey("AMPERES")) { + this.AMPERES = nbtTagCompound.getLong("AMPERES"); + } } @Override