mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-05-08 10:24:12 +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 @@ public class TileCable extends TileGeneric implements IPeripheralTile
|
|||||||
public void onLoad()
|
public void onLoad()
|
||||||
{
|
{
|
||||||
super.onLoad();
|
super.onLoad();
|
||||||
if( !world.isRemote )
|
TickScheduler.schedule( this );
|
||||||
{
|
|
||||||
updateDirection();
|
|
||||||
world.getPendingBlockTicks().scheduleTick( pos, getBlockState().getBlock(), 0 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -251,7 +251,7 @@ public class TileWiredModemFull extends TileGeneric implements IPeripheralTile
|
|||||||
public void onLoad()
|
public void onLoad()
|
||||||
{
|
{
|
||||||
super.onLoad();
|
super.onLoad();
|
||||||
if( !world.isRemote ) world.getPendingBlockTicks().scheduleTick( pos, getBlockState().getBlock(), 0 );
|
TickScheduler.schedule( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,8 +87,7 @@ public class TileWirelessModem extends TileGeneric implements IPeripheralTile
|
|||||||
public void onLoad()
|
public void onLoad()
|
||||||
{
|
{
|
||||||
super.onLoad();
|
super.onLoad();
|
||||||
updateDirection();
|
TickScheduler.schedule( this );
|
||||||
world.getPendingBlockTicks().scheduleTick( getPos(), getBlockState().getBlock(), 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,6 +14,7 @@ import dan200.computercraft.core.terminal.Terminal;
|
|||||||
import dan200.computercraft.shared.common.ServerTerminal;
|
import dan200.computercraft.shared.common.ServerTerminal;
|
||||||
import dan200.computercraft.shared.common.TileGeneric;
|
import dan200.computercraft.shared.common.TileGeneric;
|
||||||
import dan200.computercraft.shared.util.NamedTileEntityType;
|
import dan200.computercraft.shared.util.NamedTileEntityType;
|
||||||
|
import dan200.computercraft.shared.util.TickScheduler;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@ -78,7 +79,7 @@ public class TileMonitor extends TileGeneric implements IPeripheralTile
|
|||||||
public void onLoad()
|
public void onLoad()
|
||||||
{
|
{
|
||||||
super.onLoad();
|
super.onLoad();
|
||||||
world.getPendingBlockTicks().scheduleTick( getPos(), getBlockState().getBlock(), 0 );
|
TickScheduler.schedule( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user