mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-06-29 00:23:23 +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:
parent
8fe2abe0ae
commit
b4aa554279
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user