Customizable Block Place Sound (#6043)

This commit is contained in:
Matthew Peng
2021-09-24 18:28:20 -07:00
committed by GitHub
parent dac17aa2b7
commit 50cc340b20
2 changed files with 10 additions and 4 deletions

View File

@@ -58,7 +58,7 @@ public class ConstructBlock extends Block{
block.breakEffect.at(tile.drawx(), tile.drawy(), block.size, block.mapColor);
Events.fire(new BlockBuildEndEvent(tile, builder, team, true, null));
tile.remove();
if(shouldPlay()) block.breakSound.at(tile, calcPitch(false));
if(shouldPlay()) block.breakSound.at(tile, block.breakPitchChange ? calcPitch(false) : 1f);
}
@Remote(called = Loc.server)
@@ -97,7 +97,7 @@ public class ConstructBlock extends Block{
}
Fx.placeBlock.at(tile.drawx(), tile.drawy(), block.size);
if(shouldPlay()) Sounds.place.at(tile, calcPitch(true));
if(shouldPlay()) block.placeSound.at(tile, block.placePitchChange ? calcPitch(true) : 1f);
Events.fire(new BlockBuildEndEvent(tile, builder, team, false, config));
}