@@ -24,14 +24,17 @@ public static void init() {
2424 .process (event -> {
2525 var sc = (BasicAddonScreen ) Minecraft .getInstance ().screen ;
2626 var blockstate = ((ControllableDrawerTile <?>) sc .getMenu ().getObject ()).getBlockState ();
27- var direction = blockstate .getValue (Drawer .FACING_HORIZONTAL_CUSTOM );
28- if (blockstate .hasProperty (Drawer .FACING_ALL ) && (direction == Direction .UP || direction == Direction .DOWN )) {
29- var subdirection = blockstate .getValue (RotatableBlock .FACING_ALL );
30- System .out .println (subdirection );
31- event .getToolTip ().add (3 , Component .translatable ("drawer_upgrade.functionalstorage.relative_direction" , UpgradeItem .getRelativeDirectionVertical (direction , subdirection , UpgradeItem .getDirection (event .getItemStack ()))).withStyle (ChatFormatting .YELLOW ));
32- } else {
27+ if (blockstate .hasProperty (Drawer .FACING_HORIZONTAL_CUSTOM )) {
28+ var direction = blockstate .getValue (Drawer .FACING_HORIZONTAL_CUSTOM );
29+ if (blockstate .hasProperty (Drawer .FACING_ALL ) && (direction == Direction .UP || direction == Direction .DOWN )) {
30+ var subdirection = blockstate .getValue (RotatableBlock .FACING_ALL );
31+ event .getToolTip ().add (3 , Component .translatable ("drawer_upgrade.functionalstorage.relative_direction" , UpgradeItem .getRelativeDirectionVertical (direction , subdirection , UpgradeItem .getDirection (event .getItemStack ()))).withStyle (ChatFormatting .YELLOW ));
32+ } else {
33+ event .getToolTip ().add (3 , Component .translatable ("drawer_upgrade.functionalstorage.relative_direction" , UpgradeItem .getRelativeDirection (direction , UpgradeItem .getDirection (event .getItemStack ()))).withStyle (ChatFormatting .YELLOW ));
34+ }
35+ } else if (blockstate .hasProperty (Drawer .FACING_HORIZONTAL )) {
36+ var direction = blockstate .getValue (Drawer .FACING_HORIZONTAL );
3337 event .getToolTip ().add (3 , Component .translatable ("drawer_upgrade.functionalstorage.relative_direction" , UpgradeItem .getRelativeDirection (direction , UpgradeItem .getDirection (event .getItemStack ()))).withStyle (ChatFormatting .YELLOW ));
34-
3538 }
3639 }).subscribe ();
3740
0 commit comments