@@ -337,26 +337,20 @@ private void updateControls() {
337337 setLeftLabel (spawnPane , "world.info.player.spawn" );
338338 setRightTextLabel (spawnPane , () -> {
339339
340-
341340 if (playerTag .get ("respawn" ) instanceof CompoundTag respawnTag
342341 && respawnTag .get ("dimension" ) instanceof StringTag dimensionTag
343342 && respawnTag .get ("pos" ) instanceof IntArrayTag intArrayTag
344- && intArrayTag .length () >= 3
345- ) { // Valid after 25w07a
343+ && intArrayTag .length () >= 3 ) { // Valid after 25w07a
346344 return Dimension .of (dimensionTag ).formatPosition (intArrayTag );
347-
348345 } else if (playerTag .get ("SpawnX" ) instanceof IntTag intX
349346 && playerTag .get ("SpawnY" ) instanceof IntTag intY
350347 && playerTag .get ("SpawnZ" ) instanceof IntTag intZ ) { // Valid before 25w07a
351348 Dimension dimension ;
352349 // SpawnDimension tag is valid after 20w12a. Prior to this version, the game did not record the respawn point dimension and respawned in the Overworld.
353- if (playerTag .get ("SpawnDimension" ) instanceof StringTag dimensionTag ) {
354- dimension = Dimension .of (dimensionTag );
355- } else {
356- dimension = Dimension .of (new StringTag ("SpawnDimension" , "minecraft:overworld" ));
357- }
358-
359- return dimension .formatPosition (intX .getValue (), intY .getValue (), intZ .getValue ());
350+ return Dimension .of (playerTag .get ("SpawnDimension" ) instanceof StringTag dimensionTag
351+ ? dimensionTag
352+ : new StringTag ("SpawnDimension" , "minecraft:overworld" ))
353+ .formatPosition (intX .getValue (), intY .getValue (), intZ .getValue ());
360354 }
361355
362356 return "" ;
@@ -426,6 +420,19 @@ private void updateControls() {
426420 }
427421 }
428422
423+ BorderPane foodSaturationPane = new BorderPane ();
424+ {
425+ setLeftLabel (foodSaturationPane , "world.info.player.food_saturation_level" );
426+ JFXTextField foodSaturationField = new JFXTextField ();
427+ setRightTextField (foodSaturationPane , foodSaturationField , 50 );
428+
429+ if (playerTag .get ("foodSaturationLevel" ) instanceof FloatTag foodSaturationTag ) {
430+ bindTagAndTextField (foodSaturationTag , foodSaturationField );
431+ } else {
432+ foodSaturationField .setDisable (true );
433+ }
434+ }
435+
429436 BorderPane xpLevelPane = new BorderPane ();
430437 {
431438 setLeftLabel (xpLevelPane , "world.info.player.xp_level" );
@@ -440,8 +447,8 @@ private void updateControls() {
440447 }
441448
442449 playerInfo .getContent ().setAll (
443- locationPane , lastDeathLocationPane , spawnPane ,
444- playerGameTypePane , healthPane , foodLevelPane , xpLevelPane
450+ locationPane , lastDeathLocationPane , spawnPane , playerGameTypePane ,
451+ healthPane , foodLevelPane , foodSaturationPane , xpLevelPane
445452 );
446453
447454 rootPane .getChildren ().addAll (ComponentList .createComponentListTitle (i18n ("world.info.player" )), playerInfo );
@@ -457,7 +464,7 @@ private void setLeftLabel(BorderPane borderPane, @PropertyKey(resourceBundle = "
457464 private void setRightTextField (BorderPane borderPane , JFXTextField textField , int perfWidth ) {
458465 textField .setDisable (worldManagePage .isReadOnly ());
459466 textField .setPrefWidth (perfWidth );
460- textField .setAlignment (Pos .CENTER_RIGHT );
467+ BorderPane .setAlignment (textField , Pos .CENTER_RIGHT );
461468 borderPane .setRight (textField );
462469 }
463470
0 commit comments