Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
 * Implemented scrolling with mouse wheel
   * Can scroll pages, diagrams, and cycle components
   * Fix for GTNewHorizons/GT-New-Horizons-Modpack#8561
 * Revamped GregTechOreProcessing diagram layout
   * Merged thermal centrifuge layouts to free up space
   * Added chemical bath recipes to diagram
   * Thanks to bombcar for the layout idea!
 * Fixed hotkey integration with NEI; should now work with 'T' and 'Y'
 * Can now view cycle components in tooltip
 * Added config option to hide empty diagrams.
 * Added diagram group description, for showing in config comments.
 * Added separate mod check support for GT 5 vs. GT 6.
   * Includes large rename of packages and variables to include GT version.
   * Fixes crash in #1
 * Various small diagram improvements:
   * Added GregTechOrePrefixes diagram
   * Added bars to GregTechMaterialParts diagram
   * Properly sorted tools by EU capacity in GregTechMaterialTools diagram
   * Added "all diagrams" button to ForgeFluidContainers
   * Removed numbering from DebugRuler due to truncation
 * Now needs NEI v2.1.13-GTNH or later
 * Significant restructuring and improvements to code
  • Loading branch information
D-Cysteine committed Oct 1, 2021
1 parent da4448c commit 4472152
Show file tree
Hide file tree
Showing 68 changed files with 2,178 additions and 946 deletions.
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
### NEI Custom Diagram

**NEI Custom Diagram** is a framework for creating custom diagrams for NEI.\
It comes bundled with some diagrams already:
- Debug Ruler
- Ender Storage Chest Overview
- Ender Storage Tank Overview
- Forge Fluid Containers
- Forge Ore Dictionary
- GregTech Material Parts
- GregTech Material Tools
- GregTech Ore Dictionary
- GregTech Ore Processing
See the [**Wiki**](https://github.com/D-Cysteine/nei-custom-diagram/wiki)
for information on how to use it, and which diagrams are currently available!

Note that some of these diagrams are disabled by default!\
You can find the config file here: `.minecraft/config/NEICustomDiagram.cfg`

Inspired by
Expand Down
26 changes: 13 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,13 @@ val Project.minecraft: UserExtension
repositories {
mavenLocal()
maven("http://chickenbones.net/maven/") { this.name = "ChickenBones" }
ivy {
this.name = "gtnh_download_source_stupid_underscore_typo"
this.artifactPattern(
"http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]")
}
ivy {
this.name = "gtnh_download_source"
this.artifactPattern(
"http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]")
"http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision]-[classifier].[ext]")
}
maven("https://jitpack.io") { this.name = "jitpack.io" }
maven("https://gregtech.overminddl1.com/") { this.name = "GregTech" }
maven("http://www.ryanliptak.com/maven/") { this.name = "AppleCore" }
maven("http://maven.ic2.player.to/") { this.name = "IC2" }
//maven("https://gregtech.overminddl1.com/") { this.name = "GregTech" }
}

dependencies {
Expand All @@ -84,15 +77,17 @@ dependencies {
compile("codechicken:CodeChickenCore:$minecraftVersion-$codeChickenCoreVersion:dev")
compile("codechicken:CodeChickenLib:$minecraftVersion-$codeChickenLibVersion:dev")

val gregTechVersion: String by project
val gregTech5Version: String by project
val enderIoVersion: String by project
val forestryVersion: String by project
val railcraftVersion: String by project
compile("com.github.GTNewHorizons:GT5-Unofficial:$gregTechVersion:dev") {
this.isChanging = true
compile("com.github.GTNewHorizons:GT5-Unofficial:$gregTech5Version:dev") {
this.isTransitive = false
}
// The following are compile-time dependencies of GT5.
compileOnly("crazypants.enderio:EnderIO-$minecraftVersion:${enderIoVersion}_beta:dev")
compileOnly("net.sengir.forestry:forestry_$minecraftVersion:$forestryVersion:dev")
compileOnly("mods.railcraft:Railcraft_1.7.10:$railcraftVersion:dev")
compileOnly("mods.railcraft:Railcraft_$minecraftVersion:$railcraftVersion:dev")

val bartworksVersion: String by project
compile("com.github.GTNewHorizons:bartworks:$bartworksVersion:dev") {
Expand All @@ -101,6 +96,11 @@ dependencies {

val enderStorageVersion: String by project
compile("com.github.GTNewHorizons:EnderStorage:$enderStorageVersion:dev")

/*
val gregTech6Version: String by project
compile("com.gregoriust.gregtech:gregtech_$minecraftVersion:$gregTech6Version:dev")
*/
}

tasks.withType<Jar> {
Expand Down
10 changes: 7 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
neiCustomDiagramVersion=0.8.1
neiCustomDiagramVersion=1.0.0

minecraftVersion=1.7.10
forgeVersion=10.13.4.1614
Expand All @@ -8,10 +8,14 @@ autoValueVersion=1.8.2
codeChickenCoreVersion=1.0.7.47
codeChickenLibVersion=1.1.3.140

gregTechVersion=experimental-SNAPSHOT
#gregTech5Version=experimental-SNAPSHOT
gregTech5Version=5.09.37.09
enderIoVersion=2.3.0.429
forestryVersion=4.4.0.0
railcraftVersion=9.12.2.0

bartworksVersion=0.5.20

enderStorageVersion=1.4.8
enderStorageVersion=1.4.8

#gregTech6Version=6.14.20
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import codechicken.nei.event.NEIRegisterHandlerInfosEvent;
import com.github.dcysteine.neicustomdiagram.api.diagram.DiagramGroupInfo;
import com.github.dcysteine.neicustomdiagram.mod.Logger;
import com.github.dcysteine.neicustomdiagram.mod.NeiIntegration;
import com.github.dcysteine.neicustomdiagram.mod.Reflection;
import com.github.dcysteine.neicustomdiagram.mod.Registry;
import com.github.dcysteine.neicustomdiagram.mod.config.Config;
Expand All @@ -23,12 +24,12 @@
modid = NeiCustomDiagram.MOD_ID,
name = NeiCustomDiagram.MOD_NAME,
version = NeiCustomDiagram.MOD_VERSION,
guiFactory = ConfigGuiFactory.CLASS_NAME,
dependencies = NeiCustomDiagram.MOD_DEPENDENCIES)
dependencies = NeiCustomDiagram.MOD_DEPENDENCIES,
guiFactory = ConfigGuiFactory.CLASS_NAME)
public final class NeiCustomDiagram {
public static final String MOD_ID = "neicustomdiagram";
public static final String MOD_VERSION = "@version@";
public static final String MOD_NAME = "NEI Custom Diagram";
public static final String MOD_VERSION = "@version@";
public static final String MOD_DEPENDENCIES =
"required-after:NotEnoughItems;"
+ "after:gregtech;"
Expand All @@ -48,6 +49,7 @@ public void onInitialization(FMLInitializationEvent event) {
Reflection.initialize();
Registry.initialize();
Config.initialize();
NeiIntegration.initialize();
MinecraftForge.EVENT_BUS.register(NeiCustomDiagram.this);

Logger.MOD.info("Mod initialization complete!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.dcysteine.neicustomdiagram.api.diagram.interactable.Interactable;
import com.github.dcysteine.neicustomdiagram.api.diagram.layout.Layout;
import com.github.dcysteine.neicustomdiagram.api.draw.Dimension;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;

Expand All @@ -26,7 +27,7 @@ public CompositeDiagram(Layout layout, ImmutableList<? extends Interactable> int

/** The passed-in diagram will always be shown. */
public CompositeDiagram(Diagram diagram) {
super(diagram.layout, diagram.interactables);
super(diagram.layout, diagram.slotInsertions, diagram.interactables);
}

@Override
Expand All @@ -40,6 +41,13 @@ public Iterable<Interactable> interactables(DiagramState diagramState) {
return Iterables.concat(iterables);
}

@Override
public Dimension dimension(DiagramState diagramState) {
return activeDiagrams(diagramState).stream()
.map(diagram -> diagram.dimension(diagramState))
.reduce(super.dimension(diagramState), Dimension::max);
}

@Override
public void drawBackground(DiagramState diagramState) {
super.drawBackground(diagramState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.github.dcysteine.neicustomdiagram.api.diagram.matcher.DiagramMatcher;
import com.google.common.collect.ImmutableMap;

import java.util.Collection;
import java.util.Map;
import java.util.function.Supplier;

Expand All @@ -30,20 +31,20 @@ public class CustomDiagramGroup extends DiagramGroup {
* <p>To avoid collisions with any other NEI handlers, it is strongly recommended that the
* diagram group's group ID be a prefix of all custom behavior IDs.
*/
private final ImmutableMap<String, Supplier<Iterable<Diagram>>> customBehaviorMap;
private final ImmutableMap<String, Supplier<Collection<Diagram>>> customBehaviorMap;

public CustomDiagramGroup(
DiagramGroupInfo info, DiagramMatcher matcher,
Supplier<DiagramState> diagramStateSupplier,
Map<String, Supplier<Iterable<Diagram>>> customBehaviorMap) {
Map<String, Supplier<Collection<Diagram>>> customBehaviorMap) {
super(info, matcher, diagramStateSupplier);

this.customBehaviorMap = ImmutableMap.copyOf(customBehaviorMap);
}

public CustomDiagramGroup(
DiagramGroupInfo info, DiagramMatcher matcher,
Map<String, Supplier<Iterable<Diagram>>> customBehaviorMap) {
Map<String, Supplier<Collection<Diagram>>> customBehaviorMap) {
super(info, matcher);

this.customBehaviorMap = ImmutableMap.copyOf(customBehaviorMap);
Expand All @@ -61,12 +62,12 @@ public CustomDiagramGroup newInstance(Iterable<? extends Diagram> diagrams) {
}

@Override
public DiagramGroup loadDiagrams(
protected Collection<Diagram> matchDiagrams(
String id, Interactable.RecipeType recipeType, Object... stacks) {
if (customBehaviorMap.containsKey(id)) {
return newInstance(customBehaviorMap.get(id).get());
return customBehaviorMap.get(id).get();
}

return super.loadDiagrams(id, recipeType, stacks);
return super.matchDiagrams(id, recipeType, stacks);
}
}
Loading

0 comments on commit 4472152

Please sign in to comment.