mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 10:24:41 +00:00
Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee3d685a14 | ||
|
|
47951372cb | ||
|
|
7834d72ecf | ||
|
|
3ced04b4d3 | ||
|
|
75c02f0357 | ||
|
|
51ea8bba34 | ||
|
|
b0c6f358f7 | ||
|
|
c73edaa72e | ||
|
|
caebccc1fd | ||
|
|
a0c5ea42b9 | ||
|
|
23d4be06e8 | ||
|
|
1e36822fa4 | ||
|
|
3ce702343d | ||
|
|
a3387f0290 | ||
|
|
116b96f67b | ||
|
|
60fe49d18c | ||
|
|
cab0aff563 | ||
|
|
144a37cebb |
No files matched your search
@@ -43,3 +43,9 @@ jobs:
|
||||
prerelease: false
|
||||
title: "${{ env.RELEASE_VERSION }}"
|
||||
files: build/libs/*.jar
|
||||
|
||||
- name: Publish to Maven
|
||||
run: ./gradlew publish
|
||||
env:
|
||||
MAVEN_USER: ${{ secrets.MAVEN_USER }}
|
||||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
||||
@@ -0,0 +1,3 @@
|
||||
# Any Github changes require admin approval
|
||||
/.github/** @GTNewHorizons/admin
|
||||
|
||||
+89
-24
@@ -1,9 +1,9 @@
|
||||
//version: 8fa7883b6196c1765266f4e6ddf3118d5043aafb
|
||||
//version: 1642872913
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
Please check https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle for updates.
|
||||
Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates.
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,16 +32,18 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4'
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.5'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'scala'
|
||||
id("org.ajoberstar.grgit") version("3.1.1")
|
||||
id("com.github.johnrengelman.shadow") version("4.0.4")
|
||||
id("com.palantir.git-version") version("0.12.3")
|
||||
id('de.undercouch.download') version('4.1.2')
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
@@ -88,6 +90,7 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly")
|
||||
checkPropertyExists("usesShadowedDependencies")
|
||||
checkPropertyExists("developmentEnvironmentUserName")
|
||||
|
||||
boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false
|
||||
|
||||
String javaSourceDir = "src/main/java/"
|
||||
String scalaSourceDir = "src/main/scala/"
|
||||
@@ -151,12 +154,16 @@ configurations.all {
|
||||
|
||||
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
|
||||
'git config core.fileMode false'.execute()
|
||||
// Pulls version from git tag
|
||||
|
||||
// Pulls version first from the VERSION env and then git tag
|
||||
String identifiedVersion
|
||||
try {
|
||||
version = minecraftVersion + "-" + gitVersion()
|
||||
String versionOverride = System.getenv("VERSION") ?: null
|
||||
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
|
||||
version = minecraftVersion + "-" + identifiedVersion
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!");
|
||||
throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag, or the VERSION override must be set!");
|
||||
}
|
||||
|
||||
group = modGroup
|
||||
@@ -223,7 +230,7 @@ dependencies {
|
||||
annotationProcessor("com.google.code.gson:gson:2.8.6")
|
||||
annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT")
|
||||
// using 0.8 to workaround a issue in 0.7 which fails mixin application
|
||||
compile("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
|
||||
compile("com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH") {
|
||||
// Mixin includes a lot of dependencies that are too up-to-date
|
||||
exclude module: "launchwrapper"
|
||||
exclude module: "guava"
|
||||
@@ -231,7 +238,7 @@ dependencies {
|
||||
exclude module: "commons-io"
|
||||
exclude module: "log4j-core"
|
||||
}
|
||||
compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
|
||||
compile("com.github.GTNewHorizons:SpongeMixins:1.5.0")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,40 +487,63 @@ task apiJar(type: Jar) {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
if(!noPublishedSources) {
|
||||
archives sourcesJar
|
||||
}
|
||||
archives devJar
|
||||
if(apiPackage) {
|
||||
archives apiJar
|
||||
}
|
||||
}
|
||||
|
||||
// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID),
|
||||
// and isn't strictly needed with the POM so just disable it.
|
||||
tasks.withType(GenerateModuleMetadata) {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
|
||||
// publishing
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
artifact source: jar
|
||||
artifact source: sourcesJar, classifier: "src"
|
||||
artifact source: devJar, classifier: "dev"
|
||||
from components.java
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
artifact source: shadowJar, classifier: ""
|
||||
}
|
||||
if(!noPublishedSources) {
|
||||
artifact source: sourcesJar, classifier: "src"
|
||||
}
|
||||
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
|
||||
if (apiPackage) {
|
||||
artifact source: apiJar, classifier: "api"
|
||||
}
|
||||
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: group
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
|
||||
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
|
||||
version = System.getenv("ARTIFACT_VERSION") ?: project.version
|
||||
// Using the identified version, not project.version as it has the prepended 1.7.10
|
||||
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
|
||||
|
||||
// Remove all non GTNH deps here.
|
||||
// Original intention was to remove an invalid forgeBin being generated without a groupId (mandatory), but
|
||||
// it also removes all of the MC deps
|
||||
pom.withXml {
|
||||
Node pomNode = asNode()
|
||||
pomNode.dependencies.'*'.findAll() {
|
||||
it.groupId.text() != 'com.github.GTNewHorizons'
|
||||
}.each() {
|
||||
it.parent().remove(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown"
|
||||
String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown"
|
||||
String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName"
|
||||
name = "GitHubPackages"
|
||||
url = githubRepositoryUrl
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_ACTOR") ?: "NONE"
|
||||
password = System.getenv("GITHUB_TOKEN") ?: "NONE"
|
||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -537,7 +567,7 @@ if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
|
||||
}
|
||||
|
||||
static URL availableBuildScriptUrl() {
|
||||
new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle")
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle")
|
||||
}
|
||||
|
||||
boolean performBuildScriptUpdate(String projectDir) {
|
||||
@@ -575,11 +605,46 @@ configure(updateBuildScript) {
|
||||
description = 'Updates the build script to the latest version'
|
||||
}
|
||||
|
||||
// Deobfuscation
|
||||
|
||||
def deobf(String sourceURL, String fileName) {
|
||||
def bon2File = "$projectDir/deobf/BON2-2.5.0.jar"
|
||||
def cacheFile = "$projectDir/deobf/out/" + fileName + ".jar"
|
||||
def deobfFile = "$projectDir/deobf/out/" + fileName + "-deobf.jar"
|
||||
|
||||
if(file(deobfFile).exists()) {
|
||||
return files(deobfFile)
|
||||
}
|
||||
|
||||
download {
|
||||
src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar'
|
||||
dest bon2File
|
||||
quiet true
|
||||
overwrite false
|
||||
}
|
||||
|
||||
download {
|
||||
src sourceURL
|
||||
dest cacheFile
|
||||
quiet true
|
||||
overwrite false
|
||||
}
|
||||
|
||||
exec {
|
||||
commandLine 'java', '-jar', bon2File, '--inputJar', cacheFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch'
|
||||
workingDir "$projectDir/deobf"
|
||||
standardOutput = new ByteArrayOutputStream()
|
||||
}
|
||||
|
||||
delete(cacheFile)
|
||||
return files(deobfFile)
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
|
||||
def checkPropertyExists(String propertyName) {
|
||||
if (project.hasProperty(propertyName) == false) {
|
||||
throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties")
|
||||
throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile("com.github.GTNewHorizons:CodeChickenLib:master-SNAPSHOT:dev")
|
||||
compile("com.github.GTNewHorizons:CodeChickenCore:master-SNAPSHOT:dev")
|
||||
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev")
|
||||
compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev")
|
||||
shadowImplementation("org.apache.commons:commons-csv:1.5")
|
||||
}
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "GTNH Maven"
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
}
|
||||
maven {
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import codechicken.core.CommonUtils;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.util.NBTJson;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
@@ -21,6 +22,10 @@ import java.awt.Point;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -30,6 +35,7 @@ import java.util.HashMap;
|
||||
public class BookmarkPanel extends ItemPanel
|
||||
{
|
||||
|
||||
protected File bookmarkFile;
|
||||
protected boolean bookmarksIsLoaded = false;
|
||||
public int sortedStackIndex = -1;
|
||||
public int sortedNamespaceIndex = -1;
|
||||
@@ -281,15 +287,11 @@ public class BookmarkPanel extends ItemPanel
|
||||
for (PositionedStack stack : ingredients) {
|
||||
final NBTTagCompound nbTag = StackInfo.itemStackToNBT(stack.item, saveStackSize);
|
||||
|
||||
if (nbTag.getInteger("Count") > 0) {
|
||||
|
||||
if (unique.get(nbTag) == null) {
|
||||
unique.put(nbTag, 1);
|
||||
sorted.add(nbTag);
|
||||
} else if (saveStackSize) {
|
||||
unique.put(nbTag, unique.get(nbTag) + 1);
|
||||
}
|
||||
|
||||
if (unique.get(nbTag) == null) {
|
||||
unique.put(nbTag, 1);
|
||||
sorted.add(nbTag);
|
||||
} else if (saveStackSize) {
|
||||
unique.put(nbTag, unique.get(nbTag) + 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -407,6 +409,43 @@ public class BookmarkPanel extends ItemPanel
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setBookmarkFile(String worldPath)
|
||||
{
|
||||
|
||||
final File dir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + worldPath);
|
||||
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
bookmarkFile = new File(dir, "bookmarks.ini");
|
||||
|
||||
if (!bookmarkFile.exists()) {
|
||||
final File globalBookmarks = new File(CommonUtils.getMinecraftDir(), "saves/NEI/global/bookmarks.ini");
|
||||
final File configBookmarks = new File(NEIClientConfig.configDir, "bookmarks.ini");
|
||||
final File defaultBookmarks = configBookmarks.exists()? configBookmarks: globalBookmarks;
|
||||
|
||||
if (defaultBookmarks.exists()) {
|
||||
|
||||
try {
|
||||
bookmarkFile.createNewFile();
|
||||
|
||||
InputStream src = new FileInputStream(defaultBookmarks);
|
||||
OutputStream dst = new FileOutputStream(bookmarkFile);
|
||||
|
||||
IOUtils.copy(src, dst);
|
||||
|
||||
src.close();
|
||||
dst.close();
|
||||
|
||||
} catch(IOException e) {}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bookmarksIsLoaded = false;
|
||||
}
|
||||
|
||||
public void saveBookmarks()
|
||||
{
|
||||
@@ -448,12 +487,11 @@ public class BookmarkPanel extends ItemPanel
|
||||
|
||||
}
|
||||
|
||||
File file = NEIClientConfig.bookmarkFile;
|
||||
if (file != null) {
|
||||
try(FileWriter writer = new FileWriter(file)) {
|
||||
if (bookmarkFile != null) {
|
||||
try(FileWriter writer = new FileWriter(bookmarkFile)) {
|
||||
IOUtils.writeLines(strings, "\n", writer);
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Filed to save bookmarks list to file {}", file, e);
|
||||
NEIClientConfig.logger.error("Filed to save bookmarks list to file {}", bookmarkFile, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,17 +506,16 @@ public class BookmarkPanel extends ItemPanel
|
||||
|
||||
bookmarksIsLoaded = true;
|
||||
|
||||
File file = NEIClientConfig.bookmarkFile;
|
||||
if (file == null || !file.exists()) {
|
||||
if (bookmarkFile == null || !bookmarkFile.exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> itemStrings;
|
||||
try (FileReader reader = new FileReader(file)) {
|
||||
NEIClientConfig.logger.info("Loading bookmarks from file {}", file);
|
||||
try (FileReader reader = new FileReader(bookmarkFile)) {
|
||||
NEIClientConfig.logger.info("Loading bookmarks from file {}", bookmarkFile);
|
||||
itemStrings = IOUtils.readLines(reader);
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Failed to load bookmarks from file {}", file, e);
|
||||
NEIClientConfig.logger.error("Failed to load bookmarks from file {}", bookmarkFile, e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -185,13 +185,13 @@ public class ItemList
|
||||
@SuppressWarnings("unchecked")
|
||||
public void execute() {
|
||||
// System.out.println("Executing NEI Item Loading");
|
||||
ThreadOperationTimer timer = getTimer(500);
|
||||
ThreadOperationTimer timer = getTimer(NEIClientConfig.getItemLoadingTimeout());
|
||||
|
||||
LinkedList<ItemStack> items = new LinkedList<>();
|
||||
LinkedList<ItemStack> permutations = new LinkedList<>();
|
||||
ListMultimap<Item, ItemStack> itemMap = ArrayListMultimap.create();
|
||||
|
||||
timer.setLimit(500);
|
||||
timer.setLimit(NEIClientConfig.getItemLoadingTimeout());
|
||||
for (Item item : (Iterable<Item>) Item.itemRegistry) {
|
||||
if (interrupted()) return;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.KeyManager.IKeyStateTracker;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.GuiInfo;
|
||||
import codechicken.nei.api.INEIGuiHandler;
|
||||
import codechicken.nei.api.IRecipeOverlayRenderer;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.api.LayoutStyle;
|
||||
@@ -16,7 +15,7 @@ import codechicken.nei.guihook.IContainerInputHandler;
|
||||
import codechicken.nei.guihook.IContainerObjectHandler;
|
||||
import codechicken.nei.guihook.IContainerTooltipHandler;
|
||||
import codechicken.nei.recipe.GuiRecipeTab;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import codechicken.nei.recipe.RecipeCatalysts;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
@@ -63,7 +62,6 @@ import static codechicken.nei.NEIClientUtils.getNextGamemode;
|
||||
import static codechicken.nei.NEIClientUtils.healPlayer;
|
||||
import static codechicken.nei.NEIClientUtils.isValidGamemode;
|
||||
import static codechicken.nei.NEIClientUtils.setHourForward;
|
||||
import static codechicken.nei.NEIClientUtils.setItemQuantity;
|
||||
import static codechicken.nei.NEIClientUtils.shiftKey;
|
||||
import static codechicken.nei.NEIClientUtils.toggleMagnetMode;
|
||||
import static codechicken.nei.NEIClientUtils.toggleRaining;
|
||||
@@ -360,6 +358,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
} else {
|
||||
if (Keyboard.getEventKeyState() && (Keyboard.getEventKey() == Keyboard.KEY_LSHIFT || Keyboard.getEventKey() == Keyboard.KEY_RSHIFT)) {
|
||||
GuiRecipeTab.loadHandlerInfo();
|
||||
RecipeCatalysts.loadCatalystInfo();
|
||||
}
|
||||
getOptionList().openGui(getGuiContainer(), false);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ import codechicken.nei.config.OptionUtilities;
|
||||
import codechicken.nei.event.NEIConfigsLoadedEvent;
|
||||
import codechicken.nei.recipe.GuiRecipeTab;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
import codechicken.nei.recipe.RecipeCatalysts;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import codechicken.obfuscator.ObfuscationRun;
|
||||
import com.google.common.base.Objects;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -53,6 +53,7 @@ import java.util.regex.Pattern;
|
||||
public class NEIClientConfig {
|
||||
private static boolean configLoaded;
|
||||
private static boolean enabledOverride;
|
||||
private static String worldPath;
|
||||
|
||||
public static Logger logger = LogManager.getLogger("NotEnoughItems");
|
||||
public static File configDir = new File(CommonUtils.getMinecraftDir(), "config/NEI/");
|
||||
@@ -60,12 +61,15 @@ public class NEIClientConfig {
|
||||
new File("saves/NEI/client.dat"),
|
||||
new ConfigFile(new File(configDir, "client.cfg")));
|
||||
public static ConfigSet world;
|
||||
public static final File bookmarkFile = new File(configDir, "bookmarks.ini");
|
||||
public static final File handlerFile = new File(configDir, "handlers.csv");
|
||||
public static final File catalystFile = new File(configDir, "catalysts.csv");
|
||||
public static final File serialHandlersFile = new File(configDir, "serialhandlers.cfg");
|
||||
public static final File heightHackHandlersFile = new File(configDir, "heighthackhandlers.cfg");
|
||||
public static final File handlerOrderingFile = new File(configDir, "handlerordering.csv");
|
||||
|
||||
@Deprecated
|
||||
public static File bookmarkFile;
|
||||
|
||||
// Set of handlers that need to be run in serial
|
||||
public static HashSet<String> serialHandlers = new HashSet<>();
|
||||
|
||||
@@ -81,11 +85,9 @@ public class NEIClientConfig {
|
||||
// Function that extracts the handler ID from a handler, with special logic for
|
||||
// TemplateRecipeHandler: prefer using the overlay ID if it exists.
|
||||
public static final Function<IRecipeHandler, String> HANDLER_ID_FUNCTION =
|
||||
handler -> handler instanceof TemplateRecipeHandler
|
||||
? Objects.firstNonNull(
|
||||
((TemplateRecipeHandler) handler).getOverlayIdentifier(),
|
||||
handler.getHandlerId())
|
||||
: handler.getHandlerId();
|
||||
handler -> Objects.firstNonNull(
|
||||
handler.getOverlayIdentifier(),
|
||||
handler.getHandlerId());
|
||||
|
||||
// Comparator that compares handlers using the handlerOrdering map.
|
||||
public static final Comparator<IRecipeHandler> HANDLER_COMPARATOR =
|
||||
@@ -165,6 +167,8 @@ public class NEIClientConfig {
|
||||
return isMouseScrollTransferEnabled();
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("itemLoadingTimeout").getIntValue(500);
|
||||
|
||||
tag.getTag("command.creative").setDefaultValue("/gamemode {0} {1}");
|
||||
API.addOption(new OptionTextField("command.creative"));
|
||||
@@ -177,6 +181,15 @@ public class NEIClientConfig {
|
||||
tag.getTag("command.heal").setDefaultValue("");
|
||||
API.addOption(new OptionTextField("command.heal"));
|
||||
|
||||
tag.getTag("inventory.worldSpecificBookmarks").setComment("Global or world specific bookmarks").getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.worldSpecificBookmarks", true) {
|
||||
@Override
|
||||
public boolean onClick(int button) {
|
||||
super.onClick(button);
|
||||
initBookmarkFile(worldPath);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
tag.getTag("inventory.bookmarksEnabled").setComment("Enable/disable bookmarks").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.bookmarksEnabled", true));
|
||||
tag.getTag("inventory.saveCurrentRecipeInBookmarksEnabled").setComment("Save Current Recipe in Bookmarks").getBooleanValue(true);
|
||||
@@ -188,6 +201,8 @@ public class NEIClientConfig {
|
||||
API.addOption(new OptionToggleButtonBoubs("inventory.jei_style_tabs", true));
|
||||
tag.getTag("inventory.jei_style_item_presence_overlay").setComment("Enable/disable JEI Style item presence overlay on ?-hover").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.jei_style_item_presence_overlay", true));
|
||||
tag.getTag("inventory.jei_style_recipe_catalyst").setComment("Enable/disable JEI Style Recipe Catalysts").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.jei_style_recipe_catalyst", true));
|
||||
|
||||
|
||||
tag.getTag("inventory.creative_tab_style").setComment("Creative or JEI style tabs").getBooleanValue(false);
|
||||
@@ -202,6 +217,17 @@ public class NEIClientConfig {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("tools.catalyst_load_from_config").setComment("ADVANCED: Load catalysts from config").getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("tools.catalyst_load_from_config", true) {
|
||||
@Override
|
||||
public boolean onClick(int button) {
|
||||
super.onClick(button);
|
||||
RecipeCatalysts.loadCatalystInfo();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
setDefaultKeyBindings();
|
||||
}
|
||||
|
||||
@@ -262,17 +288,22 @@ public class NEIClientConfig {
|
||||
return OptionList.getOptionList("nei.options");
|
||||
}
|
||||
|
||||
public static void loadWorld(String saveName) {
|
||||
public static void loadWorld(String worldPath) {
|
||||
NEIClientConfig.worldPath = worldPath;
|
||||
|
||||
setInternalEnabled(true);
|
||||
logger.debug("Loading "+(Minecraft.getMinecraft().isSingleplayer() ? "Local" : "Remote")+" World");
|
||||
bootNEI(ClientUtils.getWorld());
|
||||
|
||||
File saveDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + saveName);
|
||||
boolean newWorld = !saveDir.exists();
|
||||
if (newWorld)
|
||||
saveDir.mkdirs();
|
||||
final File specificDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + worldPath);
|
||||
final boolean newWorld = !specificDir.exists();
|
||||
|
||||
world = new ConfigSet(new File(saveDir, "NEI.dat"), new ConfigFile(new File(saveDir, "NEI.cfg")));
|
||||
if (newWorld) {
|
||||
specificDir.mkdirs();
|
||||
}
|
||||
|
||||
initBookmarkFile(worldPath);
|
||||
world = new ConfigSet(new File(specificDir, "NEI.dat"), new ConfigFile(new File(specificDir, "NEI.cfg")));
|
||||
onWorldLoad(newWorld);
|
||||
}
|
||||
|
||||
@@ -317,6 +348,7 @@ public class NEIClientConfig {
|
||||
RecipeInfo.load();
|
||||
LayoutManager.load();
|
||||
NEIController.load();
|
||||
RecipeCatalysts.loadCatalystInfo();
|
||||
|
||||
configLoaded = true;
|
||||
|
||||
@@ -344,6 +376,16 @@ public class NEIClientConfig {
|
||||
ItemSorter.loadConfig();
|
||||
}
|
||||
|
||||
private static void initBookmarkFile(String worldPath)
|
||||
{
|
||||
|
||||
if (!global.config.getTag("inventory.worldSpecificBookmarks").getBooleanValue()) {
|
||||
worldPath = "global";
|
||||
}
|
||||
|
||||
ItemPanels.bookmarkPanel.setBookmarkFile(worldPath);
|
||||
}
|
||||
|
||||
public static boolean isWorldSpecific(String setting) {
|
||||
if(world == null) return false;
|
||||
ConfigTag tag = world.config.getTag(setting, false);
|
||||
@@ -376,6 +418,9 @@ public class NEIClientConfig {
|
||||
public static boolean isJEIStyleItemPresenceOverlayVisible() {
|
||||
return getBooleanSetting("inventory.jei_style_item_presence_overlay");
|
||||
}
|
||||
public static boolean areJEIStyleRecipeCatalystsVisible() {
|
||||
return getBooleanSetting("inventory.jei_style_recipe_catalyst");
|
||||
}
|
||||
public static boolean useCreativeTabStyle() {
|
||||
return getBooleanSetting("inventory.creative_tab_style");
|
||||
}
|
||||
@@ -385,6 +430,9 @@ public class NEIClientConfig {
|
||||
public static boolean loadHandlersFromJar() {
|
||||
return !getBooleanSetting("tools.handler_load_from_config");
|
||||
}
|
||||
public static boolean loadCatalystsFromJar() {
|
||||
return !getBooleanSetting("tools.catalyst_load_from_config");
|
||||
}
|
||||
|
||||
public static void setEnabled(boolean flag) {
|
||||
getSetting("inventory.widgetsenabled").setBooleanValue(flag);
|
||||
@@ -419,6 +467,10 @@ public class NEIClientConfig {
|
||||
int i = getIntSetting("inventory.itemIDs");
|
||||
return i == 2 || (i == 1 && isEnabled() && !isHidden());
|
||||
}
|
||||
|
||||
public static int getItemLoadingTimeout() {
|
||||
return getIntSetting("itemLoadingTimeout");
|
||||
}
|
||||
|
||||
public static void toggleBooleanSetting(String setting) {
|
||||
ConfigTag tag = getSetting(setting);
|
||||
|
||||
@@ -6,13 +6,13 @@ import codechicken.nei.api.IConfigureNEI;
|
||||
import codechicken.nei.asm.NEICorePlugin;
|
||||
import codechicken.nei.config.IMCHandler;
|
||||
import codechicken.nei.recipe.GuiRecipeTab;
|
||||
import codechicken.nei.recipe.RecipeCatalysts;
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import cpw.mods.fml.client.FMLFileResourcePack;
|
||||
import cpw.mods.fml.client.FMLFolderResourcePack;
|
||||
import cpw.mods.fml.common.DummyModContainer;
|
||||
import cpw.mods.fml.common.LoadController;
|
||||
import cpw.mods.fml.common.MetadataCollection;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
@@ -107,6 +107,7 @@ public class NEIModContainer extends DummyModContainer
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (CommonUtils.isClient()) {
|
||||
GuiRecipeTab.loadHandlerInfo();
|
||||
RecipeCatalysts.loadCatalystInfo();
|
||||
ClientHandler.postInit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import codechicken.core.ServerUtils;
|
||||
import codechicken.lib.inventory.InventoryRange;
|
||||
import codechicken.lib.inventory.InventoryUtils;
|
||||
import codechicken.lib.packet.PacketCustom;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -14,6 +16,9 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.JsonToNBT;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTException;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -24,6 +29,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.WorldSettings.GameType;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -387,6 +393,50 @@ public class NEIServerUtils
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack getModdedItem(String itemId, String nbtString) {
|
||||
int meta = -1;
|
||||
ItemStack itemStack;
|
||||
|
||||
if (!itemId.contains(":")) {
|
||||
NEIClientConfig.logger.info(String.format("Item ID %s is missing colon", itemId));
|
||||
return null;
|
||||
}
|
||||
final String[] split = itemId.split(":");
|
||||
// ModID:ItemID
|
||||
String itemLookupId = split[0] + ":" + split[1];
|
||||
|
||||
if (split.length >= 3) {
|
||||
int mIdx = -1;
|
||||
if (split[2].matches("\\d+")) {
|
||||
mIdx = 2;
|
||||
} else {
|
||||
itemLookupId += ":" + split[2];
|
||||
if (split.length >= 4) mIdx = 3;
|
||||
}
|
||||
if (mIdx != -1) meta = Integer.parseInt(split[mIdx]);
|
||||
}
|
||||
|
||||
if (meta != -1) {
|
||||
itemStack = GameRegistry.makeItemStack(itemLookupId, meta, 1, nbtString == null ? "" : nbtString);
|
||||
} else {
|
||||
itemStack = GameRegistry.findItemStack(split[0], split[1], 1);
|
||||
if (nbtString != null && !nbtString.isEmpty()) {
|
||||
try {
|
||||
final NBTBase nbttag = JsonToNBT.func_150315_a(nbtString);
|
||||
if (!(nbttag instanceof NBTTagCompound)) {
|
||||
NEIClientConfig.logger.info("Unexpected NBT string - multiple values {}", nbtString);
|
||||
return null;
|
||||
}
|
||||
itemStack.setTagCompound((NBTTagCompound) nbttag);
|
||||
} catch (NBTException e) {
|
||||
FMLLog.getLogger().log(Level.WARN, "Encountered an exception parsing ItemStack NBT string {}", nbtString, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public static NBTTagCompound readNBT(File file) throws IOException {
|
||||
if(!file.exists()) return null;
|
||||
FileInputStream in = new FileInputStream(file);
|
||||
@@ -408,4 +458,8 @@ public class NEIServerUtils
|
||||
CompressedStreamTools.writeCompressed(tag, out);
|
||||
out.close();
|
||||
}
|
||||
|
||||
public static int divideCeil(int numerator, int denominator) {
|
||||
return (int) Math.ceil((float) numerator / denominator);
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,13 @@ import codechicken.nei.SubsetWidget.SubsetTag;
|
||||
import codechicken.nei.api.ItemFilter.ItemFilterProvider;
|
||||
import codechicken.nei.config.Option;
|
||||
import codechicken.nei.config.OptionKeyBind;
|
||||
import codechicken.nei.recipe.CatalystInfo;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.ICraftingHandler;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
import codechicken.nei.recipe.IUsageHandler;
|
||||
import codechicken.nei.recipe.RecipeCatalysts;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -30,6 +33,7 @@ import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This is the main class that handles item property configuration.
|
||||
@@ -291,4 +295,72 @@ public class API
|
||||
StackInfo.stackStringifyHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an association between an ingredient and what it can craft. (i.e. Furnace ItemStack -> Smelting and Fuel Recipes)
|
||||
* Allows players to see what ingredient they need to craft in order to make recipes from a recipe category.
|
||||
* @param stack the ingredient that can craft recipes (like a furnace or crafting table)
|
||||
* @param handler the recipe category handled by the ingredient
|
||||
* @param priority higher priority comes first, default to 0
|
||||
*/
|
||||
public static void addRecipeCatalyst(ItemStack stack, IRecipeHandler handler, int priority) {
|
||||
String handlerID = RecipeCatalysts.getRecipeID(handler);
|
||||
addRecipeCatalyst(stack, handlerID, priority);
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link API#addRecipeCatalyst(ItemStack, IRecipeHandler, int)}
|
||||
*/
|
||||
public static void addRecipeCatalyst(ItemStack stack, IRecipeHandler handler) {
|
||||
addRecipeCatalyst(stack, handler, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an association between an ingredient and what it can craft. (i.e. Furnace ItemStack -> Smelting and Fuel Recipes)
|
||||
* Allows players to see what ingredient they need to craft in order to make recipes from a recipe category.
|
||||
* @param stack the ingredient that can craft recipes (like a furnace or crafting table)
|
||||
* @param handlerID recipe category identifier (see also {@link RecipeCatalysts#getRecipeID(IRecipeHandler)})
|
||||
* @param priority higher priority comes first, default to 0
|
||||
*/
|
||||
public static void addRecipeCatalyst(ItemStack stack, String handlerID, int priority) {
|
||||
RecipeCatalysts.addRecipeCatalyst(handlerID, new CatalystInfo(stack, priority));
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link API#addRecipeCatalyst(ItemStack, String, int)}
|
||||
*/
|
||||
public static void addRecipeCatalyst(ItemStack stack, String handlerID) {
|
||||
addRecipeCatalyst(stack, handlerID, 0);
|
||||
}
|
||||
|
||||
public static void removeRecipeCatalyst(ItemStack stack, IRecipeHandler handler) {
|
||||
String handlerID = RecipeCatalysts.getRecipeID(handler);
|
||||
removeRecipeCatalyst(stack, handlerID);
|
||||
}
|
||||
|
||||
public static void removeRecipeCatalyst(ItemStack stack, String handlerID) {
|
||||
RecipeCatalysts.removeRecipeCatalyst(handlerID, stack);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRecipeCatalyst(List<ItemStack> stacks, IRecipeHandler handler) {
|
||||
for (ItemStack stack : stacks) {
|
||||
addRecipeCatalyst(stack, handler);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRecipeCatalyst(List<ItemStack> stacks, String handlerID) {
|
||||
for (ItemStack stack : stacks) {
|
||||
addRecipeCatalyst(stack, handlerID);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRecipeCatalyst(ItemStack stack, Class<? extends IRecipeHandler> handler) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRecipeCatalyst(List<ItemStack> stacks, Class<? extends IRecipeHandler> handler) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,11 +3,11 @@ package codechicken.nei.api;
|
||||
import codechicken.nei.NEIChestGuiHandler;
|
||||
import codechicken.nei.NEICreativeGuiHandler;
|
||||
import codechicken.nei.NEIDummySlotHandler;
|
||||
import codechicken.nei.recipe.GuiRecipeCatalyst;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiContainerCreative;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
@@ -24,6 +24,7 @@ public class GuiInfo {
|
||||
API.registerNEIGuiHandler(new NEICreativeGuiHandler());
|
||||
API.registerNEIGuiHandler(new NEIChestGuiHandler());
|
||||
API.registerNEIGuiHandler(new NEIDummySlotHandler());
|
||||
API.registerNEIGuiHandler(new GuiRecipeCatalyst(null));
|
||||
customSlotGuis.add(GuiContainerCreative.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package codechicken.nei.asm;
|
||||
|
||||
import codechicken.lib.asm.ASMHelper;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import static org.objectweb.asm.Opcodes.POP;
|
||||
import static org.objectweb.asm.Opcodes.PUTSTATIC;
|
||||
|
||||
public class GuiContainerManagerAPITransformer extends ClassVisitor {
|
||||
private final String tname;
|
||||
private boolean changed = false;
|
||||
|
||||
public GuiContainerManagerAPITransformer(int api, ClassVisitor cv, String tname) {
|
||||
super(api, cv);
|
||||
this.tname = tname;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String mname, String mdesc, String signature, String[] exceptions) {
|
||||
return new MethodVisitor(api, super.visitMethod(access, mname, mdesc, signature, exceptions)) {
|
||||
@Override
|
||||
public void visitFieldInsn(int opcode, String owner, String name, String desc) {
|
||||
if (opcode == PUTSTATIC && "codechicken/nei/guihook/GuiContainerManager".equals(owner) && name.endsWith("Handlers") && desc.equals("Ljava/util/LinkedList;")) {
|
||||
ASMHelper.logger.warn("Found suspicious PUTSTATIC {} in {}#{}{}, replacing with POP!", name, tname, mname, mdesc);
|
||||
changed = true;
|
||||
super.visitInsn(POP);
|
||||
} else {
|
||||
super.visitFieldInsn(opcode, owner, name, desc);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public boolean isChanged() {
|
||||
return changed;
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ public class NEITransformer implements IClassTransformer
|
||||
ASMInit.init();
|
||||
}
|
||||
|
||||
private final boolean paranoidMode = Boolean.getBoolean("nei.paranoid");
|
||||
private final ModularASMTransformer transformer = new ModularASMTransformer();
|
||||
private final Map<String, ASMBlock> asmblocks = ASMReader.loadResource("/assets/nei/asm/blocks.asm");
|
||||
|
||||
@@ -264,6 +265,14 @@ public class NEITransformer implements IClassTransformer
|
||||
}
|
||||
bytes = transformSubclasses(name, bytes);
|
||||
}
|
||||
if (paranoidMode && !tname.startsWith("codechicken.nei")) {
|
||||
ClassReader cr = new ClassReader(bytes);
|
||||
ClassWriter cw = new ClassWriter(0);
|
||||
GuiContainerManagerAPITransformer cv = new GuiContainerManagerAPITransformer(ASM5, cw, tname);
|
||||
cr.accept(cv, ClassReader.SKIP_DEBUG);
|
||||
if (cv.isChanged())
|
||||
bytes = cw.toByteArray();
|
||||
}
|
||||
|
||||
bytes = transformer.transform(name, bytes);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package codechicken.nei.drawable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
/*
|
||||
* Taken from Mantle 1.12-1.3.3.49 under the MIT License
|
||||
*
|
||||
* The MIT License (MIT) Copyright (c) 2013-2014 Slime Knights (mDiyo, fuj1n, Sunstrike, progwml6, pillbox, alexbegt)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiElementDuex {
|
||||
|
||||
// this is totally completely ugly but it's a simple solution that doesn't clutter everything too much >_>
|
||||
public static int defaultTexW = 256;
|
||||
public static int defaultTexH = 256;
|
||||
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int w;
|
||||
public final int h;
|
||||
|
||||
public int texW;
|
||||
public int texH;
|
||||
|
||||
public GuiElementDuex(int x, int y, int w, int h, int texW, int texH) {
|
||||
this(x, y, w, h);
|
||||
setTextureSize(texW, texH);
|
||||
|
||||
defaultTexW = texW;
|
||||
defaultTexH = texH;
|
||||
}
|
||||
|
||||
public GuiElementDuex(int x, int y, int w, int h) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.w = w;
|
||||
this.h = h;
|
||||
setTextureSize(defaultTexW, defaultTexH);
|
||||
}
|
||||
|
||||
public GuiElementDuex setTextureSize(int w, int h) {
|
||||
texW = w;
|
||||
texH = h;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public GuiElementDuex shift(int xd, int yd) {
|
||||
return new GuiElementDuex(this.x + xd, this.y + yd, this.w, this.h, this.texW, this.texH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the element at the given x/y coordinates
|
||||
*
|
||||
* @param xPos X-Coordinate on the screen
|
||||
* @param yPos Y-Coordinate on the screen
|
||||
*/
|
||||
public int draw(int xPos, int yPos) {
|
||||
// drawModalRectWithCustomSizedTexture
|
||||
GuiScreen.func_146110_a(xPos, yPos, x, y, w, h, texW, texH);
|
||||
return w;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
public int w;
|
||||
public int h;
|
||||
|
||||
public Builder(int w, int h) {
|
||||
this.w = w;
|
||||
this.h = h;
|
||||
}
|
||||
|
||||
public GuiElementDuex get(int x, int y, int w, int h) {
|
||||
return new GuiElementDuex(x, y, w, h, this.w, this.h);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package codechicken.nei.drawable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
/*
|
||||
* Taken from Mantle 1.12-1.3.3.49 under the MIT License
|
||||
*
|
||||
* The MIT License (MIT) Copyright (c) 2013-2014 Slime Knights (mDiyo, fuj1n, Sunstrike, progwml6, pillbox, alexbegt)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiElementScalable extends GuiElementDuex {
|
||||
|
||||
public GuiElementScalable(int x, int y, int w, int h, int texW, int texH) {
|
||||
super(x, y, w, h, texW, texH);
|
||||
}
|
||||
|
||||
public GuiElementScalable(int x, int y, int w, int h) {
|
||||
super(x, y, w, h);
|
||||
}
|
||||
|
||||
public int drawScaledX(int xPos, int yPos, int width) {
|
||||
for(int i = 0; i < width / w; i++) {
|
||||
draw(xPos + i * w, yPos);
|
||||
}
|
||||
// remainder that doesn't fit total width
|
||||
int remainder = width % w;
|
||||
if(remainder > 0) {
|
||||
GuiScreen.func_146110_a(xPos + width - remainder, yPos, x, y, remainder, h, texW, texH);
|
||||
}
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
public int drawScaledY(int xPos, int yPos, int height) {
|
||||
for(int i = 0; i < height / h; i++) {
|
||||
draw(xPos, yPos + i * h);
|
||||
}
|
||||
// remainder that doesn't fit total width
|
||||
int remainder = height % h;
|
||||
if(remainder > 0) {
|
||||
// drawModalRectWithCustomSizedTexture
|
||||
GuiScreen.func_146110_a(xPos, yPos + height - remainder, x, y, w, remainder, texW, texH);
|
||||
}
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
public int drawScaled(int xPos, int yPos, int width, int height) {
|
||||
// we draw full height row-wise
|
||||
int full = height / this.h;
|
||||
for(int i = 0; i < full; i++) {
|
||||
drawScaledX(xPos, yPos + i * this.h, width);
|
||||
}
|
||||
|
||||
yPos += full * this.h;
|
||||
|
||||
// and the remainder is drawn manually
|
||||
int yRest = height % this.h;
|
||||
// the same as drawScaledX but with the remaining height
|
||||
for(int i = 0; i < width / w; i++) {
|
||||
drawScaledY(xPos + i * w, yPos, yRest);
|
||||
}
|
||||
// remainder that doesn't fit total width
|
||||
int remainder = width % w;
|
||||
if(remainder > 0) {
|
||||
// drawModalRectWithCustomSizedTexture
|
||||
GuiScreen.func_146110_a(xPos + width - remainder, yPos, x, y, remainder, yRest, texW, texH);
|
||||
}
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiElementScalable shift(int xd, int yd) {
|
||||
GuiElementScalable element = new GuiElementScalable(this.x + xd, this.y + yd, this.w, this.h);
|
||||
element.setTextureSize(texW, texH);
|
||||
return element;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawMultilineTip;
|
||||
@@ -35,11 +36,11 @@ public class GuiContainerManager
|
||||
public GuiContainer window;
|
||||
|
||||
public static RenderItem drawItems = new RenderItem();
|
||||
public static LinkedList<IContainerTooltipHandler> tooltipHandlers = new LinkedList<>();
|
||||
public static LinkedList<IContainerInputHandler> inputHandlers = new LinkedList<>();
|
||||
public static LinkedList<IContainerDrawHandler> drawHandlers = new LinkedList<>();
|
||||
public static LinkedList<IContainerObjectHandler> objectHandlers = new LinkedList<>();
|
||||
public static LinkedList<IContainerSlotClickHandler> slotClickHandlers = new LinkedList<>();
|
||||
public static final LinkedList<IContainerTooltipHandler> tooltipHandlers = new HideousLinkedList<>(new CopyOnWriteArrayList<>());
|
||||
public static final LinkedList<IContainerInputHandler> inputHandlers = new HideousLinkedList<>(new CopyOnWriteArrayList<>());
|
||||
public static final LinkedList<IContainerDrawHandler> drawHandlers = new HideousLinkedList<>(new CopyOnWriteArrayList<>());
|
||||
public static final LinkedList<IContainerObjectHandler> objectHandlers = new HideousLinkedList<>(new CopyOnWriteArrayList<>());
|
||||
public static final LinkedList<IContainerSlotClickHandler> slotClickHandlers = new HideousLinkedList<>(new CopyOnWriteArrayList<>());
|
||||
|
||||
static {
|
||||
addSlotClickHandler(new DefaultSlotClickHandler());
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
package codechicken.nei.guihook;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.UnaryOperator;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* A hideous LinkedList that is backed by an arbitrary list, for alternative characteristics while preserving
|
||||
* binary compatibility...
|
||||
* @param <E>
|
||||
*/
|
||||
final class HideousLinkedList<E> extends LinkedList<E> {
|
||||
private final List<E> backing;
|
||||
|
||||
HideousLinkedList(List<E> backing) {
|
||||
this.backing = backing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return backing.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return backing.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
return backing.contains(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return backing.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
return backing.toArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T[] toArray(T[] a) {
|
||||
return backing.toArray(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(E e) {
|
||||
return backing.add(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFirst(E e) {
|
||||
backing.add(0, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E getFirst() {
|
||||
if (backing.size() == 0) throw new NoSuchElementException();
|
||||
return(backing.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public E removeFirst() {
|
||||
E item = getFirst();
|
||||
backing.remove(0);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLast(E e) {
|
||||
backing.add(backing.size(), e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E getLast() {
|
||||
if (backing.size() == 0) throw new NoSuchElementException();
|
||||
return backing.get(backing.size() - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E removeLast() {
|
||||
E item = getLast();
|
||||
backing.remove(backing.size() - 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E peek() {
|
||||
return backing.size() > 0 ? backing.get(0) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E peekFirst() {
|
||||
return backing.size() > 0 ? getFirst() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E peekLast() {
|
||||
return backing.size() > 0 ? getLast() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E poll() {
|
||||
return backing.size() > 0 ? removeFirst() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E pollFirst() {
|
||||
return poll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E pollLast() {
|
||||
return backing.size() > 0 ? removeLast() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void push(E e) {
|
||||
addFirst(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E pop() {
|
||||
return removeFirst();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeFirstOccurrence(Object e) {
|
||||
return remove(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeLastOccurrence(Object e) {
|
||||
int idx = this.backing.lastIndexOf(e);
|
||||
if (idx != -1) {
|
||||
this.backing.remove(idx);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
return backing.remove(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
return backing.containsAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(Collection<? extends E> c) {
|
||||
return backing.addAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(int index, Collection<? extends E> c) {
|
||||
return backing.addAll(index, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAll(Collection<?> c) {
|
||||
return backing.removeAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retainAll(Collection<?> c) {
|
||||
return backing.retainAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceAll(UnaryOperator<E> operator) {
|
||||
backing.replaceAll(operator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sort(Comparator<? super E> c) {
|
||||
backing.sort(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
backing.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return backing.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return backing.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E get(int index) {
|
||||
return backing.get(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E set(int index, E element) {
|
||||
return backing.set(index, element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(int index, E element) {
|
||||
backing.add(index, element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E remove(int index) {
|
||||
return backing.remove(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int indexOf(Object o) {
|
||||
return backing.indexOf(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int lastIndexOf(Object o) {
|
||||
return backing.lastIndexOf(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListIterator<E> listIterator() {
|
||||
return backing.listIterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListIterator<E> listIterator(int index) {
|
||||
return backing.listIterator(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<E> subList(int fromIndex, int toIndex) {
|
||||
return backing.subList(fromIndex, toIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Spliterator<E> spliterator() {
|
||||
return backing.spliterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeIf(Predicate<? super E> filter) {
|
||||
return backing.removeIf(filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<E> stream() {
|
||||
return backing.stream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<E> parallelStream() {
|
||||
return backing.parallelStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEach(Consumer<? super E> action) {
|
||||
backing.forEach(action);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CatalystInfo {
|
||||
private final ItemStack stack;
|
||||
private final int priority;
|
||||
|
||||
public CatalystInfo(ItemStack stack, int priority) {
|
||||
this.stack = stack;
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import com.google.common.collect.ForwardingList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
// Do not directly extend ArrayList, see Effective Java Item 16
|
||||
public class CatalystInfoList extends ForwardingList<CatalystInfo> {
|
||||
private final String handlerID;
|
||||
private final List<CatalystInfo> catalystInfoList = new ArrayList<>();
|
||||
|
||||
public CatalystInfoList(String handlerID) {
|
||||
this.handlerID = handlerID;
|
||||
}
|
||||
|
||||
public CatalystInfoList(String handlerID, CatalystInfo catalystInfo) {
|
||||
this(handlerID);
|
||||
add(catalystInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<CatalystInfo> delegate() {
|
||||
return catalystInfoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(@Nonnull CatalystInfo catalystInfo) {
|
||||
if (contains(catalystInfo)) {
|
||||
NEIClientConfig.logger.info(String.format("catalyst %s is already registered to handler %s", catalystInfo.getStack().getDisplayName(), handlerID));
|
||||
return false;
|
||||
}
|
||||
super.add(catalystInfo);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Object object) {
|
||||
if (object instanceof CatalystInfo) {
|
||||
ItemStack stack = ((CatalystInfo) object).getStack();
|
||||
return contains(stack);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack stack) {
|
||||
return catalystInfoList.stream().anyMatch(c -> NEIServerUtils.areStacksSameType(c.getStack(), stack));
|
||||
}
|
||||
|
||||
public boolean remove(ItemStack stack) {
|
||||
Iterator<CatalystInfo> iter = catalystInfoList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
ItemStack next = iter.next().getStack();
|
||||
if (NEIServerUtils.areStacksSameType(next, stack)) {
|
||||
iter.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void sort() {
|
||||
super.sort((c1, c2) -> c2.getPriority() - c1.getPriority());
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static codechicken.nei.NEIClientUtils.translate;
|
||||
@@ -78,6 +77,11 @@ public class FuelRecipeHandler extends FurnaceRecipeHandler
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String specifyTransferRect() {
|
||||
return "fuel";
|
||||
}
|
||||
|
||||
public String getOverlayIdentifier() {
|
||||
return "fuel";
|
||||
}
|
||||
|
||||
@@ -115,6 +115,11 @@ public class FurnaceRecipeHandler extends TemplateRecipeHandler
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String specifyTransferRect() {
|
||||
return "smelting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "textures/gui/container/furnace.png";
|
||||
|
||||
@@ -76,6 +76,7 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
|
||||
|
||||
private final Rectangle area = new Rectangle();
|
||||
private final GuiRecipeTabs recipeTabs;
|
||||
private final GuiRecipeCatalyst guiRecipeCatalyst;
|
||||
private IRecipeHandler handler;
|
||||
private HandlerInfo handlerInfo;
|
||||
|
||||
@@ -84,6 +85,7 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
|
||||
protected GuiRecipe(GuiScreen prevgui) {
|
||||
super(new ContainerRecipe());
|
||||
recipeTabs = new GuiRecipeTabs(this);
|
||||
guiRecipeCatalyst = new GuiRecipeCatalyst(this);
|
||||
slotcontainer = (ContainerRecipe) inventorySlots;
|
||||
|
||||
this.prevGui = prevgui;
|
||||
@@ -267,7 +269,7 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
|
||||
return handler.getIngredientStacks(idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -454,6 +456,7 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
|
||||
}
|
||||
|
||||
public void refreshPage() {
|
||||
RecipeCatalysts.updatePosition(ySize - BG_TOP_HEIGHT - (GuiRecipeCatalyst.fullBorder * 2));
|
||||
refreshSlots();
|
||||
final int recipesPerPage = getRecipesPerPage();
|
||||
final boolean multiplepages = handler.numRecipes() > recipesPerPage;
|
||||
@@ -503,6 +506,13 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
|
||||
PositionedStack result = handler.getResultStack(i);
|
||||
if (result != null)
|
||||
slotcontainer.addSlot(result, p.x, p.y);
|
||||
|
||||
List<PositionedStack> catalysts = RecipeCatalysts.getRecipeCatalysts(handler);
|
||||
for (PositionedStack catalyst : catalysts) {
|
||||
int xOffset = -GuiRecipeCatalyst.ingredientSize + 1;
|
||||
int yOffset = BG_TOP_Y + GuiRecipeCatalyst.fullBorder;
|
||||
slotcontainer.addSlot(catalyst, xOffset, yOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,6 +597,9 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
|
||||
recipeTabs.draw(mouseX, mouseY);
|
||||
if (NEIClientConfig.areJEIStyleRecipeCatalystsVisible()) {
|
||||
guiRecipeCatalyst.draw();
|
||||
}
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import codechicken.nei.api.INEIGuiAdapter;
|
||||
import codechicken.nei.drawable.GuiElementDuex;
|
||||
import codechicken.nei.drawable.GuiElementScalable;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.util.Rectangle;
|
||||
|
||||
public class GuiRecipeCatalyst extends INEIGuiAdapter {
|
||||
private GuiRecipe guiRecipe;
|
||||
public static final int ingredientSize = 16;
|
||||
public static final int ingredientBorder = 1;
|
||||
public static final int tabBorder = 5;
|
||||
public static final int fullBorder = ingredientBorder + tabBorder;
|
||||
|
||||
private static final Rectangle catalystRect = new Rectangle();
|
||||
private static final Rectangle targetRect = new Rectangle();
|
||||
|
||||
public GuiRecipeCatalyst(GuiRecipe guiRecipe) {
|
||||
this.guiRecipe = guiRecipe;
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
if (guiRecipe == null) return;
|
||||
int catalystsSize = RecipeCatalysts.getRecipeCatalysts(guiRecipe.getHandler()).size();
|
||||
if (catalystsSize == 0) return;
|
||||
|
||||
int availableHeight = RecipeCatalysts.getHeight();
|
||||
int columnCount = RecipeCatalysts.getColumnCount(availableHeight, catalystsSize);
|
||||
int rowCount = RecipeCatalysts.getRowCount(availableHeight, catalystsSize);
|
||||
int width, height, xPos, yPos;
|
||||
|
||||
width = (ingredientBorder * 2) + (tabBorder * 2) + (columnCount * ingredientSize);
|
||||
height = (ingredientBorder * 2) + (tabBorder * 2) + (rowCount * ingredientSize);
|
||||
xPos = guiRecipe.guiLeft - width + tabBorder + 1;
|
||||
yPos = guiRecipe.guiTop;
|
||||
drawBordered("nei:textures/catalyst_tab.png", xPos, yPos, width, height, 28, 28, 6, 6, 6, 6);
|
||||
|
||||
width = (ingredientBorder * 2) + (columnCount * ingredientSize);
|
||||
height = (ingredientBorder * 2) + (rowCount * ingredientSize);
|
||||
xPos = guiRecipe.guiLeft - width + ingredientBorder + 1;
|
||||
yPos = guiRecipe.guiTop + fullBorder - ingredientBorder;
|
||||
drawBordered("nei:textures/slot.png", xPos, yPos, width, height, 18, 18, 1, 1, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) {
|
||||
if (!(gui instanceof GuiRecipe)) return false;
|
||||
guiRecipe = (GuiRecipe) gui;
|
||||
int catalystsSize = RecipeCatalysts.getRecipeCatalysts(guiRecipe.getHandler()).size();
|
||||
if (catalystsSize == 0) return false;
|
||||
|
||||
int availableHeight = RecipeCatalysts.getHeight();
|
||||
int columnCount = RecipeCatalysts.getColumnCount(availableHeight, catalystsSize);
|
||||
int rowCount = RecipeCatalysts.getRowCount(availableHeight, catalystsSize);
|
||||
int margin = 4;
|
||||
|
||||
int width = (ingredientBorder * 2) + (tabBorder * 2) + (columnCount * ingredientSize) + margin;
|
||||
int height = (ingredientBorder * 2) + (tabBorder * 2) + (rowCount * ingredientSize) + margin;
|
||||
int xOffset = guiRecipe.guiLeft - width + tabBorder;
|
||||
int yOffset = guiRecipe.guiTop;
|
||||
catalystRect.setBounds(xOffset, yOffset, width, height);
|
||||
targetRect.setBounds(x, y, w, h);
|
||||
return targetRect.intersects(catalystRect);
|
||||
}
|
||||
|
||||
private void drawBordered(String location, int xPos, int yPos, int width, int height, int texWidth, int texHeight, int sliceLeft, int sliceRight, int sliceTop, int sliceBottom) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(location));
|
||||
|
||||
GuiElementDuex cornerTopLeft = new GuiElementDuex(0, 0, sliceLeft, sliceTop, texWidth, texHeight);
|
||||
GuiElementDuex cornerTopRight = new GuiElementDuex(texWidth - sliceRight, 0, sliceRight, sliceTop, texWidth, texHeight);
|
||||
GuiElementDuex cornerBottomLeft = new GuiElementDuex(0, texHeight - sliceBottom, sliceLeft, sliceBottom, texWidth, texHeight);
|
||||
GuiElementDuex cornerBottomRight = new GuiElementDuex(texWidth - sliceRight, texHeight - sliceBottom, sliceRight, sliceBottom, texWidth, texHeight);
|
||||
|
||||
GuiElementScalable borderTop = new GuiElementScalable(sliceLeft, 0, texWidth - sliceLeft - sliceRight, sliceTop, texWidth, texHeight);
|
||||
GuiElementScalable borderBottom = new GuiElementScalable(sliceLeft, texHeight - sliceBottom, texWidth - sliceLeft - sliceRight, sliceBottom, texWidth, texHeight);
|
||||
GuiElementScalable borderLeft = new GuiElementScalable(0, sliceTop, sliceLeft, texHeight - sliceTop - sliceBottom, texWidth, texHeight);
|
||||
GuiElementScalable borderRight = new GuiElementScalable(texWidth - sliceRight, sliceTop, sliceRight, texHeight - sliceTop - sliceBottom, texWidth, texHeight);
|
||||
GuiElementScalable center = new GuiElementScalable(sliceLeft, sliceTop, texWidth - sliceLeft - sliceRight, texHeight - sliceTop - sliceBottom, texWidth, texHeight);
|
||||
|
||||
int midW = width - borderLeft.w - borderRight.w;
|
||||
int midH = height - borderTop.h - borderBottom.h;
|
||||
|
||||
// top row
|
||||
int x = xPos;
|
||||
int y = yPos;
|
||||
x += cornerTopLeft.draw(x, y);
|
||||
x += borderTop.drawScaledX(x, y, midW);
|
||||
cornerTopRight.draw(x, y);
|
||||
|
||||
// center row
|
||||
x = xPos;
|
||||
y += borderTop.h;
|
||||
x += borderLeft.drawScaledY(x, y, midH);
|
||||
x += center.drawScaled(x, y, midW, midH);
|
||||
borderRight.drawScaledY(x, y, midH);
|
||||
|
||||
// bottom row
|
||||
x = xPos;
|
||||
y += midH;
|
||||
x += cornerBottomLeft.draw(x, y);
|
||||
x += borderBottom.drawScaledX(x, y, midW);
|
||||
cornerBottomRight.draw(x, y);
|
||||
}
|
||||
}
|
||||
@@ -64,9 +64,9 @@ public abstract class GuiRecipeTab extends Widget {
|
||||
this.handlerName = handler.getHandlerId();
|
||||
this.guiRecipe = guiRecipe;
|
||||
this.selected = false;
|
||||
|
||||
|
||||
if(handler instanceof TemplateRecipeHandler) {
|
||||
handlerID = (((TemplateRecipeHandler)handler).getOverlayIdentifier());
|
||||
handlerID = handler.getOverlayIdentifier();
|
||||
} else {
|
||||
handlerID = null;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public abstract class GuiRecipeTab extends Widget {
|
||||
}
|
||||
|
||||
public void addTooltips(List<String> tooltip) {
|
||||
tooltip.add(handler.getRecipeName().trim());
|
||||
tooltip.add(handler.getRecipeTabName().trim());
|
||||
|
||||
String handlerMod = getHandlerMod(handlerName, handlerID);
|
||||
tooltip.add(EnumChatFormatting.BLUE + handlerMod);
|
||||
@@ -162,7 +162,7 @@ public abstract class GuiRecipeTab extends Widget {
|
||||
final String handlerID;
|
||||
|
||||
if (handler instanceof TemplateRecipeHandler) {
|
||||
handlerID = ((TemplateRecipeHandler) handler).getOverlayIdentifier();
|
||||
handlerID = handler.getOverlayIdentifier();
|
||||
} else {
|
||||
handlerID = null;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public abstract class GuiRecipeTab extends Widget {
|
||||
} else {
|
||||
File handlerFile = NEIClientConfig.handlerFile;
|
||||
if(!handlerFile.exists()) {
|
||||
NEIClientConfig.logger.info("Config file doesn't exit, creating");
|
||||
NEIClientConfig.logger.info("Config file doesn't exist, creating");
|
||||
try {
|
||||
assert handlerUrl != null;
|
||||
ReadableByteChannel readableByteChannel = Channels.newChannel(handlerUrl.openStream());
|
||||
@@ -272,9 +272,6 @@ public abstract class GuiRecipeTab extends Widget {
|
||||
handlerMap.put(handler, info);
|
||||
NEIClientConfig.logger.info("Loaded " + handler);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.info("Error parsing CSV");
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.info("Error parsing CSV");
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -25,12 +25,12 @@ public class GuiUsageRecipe extends GuiRecipe
|
||||
|
||||
profiler.start("recipe.concurrent.usage");
|
||||
try {
|
||||
handlers = serialUsageHandlers.stream().map(h -> h.getUsageHandler(inputId, ingredients))
|
||||
handlers = serialUsageHandlers.stream().map(h -> getUsageOrCatalystHandler(h, inputId, ingredients))
|
||||
.filter(h -> h.numRecipes() > 0)
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
|
||||
|
||||
handlers.addAll(ItemList.forkJoinPool.submit(() -> usagehandlers.parallelStream()
|
||||
.map(h -> h.getUsageHandler(inputId, ingredients))
|
||||
.map(h -> getUsageOrCatalystHandler(h, inputId, ingredients))
|
||||
.filter(h -> h.numRecipes() > 0)
|
||||
.collect(Collectors.toCollection(ArrayList::new))).get());
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
@@ -69,6 +69,15 @@ public class GuiUsageRecipe extends GuiRecipe
|
||||
return currenthandlers;
|
||||
}
|
||||
|
||||
private static IUsageHandler getUsageOrCatalystHandler(IUsageHandler handler, String inputId, Object... ingredients) {
|
||||
boolean skipCatalyst = NEIClientUtils.controlKey();
|
||||
if (NEIClientConfig.areJEIStyleRecipeCatalystsVisible() && !skipCatalyst) {
|
||||
return handler.getUsageAndCatalystHandler(inputId, ingredients);
|
||||
} else {
|
||||
return handler.getUsageHandler(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<IUsageHandler> currenthandlers;
|
||||
|
||||
public static ArrayList<IUsageHandler> usagehandlers = new ArrayList<>();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.drawable.DrawableBuilder;
|
||||
import codechicken.nei.drawable.DrawableResource;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
@@ -53,48 +54,10 @@ public class HandlerInfo {
|
||||
public boolean setItem(String itemId, String nbtString) {
|
||||
if(hasImageOrItem())
|
||||
return false;
|
||||
|
||||
int meta = -1;
|
||||
if (!itemId.contains(":")) {
|
||||
NEIClientConfig.logger.info("Item ID missing colon for handler " + handlerName + " - " + modName);
|
||||
return false;
|
||||
}
|
||||
final String[] split = itemId.split(":");
|
||||
// ModID:ItemID
|
||||
String itemLookupId = split[0] + ":" + split[1];
|
||||
|
||||
if(split.length >= 3) {
|
||||
int mIdx = -1;
|
||||
if (split[2].matches("\\d+")) {
|
||||
mIdx = 2;
|
||||
} else {
|
||||
itemLookupId += ":" + split[2];
|
||||
if (split.length >= 4) mIdx = 3;
|
||||
}
|
||||
if (mIdx != -1) meta = Integer.parseInt(split[mIdx]);
|
||||
}
|
||||
|
||||
if (meta != -1) {
|
||||
itemStack = GameRegistry.makeItemStack(itemLookupId, meta, 1, nbtString == null ? "" : nbtString);
|
||||
} else {
|
||||
itemStack = GameRegistry.findItemStack(split[0], split[1], 1);
|
||||
if (nbtString != null && !nbtString.equals("")) {
|
||||
try {
|
||||
final NBTBase nbttag = JsonToNBT.func_150315_a(nbtString);
|
||||
if (!(nbttag instanceof NBTTagCompound)) {
|
||||
NEIClientConfig.logger.info("Unexpected NBT string - multiple values {}", nbtString);
|
||||
return false;
|
||||
}
|
||||
|
||||
itemStack.setTagCompound((NBTTagCompound) nbttag);
|
||||
} catch (NBTException e) {
|
||||
FMLLog.getLogger().log(Level.WARN, "Encountered an exception parsing ItemStack NBT string {}", nbtString, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
itemStack = NEIServerUtils.getModdedItem(itemId, nbtString);
|
||||
if (itemStack == null)
|
||||
NEIClientConfig.logger.info("Couldn't find " + modName + " - " + itemLookupId);
|
||||
NEIClientConfig.logger.info("Couldn't find " + modName + " - " + itemId);
|
||||
else {
|
||||
this.itemId = itemId;
|
||||
this.nbtString = nbtString;
|
||||
|
||||
@@ -29,46 +29,55 @@ public interface IRecipeHandler
|
||||
* @return The name of this inventory.
|
||||
* To be displayed at the top of the viewing container.
|
||||
*/
|
||||
public String getRecipeName();
|
||||
String getRecipeName();
|
||||
|
||||
/**
|
||||
* For legacy compatibility reasons, this method's default implementation returns the recipe name. This is also the expected behavior
|
||||
*
|
||||
* @return The name of this inventory.
|
||||
* To be displayed in the tooltip in the tab at the top of the viewing container.
|
||||
*/
|
||||
default String getRecipeTabName() {
|
||||
return getRecipeName();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The number of recipes that this handler contains.
|
||||
*/
|
||||
public int numRecipes();
|
||||
int numRecipes();
|
||||
/**
|
||||
* Draw the background of this recipe handler (basically the slot layout image).
|
||||
* @param gui A GuiManager for drawing functions.
|
||||
* @param recipe The recipe index to draw at this position.
|
||||
*/
|
||||
public void drawBackground(int recipe);
|
||||
void drawBackground(int recipe);
|
||||
/**
|
||||
* Draw the foreground of this recipe handler (for things like progress bars).
|
||||
* @param gui A GuiManager for drawing functions.
|
||||
* @param recipe The recipe index to draw at this position.
|
||||
*/
|
||||
public void drawForeground(int recipe);
|
||||
void drawForeground(int recipe);
|
||||
/**
|
||||
*
|
||||
* @param recipe The recipe index to get items for.
|
||||
* @return A list of the ingredient {@link PositionedStack}s in this recipe relative to the top left corner of your recipe drawing space.
|
||||
*/
|
||||
public List<PositionedStack> getIngredientStacks(int recipe);
|
||||
List<PositionedStack> getIngredientStacks(int recipe);
|
||||
/**
|
||||
*
|
||||
* @param recipe The recipe index to get items for.
|
||||
* @param recipetype The recipe index to get items for.
|
||||
* @return A list of the other {@link PositionedStack}s in this recipe relative to the top left corner of your recipe drawing space. For example fuel in furnaces.
|
||||
*/
|
||||
public List<PositionedStack> getOtherStacks(int recipetype);
|
||||
List<PositionedStack> getOtherStacks(int recipetype);
|
||||
/**
|
||||
*
|
||||
* @param recipe The recipe index to get the result for.
|
||||
* @return The recipe result {@link PositionedStack} relative to the top left corner of your recipe drawing space.
|
||||
*/
|
||||
public PositionedStack getResultStack(int recipe);
|
||||
PositionedStack getResultStack(int recipe);
|
||||
/**
|
||||
* A tick function called for updating progress bars and cycling damage items.
|
||||
*/
|
||||
public void onUpdate();
|
||||
void onUpdate();
|
||||
/**
|
||||
*
|
||||
* @param recipe The recipe index to check for.
|
||||
@@ -76,24 +85,33 @@ public interface IRecipeHandler
|
||||
* @param container The container of the GUI.
|
||||
* @return true if this recipe can render an overlay for the specified type of inventory GUI.
|
||||
*/
|
||||
public boolean hasOverlay(GuiContainer gui, Container container, int recipe);
|
||||
boolean hasOverlay(GuiContainer gui, Container container, int recipe);
|
||||
/**
|
||||
*
|
||||
* @param recipe The recipe index to get the overlay renderer for.
|
||||
* @return An instance of {@link IRecipeOverlayRenderer} to be used for rendering the overlay of this specific recipe.
|
||||
*/
|
||||
public IRecipeOverlayRenderer getOverlayRenderer(GuiContainer gui, int recipe);
|
||||
IRecipeOverlayRenderer getOverlayRenderer(GuiContainer gui, int recipe);
|
||||
/**
|
||||
*
|
||||
* @param recipe The recipe index to get the overlay renderer for.
|
||||
* @return An instance of {@link IOverlayHandler} to be used for rendering the overlay of this specific recipe.
|
||||
*/
|
||||
public IOverlayHandler getOverlayHandler(GuiContainer gui, int recipe);
|
||||
IOverlayHandler getOverlayHandler(GuiContainer gui, int recipe);
|
||||
/**
|
||||
* Simply works with the {@link codechicken.nei.api.DefaultOverlayRenderer}
|
||||
* If the current container has been registered with this identifier, the question mark appears and an overlay guide can be drawn.
|
||||
*
|
||||
* @return The overlay identifier of this recipe type.
|
||||
*/
|
||||
default String getOverlayIdentifier() {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return The number of recipes that can fit on a page in the viewer (1 or 2)
|
||||
*/
|
||||
public int recipiesPerPage();
|
||||
int recipiesPerPage();
|
||||
/**
|
||||
*
|
||||
* @param gui An instance of the currentscreen
|
||||
@@ -101,16 +119,16 @@ public interface IRecipeHandler
|
||||
* @param recipe The recipe index being handled
|
||||
* @return The modified tooltip. DO NOT return null
|
||||
*/
|
||||
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe);
|
||||
List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe);
|
||||
/**
|
||||
*
|
||||
* @param gui An instance of the currentscreen
|
||||
* @param The itemstack currently under the mouse
|
||||
* @param The current tooltip, will contain item name and info
|
||||
* @param stack The itemstack currently under the mouse
|
||||
* @param currenttip The current tooltip, will contain item name and info
|
||||
* @param recipe The recipe index being handled
|
||||
* @return The modified tooltip. DO NOT return null
|
||||
*/
|
||||
public List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe);
|
||||
List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -119,7 +137,7 @@ public interface IRecipeHandler
|
||||
* @param keyCode The KeyCode as defined in {@link Keyboard}
|
||||
* @return true to terminate further processing of this event.
|
||||
*/
|
||||
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe);
|
||||
boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -127,7 +145,7 @@ public interface IRecipeHandler
|
||||
* @param button The button index being pressed, {0 = Left Click, 1 = Right Click, 2 = Middle Click}
|
||||
* @return true to terminate further processing of this event.
|
||||
*/
|
||||
public boolean mouseClicked(GuiRecipe gui, int button, int recipe);
|
||||
boolean mouseClicked(GuiRecipe gui, int button, int recipe);
|
||||
|
||||
/**
|
||||
* For legacy compatibility reasons, this method has a do-nothing default implementation.
|
||||
|
||||
@@ -15,5 +15,12 @@ public interface IUsageHandler extends IRecipeHandler
|
||||
* @param ingredients Objects representing the ingredients that matching recipes must contain.
|
||||
* @return An instance of {@link IUsageHandler} configured with a list of recipes that contain matching input
|
||||
*/
|
||||
public IUsageHandler getUsageHandler(String inputId, Object... ingredients);
|
||||
IUsageHandler getUsageHandler(String inputId, Object... ingredients);
|
||||
|
||||
/**
|
||||
* See {@link TemplateRecipeHandler#getUsageAndCatalystHandler} for implementation
|
||||
*/
|
||||
default IUsageHandler getUsageAndCatalystHandler(String inputId, Object... ingredients) {
|
||||
return getUsageHandler(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import com.google.common.base.Objects;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.apache.commons.csv.CSVFormat;
|
||||
import org.apache.commons.csv.CSVParser;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class RecipeCatalysts {
|
||||
private static final Map<String, CatalystInfoList> catalystsAdderFromAPI = new HashMap<>();
|
||||
private static final Map<String, List<ItemStack>> catalystsRemoverFromAPI = new HashMap<>();
|
||||
private static final Map<String, CatalystInfoList> recipeCatalystMap = new HashMap<>();
|
||||
private static Map<String, List<PositionedStack>> positionedRecipeCatalystMap = new HashMap<>();
|
||||
private static final List<String> forceClassNameList = new ArrayList<>();
|
||||
private static int heightCache;
|
||||
|
||||
public static void addRecipeCatalyst(String handlerID, CatalystInfo catalystInfo) {
|
||||
if (handlerID == null || handlerID.isEmpty() || catalystInfo.getStack() == null) return;
|
||||
addOrPut(catalystsAdderFromAPI, handlerID, catalystInfo);
|
||||
}
|
||||
|
||||
public static void removeRecipeCatalyst(String handlerID, ItemStack stack) {
|
||||
if (handlerID == null || handlerID.isEmpty() || stack == null) return;
|
||||
if (catalystsRemoverFromAPI.containsKey(handlerID)) {
|
||||
catalystsRemoverFromAPI.get(handlerID).add(stack);
|
||||
} else {
|
||||
catalystsRemoverFromAPI.put(handlerID, new ArrayList<>(Collections.singletonList(stack)));
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<String, List<PositionedStack>> getPositionedRecipeCatalystMap() {
|
||||
return positionedRecipeCatalystMap;
|
||||
}
|
||||
|
||||
public static List<PositionedStack> getRecipeCatalysts(IRecipeHandler handler) {
|
||||
return getRecipeCatalysts(getRecipeID(handler));
|
||||
}
|
||||
|
||||
public static List<PositionedStack> getRecipeCatalysts(String handlerID) {
|
||||
if (!NEIClientConfig.areJEIStyleTabsVisible() || !NEIClientConfig.areJEIStyleRecipeCatalystsVisible()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return positionedRecipeCatalystMap.getOrDefault(handlerID, Collections.emptyList());
|
||||
}
|
||||
|
||||
public static boolean containsCatalyst(IRecipeHandler handler, ItemStack candidate) {
|
||||
return containsCatalyst(getRecipeID(handler), candidate);
|
||||
}
|
||||
|
||||
public static boolean containsCatalyst(String handlerID, ItemStack candidate) {
|
||||
if (recipeCatalystMap.containsKey(handlerID)) {
|
||||
return recipeCatalystMap.get(handlerID).contains(candidate);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void updatePosition(int availableHeight, boolean force) {
|
||||
if (availableHeight == heightCache && !force) return;
|
||||
|
||||
Map<String, List<PositionedStack>> newMap = new HashMap<>();
|
||||
for (Map.Entry<String, CatalystInfoList> entry : recipeCatalystMap.entrySet()) {
|
||||
CatalystInfoList catalysts = entry.getValue();
|
||||
catalysts.sort();
|
||||
List<PositionedStack> newStacks = new ArrayList<>();
|
||||
int rowCount = getRowCount(availableHeight, catalysts.size());
|
||||
|
||||
for (int index = 0; index < catalysts.size(); index++) {
|
||||
ItemStack catalyst = catalysts.get(index).getStack();
|
||||
int column = index / rowCount;
|
||||
int row = index % rowCount;
|
||||
newStacks.add(new PositionedStack(catalyst, -column * GuiRecipeCatalyst.ingredientSize, row * GuiRecipeCatalyst.ingredientSize));
|
||||
}
|
||||
newMap.put(entry.getKey(), newStacks);
|
||||
}
|
||||
positionedRecipeCatalystMap = newMap;
|
||||
heightCache = availableHeight;
|
||||
}
|
||||
|
||||
public static void updatePosition(int availableHeight) {
|
||||
updatePosition(availableHeight, false);
|
||||
}
|
||||
|
||||
public static int getHeight() {
|
||||
return heightCache;
|
||||
}
|
||||
|
||||
public static int getColumnCount(int availableHeight, int catalystsSize) {
|
||||
int maxItemsPerColumn = availableHeight / GuiRecipeCatalyst.ingredientSize;
|
||||
return NEIServerUtils.divideCeil(catalystsSize, maxItemsPerColumn);
|
||||
}
|
||||
|
||||
public static int getRowCount(int availableHeight, int catalystsSize) {
|
||||
int columnCount = getColumnCount(availableHeight, catalystsSize);
|
||||
return NEIServerUtils.divideCeil(catalystsSize, columnCount);
|
||||
}
|
||||
|
||||
public static void loadCatalystInfo() {
|
||||
final boolean fromJar = NEIClientConfig.loadCatalystsFromJar();
|
||||
NEIClientConfig.logger.info("Loading catalyst info from " + (fromJar ? "JAR" : "Config"));
|
||||
recipeCatalystMap.clear();
|
||||
URL handlerUrl = Thread.currentThread().getContextClassLoader().getResource("assets/nei/csv/catalysts.csv");
|
||||
|
||||
URL url;
|
||||
if (fromJar) {
|
||||
url = handlerUrl;
|
||||
if (url == null) {
|
||||
NEIClientConfig.logger.warn("Invalid URL for catalysts csv.");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
File catalystFile = NEIClientConfig.catalystFile;
|
||||
if(!catalystFile.exists()) {
|
||||
NEIClientConfig.logger.info("Config file doesn't exist, creating");
|
||||
try {
|
||||
assert handlerUrl != null;
|
||||
ReadableByteChannel readableByteChannel = Channels.newChannel(handlerUrl.openStream());
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(catalystFile.getAbsoluteFile());
|
||||
FileChannel fileChannel = fileOutputStream.getChannel();
|
||||
fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
url = NEIClientConfig.catalystFile.toURI().toURL();
|
||||
} catch (MalformedURLException e) {
|
||||
NEIClientConfig.logger.warn("Invalid URL for catalysts csv (via config).");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()))) {
|
||||
CSVParser csvParser = CSVFormat.EXCEL.withFirstRecordAsHeader().parse(reader);
|
||||
for (CSVRecord record : csvParser) {
|
||||
final String handler = record.get("handler");
|
||||
final String modId = record.get("modId");
|
||||
final boolean requiresMod = Boolean.parseBoolean(record.get("modRequired"));
|
||||
final String excludedModId = record.get("excludedModId");
|
||||
final int priority = intOrDefault(record.get("priority"), 0);
|
||||
// todo
|
||||
final String minVersion = record.get("minVersion");
|
||||
final String maxVersion = record.get("maxVersion");
|
||||
final boolean forceClassName = Boolean.parseBoolean(record.get("forceClassName"));
|
||||
|
||||
if (requiresMod && !Loader.isModLoaded(modId)) continue;
|
||||
if (excludedModId != null && Loader.isModLoaded(excludedModId)) continue;
|
||||
|
||||
String itemName = record.get("itemName");
|
||||
if (itemName == null || itemName.isEmpty()) continue;
|
||||
ItemStack stack = NEIServerUtils.getModdedItem(itemName, record.get("nbtInfo"));
|
||||
if (stack == null) {
|
||||
NEIClientConfig.logger.warn("Couldn't find ItemStack " + itemName);
|
||||
continue;
|
||||
}
|
||||
CatalystInfo catalystInfo = new CatalystInfo(stack, priority);
|
||||
|
||||
String handlerID;
|
||||
try {
|
||||
// gently handling copy&paste from handlers.csv
|
||||
Class<?> clazz = Class.forName(handler);
|
||||
Object object = clazz.newInstance();
|
||||
if (object instanceof IRecipeHandler) {
|
||||
if (forceClassName) {
|
||||
forceClassNameList.add(handler);
|
||||
}
|
||||
handlerID = getRecipeID((IRecipeHandler) object);
|
||||
} else {
|
||||
handlerID = handler;
|
||||
}
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
handlerID = handler;
|
||||
} catch (InstantiationException ignored) {
|
||||
NEIClientConfig.logger.warn("failed to create instance for " + handler);
|
||||
handlerID = handler;
|
||||
}
|
||||
|
||||
addOrPut(recipeCatalystMap, handlerID, catalystInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.warn("Error parsing CSV");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
for (Map.Entry<String, CatalystInfoList> entry : catalystsAdderFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
for (CatalystInfo catalyst : entry.getValue()) {
|
||||
addOrPut(recipeCatalystMap, handlerID, catalyst);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, List<ItemStack>> entry : catalystsRemoverFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
if (recipeCatalystMap.containsKey(handlerID)) {
|
||||
CatalystInfoList catalysts = recipeCatalystMap.get(handlerID);
|
||||
entry.getValue().forEach(catalysts::remove);
|
||||
}
|
||||
}
|
||||
|
||||
updatePosition(getHeight(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Basically {@link NEIClientConfig#HANDLER_ID_FUNCTION}.
|
||||
* Force using {@link IRecipeHandler#getHandlerId()} if specified in catalysts.csv.
|
||||
* In other words, refuse to share handlerID defined in {@link TemplateRecipeHandler#getOverlayIdentifier()}.
|
||||
*/
|
||||
public static String getRecipeID(IRecipeHandler handler) {
|
||||
if (forceClassNameList.stream().anyMatch(s -> s.equals(handler.getHandlerId()))) {
|
||||
return handler.getHandlerId();
|
||||
}
|
||||
return Objects.firstNonNull(
|
||||
handler.getOverlayIdentifier(),
|
||||
handler.getHandlerId());
|
||||
}
|
||||
|
||||
private static void addOrPut(Map<String, CatalystInfoList> map, String handlerID, CatalystInfo catalyst) {
|
||||
if (map.containsKey(handlerID)) {
|
||||
map.get(handlerID).add(catalyst);
|
||||
} else {
|
||||
map.put(handlerID, new CatalystInfoList(handlerID, catalyst));
|
||||
}
|
||||
}
|
||||
|
||||
private static int intOrDefault(String str, int defaultValue) {
|
||||
if (str == null || str.equals("")) return defaultValue;
|
||||
try {
|
||||
return Integer.parseInt(str);
|
||||
} catch (NumberFormatException e) {
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRecipeCatalyst(List<ItemStack> stacks, Class<? extends IRecipeHandler> handler) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static List<PositionedStack> getRecipeCatalysts(Class<? extends IRecipeHandler> handler) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean containsCatalyst(Class<? extends IRecipeHandler> handler, ItemStack candidate) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -442,6 +442,7 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
*
|
||||
* @return The overlay identifier of this recipe type.
|
||||
*/
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return null;
|
||||
}
|
||||
@@ -550,6 +551,36 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
return handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* First look up {@link RecipeCatalysts} whether target ingredient is registered for it.
|
||||
* If so, load all recipes for this handler.
|
||||
* Fallback to {@link TemplateRecipeHandler#getUsageHandler}.
|
||||
*/
|
||||
public IUsageHandler getUsageAndCatalystHandler(String inputId, Object... ingredients) {
|
||||
TemplateRecipeHandler handler = newInstance();
|
||||
if (inputId.equals("item")) {
|
||||
ItemStack candidate = (ItemStack) ingredients[0];
|
||||
if (RecipeCatalysts.containsCatalyst(handler, candidate)) {
|
||||
for (RecipeTransferRect rect : transferRects) {
|
||||
if (specifyTransferRect() == null || Objects.equals(rect.outputId, specifyTransferRect())) {
|
||||
handler.loadCraftingRecipes(rect.outputId, rect.results);
|
||||
return handler;
|
||||
}
|
||||
}
|
||||
NEIClientConfig.logger.info("failed to load catalyst handler, implement `loadTransferRects` for your handler " + handler.getClass().getName());
|
||||
}
|
||||
}
|
||||
return this.getUsageHandler(inputId, ingredients);
|
||||
}
|
||||
|
||||
/**
|
||||
* Override this if you have multiple {@link RecipeTransferRect}s.
|
||||
* Used for {@link TemplateRecipeHandler#getUsageAndCatalystHandler}.
|
||||
*/
|
||||
public String specifyTransferRect() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int numRecipes() {
|
||||
return arecipes.size();
|
||||
}
|
||||
|
||||
@@ -14,9 +14,15 @@ public class DefaultStackStringifyHandler implements IStackStringifyHandler
|
||||
|
||||
public NBTTagCompound convertItemStackToNBT(ItemStack stack, boolean saveStackSize)
|
||||
{
|
||||
final String strId = Item.itemRegistry.getNameForObject(stack.getItem());
|
||||
|
||||
if (strId == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final NBTTagCompound nbTag = new NBTTagCompound();
|
||||
nbTag.setString("strId", Item.itemRegistry.getNameForObject(stack.getItem()));
|
||||
nbTag.setInteger("Count", saveStackSize? stack.stackSize: 1);
|
||||
nbTag.setString("strId", strId);
|
||||
nbTag.setInteger("Count", Math.max(saveStackSize? stack.stackSize: 1, 1));
|
||||
nbTag.setShort("Damage", (short)stack.getItemDamage());
|
||||
|
||||
if (stack.hasTagCompound()) {
|
||||
|
||||
@@ -31,12 +31,15 @@ public class GTFluidStackStringifyHandler implements IStackStringifyHandler
|
||||
{
|
||||
|
||||
if (GTDisplayFluid != null && GTDisplayFluid.isInstance(stack.getItem())) {
|
||||
final NBTTagCompound nbTag = new NBTTagCompound();
|
||||
final FluidStack fluidStack = getFluid(stack);
|
||||
|
||||
nbTag.setString("gtFluidName", fluidStack.getFluid().getName());
|
||||
nbTag.setInteger("Count", saveStackSize? fluidStack.amount: 1);
|
||||
return nbTag;
|
||||
if (fluidStack != null) {
|
||||
final NBTTagCompound nbTag = new NBTTagCompound();
|
||||
nbTag.setString("gtFluidName", fluidStack.getFluid().getName());
|
||||
nbTag.setInteger("Count", saveStackSize? fluidStack.amount: 1);
|
||||
return nbTag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -355,7 +355,7 @@ vazkii.botania.client.integration.nei.recipe.RecipeHandlerRunicAltar,Botania,Bot
|
||||
vazkii.botania.client.integration.nei.recipe.RecipeHandlerManaPool,Botania,Botania:pool,,Botania,TRUE,,,90,137,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.recipe.RecipeHandlerElvenTrade,Botania,Botania:alfheimPortal,,Botania,TRUE,,,90,130,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.recipe.RecipeHandlerBrewery,Botania,Botania:brewery,,Botania,TRUE,,,,,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.recipe.RecipeHandlerPureDaisy,Botania,Botania:specialFlower,"{""type"": ""puredaisy""}",Botania,TRUE,,,,,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.recipe.RecipeHandlerPureDaisy,Botania,Botania:specialFlower,"{type:puredaisy}",Botania,TRUE,,,,,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.recipe.RecipeHandlerLexicaBotania,Botania,Botania:lexicon,,Botania,TRUE,,,,,,,,,,,
|
||||
com.jaquadro.minecraft.storagedrawers.integration.notenoughitems.UpgradeItemRecipeHandler,Storage Drawers,minecraft:crafting_table,,StorageDrawers,TRUE,,,65,166,5,,,,,,
|
||||
ieArcFurnace,Immersive Engineering,ImmersiveEngineering:graphiteElectrode,,ImmersiveEngineering,TRUE,,,65,166,5,,,,,,
|
||||
@@ -411,6 +411,7 @@ mekanism.client.nei.ChemicalOxidizerRecipeHandler,Mekanism,Mekanism:MachineBlock
|
||||
mekanism.client.nei.ChemicalWasherRecipeHandler,Mekanism,Mekanism:MachineBlock2:7,,Mekanism,TRUE,,,70,,5,,,,,,
|
||||
mekanism.client.nei.CombinerRecipeHandler,Mekanism,Mekanism:MachineBlock:2,,Mekanism,TRUE,,,68,,5,,,,,,
|
||||
mekanism.client.nei.CrusherRecipeHandler,Mekanism,Mekanism:MachineBlock:3,,Mekanism,TRUE,,,68,,5,,,,,,
|
||||
mekanism.client.nei.EnrichmentChamberRecipeHandler,Mekanism,Mekanism:MachineBlock:0,,Mekanism,TRUE,,,68,,5,,,,,,
|
||||
mekanism.client.nei.MetallurgicInfuserRecipeHandler,Mekanism,Mekanism:MachineBlock:8,,Mekanism,TRUE,,,56,,5,,,,,,
|
||||
mekanism.client.nei.OsmiumCompressorRecipeHandler,Mekanism,Mekanism:MachineBlock:1,,Mekanism,TRUE,,,68,,5,,,,,,
|
||||
mekanism.client.nei.PRCRecipeHandler,Mekanism,Mekanism:MachineBlock2:10,,Mekanism,TRUE,,,68,,5,,,,,,
|
||||
@@ -450,4 +451,26 @@ neresources.nei.NEIEnchantmentHandler,Not Enough Resources,minecraft:anvil,,nere
|
||||
neresources.nei.NEIMobHandler,Not Enough Resources,minecraft:skull:4,,neresources,TRUE,,,130,166,2,,,,,,
|
||||
neresources.nei.NEIOreHandler,Not Enough Resources,minecraft:diamond_ore,,neresources,TRUE,,,65,166,5,,,,,,
|
||||
neresources.nei.NEIPlantHandler,Not Enough Resources,minecraft:wheat,,neresources,TRUE,,,130,166,2,,,,,,
|
||||
wanion.biggercraftingtables.nei.BigShapedRecipeHandler,Bigger Crafting Tables,minecraft:crafting_table,,biggercraftingtables,TRUE,,,130,,2,,,,,,
|
||||
wanion.biggercraftingtables.nei.BigShapedRecipeHandler,Bigger Crafting Tables,biggercraftingtables:BiggerCraftingTables,,biggercraftingtables,TRUE,,,130,,2,,,,,,
|
||||
wanion.biggercraftingtables.nei.BigShapelessRecipeHandler,Bigger Crafting Tables,biggercraftingtables:BiggerCraftingTables,,biggercraftingtables,TRUE,,,130,,2,,,,,,
|
||||
wanion.biggercraftingtables.nei.HugeShapedRecipeHandler,Bigger Crafting Tables,biggercraftingtables:BiggerCraftingTables:1,,biggercraftingtables,TRUE,,,130,,2,,,,,,
|
||||
wanion.biggercraftingtables.nei.HugeShapelessRecipeHandler,Bigger Crafting Tables,biggercraftingtables:BiggerCraftingTables:1,,biggercraftingtables,TRUE,,,130,,2,,,,,,
|
||||
net.machinemuse.numina.nei.JSONRecipeHandler,Modular Powersuits,powersuits:tile.tinkerTable,,powersuits,TRUE,,,65,166,5,,,,,,
|
||||
com.teammetallurgy.metallurgy.nei.CrusherHandler,Metallurgy 4,Metallurgy:crusher,,Metallurgy,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.MetalFurnaceRecipeHandler,NuclearCraft,NuclearCraft:furnaceIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.ElectricFurnaceRecipeHandler,NuclearCraft,NuclearCraft:electricFurnaceIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.NuclearFurnaceRecipeHandler,NuclearCraft,NuclearCraft:nuclearFurnaceIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.FactoryRecipeHandler,NuclearCraft,NuclearCraft:factoryIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.AssemblerRecipeHandler,NuclearCraft,NuclearCraft:assemblerIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.SeparatorRecipeHandler,NuclearCraft,NuclearCraft:separatorIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.HastenerRecipeHandler,NuclearCraft,NuclearCraft:hastenerIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.CollectorRecipeHandler,NuclearCraft,NuclearCraft:collectorIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.OxidiserRecipeHandler,NuclearCraft,NuclearCraft:oxidiserIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.IoniserRecipeHandler,NuclearCraft,NuclearCraft:ioniserIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.IrradiatorRecipeHandler,NuclearCraft,NuclearCraft:irradiatorIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.CoolerRecipeHandler,NuclearCraft,NuclearCraft:coolerIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.HeliumExtractorRecipeHandler,NuclearCraft,NuclearCraft:heliumExtractorIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.RecyclerRecipeHandler,NuclearCraft,NuclearCraft:recyclerIdle,,NuclearCraft,TRUE,,,65,166,5,,,,,,
|
||||
nc.crafting.nei.NuclearWorkspaceRecipeHandler,NuclearCraft,NuclearCraft:nuclearWorkspace,,NuclearCraft,TRUE,,,130,,2,,,,,,
|
||||
ganymedes01.etfuturum.NEI_EtFuturum_Config$NEI_Recipes_Smoker,EtFuturum Requiem,etfuturum:lit_smoker,,etfuturum,TRUE,,,65,166,5,,,,,,
|
||||
ganymedes01.etfuturum.NEI_EtFuturum_Config$NEI_Recipes_BlastFurnace,EtFuturum Requiem,etfuturum:lit_blast_furnace,,etfuturum,TRUE,,,65,166,5,,,,,,
|
||||
|
@@ -108,6 +108,9 @@ nei.options.keys.world.creative=Gamemode
|
||||
nei.options.keys.world.creative.tip=Cycle Gamemode
|
||||
|
||||
nei.options.inventory=Inventory
|
||||
nei.options.inventory.worldSpecificBookmarks=World Specific Bookmarks
|
||||
nei.options.inventory.worldSpecificBookmarks.true=Yes
|
||||
nei.options.inventory.worldSpecificBookmarks.false=No
|
||||
nei.options.inventory.bookmarksEnabled=Bookmarks Panel Visibility
|
||||
nei.options.inventory.bookmarksEnabled.true=Visible
|
||||
nei.options.inventory.bookmarksEnabled.false=Hidden
|
||||
@@ -117,6 +120,9 @@ nei.options.inventory.jei_style_tabs.false=No [Weirdo]
|
||||
nei.options.inventory.jei_style_item_presence_overlay=JEI Style Item Overlay on ?-Hover
|
||||
nei.options.inventory.jei_style_item_presence_overlay.true=Yes
|
||||
nei.options.inventory.jei_style_item_presence_overlay.false=No
|
||||
nei.options.inventory.jei_style_recipe_catalyst=JEI Style Recipe Catalysts
|
||||
nei.options.inventory.jei_style_recipe_catalyst.true=Yes
|
||||
nei.options.inventory.jei_style_recipe_catalyst.false=No
|
||||
nei.options.inventory.saveCurrentRecipeInBookmarksEnabled=Save Current Recipe in Bookmarks
|
||||
nei.options.inventory.saveCurrentRecipeInBookmarksEnabled.true=Enabled
|
||||
nei.options.inventory.saveCurrentRecipeInBookmarksEnabled.false=Disabled
|
||||
@@ -187,6 +193,9 @@ nei.options.tools=Tools
|
||||
nei.options.tools.handler_load_from_config=Load handlers from Config
|
||||
nei.options.tools.handler_load_from_config.true=Config
|
||||
nei.options.tools.handler_load_from_config.false=JAR
|
||||
nei.options.tools.catalyst_load_from_config=Load catalysts from Config
|
||||
nei.options.tools.catalyst_load_from_config.true=Config
|
||||
nei.options.tools.catalyst_load_from_config.false=JAR
|
||||
nei.options.tools.dump=Data Dumps
|
||||
nei.options.tools.dump.dump=Dump
|
||||
nei.options.tools.dump.dumped=%s IDs dumped to %s
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 103 B |
Reference in new issue
Block a user