Fixed high-FPS slow water/no block sounds
This commit is contained in:
@@ -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 -> {
|
||||
|
||||
@@ -52,6 +52,7 @@ public class ThreadHandler {
|
||||
}
|
||||
|
||||
public void handleRender(){
|
||||
|
||||
if(!enabled) return;
|
||||
|
||||
framesSinceUpdate += Timers.delta();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user