1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-26 07:03:22 +00:00

Do not fetch the current block within onLoad

The chunk has not been fully loaded when onLoad is called, which means
we try to load it again, and so the server deadlocks.
This commit is contained in:
SquidDev 2019-06-21 20:57:38 +01:00
parent 8fe2abe0ae
commit b4aa554279
4 changed files with 5 additions and 9 deletions

View File

@ -170,11 +170,7 @@ protected void invalidateCaps()
public void onLoad()
{
super.onLoad();
if( !world.isRemote )
{
updateDirection();
world.getPendingBlockTicks().scheduleTick( pos, getBlockState().getBlock(), 0 );
}
TickScheduler.schedule( this );
}
@Override

View File

@ -251,7 +251,7 @@ private void updateBlockState()
public void onLoad()
{
super.onLoad();
if( !world.isRemote ) world.getPendingBlockTicks().scheduleTick( pos, getBlockState().getBlock(), 0 );
TickScheduler.schedule( this );
}
@Override

View File

@ -87,8 +87,7 @@ public TileWirelessModem( TileEntityType<? extends TileWirelessModem> type, bool
public void onLoad()
{
super.onLoad();
updateDirection();
world.getPendingBlockTicks().scheduleTick( getPos(), getBlockState().getBlock(), 0 );
TickScheduler.schedule( this );
}
@Override

View File

@ -14,6 +14,7 @@
import dan200.computercraft.shared.common.ServerTerminal;
import dan200.computercraft.shared.common.TileGeneric;
import dan200.computercraft.shared.util.NamedTileEntityType;
import dan200.computercraft.shared.util.TickScheduler;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
@ -78,7 +79,7 @@ public TileMonitor( TileEntityType<? extends TileMonitor> type, boolean advanced
public void onLoad()
{
super.onLoad();
world.getPendingBlockTicks().scheduleTick( getPos(), getBlockState().getBlock(), 0 );
TickScheduler.schedule( this );
}
@Override