Skip to content

Commit

Permalink
final commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Spicierspace153 committed Sep 20, 2024
1 parent 5110594 commit 71746a4
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"button_texture": {
"type": "item",
"res": "gtceu:storage_cover"
},
"items": [
"gtceu:storage_cover"
],
"page": "gtceu:covers/storage_cover",
"position": [
-300,
150
],
"pre_nodes": [
"gtceu:covers/cover"
],
"section": "gtceu:covers"
}
6 changes: 2 additions & 4 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,6 @@
"compass.node.gtceu.covers/computer_monitor_cover": "ɹǝʌoƆ ɹoʇıuoW ɹǝʇndɯoƆ",
"compass.node.gtceu.covers/conveyor": "ɹoʎǝʌuoƆ",
"compass.node.gtceu.covers/cover": "¿ɹǝʌoƆ sı ʇɐɥM",
"compass.node.gtceu.covers/crafting_table_cover": "ɹǝʌoƆ ǝןqɐ⟘ buıʇɟɐɹƆ",
"compass.node.gtceu.covers/ender_fluid_link_cover": "ɹǝʌoƆ ʞuıꞀ pınןℲ ɹǝpuƎ",
"compass.node.gtceu.covers/energy_detector_cover": "ɹǝʌoƆ ɹoʇɔǝʇǝᗡ ʎbɹǝuƎ",
"compass.node.gtceu.covers/facade_cover": "ɹǝʌoƆ ǝpɐɔɐℲ",
Expand All @@ -1834,6 +1833,7 @@
"compass.node.gtceu.covers/robot_arm": "ɯɹⱯ ʇoqoᴚ",
"compass.node.gtceu.covers/shutter_module_cover": "ɹǝʌoƆ ǝןnpoW ɹǝʇʇnɥS",
"compass.node.gtceu.covers/solar_panel": "ןǝuɐԀ ɹɐןoS",
"compass.node.gtceu.covers/storage_cover": "ɹǝʌoƆ ǝbɐɹoʇS",
"compass.node.gtceu.ev/cracker": "ɹǝʞɔɐɹƆ",
"compass.node.gtceu.ev/distillation_tower": "ɹǝʍo⟘ uoıʇɐןןıʇsıᗡ",
"compass.node.gtceu.ev/large_combustion": "uoıʇsnqɯoƆ ǝbɹɐꞀ",
Expand Down Expand Up @@ -4173,7 +4173,6 @@
"item.gtceu.cpu_chip.tooltip": "ʇıu∩ buıssǝɔoɹԀ ןɐɹʇuǝƆㄥ§",
"item.gtceu.cpu_wafer": "ɹǝɟɐM ∩ԀƆ",
"item.gtceu.cpu_wafer.tooltip": "ʇıu∩ buıssǝɔoɹԀ ʍɐᴚㄥ§",
"item.gtceu.crafting_table_cover": "ɹǝʌoƆ ǝןqɐ⟘ buıʇɟɐɹƆ",
"item.gtceu.crafting_table_cover.tooltip": "˙ㄥ§ɹǝʌoƆɟ§ sɐ ǝuıɥɔɐW ɐ uo ㄥ§ɥɔuǝqʞɹoM pǝɔuɐʌpⱯɟ§",
"item.gtceu.credit_casting_mold": ")ǝbɐuıoƆ( pןoW buıʇsɐƆ",
"item.gtceu.credit_casting_mold.tooltip": ")¡ʇı ǝsoן ʇ,uoᗡ( suıoƆ buıʞɐɯ ɹoɟ pןoW ǝɹnɔǝSㄥ§",
Expand Down Expand Up @@ -4210,7 +4209,6 @@
"item.gtceu.data_stick": "ʞɔıʇS ɐʇɐᗡ",
"item.gtceu.data_stick.tooltip": "ǝbɐɹoʇS ɐʇɐᗡ ʎʇıɔɐdɐƆ ʍoꞀ Ɐㄥ§",
"item.gtceu.diamond_grinding_head": "pɐǝH buıpuıɹ⅁ puoɯɐıᗡ",
"item.gtceu.digital_interface_cover": "ǝɔɐɟɹǝʇuI ןɐʇıbıᗡ",
"item.gtceu.diode": "ǝpoıᗡ",
"item.gtceu.diode.tooltip": "ʇuǝuodɯoƆ ɔıuoɹʇɔǝןƎ ɔısɐᗺㄥ§",
"item.gtceu.doge_coin": "uıoƆ ǝboᗡ",
Expand Down Expand Up @@ -4796,6 +4794,7 @@
"item.gtceu.stem_cells": "sןןǝƆ ɯǝʇS",
"item.gtceu.stem_cells.tooltip": "ǝɔuǝbıןןǝʇuI ʍɐᴚㄥ§",
"item.gtceu.sticky_resin": "uısǝᴚ ʎʞɔıʇS",
"item.gtceu.storage_cover": "ɹǝʌoƆ ǝbɐɹoʇS",
"item.gtceu.sugar_gem": "ǝqnƆ ɹɐbnS",
"item.gtceu.sus_record": "ɔsıᗡ ɔısnW",
"item.gtceu.sus_record.desc": "¡ʎssns",
Expand Down Expand Up @@ -5031,7 +5030,6 @@
"item.gtceu.white_dye_spray_can": ")ǝʇıɥM( uɐƆ ʎɐɹdS",
"item.gtceu.wire_extruder_mold": ")ǝɹıM( pןoW ɹǝpnɹʇxƎ",
"item.gtceu.wire_extruder_mold.tooltip": "sǝɹıM buıʞɐɯ ɹoɟ ǝdɐɥS ɹǝpnɹʇxƎㄥ§",
"item.gtceu.wireless_digital_interface_cover": "ǝɔɐɟɹǝʇuI ןɐʇıbıᗡ ssǝןǝɹıM",
"item.gtceu.wood_bolt": "ʞɔıʇS pooM ʇɹoɥS",
"item.gtceu.wood_dust": "dןnԀ pooM",
"item.gtceu.wood_plate": "ʞuɐןԀ pooM",
Expand Down
6 changes: 2 additions & 4 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,6 @@
"compass.node.gtceu.covers/computer_monitor_cover": "Computer Monitor Cover",
"compass.node.gtceu.covers/conveyor": "Conveyor",
"compass.node.gtceu.covers/cover": "What is Cover?",
"compass.node.gtceu.covers/crafting_table_cover": "Crafting Table Cover",
"compass.node.gtceu.covers/ender_fluid_link_cover": "Ender Fluid Link Cover",
"compass.node.gtceu.covers/energy_detector_cover": "Energy Detector Cover",
"compass.node.gtceu.covers/facade_cover": "Facade Cover",
Expand All @@ -1834,6 +1833,7 @@
"compass.node.gtceu.covers/robot_arm": "Robot Arm",
"compass.node.gtceu.covers/shutter_module_cover": "Shutter Module Cover",
"compass.node.gtceu.covers/solar_panel": "Solar Panel",
"compass.node.gtceu.covers/storage_cover": "Storage Cover",
"compass.node.gtceu.ev/cracker": "Cracker",
"compass.node.gtceu.ev/distillation_tower": "Distillation Tower",
"compass.node.gtceu.ev/large_combustion": "Large Combustion",
Expand Down Expand Up @@ -4173,7 +4173,6 @@
"item.gtceu.cpu_chip.tooltip": "§7Central Processing Unit",
"item.gtceu.cpu_wafer": "CPU Wafer",
"item.gtceu.cpu_wafer.tooltip": "§7Raw Processing Unit",
"item.gtceu.crafting_table_cover": "Crafting Table Cover",
"item.gtceu.crafting_table_cover.tooltip": "§fAdvanced Workbench§7 on a Machine as §fCover§7.",
"item.gtceu.credit_casting_mold": "Casting Mold (Coinage)",
"item.gtceu.credit_casting_mold.tooltip": "§7Secure Mold for making Coins (Don't lose it!)",
Expand Down Expand Up @@ -4210,7 +4209,6 @@
"item.gtceu.data_stick": "Data Stick",
"item.gtceu.data_stick.tooltip": "§7A Low Capacity Data Storage",
"item.gtceu.diamond_grinding_head": "Diamond Grinding Head",
"item.gtceu.digital_interface_cover": "Digital Interface",
"item.gtceu.diode": "Diode",
"item.gtceu.diode.tooltip": "§7Basic Electronic Component",
"item.gtceu.doge_coin": "Doge Coin",
Expand Down Expand Up @@ -4796,6 +4794,7 @@
"item.gtceu.stem_cells": "Stem Cells",
"item.gtceu.stem_cells.tooltip": "§7Raw Intelligence",
"item.gtceu.sticky_resin": "Sticky Resin",
"item.gtceu.storage_cover": "Storage Cover",
"item.gtceu.sugar_gem": "Sugar Cube",
"item.gtceu.sus_record": "Music Disc",
"item.gtceu.sus_record.desc": "sussy!",
Expand Down Expand Up @@ -5031,7 +5030,6 @@
"item.gtceu.white_dye_spray_can": "Spray Can (White)",
"item.gtceu.wire_extruder_mold": "Extruder Mold (Wire)",
"item.gtceu.wire_extruder_mold.tooltip": "§7Extruder Shape for making Wires",
"item.gtceu.wireless_digital_interface_cover": "Wireless Digital Interface",
"item.gtceu.wood_bolt": "Short Wood Stick",
"item.gtceu.wood_dust": "Wood Pulp",
"item.gtceu.wood_plate": "Wood Plank",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/storage_cover"
}
}
27 changes: 24 additions & 3 deletions src/main/java/com/gregtechceu/gtceu/common/cover/StorageCover.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,47 @@
import com.gregtechceu.gtceu.api.cover.CoverDefinition;
import com.gregtechceu.gtceu.api.cover.IUICover;

import com.lowdragmc.lowdraglib.gui.widget.SlotWidget;
import com.lowdragmc.lowdraglib.gui.widget.Widget;
import com.lowdragmc.lowdraglib.gui.widget.WidgetGroup;
import com.lowdragmc.lowdraglib.misc.ItemStackTransfer;
import com.lowdragmc.lowdraglib.syncdata.annotation.DescSynced;
import com.lowdragmc.lowdraglib.syncdata.annotation.Persisted;

import net.minecraft.core.Direction;

import org.jetbrains.annotations.NotNull;

public class StorageCover extends CoverBehavior implements IUICover {

@Persisted
@DescSynced
public final ItemStackTransfer inventory;
private int inventorysize = 18;
private int xoffset = 7;
private int yoffset = 7;

public StorageCover(@NotNull CoverDefinition definition, @NotNull ICoverable coverableView,
@NotNull Direction attachedSide) {
super(definition, coverableView, attachedSide);
inventory = new ItemStackTransfer(inventorysize) {

@Override
public int getSlotLimit(int slot) {
return 1;
}
};
}
//////////////////////////////////////
// *********** GUI ***********//
//////////////////////////////////////

@Override
public Widget createUIWidget() {
final var group = new WidgetGroup(0, 0, 176, 85);
for (int slot = 0; slot < 18; slot++) {

group.addWidget(new SlotWidget(inventory, slot, xoffset + (slot % 9) * 18, yoffset + (slot / 9) * 18));

}

return group;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 71746a4

Please sign in to comment.