diff --git a/src/main/java/com/gregtechceu/gtceu/api/gui/GuiTextures.java b/src/main/java/com/gregtechceu/gtceu/api/gui/GuiTextures.java deleted file mode 100644 index 2b1e3eecbd2..00000000000 --- a/src/main/java/com/gregtechceu/gtceu/api/gui/GuiTextures.java +++ /dev/null @@ -1,601 +0,0 @@ -package com.gregtechceu.gtceu.api.gui; - -import com.lowdragmc.lowdraglib.gui.texture.ResourceBorderTexture; -import com.lowdragmc.lowdraglib.gui.texture.ResourceTexture; - -@SuppressWarnings("unused") -public class GuiTextures { - - // GREGTECH - public static final ResourceTexture GREGTECH_LOGO = new ResourceTexture( - "gtceu:textures/gui/icon/gregtech_logo.png"); - public static final ResourceTexture GREGTECH_LOGO_XMAS = new ResourceTexture( - "gtceu:textures/gui/icon/gregtech_logo_xmas.png"); - - // HUD - public static final ResourceTexture TOOL_FRONT_FACING_ROTATION = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_front_facing_rotation.png"); - public static final ResourceTexture TOOL_IO_FACING_ROTATION = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_io_facing_rotation.png"); - public static final ResourceTexture TOOL_PAUSE = new ResourceTexture("gtceu:textures/gui/overlay/tool_pause.png"); - public static final ResourceTexture TOOL_START = new ResourceTexture("gtceu:textures/gui/overlay/tool_start.png"); - public static final ResourceTexture TOOL_COVER_SETTINGS = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_cover_settings.png"); - public static final ResourceTexture TOOL_MUTE = new ResourceTexture("gtceu:textures/gui/overlay/tool_mute.png"); - public static final ResourceTexture TOOL_SOUND = new ResourceTexture("gtceu:textures/gui/overlay/tool_sound.png"); - public static final ResourceTexture TOOL_ALLOW_INPUT = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_allow_input.png"); - public static final ResourceTexture TOOL_ATTACH_COVER = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_attach_cover.png"); - public static final ResourceTexture TOOL_REMOVE_COVER = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_remove_cover.png"); - public static final ResourceTexture TOOL_PIPE_BLOCK = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_pipe_block.png"); - public static final ResourceTexture TOOL_PIPE_CONNECT = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_pipe_connect.png"); - public static final ResourceTexture TOOL_WIRE_BLOCK = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_wire_block.png"); - public static final ResourceTexture TOOL_WIRE_CONNECT = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_wire_connect.png"); - public static final ResourceTexture TOOL_AUTO_OUTPUT = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_auto_output.png"); - public static final ResourceTexture TOOL_DISABLE_AUTO_OUTPUT = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_disable_auto_output.png"); - public static final ResourceTexture TOOL_SWITCH_CONVERTER_NATIVE = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_wire_block.png"); // todo switch to tool_switch_converter_native once that - // gets made - public static final ResourceTexture TOOL_SWITCH_CONVERTER_EU = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_wire_connect.png"); // todo switch to tool_switch_converter_eu once that - // gets made - - // BASE TEXTURES - public static final ResourceBorderTexture BACKGROUND = new ResourceBorderTexture( - "gtceu:textures/gui/base/background.png", 16, 16, 4, 4); - public static final ResourceBorderTexture BACKGROUND_INVERSE = new ResourceBorderTexture( - "gtceu:textures/gui/base/background_inverse.png", 16, 16, 4, 4); - public static final SteamTexture BACKGROUND_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/base/background_%s.png"); - public static final ResourceTexture CLIPBOARD_BACKGROUND = new ResourceTexture( - "gtceu:textures/gui/base/clipboard_background.png"); - public static final ResourceTexture CLIPBOARD_PAPER_BACKGROUND = new ResourceTexture( - "gtceu:textures/gui/base/clipboard_paper_background.png"); - public static final ResourceBorderTexture TITLE_BAR_BACKGROUND = new ResourceBorderTexture( - "gtceu:textures/gui/base/title_bar_background.png", 16, 16, 4, 4); - - public static final ResourceTexture DISPLAY = new ResourceTexture("gtceu:textures/gui/base/display.png"); - public static final SteamTexture DISPLAY_STEAM = SteamTexture.fullImage("gtceu:textures/gui/base/display_%s.png"); - public static final ResourceTexture BLANK = new ResourceBorderTexture("gtceu:textures/gui/base/blank.png", 1, 1, 0, - 0); - public static final ResourceTexture BLANK_TRANSPARENT = new ResourceBorderTexture( - "gtceu:textures/gui/base/blank_transparent.png", 1, 1, 0, 0); - public static final ResourceBorderTexture FLUID_SLOT = new ResourceBorderTexture( - "gtceu:textures/gui/base/fluid_slot.png", 18, 18, 1, 1); - public static final ResourceTexture FLUID_TANK_BACKGROUND = new ResourceTexture( - "gtceu:textures/gui/base/fluid_tank_background.png"); - public static final ResourceTexture FLUID_TANK_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/base/fluid_tank_overlay.png"); - public static final ResourceBorderTexture SLOT = new ResourceBorderTexture("gtceu:textures/gui/base/slot.png", 18, - 18, 1, 1); - public static final ResourceBorderTexture SLOT_DARK = new ResourceBorderTexture( - "gtceu:textures/gui/base/slot_dark.png", 18, - 18, 1, 1); - - public static final ResourceTexture SLOT_DARKENED = new ResourceTexture( - "gtceu:textures/gui/base/darkened_slot.png"); - public static final SteamTexture SLOT_STEAM = SteamTexture.fullImage("gtceu:textures/gui/base/slot_%s.png"); - public static final ResourceTexture TOGGLE_BUTTON_BACK = new ResourceTexture( - "gtceu:textures/gui/widget/toggle_button_background.png"); - - public static final ResourceTexture CLOSE_ICON = new ResourceTexture("gtceu:textures/gui/icon/close.png"); - - // FLUID & ITEM OUTPUT BUTTONS - public static final ResourceTexture BLOCKS_INPUT = new ResourceTexture( - "gtceu:textures/gui/widget/button_blocks_input.png"); - public static final ResourceBorderTexture BUTTON = new ResourceBorderTexture("gtceu:textures/gui/widget/button.png", - 32, 32, 2, 2); - public static final ResourceTexture BUTTON_ALLOW_IMPORT_EXPORT = new ResourceTexture( - "gtceu:textures/gui/widget/button_allow_import_export.png"); - public static final ResourceTexture BUTTON_BLACKLIST = new ResourceTexture( - "gtceu:textures/gui/widget/button_blacklist.png"); - public static final ResourceTexture BUTTON_CHUNK_MODE = new ResourceTexture( - "gtceu:textures/gui/widget/button_chunk_mode.png"); - public static final ResourceTexture BUTTON_CLEAR_GRID = new ResourceTexture( - "gtceu:textures/gui/widget/button_clear_grid.png"); - public static final ResourceTexture BUTTON_FILTER_DAMAGE = new ResourceTexture( - "gtceu:textures/gui/widget/button_filter_damage.png"); - public static final ResourceTexture BUTTON_DISTINCT_BUSES = new ResourceTexture( - "gtceu:textures/gui/widget/button_distinct_buses.png"); - public static final ResourceTexture BUTTON_POWER = new ResourceTexture( - "gtceu:textures/gui/widget/button_power.png"); - public static final ResourceTexture BUTTON_BATCH = new ResourceTexture( - "gtceu:textures/gui/widget/button_batch.png"); - public static final ResourceTexture BUTTON_FILTER_NBT = new ResourceTexture( - "gtceu:textures/gui/widget/button_filter_nbt.png"); - public static final ResourceTexture BUTTON_FLUID_OUTPUT = new ResourceTexture( - "gtceu:textures/gui/widget/button_fluid_output_overlay.png"); - public static final ResourceTexture BUTTON_ITEM_OUTPUT = new ResourceTexture( - "gtceu:textures/gui/widget/button_item_output_overlay.png"); - public static final ResourceTexture BUTTON_LOCK = new ResourceTexture("gtceu:textures/gui/widget/button_lock.png"); - public static final ResourceTexture BUTTON_VOID = new ResourceTexture("gtceu:textures/gui/widget/button_void.png"); - public static final ResourceTexture BUTTON_VOID_PARTIAL = new ResourceTexture( - "gtceu:textures/gui/widget/button_void_partial.png"); - public static final ResourceTexture BUTTON_VOID_MULTIBLOCK = new ResourceTexture( - "gtceu:textures/gui/widget/button_void_multiblock.png"); - public static final ResourceTexture BUTTON_LEFT = new ResourceTexture("gtceu:textures/gui/widget/left.png"); - public static final ResourceTexture BUTTON_PUBLIC_PRIVATE = new ResourceTexture( - "gtceu:textures/gui/widget/button_public_private.png"); - public static final ResourceTexture BUTTON_CHECK = new ResourceTexture( - "gtceu:textures/gui/widget/button_check.png"); - public static final ResourceTexture BUTTON_LIST = new ResourceTexture( - "gtceu:textures/gui/widget/button_list.png"); - public static final ResourceTexture BUTTON_RIGHT = new ResourceTexture("gtceu:textures/gui/widget/right.png"); - public static final ResourceTexture BUTTON_SILK_TOUCH_MODE = new ResourceTexture( - "gtceu:textures/gui/widget/button_silk_touch_mode.png"); - public static final ResourceTexture BUTTON_SWITCH_VIEW = new ResourceTexture( - "gtceu:textures/gui/widget/button_switch_view.png"); - public static final ResourceTexture BUTTON_WORKING_ENABLE = new ResourceTexture( - "gtceu:textures/gui/widget/button_working_enable.png"); - public static final ResourceTexture BUTTON_INT_CIRCUIT_PLUS = new ResourceTexture( - "gtceu:textures/gui/widget/button_circuit_plus.png"); - public static final ResourceTexture BUTTON_INT_CIRCUIT_MINUS = new ResourceTexture( - "gtceu:textures/gui/widget/button_circuit_minus.png"); - public static final ResourceTexture CLIPBOARD_BUTTON = new ResourceTexture( - "gtceu:textures/gui/widget/clipboard_button.png"); - public static final ResourceBorderTexture CLIPBOARD_TEXT_BOX = new ResourceBorderTexture( - "gtceu:textures/gui/widget/clipboard_text_box.png", 9, 18, 1, 1); - public static final ResourceTexture DISTRIBUTION_MODE = new ResourceTexture( - "gtceu:textures/gui/widget/button_distribution_mode.png"); - public static final ResourceTexture BUTTON_AUTO_PULL = new ResourceTexture( - "gtceu:textures/gui/widget/button_me_auto_pull.png"); - public static final ResourceTexture LOCK = new ResourceTexture("gtceu:textures/gui/widget/lock.png"); - public static final ResourceTexture LOCK_WHITE = new ResourceTexture("gtceu:textures/gui/widget/lock_white.png"); - public static final ResourceTexture SWITCH = new ResourceTexture("gtceu:textures/gui/widget/switch.png"); - public static final ResourceTexture SWITCH_HORIZONTAL = new ResourceTexture( - "gtceu:textures/gui/widget/switch_horizontal.png"); - public static final ResourceTexture VANILLA_BUTTON = new ResourceBorderTexture( - "ldlib:textures/gui/button_common.png", 198, 18, 1, 1); - - public static final ResourceTexture ENERGY_DETECTOR_COVER_MODE_BUTTON = new ResourceTexture( - "gtceu:textures/gui/widget/button_detector_cover_energy_mode.png"); - public static final ResourceTexture INVERT_REDSTONE_BUTTON = new ResourceTexture( - "gtceu:textures/gui/widget/button_detector_cover_inverted.png"); - - public static final ResourceTexture IO_CONFIG_FLUID_MODES_BUTTON = new ResourceTexture( - "gtceu:textures/gui/icon/io_config/output_config_fluid_modes.png"); - public static final ResourceTexture IO_CONFIG_ITEM_MODES_BUTTON = new ResourceTexture( - "gtceu:textures/gui/icon/io_config/output_config_item_modes.png"); - public static final ResourceTexture IO_CONFIG_COVER_SLOT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/icon/io_config/cover_slot_overlay.png"); - public static final ResourceTexture IO_CONFIG_COVER_SETTINGS = new ResourceTexture( - "gtceu:textures/gui/icon/io_config/cover_settings.png"); - - public static final ResourceTexture PATTERN_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/widget/pattern_overlay.png"); - public static final ResourceTexture REFUND_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/widget/refund_overlay.png"); - // INDICATORS & ICONS - public static final ResourceTexture INDICATOR_NO_ENERGY = new ResourceTexture( - "gtceu:textures/gui/base/indicator_no_energy.png"); - public static final SteamTexture INDICATOR_NO_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/base/indicator_no_steam_%s.png"); - public static final ResourceTexture TANK_ICON = new ResourceTexture("gtceu:textures/gui/base/tank_icon.png"); - - // WIDGET UI RELATED - public static final ResourceTexture SLIDER_BACKGROUND = new ResourceTexture( - "gtceu:textures/gui/widget/slider_background.png"); - public static final ResourceTexture SLIDER_BACKGROUND_VERTICAL = new ResourceTexture( - "gtceu:textures/gui/widget/slider_background_vertical.png"); - public static final ResourceTexture SLIDER_ICON = new ResourceTexture("gtceu:textures/gui/widget/slider.png"); - public static final ResourceTexture MAINTENANCE_BUTTON = new ResourceTexture( - "gtceu:textures/gui/widget/button_maintenance.png"); - public static final ResourceTexture MAINTENANCE_ICON = new ResourceTexture( - "gtceu:textures/block/overlay/machine/overlay_maintenance.png"); - public static final ResourceTexture STORAGE_ICON = new ResourceTexture( - "gtceu:textures/item/storage_cover.png"); - public static final ResourceTexture BUTTON_MINER_MODES = new ResourceTexture( - "gtceu:textures/gui/widget/button_miner_modes.png"); - - // ORE PROCESSING - public static final ResourceTexture OREBY_BASE = new ResourceTexture("gtceu:textures/gui/arrows/oreby-base.png"); - public static final ResourceTexture OREBY_CHEM = new ResourceTexture("gtceu:textures/gui/arrows/oreby-chem.png"); - public static final ResourceTexture OREBY_SEP = new ResourceTexture("gtceu:textures/gui/arrows/oreby-sep.png"); - public static final ResourceTexture OREBY_SIFT = new ResourceTexture("gtceu:textures/gui/arrows/oreby-sift.png"); - public static final ResourceTexture OREBY_SMELT = new ResourceTexture("gtceu:textures/gui/arrows/oreby-smelt.png"); - - // PRIMITIVE - public static final ResourceBorderTexture PRIMITIVE_BACKGROUND = new ResourceBorderTexture( - "gtceu:textures/gui/primitive/primitive_background.png", 176, 166, 3, 3); - public static final ResourceBorderTexture PRIMITIVE_SLOT = new ResourceBorderTexture( - "gtceu:textures/gui/primitive/primitive_slot.png", 18, 18, 1, 1); - public static final ResourceTexture PRIMITIVE_FURNACE_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/primitive/overlay_primitive_furnace.png"); - public static final ResourceTexture PRIMITIVE_DUST_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/primitive/overlay_primitive_dust.png"); - public static final ResourceTexture PRIMITIVE_INGOT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/primitive/overlay_primitive_ingot.png"); - public static final ResourceTexture PRIMITIVE_LARGE_FLUID_TANK = new ResourceTexture( - "gtceu:textures/gui/primitive/primitive_large_fluid_tank.png"); - public static final ResourceTexture PRIMITIVE_LARGE_FLUID_TANK_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/primitive/primitive_large_fluid_tank_overlay.png"); - public static final ResourceTexture PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR = new ResourceTexture( - "gtceu:textures/gui/primitive/progress_bar_primitive_blast_furnace.png"); - - // SLOT OVERLAYS - public static final ResourceTexture ATOMIC_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/atomic_overlay_1.png"); - public static final ResourceTexture ATOMIC_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/atomic_overlay_2.png"); - public static final ResourceTexture ARROW_INPUT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/arrow_input_overlay.png"); - public static final ResourceTexture ARROW_OUTPUT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/arrow_output_overlay.png"); - public static final ResourceTexture BATTERY_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/battery_overlay.png"); - public static final ResourceTexture BEAKER_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/beaker_overlay_1.png"); - public static final ResourceTexture BEAKER_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/beaker_overlay_2.png"); - public static final ResourceTexture BEAKER_OVERLAY_3 = new ResourceTexture( - "gtceu:textures/gui/overlay/beaker_overlay_3.png"); - public static final ResourceTexture BEAKER_OVERLAY_4 = new ResourceTexture( - "gtceu:textures/gui/overlay/beaker_overlay_4.png"); - public static final ResourceTexture BENDER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/bender_overlay.png"); - public static final ResourceTexture BOX_OVERLAY = new ResourceTexture("gtceu:textures/gui/overlay/box_overlay.png"); - public static final ResourceTexture BOXED_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/boxed_overlay.png"); - public static final ResourceTexture BREWER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/brewer_overlay.png"); - public static final ResourceTexture CANNER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/canner_overlay.png"); - public static final ResourceTexture CHARGER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/charger_slot_overlay.png"); - public static final ResourceTexture CANISTER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/canister_overlay.png"); - public static final SteamTexture CANISTER_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/canister_overlay_%s.png"); - public static final ResourceTexture CENTRIFUGE_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/centrifuge_overlay.png"); - public static final ResourceTexture CIRCUIT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/circuit_overlay.png"); - public static final SteamTexture COAL_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/coal_overlay_%s.png"); - public static final ResourceTexture COMPRESSOR_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/compressor_overlay.png"); - public static final SteamTexture COMPRESSOR_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/compressor_overlay_%s.png"); - public static final ResourceTexture CRACKING_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/cracking_overlay_1.png"); - public static final ResourceTexture CRACKING_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/cracking_overlay_2.png"); - public static final ResourceTexture CRUSHED_ORE_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/crushed_ore_overlay.png"); - public static final SteamTexture CRUSHED_ORE_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/crushed_ore_overlay_%s.png"); - public static final ResourceTexture CRYSTAL_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/crystal_overlay.png"); - public static final ResourceTexture CUTTER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/cutter_overlay.png"); - public static final ResourceTexture DARK_CANISTER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/dark_canister_overlay.png"); - public static final ResourceTexture DUST_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/dust_overlay.png"); - public static final SteamTexture DUST_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/dust_overlay_%s.png"); - public static final ResourceTexture EXTRACTOR_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/extractor_overlay.png"); - public static final SteamTexture EXTRACTOR_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/extractor_overlay_%s.png"); - public static final ResourceTexture FILTER_SLOT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/filter_slot_overlay.png"); - public static final ResourceTexture FURNACE_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/furnace_overlay_1.png"); - public static final ResourceTexture FURNACE_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/furnace_overlay_2.png"); - public static final SteamTexture FURNACE_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/furnace_overlay_%s.png"); - public static final ResourceTexture HAMMER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/hammer_overlay.png"); - public static final SteamTexture HAMMER_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/hammer_overlay_%s.png"); - public static final ResourceTexture HEATING_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/heating_overlay_1.png"); - public static final ResourceTexture HEATING_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/heating_overlay_2.png"); - public static final ResourceTexture IMPLOSION_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/implosion_overlay_1.png"); - public static final ResourceTexture IMPLOSION_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/implosion_overlay_2.png"); - public static final ResourceTexture IN_SLOT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/in_slot_overlay.png"); - public static final SteamTexture IN_SLOT_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/in_slot_overlay_%s.png"); - public static final ResourceTexture INGOT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/ingot_overlay.png"); - public static final ResourceTexture INT_CIRCUIT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/int_circuit_overlay.png"); - public static final ResourceTexture LENS_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/lens_overlay.png"); - public static final ResourceTexture LIGHTNING_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/lightning_overlay_1.png"); - public static final ResourceTexture LIGHTNING_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/lightning_overlay_2.png"); - public static final ResourceTexture MOLD_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/mold_overlay.png"); - public static final ResourceTexture MOLECULAR_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/molecular_overlay_1.png"); - public static final ResourceTexture MOLECULAR_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/molecular_overlay_2.png"); - public static final ResourceTexture MOLECULAR_OVERLAY_3 = new ResourceTexture( - "gtceu:textures/gui/overlay/molecular_overlay_3.png"); - public static final ResourceTexture MOLECULAR_OVERLAY_4 = new ResourceTexture( - "gtceu:textures/gui/overlay/molecular_overlay_4.png"); - public static final ResourceTexture OUT_SLOT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/out_slot_overlay.png"); - public static final SteamTexture OUT_SLOT_OVERLAY_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/overlay/out_slot_overlay_%s.png"); - public static final ResourceTexture PAPER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/paper_overlay.png"); - public static final ResourceTexture PRINTED_PAPER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/printed_paper_overlay.png"); - public static final ResourceTexture PIPE_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/pipe_overlay_2.png"); - public static final ResourceTexture PIPE_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/pipe_overlay_1.png"); - public static final ResourceTexture PRESS_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/press_overlay_1.png"); - public static final ResourceTexture PRESS_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/press_overlay_2.png"); - public static final ResourceTexture PRESS_OVERLAY_3 = new ResourceTexture( - "gtceu:textures/gui/overlay/press_overlay_3.png"); - public static final ResourceTexture PRESS_OVERLAY_4 = new ResourceTexture( - "gtceu:textures/gui/overlay/press_overlay_4.png"); - public static final ResourceTexture SAWBLADE_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/sawblade_overlay.png"); - public static final ResourceTexture SOLIDIFIER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/solidifier_overlay.png"); - public static final ResourceTexture STRING_SLOT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/string_slot_overlay.png"); - public static final ResourceTexture TOOL_SLOT_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/tool_slot_overlay.png"); - public static final ResourceTexture TURBINE_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/turbine_overlay.png"); - public static final ResourceTexture VIAL_OVERLAY_1 = new ResourceTexture( - "gtceu:textures/gui/overlay/vial_overlay_1.png"); - public static final ResourceTexture VIAL_OVERLAY_2 = new ResourceTexture( - "gtceu:textures/gui/overlay/vial_overlay_2.png"); - public static final ResourceTexture WIREMILL_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/wiremill_overlay.png"); - public static final ResourceTexture POSITIVE_MATTER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/positive_matter_overlay.png"); - public static final ResourceTexture NEUTRAL_MATTER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/neutral_matter_overlay.png"); - public static final ResourceTexture DATA_ORB_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/data_orb_overlay.png"); - public static final ResourceTexture SCANNER_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/scanner_overlay.png"); - public static final ResourceTexture DUCT_TAPE_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/duct_tape_overlay.png"); - public static final ResourceTexture RESEARCH_STATION_OVERLAY = new ResourceTexture( - "gtceu:textures/gui/overlay/research_station_overlay.png"); - - // PROGRESS BARS - public static final ResourceTexture PROGRESS_BAR_ARC_FURNACE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_arc_furnace.png"); - public static final ResourceTexture PROGRESS_BAR_ARROW = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_arrow.png"); - public static final SteamTexture PROGRESS_BAR_ARROW_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_arrow_%s.png"); - public static final ResourceTexture PROGRESS_BAR_ARROW_MULTIPLE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_arrow_multiple.png"); - public static final ResourceTexture PROGRESS_BAR_ASSEMBLER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_assembler.png"); - - public static final ResourceTexture PROGRESS_BAR_ASSEMBLY_LINE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_assembly_line.png"); - public static final ResourceTexture PROGRESS_BAR_ASSEMBLY_LINE_ARROW = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_assembly_line_arrow.png"); - public static final ResourceTexture PROGRESS_BAR_BATH = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_bath.png"); - public static final ResourceTexture PROGRESS_BAR_BENDING = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_bending.png"); - public static final SteamTexture PROGRESS_BAR_BOILER_EMPTY = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_boiler_empty_%s.png"); - public static final SteamTexture PROGRESS_BAR_BOILER_FUEL = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_boiler_fuel_%s.png"); - public static final ResourceTexture PROGRESS_BAR_BOILER_HEAT = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_boiler_heat.png"); - public static final ResourceTexture PROGRESS_BAR_CANNER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_canner.png"); - public static final ResourceTexture PROGRESS_BAR_CIRCUIT = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_circuit_assembler.png"); - public static final ResourceTexture PROGRESS_BAR_CIRCUIT_ASSEMBLER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_circuit_assembler.png"); - public static final ResourceTexture PROGRESS_BAR_COKE_OVEN = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_coke_oven.png"); - public static final ResourceTexture PROGRESS_BAR_COMPRESS = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_compress.png"); - public static final SteamTexture PROGRESS_BAR_COMPRESS_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_compress_%s.png"); - public static final ResourceTexture PROGRESS_BAR_CRACKING = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_cracking.png"); - public static final ResourceTexture PROGRESS_BAR_CRACKING_INPUT = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_cracking_2.png"); - public static final ResourceTexture PROGRESS_BAR_CRYSTALLIZATION = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_crystallization.png"); - public static final ResourceTexture PROGRESS_BAR_DISTILLATION_TOWER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_distillation_tower.png"); - public static final ResourceTexture PROGRESS_BAR_EXTRACT = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_extract.png"); - public static final SteamTexture PROGRESS_BAR_EXTRACT_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_extract_%s.png"); - public static final ResourceTexture PROGRESS_BAR_EXTRUDER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_extruder.png"); - public static final ResourceTexture PROGRESS_BAR_FUSION = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_fusion.png"); - public static final ResourceTexture PROGRESS_BAR_GAS_COLLECTOR = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_gas_collector.png"); - public static final ResourceTexture PROGRESS_BAR_HAMMER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_hammer.png"); - public static final SteamTexture PROGRESS_BAR_HAMMER_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_hammer_%s.png"); - public static final ResourceTexture PROGRESS_BAR_HAMMER_BASE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_hammer_base.png"); - public static final SteamTexture PROGRESS_BAR_HAMMER_BASE_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_hammer_base_%s.png"); - public static final ResourceTexture PROGRESS_BAR_LATHE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_lathe.png"); - public static final ResourceTexture PROGRESS_BAR_LATHE_BASE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_lathe_base.png"); - public static final ResourceTexture PROGRESS_BAR_MACERATE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_macerate.png"); - public static final SteamTexture PROGRESS_BAR_MACERATE_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_macerate_%s.png"); - public static final ResourceTexture PROGRESS_BAR_MAGNET = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_magnet.png"); - public static final ResourceTexture PROGRESS_BAR_MASS_FAB = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_mass_fab.png"); - public static final ResourceTexture PROGRESS_BAR_MIXER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_mixer.png"); - public static final ResourceTexture PROGRESS_BAR_PACKER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_packer.png"); - public static final ResourceTexture PROGRESS_BAR_RECYCLER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_recycler.png"); - public static final ResourceTexture PROGRESS_BAR_REPLICATOR = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_replicator.png"); - public static final ResourceTexture PROGRESS_BAR_SIFT = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_sift.png"); - public static final ResourceTexture PROGRESS_BAR_SLICE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_slice.png"); - public static final SteamTexture PROGRESS_BAR_SOLAR_STEAM = SteamTexture - .fullImage("gtceu:textures/gui/progress_bar/progress_bar_solar_%s.png"); - public static final ResourceTexture PROGRESS_BAR_UNLOCK = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_unlock.png"); - public static final ResourceTexture PROGRESS_BAR_UNPACKER = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_unpacker.png"); - public static final ResourceTexture PROGRESS_BAR_WIREMILL = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_wiremill.png"); - public static final ResourceTexture PROGRESS_BAR_RESEARCH_STATION_1 = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_research_station_1.png"); - public static final ResourceTexture PROGRESS_BAR_RESEARCH_STATION_2 = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_research_station_2.png"); - public static final ResourceTexture PROGRESS_BAR_RESEARCH_STATION_BASE = new ResourceTexture( - "gtceu:textures/gui/progress_bar/progress_bar_research_station_base.png"); - - // JEI - public static final ResourceTexture INFO_ICON = new ResourceTexture("gtceu:textures/gui/widget/information.png"); - public static final ResourceTexture MULTIBLOCK_CATEGORY = new ResourceTexture( - "gtceu:textures/gui/icon/coke_oven.png"); - - public static final ResourceTexture ARC_FURNACE_RECYCLING_CATEGORY = new ResourceTexture( - "gtceu:textures/gui/icon/category/arc_furnace_recycling.png"); - public static final ResourceTexture MACERATOR_RECYCLING_CATEGORY = new ResourceTexture( - "gtceu:textures/gui/icon/category/macerator_recycling.png"); - public static final ResourceTexture EXTRACTOR_RECYCLING_CATEGORY = new ResourceTexture( - "gtceu:textures/gui/icon/category/extractor_recycling.png"); - - // Covers - public static final ResourceTexture COVER_MACHINE_CONTROLLER = new ResourceTexture( - "gtceu:textures/items/machine_controller_cover.png"); - - // Terminal - public static final ResourceTexture ICON_REMOVE = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/remove_hover.png"); - public static final ResourceTexture ICON_UP = new ResourceTexture("gtceu:textures/gui/terminal/icon/up_hover.png"); - public static final ResourceTexture ICON_DOWN = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/down_hover.png"); - public static final ResourceTexture ICON_RIGHT = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/right_hover.png"); - public static final ResourceTexture ICON_LEFT = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/left_hover.png"); - public static final ResourceTexture ICON_ADD = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/add_hover.png"); - - public static final ResourceTexture ICON_NEW_PAGE = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/system/memory_card_hover.png"); - public static final ResourceTexture ICON_LOAD = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/folder_hover.png"); - public static final ResourceTexture ICON_SAVE = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/system/save_hover.png"); - public static final ResourceTexture ICON_LOCATION = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/guide_hover.png"); - public static final ResourceTexture ICON_VISIBLE = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/appearance_hover.png"); - public static final ResourceTexture ICON_CALCULATOR = new ResourceTexture( - "gtceu:textures/gui/terminal/icon/calculator_hover.png"); - public static final ResourceTexture UI_FRAME_SIDE_UP = new ResourceTexture( - "gtceu:textures/gui/terminal/frame_side_up.png"); - public static final ResourceTexture UI_FRAME_SIDE_DOWN = new ResourceTexture( - "gtceu:textures/gui/terminal/frame_side_down.png"); - - // Texture Areas - public static final ResourceTexture BUTTON_FLUID = new ResourceTexture( - "gtceu:textures/block/cover/cover_interface_fluid_button.png"); - public static final ResourceTexture BUTTON_ITEM = new ResourceTexture( - "gtceu:textures/block/cover/cover_interface_item_button.png"); - public static final ResourceTexture BUTTON_ENERGY = new ResourceTexture( - "gtceu:textures/block/cover/cover_interface_energy_button.png"); - public static final ResourceTexture BUTTON_MACHINE = new ResourceTexture( - "gtceu:textures/block/cover/cover_interface_machine_button.png"); - public static final ResourceTexture BUTTON_INTERFACE = new ResourceTexture( - "gtceu:textures/block/cover/cover_interface_computer_button.png"); - public static final ResourceTexture COVER_INTERFACE_MACHINE_ON_PROXY = new ResourceTexture( - "gtceu:textures/block/cover/cover_interface_machine_on_proxy.png"); - public static final ResourceTexture COVER_INTERFACE_MACHINE_OFF_PROXY = new ResourceTexture( - "gtceu:textures/blocks/cover/cover_interface_machine_off_proxy.png"); - public static final ResourceTexture SCENE = new ResourceTexture("gtceu:textures/gui/widget/scene.png"); - public static final ResourceBorderTexture DISPLAY_FRAME = new ResourceBorderTexture( - "gtceu:textures/gui/base/display_frame.png", 16, 16, 4, 4); - public static final ResourceTexture INSUFFICIENT_INPUT = new ResourceTexture( - "gtceu:textures/gui/base/indicator_no_energy.png"); - public static final ResourceBorderTexture ENERGY_BAR_BACKGROUND = new ResourceBorderTexture( - "gtceu:textures/gui/progress_bar/progress_bar_boiler_empty_steel.png", 10, 54, 1, 1); - public static final ResourceBorderTexture ENERGY_BAR_BASE = new ResourceBorderTexture( - "gtceu:textures/gui/progress_bar/progress_bar_boiler_heat.png", 10, 54, 1, 1); - public static final ResourceTexture LIGHT_ON = new ResourceTexture("gtceu:textures/gui/widget/light_on.png"); - public static final ResourceTexture LIGHT_OFF = new ResourceTexture("gtceu:textures/gui/widget/light_off.png"); - public static final ResourceTexture UP = new ResourceTexture("gtceu:textures/gui/base/up.png"); - public static final ResourceTexture[] TIER = new ResourceTexture[9]; - static { - var offset = 1f / TIER.length; - for (int i = 0; i < TIER.length; i++) { - TIER[i] = new ResourceTexture("gtceu:textures/gui/overlay/tier.png").getSubTexture(0, i * offset, 1, - offset); - } - } - - // Lamp item overlay - public static final ResourceTexture LAMP_NO_BLOOM = new ResourceTexture( - "gtceu:textures/gui/item_overlay/lamp_no_bloom.png"); - public static final ResourceTexture LAMP_NO_LIGHT = new ResourceTexture( - "gtceu:textures/gui/item_overlay/lamp_no_light.png"); - - // ME hatch/bus - public static final ResourceTexture NUMBER_BACKGROUND = new ResourceTexture( - "gtceu:textures/gui/widget/number_background.png"); - public static final ResourceTexture CONFIG_ARROW = new ResourceTexture( - "gtceu:textures/gui/widget/config_arrow.png"); - public static final ResourceTexture CONFIG_ARROW_DARK = new ResourceTexture( - "gtceu:textures/gui/widget/config_arrow_dark.png"); - public static final ResourceTexture SELECT_BOX = new ResourceTexture("gtceu:textures/gui/widget/select_box.png"); - - // HPCA Component icons - public static final ResourceTexture HPCA_COMPONENT_OUTLINE = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/component_outline.png"); - public static final ResourceTexture HPCA_ICON_EMPTY_COMPONENT = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/empty_component.png"); - public static final ResourceTexture HPCA_ICON_ADVANCED_COMPUTATION_COMPONENT = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/advanced_computation_component.png"); - public static final ResourceTexture HPCA_ICON_BRIDGE_COMPONENT = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/bridge_component.png"); - public static final ResourceTexture HPCA_ICON_COMPUTATION_COMPONENT = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/computation_component.png"); - public static final ResourceTexture HPCA_ICON_ACTIVE_COOLER_COMPONENT = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/active_cooler_component.png"); - public static final ResourceTexture HPCA_ICON_HEAT_SINK_COMPONENT = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/heat_sink_component.png"); - public static final ResourceTexture HPCA_ICON_DAMAGED_ADVANCED_COMPUTATION_COMPONENT = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/damaged_advanced_computation_component.png"); - public static final ResourceTexture HPCA_ICON_DAMAGED_COMPUTATION_COMPONENT = new ResourceTexture( - "gtceu:textures/gui/widget/hpca/damaged_computation_component.png"); -} diff --git a/src/main/java/com/gregtechceu/gtceu/api/gui/SteamTexture.java b/src/main/java/com/gregtechceu/gtceu/api/gui/SteamTexture.java deleted file mode 100644 index fa3743bcf94..00000000000 --- a/src/main/java/com/gregtechceu/gtceu/api/gui/SteamTexture.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.gregtechceu.gtceu.api.gui; - -import com.lowdragmc.lowdraglib.gui.texture.ResourceTexture; - -public class SteamTexture { - - private static final String BRONZE = "bronze"; - private static final String STEEL = "steel"; - - private final ResourceTexture bronzeTexture; - private final ResourceTexture steelTexture; - - private SteamTexture(ResourceTexture bronzeTexture, ResourceTexture steelTexture) { - this.bronzeTexture = bronzeTexture; - this.steelTexture = steelTexture; - } - - public static SteamTexture fullImage(String path) { - return new SteamTexture( - new ResourceTexture(String.format(path, BRONZE)), - new ResourceTexture(String.format(path, STEEL))); - } - - public ResourceTexture get(boolean isHighPressure) { - return isHighPressure ? steelTexture : bronzeTexture; - } -} diff --git a/src/main/java/com/gregtechceu/gtceu/api/gui/widget/PatternPreviewWidget.java b/src/main/java/com/gregtechceu/gtceu/api/gui/widget/PatternPreviewWidget.java index 781b2c91f8d..6b70f9337f1 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/gui/widget/PatternPreviewWidget.java +++ b/src/main/java/com/gregtechceu/gtceu/api/gui/widget/PatternPreviewWidget.java @@ -2,7 +2,6 @@ import com.gregtechceu.gtceu.GTCEu; import com.gregtechceu.gtceu.api.block.MetaMachineBlock; -import com.gregtechceu.gtceu.api.gui.GuiTextures; import com.gregtechceu.gtceu.api.machine.MultiblockMachineDefinition; import com.gregtechceu.gtceu.api.machine.multiblock.MultiblockControllerMachine; import com.gregtechceu.gtceu.api.pattern.BlockPattern; @@ -74,8 +73,8 @@ public class PatternPreviewWidget extends WidgetGroup { private final List predicates; private int index; public int layer; - private com.lowdragmc.lowdraglib.gui.widget.SlotWidget[] slotWidgets; - private com.lowdragmc.lowdraglib.gui.widget.SlotWidget[] candidates; + private SlotWidget[] slotWidgets; + private SlotWidget[] candidates; protected PatternPreviewWidget(MultiblockMachineDefinition controllerDefinition) { super(0, 0, 160, 160); @@ -149,7 +148,6 @@ public void renderBlockOverLay(WorldSceneRenderer renderer) { scrollableWidgetGroup = new DraggableScrollableWidgetGroup(3, 132, 154, 22) .setXScrollBarHeight(4) - .setXBarStyle(GuiTextures.SLIDER_BACKGROUND, GuiTextures.BUTTON) .setScrollable(true) .setDraggable(true); scrollableWidgetGroup.setScrollWheelDirection(DraggableScrollableWidgetGroup.ScrollWheelDirection.HORIZONTAL); @@ -242,11 +240,11 @@ public void setPage(int index) { MBPattern pattern = patterns[index]; setupScene(pattern); if (slotWidgets != null) { - for (com.lowdragmc.lowdraglib.gui.widget.SlotWidget slotWidget : slotWidgets) { + for (SlotWidget slotWidget : slotWidgets) { scrollableWidgetGroup.removeWidget(slotWidget); } } - slotWidgets = new com.lowdragmc.lowdraglib.gui.widget.SlotWidget[Math.min(pattern.parts.size(), 18)]; + slotWidgets = new SlotWidget[Math.min(pattern.parts.size(), 18)]; var itemHandler = new CycleItemEntryHandler( pattern.parts.stream().map(l -> (ItemEntryList) new ItemStackList(l)).toList()); @@ -290,7 +288,7 @@ private void onPosSelected(BlockPos pos, Direction facing) { predicates.addAll(predicate.limited); predicates.removeIf(p -> p == null || p.candidates == null); // why it happens? if (candidates != null) { - for (com.lowdragmc.lowdraglib.gui.widget.SlotWidget candidate : candidates) { + for (SlotWidget candidate : candidates) { removeWidget(candidate); } } @@ -303,13 +301,13 @@ private void onPosSelected(BlockPos pos, Direction facing) { predicateTips.add(simplePredicate.getToolTips(predicate)); } } - candidates = new com.lowdragmc.lowdraglib.gui.widget.SlotWidget[candidateStacks.size()]; + candidates = new SlotWidget[candidateStacks.size()]; var itemHandler = new CycleItemEntryHandler( candidateStacks.stream().map(l -> (ItemEntryList) new ItemStackList(l)).toList()); int maxCol = (160 - (((slotWidgets.length - 1) / 9 + 1) * 18) - 35) % 18; for (int i = 0; i < candidateStacks.size(); i++) { int finalI = i; - candidates[i] = new com.lowdragmc.lowdraglib.gui.widget.SlotWidget() + candidates[i] = new SlotWidget() .setIngredientIO(IngredientIO.INPUT) .setBackgroundTexture(new ColorRectTexture(0x4fffffff)) .setOnAddedTooltips((slot, list) -> list.addAll(predicateTips.get(finalI))); diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemUIFactory.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemUIFactory.java deleted file mode 100644 index 33da6b1e1f2..00000000000 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemUIFactory.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.gregtechceu.gtceu.api.item.component; - -import com.lowdragmc.lowdraglib.gui.factory.HeldItemUIFactory; -import com.lowdragmc.lowdraglib.gui.modular.ModularUI; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResultHolder; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; - -public interface IItemUIFactory extends IInteractionItem { - - ModularUI createUI(HeldItemUIFactory.HeldItemHolder holder, Player entityPlayer); - - @Override - default InteractionResultHolder use(Item item, Level level, Player player, InteractionHand usedHand) { - ItemStack heldItem = player.getItemInHand(usedHand); - if (player instanceof ServerPlayer serverPlayer) { - HeldItemUIFactory.INSTANCE.openUI(serverPlayer, usedHand); - } - return InteractionResultHolder.success(heldItem); - } -} diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/mui/MachineUIPanelBuilder.java b/src/main/java/com/gregtechceu/gtceu/api/machine/mui/MachineUIPanelBuilder.java index 4fb2dd0f2ae..46e5e2e58e7 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/mui/MachineUIPanelBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/mui/MachineUIPanelBuilder.java @@ -11,10 +11,12 @@ import com.gregtechceu.gtceu.common.mui.GTGuiTextures; import com.gregtechceu.gtceu.common.mui.GTMuiWidgets; +import brachy.modularui.drawable.ItemDrawable; import brachy.modularui.drawable.UITexture; import brachy.modularui.screen.UISettings; import brachy.modularui.value.sync.PanelSyncManager; import brachy.modularui.widget.ParentWidget; +import brachy.modularui.widgets.ButtonWidget; import brachy.modularui.widgets.layout.Flow; import lombok.Setter; import lombok.experimental.Accessors; @@ -99,6 +101,14 @@ public MachineUIPanel build(PanelSyncManager syncManager, UISettings settings) { } } + for (var cover : machine.getCoverContainer().getCovers()) { + attachLeft.child(new ButtonWidget<>() + .overlay(new ItemDrawable(cover.getAttachItem())) + .onMousePressed((context, button) -> { + return true; + })); + } + return panel; } diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java b/src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java index 722707ac062..e5b181ff6e7 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java @@ -37,6 +37,7 @@ import brachy.modularui.api.drawable.Text; import brachy.modularui.drawable.UITexture; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.factory.PosGuiData; import brachy.modularui.screen.UISettings; import brachy.modularui.value.sync.DoubleSyncValue; @@ -332,10 +333,9 @@ public void buildMainUI(ParentWidget mainWidget, PosGuiData guiData, PanelSyn .size(14, 54)) .child(new ProgressWidget() .texture(progressTexture, - GTGuiTextures.PROGRESS_BAR_BOILER_HEAT, 54) + GTGuiTextures.PROGRESS_BAR_BOILER_HEAT, ProgressDrawable.Direction.UP) .size(14, 54) .value(tempPercentage) - .direction(ProgressWidget.Direction.UP) .tooltipAutoUpdate(true) .tooltipBuilder((r) -> r.addLine(Text .lang("gtceu.fluid.temperature", getCurrentTemperature()))))); diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/gui/GTRecipeTypeUILayout.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/gui/GTRecipeTypeUILayout.java index f15bc22dd5c..7734c3e4757 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/gui/GTRecipeTypeUILayout.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/gui/GTRecipeTypeUILayout.java @@ -350,12 +350,13 @@ public Builder setCapabilityContentBuilder(RecipeCapability cap, CapabilityCo public GTRecipeTypeUILayout build() { var progressWidgetSupplier = this.progressWidgetSupplier; - if (progressWidgetSupplier == null) progressWidgetSupplier = (l, v, m) -> new ProgressWidget() - .value(v) - .name("progressBar") - .texture(progressBar.get(m), progressBar.progressSize()) - .size(progressBar.progressSize()) - .direction(progressBar.fillDirection()); + if (progressWidgetSupplier == null) { + progressWidgetSupplier = (l, v, m) -> new ProgressWidget() + .value(v) + .name("progressBar") + .texture(progressBar.get(m), progressBar.fillDirection()) + .size(progressBar.progressSize()); + } var layout = new GTRecipeTypeUILayout(recipeType, capabilityInfo, recipeUIModifiers, progressWidgetSupplier, customUIBuilder); diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/gui/ProgressBarTextureSet.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/gui/ProgressBarTextureSet.java index 5baf8168699..767922e6f49 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/gui/ProgressBarTextureSet.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/gui/ProgressBarTextureSet.java @@ -3,7 +3,7 @@ import com.gregtechceu.gtceu.api.mui.SteamTextureSet; import brachy.modularui.drawable.UITexture; -import brachy.modularui.widgets.ProgressWidget; +import brachy.modularui.drawable.progress.ProgressDrawable; import lombok.Getter; import lombok.experimental.Accessors; import org.jetbrains.annotations.Nullable; @@ -13,9 +13,9 @@ public class ProgressBarTextureSet extends SteamTextureSet { private final int progressSize; - private final ProgressWidget.Direction fillDirection; + private final ProgressDrawable.Direction fillDirection; - public ProgressBarTextureSet(int progressSize, ProgressWidget.Direction fillDirection, UITexture main, + public ProgressBarTextureSet(int progressSize, ProgressDrawable.Direction fillDirection, UITexture main, @Nullable UITexture bronze, @Nullable UITexture steel) { super(main, bronze, steel); this.progressSize = progressSize; @@ -23,14 +23,14 @@ public ProgressBarTextureSet(int progressSize, ProgressWidget.Direction fillDire } public ProgressBarTextureSet(UITexture main, UITexture bronze, UITexture steel) { - this(20, ProgressWidget.Direction.RIGHT, main, bronze, steel); + this(20, ProgressDrawable.Direction.RIGHT, main, bronze, steel); } public ProgressBarTextureSet(UITexture main) { - this(20, ProgressWidget.Direction.RIGHT, main); + this(20, ProgressDrawable.Direction.RIGHT, main); } - public ProgressBarTextureSet(int progressSize, ProgressWidget.Direction fillDirection, UITexture main) { - this(20, fillDirection, main, null, null); + public ProgressBarTextureSet(int progressSize, ProgressDrawable.Direction fillDirection, UITexture main) { + this(progressSize, fillDirection, main, null, null); } } diff --git a/src/main/java/com/gregtechceu/gtceu/client/renderer/item/ToolChargeBarRenderer.java b/src/main/java/com/gregtechceu/gtceu/client/renderer/item/ToolChargeBarRenderer.java index 5e6074bf9ca..81f535222b6 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/renderer/item/ToolChargeBarRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/client/renderer/item/ToolChargeBarRenderer.java @@ -3,14 +3,14 @@ import com.gregtechceu.gtceu.api.item.IGTTool; import com.gregtechceu.gtceu.api.item.component.IDurabilityBar; import com.gregtechceu.gtceu.api.item.tool.ToolHelper; -import com.gregtechceu.gtceu.client.util.DrawUtil; +import com.gregtechceu.gtceu.core.mixins.client.GuiGraphicsAccessor; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.renderer.RenderType; import net.minecraft.nbt.CompoundTag; import net.minecraft.util.FastColor; import net.minecraft.world.item.ItemStack; +import brachy.modularui.drawable.GuiDraw; import it.unimi.dsi.fastutil.ints.IntIntPair; public final class ToolChargeBarRenderer { @@ -38,9 +38,10 @@ public static void render(GuiGraphics graphics, int level, int xPosition, int yP int x = xPosition + 2; int y = yPosition + 13 - offset; - graphics.fill(RenderType.gui(), x, y, x + 13, y + (shadow ? 2 : 1), 190, colorShadow); - DrawUtil.fillHorizontalGradient(graphics, RenderType.gui(), x, y, x + level, y + 1, left, right, 190); - // graphics.fill(RenderType.guiOverlay(), x + BAR_W, y, x + BAR_W - level, y - 1, colorBG); + + GuiDraw.drawRect(graphics, x, y, 13, shadow ? 2 : 1, colorShadow); + GuiDraw.drawHorizontalGradientRect(graphics, x, y, level, 1, left, right); + ((GuiGraphicsAccessor) graphics).callFlushIfUnmanaged(); } public static void renderBarsTool(GuiGraphics graphics, IGTTool tool, ItemStack stack, int xPosition, diff --git a/src/main/java/com/gregtechceu/gtceu/client/renderer/item/decorator/GTLampItemOverlayRenderer.java b/src/main/java/com/gregtechceu/gtceu/client/renderer/item/decorator/GTLampItemOverlayRenderer.java index 32bf1087249..874759af23e 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/renderer/item/decorator/GTLampItemOverlayRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/client/renderer/item/decorator/GTLampItemOverlayRenderer.java @@ -1,6 +1,6 @@ package com.gregtechceu.gtceu.client.renderer.item.decorator; -import com.gregtechceu.gtceu.api.gui.GuiTextures; +import com.gregtechceu.gtceu.common.mui.GTGuiTextures; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; @@ -9,6 +9,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.IItemDecorator; +import brachy.modularui.drawable.GuiDraw; import com.mojang.blaze3d.systems.RenderSystem; import static com.gregtechceu.gtceu.common.block.LampBlock.isBloomEnabled; @@ -42,11 +43,17 @@ public boolean render(GuiGraphics graphics, Font font, ItemStack stack, int xPos RenderSystem.disableDepthTest(); if (overlayType.noBloom()) { - GuiTextures.LAMP_NO_BLOOM.draw(graphics, 0, 0, xPosition, yPosition, 16, 16); + var texture = GTGuiTextures.LAMP_NO_BLOOM; + GuiDraw.drawTexture(graphics.pose().last().pose(), texture.location, xPosition, yPosition, xPosition + 16, + yPosition + 16, texture.u0, texture.v0, + texture.u1, texture.v1); } if (overlayType.noLight()) { - GuiTextures.LAMP_NO_LIGHT.draw(graphics, 0, 0, xPosition, yPosition, 16, 16); + var texture = GTGuiTextures.LAMP_NO_LIGHT; + GuiDraw.drawTexture(graphics.pose().last().pose(), texture.location, xPosition, yPosition, xPosition + 16, + yPosition + 16, texture.u0, texture.v0, + texture.u1, texture.v1); } RenderSystem.enableDepthTest(); return true; diff --git a/src/main/java/com/gregtechceu/gtceu/client/renderer/item/decorator/GTTankItemFluidPreview.java b/src/main/java/com/gregtechceu/gtceu/client/renderer/item/decorator/GTTankItemFluidPreview.java index ac15b2744fd..0a86d53c38a 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/renderer/item/decorator/GTTankItemFluidPreview.java +++ b/src/main/java/com/gregtechceu/gtceu/client/renderer/item/decorator/GTTankItemFluidPreview.java @@ -3,9 +3,6 @@ import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.utils.GTUtil; -import com.lowdragmc.lowdraglib.gui.util.DrawerHelper; -import com.lowdragmc.lowdraglib.side.fluid.forge.FluidHelperImpl; - import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.ItemStack; @@ -14,6 +11,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandlerItem; +import brachy.modularui.drawable.GuiDraw; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.*; import lombok.Getter; @@ -101,13 +99,13 @@ public boolean render(GuiGraphics guiGraphics, Font font, ItemStack itemStack, i renderedCount < getMaxRenderCount(); index++) { FluidStack fluidInTank = fluidHandler.getFluidInTank(index); if (!fluidInTank.isEmpty()) { - DrawerHelper.drawFluidForGui( + GuiDraw.drawFluidTexture( guiGraphics, - FluidHelperImpl.toFluidStack(fluidInTank), + fluidInTank, x + OFFSET[renderedCount][0], y + OFFSET[renderedCount][1], 8.0F, - 8.0F); + 8.0F, 0); renderedCount++; } } diff --git a/src/main/java/com/gregtechceu/gtceu/client/util/DrawUtil.java b/src/main/java/com/gregtechceu/gtceu/client/util/DrawUtil.java index 03b1958a156..e699f58dd4c 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/util/DrawUtil.java +++ b/src/main/java/com/gregtechceu/gtceu/client/util/DrawUtil.java @@ -1,69 +1,7 @@ package com.gregtechceu.gtceu.client.util; -import com.gregtechceu.gtceu.core.mixins.client.GuiGraphicsAccessor; - -import com.lowdragmc.lowdraglib.utils.ColorUtils; - -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.renderer.RenderType; - -import com.mojang.blaze3d.vertex.VertexConsumer; -import org.joml.Matrix4f; - public class DrawUtil { - /** - * Fills a rectangle with a gradient color from colorFrom to colorTo at the specified z-level using the given render - * type and coordinates as the boundaries. - * - * @param y2 the y-coordinate of the second corner of the rectangle. - * @param x2 the x-coordinate of the second corner of the rectangle. - * @param y1 the y-coordinate of the first corner of the rectangle. - * @param x1 the x-coordinate of the first corner of the rectangle. - * @param renderType the render type to use. - * @param z the z-level of the rectangle. - * @param colorTo the ending color of the gradient. - * @param colorFrom the starting color of the gradient. - */ - public static void fillHorizontalGradient(GuiGraphics graphics, RenderType renderType, int x1, int y1, int x2, - int y2, int colorFrom, int colorTo, int z) { - VertexConsumer vertexconsumer = graphics.bufferSource().getBuffer(renderType); - fillHorizontalGradient(graphics, vertexconsumer, x1, y1, x2, y2, z, colorFrom, colorTo); - ((GuiGraphicsAccessor) graphics).callFlushIfUnmanaged(); - } - - /** - * The core `fillGradient` method. - *

- * Fills a rectangle with a gradient color from colorFrom to colorTo at the specified z-level using the given render - * type and coordinates as the boundaries. - * - * @param consumer the {@linkplain VertexConsumer} object for drawing the vertices on screen. - * @param x1 the x-coordinate of the first corner of the rectangle. - * @param y1 the y-coordinate of the first corner of the rectangle. - * @param x2 the x-coordinate of the second corner of the rectangle. - * @param y2 the y-coordinate of the second corner of the rectangle. - * @param z the z-level of the rectangle. - * @param colorFrom the starting color of the gradient. - * @param colorTo the ending color of the gradient. - */ - private static void fillHorizontalGradient(GuiGraphics graphics, VertexConsumer consumer, int x1, int y1, int x2, - int y2, int z, int colorFrom, int colorTo) { - float a1 = ColorUtils.alpha(colorFrom); - float r1 = ColorUtils.red(colorFrom); - float g1 = ColorUtils.green(colorFrom); - float b1 = ColorUtils.blue(colorFrom); - float a2 = ColorUtils.alpha(colorTo); - float r2 = ColorUtils.red(colorTo); - float g2 = ColorUtils.green(colorTo); - float b2 = ColorUtils.blue(colorTo); - Matrix4f matrix4f = graphics.pose().last().pose(); - consumer.vertex(matrix4f, (float) x1, (float) y1, (float) z).color(r1, g1, b1, a1).endVertex(); - consumer.vertex(matrix4f, (float) x1, (float) y2, (float) z).color(r1, g1, b1, a1).endVertex(); - consumer.vertex(matrix4f, (float) x2, (float) y2, (float) z).color(r2, g2, b2, a2).endVertex(); - consumer.vertex(matrix4f, (float) x2, (float) y1, (float) z).color(r2, g2, b2, a2).endVertex(); - } - /** * Converts an (A)RGB integer color into an array of floats, for use in GL calls * diff --git a/src/main/java/com/gregtechceu/gtceu/client/util/RenderUtil.java b/src/main/java/com/gregtechceu/gtceu/client/util/RenderUtil.java index d75830db7da..434ffc77e93 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/util/RenderUtil.java +++ b/src/main/java/com/gregtechceu/gtceu/client/util/RenderUtil.java @@ -9,8 +9,6 @@ import com.gregtechceu.gtceu.utils.GTUtil; import com.gregtechceu.gtceu.utils.ResearchManager; -import com.lowdragmc.lowdraglib.gui.util.DrawerHelper; - import net.minecraft.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -45,9 +43,9 @@ import net.minecraftforge.client.model.data.ModelData; import net.minecraftforge.fluids.FluidStack; +import brachy.modularui.drawable.GuiDraw; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; +import com.mojang.blaze3d.vertex.*; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.Nullable; import org.joml.Matrix4f; @@ -312,11 +310,7 @@ public static boolean renderResearchItemContent(GuiGraphics graphics, Operation< if (fluids.length != 0) { FluidStack output = fluids[0]; if (!output.isEmpty()) { - var clientExt = IClientFluidTypeExtensions.of(output.getFluid()); - var texture = RenderUtil.FluidTextureType.STILL.map(clientExt, output); - int color = clientExt.getTintColor(output); - - DrawerHelper.drawFluidTexture(graphics, x, y, texture, 0, 0, z, color); + GuiDraw.drawFluidTexture(graphics, output, x, y, 0, 0, z); return true; } } diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java index 4ddda5bc642..1e014089c05 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java @@ -32,6 +32,8 @@ import net.minecraftforge.fml.ModLoader; import brachy.modularui.api.drawable.Text; +import brachy.modularui.drawable.progress.CircularProgressDrawable; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.widgets.ProgressWidget; import brachy.modularui.widgets.layout.Flow; @@ -180,7 +182,14 @@ public class GTRecipeTypes { .setMaxIOSize(1, 6, 1, 1).setEUIO(IO.IN) .prepareBuilder(recipeBuilder -> recipeBuilder.EUt(GTValues.VA[GTValues.LV])) .UI(builder -> builder - .setProgressBar(GTGuiTextures.PROGRESS_MIXER) + .setProgressBarSupplier((l, v, m) -> { + return new CircularProgressDrawable() + .emptyTexture(GTGuiTextures.PROGRESS_BATH[0]) + .filledTexture(GTGuiTextures.PROGRESS_BATH[1]) + .clockwise() + .asWidget() + .value(v); + }) .setItemSlotOverlay(IO.IN, 0, GTGuiTextures.BREWER_OVERLAY) .setItemSlotsOverlay(IO.OUT, 0, 5, GTGuiTextures.DUST_OVERLAY) .setFluidSlotOverlay(IO.IN, 0, GTGuiTextures.CENTRIFUGE_OVERLAY)) @@ -323,10 +332,8 @@ public class GTRecipeTypes { .texture( GTGuiTextures.PROGRESS_HAMMER .get(machine), - 20) - .size(20) - .direction( - ProgressWidget.Direction.DOWN)) + ProgressDrawable.Direction.DOWN) + .size(20)) .child(GTGuiTextures.PROGRESS_HAMMER_BASE .get(machine) .asWidget() @@ -355,15 +362,21 @@ public class GTRecipeTypes { .child(new ProgressWidget() .value(value) .name("progressBar") - .texture(GTGuiTextures.PROGRESS_BAR_LATHE, 20) - .size(20) - .direction(ProgressWidget.Direction.RIGHT)) + .texture(GTGuiTextures.PROGRESS_BAR_LATHE, ProgressDrawable.Direction.RIGHT) + .size(20)) .child(GTGuiTextures.PROGRESS_BAR_LATHE_BASE.asWidget().width(5)))) .setSound(GTSoundEntries.CUT); public final static GTRecipeType MIXER_RECIPES = register("mixer", ELECTRIC).setMaxIOSize(6, 1, 2, 1).setEUIO(IO.IN) .UI(builder -> builder - .setProgressBar(GTGuiTextures.PROGRESS_MIXER) + .setProgressBarSupplier((l, v, m) -> { + return new CircularProgressDrawable() + .emptyTexture(GTGuiTextures.PROGRESS_MIXER[0]) + .filledTexture(GTGuiTextures.PROGRESS_MIXER[1]) + .clockwise() + .asWidget() + .value(v); + }) .setItemSlotsOverlay(IO.IN, 0, 5, GTGuiTextures.DUST_OVERLAY) .setItemSlotOverlay(IO.OUT, 0, GTGuiTextures.DUST_OVERLAY)) .setSound(GTSoundEntries.MIXER); @@ -372,7 +385,14 @@ public class GTRecipeTypes { .setEUIO(IO.IN) .prepareBuilder(recipeBuilder -> recipeBuilder.duration(400).EUt(16)) .UI(builder -> builder - .setProgressBar(GTGuiTextures.PROGRESS_BATH) + .setProgressBarSupplier((l, v, m) -> { + return new CircularProgressDrawable() + .emptyTexture(GTGuiTextures.PROGRESS_BATH[0]) + .filledTexture(GTGuiTextures.PROGRESS_BATH[1]) + .clockwise() + .asWidget() + .value(v); + }) .setItemSlotOverlay(IO.IN, 0, GTGuiTextures.CRUSHED_ORE_OVERLAY) .setItemSlotOverlay(IO.OUT, 0, GTGuiTextures.DUST_OVERLAY)) .setSound(GTSoundEntries.BATH); diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/tool/behavior/BlockRotatingBehavior.java b/src/main/java/com/gregtechceu/gtceu/common/item/tool/behavior/BlockRotatingBehavior.java index 1753106e602..45fbadfddbf 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/tool/behavior/BlockRotatingBehavior.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/tool/behavior/BlockRotatingBehavior.java @@ -7,10 +7,9 @@ import com.gregtechceu.gtceu.common.item.tool.rotation.CustomBlockRotations; import com.gregtechceu.gtceu.common.item.tool.rotation.ICustomRotationBehavior; -import com.lowdragmc.lowdraglib.utils.RayTraceHelper; - import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; +import net.minecraft.util.Mth; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -91,8 +90,26 @@ public void addInformation(@NotNull ItemStack stack, @Nullable Level world, @Not } public static BlockHitResult retraceBlock(BlockGetter level, Player player, BlockPos pos) { - Vec3 startVec = RayTraceHelper.getTraceOrigin(player); - Vec3 endVec = RayTraceHelper.getTraceTarget(player, ToolHelper.getPlayerBlockReach(player), startVec); + double d0 = player.getX(); + double d1 = player.getY() + (double) player.getEyeHeight(); + double d2 = player.getZ(); + + Vec3 startVec = new Vec3(d0, d1, d2); + + // If you want someone to blame for these variables, blame + // https://github.com/Creators-of-Create/Create/blob/mc1.21.1/dev/src/main/java/com/simibubi/create/foundation/utility/RaycastHelper.java + double range = ToolHelper.getPlayerBlockReach(player); + float f = player.getXRot(); + float f1 = player.getYRot(); + float f2 = Mth.cos(-f1 * ((float) Math.PI / 180F) - (float) Math.PI); + float f3 = Mth.sin(-f1 * ((float) Math.PI / 180F) - (float) Math.PI); + float f4 = -Mth.cos(-f * ((float) Math.PI / 180F)); + float f5 = Mth.sin(-f * ((float) Math.PI / 180F)); + float f6 = f3 * f4; + float f7 = f2 * f4; + + Vec3 endVec = startVec.add((double) f6 * range, (double) f5 * range, (double) f7 * range); + BlockState state = level.getBlockState(pos); VoxelShape baseShape = state.getShape(level, pos); BlockHitResult baseTraceResult = baseShape.clip(startVec, endVec, pos); diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java index 6b7f09218a8..5c5f0c3f651 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java @@ -31,6 +31,7 @@ import brachy.modularui.api.drawable.IDrawable; import brachy.modularui.api.drawable.Text; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.factory.PosGuiData; import brachy.modularui.screen.UISettings; import brachy.modularui.value.sync.DoubleSyncValue; @@ -147,8 +148,7 @@ public void buildMainUI(ParentWidget mainWidget, PosGuiData guiData, PanelSyn flow.child(new ProgressWidget() .texture(GTGuiTextures.PROGRESS_BAR_BOILER_EMPTY_STEEL, - GTGuiTextures.PROGRESS_BAR_BOILER_HEAT, 60) - .direction(ProgressWidget.Direction.UP) + GTGuiTextures.PROGRESS_BAR_BOILER_HEAT, ProgressDrawable.Direction.UP) .value(energyPercentage) .marginLeft(5) .size(18, 60) diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/electric/FisherMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/electric/FisherMachine.java index c5173eaaeaa..1e46e31d432 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/electric/FisherMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/electric/FisherMachine.java @@ -38,6 +38,7 @@ import net.minecraft.world.phys.Vec3; import brachy.modularui.drawable.ItemDrawable; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.factory.PosGuiData; import brachy.modularui.screen.UISettings; import brachy.modularui.utils.Alignment; @@ -317,7 +318,7 @@ public void buildMainUI(ParentWidget mainWidget, PosGuiData guiData, PanelSyn .child(new ItemSlot().slot(new ModularSlot(baitHandler, 0)) .background(GTGuiTextures.SLOT, GTGuiTextures.STRING_SLOT_OVERLAY).marginRight(2)) .child(new ProgressWidget() - .texture(GTGuiTextures.PROGRESS_ARROW.main(), 16) + .texture(GTGuiTextures.PROGRESS_ARROW.main(), ProgressDrawable.Direction.RIGHT) .value(progressPercent)) .child(GTMuiMachineUtil.createSlotGroupFromInventory(cache, "output_item_inv", cache.getSize(), 'i', diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CokeOvenMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CokeOvenMachine.java index c7700cb8c84..44d4070ea4e 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CokeOvenMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CokeOvenMachine.java @@ -19,6 +19,7 @@ import net.minecraftforge.fluids.FluidUtil; import brachy.modularui.api.ITheme; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.factory.PosGuiData; import brachy.modularui.screen.UISettings; import brachy.modularui.theme.ThemeAPI; @@ -70,7 +71,7 @@ public void buildMainUI(ParentWidget mainWidget, PosGuiData guiData, PanelSyn .child(new ProgressWidget() .value(progressPercent) .size(20, 15) - .texture(GTGuiTextures.PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR, 18) + .texture(GTGuiTextures.PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR, ProgressDrawable.Direction.RIGHT) .margin(4, 0)) .child(new ItemSlot().syncHandler(new ItemSlotSyncHandler( diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/PrimitiveBlastFurnaceMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/PrimitiveBlastFurnaceMachine.java index 24301ea7dba..01ebe663a37 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/PrimitiveBlastFurnaceMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/PrimitiveBlastFurnaceMachine.java @@ -30,6 +30,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; import brachy.modularui.api.ITheme; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.factory.PosGuiData; import brachy.modularui.screen.UISettings; import brachy.modularui.theme.ThemeAPI; @@ -158,7 +159,7 @@ public void buildMainUI(ParentWidget mainWidget, PosGuiData guiData, PanelSyn .child(new ProgressWidget() .value(progressPercent) .size(20, 15) - .texture(GTGuiTextures.PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR, 0) + .texture(GTGuiTextures.PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR, ProgressDrawable.Direction.RIGHT) .margin(5, 5, 0, 0)) .child(createExportItemSlot(syncManager, theme)); diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamLiquidBoilerMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamLiquidBoilerMachine.java index b47eb32a336..63fbae3a930 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamLiquidBoilerMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamLiquidBoilerMachine.java @@ -19,6 +19,7 @@ import net.minecraftforge.fluids.FluidUtil; import brachy.modularui.drawable.UITexture; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.factory.PosGuiData; import brachy.modularui.screen.UISettings; import brachy.modularui.utils.Alignment; @@ -94,9 +95,8 @@ public void buildMainUI(ParentWidget mainWidget, PosGuiData guiData, PanelSyn .crossAxisAlignment(Alignment.CrossAxis.CENTER) .child(new ProgressWidget() .size(18) - .texture(progressTexture, 18) + .texture(progressTexture, ProgressDrawable.Direction.UP) .value(progressPercent) - .direction(ProgressWidget.Direction.UP) .setEnabledIf((w) -> progressPercent.getFloatValue() > -1f)) .child(new FluidSlot() .syncHandler(new FluidSlotSyncHandler(fuelTank.getStorages()[0]) diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamSolarBoiler.java b/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamSolarBoiler.java index 1149d7b5368..3583382d420 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamSolarBoiler.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamSolarBoiler.java @@ -12,6 +12,7 @@ import net.minecraft.util.RandomSource; import brachy.modularui.drawable.UITexture; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.factory.PosGuiData; import brachy.modularui.screen.UISettings; import brachy.modularui.value.sync.DoubleSyncValue; @@ -85,7 +86,7 @@ public void buildMainUI(ParentWidget mainWidget, PosGuiData guiData, PanelSyn mainWidget.child(new ProgressWidget() .size(18) - .texture(progressTexture, 20) + .texture(progressTexture, ProgressDrawable.Direction.UP) .value(canSeeSun)); } diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamSolidBoilerMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamSolidBoilerMachine.java index 5894bf8ff96..b7ea4f2f473 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamSolidBoilerMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/steam/SteamSolidBoilerMachine.java @@ -19,6 +19,7 @@ import net.minecraftforge.fluids.FluidUtil; import brachy.modularui.drawable.UITexture; +import brachy.modularui.drawable.progress.ProgressDrawable; import brachy.modularui.factory.PosGuiData; import brachy.modularui.screen.UISettings; import brachy.modularui.value.sync.DoubleSyncValue; @@ -139,9 +140,8 @@ public void buildMainUI(ParentWidget mainWidget, PosGuiData guiData, PanelSyn .slot(new ModularSlot(this.fuelHandler, 0))) .child(new ProgressWidget() .size(18) - .texture(progressTexture, 18) - .value(progressPercent) - .direction(ProgressWidget.Direction.UP)) + .texture(progressTexture, ProgressDrawable.Direction.UP) + .value(progressPercent)) .child(new ItemSlot() .slot(new ModularSlot(this.ashHandler, 0)))); } diff --git a/src/main/java/com/gregtechceu/gtceu/common/mui/GTGuiTextures.java b/src/main/java/com/gregtechceu/gtceu/common/mui/GTGuiTextures.java index fe3fc3b8988..9b1000b02fa 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/mui/GTGuiTextures.java +++ b/src/main/java/com/gregtechceu/gtceu/common/mui/GTGuiTextures.java @@ -11,7 +11,7 @@ import brachy.modularui.drawable.ColorType; import brachy.modularui.drawable.TabTexture; import brachy.modularui.drawable.UITexture; -import brachy.modularui.widgets.ProgressWidget; +import brachy.modularui.drawable.progress.ProgressDrawable; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; @@ -151,6 +151,8 @@ interface IDs { .name(IDs.STEEL_SLOT) .build(); + UITexture SLOT_DARK = fullImage("textures/gui/base/slot_dark.png"); + // todo move to textures/gui/base UITexture SLOT_PRIMITIVE = new UITexture.Builder() .location(GTCEu.MOD_ID, "textures/gui/primitive/primitive_slot.png") @@ -475,8 +477,8 @@ interface IDs { ProgressBarTextureSet PROGRESS_ASSEMBLER = new ProgressBarTextureSet( progressBar("textures/gui/progress_bar/progress_bar_assembler.png", ColorType.DEFAULT)); - ProgressBarTextureSet PROGRESS_BATH = new ProgressBarTextureSet(20, ProgressWidget.Direction.CIRCULAR_CW, - progressBar("textures/gui/progress_bar/progress_bar_bath.png", ColorType.DEFAULT)); + UITexture[] PROGRESS_BATH = slice("textures/gui/progress_bar/progress_bar_bath.png", + 20, 40, 20, 20, ColorType.DEFAULT); ProgressBarTextureSet PROGRESS_BENDING = new ProgressBarTextureSet( progressBar("textures/gui/progress_bar/progress_bar_bending.png", ColorType.DEFAULT)); @@ -512,7 +514,7 @@ interface IDs { ProgressBarTextureSet PROGRESS_GAS_COLLECTOR = new ProgressBarTextureSet( progressBar("textures/gui/progress_bar/progress_bar_gas_collector.png", ColorType.DEFAULT)); - ProgressBarTextureSet PROGRESS_HAMMER = new ProgressBarTextureSet(20, ProgressWidget.Direction.DOWN, + ProgressBarTextureSet PROGRESS_HAMMER = new ProgressBarTextureSet(20, ProgressDrawable.Direction.DOWN, progressBar("textures/gui/progress_bar/progress_bar_hammer.png", ColorType.DEFAULT), progressBar("textures/gui/progress_bar/progress_bar_hammer_bronze.png"), progressBar("textures/gui/progress_bar/progress_bar_hammer_steel.png")); @@ -522,7 +524,7 @@ interface IDs { fullImage("textures/gui/progress_bar/progress_bar_hammer_base_bronze.png"), fullImage("textures/gui/progress_bar/progress_bar_hammer_base_steel.png")); - ProgressBarTextureSet PROGRESS_MACERATE = new ProgressBarTextureSet(20, ProgressWidget.Direction.RIGHT, + ProgressBarTextureSet PROGRESS_MACERATE = new ProgressBarTextureSet(20, ProgressDrawable.Direction.RIGHT, progressBar("textures/gui/progress_bar/progress_bar_macerate.png", ColorType.DEFAULT), progressBar("textures/gui/progress_bar/progress_bar_macerate_bronze.png"), progressBar("textures/gui/progress_bar/progress_bar_macerate_steel.png")); @@ -530,10 +532,10 @@ interface IDs { ProgressBarTextureSet PROGRESS_MAGNET = new ProgressBarTextureSet( progressBar("textures/gui/progress_bar/progress_bar_magnet.png", ColorType.DEFAULT)); - ProgressBarTextureSet PROGRESS_MIXER = new ProgressBarTextureSet(20, ProgressWidget.Direction.CIRCULAR_CW, - progressBar("textures/gui/progress_bar/progress_bar_mixer.png", ColorType.DEFAULT)); + UITexture[] PROGRESS_MIXER = slice("textures/gui/progress_bar/progress_bar_mixer.png", + 20, 40, 20, 20, ColorType.DEFAULT); - ProgressBarTextureSet PROGRESS_SIFTER = new ProgressBarTextureSet(20, ProgressWidget.Direction.DOWN, + ProgressBarTextureSet PROGRESS_SIFTER = new ProgressBarTextureSet(20, ProgressDrawable.Direction.DOWN, progressBar("textures/gui/progress_bar/progress_bar_sift.png", ColorType.DEFAULT)); ProgressBarTextureSet PROGRESS_CUTTER = new ProgressBarTextureSet( @@ -590,7 +592,7 @@ interface IDs { UITexture PROGRESS_BAR_BOILER_FUEL_STEEL = progressBar( "textures/gui/progress_bar/progress_bar_boiler_fuel_steel.png", 18, 36); - ProgressBarTextureSet PROGRESS_BOILER_FUEL_STEEL = new ProgressBarTextureSet(18, ProgressWidget.Direction.UP, + ProgressBarTextureSet PROGRESS_BOILER_FUEL_STEEL = new ProgressBarTextureSet(18, ProgressDrawable.Direction.UP, PROGRESS_BAR_BOILER_FUEL_STEEL); UITexture PROGRESS_BAR_CRACKING_INPUT = progressBar("textures/gui/progress_bar/progress_bar_cracking_2.png", 21, 38, @@ -659,6 +661,9 @@ interface IDs { .adaptable(2) .build(); + UITexture CONFIG_ARROW = fullImage("textures/gui/widget/config_arrow.png"); + UITexture CONFIG_ARROW_DARK = fullImage("textures/gui/widget/config_arrow_dark.png"); + // HPCA UITexture HPCA_COMPUTATION_COMPONENT = fullImage( "textures/gui/widget/hpca/computation_component.png"); @@ -720,6 +725,12 @@ interface IDs { UITexture OREBY_SIFT = fullImage("textures/gui/arrows/oreby-sift.png"); UITexture OREBY_SMELT = fullImage("textures/gui/arrows/oreby-smelt.png"); + // Lamp item overlay + UITexture LAMP_NO_BLOOM = fullImage( + "textures/gui/item_overlay/lamp_no_bloom.png"); + UITexture LAMP_NO_LIGHT = fullImage( + "textures/gui/item_overlay/lamp_no_light.png"); + // MISC static void init() {/**/} diff --git a/src/main/java/com/gregtechceu/gtceu/common/mui/GTMuiWidgets.java b/src/main/java/com/gregtechceu/gtceu/common/mui/GTMuiWidgets.java index 00de1e82a8b..c5c5150bf7e 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/mui/GTMuiWidgets.java +++ b/src/main/java/com/gregtechceu/gtceu/common/mui/GTMuiWidgets.java @@ -147,18 +147,20 @@ public static ToggleButton createPowerButton(IControllable workable) { "behaviour.soft_hammer"); } - public static ProgressWidget createProgressBar(IRecipeLogicMachine workableMachine, PanelSyncManager syncManager, - UITexture texture, int size) { - DoubleSyncValue progressPercent = syncManager.getOrCreateSyncHandler("progressPercent", DoubleSyncValue.class, - () -> new DoubleSyncValue(() -> { - if (workableMachine.getMaxProgress() == 0.0f) return 0.0f; - return workableMachine.getProgress() / (double) workableMachine.getMaxProgress(); - })); - - return new ProgressWidget() - .texture(texture, size) - .value(progressPercent); - } + /* + * public static ProgressWidget createProgressBar(IRecipeLogicMachine workableMachine, PanelSyncManager syncManager, + * UITexture texture, int size) { + * DoubleSyncValue progressPercent = syncManager.getOrCreateSyncHandler("progressPercent", DoubleSyncValue.class, + * () -> new DoubleSyncValue(() -> { + * if (workableMachine.getMaxProgress() == 0.0f) return 0.0f; + * return workableMachine.getProgress() / (double) workableMachine.getMaxProgress(); + * })); + * + * return new ProgressWidget() + * .texture(texture, size) + * .value(progressPercent); + * } + */ public static FluidSlot createTankWidget() { return new FluidSlot().size(20, 58).alwaysShowFull(false); diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/ldlib/ClickDataMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/ldlib/ClickDataMixin.java deleted file mode 100644 index e69dfc1e3ce..00000000000 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/ldlib/ClickDataMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.gregtechceu.gtceu.core.mixins.ldlib; - -import com.lowdragmc.lowdraglib.gui.util.ClickData; - -import net.minecraft.client.gui.screens.Screen; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(value = ClickData.class, remap = false) -public class ClickDataMixin { - - @Mutable - @Shadow(remap = false) - @Final - public boolean isShiftClick; - - @Mutable - @Shadow(remap = false) - @Final - public boolean isCtrlClick; - - @Inject(method = "()V", at = @At("RETURN"), remap = false) - private void gtceu$useVanillaModifierKeys(CallbackInfo ci) { - isShiftClick = Screen.hasShiftDown(); - isCtrlClick = Screen.hasControlDown(); - } -} diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/ldlib/ModularWrapperWidgetMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/ldlib/ModularWrapperWidgetMixin.java deleted file mode 100644 index df313d70aab..00000000000 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/ldlib/ModularWrapperWidgetMixin.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.gregtechceu.gtceu.core.mixins.ldlib; - -import com.lowdragmc.lowdraglib.emi.ModularWrapperWidget; -import com.lowdragmc.lowdraglib.gui.ingredient.IRecipeIngredientSlot; - -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.Constant; - -@Mixin(value = ModularWrapperWidget.class, remap = false) -public class ModularWrapperWidgetMixin { - - @WrapOperation(method = "getTooltip(II)Ljava/util/List;", - constant = { @Constant(classValue = IRecipeIngredientSlot.class) }) - public boolean gtceu$wrapInstanceOf(Object object, Operation original) { - return false; - } -} diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEConfigSyncHandler.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEConfigSyncHandler.java index 141d777c113..370697f4c7b 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEConfigSyncHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEConfigSyncHandler.java @@ -9,8 +9,9 @@ import appeng.api.stacks.GenericStack; import brachy.modularui.value.sync.SyncHandler; +import org.jetbrains.annotations.Nullable; -public class AEConfigSyncHandler extends SyncHandler { +public class AEConfigSyncHandler extends SyncHandler { private static final int SYNC_SLOTS = 1; @@ -20,9 +21,9 @@ public class AEConfigSyncHandler extends SyncHandler { private final GenericStack[] cachedStock; @OnlyIn(Dist.CLIENT) - private GenericStack[] clientConfig; + private @Nullable GenericStack @Nullable [] clientConfig; @OnlyIn(Dist.CLIENT) - private GenericStack[] clientStock; + private @Nullable GenericStack @Nullable [] clientStock; public AEConfigSyncHandler(IConfigurableSlotList slotList, int slotCount) { this.slotList = slotList; @@ -38,12 +39,12 @@ public void initClient() { } @OnlyIn(Dist.CLIENT) - public GenericStack getClientConfig(int index) { + public @Nullable GenericStack getClientConfig(int index) { return clientConfig != null ? clientConfig[index] : null; } @OnlyIn(Dist.CLIENT) - public GenericStack getClientStock(int index) { + public @Nullable GenericStack getClientStock(int index) { return clientStock != null ? clientStock[index] : null; } @@ -82,6 +83,7 @@ public void detectAndSendChanges(boolean init) { public void readOnClient(int id, FriendlyByteBuf buf) { if (id == SYNC_SLOTS) { if (clientConfig == null) initClient(); + if (clientStock == null) initClient(); for (int i = 0; i < slotCount; i++) { if (buf.readBoolean()) { clientConfig[i] = readStack(buf); @@ -94,20 +96,20 @@ public void readOnClient(int id, FriendlyByteBuf buf) { @Override public void readOnServer(int id, FriendlyByteBuf buf) {} - private static GenericStack copy(GenericStack stack) { + private static @Nullable GenericStack copy(@Nullable GenericStack stack) { return stack != null ? new GenericStack(stack.what(), stack.amount()) : null; } - private static void writeStack(FriendlyByteBuf buf, GenericStack stack) { + private static void writeStack(FriendlyByteBuf buf, @Nullable GenericStack stack) { buf.writeBoolean(stack != null); if (stack != null) GenericStack.writeBuffer(stack, buf); } - private static GenericStack readStack(FriendlyByteBuf buf) { + private static @Nullable GenericStack readStack(FriendlyByteBuf buf) { return buf.readBoolean() ? GenericStack.readBuffer(buf) : null; } - private static boolean areEqual(GenericStack a, GenericStack b) { + private static boolean areEqual(@Nullable GenericStack a, @Nullable GenericStack b) { if (a == b) return true; if (a == null || b == null) return false; return a.amount() == b.amount() && a.what().equals(b.what()); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEConfigWidget.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEConfigWidget.java index dc3dc8f9321..ed46a10b104 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEConfigWidget.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEConfigWidget.java @@ -1,6 +1,5 @@ package com.gregtechceu.gtceu.integration.ae2.gui; -import com.gregtechceu.gtceu.api.gui.GuiTextures; import com.gregtechceu.gtceu.common.mui.GTGuiTextures; import com.gregtechceu.gtceu.integration.ae2.slot.ExportOnlyAEFluidList; import com.gregtechceu.gtceu.integration.ae2.slot.ExportOnlyAEItemList; @@ -32,9 +31,10 @@ import brachy.modularui.widgets.textfield.TextFieldWidget; import com.mojang.blaze3d.platform.InputConstants; import dev.emi.emi.api.stack.EmiStack; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Objects; + public class AEConfigWidget extends Widget implements Interactable, GhostIngredientSlot { @@ -45,8 +45,8 @@ public class AEConfigWidget extends Widget private final int slotCount; private final boolean isFluid; private final int columns; - private PanelSyncManager syncManager; - private AEConfigSyncHandler configSyncHandler; + private @Nullable PanelSyncManager syncManager; + private @Nullable AEConfigSyncHandler configSyncHandler; @OnlyIn(Dist.CLIENT) private float lastMouseX; @@ -55,11 +55,11 @@ public class AEConfigWidget extends Widget @OnlyIn(Dist.CLIENT) private int editingSlotIndex; @OnlyIn(Dist.CLIENT) - private String pendingAmount; + private @Nullable String pendingAmount; @OnlyIn(Dist.CLIENT) - private SecondaryPanel amountEditorPanel; + private @Nullable SecondaryPanel amountEditorPanel; @OnlyIn(Dist.CLIENT) - private TextFieldWidget amountField; + private @Nullable TextFieldWidget amountField; public AEConfigWidget(IConfigurableSlotList slotList, int slotCount, boolean isFluid) { this.slotList = slotList; @@ -89,7 +89,7 @@ private ModularPanel buildAmountEditor(ModularPanel parent, net.minecraft. amountField = new TextFieldWidget() { @Override - public @NotNull Interactable.Result onKeyPressed(int keyCode, int scanCode, int modifiers) { + public Interactable.Result onKeyPressed(int keyCode, int scanCode, int modifiers) { if (isFocused() && (keyCode == InputConstants.KEY_RETURN || keyCode == InputConstants.KEY_NUMPADENTER)) { confirmAmountEdit(); @@ -124,8 +124,9 @@ private ModularPanel buildAmountEditor(ModularPanel parent, net.minecraft. @OnlyIn(Dist.CLIENT) private void confirmAmountEdit() { - if (editingSlotIndex < 0 || syncManager == null) return; + if (editingSlotIndex < 0 || syncManager == null || amountEditorPanel == null) return; String text = amountField != null ? amountField.getText() : pendingAmount; + if (text == null) return; long amount = AEGuiHelper.parseAmount(text); if (amount > 0) { String resolved = String.valueOf(amount); @@ -146,7 +147,7 @@ private void confirmAmountEdit() { @OnlyIn(Dist.CLIENT) private void openAmountEditor(int slotIndex) { GenericStack config = configSyncHandler != null ? configSyncHandler.getClientConfig(slotIndex) : null; - if (config == null) return; + if (config == null || amountEditorPanel == null) return; editingSlotIndex = slotIndex; pendingAmount = String.valueOf(config.amount()); if (amountEditorPanel.isPanelOpen()) { @@ -189,7 +190,7 @@ public void draw(ModularGuiContext context, WidgetThemeEntry widgetTheme) { for (int i = 0; i < slotCount; i++) { int x = slotX(i); int y = slotY(i); - drawSlotBackground(graphics, x, y, autoPull); + drawSlotBackground(context, x, y, autoPull); GenericStack config = configSyncHandler != null ? configSyncHandler.getClientConfig(i) : null; GenericStack stock = configSyncHandler != null ? configSyncHandler.getClientStock(i) : null; @@ -306,7 +307,7 @@ public boolean onMouseScrolled(double delta) { // --- GhostIngredientSlot --- @Override - public void setGhostIngredient(@NotNull ItemStack ingredient) { + public void setGhostIngredient(ItemStack ingredient) { if (isAutoPull() || syncManager == null) return; int slot = findTargetSlot(); if (slot < 0) return; @@ -341,11 +342,10 @@ public boolean ingredientHandlingOverride(Object ingredient) { if (fluidStack.getAmount() <= 0) fluidStack.setAmount(1000); int slot = findTargetSlot(); if (slot < 0) return false; - FluidStack toSend = fluidStack; syncManager.callSyncedAction("ae_config_set_ghost", buf -> { buf.writeVarInt(slot); buf.writeBoolean(true); - toSend.writeToPacket(buf); + fluidStack.writeToPacket(buf); }); return true; } else { @@ -364,13 +364,13 @@ public boolean ingredientHandlingOverride(Object ingredient) { } @Override - public @Nullable ItemStack castGhostIngredientIfValid(@NotNull Object ingredient) { + public @Nullable ItemStack castGhostIngredientIfValid(Object ingredient) { if (isAutoPull() || !areAncestorsEnabled()) return null; return !isFluid && ingredient instanceof ItemStack itemStack ? itemStack : null; } @Override - public @NotNull Class ingredientClass() { + public Class ingredientClass() { return ItemStack.class; } @@ -402,20 +402,20 @@ private void drawStack(GuiGraphics graphics, GenericStack stack, int x, int y) { AEGuiHelper.drawFluid(graphics, stack, x, y); } else if (stack.what() instanceof AEItemKey key) { ItemStack displayStack = new ItemStack(key.getItem()); - if (key.hasTag()) displayStack.setTag(key.getTag().copy()); + if (key.hasTag()) displayStack.setTag(Objects.requireNonNull(key.getTag()).copy()); graphics.renderItem(displayStack, x, y); } } @OnlyIn(Dist.CLIENT) - private void drawSlotBackground(GuiGraphics graphics, int x, int y, boolean autoPull) { + private void drawSlotBackground(ModularGuiContext context, int x, int y, boolean autoPull) { if (autoPull) { - GuiTextures.SLOT_DARK.draw(graphics, 0, 0, x, y, 18, 18); - GuiTextures.CONFIG_ARROW.draw(graphics, 0, 0, x, y, 18, 18); + GTGuiTextures.SLOT_DARK.draw(context, x, y, 18, 18); + GTGuiTextures.CONFIG_ARROW.draw(context, x, y, 18, 18); } else { - (isFluid ? GuiTextures.FLUID_SLOT : GuiTextures.SLOT).draw(graphics, 0, 0, x, y, 18, 18); - GuiTextures.CONFIG_ARROW_DARK.draw(graphics, 0, 0, x, y, 18, 18); + (isFluid ? GTGuiTextures.FLUID_SLOT : GTGuiTextures.SLOT).draw(context, x, y, 18, 18); + GTGuiTextures.CONFIG_ARROW_DARK.draw(context, x, y, 18, 18); } - GuiTextures.SLOT_DARK.draw(graphics, 0, 0, x, y + 18, 18, 18); + GTGuiTextures.SLOT_DARK.draw(context, x, y + 18, 18, 18); } } diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEStackDisplayWidget.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEStackDisplayWidget.java index 47ddeb52333..9f39a64c0e7 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEStackDisplayWidget.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/AEStackDisplayWidget.java @@ -1,6 +1,6 @@ package com.gregtechceu.gtceu.integration.ae2.gui; -import com.gregtechceu.gtceu.api.gui.GuiTextures; +import com.gregtechceu.gtceu.common.mui.GTGuiTextures; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; @@ -15,6 +15,7 @@ import brachy.modularui.screen.viewport.ModularGuiContext; import brachy.modularui.theme.WidgetThemeEntry; import brachy.modularui.widget.Widget; +import org.jetbrains.annotations.Nullable; import java.util.List; @@ -33,7 +34,7 @@ public AEStackDisplayWidget(List source, int index) { size(18); } - private GenericStack getStack() { + private @Nullable GenericStack getStack() { return index < source.size() ? source.get(index) : null; } @@ -46,7 +47,7 @@ protected WidgetThemeEntry getWidgetThemeInternal(ITheme theme) { @Override public void draw(ModularGuiContext context, WidgetThemeEntry widgetTheme) { var graphics = context.getGraphics(); - GuiTextures.SLOT_DARK.draw(graphics, 0, 0, 0, 0, 18, 18); + GTGuiTextures.SLOT_DARK.draw(context, 0, 0, 18, 18); GenericStack stack = getStack(); if (stack == null) return; @@ -72,7 +73,7 @@ public void drawForeground(ModularGuiContext context) { List.of(stack.what().getDisplayName(), Component.literal("x" + AEGuiHelper.formatAmountFull(stack.amount())) .withStyle(ChatFormatting.GRAY)), - (int) context.getAbsMouseX(), (int) context.getAbsMouseY()); + context.getAbsMouseX(), context.getAbsMouseY()); } } } diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/package-info.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/package-info.java new file mode 100644 index 00000000000..cab9ad58f64 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/gui/package-info.java @@ -0,0 +1,4 @@ +@NotNullByDefault +package com.gregtechceu.gtceu.integration.ae2.gui; + +import org.jetbrains.annotations.NotNullByDefault; diff --git a/src/main/java/com/gregtechceu/gtceu/integration/map/layer/builtin/FluidRenderLayer.java b/src/main/java/com/gregtechceu/gtceu/integration/map/layer/builtin/FluidRenderLayer.java index 8dd081eabbb..0a9fcb38280 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/map/layer/builtin/FluidRenderLayer.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/map/layer/builtin/FluidRenderLayer.java @@ -4,8 +4,6 @@ import com.gregtechceu.gtceu.integration.map.GenericMapRenderer; import com.gregtechceu.gtceu.integration.map.layer.MapRenderLayer; -import com.lowdragmc.lowdraglib.side.fluid.FluidStack; - import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.level.ChunkPos; @@ -24,8 +22,7 @@ public static String getId(ProspectorMode.FluidInfo vein, ChunkPos pos) { } public static Component getName(ProspectorMode.FluidInfo entry) { - FluidStack fluidStack = FluidStack.create(entry.fluid(), entry.left()); - return fluidStack.getDisplayName(); + return entry.asStack().getDisplayName(); } public static List getTooltip(Component name, ProspectorMode.FluidInfo entry) { diff --git a/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/emi/GTEMIPlugin.java b/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/emi/GTEMIPlugin.java index 54a209cd9be..5b04fcfa719 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/emi/GTEMIPlugin.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/emi/GTEMIPlugin.java @@ -16,11 +16,8 @@ import com.gregtechceu.gtceu.integration.recipeviewer.emi.orevein.GTBedrockOreEmiCategory; import com.gregtechceu.gtceu.integration.recipeviewer.emi.orevein.GTOreVeinEmiCategory; import com.gregtechceu.gtceu.integration.recipeviewer.emi.recipe.Ae2PatternTerminalHandler; -import com.gregtechceu.gtceu.integration.recipeviewer.emi.recipe.GTEmiRecipeHandler; import com.gregtechceu.gtceu.integration.recipeviewer.emi.recipe.GTRecipeEMICategory; -import com.lowdragmc.lowdraglib.gui.modular.ModularUIContainer; - import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.alchemy.Potion; import net.minecraft.world.item.alchemy.PotionUtils; @@ -52,7 +49,6 @@ public void register(EmiRegistry registry) { registry.addCategory(GTRecipeEMICategory.CATEGORIES.apply(category)); } } - registry.addRecipeHandler(ModularUIContainer.MENUTYPE, new GTEmiRecipeHandler()); if (GTCEu.Mods.isAE2Loaded()) { registry.addRecipeHandler(PatternEncodingTermMenu.TYPE, new Ae2PatternTerminalHandler<>()); } diff --git a/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/emi/recipe/GTEmiRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/emi/recipe/GTEmiRecipeHandler.java deleted file mode 100644 index 97ecf734048..00000000000 --- a/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/emi/recipe/GTEmiRecipeHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.gregtechceu.gtceu.integration.recipeviewer.emi.recipe; - -import com.lowdragmc.lowdraglib.gui.modular.ModularUIContainer; -import com.lowdragmc.lowdraglib.gui.widget.SlotWidget; -import com.lowdragmc.lowdraglib.jei.IngredientIO; - -import net.minecraft.world.inventory.Slot; - -import dev.emi.emi.api.recipe.EmiRecipe; -import dev.emi.emi.api.recipe.handler.StandardRecipeHandler; - -import java.util.List; - -public class GTEmiRecipeHandler implements StandardRecipeHandler { - - @Override - public List getInputSources(ModularUIContainer handler) { - return handler.getModularUI().getSlotMap().values().stream() - .filter(e -> e.getIngredientIO() == IngredientIO.INPUT || e.isPlayerContainer || e.isPlayerHotBar) - .map(SlotWidget::getHandler) - .toList(); - } - - @Override - public List getCraftingSlots(ModularUIContainer handler) { - return handler.getModularUI().getSlotMap().values().stream() - .filter(e -> e.getIngredientIO() == IngredientIO.INPUT) - .map(SlotWidget::getHandler) - .toList(); - } - - @Override - public boolean supportsRecipe(EmiRecipe recipe) { - return recipe instanceof GTEmiRecipe; - } -} diff --git a/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/rei/recipe/GTRecipeREICategory.java b/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/rei/recipe/GTRecipeREICategory.java index 706c338f46c..adb79fc419c 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/rei/recipe/GTRecipeREICategory.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/recipeviewer/rei/recipe/GTRecipeREICategory.java @@ -7,8 +7,6 @@ import com.gregtechceu.gtceu.api.registry.GTRegistries; import com.gregtechceu.gtceu.common.data.GTRecipeTypes; -import com.lowdragmc.lowdraglib.utils.Size; - import net.minecraft.Util; import net.minecraft.network.chat.Component; @@ -34,13 +32,9 @@ public class GTRecipeREICategory extends ModularUIREIDisplayCategory getCategoryIdentifier() { return CATEGORIES.apply(category); } - @Override - public int getDisplayHeight() { - return getSize().height; - } - - @Override - public int getDisplayWidth(GTRecipeDisplay display) { - return getSize().width; - } - @NotNull @Override public Component getTitle() { diff --git a/src/main/resources/data/curios/tags/items/hands.json b/src/main/resources/data/curios/tags/items/hands.json index b5c7e21d805..90d5a15104d 100644 --- a/src/main/resources/data/curios/tags/items/hands.json +++ b/src/main/resources/data/curios/tags/items/hands.json @@ -1,6 +1,5 @@ { "values": [ - "gtceu:rubber_gloves", - "gtceu:mui_test_item" + "gtceu:rubber_gloves" ] } diff --git a/src/main/resources/gtceu.mixins.json b/src/main/resources/gtceu.mixins.json index 5f722c64ac0..8a00301ab15 100644 --- a/src/main/resources/gtceu.mixins.json +++ b/src/main/resources/gtceu.mixins.json @@ -25,8 +25,6 @@ "ftbchunks.FTBChunksClientMixin", "ftbchunks.LargeMapScreenMixin", "ftbchunks.RegionMapPanelMixin", - "ldlib.ClickDataMixin", - "ldlib.ModularWrapperWidgetMixin", "rei.FluidEntryRendererMixin", "xaerominimap.HighlighterRegistryMixin", "xaerominimap.MinimapFBORendererMixin",