Fixed high-FPS slow water/no block sounds

This commit is contained in:
Anuken
2018-02-28 15:11:35 -05:00
parent b67a4f3c14
commit 7e20b493ea
5 changed files with 9 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
#Autogenerated file. Do not modify. #Autogenerated file. Do not modify.
#Tue Feb 27 20:28:50 EST 2018 #Wed Feb 28 15:00:57 EST 2018
version=release version=release
androidBuildCode=317 androidBuildCode=319
name=Mindustry name=Mindustry
code=3.4 code=3.4
build=29 build=custom build

View File

@@ -166,7 +166,7 @@ public class NetClient extends Module {
}); });
Net.handleClient(PlacePacket.class, (packet) -> { Net.handleClient(PlacePacket.class, (packet) -> {
Placement.placeBlock(packet.x, packet.y, Block.getByID(packet.block), packet.rotation, true, false); Placement.placeBlock(packet.x, packet.y, Block.getByID(packet.block), packet.rotation, true, Timers.get("placeblocksound", 10));
if(packet.playerid == player.id){ if(packet.playerid == player.id){
Tile tile = world.tile(packet.x, packet.y); Tile tile = world.tile(packet.x, packet.y);
@@ -175,7 +175,7 @@ public class NetClient extends Module {
}); });
Net.handleClient(BreakPacket.class, (packet) -> { Net.handleClient(BreakPacket.class, (packet) -> {
Placement.breakBlock(packet.x, packet.y, true, false); Placement.breakBlock(packet.x, packet.y, true, Timers.get("breakblocksound", 10));
}); });
Net.handleClient(EntitySpawnPacket.class, packet -> { Net.handleClient(EntitySpawnPacket.class, packet -> {

View File

@@ -52,6 +52,7 @@ public class ThreadHandler {
} }
public void handleRender(){ public void handleRender(){
if(!enabled) return; if(!enabled) return;
framesSinceUpdate += Timers.delta(); framesSinceUpdate += Timers.delta();

View File

@@ -81,7 +81,7 @@ public class LiquidBlock extends Block implements LiquidAcceptor{
LiquidAcceptor other = (LiquidAcceptor)next.block(); LiquidAcceptor other = (LiquidAcceptor)next.block();
float flow = Math.min(other.getLiquidCapacity(next) - other.getLiquid(next) - 0.001f, float flow = Math.min(other.getLiquidCapacity(next) - other.getLiquid(next) - 0.001f,
Math.min(entity.liquidAmount/flowfactor * Timers.delta(), entity.liquidAmount)); Math.min(entity.liquidAmount/flowfactor * Math.max(Timers.delta(), 1f), entity.liquidAmount));
if(flow <= 0f || entity.liquidAmount < flow) return; if(flow <= 0f || entity.liquidAmount < flow) return;

View File

@@ -94,6 +94,8 @@ public class NuclearReactor extends LiquidPowerGenerator{
} }
} }
entity.heat = Mathf.clamp(entity.heat);
if(entity.heat >= 1f){ if(entity.heat >= 1f){
entity.damage((int)entity.health); entity.damage((int)entity.health);
}else{ }else{