Fixed crash with core capture
This commit is contained in:
@@ -618,15 +618,19 @@ public class CoreBlock extends StorageBlock{
|
|||||||
if(state.rules.coreCapture){
|
if(state.rules.coreCapture){
|
||||||
if(!net.client()){
|
if(!net.client()){
|
||||||
tile.setBlock(block, lastDamage);
|
tile.setBlock(block, lastDamage);
|
||||||
}
|
|
||||||
|
|
||||||
//delay so clients don't destroy it afterwards
|
|
||||||
Core.app.post(() -> tile.setNet(block, lastDamage, 0));
|
|
||||||
|
|
||||||
//building does not exist on client yet
|
|
||||||
if(!net.client()){
|
|
||||||
//core is invincible for several seconds to prevent recapture
|
//core is invincible for several seconds to prevent recapture
|
||||||
((CoreBuild)tile.build).iframes = captureInvicibility;
|
((CoreBuild)tile.build).iframes = captureInvicibility;
|
||||||
|
|
||||||
|
if(net.server()){
|
||||||
|
//delay so clients don't destroy it afterwards
|
||||||
|
Core.app.post(() -> {
|
||||||
|
//make sure the world hasn't reloaded since
|
||||||
|
if(world.tile(tile.x, tile.y) == tile){
|
||||||
|
tile.setNet(block, lastDamage, 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user