@@ -271,7 +271,7 @@ public void tick() {
271
271
if (otherData != data && otherData .plot != null && otherData .plot .safeZone ().contains (player .getBlockPos ())) {
272
272
resetPlayer (player , true );
273
273
player .sendMessage (TextUtil .translatable (TextUtil .WARNING , TextUtil .DANGER , "text.build_rush.do_not_disturb" ));
274
- player .playSound (SoundEvents .BLOCK_NOTE_BLOCK_DIDGERIDOO .value (), 1 , 1 );
274
+ player .playSoundToPlayer (SoundEvents .BLOCK_NOTE_BLOCK_DIDGERIDOO .value (), SoundCategory . PLAYERS , 1 , 1 );
275
275
break ;
276
276
}
277
277
}
@@ -303,18 +303,18 @@ public void tick() {
303
303
}
304
304
if (stateSeconds == 30 || stateSeconds == 15 || stateSeconds == 10 ) {
305
305
TextUtil .sendSubtitle (player , Text .literal (String .valueOf (stateSeconds )).setStyle (Style .EMPTY .withColor (Formatting .YELLOW )), 0 , 30 , 10 );
306
- player .playSound (SoundEvents .BLOCK_NOTE_BLOCK_BELL .value (), 1 , 1.3f );
306
+ player .playSoundToPlayer (SoundEvents .BLOCK_NOTE_BLOCK_BELL .value (), SoundCategory . PLAYERS , 1 , 1.3f );
307
307
}
308
308
if (stateSeconds <= 5 ) {
309
309
TextUtil .sendSubtitle (player , Text .literal (String .valueOf (stateSeconds )).setStyle (Style .EMPTY .withColor (Formatting .RED )), 0 , 20 , 0 );
310
- player .playSound (SoundEvents .BLOCK_NOTE_BLOCK_BELL .value (), 1 , 1.6f );
310
+ player .playSoundToPlayer (SoundEvents .BLOCK_NOTE_BLOCK_BELL .value (), SoundCategory . PLAYERS , 1 , 1.6f );
311
311
}
312
312
} else {
313
313
data .bar .setColor (BossBar .Color .GREEN );
314
314
}
315
315
if (stateSeconds == 0 && (stateMinutes == 1 || stateMinutes == 2 )) {
316
316
TextUtil .sendSubtitle (player , Text .literal (String .valueOf (60 )).setStyle (Style .EMPTY .withColor (Formatting .GREEN )), 0 , 40 , 20 );
317
- player .playSound (SoundEvents .BLOCK_NOTE_BLOCK_BELL .value (), 1 , 1 );
317
+ player .playSoundToPlayer (SoundEvents .BLOCK_NOTE_BLOCK_BELL .value (), SoundCategory . PLAYERS , 1 , 1 );
318
318
}
319
319
}
320
320
data .bar .setPercent (statePercent );
@@ -394,7 +394,7 @@ public void eliminate(PlayerData data) {
394
394
player .sendMessage (TextUtil .translatable (TextUtil .SKULL , TextUtil .DANGER , "text.build_rush.eliminated.self" , player .getName ().getString ()));
395
395
TextUtil .clearSubtitle (player );
396
396
TextUtil .sendTitle (player , TextUtil .translatable (TextUtil .DANGER , "title.build_rush.eliminated" ), 0 , 5 * 20 , 20 );
397
- player .playSound (SoundEvents .ENTITY_BLAZE_DEATH , 1 , 2f );
397
+ player .playSoundToPlayer (SoundEvents .ENTITY_BLAZE_DEATH , SoundCategory . PLAYERS , 1 , 2f );
398
398
}
399
399
this .refreshSidebar ();
400
400
@@ -691,7 +691,7 @@ public void onBlockPlaced(ServerPlayerEntity player) {
691
691
data .score = this .maxScore ;
692
692
//TODO: store and send time
693
693
player .sendMessage (TextUtil .translatable (TextUtil .CHECKMARK , TextUtil .SUCCESS , "text.build_rush.finished" ), false );
694
- player .playSound (SoundEvents .ENTITY_PLAYER_LEVELUP , 1.0f , 1.0f );
694
+ player .playSoundToPlayer (SoundEvents .ENTITY_PLAYER_LEVELUP , SoundCategory . PLAYERS , 1.0f , 1.0f );
695
695
resetPlayer (player , false );
696
696
TextUtil .clearTitle (player );
697
697
}
@@ -926,7 +926,7 @@ public void startElimination() {
926
926
927
927
if (data .score == this .maxScore ) {
928
928
TextUtil .sendSubtitle (player , Text .translatable ("title.build_rush.perfect" ).setStyle (Style .EMPTY .withColor (TextUtil .LEGENDARY ).withBold (true )), 0 , 3 * 20 , 10 );
929
- player .playSound (SoundEvents .ENTITY_PLAYER_LEVELUP , 1.0f , 1.0f );
929
+ player .playSoundToPlayer (SoundEvents .ENTITY_PLAYER_LEVELUP , SoundCategory . PLAYERS , 1.0f , 1.0f );
930
930
} else {
931
931
float scorePercentage = data .score / (float ) this .maxScore ;
932
932
String scoreAsPercent = String .format ("%.2f" , scorePercentage * 100 ).replaceAll ("0*$" , "" ).replaceAll ("[,.]$" , "" );
@@ -935,7 +935,7 @@ public void startElimination() {
935
935
936
936
player .sendMessage (TextUtil .translatable (TextUtil .DASH , TextUtil .NEUTRAL , "text.build_rush.score" , scoreText ), false );
937
937
TextUtil .sendSubtitle (player , scoreText , 0 , 2 * 20 , 5 );
938
- player .playSound (SoundEvents .ENTITY_EXPERIENCE_ORB_PICKUP , 1.0f , 1.0f );
938
+ player .playSoundToPlayer (SoundEvents .ENTITY_EXPERIENCE_ORB_PICKUP , SoundCategory . PLAYERS , 1.0f , 1.0f );
939
939
}
940
940
}
941
941
0 commit comments