src/main/java/net/azagwen/atbyw/client/screen/TintingTableScreen.java
private void update() {
        switch (this.handler.getMode()) {
            case HEX -> {
                this.switchModeButton.setU(242);
                this.switchModeButton.setMessage(new TranslatableText("container.tinting_table_mode.hex"));
            }
            case RGB -> {
                this.switchModeButton.setU(228);
                this.switchModeButton.setMessage(new TranslatableText("container.tinting_table_mode.rgb"));
            }
        }

        if (this.hexField.isVisible()) {
            try {
                this.handler.setColor(Color.decode(this.hexField.getText()).getRGB());
                this.isHexCodeValid = true;
            } catch (NumberFormatException ignored) {
                this.isHexCodeValid = false;
            }
        }
    }
//Updates drawables that needs updating (called at init and in tick)
Updates drawables that needs updating (called at init and in tick)
Updates drawables that needs updating ( called at init and in tick )
private void update() {
        switch (this.handler.getMode()) {
            case HEX -> {
                this.switchModeButton.setU(242);
                this.switchModeButton.setMessage(new TranslatableText("container.tinting_table_mode.hex"));
            }
            case RGB -> {
                this.switchModeButton.setU(228);
                this.switchModeButton.setMessage(new TranslatableText("container.tinting_table_mode.rgb"));
            }
        }
        if (this.hexField.isVisible()) {
            try {
                this.handler.setColor(Color.decode(this.hexField.getText()).getRGB());
                this.isHexCodeValid = true;
            } catch (NumberFormatException ignored) {
                this.isHexCodeValid = false;
            }
        }
    }
private void update ( ) { switch ( this . handler . getMode ( ) ) { case HEX -> { this . switchModeButton . setU ( 242 ) ; this . switchModeButton . setMessage ( new TranslatableText ( "container.tinting_table_mode.hex" ) ) ; } case RGB -> { this . switchModeButton . setU ( 228 ) ; this . switchModeButton . setMessage ( new TranslatableText ( "container.tinting_table_mode.rgb" ) ) ; } } if ( this . hexField . isVisible ( ) ) { try { this . handler . setColor ( Color . decode ( this . hexField . getText ( ) ) . getRGB ( ) ) ; this . isHexCodeValid = true ; } catch ( NumberFormatException ignored ) { this . isHexCodeValid = false ; } } }
Updates drawables that needs updating (called at init and in tick)
Updates drawables that needs updating ( called at init and in tick )