Skip to content

Commit

Permalink
made digital chest and fusion control computer use new methods in Gui…
Browse files Browse the repository at this point in the history
…Data
  • Loading branch information
Trinsdar committed Nov 26, 2023
1 parent 24f5797 commit fc3970e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 69 deletions.
2 changes: 1 addition & 1 deletion common/src/main/java/trinsdar/gt4r/GT4Reimagined.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public void onRegistrationEvent(RegistrationEvent event, Side side) {
Guis.init(side);
Models.init();
Registry.register(Registry.LOOT_FUNCTION_TYPE, new ResourceLocation(GT4RRef.ID, "random_drop_bonus"), GT4RRandomDropBonus.RANDOM_DROP_BONUS);
TierMaps.buildTierMaps();
}
case DATA_READY -> {
if (AntimatterAPI.isModLoaded(GT4RRef.MOD_BLUEPOWER)) {
//GEM.forceOverride(Amethyst, ForgeRegistries.ITEMS.getValue(new ResourceLocation("bluepower", "amethyst_gem")));
}
TierMaps.buildTierMaps();
Structures.init();
Structures.initPatterns();
OreConfigHandler.ORE_CONFIG_HANDLER.save();
Expand Down
6 changes: 3 additions & 3 deletions common/src/main/java/trinsdar/gt4r/data/Guis.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ private static void initMaterialMachine(Side side){
//TODO move these textures to background folder
BiFunction<Boolean, String, ResourceLocation> textures = (c, l) -> new ResourceLocation(GT4RRef.ID, "textures/gui/machine/" + (c ? "charging_" : "") + l + ".png");
QUANTUM_CHEST.setGUI(MenuHandlers.QUANTUM_CHEST_HANDLER);
DIGITAL_CHEST.setGUI(MenuHandlers.DIGITAL_CHEST_HANDLER);



Expand Down Expand Up @@ -269,7 +268,7 @@ public static void backgroundTextures(){
LARGE_STEAM_TURBINE.getGui().setBackgroundTexture("multiblock");
THERMAL_BOILER.getGui().setBackgroundTexture("multiblock");
HEAT_EXCHANGER.getGui().setBackgroundTexture("multiblock");
FUSION_REACTOR.setGUI(MenuHandlers.FUSION_MENU_HANDLER);
DIGITAL_CHEST.getGui().setBackgroundTexture("digital_chest");
FUSION_REACTOR.getGui().setBackgroundTexture("fusion_control_computer");
}

Expand Down Expand Up @@ -300,7 +299,8 @@ public static void machineData(){
DISTILLATION_TOWER.setGuiProgressBarForJEI(BarDir.TOP, true);
DISTILLATION_TOWER.getGui().getMachineData().setProgressLocation("distillation_tower")
.setProgressSize(16, 72).setProgressPos(80, 4).setMachineStatePos(65, 25);
FUSION_REACTOR.getGui().setEnablePlayerSlots(false)
DIGITAL_CHEST.getGui().setYSize(221).setPlayerYOffset(56);
FUSION_REACTOR.getGui().setYSize(182).setTitleDrawingAllowed(false).setEnablePlayerSlots(false)
.getMachineData().setProgressLocation("fusion_reactor").setProgressPos(163, 4).setProgressSize(149, 16);
}

Expand Down
17 changes: 0 additions & 17 deletions common/src/main/java/trinsdar/gt4r/data/MenuHandlers.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import muramasa.antimatter.blockentity.multi.BlockEntityMultiMachine;
import net.minecraft.world.entity.player.Inventory;
import trinsdar.gt4r.GT4RRef;
import trinsdar.gt4r.gui.ContainerDigitalChest;
import trinsdar.gt4r.gui.ContainerQuantumChest;
import trinsdar.gt4r.gui.MenuHandlerCrafting;
import trinsdar.gt4r.gui.MenuHandlerCraftingItem;
Expand Down Expand Up @@ -45,22 +44,6 @@ public String screenID() {
}
};

public static MenuHandlerMachine<BlockEntityDigitalChest, ContainerDigitalChest> DIGITAL_CHEST_HANDLER = new MenuHandlerMachine(GT4RRef.ID, "container_digital_chest") {
@Override
public ContainerBasicMachine getMenu(IGuiHandler tile, Inventory playerInv, int windowId) {
return tile instanceof BlockEntityDigitalChest ? new ContainerDigitalChest((BlockEntityDigitalChest) tile, playerInv, this, windowId) : null;
}

@Override
public String screenID() {
return "digital_chest";
}

@Override
public String screenDomain() {
return GT4RRef.ID;
}
};
public static MenuHandlerCrafting COVER_CRAFTING_HANDLER = new MenuHandlerCrafting(GT4RRef.ID, "crafting_grid");
public static MenuHandlerCraftingItem ITEM_CRAFTING_HANDLER = new MenuHandlerCraftingItem(GT4RRef.ID, "crafting_item");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
import net.minecraft.client.gui.screens.inventory.CraftingScreen;
import net.minecraft.world.inventory.CraftingMenu;
import trinsdar.gt4r.GT4RRef;
import trinsdar.gt4r.gui.ContainerDigitalChest;
import trinsdar.gt4r.gui.screen.ScreenDigitalChest;
import trinsdar.gt4r.gui.screen.ScreenFusionReactor;

public class ScreenFactories {
public final static MenuScreens.ScreenConstructor SCREEN_FUSION_REACTOR = AntimatterAPI.register(MenuScreens.ScreenConstructor.class, "fusion_reactor", GT4RRef.ID,(MenuScreens.ScreenConstructor)(a, b, c) -> new ScreenFusionReactor<>((ContainerMultiMachine) a,b,c));
public final static MenuScreens.ScreenConstructor SCREEN_DIGITAL_CHEST = AntimatterAPI.register(MenuScreens.ScreenConstructor.class, "digital_chest", GT4RRef.ID,(MenuScreens.ScreenConstructor)(a, b, c) -> new ScreenDigitalChest((ContainerDigitalChest) a,b,c));
public final static MenuScreens.ScreenConstructor SCREEN_CRAFTING_TABLE = AntimatterAPI.register(MenuScreens.ScreenConstructor.class, "crafting_table", GT4RRef.ID,(MenuScreens.ScreenConstructor)(a, b, c) -> new CraftingScreen((CraftingMenu) a, b, c));

public static void init(){
Expand Down
28 changes: 0 additions & 28 deletions common/src/main/java/trinsdar/gt4r/gui/ContainerDigitalChest.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static com.google.common.collect.ImmutableMap.of;
import static io.github.gregtechintergalactical.gtcore.data.GTCoreItems.*;
import static muramasa.antimatter.data.AntimatterMaterialTypes.ROD;
import static muramasa.antimatter.machine.Tier.*;
import static muramasa.antimatter.util.TagUtils.getForgelikeItemTag;
import static trinsdar.gt4r.data.CustomTags.*;
Expand Down Expand Up @@ -179,7 +180,7 @@ private static void loadSimpleMachineRecipes(Consumer<FinishedRecipe> output, An
provider.addItemRecipe(output, GT4RRef.ID, "heat_exchanger", "machines", "has_machine_hull_basic", provider.hasSafeItem(MACHINE_HULLS_BASIC),
HEAT_EXCHANGER.getItem(LV), of('I', AntimatterMaterialTypes.PLATE.getMaterialTag(Invar), 'C', CopperCoil, 'P', FLUID_PIPE_INVAR.getBlock(PipeSize.SMALL), 'M', MACHINE_HULLS_BASIC), "ICI", "PMP", "ICI");
provider.addItemRecipe(output, GT4RRef.ID, "fermenter", "machines", "has_machine_hull_basic", provider.hasSafeItem(MACHINE_HULLS_BASIC), FERMENTER.getItem(LV), of('C', CIRCUITS_BASIC, 'G', ForgeCTags.GLASS, 'M', MACHINE_HULLS_BASIC, 'P', PumpModule), " P ", "GMG", " C ");
provider.addItemRecipe(output, GT4RRef.ID, "distillery", "machines", "has_machine_hull_basic", provider.hasSafeItem(MACHINE_HULLS_BASIC), DISTILLERY.getItem(LV), of('C', CIRCUITS_BASIC, 'G', ForgeCTags.GLASS, 'M', MACHINE_HULLS_BASIC, 'P', PumpModule, 'B', AntimatterMaterialTypes.ROD.getMaterialTag(AntimatterMaterials.Blaze)), " B ", "CMC", "GPG");
provider.addItemRecipe(output, GT4RRef.ID, "distillery", "machines", "has_machine_hull_basic", provider.hasSafeItem(MACHINE_HULLS_BASIC), DISTILLERY.getItem(LV), of('C', CIRCUITS_BASIC, 'G', ForgeCTags.GLASS, 'M', MACHINE_HULLS_BASIC, 'P', PumpModule, 'B', ROD.getMaterialTag(AntimatterMaterials.Blaze)), " B ", "CMC", "GPG");
provider.addItemRecipe(output, GT4RRef.ID, "mass_fabricator", "machines", "has_teleporter", provider.hasSafeItem(TELEPORTER.getItem(HV)),
MASS_FABRICATOR.getItem(EV), of('C', CIRCUITS_MASTER, 'F', FUSION_COIL, 'L', BatteryEnergyOrb, 'T', TELEPORTER.getItem(HV)), "CTC", "FLF", "CTC");
provider.addItemRecipe(output, GT4RRef.ID, "replicator", "machines", "has_teleporter", provider.hasSafeItem(TELEPORTER.getItem(HV)),
Expand Down Expand Up @@ -209,8 +210,8 @@ private static void loadUtilityBlockRecipes(Consumer<FinishedRecipe> output, Ant
provider.addItemRecipe(output, GT4RRef.ID, "computer_cube", "machines", "has_basic_machine", provider.hasSafeItem(MACHINE_HULLS_BASIC),
COMPUTER_CUBE.getItem(LV), of('C', CIRCUITS_MASTER, 'c', ComputerMonitor, 'B', MACHINE_HULLS_BASIC, 'D', CIRCUITS_ULTIMATE), "DcC", "cBc", "CcD");
GT4RMaterialTags.CABINET.all().forEach(m -> {
provider.addItemRecipe(output, GT4RRef.ID, "barrel_" + m.getId(), "machines", "has_chest", provider.hasSafeItem(ForgeCTags.CHESTS_WOODEN), Machine.get(m.getId() + "_barrel", GTCore.ID).map(mch -> mch.getItem(NONE)).orElse(Items.AIR), of('P', AntimatterMaterialTypes.PLATE.getMaterialTag(m), 'C', ForgeCTags.CHESTS_WOODEN), "PPP", "CPC", "PPP");
provider.addItemRecipe(output, GT4RRef.ID, "chest_" + m.getId(), "machines", "has_chest", provider.hasSafeItem(ForgeCTags.CHESTS_WOODEN), Machine.get(m.getId() + "_chest", GTCore.ID).map(mch -> mch.getItem(NONE)).orElse(Items.AIR), of('P', AntimatterMaterialTypes.PLATE.getMaterialTag(m), 'C', ForgeCTags.CHESTS_WOODEN, 'R', AntimatterMaterialTypes.ROD.getMaterialTag(m), 'S', AntimatterDefaultTools.SAW.getTag(), 'W', AntimatterDefaultTools.WRENCH.getTag()), "SPW", "RCR", "PPP");
provider.addItemRecipe(output, GT4RRef.ID, "barrel_" + m.getId(), "machines", Machine.get(m.getId() + "_barrel", GTCore.ID).map(mch -> mch.getItem(NONE)).orElse(Items.AIR), of('P', AntimatterMaterialTypes.PLATE.getMaterialTag(m), 'C', Items.BARREL, 'R', ROD.getMaterialTag(m), 'S', AntimatterDefaultTools.SAW.getTag(), 'W', AntimatterDefaultTools.WRENCH.getTag()), "PRP", "SCW", "PRP");
provider.addItemRecipe(output, GT4RRef.ID, "chest_" + m.getId(), "machines", Machine.get(m.getId() + "_chest", GTCore.ID).map(mch -> mch.getItem(NONE)).orElse(Items.AIR), of('P', AntimatterMaterialTypes.PLATE.getMaterialTag(m), 'C', ForgeCTags.CHESTS_WOODEN, 'R', ROD.getMaterialTag(m), 'S', AntimatterDefaultTools.SAW.getTag(), 'W', AntimatterDefaultTools.WRENCH.getTag()), "SPW", "RCR", "PPP");
});

/*GT4RMaterialTags.LOCKER.all().forEach(m -> {
Expand Down
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 fc3970e

Please sign in to comment.