Skip to content

Commit

Permalink
Revert "spotlessApply (#32)" (#33)
Browse files Browse the repository at this point in the history
This reverts commit b08cd13.
  • Loading branch information
Ethryan authored Apr 23, 2024
1 parent b08cd13 commit 2e59e3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -52,7 +52,7 @@ class DiagramBuilder {
private final Diagram.Builder diagramBuilder;

DiagramBuilder(LayoutHandler layoutHandler, LabelHandler labelHandler, RecipeHandler recipeHandler,
List<ItemComponent> rawOres, @Nullable ItemComponent trueRawOres) {
List<ItemComponent> rawOres, @Nullable ItemComponent trueRawOres) {
this.layoutHandler = layoutHandler;
this.labelHandler = labelHandler;
this.recipeHandler = recipeHandler;
Expand Down Expand Up @@ -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<ItemComponent> crushedOreOptional = handleRecipes(
RecipeHandler.RecipeMap.MACERATOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 {

Expand All @@ -52,6 +53,7 @@ public final class GregTechOreProcessing implements DiagramGenerator {
OrePrefixes.oreEnd,
OrePrefixes.rawOre);


private final DiagramGroupInfo info;

private final LabelHandler labelHandler;
Expand Down Expand Up @@ -135,14 +137,8 @@ public DiagramGroup generate() {
return new DiagramGroup(info, matcherBuilder.build());
}

private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List<ItemComponent> rawOres,
@Nullable ItemComponent trueRawOre) {
DiagramBuilder diagramBuilder = new DiagramBuilder(
layoutHandler,
labelHandler,
recipeHandler,
rawOres,
trueRawOre);
private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List<ItemComponent> 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));
Expand All @@ -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;
}
}

0 comments on commit 2e59e3e

Please sign in to comment.