Replaced some post calls with cancel-able time calls
This commit is contained in:
@@ -546,7 +546,7 @@ public class Damage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void tileDamage(Team team, int x, int y, float baseRadius, float damage, @Nullable Bullet source){
|
public static void tileDamage(Team team, int x, int y, float baseRadius, float damage, @Nullable Bullet source){
|
||||||
Core.app.post(() -> {
|
Time.run(0f, () -> {
|
||||||
var in = world.build(x, y);
|
var in = world.build(x, y);
|
||||||
//spawned inside a multiblock. this means that damage needs to be dealt directly.
|
//spawned inside a multiblock. this means that damage needs to be dealt directly.
|
||||||
//why? because otherwise the building would absorb everything in one cell, which means much less damage than a nearby explosion.
|
//why? because otherwise the building would absorb everything in one cell, which means much less damage than a nearby explosion.
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
|
|
||||||
if(fragOnHit){
|
if(fragOnHit){
|
||||||
if(delayFrags && fragBullet != null && fragBullet.delayFrags){
|
if(delayFrags && fragBullet != null && fragBullet.delayFrags){
|
||||||
Core.app.post(() -> createFrags(b, x, y));
|
Time.run(0f, () -> createFrags(b, x, y));
|
||||||
}else{
|
}else{
|
||||||
createFrags(b, x, y);
|
createFrags(b, x, y);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class MinimapRenderer{
|
|||||||
if(e.tile.block().solid && e.tile.y > 0){
|
if(e.tile.block().solid && e.tile.y > 0){
|
||||||
Tile tile = world.tile(e.tile.x, e.tile.y - 1);
|
Tile tile = world.tile(e.tile.x, e.tile.y - 1);
|
||||||
if(tile.block() == Blocks.air){
|
if(tile.block() == Blocks.air){
|
||||||
Core.app.post(() -> update(tile));
|
Time.run(0f, () -> update(tile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -624,11 +624,8 @@ public class CoreBlock extends StorageBlock{
|
|||||||
|
|
||||||
if(net.server()){
|
if(net.server()){
|
||||||
//delay so clients don't destroy it afterwards
|
//delay so clients don't destroy it afterwards
|
||||||
Core.app.post(() -> {
|
Time.run(0f, () -> {
|
||||||
//make sure the world hasn't reloaded since
|
tile.setNet(block, lastDamage, 0);
|
||||||
if(world.tile(tile.x, tile.y) == tile){
|
|
||||||
tile.setNet(block, lastDamage, 0);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user