mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Phased out any usage of World.getTotalWorldTime() in favor of internal tickers. SubTileEntity now has a session and packet safe internal ticker.
This commit is contained in:
1 parent
0a7d5ec220
commit
765e302c7e
23 files changed
+47
-46
No files matched your search
@@ -32,7 +32,6 @@ import vazkii.botania.api.mana.IManaCollector;
|
||||
public class SubTileGenerating extends SubTileEntity {
|
||||
|
||||
private static final String TAG_MANA = "mana";
|
||||
private static final String TAG_TICKS_EXISTED = "ticksExisted";
|
||||
|
||||
private static final String TAG_COLLECTOR_X = "collectorX";
|
||||
private static final String TAG_COLLECTOR_Y = "collectorY";
|
||||
@@ -40,18 +39,12 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
|
||||
protected int mana;
|
||||
|
||||
int ticksExisted = 0;
|
||||
int sizeLastCheck = -1;
|
||||
protected TileEntity linkedCollector = null;
|
||||
public int knownMana = -1;
|
||||
|
||||
ChunkCoordinates cachedCollectorCoordinates = null;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -60,7 +53,7 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
|
||||
if(canGeneratePassively()) {
|
||||
int delay = getDelayBetweenPassiveGeneration();
|
||||
if(delay > 0 && supertile.getWorldObj().getWorldTime() % delay == 0) {
|
||||
if(delay > 0 && ticksExisted % delay == 0) {
|
||||
if(shouldSyncPassiveGeneration())
|
||||
sync();
|
||||
addMana(getValueForPassiveGeneration());
|
||||
|
||||
Reference in new issue
Block a user