Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic circuits #22

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/main/java/com/zorbatron/zbgt/common/items/ZBGTMetaItem.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package com.zorbatron.zbgt.common.items;

import static com.zorbatron.zbgt.common.items.ZBGTMetaItems.*;
import static gregtech.api.GTValues.*;

import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;

import com.zorbatron.zbgt.ZBGTUtility;
import com.zorbatron.zbgt.recipe.helpers.RecipeAssists;

import gregtech.api.GregTechAPI;
import gregtech.api.items.metaitem.MetaItem;
import gregtech.api.items.metaitem.StandardMetaItem;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.common.items.behaviors.TooltipBehavior;

public class ZBGTMetaItem extends StandardMetaItem {
Expand Down Expand Up @@ -144,5 +147,42 @@ public void registerSubItems() {
lines.add(I18n.format("metaitem.cover.dual.tooltip.transfer_rate.stacks", 16,
1280 * 64 * 64 * 4 / 20));
})).setInvisibleIf(!GregTechAPI.isHighTier());

// Generic Circuits: 26-40
GENERIC_CIRCUIT_ULV = addItem(26, "generic_circuit.ulv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(ULV));
GENERIC_CIRCUIT_LV = addItem(27, "generic_circuit.lv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(LV));
GENERIC_CIRCUIT_MV = addItem(28, "generic_circuit.mv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(MV));
GENERIC_CIRCUIT_HV = addItem(29, "generic_circuit.hv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(HV));
GENERIC_CIRCUIT_EV = addItem(30, "generic_circuit.ev")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(EV));
GENERIC_CIRCUIT_IV = addItem(31, "generic_circuit.iv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(IV));
GENERIC_CIRCUIT_LuV = addItem(32, "generic_circuit.luv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(LuV));
GENERIC_CIRCUIT_ZPM = addItem(33, "generic_circuit.zpm")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(ZPM));
GENERIC_CIRCUIT_UV = addItem(34, "generic_circuit.uv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(UV));
GENERIC_CIRCUIT_UHV = addItem(35, "generic_circuit.uhv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(UHV));
GENERIC_CIRCUIT_UEV = addItem(36, "generic_circuit.uev")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(UEV))
.setInvisibleIf(!GregTechAPI.isHighTier());
GENERIC_CIRCUIT_UIV = addItem(37, "generic_circuit.uiv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(UIV))
.setInvisibleIf(!GregTechAPI.isHighTier());
GENERIC_CIRCUIT_UXV = addItem(38, "generic_circuit.uxv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(UXV))
.setInvisibleIf(!GregTechAPI.isHighTier());
GENERIC_CIRCUIT_OpV = addItem(39, "generic_circuit.opv")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(OpV))
.setInvisibleIf(!GregTechAPI.isHighTier());
GENERIC_CIRCUIT_MAX = addItem(40, "generic_circuit.max")
.setUnificationData(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(MAX))
.setInvisibleIf(!GregTechAPI.isHighTier());
}
}
16 changes: 16 additions & 0 deletions src/main/java/com/zorbatron/zbgt/common/items/ZBGTMetaItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ public class ZBGTMetaItems {
public static MetaItem<?>.MetaValueItem PRECISE_DUAL_COVER_UXV;
public static MetaItem<?>.MetaValueItem PRECISE_DUAL_COVER_OpV;

public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_ULV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_LV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_MV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_HV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_EV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_IV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_LuV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_ZPM;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_UV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_UHV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_UEV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_UIV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_UXV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_OpV;
public static MetaItem<?>.MetaValueItem GENERIC_CIRCUIT_MAX;

public static void init() {
ZBGTMetaItem item = new ZBGTMetaItem();
item.setRegistryName("zbgt_meta_item");
Expand Down
18 changes: 16 additions & 2 deletions src/main/java/com/zorbatron/zbgt/recipe/MiscRecipes.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package com.zorbatron.zbgt.recipe;

import static gregtech.api.GTValues.*;
import static gregtech.api.recipes.RecipeMaps.COMPRESSOR_RECIPES;
import static gregtech.api.recipes.RecipeMaps.POLARIZER_RECIPES;
import static gregtech.api.recipes.RecipeMaps.*;
import static gregtech.api.unification.material.Materials.*;

import com.zorbatron.zbgt.ZBGTConfig;
import com.zorbatron.zbgt.recipe.helpers.RecipeAssists;

import gregtech.api.unification.ore.OrePrefix;

public class MiscRecipes {

protected static void init() {
magneticFluids();
genericCircuits();

if (ZBGTConfig.recipeSettings.enableSillyRecipes) {
sillyRecipes();
Expand Down Expand Up @@ -43,6 +46,17 @@ private static void magneticFluids() {
.buildAndRegister();
}

private static void genericCircuits() {
for (int tier = ULV; tier <= MAX; tier++) {
ASSEMBLER_RECIPES.recipeBuilder()
.input(OrePrefix.circuit, RecipeAssists.getMarkerMaterialByTier(tier), 16)
.circuitMeta(29)
.output(RecipeAssists.getGenericCircuitByTier(tier), 16)
.EUt(8).duration(20)
.buildAndRegister();
}
}

private static void sillyRecipes() {
COMPRESSOR_RECIPES.recipeBuilder()
.fluidInputs(Water.getFluid(Integer.MAX_VALUE))
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/com/zorbatron/zbgt/recipe/helpers/RecipeAssists.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.zorbatron.zbgt.recipe.helpers;

import static com.zorbatron.zbgt.common.items.ZBGTMetaItems.*;
import static gregtech.api.GTValues.*;
import static gregtech.api.unification.material.Materials.*;
import static gregtech.common.items.MetaItems.*;
Expand Down Expand Up @@ -41,6 +42,26 @@ public static Material getMarkerMaterialByTier(int tier) {
};
}

public static MetaItem<?>.MetaValueItem getGenericCircuitByTier(int tier) {
return switch (tier) {
case (1) -> GENERIC_CIRCUIT_LV;
case (2) -> GENERIC_CIRCUIT_MV;
case (3) -> GENERIC_CIRCUIT_HV;
case (4) -> GENERIC_CIRCUIT_EV;
case (5) -> GENERIC_CIRCUIT_IV;
case (6) -> GENERIC_CIRCUIT_LuV;
case (7) -> GENERIC_CIRCUIT_ZPM;
case (8) -> GENERIC_CIRCUIT_UV;
case (9) -> GENERIC_CIRCUIT_UHV;
case (10) -> GENERIC_CIRCUIT_UEV;
case (11) -> GENERIC_CIRCUIT_UIV;
case (12) -> GENERIC_CIRCUIT_UXV;
case (13) -> GENERIC_CIRCUIT_OpV;
case (14) -> GENERIC_CIRCUIT_MAX;
default -> GENERIC_CIRCUIT_ULV;
};
}

public static Material getMaterialByTier(int tier) {
return switch (tier) {
case (LV) -> Steel;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/main/resources/assets/zbgt/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ metaitem.cover.dual.tooltip.transfer_rate.stacks=§bTransfer Rate: §f%,d stacks

cover.dual_cover.mode_changer=Click to change between the item and fluid settings

# Items
metaitem.generic_circuit.ulv.name=Generic ULV Circuit
metaitem.generic_circuit.lv.name=Generic LV Circuit
metaitem.generic_circuit.mv.name=Generic MV Circuit
metaitem.generic_circuit.hv.name=Generic HV Circuit
metaitem.generic_circuit.ev.name=Generic EV Circuit
metaitem.generic_circuit.iv.name=Generic IV Circuit
metaitem.generic_circuit.luv.name=Generic LuV Circuit
metaitem.generic_circuit.zpm.name=Generic ZPM Circuit
metaitem.generic_circuit.uv.name=Generic UV Circuit
metaitem.generic_circuit.uhv.name=Generic UHV Circuit
metaitem.generic_circuit.uev.name=Generic UEV Circuit
metaitem.generic_circuit.uiv.name=Generic UIV Circuit
metaitem.generic_circuit.uxv.name=Generic UXV Circuit
metaitem.generic_circuit.opv.name=Generic OpV Circuit
metaitem.generic_circuit.max.name=Generic MAX Circuit


# Widgets
zbgt.widget.item_slot_tiny_amount.amount_tooltip=Amount: %s
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.ev"
"layer0": "gregtech:items/metaitems/dual_cover/ev"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.hv"
"layer0": "gregtech:items/metaitems/dual_cover/hv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.iv"
"layer0": "gregtech:items/metaitems/dual_cover/iv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.luv"
"layer0": "gregtech:items/metaitems/dual_cover/luv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.lv"
"layer0": "gregtech:items/metaitems/dual_cover/lv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.mv"
"layer0": "gregtech:items/metaitems/dual_cover/mv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.opv"
"layer0": "gregtech:items/metaitems/dual_cover/opv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.uev"
"layer0": "gregtech:items/metaitems/dual_cover/uev"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.uhv"
"layer0": "gregtech:items/metaitems/dual_cover/uhv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.uiv"
"layer0": "gregtech:items/metaitems/dual_cover/uiv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.uv"
"layer0": "gregtech:items/metaitems/dual_cover/uv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.uxv"
"layer0": "gregtech:items/metaitems/dual_cover/uxv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/dual_cover.zpm"
"layer0": "gregtech:items/metaitems/dual_cover/zpm"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.ev"
"layer0": "gregtech:items/metaitems/precise_dual_cover/ev"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.hv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/hv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.iv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/iv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.luv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/luv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.lv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/lv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.mv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/mv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.opv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/opv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.uev"
"layer0": "gregtech:items/metaitems/precise_dual_cover/uev"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.uhv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/uhv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.uiv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/uiv"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/precise_dual_cover.uv"
"layer0": "gregtech:items/metaitems/precise_dual_cover/uv"
}
}

Loading