diff --git a/dependencies.gradle b/dependencies.gradle index 3548494..d70412c 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.27-GTNH:dev') + api('com.github.GTNewHorizons:NotEnoughItems:2.6.0-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.161: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') + api('com.github.GTNewHorizons:EnderStorage:1.6.0:dev') {transitive=false} + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.23:dev') + api('com.github.GTNewHorizons:GTplusplus:1.12.7:dev') + api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.4.9:dev') + api('com.github.GTNewHorizons:bartworks:0.10.10: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 d27e28c..ab814e3 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 @@ -44,12 +44,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, Optional trueRawOre) { this.layoutHandler = layoutHandler; this.labelHandler = labelHandler; this.recipeHandler = recipeHandler; @@ -71,14 +72,25 @@ class DiagramBuilder { this.rawOre = rawOres.get(0); } + 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(); } void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder) { diagramBuilder.addAllOptionalLayouts(layoutHandler.layouts()) .insertIntoSlot(LayoutHandler.SlotKeys.RAW_ORE, DisplayComponent.builder(rawOre).build()); + trueRawOre.ifPresent(v -> { + diagramBuilder.insertIntoSlot(LayoutHandler.SlotKeys.TRUE_RAW_ORE, 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 2b2cde3..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 @@ -94,12 +94,15 @@ public DiagramGroup generate() { OTHER_ORE_PREFIXES .forEach(prefix -> rawOres.addAll(GregTechOreDictUtil.getAllComponents(prefix, material))); - buildDiagram(matcherBuilder, rawOres); + Optional trueRawOre = GregTechOreDictUtil.getComponent(OrePrefixes.rawOre, material); + + buildDiagram(matcherBuilder, rawOres, trueRawOre); } 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; } @@ -110,7 +113,7 @@ public DiagramGroup generate() { OTHER_ORE_PREFIXES.forEach( prefix -> BartWorksOreDictUtil.getComponent(prefix, werkstoff).ifPresent(rawOres::add)); - buildDiagram(matcherBuilder, rawOres); + buildDiagram(matcherBuilder, rawOres, trueRawOre); } } @@ -122,15 +125,21 @@ public DiagramGroup generate() { continue; } - buildDiagram(matcherBuilder, ImmutableList.of(ItemComponent.create(ore))); + buildDiagram(matcherBuilder, ImmutableList.of(ItemComponent.create(ore)), Optional.ofNullable(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, + Optional trueRawOre) { + DiagramBuilder diagramBuilder = new DiagramBuilder( + layoutHandler, + labelHandler, + recipeHandler, + rawOres, + trueRawOre); diagramBuilder.buildDiagram(matcherBuilder); Logger.GREGTECH_5_ORE_PROCESSING.debug("Generated diagram [{}]", rawOres.get(0)); 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 59e6186..2eef6ee 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,13 @@ 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 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 @@ -69,7 +71,9 @@ static final class AdditionalRecipeLabelPositions { void initialize() { ImmutableList.Builder layoutsBuilder = new ImmutableList.Builder<>(); layoutsBuilder.add(buildRawOreLayout()); + layoutsBuilder.add(buildTrueRawOreLayout()); layoutsBuilder.add(buildRawOreMacerateLayout()); + layoutsBuilder.add(buildTrueRawOreMacerateLayout()); layoutsBuilder.add(buildCrushedOreWashLayout()); layoutsBuilder.add(buildCrushedOreBathMercuryLayout()); layoutsBuilder.add(buildCrushedOreBathSodiumPersulfateLayout()); @@ -90,8 +94,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(4, 2)).setDrawFunction(Draw::drawBigSlot) .setTooltip(Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("oreslot"), Tooltip.SLOT_FORMATTING)) .build(); @@ -100,13 +105,20 @@ private Layout buildRawOreLayout() { return Layout.builder().putSlot(SlotKeys.RAW_ORE, inputSlot).addInteractable(allDiagramsButton).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(); + // Raw Ores Item + private Layout buildTrueRawOreLayout() { + 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().putSlot(SlotKeys.TRUE_RAW_ORE, inputSlot).build(); + } - CustomInteractable label = labelHandler.buildLabel(LabelHandler.ItemLabel.MACERATOR, Grid.GRID.grid(4, 8)); + 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, 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(); @@ -115,8 +127,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, 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) + .setDefaultTooltip( + Tooltip.create(Lang.GREGTECH_5_ORE_PROCESSING.trans("maceratorslot"), Tooltip.SLOT_FORMATTING)) + .build(); + + return Layout.builder().addLines(lines).addLines(lines2).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)); @@ -131,8 +158,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 @@ -147,7 +173,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)); @@ -170,7 +197,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)); @@ -209,11 +237,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(); @@ -271,7 +299,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(); diff --git a/src/main/resources/assets/neicustomdiagram/lang/en_US.lang b/src/main/resources/assets/neicustomdiagram/lang/en_US.lang index 0b70e71..898e286 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 27f76c8..cfa7ab4 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=Processed raw ore neicustomdiagram.generators.gregtech5.oreprocessing.maceratorlabel=粉碎机 neicustomdiagram.generators.gregtech5.oreprocessing.maceratorslot=粉碎机输出 neicustomdiagram.generators.gregtech5.oreprocessing.orewashingplantlabel=洗矿机