This commit is contained in:
Anuken 2018-09-03 09:56:14 -04:00
parent 019e22aff2
commit e36667cd08
4 changed files with 10 additions and 7 deletions

View file

@ -73,12 +73,13 @@ public class PowerBlocks extends BlockList implements ContentList{
powerNode = new PowerNode("power-node"){{
shadow = "shadow-round-1";
powerSpeed = 0.5f;
maxNodes = 4;
}};
powerNodeLarge = new PowerNode("power-node-large"){{
size = 2;
powerSpeed = 1f;
powerSpeed = 1.5f;
maxNodes = 6;
laserRange = 7.5f;
shadow = "shadow-round-2";

View file

@ -217,7 +217,7 @@ public class NetClient extends Module{
int totalChunks = Mathf.ceil((float) totalLength / NetServer.maxSnapshotSize);
//reset status when a new snapshot sending begins
if(netClient.currentSnapshotID != snapshotID || netClient.recievedChunks == null){
if(netClient.currentSnapshotID != snapshotID || netClient.recievedChunks == null || netClient.recievedChunks.length != totalChunks){
netClient.currentSnapshotID = snapshotID;
netClient.currentSnapshot = new byte[totalLength];
netClient.recievedChunkCounter = 0;

View file

@ -127,6 +127,10 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
tile.block().handleBulletHit(this, other);
}
public void kill(){
Call.onTileDestroyed(tile);
}
public void damage(float damage){
if(dead) return;

View file

@ -121,8 +121,8 @@ public class NuclearReactor extends PowerGenerator{
entity.heat = Mathf.clamp(entity.heat);
if(entity.heat >= 1f){
entity.damage((int) entity.health);
if(entity.heat >= 0.999f){
entity.kill();
}else{
distributePower(tile);
}
@ -141,9 +141,7 @@ public class NuclearReactor extends PowerGenerator{
Effects.shake(6f, 16f, tile.worldx(), tile.worldy());
Effects.effect(ExplosionFx.nuclearShockwave, tile.worldx(), tile.worldy());
for(int i = 0; i < 6; i++){
Timers.run(Mathf.random(40), () -> {
Effects.effect(BlockFx.nuclearcloud, tile.worldx(), tile.worldy());
});
Timers.run(Mathf.random(40), () -> Effects.effect(BlockFx.nuclearcloud, tile.worldx(), tile.worldy()));
}
Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4);