From bdba3d1c01ce7585a263d3c0edf4885d91dd8156 Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Sat, 9 Mar 2024 14:48:34 +0100 Subject: [PATCH 01/14] Add RawOre to the OreProccessing Page --- gradle.properties | 9 +++++---- settings.gradle | 2 +- .../gregtech5/oreprocessing/GregTechOreProcessing.java | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index d046bb0..48da550 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,7 +33,7 @@ channel = stable mappingsVersion = 12 # Defines other MCP mappings for dependency deobfuscation. -remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ +remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ # Select a default username for testing your mod. You can always override this per-run by running # `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. @@ -61,6 +61,9 @@ gradleTokenModId = # [DEPRECATED] Mod name replacement token. gradleTokenModName = +# [DEPRECATED] Mod Group replacement token. +gradleTokenGroupName = + # [DEPRECATED] # Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java # public static final String VERSION = "GRADLETOKEN_VERSION"; @@ -123,7 +126,7 @@ includeWellKnownRepositories = true usesMavenPublishing = true # Maven repository to publish the mod to. -# mavenPublishUrl = https://nexus.gtnewhorizons.com/repository/releases/ +# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/ # Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token. # @@ -187,5 +190,3 @@ customArchiveBaseName = NEICustomDiagram # This is meant to be set in $HOME/.gradle/gradle.properties. # ideaCheckSpotlessOnBuild = true -# Non-GTNH properties -gradleTokenGroupName = diff --git a/settings.gradle b/settings.gradle index e8946ad..b11efb0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.8' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.16' } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index 2b2cde3..877f2d7 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -46,7 +46,8 @@ public final class GregTechOreProcessing implements DiagramGenerator { OrePrefixes.oreSmall, OrePrefixes.orePoor, OrePrefixes.oreEndstone, - OrePrefixes.oreEnd); + OrePrefixes.oreEnd, + OrePrefixes.rawOre); private final DiagramGroupInfo info; From 4544722c1ba5a20e0e625350215d8894dd5d9227 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 10 Mar 2024 22:09:17 +0100 Subject: [PATCH 02/14] update --- dependencies.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 67dca29..6525f7e 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,12 +4,12 @@ dependencies { compileOnly('com.google.auto.value:auto-value-annotations:1.8.2') annotationProcessor('com.google.auto.value:auto-value:1.8.2') - api('com.github.GTNewHorizons:NotEnoughItems:2.5.4-GTNH:dev') + api('com.github.GTNewHorizons:NotEnoughItems:2.5.24-GTNH:dev') api('com.github.GTNewHorizons:DetravScannerMod:1.8.0:dev') {transitive=false} api('com.github.GTNewHorizons:EnderStorage:1.5.0:dev') {transitive=false} - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.25:dev') - api('com.github.GTNewHorizons:GTplusplus:1.11.13:dev') - api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.3.11:dev') - api('com.github.GTNewHorizons:bartworks:0.9.4:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.95:dev') + api('com.github.GTNewHorizons:GTplusplus:1.11.33:dev') + api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.3.38:dev') + api('com.github.GTNewHorizons:bartworks:0.9.17:dev') } From 01111ba9b21d07f42e9089392bb39b84cdcf9a20 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 10 Mar 2024 22:13:58 +0100 Subject: [PATCH 03/14] update --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 6525f7e..f026d9a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -8,7 +8,7 @@ dependencies { api('com.github.GTNewHorizons:DetravScannerMod:1.8.0:dev') {transitive=false} api('com.github.GTNewHorizons:EnderStorage:1.5.0:dev') {transitive=false} - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.95:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.96-pre:dev') api('com.github.GTNewHorizons:GTplusplus:1.11.33:dev') api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.3.38:dev') api('com.github.GTNewHorizons:bartworks:0.9.17:dev') From 0a827666c8675b701e6d438053249cc4586840d4 Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:11:43 +0200 Subject: [PATCH 04/14] backup --- dependencies.gradle | 10 +++++----- .../gregtech5/oreprocessing/DiagramBuilder.java | 11 +++++++++++ .../oreprocessing/GregTechOreProcessing.java | 17 +++++++++++++++-- .../gregtech5/oreprocessing/LayoutHandler.java | 16 ++++++++++++++-- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index f026d9a..d45380d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,12 +4,12 @@ dependencies { compileOnly('com.google.auto.value:auto-value-annotations:1.8.2') annotationProcessor('com.google.auto.value:auto-value:1.8.2') - api('com.github.GTNewHorizons:NotEnoughItems:2.5.24-GTNH:dev') + api('com.github.GTNewHorizons:NotEnoughItems:2.5.26-GTNH:dev') api('com.github.GTNewHorizons:DetravScannerMod:1.8.0:dev') {transitive=false} api('com.github.GTNewHorizons:EnderStorage:1.5.0:dev') {transitive=false} - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.96-pre:dev') - api('com.github.GTNewHorizons:GTplusplus:1.11.33:dev') - api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.3.38:dev') - api('com.github.GTNewHorizons:bartworks:0.9.17:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.160-pre:dev') + api('com.github.GTNewHorizons:GTplusplus:1.11.57:dev') + api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.3.48:dev') + api('com.github.GTNewHorizons:bartworks:0.9.21:dev') } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index 64c5d48..401eaf9 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -1,5 +1,6 @@ package com.github.dcysteine.neicustomdiagram.generators.gregtech5.oreprocessing; +import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -44,6 +45,7 @@ class DiagramBuilder { private final RecipeHandler recipeHandler; private final ItemComponent rawOre; + private final ItemComponent rawOre2; private final Set craftingComponents; private final Set usageComponents; private final Diagram.Builder diagramBuilder; @@ -63,12 +65,19 @@ class DiagramBuilder { List gregTechOres = filteredRawOres.stream().filter(GregTechOreProcessing::isGregTechOreBlock) .collect(Collectors.toList()); + // Try to show a GregTech raw ore, if there are any. + List gregTechRawOres = filteredRawOres.stream().filter(GregTechOreProcessing::isGregTechOreBlock) + .collect(Collectors.toList()); + if (!gregTechOres.isEmpty()) { this.rawOre = gregTechOres.get(0); + this.rawOre2 = gregTechRawOres.get(0); } else if (!filteredRawOres.isEmpty()) { this.rawOre = filteredRawOres.get(0); + this.rawOre2 = filteredRawOres.get(0); } else { this.rawOre = rawOres.get(0); + this.rawOre2 = rawOres.get(0); } this.craftingComponents = new HashSet<>(filteredRawOres); @@ -80,6 +89,8 @@ void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder) { diagramBuilder.addAllOptionalLayouts(layoutHandler.layouts()) .insertIntoSlot(LayoutHandler.SlotKeys.RAW_ORE, DisplayComponent.builder(rawOre).build()); + //diagramBuilder.autoInsertIntoSlotGroup(LayoutHandler.SlotGroupKeys.RAW_ORE2).insertIntoNextSlot(DisplayComponent.builder(rawOre2).build()); + Optional crushedOreOptional = handleRecipes( RecipeHandler.RecipeMap.MACERATOR, rawOre, diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index 877f2d7..5424110 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -4,7 +4,9 @@ import java.util.List; import java.util.Optional; +import gregtech.common.blocks.GT_Item_Ores; import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -46,8 +48,9 @@ public final class GregTechOreProcessing implements DiagramGenerator { OrePrefixes.oreSmall, OrePrefixes.orePoor, OrePrefixes.oreEndstone, - OrePrefixes.oreEnd, - OrePrefixes.rawOre); + OrePrefixes.oreEnd); + + private static final ImmutableList OTHER_RAW_ORE_PREFIXES = ImmutableList.of(OrePrefixes.rawOre); private final DiagramGroupInfo info; @@ -96,6 +99,16 @@ public DiagramGroup generate() { .forEach(prefix -> rawOres.addAll(GregTechOreDictUtil.getAllComponents(prefix, material))); buildDiagram(matcherBuilder, rawOres); + + List rawOres2 = GregTechOreDictUtil.getAllComponents(OrePrefixes.rawOre, material); + if (rawOres2.isEmpty()) { + continue; + } + + OTHER_RAW_ORE_PREFIXES + .forEach(prefix -> rawOres2.addAll(GregTechOreDictUtil.getAllComponents(prefix, material))); + + buildDiagram(matcherBuilder, rawOres2); } if (Registry.ModDependency.BARTWORKS.isLoaded()) { diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java index 369a5f2..8bb0f29 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java @@ -23,6 +23,7 @@ static final class SlotKeys { static final class SlotGroupKeys { + static final Layout.SlotGroupKey RAW_ORE2 = Layout.SlotGroupKey.create("raw-ore2"); static final Layout.SlotGroupKey RAW_ORE_MACERATE = Layout.SlotGroupKey.create("raw-ore-macerate"); static final Layout.SlotGroupKey CRUSHED_ORE_MACERATE = Layout.SlotGroupKey.create("crushed-ore-macerate"); static final Layout.SlotGroupKey CRUSHED_ORE_WASH = Layout.SlotGroupKey.create("crushed-ore-wash"); @@ -88,8 +89,9 @@ ImmutableList layouts() { return layouts; } + //Ores Block private Layout buildRawOreLayout() { - Slot inputSlot = Slot.builder(Grid.GRID.grid(6, 4)).setDrawFunction(Draw::drawBigSlot) + Slot inputSlot = Slot.builder(Grid.GRID.grid(6, 2)).setDrawFunction(Draw::drawSlot) .setTooltip(Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("oreslot"), Tooltip.SLOT_FORMATTING)) .build(); @@ -98,8 +100,18 @@ private Layout buildRawOreLayout() { return Layout.builder().putSlot(SlotKeys.RAW_ORE, inputSlot).addInteractable(allDiagramsButton).build(); } + //Raw Ores Item + private Layout buildRawOre2Layout() { + SlotGroup inputSlot = SlotGroup.builder(1, 1, Grid.GRID.grid(6, 4), Grid.Direction.W) + .setDefaultTooltip(Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("raworeslot"), Tooltip.SLOT_FORMATTING)) + .build(); + + return Layout.builder().putSlotGroup(SlotGroupKeys.RAW_ORE2, inputSlot).build(); + } + private Layout buildRawOreMacerateLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(6, 4)).addSegment(Grid.GRID.grid(4, 4)) + Lines lines = Lines.builder(Grid.GRID.grid(6, 2)) + .addSegment(Grid.GRID.grid(4, 2)) .addArrow(Grid.GRID.edge(4, 10, Grid.Direction.N)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(4, 8)); From a6ce4c1cc303ede628851b797712f5703f9b6b3b Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:17:51 +0200 Subject: [PATCH 05/14] wip --- .../gregtech5/oreprocessing/DiagramBuilder.java | 8 +------- .../gregtech5/oreprocessing/LayoutHandler.java | 15 ++------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index 401eaf9..a675ab9 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -65,13 +65,9 @@ class DiagramBuilder { List gregTechOres = filteredRawOres.stream().filter(GregTechOreProcessing::isGregTechOreBlock) .collect(Collectors.toList()); - // Try to show a GregTech raw ore, if there are any. - List gregTechRawOres = filteredRawOres.stream().filter(GregTechOreProcessing::isGregTechOreBlock) - .collect(Collectors.toList()); - if (!gregTechOres.isEmpty()) { this.rawOre = gregTechOres.get(0); - this.rawOre2 = gregTechRawOres.get(0); + this.rawOre2 = gregTechOres.get(0); } else if (!filteredRawOres.isEmpty()) { this.rawOre = filteredRawOres.get(0); this.rawOre2 = filteredRawOres.get(0); @@ -89,8 +85,6 @@ void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder) { diagramBuilder.addAllOptionalLayouts(layoutHandler.layouts()) .insertIntoSlot(LayoutHandler.SlotKeys.RAW_ORE, DisplayComponent.builder(rawOre).build()); - //diagramBuilder.autoInsertIntoSlotGroup(LayoutHandler.SlotGroupKeys.RAW_ORE2).insertIntoNextSlot(DisplayComponent.builder(rawOre2).build()); - Optional crushedOreOptional = handleRecipes( RecipeHandler.RecipeMap.MACERATOR, rawOre, diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java index 8bb0f29..0df30d1 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java @@ -23,7 +23,6 @@ static final class SlotKeys { static final class SlotGroupKeys { - static final Layout.SlotGroupKey RAW_ORE2 = Layout.SlotGroupKey.create("raw-ore2"); static final Layout.SlotGroupKey RAW_ORE_MACERATE = Layout.SlotGroupKey.create("raw-ore-macerate"); static final Layout.SlotGroupKey CRUSHED_ORE_MACERATE = Layout.SlotGroupKey.create("crushed-ore-macerate"); static final Layout.SlotGroupKey CRUSHED_ORE_WASH = Layout.SlotGroupKey.create("crushed-ore-wash"); @@ -91,7 +90,7 @@ ImmutableList layouts() { //Ores Block private Layout buildRawOreLayout() { - Slot inputSlot = Slot.builder(Grid.GRID.grid(6, 2)).setDrawFunction(Draw::drawSlot) + Slot inputSlot = Slot.builder(Grid.GRID.grid(6, 4)).setDrawFunction(Draw::drawBigSlot) .setTooltip(Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("oreslot"), Tooltip.SLOT_FORMATTING)) .build(); @@ -100,18 +99,8 @@ private Layout buildRawOreLayout() { return Layout.builder().putSlot(SlotKeys.RAW_ORE, inputSlot).addInteractable(allDiagramsButton).build(); } - //Raw Ores Item - private Layout buildRawOre2Layout() { - SlotGroup inputSlot = SlotGroup.builder(1, 1, Grid.GRID.grid(6, 4), Grid.Direction.W) - .setDefaultTooltip(Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("raworeslot"), Tooltip.SLOT_FORMATTING)) - .build(); - - return Layout.builder().putSlotGroup(SlotGroupKeys.RAW_ORE2, inputSlot).build(); - } - private Layout buildRawOreMacerateLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(6, 2)) - .addSegment(Grid.GRID.grid(4, 2)) + Lines lines = Lines.builder(Grid.GRID.grid(6, 4)).addSegment(Grid.GRID.grid(4, 4)) .addArrow(Grid.GRID.edge(4, 10, Grid.Direction.N)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(4, 8)); From 7e6664f804855cdc65591514630fceddc969a184 Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:34:05 +0200 Subject: [PATCH 06/14] WiP --- .../oreprocessing/DiagramBuilder.java | 5 ---- .../oreprocessing/GregTechOreProcessing.java | 24 ++++++++++++++----- .../oreprocessing/LayoutHandler.java | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index a675ab9..64c5d48 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -1,6 +1,5 @@ package com.github.dcysteine.neicustomdiagram.generators.gregtech5.oreprocessing; -import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -45,7 +44,6 @@ class DiagramBuilder { private final RecipeHandler recipeHandler; private final ItemComponent rawOre; - private final ItemComponent rawOre2; private final Set craftingComponents; private final Set usageComponents; private final Diagram.Builder diagramBuilder; @@ -67,13 +65,10 @@ class DiagramBuilder { if (!gregTechOres.isEmpty()) { this.rawOre = gregTechOres.get(0); - this.rawOre2 = gregTechOres.get(0); } else if (!filteredRawOres.isEmpty()) { this.rawOre = filteredRawOres.get(0); - this.rawOre2 = filteredRawOres.get(0); } else { this.rawOre = rawOres.get(0); - this.rawOre2 = rawOres.get(0); } this.craftingComponents = new HashSet<>(filteredRawOres); diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index 5424110..ba2e994 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -4,9 +4,7 @@ import java.util.List; import java.util.Optional; -import gregtech.common.blocks.GT_Item_Ores; import net.minecraft.block.Block; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -100,15 +98,15 @@ public DiagramGroup generate() { buildDiagram(matcherBuilder, rawOres); - List rawOres2 = GregTechOreDictUtil.getAllComponents(OrePrefixes.rawOre, material); - if (rawOres2.isEmpty()) { + List trueRawOres = GregTechOreDictUtil.getAllComponents(OrePrefixes.rawOre, material); + if (trueRawOres.isEmpty()) { continue; } OTHER_RAW_ORE_PREFIXES - .forEach(prefix -> rawOres2.addAll(GregTechOreDictUtil.getAllComponents(prefix, material))); + .forEach(prefix -> trueRawOres.addAll(GregTechOreDictUtil.getAllComponents(prefix, material))); - buildDiagram(matcherBuilder, rawOres2); + buildDiagram(matcherBuilder, trueRawOres); } if (Registry.ModDependency.BARTWORKS.isLoaded()) { @@ -125,6 +123,20 @@ public DiagramGroup generate() { prefix -> BartWorksOreDictUtil.getComponent(prefix, werkstoff).ifPresent(rawOres::add)); buildDiagram(matcherBuilder, rawOres); + + Optional trueRawOre = BartWorksOreDictUtil.getComponent(OrePrefixes.rawOre, werkstoff); + if (!trueRawOre.isPresent()) { + continue; + } + + List trueRawOres = new ArrayList<>(); + rawOres.add(rawOre.get()); + + OTHER_RAW_ORE_PREFIXES.forEach( + prefix -> BartWorksOreDictUtil.getComponent(prefix, werkstoff).ifPresent(rawOres::add)); + + buildDiagram(matcherBuilder, trueRawOres); + } } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java index 0df30d1..d0008e2 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java @@ -88,7 +88,7 @@ ImmutableList layouts() { return layouts; } - //Ores Block + // Ores Block private Layout buildRawOreLayout() { Slot inputSlot = Slot.builder(Grid.GRID.grid(6, 4)).setDrawFunction(Draw::drawBigSlot) .setTooltip(Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("oreslot"), Tooltip.SLOT_FORMATTING)) From 3f70b9c46b4094924253553c4f934a89b86c1deb Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:14:56 +0200 Subject: [PATCH 07/14] Implement part 1 --- .../oreprocessing/DiagramBuilder.java | 11 ++++- .../oreprocessing/GregTechOreProcessing.java | 47 +++++++------------ .../oreprocessing/LayoutHandler.java | 14 ++++++ 3 files changed, 41 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index 64c5d48..8f78188 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -34,6 +34,8 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import javax.annotation.Nullable; + class DiagramBuilder { private static final ItemComponent STONE_DUST = ItemComponent @@ -44,12 +46,13 @@ class DiagramBuilder { private final RecipeHandler recipeHandler; private final ItemComponent rawOre; + private final Optional trueRawOre; private final Set craftingComponents; private final Set usageComponents; private final Diagram.Builder diagramBuilder; DiagramBuilder(LayoutHandler layoutHandler, LabelHandler labelHandler, RecipeHandler recipeHandler, - List rawOres) { + List rawOres, @Nullable ItemComponent trueRawOres) { this.layoutHandler = layoutHandler; this.labelHandler = labelHandler; this.recipeHandler = recipeHandler; @@ -71,6 +74,8 @@ class DiagramBuilder { this.rawOre = rawOres.get(0); } + this.trueRawOre = Optional.ofNullable(trueRawOres); + this.craftingComponents = new HashSet<>(filteredRawOres); this.usageComponents = new HashSet<>(filteredRawOres); this.diagramBuilder = Diagram.builder(); @@ -79,6 +84,10 @@ class DiagramBuilder { void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder) { diagramBuilder.addAllOptionalLayouts(layoutHandler.layouts()) .insertIntoSlot(LayoutHandler.SlotKeys.RAW_ORE, DisplayComponent.builder(rawOre).build()); + trueRawOre.ifPresent(v -> { + diagramBuilder.autoInsertIntoSlotGroup(LayoutHandler.SlotGroupKeys.TRUE_RAW_ORE) + .insertIntoNextSlot(DisplayComponent.builder(v).build()); + }); Optional crushedOreOptional = handleRecipes( RecipeHandler.RecipeMap.MACERATOR, diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index ba2e994..25eefc6 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Optional; +import it.unimi.dsi.fastutil.Pair; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -24,9 +25,12 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.common.blocks.GT_Block_Ores_Abstract; +import gregtech.common.items.GT_MetaGenerated_Item_03; import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.material.Material; +import javax.annotation.Nullable; + /** Generates ore processing diagrams for GregTech ores. */ public final class GregTechOreProcessing implements DiagramGenerator { @@ -46,9 +50,9 @@ public final class GregTechOreProcessing implements DiagramGenerator { OrePrefixes.oreSmall, OrePrefixes.orePoor, OrePrefixes.oreEndstone, - OrePrefixes.oreEnd); + OrePrefixes.oreEnd, + OrePrefixes.rawOre); - private static final ImmutableList OTHER_RAW_ORE_PREFIXES = ImmutableList.of(OrePrefixes.rawOre); private final DiagramGroupInfo info; @@ -96,17 +100,9 @@ public DiagramGroup generate() { OTHER_ORE_PREFIXES .forEach(prefix -> rawOres.addAll(GregTechOreDictUtil.getAllComponents(prefix, material))); - buildDiagram(matcherBuilder, rawOres); - - List trueRawOres = GregTechOreDictUtil.getAllComponents(OrePrefixes.rawOre, material); - if (trueRawOres.isEmpty()) { - continue; - } - - OTHER_RAW_ORE_PREFIXES - .forEach(prefix -> trueRawOres.addAll(GregTechOreDictUtil.getAllComponents(prefix, material))); + ItemComponent trueRawOres = GregTechOreDictUtil.getAllComponents(OrePrefixes.rawOre, material).get(0); - buildDiagram(matcherBuilder, trueRawOres); + buildDiagram(matcherBuilder, rawOres, trueRawOres); } if (Registry.ModDependency.BARTWORKS.isLoaded()) { @@ -122,21 +118,7 @@ public DiagramGroup generate() { OTHER_ORE_PREFIXES.forEach( prefix -> BartWorksOreDictUtil.getComponent(prefix, werkstoff).ifPresent(rawOres::add)); - buildDiagram(matcherBuilder, rawOres); - - Optional trueRawOre = BartWorksOreDictUtil.getComponent(OrePrefixes.rawOre, werkstoff); - if (!trueRawOre.isPresent()) { - continue; - } - - List trueRawOres = new ArrayList<>(); - rawOres.add(rawOre.get()); - - OTHER_RAW_ORE_PREFIXES.forEach( - prefix -> BartWorksOreDictUtil.getComponent(prefix, werkstoff).ifPresent(rawOres::add)); - - buildDiagram(matcherBuilder, trueRawOres); - + buildDiagram(matcherBuilder, rawOres, null); } } @@ -148,15 +130,15 @@ public DiagramGroup generate() { continue; } - buildDiagram(matcherBuilder, ImmutableList.of(ItemComponent.create(ore))); + buildDiagram(matcherBuilder, ImmutableList.of(ItemComponent.create(ore)), null); } } return new DiagramGroup(info, matcherBuilder.build()); } - private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres) { - DiagramBuilder diagramBuilder = new DiagramBuilder(layoutHandler, labelHandler, recipeHandler, rawOres); + private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres, @Nullable ItemComponent trueRawOre) { + DiagramBuilder diagramBuilder = new DiagramBuilder(layoutHandler, labelHandler, recipeHandler, rawOres, trueRawOre); diagramBuilder.buildDiagram(matcherBuilder); Logger.GREGTECH_5_ORE_PROCESSING.debug("Generated diagram [{}]", rawOres.get(0)); @@ -166,4 +148,9 @@ static boolean isGregTechOreBlock(ItemComponent itemComponent) { Block block = Block.getBlockFromItem(itemComponent.item()); return block instanceof GT_Block_Ores_Abstract; } + + static boolean isGregTechRawOreItem(ItemComponent itemComponent) { + if (itemComponent == null) {return false;} + return itemComponent.item() instanceof GT_MetaGenerated_Item_03; + } } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java index d0008e2..04f6afc 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java @@ -23,7 +23,9 @@ static final class SlotKeys { static final class SlotGroupKeys { + static final Layout.SlotGroupKey TRUE_RAW_ORE = Layout.SlotGroupKey.create("true-raw-ore"); static final Layout.SlotGroupKey RAW_ORE_MACERATE = Layout.SlotGroupKey.create("raw-ore-macerate"); + static final Layout.SlotGroupKey TRUE_RAW_ORE_MACERATE = Layout.SlotGroupKey.create("true-raw-ore-macerate"); static final Layout.SlotGroupKey CRUSHED_ORE_MACERATE = Layout.SlotGroupKey.create("crushed-ore-macerate"); static final Layout.SlotGroupKey CRUSHED_ORE_WASH = Layout.SlotGroupKey.create("crushed-ore-wash"); static final Layout.SlotGroupKey CRUSHED_ORE_BATH_MERCURY = Layout.SlotGroupKey @@ -67,6 +69,7 @@ static final class AdditionalRecipeLabelPositions { void initialize() { ImmutableList.Builder layoutsBuilder = new ImmutableList.Builder<>(); layoutsBuilder.add(buildRawOreLayout()); + layoutsBuilder.add(buildTrueRawOreLayout()); layoutsBuilder.add(buildRawOreMacerateLayout()); layoutsBuilder.add(buildCrushedOreWashLayout()); layoutsBuilder.add(buildCrushedOreBathMercuryLayout()); @@ -99,6 +102,17 @@ private Layout buildRawOreLayout() { return Layout.builder().putSlot(SlotKeys.RAW_ORE, inputSlot).addInteractable(allDiagramsButton).build(); } + // Raw Ores Item + private Layout buildTrueRawOreLayout() { + SlotGroup inputSlot = SlotGroup.builder(1, 1, Grid.GRID.grid(6, 6), Grid.Direction.W) + .setDefaultDrawFunction(Draw::drawBigSlot) + .setDefaultTooltip( + Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("raworeslot"), Tooltip.SLOT_FORMATTING)) + .build(); + + return Layout.builder().putSlotGroup(SlotGroupKeys.TRUE_RAW_ORE, inputSlot).build(); + } + private Layout buildRawOreMacerateLayout() { Lines lines = Lines.builder(Grid.GRID.grid(6, 4)).addSegment(Grid.GRID.grid(4, 4)) .addArrow(Grid.GRID.edge(4, 10, Grid.Direction.N)).build(); From b08cd13305786743f42aa2288b2d93d66cec6339 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:13:16 +0200 Subject: [PATCH 08/14] spotlessApply (#32) Co-authored-by: GitHub GTNH Actions <> --- .../oreprocessing/DiagramBuilder.java | 10 +++++----- .../oreprocessing/GregTechOreProcessing.java | 20 ++++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index 8f78188..068ffed 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -10,6 +10,8 @@ import java.util.function.Function; import java.util.stream.Collectors; +import javax.annotation.Nullable; + import com.github.dcysteine.neicustomdiagram.api.diagram.Diagram; import com.github.dcysteine.neicustomdiagram.api.diagram.component.Component; import com.github.dcysteine.neicustomdiagram.api.diagram.component.DisplayComponent; @@ -34,8 +36,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; -import javax.annotation.Nullable; - class DiagramBuilder { private static final ItemComponent STONE_DUST = ItemComponent @@ -52,7 +52,7 @@ class DiagramBuilder { private final Diagram.Builder diagramBuilder; DiagramBuilder(LayoutHandler layoutHandler, LabelHandler labelHandler, RecipeHandler recipeHandler, - List rawOres, @Nullable ItemComponent trueRawOres) { + List rawOres, @Nullable ItemComponent trueRawOres) { this.layoutHandler = layoutHandler; this.labelHandler = labelHandler; this.recipeHandler = recipeHandler; @@ -84,10 +84,10 @@ class DiagramBuilder { void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder) { diagramBuilder.addAllOptionalLayouts(layoutHandler.layouts()) .insertIntoSlot(LayoutHandler.SlotKeys.RAW_ORE, DisplayComponent.builder(rawOre).build()); - trueRawOre.ifPresent(v -> { + trueRawOre.ifPresent(v -> { diagramBuilder.autoInsertIntoSlotGroup(LayoutHandler.SlotGroupKeys.TRUE_RAW_ORE) .insertIntoNextSlot(DisplayComponent.builder(v).build()); - }); + }); Optional crushedOreOptional = handleRecipes( RecipeHandler.RecipeMap.MACERATOR, diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index 25eefc6..55a2951 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -4,7 +4,8 @@ import java.util.List; import java.util.Optional; -import it.unimi.dsi.fastutil.Pair; +import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -29,8 +30,6 @@ import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.material.Material; -import javax.annotation.Nullable; - /** Generates ore processing diagrams for GregTech ores. */ public final class GregTechOreProcessing implements DiagramGenerator { @@ -53,7 +52,6 @@ public final class GregTechOreProcessing implements DiagramGenerator { OrePrefixes.oreEnd, OrePrefixes.rawOre); - private final DiagramGroupInfo info; private final LabelHandler labelHandler; @@ -137,8 +135,14 @@ public DiagramGroup generate() { return new DiagramGroup(info, matcherBuilder.build()); } - private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres, @Nullable ItemComponent trueRawOre) { - DiagramBuilder diagramBuilder = new DiagramBuilder(layoutHandler, labelHandler, recipeHandler, rawOres, trueRawOre); + private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres, + @Nullable ItemComponent trueRawOre) { + DiagramBuilder diagramBuilder = new DiagramBuilder( + layoutHandler, + labelHandler, + recipeHandler, + rawOres, + trueRawOre); diagramBuilder.buildDiagram(matcherBuilder); Logger.GREGTECH_5_ORE_PROCESSING.debug("Generated diagram [{}]", rawOres.get(0)); @@ -150,7 +154,9 @@ static boolean isGregTechOreBlock(ItemComponent itemComponent) { } static boolean isGregTechRawOreItem(ItemComponent itemComponent) { - if (itemComponent == null) {return false;} + if (itemComponent == null) { + return false; + } return itemComponent.item() instanceof GT_MetaGenerated_Item_03; } } From 2e59e3e1bbc2608743096d275534f9a3184bd66a Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:36:38 +0200 Subject: [PATCH 09/14] Revert "spotlessApply (#32)" (#33) This reverts commit b08cd13305786743f42aa2288b2d93d66cec6339. --- .../oreprocessing/DiagramBuilder.java | 10 +++++----- .../oreprocessing/GregTechOreProcessing.java | 20 +++++++------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index 068ffed..8f78188 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -10,8 +10,6 @@ import java.util.function.Function; import java.util.stream.Collectors; -import javax.annotation.Nullable; - import com.github.dcysteine.neicustomdiagram.api.diagram.Diagram; import com.github.dcysteine.neicustomdiagram.api.diagram.component.Component; import com.github.dcysteine.neicustomdiagram.api.diagram.component.DisplayComponent; @@ -36,6 +34,8 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import javax.annotation.Nullable; + class DiagramBuilder { private static final ItemComponent STONE_DUST = ItemComponent @@ -52,7 +52,7 @@ class DiagramBuilder { private final Diagram.Builder diagramBuilder; DiagramBuilder(LayoutHandler layoutHandler, LabelHandler labelHandler, RecipeHandler recipeHandler, - List rawOres, @Nullable ItemComponent trueRawOres) { + List rawOres, @Nullable ItemComponent trueRawOres) { this.layoutHandler = layoutHandler; this.labelHandler = labelHandler; this.recipeHandler = recipeHandler; @@ -84,10 +84,10 @@ class DiagramBuilder { void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder) { diagramBuilder.addAllOptionalLayouts(layoutHandler.layouts()) .insertIntoSlot(LayoutHandler.SlotKeys.RAW_ORE, DisplayComponent.builder(rawOre).build()); - trueRawOre.ifPresent(v -> { + trueRawOre.ifPresent(v -> { diagramBuilder.autoInsertIntoSlotGroup(LayoutHandler.SlotGroupKeys.TRUE_RAW_ORE) .insertIntoNextSlot(DisplayComponent.builder(v).build()); - }); + }); Optional crushedOreOptional = handleRecipes( RecipeHandler.RecipeMap.MACERATOR, diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index 55a2951..25eefc6 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -4,8 +4,7 @@ import java.util.List; import java.util.Optional; -import javax.annotation.Nullable; - +import it.unimi.dsi.fastutil.Pair; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -30,6 +29,8 @@ import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.material.Material; +import javax.annotation.Nullable; + /** Generates ore processing diagrams for GregTech ores. */ public final class GregTechOreProcessing implements DiagramGenerator { @@ -52,6 +53,7 @@ public final class GregTechOreProcessing implements DiagramGenerator { OrePrefixes.oreEnd, OrePrefixes.rawOre); + private final DiagramGroupInfo info; private final LabelHandler labelHandler; @@ -135,14 +137,8 @@ public DiagramGroup generate() { return new DiagramGroup(info, matcherBuilder.build()); } - private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres, - @Nullable ItemComponent trueRawOre) { - DiagramBuilder diagramBuilder = new DiagramBuilder( - layoutHandler, - labelHandler, - recipeHandler, - rawOres, - trueRawOre); + private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres, @Nullable ItemComponent trueRawOre) { + DiagramBuilder diagramBuilder = new DiagramBuilder(layoutHandler, labelHandler, recipeHandler, rawOres, trueRawOre); diagramBuilder.buildDiagram(matcherBuilder); Logger.GREGTECH_5_ORE_PROCESSING.debug("Generated diagram [{}]", rawOres.get(0)); @@ -154,9 +150,7 @@ static boolean isGregTechOreBlock(ItemComponent itemComponent) { } static boolean isGregTechRawOreItem(ItemComponent itemComponent) { - if (itemComponent == null) { - return false; - } + if (itemComponent == null) {return false;} return itemComponent.item() instanceof GT_MetaGenerated_Item_03; } } From 3910b397b78cfb01722343f4ec6adf0afb0c747b Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:37:19 +0200 Subject: [PATCH 10/14] Final fixes --- .../oreprocessing/DiagramBuilder.java | 14 ++++-- .../oreprocessing/GregTechOreProcessing.java | 20 +++++--- .../oreprocessing/LayoutHandler.java | 46 +++++++++++++------ 3 files changed, 53 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index 8f78188..1cf6373 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -10,6 +10,8 @@ import java.util.function.Function; import java.util.stream.Collectors; +import javax.annotation.Nullable; + import com.github.dcysteine.neicustomdiagram.api.diagram.Diagram; import com.github.dcysteine.neicustomdiagram.api.diagram.component.Component; import com.github.dcysteine.neicustomdiagram.api.diagram.component.DisplayComponent; @@ -34,8 +36,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; -import javax.annotation.Nullable; - class DiagramBuilder { private static final ItemComponent STONE_DUST = ItemComponent @@ -52,7 +52,7 @@ class DiagramBuilder { private final Diagram.Builder diagramBuilder; DiagramBuilder(LayoutHandler layoutHandler, LabelHandler labelHandler, RecipeHandler recipeHandler, - List rawOres, @Nullable ItemComponent trueRawOres) { + List rawOres, @Nullable ItemComponent trueRawOres) { this.layoutHandler = layoutHandler; this.labelHandler = labelHandler; this.recipeHandler = recipeHandler; @@ -84,10 +84,14 @@ class DiagramBuilder { void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder) { diagramBuilder.addAllOptionalLayouts(layoutHandler.layouts()) .insertIntoSlot(LayoutHandler.SlotKeys.RAW_ORE, DisplayComponent.builder(rawOre).build()); - trueRawOre.ifPresent(v -> { + trueRawOre.ifPresent(v -> { diagramBuilder.autoInsertIntoSlotGroup(LayoutHandler.SlotGroupKeys.TRUE_RAW_ORE) .insertIntoNextSlot(DisplayComponent.builder(v).build()); - }); + Optional crushedOreOptional = handleRecipes( + RecipeHandler.RecipeMap.MACERATOR, + v, + LayoutHandler.SlotGroupKeys.TRUE_RAW_ORE_MACERATE); + }); Optional crushedOreOptional = handleRecipes( RecipeHandler.RecipeMap.MACERATOR, diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index 25eefc6..55a2951 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -4,7 +4,8 @@ import java.util.List; import java.util.Optional; -import it.unimi.dsi.fastutil.Pair; +import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -29,8 +30,6 @@ import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.material.Material; -import javax.annotation.Nullable; - /** Generates ore processing diagrams for GregTech ores. */ public final class GregTechOreProcessing implements DiagramGenerator { @@ -53,7 +52,6 @@ public final class GregTechOreProcessing implements DiagramGenerator { OrePrefixes.oreEnd, OrePrefixes.rawOre); - private final DiagramGroupInfo info; private final LabelHandler labelHandler; @@ -137,8 +135,14 @@ public DiagramGroup generate() { return new DiagramGroup(info, matcherBuilder.build()); } - private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres, @Nullable ItemComponent trueRawOre) { - DiagramBuilder diagramBuilder = new DiagramBuilder(layoutHandler, labelHandler, recipeHandler, rawOres, trueRawOre); + private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres, + @Nullable ItemComponent trueRawOre) { + DiagramBuilder diagramBuilder = new DiagramBuilder( + layoutHandler, + labelHandler, + recipeHandler, + rawOres, + trueRawOre); diagramBuilder.buildDiagram(matcherBuilder); Logger.GREGTECH_5_ORE_PROCESSING.debug("Generated diagram [{}]", rawOres.get(0)); @@ -150,7 +154,9 @@ static boolean isGregTechOreBlock(ItemComponent itemComponent) { } static boolean isGregTechRawOreItem(ItemComponent itemComponent) { - if (itemComponent == null) {return false;} + if (itemComponent == null) { + return false; + } return itemComponent.item() instanceof GT_MetaGenerated_Item_03; } } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java index 04f6afc..0638e96 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java @@ -71,6 +71,7 @@ void initialize() { layoutsBuilder.add(buildRawOreLayout()); layoutsBuilder.add(buildTrueRawOreLayout()); layoutsBuilder.add(buildRawOreMacerateLayout()); + layoutsBuilder.add(buildTrueRawOreMacerateLayout()); layoutsBuilder.add(buildCrushedOreWashLayout()); layoutsBuilder.add(buildCrushedOreBathMercuryLayout()); layoutsBuilder.add(buildCrushedOreBathSodiumPersulfateLayout()); @@ -93,7 +94,7 @@ ImmutableList layouts() { // Ores Block private Layout buildRawOreLayout() { - Slot inputSlot = Slot.builder(Grid.GRID.grid(6, 4)).setDrawFunction(Draw::drawBigSlot) + Slot inputSlot = Slot.builder(Grid.GRID.grid(4, 2)).setDrawFunction(Draw::drawBigSlot) .setTooltip(Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("oreslot"), Tooltip.SLOT_FORMATTING)) .build(); @@ -104,22 +105,21 @@ private Layout buildRawOreLayout() { // Raw Ores Item private Layout buildTrueRawOreLayout() { - SlotGroup inputSlot = SlotGroup.builder(1, 1, Grid.GRID.grid(6, 6), Grid.Direction.W) + SlotGroup inputSlot = SlotGroup.builder(1, 1, Grid.GRID.grid(6, 2), Grid.Direction.S) .setDefaultDrawFunction(Draw::drawBigSlot) .setDefaultTooltip( - Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("raworeslot"), Tooltip.SLOT_FORMATTING)) + Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("oreslot"), Tooltip.SLOT_FORMATTING)) .build(); return Layout.builder().putSlotGroup(SlotGroupKeys.TRUE_RAW_ORE, inputSlot).build(); } private Layout buildRawOreMacerateLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(6, 4)).addSegment(Grid.GRID.grid(4, 4)) - .addArrow(Grid.GRID.edge(4, 10, Grid.Direction.N)).build(); + Lines lines = Lines.builder(Grid.GRID.grid(4, 2)).addArrow(Grid.GRID.edge(4, 8, Grid.Direction.N)).build(); - CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(4, 8)); + CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(4, 5)); - SlotGroup outputSlots = SlotGroup.builder(1, 2, Grid.GRID.grid(4, 10), Grid.Direction.S) + SlotGroup outputSlots = SlotGroup.builder(1, 2, Grid.GRID.grid(4, 7), Grid.Direction.S) .setDefaultTooltip( Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("maceratorslot"), Tooltip.SLOT_FORMATTING)) .build(); @@ -128,8 +128,23 @@ private Layout buildRawOreMacerateLayout() { .putSlotGroup(SlotGroupKeys.RAW_ORE_MACERATE, outputSlots).build(); } + private Layout buildTrueRawOreMacerateLayout() { + Lines lines = Lines.builder(Grid.GRID.grid(6, 2)).addArrow(Grid.GRID.edge(6, 8, Grid.Direction.N)).build(); + + CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(6, 5)); + + SlotGroup outputSlots = SlotGroup.builder(1, 2, Grid.GRID.grid(6, 7), Grid.Direction.S) + .setDefaultTooltip( + Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("maceratorslot"), Tooltip.SLOT_FORMATTING)) + .build(); + + return Layout.builder().addLines(lines).addInteractable(label) + .putSlotGroup(SlotGroupKeys.TRUE_RAW_ORE_MACERATE, outputSlots).build(); + } + private Layout buildCrushedOreMacerateLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(4, 10)).addSegment(Grid.GRID.grid(2, 10)) + Lines lines = Lines.builder(Grid.GRID.grid(4, 7)).addSegment(Grid.GRID.grid(3, 7)) + .addSegment(Grid.GRID.grid(3, 10)).addSegment(Grid.GRID.grid(2, 10)) .addArrow(Grid.GRID.edge(2, 14, Grid.Direction.N)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(2, 12)); @@ -144,8 +159,7 @@ private Layout buildCrushedOreMacerateLayout() { } private Layout buildCrushedOreWashLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(4, 10)).addSegment(Grid.GRID.grid(5, 10)) - .addSegment(Grid.GRID.grid(5, 8)).addSegment(Grid.GRID.grid(8, 8)) + Lines lines = Lines.builder(Grid.GRID.grid(4, 7)).addSegment(Grid.GRID.grid(8, 7)) .addArrow(Grid.GRID.edge(8, 10, Grid.Direction.N)).build(); CustomInteractable label = labelHandler @@ -160,7 +174,8 @@ private Layout buildCrushedOreWashLayout() { } private Layout buildCrushedOreBathMercuryLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(4, 10)).addSegment(Grid.GRID.grid(0, 10)) + Lines lines = Lines.builder(Grid.GRID.grid(4, 7)).addSegment(Grid.GRID.grid(3, 7)) + .addSegment(Grid.GRID.grid(3, 10)).addSegment(Grid.GRID.grid(0, 10)) .addArrow(Grid.GRID.edge(0, 6, Grid.Direction.S)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.CHEMICAL_BATH, Grid.GRID.grid(0, 8)); @@ -183,7 +198,8 @@ private Layout buildCrushedOreBathMercuryLayout() { } private Layout buildCrushedOreBathSodiumPersulfateLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(4, 10)).addSegment(Grid.GRID.grid(2, 10)) + Lines lines = Lines.builder(Grid.GRID.grid(4, 7)).addSegment(Grid.GRID.grid(3, 7)) + .addSegment(Grid.GRID.grid(3, 10)).addSegment(Grid.GRID.grid(2, 10)) .addArrow(Grid.GRID.edge(2, 6, Grid.Direction.S)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.CHEMICAL_BATH, Grid.GRID.grid(2, 8)); @@ -222,11 +238,11 @@ private Layout buildPurifiedOreMacerateLayout() { private Layout buildPurifiedOreSiftLayout() { Lines lines = Lines.builder(Grid.GRID.grid(8, 10)).addSegment(Grid.GRID.grid(10, 10)) - .addArrow(Grid.GRID.edge(10, 6, Grid.Direction.S)).build(); + .addArrow(Grid.GRID.edge(10, 5, Grid.Direction.S)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.SIFTER, Grid.GRID.grid(10, 8)); - SlotGroup outputSlots = SlotGroup.builder(3, 3, Grid.GRID.grid(10, 6), Grid.Direction.N) + SlotGroup outputSlots = SlotGroup.builder(3, 3, Grid.GRID.grid(10, 5), Grid.Direction.N) .setDefaultTooltip( Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("sifterslot"), Tooltip.SLOT_FORMATTING)) .build(); @@ -284,7 +300,7 @@ private Layout buildPurifiedDustElectromagneticSeparateLayout() { } private Layout buildOreThermalCentrifugeLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(4, 10)).addSegment(Grid.GRID.grid(5, 10)) + Lines lines = Lines.builder(Grid.GRID.grid(4, 7)).addSegment(Grid.GRID.grid(5, 7)) .addSegment(Grid.GRID.grid(5, 12)).addSegment(Grid.GRID.grid(7, 12)).addSegment(Grid.GRID.grid(7, 10)) .addSegment(Grid.GRID.grid(8, 10)).move(Grid.GRID.grid(6, 12)) .addArrow(Grid.GRID.edge(6, 14, Grid.Direction.N)).build(); From d792834a139ab554e57a9f89a16cfd95849e0a75 Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:45:35 +0200 Subject: [PATCH 11/14] finalized --- .../gregtech5/oreprocessing/DiagramBuilder.java | 6 ++---- .../oreprocessing/GregTechOreProcessing.java | 11 +++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index 1cf6373..7bcbc94 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -10,8 +10,6 @@ import java.util.function.Function; import java.util.stream.Collectors; -import javax.annotation.Nullable; - import com.github.dcysteine.neicustomdiagram.api.diagram.Diagram; import com.github.dcysteine.neicustomdiagram.api.diagram.component.Component; import com.github.dcysteine.neicustomdiagram.api.diagram.component.DisplayComponent; @@ -52,7 +50,7 @@ class DiagramBuilder { private final Diagram.Builder diagramBuilder; DiagramBuilder(LayoutHandler layoutHandler, LabelHandler labelHandler, RecipeHandler recipeHandler, - List rawOres, @Nullable ItemComponent trueRawOres) { + List rawOres, Optional trueRawOres) { this.layoutHandler = layoutHandler; this.labelHandler = labelHandler; this.recipeHandler = recipeHandler; @@ -74,7 +72,7 @@ class DiagramBuilder { this.rawOre = rawOres.get(0); } - this.trueRawOre = Optional.ofNullable(trueRawOres); + this.trueRawOre = trueRawOres; this.craftingComponents = new HashSet<>(filteredRawOres); this.usageComponents = new HashSet<>(filteredRawOres); diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index 55a2951..f9e80fa 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -4,8 +4,6 @@ import java.util.List; import java.util.Optional; -import javax.annotation.Nullable; - import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -100,12 +98,13 @@ public DiagramGroup generate() { ItemComponent trueRawOres = GregTechOreDictUtil.getAllComponents(OrePrefixes.rawOre, material).get(0); - buildDiagram(matcherBuilder, rawOres, trueRawOres); + buildDiagram(matcherBuilder, rawOres, Optional.ofNullable(trueRawOres)); } if (Registry.ModDependency.BARTWORKS.isLoaded()) { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { Optional rawOre = BartWorksOreDictUtil.getComponent(OrePrefixes.ore, werkstoff); + Optional trueRawOre = BartWorksOreDictUtil.getComponent(OrePrefixes.rawOre, werkstoff); if (!rawOre.isPresent()) { continue; } @@ -116,7 +115,7 @@ public DiagramGroup generate() { OTHER_ORE_PREFIXES.forEach( prefix -> BartWorksOreDictUtil.getComponent(prefix, werkstoff).ifPresent(rawOres::add)); - buildDiagram(matcherBuilder, rawOres, null); + buildDiagram(matcherBuilder, rawOres, trueRawOre); } } @@ -128,7 +127,7 @@ public DiagramGroup generate() { continue; } - buildDiagram(matcherBuilder, ImmutableList.of(ItemComponent.create(ore)), null); + buildDiagram(matcherBuilder, ImmutableList.of(ItemComponent.create(ore)), Optional.ofNullable(null)); } } @@ -136,7 +135,7 @@ public DiagramGroup generate() { } private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List rawOres, - @Nullable ItemComponent trueRawOre) { + Optional trueRawOre) { DiagramBuilder diagramBuilder = new DiagramBuilder( layoutHandler, labelHandler, From c8bc86f6be5254554dfbe7479330ab5e3bde2d4e Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:00:07 +0200 Subject: [PATCH 12/14] Adressing review suggestions --- .../gregtech5/oreprocessing/DiagramBuilder.java | 9 +++++---- .../oreprocessing/GregTechOreProcessing.java | 15 +++------------ .../gregtech5/oreprocessing/LayoutHandler.java | 14 ++++++-------- .../assets/neicustomdiagram/lang/en_US.lang | 1 + .../assets/neicustomdiagram/lang/zh_CN.lang | 1 + 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index 7bcbc94..c731b5c 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -50,7 +50,7 @@ class DiagramBuilder { private final Diagram.Builder diagramBuilder; DiagramBuilder(LayoutHandler layoutHandler, LabelHandler labelHandler, RecipeHandler recipeHandler, - List rawOres, Optional trueRawOres) { + List rawOres, Optional trueRawOre) { this.layoutHandler = layoutHandler; this.labelHandler = labelHandler; this.recipeHandler = recipeHandler; @@ -72,10 +72,12 @@ class DiagramBuilder { this.rawOre = rawOres.get(0); } - this.trueRawOre = trueRawOres; + this.trueRawOre = trueRawOre; this.craftingComponents = new HashSet<>(filteredRawOres); + this.trueRawOre.ifPresent(this.craftingComponents::add); this.usageComponents = new HashSet<>(filteredRawOres); + this.trueRawOre.ifPresent(this.usageComponents::add); this.diagramBuilder = Diagram.builder(); } @@ -83,8 +85,7 @@ void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder) { diagramBuilder.addAllOptionalLayouts(layoutHandler.layouts()) .insertIntoSlot(LayoutHandler.SlotKeys.RAW_ORE, DisplayComponent.builder(rawOre).build()); trueRawOre.ifPresent(v -> { - diagramBuilder.autoInsertIntoSlotGroup(LayoutHandler.SlotGroupKeys.TRUE_RAW_ORE) - .insertIntoNextSlot(DisplayComponent.builder(v).build()); + diagramBuilder.insertIntoSlot(LayoutHandler.SlotKeys.TRUE_RAW_ORE, DisplayComponent.builder(v).build()); Optional crushedOreOptional = handleRecipes( RecipeHandler.RecipeMap.MACERATOR, v, diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index f9e80fa..8e9cdc5 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -24,7 +24,6 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.common.blocks.GT_Block_Ores_Abstract; -import gregtech.common.items.GT_MetaGenerated_Item_03; import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.material.Material; @@ -47,8 +46,7 @@ public final class GregTechOreProcessing implements DiagramGenerator { OrePrefixes.oreSmall, OrePrefixes.orePoor, OrePrefixes.oreEndstone, - OrePrefixes.oreEnd, - OrePrefixes.rawOre); + OrePrefixes.oreEnd); private final DiagramGroupInfo info; @@ -96,9 +94,9 @@ public DiagramGroup generate() { OTHER_ORE_PREFIXES .forEach(prefix -> rawOres.addAll(GregTechOreDictUtil.getAllComponents(prefix, material))); - ItemComponent trueRawOres = GregTechOreDictUtil.getAllComponents(OrePrefixes.rawOre, material).get(0); + Optional trueRawOre = GregTechOreDictUtil.getComponent(OrePrefixes.rawOre, material); - buildDiagram(matcherBuilder, rawOres, Optional.ofNullable(trueRawOres)); + buildDiagram(matcherBuilder, rawOres, trueRawOre); } if (Registry.ModDependency.BARTWORKS.isLoaded()) { @@ -151,11 +149,4 @@ static boolean isGregTechOreBlock(ItemComponent itemComponent) { Block block = Block.getBlockFromItem(itemComponent.item()); return block instanceof GT_Block_Ores_Abstract; } - - static boolean isGregTechRawOreItem(ItemComponent itemComponent) { - if (itemComponent == null) { - return false; - } - return itemComponent.item() instanceof GT_MetaGenerated_Item_03; - } } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java index 0638e96..303fda9 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java @@ -19,11 +19,11 @@ class LayoutHandler { static final class SlotKeys { static final Layout.SlotKey RAW_ORE = Layout.SlotKey.create("raw-ore"); + static final Layout.SlotKey TRUE_RAW_ORE = Layout.SlotKey.create("true-raw-ore"); } static final class SlotGroupKeys { - static final Layout.SlotGroupKey TRUE_RAW_ORE = Layout.SlotGroupKey.create("true-raw-ore"); static final Layout.SlotGroupKey RAW_ORE_MACERATE = Layout.SlotGroupKey.create("raw-ore-macerate"); static final Layout.SlotGroupKey TRUE_RAW_ORE_MACERATE = Layout.SlotGroupKey.create("true-raw-ore-macerate"); static final Layout.SlotGroupKey CRUSHED_ORE_MACERATE = Layout.SlotGroupKey.create("crushed-ore-macerate"); @@ -105,17 +105,15 @@ private Layout buildRawOreLayout() { // Raw Ores Item private Layout buildTrueRawOreLayout() { - SlotGroup inputSlot = SlotGroup.builder(1, 1, Grid.GRID.grid(6, 2), Grid.Direction.S) - .setDefaultDrawFunction(Draw::drawBigSlot) - .setDefaultTooltip( - Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("oreslot"), Tooltip.SLOT_FORMATTING)) + Slot inputSlot = Slot.builder(Grid.GRID.grid(6, 2)).setDrawFunction(Draw::drawBigSlot) + .setTooltip(Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("raworeslot"), Tooltip.SLOT_FORMATTING)) .build(); - return Layout.builder().putSlotGroup(SlotGroupKeys.TRUE_RAW_ORE, inputSlot).build(); + return Layout.builder().putSlot(SlotKeys.TRUE_RAW_ORE, inputSlot).build(); } private Layout buildRawOreMacerateLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(4, 2)).addArrow(Grid.GRID.edge(4, 8, Grid.Direction.N)).build(); + Lines lines = Lines.builder(Grid.GRID.grid(4, 2)).addArrow(Grid.GRID.edge(4, 7, Grid.Direction.N)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(4, 5)); @@ -129,7 +127,7 @@ private Layout buildRawOreMacerateLayout() { } private Layout buildTrueRawOreMacerateLayout() { - Lines lines = Lines.builder(Grid.GRID.grid(6, 2)).addArrow(Grid.GRID.edge(6, 8, Grid.Direction.N)).build(); + Lines lines = Lines.builder(Grid.GRID.grid(6, 2)).addArrow(Grid.GRID.edge(6, 7, Grid.Direction.N)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(6, 5)); diff --git a/src/main/resources/assets/neicustomdiagram/lang/en_US.lang b/src/main/resources/assets/neicustomdiagram/lang/en_US.lang index ccb8644..d830ed0 100644 --- a/src/main/resources/assets/neicustomdiagram/lang/en_US.lang +++ b/src/main/resources/assets/neicustomdiagram/lang/en_US.lang @@ -179,6 +179,7 @@ neicustomdiagram.generators.gregtech5.oreprefixes.prefixlabel=Ore prefix: %s neicustomdiagram.generators.gregtech5.oreprocessing.groupname=GregTech Ore Processing neicustomdiagram.generators.gregtech5.oreprocessing.oreslot=Processed ore +neicustomdiagram.generators.gregtech5.oreprocessing.raworeslot=Processed raw ore neicustomdiagram.generators.gregtech5.oreprocessing.maceratorlabel=Macerator neicustomdiagram.generators.gregtech5.oreprocessing.maceratorslot=Macerator output neicustomdiagram.generators.gregtech5.oreprocessing.orewashingplantlabel=Ore Washing Plant diff --git a/src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang b/src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang index 9d1866e..f080d74 100644 --- a/src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang +++ b/src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang @@ -179,6 +179,7 @@ neicustomdiagram.generators.gregtech5.oreprefixes.prefixlabel=矿辞前缀:%s neicustomdiagram.generators.gregtech5.oreprocessing.groupname=GT矿物处理 neicustomdiagram.generators.gregtech5.oreprocessing.oreslot=已处理矿物 +neicustomdiagram.generators.gregtech5.oreprocessing.raworeslot=加工原矿 neicustomdiagram.generators.gregtech5.oreprocessing.maceratorlabel=粉碎机 neicustomdiagram.generators.gregtech5.oreprocessing.maceratorslot=粉碎机输出 neicustomdiagram.generators.gregtech5.oreprocessing.orewashingplantlabel=洗矿机 From 5f3f0f75aad1fd5d2c3a2c7d6c90683868916c58 Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:02:48 +0200 Subject: [PATCH 13/14] update text --- src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang b/src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang index f080d74..b6aea15 100644 --- a/src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang +++ b/src/main/resources/assets/neicustomdiagram/lang/zh_CN.lang @@ -179,7 +179,7 @@ neicustomdiagram.generators.gregtech5.oreprefixes.prefixlabel=矿辞前缀:%s neicustomdiagram.generators.gregtech5.oreprocessing.groupname=GT矿物处理 neicustomdiagram.generators.gregtech5.oreprocessing.oreslot=已处理矿物 -neicustomdiagram.generators.gregtech5.oreprocessing.raworeslot=加工原矿 +neicustomdiagram.generators.gregtech5.oreprocessing.raworeslot=Processed raw ore neicustomdiagram.generators.gregtech5.oreprocessing.maceratorlabel=粉碎机 neicustomdiagram.generators.gregtech5.oreprocessing.maceratorslot=粉碎机输出 neicustomdiagram.generators.gregtech5.oreprocessing.orewashingplantlabel=洗矿机 From dd93558f97b57c746c66fb85d4c77a39f4a78380 Mon Sep 17 00:00:00 2001 From: Ethryan <3237986+Ethryan@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:06:47 +0200 Subject: [PATCH 14/14] Add missing line --- .../generators/gregtech5/oreprocessing/LayoutHandler.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java index 303fda9..1d30d24 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/LayoutHandler.java @@ -114,7 +114,6 @@ private Layout buildTrueRawOreLayout() { private Layout buildRawOreMacerateLayout() { Lines lines = Lines.builder(Grid.GRID.grid(4, 2)).addArrow(Grid.GRID.edge(4, 7, Grid.Direction.N)).build(); - CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(4, 5)); SlotGroup outputSlots = SlotGroup.builder(1, 2, Grid.GRID.grid(4, 7), Grid.Direction.S) @@ -128,7 +127,7 @@ private Layout buildRawOreMacerateLayout() { private Layout buildTrueRawOreMacerateLayout() { Lines lines = Lines.builder(Grid.GRID.grid(6, 2)).addArrow(Grid.GRID.edge(6, 7, Grid.Direction.N)).build(); - + Lines lines2 = Lines.builder(Grid.GRID.grid(4, 7)).addSegment(Grid.GRID.grid(6, 7)).build(); CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(6, 5)); SlotGroup outputSlots = SlotGroup.builder(1, 2, Grid.GRID.grid(6, 7), Grid.Direction.S) @@ -136,7 +135,7 @@ private Layout buildTrueRawOreMacerateLayout() { Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("maceratorslot"), Tooltip.SLOT_FORMATTING)) .build(); - return Layout.builder().addLines(lines).addInteractable(label) + return Layout.builder().addLines(lines).addLines(lines2).addInteractable(label) .putSlotGroup(SlotGroupKeys.TRUE_RAW_ORE_MACERATE, outputSlots).build(); }