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

@@ -166,7 +166,7 @@ public class NetClient extends Module {
});
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){
Tile tile = world.tile(packet.x, packet.y);
@@ -175,7 +175,7 @@ public class NetClient extends Module {
});
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 -> {

View File

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

View File

@@ -81,7 +81,7 @@ public class LiquidBlock extends Block implements LiquidAcceptor{
LiquidAcceptor other = (LiquidAcceptor)next.block();
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;

View File

@@ -93,6 +93,8 @@ public class NuclearReactor extends LiquidPowerGenerator{
tile.worldy() + Mathf.random(height * tilesize / 2f));
}
}
entity.heat = Mathf.clamp(entity.heat);
if(entity.heat >= 1f){
entity.damage((int)entity.health);