1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-09-28 15:08:47 +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 @@ public class TileCable extends TileGeneric implements IPeripheralTile
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 @@ public class TileWiredModemFull extends TileGeneric implements IPeripheralTile
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 class TileWirelessModem extends TileGeneric implements IPeripheralTile
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.core.terminal.Terminal;
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 class TileMonitor extends TileGeneric implements IPeripheralTile
public void onLoad()
{
super.onLoad();
world.getPendingBlockTicks().scheduleTick( getPos(), getBlockState().getBlock(), 0 );
TickScheduler.schedule( this );
}
@Override