From fad6475dfa84b676fecfb65adf052ae178b44f64 Mon Sep 17 00:00:00 2001 From: Matthias Mann Date: Wed, 29 Apr 2015 21:06:38 +0200 Subject: [PATCH] allow WirelessChargedLocation to be created while the TileEntity is not yet in the world --- .../enderio/machine/wireless/WirelessChargedLocation.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/crazypants/enderio/machine/wireless/WirelessChargedLocation.java b/src/main/java/crazypants/enderio/machine/wireless/WirelessChargedLocation.java index 0f0ff33b..dadc8b7a 100644 --- a/src/main/java/crazypants/enderio/machine/wireless/WirelessChargedLocation.java +++ b/src/main/java/crazypants/enderio/machine/wireless/WirelessChargedLocation.java @@ -19,7 +19,11 @@ public class WirelessChargedLocation { public WirelessChargedLocation(TileEntity te) { this.te = te; this.chargers = new ArrayList(); - updateChargers(); + /* Set lastChangeCount to one less than the current change count so that + the charger list is updated on first use (unless ~4B changes happen in between). + Do this instead directly updating so that WirelessChargedLocation can be used + while the TileEntity is still in construction (or loading). */ + this.lastChangeCount = WirelessChargerController.instance.getChangeCount() - 1; } private void updateChargers() {