allow WirelessChargedLocation to be created while the TileEntity is not yet in the world

This commit is contained in:
Matthias Mann committed 2015-04-29 21:06:38 +02:00
1 parent a12fbd184d
commit fad6475dfa
1 file changed
+5 -1
@@ -19,7 +19,11 @@ public class WirelessChargedLocation {
public WirelessChargedLocation(TileEntity te) {
this.te = te;
this.chargers = new ArrayList<IWirelessCharger>();
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() {