mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 10:44:45 +00:00
Compare commits
66
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc400ea560 | ||
|
|
ea03cfa17d | ||
|
|
94676e0934 | ||
|
|
f7ba34c0af | ||
|
|
db1fd255bb | ||
|
|
94ca7f3134 | ||
|
|
dea024173f | ||
|
|
af320a6c9f | ||
|
|
dcb10bb79d | ||
|
|
d3b6603d06 | ||
|
|
adf2065305 | ||
|
|
e30f6a41ad | ||
|
|
b1a45d0305 | ||
|
|
566d1b095d | ||
|
|
f35a92a101 | ||
|
|
fdf130f741 | ||
|
|
064f31f8db | ||
|
|
9b081ed2a7 | ||
|
|
2fc2ecf082 | ||
|
|
bc7efcfce5 | ||
|
|
0c5af2b892 | ||
|
|
0c61e559ec | ||
|
|
b94bd11e64 | ||
|
|
151a9957de | ||
|
|
b011024164 | ||
|
|
74d98a86f3 | ||
|
|
bd5946f5bf | ||
|
|
1647e8765f | ||
|
|
744b2ffc64 | ||
|
|
e88348aabf | ||
|
|
4766d90db0 | ||
|
|
1dc02a3730 | ||
|
|
a6a5e19e80 | ||
|
|
e9ab2eba9e | ||
|
|
0e3ff1ee06 | ||
|
|
95e9ac3c89 | ||
|
|
1ed004e619 | ||
|
|
153da523d6 | ||
|
|
c732361bbc | ||
|
|
bdb206b45d | ||
|
|
aa44a97f80 | ||
|
|
00c4411ec5 | ||
|
|
4f23d21d37 | ||
|
|
8569431e1d | ||
|
|
5b9c27e253 | ||
|
|
d613d06471 | ||
|
|
65ffbad491 | ||
|
|
885609720e | ||
|
|
bacf246504 | ||
|
|
1ab3350eb8 | ||
|
|
f3aa12483d | ||
|
|
d86c472790 | ||
|
|
4124151208 | ||
|
|
68ad800620 | ||
|
|
2c7207485d | ||
|
|
e8094794c3 | ||
|
|
ad86d8f9c5 | ||
|
|
30c87e9160 | ||
|
|
5eeb001534 | ||
|
|
962754ee10 | ||
|
|
0e34840c21 | ||
|
|
a12fadb10d | ||
|
|
9218e233aa | ||
|
|
23e16abae6 | ||
|
|
b3cb4db9ca | ||
|
|
45fea43a4b |
No files matched your search
+10
-2
@@ -1,6 +1,7 @@
|
||||
.gradle
|
||||
.settings
|
||||
/.idea/
|
||||
/.vscode/
|
||||
/run/
|
||||
/build/
|
||||
/eclipse/
|
||||
@@ -25,6 +26,13 @@ whitelist.json
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
src/main/resources/mixins.*([!.]).json
|
||||
*.bat
|
||||
.DS_Store
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
.factorypath
|
||||
addon.local.gradle
|
||||
addon.local.gradle.kts
|
||||
addon.late.local.gradle
|
||||
addon.late.local.gradle.kts
|
||||
layout.json
|
||||
@@ -12,7 +12,7 @@ If you have issues with NEI outside of the GTNH modpack you may report them in t
|
||||
- Uses a parallel stream to search the item list over multiple cores, resulting in 2-6x faster searches on average
|
||||
- Loads the recipe handlers in parallel
|
||||
* A textbox for search with most of the features you'd expect - moving forward, backwards, selection, etc
|
||||
* Bookmarks! What are you in the process of crafting? Bookmark it using either 'A' or configure your own key.
|
||||
* Bookmarks! Are you in the process of crafting? Bookmark it using either 'A' or configure your own key.
|
||||
* Toggle bookmark pane. Default shortcut key `B`. Item Subsets menu is only available if bookmarks are not visible.
|
||||
* Utility/Cheat buttons line up and wrap based on GUI size
|
||||
* ItemList is no longer regenerated from the ItemRegistry on every inventory load
|
||||
@@ -27,16 +27,9 @@ If you have issues with NEI outside of the GTNH modpack you may report them in t
|
||||
* Remove TMI style
|
||||
* Removed inventory Load/Save state
|
||||
|
||||
## Development
|
||||
Before launching, you need to add
|
||||
```
|
||||
-Dfml.coreMods.load=codechicken.nei.asm.NEICorePlugin
|
||||
```
|
||||
as a command line argument to the VM.
|
||||
|
||||
## License
|
||||
|
||||
GTNH Modifications Copyright (c) 2019-2022 mitchej123 and the GTNH Team
|
||||
GTNH Modifications Copyright (c) 2019-2024 mitchej123 and the GTNH Team
|
||||
|
||||
Licensed under LGPL-3.0 or later - use this however you want, but please give back any modifications
|
||||
|
||||
|
||||
+2
-1530
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -1,7 +1,7 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:CodeChickenLib:1.1.6:dev')
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.1.10:dev')
|
||||
shadowImplementation('org.apache.commons:commons-csv:1.9.0')
|
||||
api('com.github.GTNewHorizons:CodeChickenLib:1.2.1:dev')
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.2.1:dev')
|
||||
shadowImplementation('org.apache.commons:commons-csv:1.10.0')
|
||||
}
|
||||
+134
-40
@@ -1,90 +1,137 @@
|
||||
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
|
||||
# LOCAL to test local config updates.
|
||||
gtnh.settings.blowdryerTag = 0.2.0
|
||||
|
||||
# Human-readable mod name, available for mcmod.info population.
|
||||
modName = NotEnoughItems
|
||||
|
||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
|
||||
# Conventionally lowercase.
|
||||
modId = NotEnoughItems
|
||||
|
||||
# Root package of the mod, used to find various classes in other properties,
|
||||
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||
modGroup = codechicken.nei
|
||||
|
||||
# WHY is there no version field?
|
||||
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
||||
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
||||
# Whether to use modGroup as the maven publishing group.
|
||||
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
|
||||
useModGroupForPublishing = false
|
||||
|
||||
# Will update your build.gradle automatically whenever an update is available
|
||||
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||
autoUpdateBuildScript = false
|
||||
|
||||
# Version of Minecraft to target
|
||||
minecraftVersion = 1.7.10
|
||||
|
||||
# Version of Minecraft Forge to target
|
||||
forgeVersion = 10.13.4.1614
|
||||
|
||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
|
||||
# restart Minecraft in development. Choose this dependent on your mod:
|
||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
|
||||
channel = stable
|
||||
|
||||
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
|
||||
mappingsVersion = 12
|
||||
|
||||
# Defines other MCP mappings for dependency deobfuscation.
|
||||
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
|
||||
# Select a default username for testing your mod. You can always override this per-run by running
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Define a source file of your project with:
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...])
|
||||
# Leave these properties empty to skip individual token replacements
|
||||
# Generate a class with String fields for the mod id, name, version and group name named with the fields below
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = false
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
enableGenericInjection = false
|
||||
|
||||
# Generate a class with a String field for the mod version named as defined below.
|
||||
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
|
||||
generateGradleTokenClass = codechicken.nei.Tags
|
||||
gradleTokenModId = MODID
|
||||
gradleTokenModName = MODNAME
|
||||
|
||||
# Name of the token containing the project's current version to generate/replace.
|
||||
gradleTokenVersion = VERSION
|
||||
gradleTokenGroupName = GROUPNAME
|
||||
|
||||
# [DEPRECATED] Mod ID replacement token.
|
||||
gradleTokenModId =
|
||||
|
||||
# [DEPRECATED] Mod name replacement token.
|
||||
gradleTokenModName =
|
||||
|
||||
# [DEPRECATED] Mod Group replacement token.
|
||||
gradleTokenGroupName =
|
||||
|
||||
# [DEPRECATED]
|
||||
# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java
|
||||
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...])
|
||||
# Leave these properties empty to skip individual token replacements
|
||||
# version in @Mod([...], version = VERSION, [...]).
|
||||
# Leave these properties empty to skip individual token replacements.
|
||||
replaceGradleTokenInFile =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
|
||||
apiPackage =
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
# There can be multiple files in a space-separated list.
|
||||
# Example value: mymodid_at.cfg nei_at.cfg
|
||||
accessTransformersFile = nei_at.cfg
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
# Specify the location of your implementation of IMixinPlugin. Leave it empty otherwise.
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatibility only
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass = asm.NEICorePlugin
|
||||
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = true
|
||||
|
||||
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
||||
# responsibility check the licence and request permission for distribution, if required.
|
||||
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||
forceEnableMixins = false
|
||||
|
||||
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
|
||||
# responsibility to check the license and request permission for distribution if required.
|
||||
usesShadowedDependencies = true
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
|
||||
# their own classes, making the minimization unreliable.
|
||||
minimizeShadowedDependencies = true
|
||||
|
||||
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId = 358228
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
# and the name is the CurseForge project id of the other mod.
|
||||
curseForgeRelations = requiredDependency:codechickencore-unofficial;requiredDependency:codechickenlib-unofficial
|
||||
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
usesMavenPublishing = true
|
||||
|
||||
# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token.
|
||||
# Maven repository to publish the mod to.
|
||||
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
|
||||
|
||||
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
|
||||
#
|
||||
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||
# Leave this empty if you don't want to publish on Modrinth.
|
||||
|
||||
# Leave this empty if you don't want to publish to Modrinth.
|
||||
modrinthProjectId = notenoughitems-unofficial
|
||||
|
||||
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||
@@ -92,7 +139,54 @@ modrinthProjectId = notenoughitems-unofficial
|
||||
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
modrinthRelations = required-project\:codechickenlib-unofficial;required-project\:codechickencore-unofficial
|
||||
|
||||
modrinthRelations = required-project:codechickenlib-unofficial;required-project:codechickencore-unofficial
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
#
|
||||
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId = 358228
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
# and the name is the CurseForge project slug of the other mod.
|
||||
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
curseForgeRelations = requiredDependency\:codechickencore-unofficial;requiredDependency\:codechickenlib-unofficial
|
||||
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
|
||||
# projects. New projects should not use this parameter.
|
||||
# customArchiveBaseName =
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
|
||||
# versionPattern =
|
||||
|
||||
# Uncomment to prevent the source code from being published.
|
||||
# noPublishedSources = true
|
||||
|
||||
# Uncomment this to disable Spotless checks.
|
||||
# This should only be uncommented to keep it easier to sync with upstream/other forks.
|
||||
# That is, if there is no other active fork/upstream, NEVER change this.
|
||||
# disableSpotless = true
|
||||
|
||||
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
|
||||
# disableCheckstyle = true
|
||||
|
||||
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
|
||||
# (force use delegated build).
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
|
||||
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
|
||||
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
|
||||
# ideaOverrideBuildType = idea
|
||||
|
||||
# Whether IDEA should run spotless checks when pressing the Build button.
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -83,10 +83,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -133,10 +131,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
|
||||
Vendored
+10
-10
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
|
||||
@@ -1,15 +1,4 @@
|
||||
// Add any additional repositiroes for your dependencies here
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name 'GTNH Maven'
|
||||
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||
}
|
||||
maven {
|
||||
url 'https://cursemaven.com'
|
||||
content {
|
||||
includeGroup 'curse.maven'
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-10
@@ -4,10 +4,10 @@ pluginManagement {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
||||
includeGroup("com.gtnewhorizons")
|
||||
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
@@ -17,12 +17,10 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.15'
|
||||
}
|
||||
|
||||
blowdryerSetup {
|
||||
repoSubfolder 'gtnhShared'
|
||||
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
|
||||
//devLocal '.' // Use this when testing config updates locally
|
||||
}
|
||||
|
||||
|
||||
rootProject.name = "NotEnoughItems"
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiChest;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IBookmarkContainerHandler;
|
||||
|
||||
public class BookmarkContainerInfo {
|
||||
|
||||
private static final HashMap<Class<? extends GuiContainer>, IBookmarkContainerHandler> handlerMap = new HashMap<>();
|
||||
|
||||
public static void registerBookmarkContainerHandler(Class<? extends GuiContainer> classz,
|
||||
IBookmarkContainerHandler handler) {
|
||||
handlerMap.put(classz, handler);
|
||||
}
|
||||
|
||||
public static boolean hasBookmarkContainerHandler(Class<? extends GuiContainer> classz) {
|
||||
return handlerMap.containsKey(classz);
|
||||
}
|
||||
|
||||
public static IBookmarkContainerHandler getBookmarkContainerHandler(GuiContainer gui) {
|
||||
if (gui != null) {
|
||||
return handlerMap.get(gui.getClass());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void load() {
|
||||
API.registerBookmarkContainerHandler(GuiChest.class, new DefaultBookmarkContainerHandler());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import codechicken.nei.BookmarkPanel.ItemStackMetadata;
|
||||
import codechicken.nei.recipe.BookmarkRecipeId;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
public class BookmarkCraftingChain {
|
||||
|
||||
public HashMap<ItemStack, ItemStack> calculatedItems = new HashMap<>();
|
||||
public HashMap<ItemStack, Integer> multiplier = new HashMap<>();
|
||||
|
||||
public HashMap<ItemStack, ItemStack> inputs = new HashMap<>();
|
||||
public HashMap<ItemStack, ItemStack> outputs = new HashMap<>();
|
||||
public HashMap<ItemStack, ItemStack> intermediate = new HashMap<>();
|
||||
|
||||
protected static class CraftingChainItem {
|
||||
|
||||
public String guid;
|
||||
public int stackIndex = 0;
|
||||
public int recipeIndex = 0;
|
||||
public int factor = 0;
|
||||
public int count = 0;
|
||||
public boolean ingredient = false;
|
||||
public int fluidCellAmount = 1;
|
||||
public ItemStack stack = null;
|
||||
|
||||
public CraftingChainItem(ItemStack stack, ItemStackMetadata stackMetadata) {
|
||||
FluidStack fluid = StackInfo.getFluid(stack);
|
||||
this.recipeIndex = getRecipeIndex(stackMetadata.recipeId);
|
||||
this.ingredient = stackMetadata.ingredient;
|
||||
this.stack = stack;
|
||||
|
||||
if (fluid != null) {
|
||||
this.stackIndex = getStackIndex(fluid);
|
||||
this.count = fluid.amount * Math.max(0, stack.stackSize);
|
||||
this.fluidCellAmount = StackInfo.isFluidContainer(stack) ? fluid.amount : 1;
|
||||
this.factor = this.fluidCellAmount * stackMetadata.factor;
|
||||
} else {
|
||||
this.stackIndex = getStackIndex(stack);
|
||||
this.count = StackInfo.itemStackToNBT(stack).getInteger("Count");
|
||||
this.factor = stackMetadata.factor;
|
||||
}
|
||||
|
||||
this.guid = this.stackIndex + " " + this.recipeIndex;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack(long count) {
|
||||
return StackInfo.loadFromNBT(
|
||||
StackInfo.itemStackToNBT(this.stack),
|
||||
this.factor > 0 ? (count / this.fluidCellAmount) : 0);
|
||||
}
|
||||
|
||||
public static void clearStatic() {
|
||||
itemCache.clear();
|
||||
fluidCache.clear();
|
||||
recipeCache.clear();
|
||||
}
|
||||
|
||||
private static HashMap<ItemStack, Integer> itemCache = new HashMap<>();
|
||||
|
||||
private static int getStackIndex(ItemStack stackA) {
|
||||
|
||||
if (!itemCache.containsKey(stackA)) {
|
||||
|
||||
for (ItemStack item : itemCache.keySet()) {
|
||||
if (StackInfo.equalItemAndNBT(stackA, item, true)) {
|
||||
itemCache.put(stackA, itemCache.get(item));
|
||||
return itemCache.get(stackA);
|
||||
}
|
||||
}
|
||||
|
||||
itemCache.put(stackA, itemCache.size() + fluidCache.size());
|
||||
}
|
||||
|
||||
return itemCache.get(stackA);
|
||||
}
|
||||
|
||||
private static HashMap<FluidStack, Integer> fluidCache = new HashMap<>();
|
||||
|
||||
private static int getStackIndex(FluidStack fluidA) {
|
||||
|
||||
if (!fluidCache.containsKey(fluidA)) {
|
||||
for (FluidStack item : fluidCache.keySet()) {
|
||||
if (fluidA.isFluidEqual(item)) {
|
||||
fluidCache.put(fluidA, fluidCache.get(item));
|
||||
return fluidCache.get(fluidA);
|
||||
}
|
||||
}
|
||||
|
||||
fluidCache.put(fluidA, itemCache.size() + fluidCache.size());
|
||||
}
|
||||
|
||||
return fluidCache.get(fluidA);
|
||||
}
|
||||
|
||||
private static HashMap<BookmarkRecipeId, Integer> recipeCache = new HashMap<>();
|
||||
|
||||
private static int getRecipeIndex(BookmarkRecipeId recipe) {
|
||||
|
||||
if (recipe == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!recipeCache.containsKey(recipe)) {
|
||||
for (BookmarkRecipeId item : recipeCache.keySet()) {
|
||||
if (item.equals(recipe)) {
|
||||
recipeCache.put(recipe, recipeCache.get(item));
|
||||
return recipeCache.get(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
recipeCache.put(recipe, recipeCache.size());
|
||||
}
|
||||
|
||||
return recipeCache.get(recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected static class CraftingChainRequest {
|
||||
|
||||
public List<CraftingChainItem> items = new ArrayList<>();
|
||||
|
||||
public HashMap<Integer, Integer> multiplier = new HashMap<>();
|
||||
public HashMap<String, Long> counts = new HashMap<>();
|
||||
|
||||
public HashMap<Integer, HashSet<CraftingChainItem>> inputs = new HashMap<>();
|
||||
public HashMap<Integer, HashSet<CraftingChainItem>> outputs = new HashMap<>();
|
||||
|
||||
public HashSet<Integer> initialItems = new HashSet<>();
|
||||
public HashSet<Integer> startedIngrs = new HashSet<>();
|
||||
|
||||
public CraftingChainRequest(List<ItemStack> items, List<ItemStackMetadata> metadata) {
|
||||
HashSet<Integer> inputs = new HashSet<>();
|
||||
HashSet<Integer> outputs = new HashSet<>();
|
||||
|
||||
for (int index = 0; index < items.size(); index++) {
|
||||
CraftingChainItem item = new CraftingChainItem(items.get(index), metadata.get(index));
|
||||
item.guid = item.ingredient ? "i" + item.guid : "r" + item.guid;
|
||||
this.items.add(item);
|
||||
|
||||
if (this.multiplier.get(item.recipeIndex) == null) {
|
||||
this.multiplier.put(item.recipeIndex, 0);
|
||||
}
|
||||
|
||||
this.counts.put(item.guid, this.counts.getOrDefault(item.guid, 0L) + item.count);
|
||||
|
||||
if (item.ingredient) {
|
||||
inputs.add(item.recipeIndex);
|
||||
|
||||
if (this.inputs.get(item.stackIndex) == null) {
|
||||
this.inputs.put(item.stackIndex, new HashSet<>());
|
||||
}
|
||||
|
||||
this.inputs.get(item.stackIndex).add(item);
|
||||
} else {
|
||||
outputs.add(item.recipeIndex);
|
||||
|
||||
if (this.outputs.get(item.stackIndex) == null) {
|
||||
this.outputs.put(item.stackIndex, new HashSet<>());
|
||||
}
|
||||
|
||||
this.outputs.get(item.stackIndex).add(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (int recipeIndex : this.multiplier.keySet()) {
|
||||
if (recipeIndex == -1 || !inputs.contains(recipeIndex) || !outputs.contains(recipeIndex)) {
|
||||
this.initialItems.add(recipeIndex);
|
||||
}
|
||||
}
|
||||
|
||||
for (CraftingChainItem item : this.items) {
|
||||
if (item.ingredient == false && !this.initialItems.contains(item.recipeIndex)) {
|
||||
this.startedIngrs.add(item.stackIndex);
|
||||
}
|
||||
}
|
||||
|
||||
CraftingChainItem.clearStatic();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void refresh(List<ItemStack> items, List<ItemStackMetadata> metadata) {
|
||||
CraftingChainRequest request = new CraftingChainRequest(items, metadata);
|
||||
HashMap<Integer, Long> iShift = new HashMap<>();
|
||||
HashMap<Integer, Long> oShift = new HashMap<>();
|
||||
boolean change = true;
|
||||
int iteration = 100;
|
||||
|
||||
while (--iteration > 0 && change) {
|
||||
change = false;
|
||||
for (int stackIndex : request.startedIngrs) {
|
||||
change = calculateShift(request, stackIndex) || change;
|
||||
}
|
||||
}
|
||||
|
||||
this.inputs.clear();
|
||||
this.outputs.clear();
|
||||
this.intermediate.clear();
|
||||
this.calculatedItems.clear();
|
||||
this.multiplier.clear();
|
||||
|
||||
for (CraftingChainItem item : request.items) {
|
||||
if (request.initialItems.contains(item.recipeIndex)) {
|
||||
long iCount = calculateCount(request, request.inputs.get(item.stackIndex))
|
||||
- iShift.getOrDefault(item.stackIndex, 0L);
|
||||
this.calculatedItems.put(item.stack, item.stack);
|
||||
|
||||
if (iCount == 0) {
|
||||
this.inputs.put(item.stack, item.getItemStack(0));
|
||||
} else {
|
||||
long count = Math.min(iCount, item.count);
|
||||
this.inputs.put(item.stack, item.getItemStack(count));
|
||||
iShift.put(item.stackIndex, iShift.getOrDefault(item.stackIndex, 0L) + count);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (CraftingChainItem item : request.items) {
|
||||
if (!request.initialItems.contains(item.recipeIndex)) {
|
||||
long count = item.count + item.factor * request.multiplier.get(item.recipeIndex);
|
||||
this.calculatedItems.put(item.stack, item.getItemStack(count));
|
||||
|
||||
if (item.ingredient) { // input
|
||||
long oCount = calculateCount(request, request.outputs.get(item.stackIndex))
|
||||
- oShift.getOrDefault(item.stackIndex, 0L);
|
||||
|
||||
if (oCount < count) {
|
||||
this.inputs.put(item.stack, item.getItemStack(count - oCount));
|
||||
oShift.put(item.stackIndex, oShift.getOrDefault(item.stackIndex, 0L) + oCount);
|
||||
} else if (oCount >= count) {
|
||||
this.intermediate.put(item.stack, item.getItemStack(0));
|
||||
oShift.put(item.stackIndex, oShift.getOrDefault(item.stackIndex, 0L) + count);
|
||||
}
|
||||
|
||||
} else { // output
|
||||
long iCount = calculateCount(request, request.inputs.get(item.stackIndex))
|
||||
- iShift.getOrDefault(item.stackIndex, 0L);
|
||||
this.multiplier.put(item.stack, item.factor > 0 ? (int) (count / item.factor) : 0);
|
||||
|
||||
if (iCount < count) {
|
||||
this.outputs.put(item.stack, item.getItemStack(count - iCount));
|
||||
iShift.put(item.stackIndex, iShift.getOrDefault(item.stackIndex, 0L) + iCount);
|
||||
} else if (iCount >= count) {
|
||||
this.intermediate.put(item.stack, item.getItemStack(0));
|
||||
iShift.put(item.stackIndex, iShift.getOrDefault(item.stackIndex, 0L) + count);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean calculateShift(CraftingChainRequest request, int stackIndex) {
|
||||
|
||||
if (!request.outputs.containsKey(stackIndex)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int minRecipeIndex = 0;
|
||||
int minShift = Integer.MAX_VALUE;
|
||||
|
||||
for (CraftingChainItem item : request.outputs.get(stackIndex)) {
|
||||
if (!request.initialItems.contains(item.recipeIndex) && item.factor > 0) {
|
||||
long ingrCount = calculateCount(request, request.inputs.get(item.stackIndex), item.recipeIndex);
|
||||
long outputCount = calculateCount(request, request.outputs.get(item.stackIndex));
|
||||
long shift = (long) Math.ceil((ingrCount - outputCount) / (double) item.factor);
|
||||
|
||||
if (shift > 0 && shift < minShift) {
|
||||
minShift = (int) shift;
|
||||
minRecipeIndex = item.recipeIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (minShift < Integer.MAX_VALUE) {
|
||||
request.multiplier.put(minRecipeIndex, request.multiplier.get(minRecipeIndex) + minShift);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private long calculateCount(CraftingChainRequest request, HashSet<CraftingChainItem> items) {
|
||||
return calculateCount(request, items, -1);
|
||||
}
|
||||
|
||||
private long calculateCount(CraftingChainRequest request, HashSet<CraftingChainItem> items, int recipeIndex) {
|
||||
long count = 0L;
|
||||
|
||||
if (items != null) {
|
||||
for (CraftingChainItem item : items) {
|
||||
if (item.recipeIndex != recipeIndex || recipeIndex == -1) {
|
||||
count += request.counts.get(item.guid) + item.factor * request.multiplier.get(item.recipeIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -9,9 +9,6 @@ import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -31,12 +28,15 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import org.apache.commons.csv.CSVFormat;
|
||||
import org.apache.commons.csv.CSVParser;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import codechicken.core.ClientUtils;
|
||||
import codechicken.core.GuiModListScroll;
|
||||
import codechicken.lib.packet.PacketCustom;
|
||||
@@ -44,25 +44,16 @@ import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.recipe.GuiRecipeTab;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cpw.mods.fml.client.CustomModLoadingErrorDisplayException;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ClientHandler {
|
||||
|
||||
private static String[] defaultSerialHandlers = {
|
||||
"WayofTime.alchemicalWizardry.client.nei.NEIAlchemyRecipeHandler" };
|
||||
private static String[] defaultHeightHackHandlerRegex = { "buildcraft.compat.nei.*",
|
||||
"cofh.thermalexpansion.plugins.nei.handlers.*", "crazypants.enderio.nei.*",
|
||||
"forestry.factory.recipes.nei.*", "ic2.neiIntegration.core.recipehandler.*", "mariculture.plugins.nei.*",
|
||||
"redgear.brewcraft.plugins.nei.*", "tconstruct.plugins.nei.*",
|
||||
"WayofTime.alchemicalWizardry.client.nei.*", };
|
||||
private static String[] defaultHandlerOrdering = {
|
||||
"# Each line in this file should either be a comment (starts with '#') or an ordering.",
|
||||
"# Ordering lines are <handler ID>,<ordering number>.",
|
||||
@@ -157,6 +148,7 @@ public class ClientHandler {
|
||||
public static void preInit() {
|
||||
loadSerialHandlers();
|
||||
loadHeightHackHandlers();
|
||||
loadHiddenHandlers();
|
||||
ItemInfo.preInit();
|
||||
StackInfo.loadGuidFilters();
|
||||
}
|
||||
@@ -166,16 +158,19 @@ public class ClientHandler {
|
||||
if (!file.exists()) {
|
||||
try (FileWriter writer = new FileWriter(file)) {
|
||||
NEIClientConfig.logger.info("Creating default serial handlers list {}", file);
|
||||
Collection<String> toSave = Loader.isModLoaded("dreamcraft") ? Collections.singletonList("")
|
||||
: Arrays.asList(defaultSerialHandlers);
|
||||
IOUtils.writeLines(toSave, "\n", writer);
|
||||
URL defaultSerialHandlersResource = ClientHandler.class
|
||||
.getResource("/assets/nei/cfg/serialhandlers.cfg");
|
||||
if (defaultSerialHandlersResource != null) {
|
||||
IOUtils.copy(defaultSerialHandlersResource.openStream(), writer);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Failed to save default serial handlers list to file {}", file, e);
|
||||
}
|
||||
}
|
||||
try (FileReader reader = new FileReader(file)) {
|
||||
NEIClientConfig.logger.info("Loading serial handlers from file {}", file);
|
||||
NEIClientConfig.serialHandlers = new HashSet<>(IOUtils.readLines(reader));
|
||||
NEIClientConfig.serialHandlers = IOUtils.readLines(reader).stream().filter((line) -> !line.startsWith("#"))
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Failed to load serial handlers from file {}", file, e);
|
||||
}
|
||||
@@ -186,8 +181,11 @@ public class ClientHandler {
|
||||
if (!file.exists()) {
|
||||
try (FileWriter writer = new FileWriter(file)) {
|
||||
NEIClientConfig.logger.info("Creating default height hack handlers list {}", file);
|
||||
Collection<String> toSave = Arrays.asList(defaultHeightHackHandlerRegex);
|
||||
IOUtils.writeLines(toSave, "\n", writer);
|
||||
URL defaultHeightHackHandlersResource = ClientHandler.class
|
||||
.getResource("/assets/nei/cfg/heighthackhandlers.cfg");
|
||||
if (defaultHeightHackHandlersResource != null) {
|
||||
IOUtils.copy(defaultHeightHackHandlersResource.openStream(), writer);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Failed to save default height hack handlers list to file {}", file, e);
|
||||
}
|
||||
@@ -195,13 +193,38 @@ public class ClientHandler {
|
||||
|
||||
try (FileReader reader = new FileReader(file)) {
|
||||
NEIClientConfig.logger.info("Loading height hack handlers from file {}", file);
|
||||
NEIClientConfig.heightHackHandlerRegex = IOUtils.readLines(reader).stream().map(Pattern::compile)
|
||||
NEIClientConfig.heightHackHandlerRegex = IOUtils.readLines(reader).stream()
|
||||
.filter((line) -> !line.startsWith("#")).map(Pattern::compile)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Failed to load height hack handlers from file {}", file, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadHiddenHandlers() {
|
||||
File file = NEIClientConfig.hiddenHandlersFile;
|
||||
if (!file.exists()) {
|
||||
try (FileWriter writer = new FileWriter(file)) {
|
||||
NEIClientConfig.logger.info("Creating default hidden handlers list {}", file);
|
||||
URL defaultHeightHackHandlersResource = ClientHandler.class
|
||||
.getResource("/assets/nei/cfg/hiddenhandlers.cfg");
|
||||
if (defaultHeightHackHandlersResource != null) {
|
||||
IOUtils.copy(defaultHeightHackHandlersResource.openStream(), writer);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Failed to save default hidden handlers list to file {}", file, e);
|
||||
}
|
||||
}
|
||||
|
||||
try (FileReader reader = new FileReader(file)) {
|
||||
NEIClientConfig.logger.info("Loading hidden handlers from file {}", file);
|
||||
NEIClientConfig.hiddenHandlers = IOUtils.readLines(reader).stream().filter((line) -> !line.startsWith("#"))
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Failed to load hidden handlers from file {}", file, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void load() {
|
||||
instance = new ClientHandler();
|
||||
|
||||
@@ -276,7 +299,11 @@ public class ClientHandler {
|
||||
|
||||
if (!NEIClientConfig.isEnabled()) return;
|
||||
|
||||
KeyManager.tickKeyStates();
|
||||
/*
|
||||
* NEI plugins are loaded in a separate thread. Make sure loading them has finished otherwise a CME might
|
||||
* occur in KeyManager if a plugin calls API.addKeyBind() during initialization.
|
||||
*/
|
||||
if (NEIClientConfig.isLoaded()) KeyManager.tickKeyStates();
|
||||
|
||||
NEIController.updateUnlimitedItems(mc.thePlayer.inventory);
|
||||
if (mc.currentScreen == null) NEIController.processCreativeCycling(mc.thePlayer.inventory);
|
||||
@@ -306,6 +333,15 @@ public class ClientHandler {
|
||||
if (NEIClientConfig.isEnabled()) WorldOverlayRenderer.render(event.partialTicks);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (event.world == mc.theWorld) {
|
||||
NEIClientConfig.unloadWorld();
|
||||
}
|
||||
}
|
||||
|
||||
public void loadWorld(World world, boolean fromServer) {
|
||||
if (world != lastworld) {
|
||||
SMPmagneticItems.clear();
|
||||
|
||||
@@ -81,7 +81,6 @@ public class ContainerPotionCreator extends ContainerExtended {
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
NEIClientConfig.global.nbt.setTag("potionStore", tag);
|
||||
NEIClientConfig.global.saveNBT();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.api.IBookmarkContainerHandler;
|
||||
|
||||
public class DefaultBookmarkContainerHandler implements IBookmarkContainerHandler {
|
||||
|
||||
@Override
|
||||
public void pullBookmarkItemsFromContainer(GuiContainer guiContainer, ArrayList<ItemStack> bookmarkItems) {
|
||||
FastTransferManager manager = new FastTransferManager();
|
||||
LinkedList<ItemStack> containerStacks = manager.saveContainer(guiContainer.inventorySlots);
|
||||
|
||||
for (ItemStack bookmarkItem : bookmarkItems) {
|
||||
|
||||
int bookmarkSizeBackup = bookmarkItem.stackSize;
|
||||
|
||||
for (int i = 0; i < containerStacks.size() - 4 * 9; i++) { // Last 36 slots are player inventory
|
||||
ItemStack containerItem = containerStacks.get(i);
|
||||
|
||||
if (containerItem == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bookmarkItem.isItemEqual(containerItem)) {
|
||||
if (bookmarkItem.stackSize <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
int transferAmount = Math.min(bookmarkItem.stackSize, containerItem.stackSize);
|
||||
|
||||
manager.transferItems(guiContainer, i, transferAmount);
|
||||
bookmarkItem.stackSize -= transferAmount;
|
||||
|
||||
if (bookmarkItem.stackSize == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
bookmarkItem.stackSize = bookmarkSizeBackup;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,6 +184,12 @@ public class FastTransferManager {
|
||||
moveOutputSet(window, fromSlot, toSlot);
|
||||
}
|
||||
|
||||
public void transferItems(GuiContainer window, int fromSlot, int itemCount) {
|
||||
for (int i = 0; i < itemCount; i++) {
|
||||
transferItem(window, fromSlot);
|
||||
}
|
||||
}
|
||||
|
||||
public void moveOutputSet(GuiContainer window, int fromSlot, int toSlot) {
|
||||
if (NEIClientUtils.getHeldItem() != null) return;
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ public class GuiEnchantmentModifier extends GuiContainer {
|
||||
|
||||
public static void toggleEnchantmentValidation() {
|
||||
NEIClientConfig.world.nbt.setBoolean("validateenchantments", !validateEnchantments());
|
||||
NEIClientConfig.world.saveNBT();
|
||||
}
|
||||
|
||||
protected void actionPerformed(GuiButton guibutton) {
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawRect;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.nei.ItemPanel.ItemPanelSlot;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
public class ItemHistoryPanel extends Widget {
|
||||
|
||||
protected int mouseDownSlot = -1;
|
||||
protected ItemsGrid grid;
|
||||
|
||||
public ItemHistoryPanel() {
|
||||
grid = new ItemsGrid();
|
||||
}
|
||||
|
||||
public void draw(int mousex, int mousey) {
|
||||
|
||||
if (NEIClientConfig.getIntSetting("inventory.history.splittingMode") == 0) {
|
||||
drawRect(x, y, w, h, NEIClientConfig.getSetting("inventory.history.historyColor").getHexValue());
|
||||
} else {
|
||||
drawSplittingArea(x, y, w, h, NEIClientConfig.getSetting("inventory.history.historyColor").getHexValue());
|
||||
}
|
||||
|
||||
grid.draw(mousex, mousey);
|
||||
}
|
||||
|
||||
public void update() {
|
||||
grid.update();
|
||||
}
|
||||
|
||||
public void addItem(ItemStack stack) {
|
||||
if (stack != null) {
|
||||
ItemStack is = StackInfo.loadFromNBT(StackInfo.itemStackToNBT(stack), 0);
|
||||
|
||||
grid.realItems.removeIf(historyStack -> StackInfo.equalItemAndNBT(historyStack, stack, true));
|
||||
grid.realItems.add(0, is);
|
||||
|
||||
if (grid.realItems.size() > (grid.rows * grid.columns)) {
|
||||
grid.realItems.remove(grid.rows * grid.columns);
|
||||
}
|
||||
|
||||
grid.onItemsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void resize(GuiContainer gui) {
|
||||
grid.setGridSize(x, y, w, h);
|
||||
grid.refresh(gui);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackMouseOver(int mousex, int mousey) {
|
||||
ItemPanelSlot slot = getSlotMouseOver(mousex, mousey);
|
||||
return slot == null ? null : slot.item;
|
||||
}
|
||||
|
||||
public ItemPanelSlot getSlotMouseOver(int mousex, int mousey) {
|
||||
return grid.getSlotMouseOver(mousex, mousey);
|
||||
}
|
||||
|
||||
private void drawSplittingArea(int x, int y, int width, int height, int color) {
|
||||
|
||||
float alpha = (float) (color >> 24 & 255) / 255.0F;
|
||||
float red = (float) (color >> 16 & 255) / 255.0F;
|
||||
float green = (float) (color >> 8 & 255) / 255.0F;
|
||||
float blue = (float) (color & 255) / 255.0F;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_LINE_STIPPLE);
|
||||
GL11.glColor4f(red, green, blue, alpha);
|
||||
GL11.glLineWidth(2F);
|
||||
GL11.glLineStipple(2, (short) 0x00FF);
|
||||
|
||||
GL11.glBegin(GL11.GL_LINE_LOOP);
|
||||
|
||||
GL11.glVertex2i(x, y);
|
||||
GL11.glVertex2i(x + width, y);
|
||||
GL11.glVertex2i(x + width, y + height);
|
||||
GL11.glVertex2i(x, y + height);
|
||||
|
||||
GL11.glEnd();
|
||||
|
||||
GL11.glLineStipple(1, (short) 0xFFFF);
|
||||
GL11.glLineWidth(1F);
|
||||
GL11.glDisable(GL11.GL_LINE_STIPPLE);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDragged(int mousex, int mousey, int button, long heldTime) {
|
||||
|
||||
if (mouseDownSlot >= 0 && ItemPanels.itemPanel.draggedStack == null
|
||||
&& NEIClientUtils.getHeldItem() == null
|
||||
&& NEIClientConfig.hasSMPCounterPart()) {
|
||||
|
||||
ItemPanelSlot mouseOverSlot = getSlotMouseOver(mousex, mousey);
|
||||
|
||||
if (mouseOverSlot == null || mouseOverSlot.slotIndex != mouseDownSlot || heldTime > 500) {
|
||||
ItemPanels.itemPanel.draggedStack = getDraggedStackWithQuantity(mouseDownSlot);
|
||||
mouseDownSlot = -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleClick(int mousex, int mousey, int button) {
|
||||
|
||||
if (handleClickExt(mousex, mousey, button)) return true;
|
||||
|
||||
if (NEIClientUtils.getHeldItem() != null) {
|
||||
|
||||
if (!grid.contains(mousex, mousey)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (NEIClientConfig.canPerformAction("delete") && NEIClientConfig.canPerformAction("item")) {
|
||||
if (button == 1) {
|
||||
NEIClientUtils.decreaseSlotStack(-999);
|
||||
} else {
|
||||
NEIClientUtils.deleteHeldItem();
|
||||
}
|
||||
} else {
|
||||
NEIClientUtils.dropHeldItem();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemPanelSlot hoverSlot = getSlotMouseOver(mousex, mousey);
|
||||
if (hoverSlot != null) {
|
||||
|
||||
if (button == 2) {
|
||||
|
||||
if (hoverSlot.item != null) {
|
||||
ItemPanels.itemPanel.draggedStack = getDraggedStackWithQuantity(hoverSlot.slotIndex);
|
||||
}
|
||||
|
||||
} else {
|
||||
mouseDownSlot = hoverSlot.slotIndex;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseUp(int mousex, int mousey, int button) {
|
||||
ItemPanelSlot hoverSlot = getSlotMouseOver(mousex, mousey);
|
||||
|
||||
if (hoverSlot != null && hoverSlot.slotIndex == mouseDownSlot && ItemPanels.itemPanel.draggedStack == null) {
|
||||
ItemStack item = hoverSlot.item.copy();
|
||||
|
||||
if (NEIController.manager.window instanceof GuiRecipe || !NEIClientConfig.canCheatItem(item)) {
|
||||
|
||||
if (button == 0) {
|
||||
GuiCraftingRecipe.openRecipeGui("item", item);
|
||||
} else if (button == 1) {
|
||||
GuiUsageRecipe.openRecipeGui("item", item);
|
||||
}
|
||||
|
||||
mouseDownSlot = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
NEIClientUtils.cheatItem(getDraggedStackWithQuantity(hoverSlot.slotIndex), button, -1);
|
||||
}
|
||||
|
||||
mouseDownSlot = -1;
|
||||
}
|
||||
|
||||
protected ItemStack getDraggedStackWithQuantity(int mouseDownSlot) {
|
||||
ItemStack stack = grid.getItem(mouseDownSlot);
|
||||
|
||||
if (stack != null) {
|
||||
int amount = NEIClientConfig.showItemQuantityWidget() ? NEIClientConfig.getItemQuantity() : 0;
|
||||
|
||||
if (amount == 0) {
|
||||
amount = stack.getMaxStackSize();
|
||||
}
|
||||
|
||||
return NEIServerUtils.copyStack(stack, amount);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -13,15 +14,15 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
|
||||
import codechicken.nei.ThreadOperationTimer.TimeoutException;
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import codechicken.nei.api.ItemFilter.ItemFilterProvider;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
|
||||
public class ItemList {
|
||||
|
||||
/**
|
||||
@@ -84,6 +85,10 @@ public class ItemList {
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
public AllMultiItemFilter(ItemFilter... filters) {
|
||||
this(Arrays.asList(filters));
|
||||
}
|
||||
|
||||
public AllMultiItemFilter() {
|
||||
this(new LinkedList<>());
|
||||
}
|
||||
@@ -91,7 +96,7 @@ public class ItemList {
|
||||
@Override
|
||||
public boolean matches(ItemStack item) {
|
||||
for (ItemFilter filter : filters) try {
|
||||
if (!filter.matches(item)) return false;
|
||||
if (filter != null && !filter.matches(item)) return false;
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.error("Exception filtering " + item + " with " + filter, e);
|
||||
}
|
||||
@@ -254,7 +259,7 @@ public class ItemList {
|
||||
|
||||
try {
|
||||
filtered = ItemList.forkJoinPool.submit(
|
||||
() -> items.parallelStream().filter(PresetsWidget::matches).filter(filter::matches)
|
||||
() -> items.parallelStream().filter(filter::matches)
|
||||
.collect(Collectors.toCollection(ArrayList::new)))
|
||||
.get();
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
|
||||
@@ -22,8 +22,8 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public class ItemMobSpawner extends ItemBlock {
|
||||
|
||||
private static Map<Integer, EntityLiving> entityHashMap;
|
||||
private static Map<Integer, String> IDtoNameMap;
|
||||
private static final Map<Integer, EntityLiving> entityHashMap = new HashMap<>();
|
||||
private static final Map<Integer, String> IDtoNameMap = new HashMap<>();
|
||||
public static int idPig;
|
||||
private static boolean loaded;
|
||||
|
||||
@@ -32,9 +32,6 @@ public class ItemMobSpawner extends ItemBlock {
|
||||
|
||||
hasSubtypes = true;
|
||||
MinecraftForgeClient.registerItemRenderer(this, new SpawnerRenderer());
|
||||
|
||||
entityHashMap = new HashMap<>();
|
||||
IDtoNameMap = new HashMap<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,6 +34,7 @@ public class ItemPanel extends PanelWidget {
|
||||
public Button more;
|
||||
public Button less;
|
||||
public ItemQuantityField quantity;
|
||||
public ItemHistoryPanel historyPanel;
|
||||
|
||||
public static class ItemPanelSlot {
|
||||
|
||||
@@ -64,18 +65,18 @@ public class ItemPanel extends PanelWidget {
|
||||
if (newItems != null) {
|
||||
realItems = newItems;
|
||||
newItems = null;
|
||||
onGridChanged();
|
||||
onItemsChanged();
|
||||
}
|
||||
|
||||
super.refresh(gui);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawSlotOutline(@Nullable ItemPanelSlot focused, int slotIdx, Rectangle4i rect) {
|
||||
protected void beforeDrawSlot(@Nullable ItemPanelSlot focused, int slotIdx, Rectangle4i rect) {
|
||||
if (PresetsWidget.inEditMode()) {
|
||||
if (!PresetsWidget.isHidden(getItem(slotIdx))) drawRect(rect.x, rect.y, rect.w, rect.h, 0xee555555);
|
||||
} else {
|
||||
super.drawSlotOutline(focused, slotIdx, rect);
|
||||
super.beforeDrawSlot(focused, slotIdx, rect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +135,7 @@ public class ItemPanel extends PanelWidget {
|
||||
};
|
||||
|
||||
quantity = new ItemQuantityField("quantity");
|
||||
historyPanel = new ItemHistoryPanel();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -142,7 +144,7 @@ public class ItemPanel extends PanelWidget {
|
||||
}
|
||||
|
||||
public String getLabelText() {
|
||||
return String.format("(%d/%d)", getPage(), Math.max(1, getNumPages()));
|
||||
return String.format("%d/%d", getPage(), Math.max(1, getNumPages()));
|
||||
}
|
||||
|
||||
protected String getPositioningSettingName() {
|
||||
@@ -166,34 +168,65 @@ public class ItemPanel extends PanelWidget {
|
||||
}
|
||||
|
||||
protected int resizeFooter(GuiContainer gui) {
|
||||
if (!NEIClientConfig.showItemQuantityWidget()) return 0;
|
||||
|
||||
final int BUTTON_SIZE = 16;
|
||||
if (!NEIClientConfig.showItemQuantityWidget() && NEIClientConfig.isSearchWidgetCentered()) return 0;
|
||||
|
||||
final int BUTTON_SIZE = 20;
|
||||
more.w = less.w = BUTTON_SIZE;
|
||||
more.h = less.h = quantity.h = BUTTON_SIZE;
|
||||
quantity.h = BUTTON_SIZE;
|
||||
|
||||
less.x = x;
|
||||
more.x = x + w - BUTTON_SIZE;
|
||||
more.y = less.y = quantity.y = y + h - BUTTON_SIZE;
|
||||
if (NEIClientConfig.isSearchWidgetCentered()) {
|
||||
more.h = less.h = BUTTON_SIZE;
|
||||
more.x = x + w - BUTTON_SIZE;
|
||||
more.y = less.y = quantity.y = y + h - BUTTON_SIZE;
|
||||
less.x = x;
|
||||
quantity.x = x + BUTTON_SIZE + 2;
|
||||
quantity.w = more.x - quantity.x - 2;
|
||||
} else {
|
||||
quantity.x = (int) (x + (w * 0.7)) + 3;
|
||||
quantity.y = y + h - BUTTON_SIZE;
|
||||
quantity.w = (int) ((w * 0.3) - BUTTON_SIZE - 1);
|
||||
|
||||
quantity.x = x + BUTTON_SIZE + 2;
|
||||
quantity.w = more.x - quantity.x - 2;
|
||||
more.h = less.h = BUTTON_SIZE / 2;
|
||||
more.y = y + h - (more.h * 2);
|
||||
|
||||
return BUTTON_SIZE + 2;
|
||||
less.x = more.x = quantity.x + quantity.w;
|
||||
less.y = more.y + more.h;
|
||||
}
|
||||
|
||||
if (NEIClientConfig.showHistoryPanelWidget()) {
|
||||
historyPanel.x = x;
|
||||
historyPanel.w = w;
|
||||
historyPanel.h = ItemsGrid.SLOT_SIZE * NEIClientConfig.getIntSetting("inventory.history.useRows");
|
||||
historyPanel.y = quantity.y - PanelWidget.PADDING - historyPanel.h;
|
||||
return quantity.h + historyPanel.h + PanelWidget.PADDING * 2;
|
||||
}
|
||||
|
||||
return quantity.h + PanelWidget.PADDING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible() {
|
||||
super.setVisible();
|
||||
|
||||
if (grid.getPerPage() > 0 && NEIClientConfig.showItemQuantityWidget()) {
|
||||
LayoutManager.addWidget(more);
|
||||
LayoutManager.addWidget(less);
|
||||
LayoutManager.addWidget(quantity);
|
||||
if (grid.getPerPage() > 0) {
|
||||
if (NEIClientConfig.showItemQuantityWidget()) {
|
||||
LayoutManager.addWidget(more);
|
||||
LayoutManager.addWidget(less);
|
||||
LayoutManager.addWidget(quantity);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.showHistoryPanelWidget()) {
|
||||
LayoutManager.addWidget(historyPanel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resize(GuiContainer gui) {
|
||||
super.resize(gui);
|
||||
historyPanel.resize(gui);
|
||||
}
|
||||
|
||||
protected ItemStack getDraggedStackWithQuantity(int mouseDownSlot) {
|
||||
ItemStack stack = grid.getItem(mouseDownSlot);
|
||||
|
||||
|
||||
@@ -52,4 +52,20 @@ public class ItemQuantityField extends TextField {
|
||||
super.draw(mousex, mousey);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMouseWheel(int i, int mx, int my) {
|
||||
if (!contains(mx, my)) return false;
|
||||
int multiplier = 1;
|
||||
if (NEIClientUtils.shiftKey()) {
|
||||
multiplier = 10;
|
||||
} else if (NEIClientUtils.controlKey()) {
|
||||
multiplier = 64;
|
||||
}
|
||||
|
||||
int quantity = intValue() + i * multiplier;
|
||||
setText(Integer.toString(quantity));
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -203,6 +203,11 @@ public class ItemStackMap<T> {
|
||||
return map == null ? null : map.get(key);
|
||||
}
|
||||
|
||||
public T getOrDefault(ItemStack key, T defaultValue) {
|
||||
T e = get(key);
|
||||
return e == null ? defaultValue : e;
|
||||
}
|
||||
|
||||
public void put(ItemStack key, T value) {
|
||||
if (key == null || key.getItem() == null) return;
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -27,6 +29,11 @@ public class ItemStackSet extends ItemStackMap<ItemStack> implements ItemFilter
|
||||
put(item, item);
|
||||
}
|
||||
|
||||
public ItemStackSet addAll(List<ItemStack> items) {
|
||||
for (ItemStack item : items) add(item);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack item) {
|
||||
return get(item) != null;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ public class ItemsGrid {
|
||||
|
||||
protected int rows;
|
||||
protected int columns;
|
||||
protected List<Integer> gridMask = null;
|
||||
|
||||
protected boolean[] invalidSlotMap;
|
||||
|
||||
@@ -68,7 +69,7 @@ public class ItemsGrid {
|
||||
public int indexOf(ItemStack stackA, boolean useNBT) {
|
||||
|
||||
for (int idx = 0; idx < realItems.size(); idx++) {
|
||||
if (StackInfo.equalItemAndNBT(stackA, getItem(idx), useNBT)) {
|
||||
if (StackInfo.equalItemAndNBT(stackA, realItems.get(idx), useNBT)) {
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
@@ -105,6 +106,10 @@ public class ItemsGrid {
|
||||
return columns;
|
||||
}
|
||||
|
||||
public int getLastRowIndex() {
|
||||
return this.columns > 0 ? (int) Math.ceil((float) this.getMask().size() / this.columns) - 1 : 0;
|
||||
}
|
||||
|
||||
public void setGridSize(int mleft, int mtop, int w, int h) {
|
||||
marginLeft = mleft;
|
||||
marginTop = mtop;
|
||||
@@ -148,6 +153,11 @@ public class ItemsGrid {
|
||||
|
||||
protected void onGridChanged() {
|
||||
refreshBuffer = true;
|
||||
this.gridMask = null;
|
||||
}
|
||||
|
||||
protected void onItemsChanged() {
|
||||
onGridChanged();
|
||||
}
|
||||
|
||||
public void refresh(GuiContainer gui) {
|
||||
@@ -183,9 +193,9 @@ public class ItemsGrid {
|
||||
|
||||
for (int r = 0; r < rows; r++) {
|
||||
final int idx = columns * r + c;
|
||||
if (GuiInfo.hideItemPanelSlot(gui, getSlotRect(r, c)) && idx >= 0
|
||||
&& idx < invalidSlotMap.length
|
||||
&& !invalidSlotMap[idx]) {
|
||||
if (idx >= 0 && idx < invalidSlotMap.length
|
||||
&& !invalidSlotMap[idx]
|
||||
&& GuiInfo.hideItemPanelSlot(gui, getSlotRect(r, c))) {
|
||||
invalidSlotMap[idx] = true;
|
||||
validColumn = false;
|
||||
perPage--;
|
||||
@@ -223,33 +233,51 @@ public class ItemsGrid {
|
||||
}
|
||||
|
||||
protected List<Integer> getMask() {
|
||||
List<Integer> mask = new ArrayList<>();
|
||||
|
||||
int idx = page * perPage;
|
||||
for (int i = 0; i < rows * columns && idx < size(); i++) {
|
||||
mask.add(isInvalidSlot(i) ? null : idx++);
|
||||
if (this.gridMask == null) {
|
||||
this.gridMask = new ArrayList<>();
|
||||
int idx = page * perPage;
|
||||
|
||||
for (int i = 0; i < rows * columns && idx < size(); i++) {
|
||||
this.gridMask.add(isInvalidSlot(i) ? null : idx++);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return mask;
|
||||
return this.gridMask;
|
||||
}
|
||||
|
||||
private void drawSlotOutlines(int mousex, int mousey) {
|
||||
ItemPanelSlot focused = getSlotMouseOver(mousex, mousey);
|
||||
private void beforeDrawItems(int mousex, int mousey, @Nullable ItemPanelSlot focused) {
|
||||
|
||||
final List<Integer> mask = getMask();
|
||||
|
||||
for (int i = 0; i < mask.size(); i++) {
|
||||
if (mask.get(i) != null) {
|
||||
drawSlotOutline(focused, mask.get(i), getSlotRect(i));
|
||||
beforeDrawSlot(focused, mask.get(i), getSlotRect(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawSlotOutline(@Nullable ItemPanelSlot focused, int slotIdx, Rectangle4i rect) {
|
||||
private void afterDrawItems(int mousex, int mousey, @Nullable ItemPanelSlot focused) {
|
||||
final List<Integer> mask = getMask();
|
||||
|
||||
for (int i = 0; i < mask.size(); i++) {
|
||||
if (mask.get(i) != null) {
|
||||
afterDrawSlot(focused, mask.get(i), getSlotRect(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void update() {}
|
||||
|
||||
protected void beforeDrawSlot(@Nullable ItemPanelSlot focused, int slotIdx, Rectangle4i rect) {
|
||||
if (focused != null && focused.slotIndex == slotIdx) {
|
||||
drawRect(rect.x, rect.y, rect.w, rect.h, 0xee555555); // highlight
|
||||
}
|
||||
}
|
||||
|
||||
protected void afterDrawSlot(@Nullable ItemPanelSlot focused, int slotIdx, Rectangle4i rect) {}
|
||||
|
||||
private void blitExistingBuffer() {
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
@@ -291,12 +319,18 @@ public class ItemsGrid {
|
||||
GuiContainerManager.disableMatrixStackLogging();
|
||||
}
|
||||
|
||||
protected boolean shouldCacheItemRendering() {
|
||||
return NEIClientConfig.shouldCacheItemRendering();
|
||||
}
|
||||
|
||||
public void draw(int mousex, int mousey) {
|
||||
if (getPerPage() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (NEIClientConfig.shouldCacheItemRendering()) {
|
||||
final ItemPanelSlot focused = getSlotMouseOver(mousex, mousey);
|
||||
|
||||
if (shouldCacheItemRendering()) {
|
||||
|
||||
if (refreshBuffer) {
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
@@ -321,14 +355,18 @@ public class ItemsGrid {
|
||||
refreshBuffer = false;
|
||||
}
|
||||
|
||||
drawSlotOutlines(mousex, mousey);
|
||||
beforeDrawItems(mousex, mousey, focused);
|
||||
blitExistingBuffer();
|
||||
} else {
|
||||
drawSlotOutlines(mousex, mousey);
|
||||
beforeDrawItems(mousex, mousey, focused);
|
||||
drawItems();
|
||||
}
|
||||
|
||||
afterDrawItems(mousex, mousey, focused);
|
||||
}
|
||||
|
||||
public void postDrawTooltips(int mousex, int mousey, List<String> tooltip) {}
|
||||
|
||||
public void setVisible() {
|
||||
if (getItems().isEmpty() && getMessageOnEmpty() != null) {
|
||||
LayoutManager.addWidget(messageLabel);
|
||||
@@ -364,16 +402,20 @@ public class ItemsGrid {
|
||||
}
|
||||
|
||||
public boolean contains(int px, int py) {
|
||||
final Rectangle4i rect = new Rectangle4i(
|
||||
marginLeft + paddingLeft,
|
||||
marginTop,
|
||||
columns * SLOT_SIZE,
|
||||
rows * SLOT_SIZE);
|
||||
|
||||
if (!(new Rectangle4i(marginLeft + paddingLeft, marginTop, columns * SLOT_SIZE, height)).contains(px, py)) {
|
||||
if (!rect.contains(px, py)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final int r = (int) ((py - marginTop) / SLOT_SIZE);
|
||||
final int c = (int) ((px - marginLeft - paddingLeft) / SLOT_SIZE);
|
||||
final int slt = columns * r + c;
|
||||
|
||||
return r >= rows || c >= columns || !isInvalidSlot(slt);
|
||||
return !isInvalidSlot(columns * r + c);
|
||||
}
|
||||
|
||||
public String getMessageOnEmpty() {
|
||||
|
||||
@@ -14,7 +14,6 @@ import static codechicken.nei.NEIClientConfig.isEnabled;
|
||||
import static codechicken.nei.NEIClientConfig.isHidden;
|
||||
import static codechicken.nei.NEIClientConfig.showIDs;
|
||||
import static codechicken.nei.NEIClientConfig.toggleBooleanSetting;
|
||||
import static codechicken.nei.NEIClientConfig.world;
|
||||
import static codechicken.nei.NEIClientUtils.cycleGamemode;
|
||||
import static codechicken.nei.NEIClientUtils.decreaseSlotStack;
|
||||
import static codechicken.nei.NEIClientUtils.deleteEverything;
|
||||
@@ -280,6 +279,13 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postRenderTooltips(GuiContainer gui, int mousex, int mousey, List<String> tooltip) {
|
||||
if (!isHidden() && isEnabled() && GuiContainerManager.shouldShowTooltip(gui)) {
|
||||
for (Widget widget : drawWidgets) widget.postDrawTooltips(mousex, mousey, tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) {
|
||||
if (!isHidden() && isEnabled() && GuiContainerManager.shouldShowTooltip(gui)) {
|
||||
@@ -317,7 +323,8 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
if (isBookmarkPanelHidden()) visiblity.showBookmarkPanel = false;
|
||||
|
||||
if (gui.height - gui.ySize <= 40) visiblity.showSearchSection = false;
|
||||
if (gui.height - gui.ySize <= 40 && NEIClientConfig.isSearchWidgetCentered())
|
||||
visiblity.showSearchSection = false;
|
||||
|
||||
if (visiblity.showBookmarkPanel || gui.guiTop <= 20) visiblity.showSubsetDropdown = false;
|
||||
|
||||
@@ -325,6 +332,8 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
if (gui.guiLeft - 4 < 76) visiblity.showWidgets = false;
|
||||
|
||||
if (!itemsLoaded) visiblity.showPresetsDropdown = false;
|
||||
|
||||
try {
|
||||
GuiInfo.readLock.lock();
|
||||
GuiInfo.guiHandlers.forEach(handler -> handler.modifyVisiblity(gui, visiblity));
|
||||
@@ -531,8 +540,8 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getButtonTip() {
|
||||
return getTimeTip(NEIActions.timeZones[zone], state);
|
||||
public void addTooltips(List<String> tooltip) {
|
||||
addTimeTip(NEIActions.timeZones[zone], state, tooltip);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -565,9 +574,13 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
return translate("inventory." + name + "." + sfx);
|
||||
}
|
||||
|
||||
private static String getTimeTip(String name, int state) {
|
||||
String sfx = (state & 0x3) == 2 ? "enable" : "set";
|
||||
return translate("inventory." + name + "." + sfx);
|
||||
private static void addTimeTip(String name, int state, List<String> tooltip) {
|
||||
if ((state & 0x3) == 2) {
|
||||
tooltip.add(translate("inventory." + name + ".enable"));
|
||||
} else {
|
||||
tooltip.add(translate("inventory." + name + ".set"));
|
||||
tooltip.add(EnumChatFormatting.GRAY + translate("inventory." + name + ".disable"));
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean handleDisabledButtonPress(String ident, boolean rightclick) {
|
||||
@@ -719,7 +732,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
@Override
|
||||
public boolean shouldShowTooltip(GuiContainer gui) {
|
||||
return itemPanel.draggedStack == null && bookmarkPanel.sortedStackIndex == -1;
|
||||
return itemPanel.draggedStack == null && !bookmarkPanel.inEditingState();
|
||||
}
|
||||
|
||||
/** Note: this method isn't actually used by this mod, but NEI add-ons might need it. */
|
||||
@@ -742,17 +755,21 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
@Override
|
||||
public void renderSlotOverlay(GuiContainer window, Slot slot) {
|
||||
ItemStack item = slot.getStack();
|
||||
if (world.nbt.getBoolean("searchinventories") && (item == null ? !getSearchExpression().equals("")
|
||||
: !((SearchField) searchField).getFilter().matches(item))) {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glTranslatef(0, 0, 150);
|
||||
drawRect(slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, 0x80000000);
|
||||
GL11.glTranslatef(0, 0, -150);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
if (SearchField.searchInventories()) {
|
||||
ItemStack item = slot.getStack();
|
||||
|
||||
if (item == null ? !getSearchExpression().equals("") : !searchField.getFilter().matches(item)) {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glTranslatef(0, 0, 150);
|
||||
drawRect(slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, 0x80000000);
|
||||
GL11.glTranslatef(0, 0, -150);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void drawIcon(int x, int y, Image image) {
|
||||
@@ -808,9 +825,21 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
drawTexturedModalRect(x2, y2, tx2, ty2, w2, h2); // bottom right
|
||||
}
|
||||
|
||||
public static void drawItemPresenceOverlay(int slotX, int slotY, boolean isPresent) {
|
||||
Image icon = itemPresenceOverlays[isPresent ? 1 : 0];
|
||||
drawIcon(slotX + 16 - icon.width, slotY + 16 - icon.height, icon);
|
||||
public static void drawItemPresenceOverlay(int slotX, int slotY, boolean isPresent, boolean slotHighlight) {
|
||||
|
||||
if (slotHighlight) {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glTranslatef(0, 0, -150);
|
||||
drawRect(slotX, slotY, 16, 16, isPresent ? 0x8000AA00 : 0x80AA0000);
|
||||
GL11.glTranslatef(0, 0, 150);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
} else {
|
||||
Image icon = itemPresenceOverlays[isPresent ? 1 : 0];
|
||||
drawIcon(slotX + 16 - icon.width, slotY + 16 - icon.height, icon);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static LayoutManager instance() {
|
||||
|
||||
@@ -127,8 +127,13 @@ public class LayoutStyleMinecraft extends LayoutStyle {
|
||||
presetsPanel.x = (gui.width - gui.xSize) / 2 + gui.xSize - presetsPanel.w;
|
||||
|
||||
searchField.h = 20;
|
||||
searchField.w = 150;
|
||||
searchField.x = (gui.width - searchField.w) / 2;
|
||||
if (NEIClientConfig.isSearchWidgetCentered()) {
|
||||
searchField.w = 150;
|
||||
searchField.x = (gui.width - searchField.w) / 2;
|
||||
} else {
|
||||
searchField.w = (int) (itemPanel.w * (NEIClientConfig.showItemQuantityWidget() ? 0.7 : 1));
|
||||
searchField.x = itemPanel.x;
|
||||
}
|
||||
searchField.y = gui.height - searchField.h - 2;
|
||||
|
||||
if (!visiblity.showItemSection) {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import static codechicken.nei.PacketIDs.C2S;
|
||||
import static codechicken.nei.PacketIDs.S2C;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -20,37 +23,37 @@ public class NEICPH implements IClientPacketHandler {
|
||||
@Override
|
||||
public void handlePacket(PacketCustom packet, Minecraft mc, INetHandlerPlayClient netHandler) {
|
||||
switch (packet.getType()) {
|
||||
case 1:
|
||||
case S2C.SEND_SERVER_SIDE_CHECK:
|
||||
handleSMPCheck(packet.readUByte(), packet.readString(), mc.theWorld);
|
||||
break;
|
||||
case 10:
|
||||
case S2C.SEND_LOGIN_STATE:
|
||||
handleLoginState(packet);
|
||||
break;
|
||||
case 11:
|
||||
case S2C.SEND_ACTION_DISABLED:
|
||||
handleActionDisabled(packet);
|
||||
break;
|
||||
case 12:
|
||||
case S2C.SEND_ACTION_ENABLED:
|
||||
handleActionEnabled(packet);
|
||||
break;
|
||||
case 13:
|
||||
case S2C.SEND_MAGNETIC_ITEM:
|
||||
ClientHandler.instance().addSMPMagneticItem(packet.readInt(), mc.theWorld);
|
||||
break;
|
||||
case 14:
|
||||
case S2C.SEND_GAME_MODE:
|
||||
handleGamemode(mc, packet.readUByte());
|
||||
break;
|
||||
case 21:
|
||||
case S2C.OPEN_ENCHANTMENT_GUI:
|
||||
ClientUtils.openSMPGui(
|
||||
packet.readUByte(),
|
||||
new GuiEnchantmentModifier(mc.thePlayer.inventory, mc.theWorld, 0, 0, 0));
|
||||
break;
|
||||
case 23:
|
||||
case S2C.SET_CREATIVE_PLUS_MODE:
|
||||
if (packet.readBoolean()) ClientUtils.openSMPGui(
|
||||
packet.readUByte(),
|
||||
new GuiExtendedCreativeInv(
|
||||
new ContainerCreativeInv(mc.thePlayer, new ExtendedCreativeInv(null, Side.CLIENT))));
|
||||
else mc.displayGuiScreen(new GuiInventory(mc.thePlayer));
|
||||
break;
|
||||
case 24:
|
||||
case S2C.OPEN_POTION_GUI:
|
||||
ClientUtils.openSMPGui(packet.readUByte(), new GuiPotionCreator(mc.thePlayer.inventory));
|
||||
break;
|
||||
}
|
||||
@@ -102,7 +105,7 @@ public class NEICPH implements IClientPacketHandler {
|
||||
try {
|
||||
ClientHandler.instance().loadWorld(world, true);
|
||||
NEIClientConfig.setHasSMPCounterPart(true);
|
||||
NEIClientConfig.loadWorld(getSaveName(worldName));
|
||||
NEIClientConfig.loadWorld(getSaveName());
|
||||
sendRequestLoginInfo();
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.error("Error handling SMP Check", e);
|
||||
@@ -110,14 +113,14 @@ public class NEICPH implements IClientPacketHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private static String getSaveName(String worldName) {
|
||||
private static String getSaveName() {
|
||||
if (Minecraft.getMinecraft().isSingleplayer()) return "local/" + ClientUtils.getWorldSaveName();
|
||||
|
||||
return "remote/" + ClientUtils.getServerIP().replace(':', '~') + "/" + worldName;
|
||||
return "remote/" + ClientUtils.getServerIP().replace(':', '~');
|
||||
}
|
||||
|
||||
public static void sendGiveItem(ItemStack spawnstack, boolean infinite, boolean doSpawn) {
|
||||
PacketCustom packet = new PacketCustom(channel, 1);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.GIVE_ITEM);
|
||||
packet.writeItemStack(spawnstack, true);
|
||||
packet.writeBoolean(infinite);
|
||||
packet.writeBoolean(doSpawn);
|
||||
@@ -125,7 +128,7 @@ public class NEICPH implements IClientPacketHandler {
|
||||
}
|
||||
|
||||
public static void sendDeleteAllItems() {
|
||||
PacketCustom packet = new PacketCustom(channel, 4);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.DELETE_ALL_ITEMS);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
@@ -139,18 +142,18 @@ public class NEICPH implements IClientPacketHandler {
|
||||
sendSetSlot(slot, item, false);
|
||||
}
|
||||
|
||||
PacketCustom packet = new PacketCustom(channel, 11);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.REQUEST_CONTAINER_CONTENTS);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendRequestContainer() {
|
||||
PacketCustom packet = new PacketCustom(channel, 16);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.REQUEST_CONTAINER);
|
||||
packet.writeInt(Minecraft.getMinecraft().thePlayer.openContainer.getInventory().size());
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendSetSlot(int slot, ItemStack stack, boolean container) {
|
||||
PacketCustom packet = new PacketCustom(channel, 5);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.SET_SLOT);
|
||||
packet.writeBoolean(container);
|
||||
packet.writeShort(slot);
|
||||
packet.writeItemStack(stack);
|
||||
@@ -158,38 +161,38 @@ public class NEICPH implements IClientPacketHandler {
|
||||
}
|
||||
|
||||
private static void sendRequestLoginInfo() {
|
||||
PacketCustom packet = new PacketCustom(channel, 10);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.REQUEST_LOGIN_INFO);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendToggleMagnetMode() {
|
||||
PacketCustom packet = new PacketCustom(channel, 6);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.TOGGLE_MAGNET);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendSetTime(int hour) {
|
||||
PacketCustom packet = new PacketCustom(channel, 7);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.SET_TIME);
|
||||
packet.writeByte(hour);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendHeal() {
|
||||
PacketCustom packet = new PacketCustom(channel, 8);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.HEAL);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendToggleRain() {
|
||||
PacketCustom packet = new PacketCustom(channel, 9);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.TOGGLE_RAIN);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendOpenEnchantmentWindow() {
|
||||
PacketCustom packet = new PacketCustom(channel, 21);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.REQUEST_ENCHANTMENT_GUI);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendModifyEnchantment(int enchID, int level, boolean add) {
|
||||
PacketCustom packet = new PacketCustom(channel, 22);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.MODIFY_ENCHANTMENT);
|
||||
packet.writeByte(enchID);
|
||||
packet.writeByte(level);
|
||||
packet.writeBoolean(add);
|
||||
@@ -197,30 +200,30 @@ public class NEICPH implements IClientPacketHandler {
|
||||
}
|
||||
|
||||
public static void sendSetPropertyDisabled(String name, boolean enable) {
|
||||
PacketCustom packet = new PacketCustom(channel, 12);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.CHANGE_PROPERTY);
|
||||
packet.writeString(name);
|
||||
packet.writeBoolean(enable);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendGamemode(int mode) {
|
||||
new PacketCustom(channel, 13).writeByte(mode).sendToServer();
|
||||
new PacketCustom(channel, C2S.SET_GAME_MODE).writeByte(mode).sendToServer();
|
||||
}
|
||||
|
||||
public static void sendCreativeInv(boolean open) {
|
||||
PacketCustom packet = new PacketCustom(channel, 23);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.SET_CREATIVE_PLUS_MODE);
|
||||
packet.writeBoolean(open);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendCreativeScroll(int steps) {
|
||||
PacketCustom packet = new PacketCustom(channel, 14);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.CYCLE_CREATIVE_INV);
|
||||
packet.writeInt(steps);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendMobSpawnerID(int x, int y, int z, String mobtype) {
|
||||
PacketCustom packet = new PacketCustom(channel, 15);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.SEND_MOB_SPAWNER_ID);
|
||||
packet.writeCoord(x, y, z);
|
||||
packet.writeString(mobtype);
|
||||
packet.sendToServer();
|
||||
@@ -231,13 +234,13 @@ public class NEICPH implements IClientPacketHandler {
|
||||
InventoryUtils.readItemStacksFromTag(
|
||||
potionStore,
|
||||
NEIClientConfig.global.nbt.getCompoundTag("potionStore").getTagList("items", 10));
|
||||
PacketCustom packet = new PacketCustom(channel, 24);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.REQUEST_POTION_GUI);
|
||||
for (ItemStack stack : potionStore) packet.writeItemStack(stack);
|
||||
packet.sendToServer();
|
||||
}
|
||||
|
||||
public static void sendDummySlotSet(int slotNumber, ItemStack stack) {
|
||||
PacketCustom packet = new PacketCustom(channel, 25);
|
||||
PacketCustom packet = new PacketCustom(channel, C2S.SET_DUMMY_SLOT);
|
||||
packet.writeShort(slotNumber);
|
||||
packet.writeItemStack(stack, true);
|
||||
packet.sendToServer();
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -21,6 +22,8 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import codechicken.core.CCUpdateChecker;
|
||||
import codechicken.core.ClassDiscoverer;
|
||||
import codechicken.core.ClientUtils;
|
||||
@@ -40,6 +43,7 @@ import codechicken.nei.config.GuiOptionList;
|
||||
import codechicken.nei.config.GuiPanelSettings;
|
||||
import codechicken.nei.config.OptionCycled;
|
||||
import codechicken.nei.config.OptionGamemodes;
|
||||
import codechicken.nei.config.OptionIntegerField;
|
||||
import codechicken.nei.config.OptionList;
|
||||
import codechicken.nei.config.OptionOpenGui;
|
||||
import codechicken.nei.config.OptionTextField;
|
||||
@@ -53,11 +57,10 @@ import codechicken.nei.recipe.RecipeCatalysts;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.obfuscator.ObfuscationRun;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
public class NEIClientConfig {
|
||||
|
||||
private static boolean configLoaded;
|
||||
private static boolean mainNEIConfigLoaded;
|
||||
private static boolean pluginNEIConfigLoaded;
|
||||
private static boolean enabledOverride;
|
||||
private static String worldPath;
|
||||
|
||||
@@ -72,6 +75,7 @@ public class NEIClientConfig {
|
||||
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");
|
||||
public static final File hiddenHandlersFile = new File(configDir, "hiddenhandlers.csv");
|
||||
|
||||
@Deprecated
|
||||
public static File bookmarkFile;
|
||||
@@ -83,6 +87,9 @@ public class NEIClientConfig {
|
||||
// We use regex here so that we can apply the height hack to entire mods with one entry.
|
||||
public static HashSet<Pattern> heightHackHandlerRegex = new HashSet<>();
|
||||
|
||||
// Set of handler Name or Id of handlers that need hide.
|
||||
public static HashSet<String> hiddenHandlers = new HashSet<>();
|
||||
|
||||
// Map of handler ID to sort order.
|
||||
// Handlers will be sorted in ascending order, so smaller numbers show up earlier.
|
||||
// Any handler not in the map will be assigned to 0, and negative numbers are fine.
|
||||
@@ -156,6 +163,19 @@ public class NEIClientConfig {
|
||||
|
||||
ItemSorter.initConfig(tag);
|
||||
|
||||
tag.getTag("inventory.history.enabled").setComment("Enable/disable History Panel").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.history.enabled", true));
|
||||
|
||||
tag.getTag("inventory.history.historyColor").setComment("Color of the history area display")
|
||||
.getHexValue(0xee555555);
|
||||
API.addOption(new OptionIntegerField("inventory.history.historyColor"));
|
||||
|
||||
tag.getTag("inventory.history.useRows").setComment("Rows used in historical areas").getIntValue(2);
|
||||
API.addOption(new OptionIntegerField("inventory.history.useRows", 1, 5));
|
||||
|
||||
tag.getTag("inventory.history.splittingMode").getIntValue(1);
|
||||
API.addOption(new OptionCycled("inventory.history.splittingMode", 2, true));
|
||||
|
||||
tag.getTag("inventory.itemIDs").getIntValue(1);
|
||||
API.addOption(new OptionCycled("inventory.itemIDs", 3, true));
|
||||
|
||||
@@ -236,22 +256,32 @@ public class NEIClientConfig {
|
||||
|
||||
tag.getTag("inventory.bookmarksEnabled").setComment("Enable/disable bookmarks").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.bookmarksEnabled", true));
|
||||
tag.getTag("inventory.useNBTInBookmarks").setComment("Use NBT in Bookmarks").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.useNBTInBookmarks", true));
|
||||
|
||||
tag.getTag("inventory.bookmarksAnimationEnabled").setComment("REI Style Animation in Bookmarks")
|
||||
.getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.bookmarksAnimationEnabled", true));
|
||||
|
||||
tag.getTag("inventory.recipeTooltipsMode").setComment("Show recipe tooltips in Bookmarks").getIntValue(1);
|
||||
API.addOption(new OptionCycled("inventory.recipeTooltipsMode", 4, true));
|
||||
|
||||
tag.getTag("inventory.showRecipeMarker").setComment("Show Recipe Marker").getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.showRecipeMarker", true));
|
||||
|
||||
tag.getTag("inventory.showItemQuantityWidget").setComment("Show Item Quantity Widget").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.showItemQuantityWidget", true));
|
||||
|
||||
tag.getTag("inventory.centerSearchWidget").setComment("Center Search Widget").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.centerSearchWidget", true));
|
||||
|
||||
tag.getTag("inventory.jei_style_tabs").setComment("Enable/disable JEI Style Tabs").getBooleanValue(true);
|
||||
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.itemPresenceOverlay").setComment("Item presence overlay on ?-hover").getIntValue(1);
|
||||
API.addOption(new OptionCycled("inventory.itemPresenceOverlay", 3, true));
|
||||
|
||||
tag.getTag("inventory.slotHighlightPresent").setComment("Highlight Present Item").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.slotHighlightPresent", 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));
|
||||
@@ -347,6 +377,8 @@ public class NEIClientConfig {
|
||||
API.addHashBind(
|
||||
"gui.bookmark_recipe_count",
|
||||
Keyboard.KEY_A + NEIClientUtils.SHIFT_HASH + NEIClientUtils.CTRL_HASH);
|
||||
API.addHashBind("gui.bookmark_pull_items", Keyboard.KEY_V);
|
||||
API.addHashBind("gui.bookmark_pull_items_ingredients", Keyboard.KEY_V + NEIClientUtils.SHIFT_HASH);
|
||||
API.addHashBind("gui.overlay", Keyboard.KEY_S);
|
||||
API.addHashBind("gui.overlay_use", Keyboard.KEY_S + NEIClientUtils.SHIFT_HASH);
|
||||
API.addHashBind("gui.overlay_hide", Keyboard.KEY_S + NEIClientUtils.CTRL_HASH);
|
||||
@@ -365,6 +397,8 @@ public class NEIClientConfig {
|
||||
API.addKeyBind("world.rain", 0);
|
||||
API.addKeyBind("world.heal", 0);
|
||||
API.addKeyBind("world.creative", 0);
|
||||
API.addHashBind("gui.copy_name", Keyboard.KEY_C + NEIClientUtils.CTRL_HASH);
|
||||
API.addHashBind("gui.copy_oredict", Keyboard.KEY_D + NEIClientUtils.CTRL_HASH);
|
||||
}
|
||||
|
||||
public static OptionList getOptionList() {
|
||||
@@ -416,8 +450,21 @@ public class NEIClientConfig {
|
||||
world.saveNBT();
|
||||
}
|
||||
|
||||
public static void unloadWorld() {
|
||||
if (ItemPanels.bookmarkPanel != null) {
|
||||
ItemPanels.bookmarkPanel.saveBookmarks();
|
||||
}
|
||||
|
||||
if (world != null) {
|
||||
world.saveNBT();
|
||||
}
|
||||
}
|
||||
|
||||
private static final Map<String, String> keySettings = new HashMap<>();
|
||||
|
||||
public static int getKeyBinding(String string) {
|
||||
return getSetting("keys." + string).getIntValue(Keyboard.KEY_NONE);
|
||||
final String key = keySettings.computeIfAbsent(string, (s) -> "keys." + s);
|
||||
return getSetting(key).getIntValue(Keyboard.KEY_NONE);
|
||||
}
|
||||
|
||||
public static void setDefaultKeyBinding(String string, int key) {
|
||||
@@ -460,21 +507,22 @@ public class NEIClientConfig {
|
||||
}
|
||||
|
||||
public static void bootNEI(World world) {
|
||||
if (configLoaded) return;
|
||||
if (mainNEIConfigLoaded) return;
|
||||
|
||||
// main NEI config loading
|
||||
ItemInfo.load(world);
|
||||
GuiInfo.load();
|
||||
RecipeInfo.load();
|
||||
LayoutManager.load();
|
||||
NEIController.load();
|
||||
RecipeCatalysts.loadCatalystInfo();
|
||||
|
||||
configLoaded = true;
|
||||
BookmarkContainerInfo.load();
|
||||
mainNEIConfigLoaded = true;
|
||||
|
||||
new Thread("NEI Plugin Loader") {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
logger.debug("Started NEI plugin loading");
|
||||
ClassDiscoverer classDiscoverer = new ClassDiscoverer(
|
||||
test -> test.startsWith("NEI") && test.endsWith("Config.class"),
|
||||
IConfigureNEI.class);
|
||||
@@ -492,6 +540,15 @@ public class NEIClientConfig {
|
||||
}
|
||||
}
|
||||
|
||||
RecipeCatalysts.loadCatalystInfo();
|
||||
|
||||
// Set pluginNEIConfigLoaded here before posting the NEIConfigsLoadedEvent. This used to be the other
|
||||
// way around, but apparently if your modpack includes 800 mods the event poster might not return in
|
||||
// time and cause issues when loading a world for a second time as configLoaded is still false. This may
|
||||
// cause issues in case one of the event handler calls the (non-thread-safe) NEI API. I don't expect any
|
||||
// handler to do this, but who knows what modders have come up with...
|
||||
pluginNEIConfigLoaded = true;
|
||||
logger.debug("NEI plugin loading finished");
|
||||
MinecraftForge.EVENT_BUS.post(new NEIConfigsLoadedEvent());
|
||||
}
|
||||
}.start();
|
||||
@@ -538,14 +595,14 @@ public class NEIClientConfig {
|
||||
return !getBooleanSetting("inventory.bookmarksEnabled");
|
||||
}
|
||||
|
||||
public static boolean useNBTInBookmarks() {
|
||||
return getBooleanSetting("inventory.useNBTInBookmarks");
|
||||
}
|
||||
|
||||
public static boolean areBookmarksAnimated() {
|
||||
return getBooleanSetting("inventory.bookmarksAnimationEnabled");
|
||||
}
|
||||
|
||||
public static int getRecipeTooltipsMode() {
|
||||
return getIntSetting("inventory.recipeTooltipsMode");
|
||||
}
|
||||
|
||||
public static boolean showRecipeMarker() {
|
||||
return getBooleanSetting("inventory.showRecipeMarker");
|
||||
}
|
||||
@@ -554,12 +611,20 @@ public class NEIClientConfig {
|
||||
return getBooleanSetting("inventory.showItemQuantityWidget");
|
||||
}
|
||||
|
||||
public static boolean isSearchWidgetCentered() {
|
||||
return getBooleanSetting("inventory.centerSearchWidget");
|
||||
}
|
||||
|
||||
public static boolean areJEIStyleTabsVisible() {
|
||||
return getBooleanSetting("inventory.jei_style_tabs");
|
||||
}
|
||||
|
||||
public static boolean isJEIStyleItemPresenceOverlayVisible() {
|
||||
return getBooleanSetting("inventory.jei_style_item_presence_overlay");
|
||||
public static int itemPresenceOverlay() {
|
||||
return getIntSetting("inventory.itemPresenceOverlay");
|
||||
}
|
||||
|
||||
public static boolean isSlotHighlightPresent() {
|
||||
return getBooleanSetting("inventory.slotHighlightPresent");
|
||||
}
|
||||
|
||||
public static boolean areJEIStyleRecipeCatalystsVisible() {
|
||||
@@ -590,6 +655,10 @@ public class NEIClientConfig {
|
||||
return enabledOverride && getBooleanSetting("inventory.widgetsenabled");
|
||||
}
|
||||
|
||||
public static boolean isLoaded() {
|
||||
return mainNEIConfigLoaded && pluginNEIConfigLoaded;
|
||||
}
|
||||
|
||||
public static boolean loadHandlersFromJar() {
|
||||
return !getBooleanSetting("tools.handler_load_from_config");
|
||||
}
|
||||
@@ -659,7 +728,6 @@ public class NEIClientConfig {
|
||||
|
||||
public static void setSearchExpression(String expression) {
|
||||
world.nbt.setString("search", expression);
|
||||
world.saveNBT();
|
||||
}
|
||||
|
||||
public static boolean isMouseScrollTransferEnabled() {
|
||||
@@ -670,6 +738,10 @@ public class NEIClientConfig {
|
||||
return !getBooleanSetting("inventory.invertMouseScrollTransfer");
|
||||
}
|
||||
|
||||
public static boolean showHistoryPanelWidget() {
|
||||
return getBooleanSetting("inventory.history.enabled");
|
||||
}
|
||||
|
||||
public static boolean shouldCacheItemRendering() {
|
||||
return getBooleanSetting("inventory.cacheItemRendering") && OpenGlHelper.framebufferSupported;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import codechicken.lib.inventory.InventoryRange;
|
||||
import codechicken.lib.inventory.InventoryUtils;
|
||||
import codechicken.lib.util.LangProxy;
|
||||
@@ -50,8 +52,6 @@ import codechicken.nei.api.GuiInfo;
|
||||
import codechicken.nei.api.IInfiniteItemHandler;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
public class NEIClientUtils extends NEIServerUtils {
|
||||
|
||||
public static LangProxy lang = new LangProxy("nei");
|
||||
@@ -394,7 +394,6 @@ public class NEIClientUtils extends NEIServerUtils {
|
||||
|
||||
public static void setItemQuantity(int i) {
|
||||
world.nbt.setInteger("quantity", i);
|
||||
world.saveNBT();
|
||||
}
|
||||
|
||||
public static GuiContainer getGuiContainer() {
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
|
||||
import codechicken.core.CommonUtils;
|
||||
import codechicken.core.launch.CodeChickenCorePlugin;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import codechicken.nei.asm.NEICorePlugin;
|
||||
import codechicken.nei.config.IMCHandler;
|
||||
import codechicken.nei.recipe.GuiRecipeTab;
|
||||
|
||||
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;
|
||||
@@ -23,6 +26,7 @@ import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.versioning.ArtifactVersion;
|
||||
@@ -115,11 +119,17 @@ public class NEIModContainer extends DummyModContainer {
|
||||
@Subscribe
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (CommonUtils.isClient()) {
|
||||
GuiRecipeTab.loadHandlerInfo();
|
||||
ClientHandler.postInit();
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void loadComplete(FMLLoadCompleteEvent event) {
|
||||
if (CommonUtils.isClient()) {
|
||||
GuiRecipeTab.loadHandlerInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void handleIMCMessages(FMLInterModComms.IMCEvent event) {
|
||||
IMCHandler.processIMC(event.getMessages());
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import static codechicken.nei.PacketIDs.C2S;
|
||||
import static codechicken.nei.PacketIDs.S2C;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -28,61 +31,61 @@ public class NEISPH implements IServerPacketHandler {
|
||||
if (!NEIServerConfig.authenticatePacket(sender, packet)) return;
|
||||
|
||||
switch (packet.getType()) {
|
||||
case 1:
|
||||
case C2S.GIVE_ITEM:
|
||||
handleGiveItem(sender, packet);
|
||||
break;
|
||||
case 4:
|
||||
case C2S.DELETE_ALL_ITEMS:
|
||||
NEIServerUtils.deleteAllItems(sender);
|
||||
break;
|
||||
case 5:
|
||||
case C2S.SET_SLOT:
|
||||
setInventorySlot(sender, packet);
|
||||
break;
|
||||
case 6:
|
||||
case C2S.TOGGLE_MAGNET:
|
||||
NEIServerUtils.toggleMagnetMode(sender);
|
||||
break;
|
||||
case 7:
|
||||
case C2S.SET_TIME:
|
||||
NEIServerUtils.setHourForward(sender.worldObj, packet.readUByte(), true);
|
||||
break;
|
||||
case 8:
|
||||
case C2S.HEAL:
|
||||
NEIServerUtils.healPlayer(sender);
|
||||
break;
|
||||
case 9:
|
||||
case C2S.TOGGLE_RAIN:
|
||||
NEIServerUtils.toggleRaining(sender.worldObj, true);
|
||||
break;
|
||||
case 10:
|
||||
case C2S.REQUEST_LOGIN_INFO:
|
||||
sendLoginState(sender);
|
||||
break;
|
||||
case 11:
|
||||
case C2S.REQUEST_CONTAINER_CONTENTS:
|
||||
sender.sendContainerAndContentsToPlayer(sender.openContainer, sender.openContainer.getInventory());
|
||||
break;
|
||||
case 12:
|
||||
case C2S.CHANGE_PROPERTY:
|
||||
handlePropertyChange(sender, packet);
|
||||
break;
|
||||
case 13:
|
||||
case C2S.SET_GAME_MODE:
|
||||
NEIServerUtils.setGamemode(sender, packet.readUByte());
|
||||
break;
|
||||
case 14:
|
||||
case C2S.CYCLE_CREATIVE_INV:
|
||||
NEIServerUtils.cycleCreativeInv(sender, packet.readInt());
|
||||
break;
|
||||
case 15:
|
||||
case C2S.SEND_MOB_SPAWNER_ID:
|
||||
handleMobSpawnerID(sender.worldObj, packet.readCoord(), packet.readString());
|
||||
break;
|
||||
case 16:
|
||||
case C2S.REQUEST_CONTAINER:
|
||||
handleRequestContainer(sender, packet.readInt());
|
||||
break;
|
||||
case 21:
|
||||
case C2S.REQUEST_ENCHANTMENT_GUI:
|
||||
openEnchantmentGui(sender);
|
||||
break;
|
||||
case 22:
|
||||
case C2S.MODIFY_ENCHANTMENT:
|
||||
modifyEnchantment(sender, packet.readUByte(), packet.readUByte(), packet.readBoolean());
|
||||
break;
|
||||
case 23:
|
||||
case C2S.SET_CREATIVE_PLUS_MODE:
|
||||
processCreativeInv(sender, packet.readBoolean());
|
||||
break;
|
||||
case 24:
|
||||
case C2S.REQUEST_POTION_GUI:
|
||||
openPotionGui(sender, packet);
|
||||
break;
|
||||
case 25:
|
||||
case C2S.SET_DUMMY_SLOT:
|
||||
handleDummySlotSet(sender, packet);
|
||||
break;
|
||||
}
|
||||
@@ -126,14 +129,14 @@ public class NEISPH implements IServerPacketHandler {
|
||||
NEIServerConfig.forPlayer(sender.getCommandSenderName()),
|
||||
Side.SERVER)),
|
||||
(player, windowId) -> {
|
||||
PacketCustom packet = new PacketCustom(channel, 23);
|
||||
PacketCustom packet = new PacketCustom(channel, S2C.SET_CREATIVE_PLUS_MODE);
|
||||
packet.writeBoolean(true);
|
||||
packet.writeByte(windowId);
|
||||
packet.sendToPlayer(player);
|
||||
});
|
||||
} else {
|
||||
sender.closeContainer();
|
||||
PacketCustom packet = new PacketCustom(channel, 23);
|
||||
PacketCustom packet = new PacketCustom(channel, S2C.SET_CREATIVE_PLUS_MODE);
|
||||
packet.writeBoolean(false);
|
||||
packet.sendToPlayer(sender);
|
||||
}
|
||||
@@ -169,7 +172,7 @@ public class NEISPH implements IServerPacketHandler {
|
||||
player,
|
||||
new ContainerEnchantmentModifier(player.inventory, player.worldObj, 0, 0, 0),
|
||||
(player1, windowId) -> {
|
||||
PacketCustom packet = new PacketCustom(channel, 21);
|
||||
PacketCustom packet = new PacketCustom(channel, S2C.OPEN_ENCHANTMENT_GUI);
|
||||
packet.writeByte(windowId);
|
||||
packet.sendToPlayer(player1);
|
||||
});
|
||||
@@ -179,18 +182,19 @@ public class NEISPH implements IServerPacketHandler {
|
||||
InventoryBasic b = new InventoryBasic("potionStore", true, 9);
|
||||
for (int i = 0; i < b.getSizeInventory(); i++) b.setInventorySlotContents(i, packet.readItemStack());
|
||||
ServerUtils.openSMPContainer(player, new ContainerPotionCreator(player.inventory, b), (player1, windowId) -> {
|
||||
PacketCustom packet1 = new PacketCustom(channel, 24);
|
||||
PacketCustom packet1 = new PacketCustom(channel, S2C.OPEN_POTION_GUI);
|
||||
packet1.writeByte(windowId);
|
||||
packet1.sendToPlayer(player1);
|
||||
});
|
||||
}
|
||||
|
||||
public static void sendActionDisabled(int dim, String name, boolean disable) {
|
||||
new PacketCustom(channel, 11).writeString(name).writeBoolean(disable).sendToDimension(dim);
|
||||
new PacketCustom(channel, S2C.SEND_ACTION_DISABLED).writeString(name).writeBoolean(disable)
|
||||
.sendToDimension(dim);
|
||||
}
|
||||
|
||||
public static void sendActionEnabled(EntityPlayerMP player, String name, boolean enable) {
|
||||
new PacketCustom(channel, 12).writeString(name).writeBoolean(enable).sendToPlayer(player);
|
||||
new PacketCustom(channel, S2C.SEND_ACTION_ENABLED).writeString(name).writeBoolean(enable).sendToPlayer(player);
|
||||
}
|
||||
|
||||
private void sendLoginState(EntityPlayerMP player) {
|
||||
@@ -209,7 +213,7 @@ public class NEISPH implements IServerPacketHandler {
|
||||
if (!NEIServerConfig.isPlayerInList(player.getCommandSenderName(), entry.value, true))
|
||||
bannedItems.add(entry.key);
|
||||
|
||||
PacketCustom packet = new PacketCustom(channel, 10);
|
||||
PacketCustom packet = new PacketCustom(channel, S2C.SEND_LOGIN_STATE);
|
||||
|
||||
packet.writeByte(actions.size());
|
||||
for (String s : actions) packet.writeString(s);
|
||||
@@ -228,7 +232,7 @@ public class NEISPH implements IServerPacketHandler {
|
||||
|
||||
public static void sendHasServerSideTo(EntityPlayerMP player) {
|
||||
NEIServerConfig.logger.debug("Sending serverside check to: " + player.getCommandSenderName());
|
||||
PacketCustom packet = new PacketCustom(channel, 1);
|
||||
PacketCustom packet = new PacketCustom(channel, S2C.SEND_SERVER_SIDE_CHECK);
|
||||
packet.writeByte(NEIActions.protocol);
|
||||
packet.writeString(CommonUtils.getWorldName(player.worldObj));
|
||||
|
||||
@@ -236,7 +240,7 @@ public class NEISPH implements IServerPacketHandler {
|
||||
}
|
||||
|
||||
public static void sendAddMagneticItemTo(EntityPlayerMP player, EntityItem item) {
|
||||
PacketCustom packet = new PacketCustom(channel, 13);
|
||||
PacketCustom packet = new PacketCustom(channel, S2C.SEND_MAGNETIC_ITEM);
|
||||
packet.writeInt(item.getEntityId());
|
||||
|
||||
packet.sendToPlayer(player);
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -108,7 +109,11 @@ public class NEIServerConfig {
|
||||
|
||||
private static void saveWorld(int dim) {
|
||||
try {
|
||||
File file = new File(getSaveDir(DimensionManager.getWorld(dim)), "world.dat");
|
||||
final File saveDir = getSaveDir(DimensionManager.getWorld(dim));
|
||||
if (!saveDir.isDirectory()) {
|
||||
FileUtils.forceMkdir(saveDir);
|
||||
}
|
||||
File file = new File(saveDir, "world.dat");
|
||||
NEIServerUtils.writeNBT(dimTags.get(dim), file);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
@@ -42,6 +42,7 @@ import codechicken.core.ServerUtils;
|
||||
import codechicken.lib.inventory.InventoryRange;
|
||||
import codechicken.lib.inventory.InventoryUtils;
|
||||
import codechicken.lib.packet.PacketCustom;
|
||||
import codechicken.nei.PacketIDs.S2C;
|
||||
import codechicken.nei.util.NBTHelper;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -295,7 +296,7 @@ public class NEIServerUtils {
|
||||
player.theItemInWorldManager.setGameType(getGameType(mode));
|
||||
|
||||
// tell the client to change it
|
||||
new PacketCustom(NEISPH.channel, 14).writeByte(mode).sendToPlayer(player);
|
||||
new PacketCustom(NEISPH.channel, S2C.SEND_GAME_MODE).writeByte(mode).sendToPlayer(player);
|
||||
player.addChatMessage(new ChatComponentTranslation("nei.chat.gamemode." + mode));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package codechicken.nei;
|
||||
|
||||
public final class PacketIDs {
|
||||
|
||||
public static final class C2S {
|
||||
|
||||
public static final int GIVE_ITEM = 1;
|
||||
public static final int DELETE_ALL_ITEMS = 4;
|
||||
public static final int SET_SLOT = 5;
|
||||
public static final int TOGGLE_MAGNET = 6;
|
||||
public static final int SET_TIME = 7;
|
||||
public static final int HEAL = 8;
|
||||
public static final int TOGGLE_RAIN = 9;
|
||||
public static final int REQUEST_LOGIN_INFO = 10;
|
||||
public static final int REQUEST_CONTAINER_CONTENTS = 11;
|
||||
public static final int CHANGE_PROPERTY = 12;
|
||||
public static final int SET_GAME_MODE = 13;
|
||||
public static final int CYCLE_CREATIVE_INV = 14;
|
||||
public static final int SEND_MOB_SPAWNER_ID = 15;
|
||||
public static final int REQUEST_CONTAINER = 16;
|
||||
public static final int REQUEST_ENCHANTMENT_GUI = 21;
|
||||
public static final int MODIFY_ENCHANTMENT = 22;
|
||||
public static final int SET_CREATIVE_PLUS_MODE = 23;
|
||||
public static final int REQUEST_POTION_GUI = 24;
|
||||
public static final int SET_DUMMY_SLOT = 25;
|
||||
}
|
||||
|
||||
public static final class S2C {
|
||||
|
||||
public static final int SEND_SERVER_SIDE_CHECK = 1;
|
||||
public static final int SEND_LOGIN_STATE = 10;
|
||||
public static final int SEND_ACTION_DISABLED = 11;
|
||||
public static final int SEND_ACTION_ENABLED = 12;
|
||||
public static final int SEND_MAGNETIC_ITEM = 13;
|
||||
public static final int SEND_GAME_MODE = 14;
|
||||
public static final int OPEN_ENCHANTMENT_GUI = 21;
|
||||
public static final int SET_CREATIVE_PLUS_MODE = 23;
|
||||
public static final int OPEN_POTION_GUI = 24;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -171,6 +172,11 @@ public abstract class PanelWidget extends Widget {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
grid.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(int mousex, int mousey) {
|
||||
grid.draw(mousex, mousey);
|
||||
@@ -185,6 +191,11 @@ public abstract class PanelWidget extends Widget {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDrawTooltips(int mx, int my, List<String> tooltip) {
|
||||
grid.postDrawTooltips(mx, my, tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDragged(int mousex, int mousey, int button, long heldTime) {
|
||||
if (mouseDownSlot >= 0 && draggedStack == null
|
||||
@@ -317,7 +328,7 @@ public abstract class PanelWidget extends Widget {
|
||||
ItemPanelSlot hoverSlot = getSlotMouseOver(mousex, mousey);
|
||||
|
||||
if (hoverSlot != null && hoverSlot.slotIndex == mouseDownSlot && draggedStack == null) {
|
||||
ItemStack item = hoverSlot.item;
|
||||
ItemStack item = hoverSlot.item.copy();
|
||||
|
||||
if (NEIController.manager.window instanceof GuiRecipe || !NEIClientConfig.canCheatItem(item)) {
|
||||
|
||||
|
||||
@@ -26,8 +26,11 @@ public class PositionedStack {
|
||||
relx = x;
|
||||
rely = y;
|
||||
|
||||
if (genPerms) generatePermutations();
|
||||
else setPermutationToRender(0);
|
||||
if (genPerms) {
|
||||
generatePermutations();
|
||||
} else {
|
||||
setPermutationToRender(0);
|
||||
}
|
||||
}
|
||||
|
||||
public PositionedStack(Object object, int x, int y) {
|
||||
@@ -77,10 +80,13 @@ public class PositionedStack {
|
||||
|
||||
public void setPermutationToRender(int index) {
|
||||
item = items[index].copy();
|
||||
if (item.getItem() == null) item = new ItemStack(Blocks.fire);
|
||||
else if (item.getItemDamage() == OreDictionary.WILDCARD_VALUE && item.getItem() != null
|
||||
&& item.getItem().isRepairable())
|
||||
item.setItemDamage(0);
|
||||
|
||||
if (item.getItem() == null) {
|
||||
item = new ItemStack(Blocks.fire);
|
||||
} else if (item.getItemDamage() == OreDictionary.WILDCARD_VALUE && item.getItem() != null
|
||||
&& item.getItem().isRepairable()) {
|
||||
item.setItemDamage(0);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack ingredient) {
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -21,48 +23,64 @@ import net.minecraft.item.ItemStack;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import codechicken.core.CommonUtils;
|
||||
import codechicken.core.gui.GuiScrollSlot;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.ItemPanel.ItemPanelSlot;
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
import codechicken.nei.util.NBTJson;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
|
||||
import codechicken.core.CommonUtils;
|
||||
import codechicken.core.gui.GuiScrollSlot;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.ItemList.ItemsLoadedCallback;
|
||||
import codechicken.nei.ItemPanel.ItemPanelSlot;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IRecipeFilter;
|
||||
import codechicken.nei.api.IRecipeFilter.IRecipeFilterProvider;
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import codechicken.nei.api.ItemFilter.ItemFilterProvider;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
import codechicken.nei.util.NBTJson;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class PresetsWidget extends Widget {
|
||||
public class PresetsWidget extends Widget implements ItemFilterProvider, ItemsLoadedCallback, ItemFilter {
|
||||
|
||||
public static class PresetTag implements ItemFilter {
|
||||
protected static enum PresetTagState {
|
||||
|
||||
WHITELIST,
|
||||
BLACKLIST,
|
||||
BLACKLIST_PLUS;
|
||||
|
||||
public PresetTagState next() {
|
||||
if (this == PresetTagState.WHITELIST) return PresetTagState.BLACKLIST;
|
||||
if (this == PresetTagState.BLACKLIST) return PresetTagState.BLACKLIST_PLUS;
|
||||
if (this == PresetTagState.BLACKLIST_PLUS) return PresetTagState.WHITELIST;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PresetTag {
|
||||
|
||||
public String filename = null;
|
||||
public String displayName = "";
|
||||
public boolean whitelist = true;
|
||||
public HashSet<String> items;
|
||||
public PresetTagState state = PresetTagState.BLACKLIST;
|
||||
public ItemStackSet items;
|
||||
|
||||
public PresetTag(String displayName) {
|
||||
this(displayName, new HashSet<>(), false, null);
|
||||
this(displayName, null, PresetTagState.BLACKLIST, null);
|
||||
}
|
||||
|
||||
public PresetTag(String displayName, HashSet<String> items) {
|
||||
this(displayName, items, true, null);
|
||||
}
|
||||
|
||||
public PresetTag(String displayName, HashSet<String> items, boolean whitelist, String filename) {
|
||||
public PresetTag(String displayName, ItemStackSet items, PresetTagState state, String filename) {
|
||||
this.displayName = displayName;
|
||||
this.items = items != null ? items : new HashSet<>();
|
||||
this.whitelist = whitelist;
|
||||
this.items = items != null ? items : new ItemStackSet();
|
||||
this.state = state;
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
public boolean matches(final ItemStack stack) {
|
||||
return items.contains(StackInfo.getItemStackGUID(stack)) == whitelist;
|
||||
return items.contains(stack) == (state == PresetTagState.WHITELIST);
|
||||
}
|
||||
|
||||
public static PresetTag loadFromFile(File file) {
|
||||
@@ -84,14 +102,18 @@ public class PresetsWidget extends Widget {
|
||||
final JsonParser parser = new JsonParser();
|
||||
final JsonObject metaObject = parser.parse(itemStrings.remove(0)).getAsJsonObject();
|
||||
final String displayName = metaObject.get("displayName").getAsString();
|
||||
final boolean whitelist = metaObject.get("whitelist").getAsBoolean();
|
||||
final HashSet<String> items = new HashSet<>();
|
||||
final PresetTagState state = metaObject.has("state")
|
||||
? PresetTagState.valueOf(metaObject.get("state").getAsString())
|
||||
: PresetTagState.BLACKLIST;
|
||||
final ItemStackSet items = new ItemStackSet();
|
||||
|
||||
for (String itemStr : itemStrings) {
|
||||
items.add(itemStr);
|
||||
for (ItemStack stack : ItemList.items) {
|
||||
if (itemStrings.contains(StackInfo.getItemStackGUID(stack))) {
|
||||
items.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
return new PresetTag(displayName, items, whitelist, file.getName());
|
||||
return new PresetTag(displayName, items, state, file.getName());
|
||||
} catch (Throwable th) {
|
||||
NEIClientConfig.logger.error("Failed to load presets ItemStack from file", file);
|
||||
}
|
||||
@@ -127,12 +149,16 @@ public class PresetsWidget extends Widget {
|
||||
final JsonObject row = new JsonObject();
|
||||
|
||||
row.add("displayName", new JsonPrimitive(displayName));
|
||||
row.add("whitelist", new JsonPrimitive(whitelist));
|
||||
row.add("state", new JsonPrimitive(state.toString()));
|
||||
|
||||
strings.add(NBTJson.toJson(row));
|
||||
|
||||
try {
|
||||
strings.addAll(items);
|
||||
|
||||
for (ItemStack stack : items.values()) {
|
||||
strings.add(StackInfo.getItemStackGUID(stack));
|
||||
}
|
||||
|
||||
} catch (JsonSyntaxException e) {
|
||||
NEIClientConfig.logger.error("Failed to stringify presets ItemStack to json string");
|
||||
}
|
||||
@@ -146,9 +172,8 @@ public class PresetsWidget extends Widget {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public PresetTag copy() {
|
||||
return new PresetTag(displayName, (HashSet) items.clone(), whitelist, null);
|
||||
return new PresetTag(displayName, new ItemStackSet().addAll(items.values()), state, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +315,7 @@ public class PresetsWidget extends Widget {
|
||||
selected.remove(tag);
|
||||
tag.deleteFile();
|
||||
} else if (direction.contains(mx, my)) {
|
||||
tag.whitelist = !tag.whitelist;
|
||||
tag.state = tag.state.next();
|
||||
tag.saveToFile();
|
||||
}
|
||||
|
||||
@@ -299,6 +324,7 @@ public class PresetsWidget extends Widget {
|
||||
PresetsWidget.openListBox = !presets.isEmpty()
|
||||
&& (NEIClientUtils.controlKey() || NEIClientUtils.shiftKey() || !option.contains(mx, my));
|
||||
ItemList.updateFilter.restart();
|
||||
PresetsRecipeFilter.blacklist = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -319,13 +345,22 @@ public class PresetsWidget extends Widget {
|
||||
|
||||
final String displayName = NEIClientUtils
|
||||
.cropText(PresetsWidget.fontRenderer, tag.displayName, option.w - 6);
|
||||
final String dirName = tag.whitelist ? translate("presets.whitelist.label")
|
||||
: translate("presets.blacklist.label");
|
||||
String stateLabel = translate("presets.blacklist.label");
|
||||
|
||||
if (tag.state == PresetTagState.WHITELIST) {
|
||||
stateLabel = translate("presets.whitelist.label");
|
||||
} else if (tag.state == PresetTagState.BLACKLIST_PLUS) {
|
||||
stateLabel = translate("presets.blacklistPlus.label");
|
||||
}
|
||||
|
||||
// blacklist or whitelist
|
||||
LayoutManager.getLayoutStyle()
|
||||
.drawSubsetTag(null, direction.x, direction.y, direction.w, direction.h, directionState, false);
|
||||
GuiDraw.drawString(dirName, direction.x + 6, direction.y + 5, directionState == 2 ? 0xFFE0E0E0 : 0xFFFFA0);
|
||||
GuiDraw.drawString(
|
||||
stateLabel,
|
||||
direction.x + 6,
|
||||
direction.y + 5,
|
||||
directionState == 2 ? 0xFFE0E0E0 : 0xFFFFA0);
|
||||
|
||||
// option name
|
||||
LayoutManager.getLayoutStyle()
|
||||
@@ -433,6 +468,70 @@ public class PresetsWidget extends Widget {
|
||||
}
|
||||
}
|
||||
|
||||
protected static class PresetsRecipeFilter implements IRecipeFilterProvider, IRecipeFilter {
|
||||
|
||||
protected static ItemStackSet blacklist;
|
||||
|
||||
public IRecipeFilter getFilter() {
|
||||
|
||||
if (PresetsWidget.edit != null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (blacklist == null) {
|
||||
blacklist = new ItemStackSet();
|
||||
|
||||
for (PresetTag tag : listbox.getSelected()) {
|
||||
if (tag.state == PresetTagState.BLACKLIST_PLUS) {
|
||||
blacklist.addAll(tag.items.values());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return blacklist.isEmpty() ? null : this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(IRecipeHandler handler, List<PositionedStack> ingredients, PositionedStack result,
|
||||
List<PositionedStack> others) {
|
||||
|
||||
if (matchPositionedStack(ingredients, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result != null && matchPositionedStack(result)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!others.isEmpty() && matchPositionedStack(others, true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return result == null && others.isEmpty();
|
||||
}
|
||||
|
||||
private boolean matchPositionedStack(List<PositionedStack> items, boolean dir) {
|
||||
for (PositionedStack pStack : items) {
|
||||
if (matchPositionedStack(pStack) == dir) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean matchPositionedStack(PositionedStack pStack) {
|
||||
for (ItemStack stack : pStack.items) {
|
||||
if (!blacklist.contains(stack)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected static final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
protected static SubsetListBox listbox = new SubsetListBox();
|
||||
protected static File presetsDir;
|
||||
@@ -517,7 +616,7 @@ public class PresetsWidget extends Widget {
|
||||
|
||||
public boolean onButtonPress(boolean rightclick) {
|
||||
if (!rightclick && edit != null) {
|
||||
edit.whitelist = !edit.whitelist;
|
||||
edit.state = edit.state.next();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -526,20 +625,54 @@ public class PresetsWidget extends Widget {
|
||||
|
||||
@Override
|
||||
public String getRenderLabel() {
|
||||
return edit != null && edit.whitelist ? translate("presets.whitelist.label")
|
||||
: translate("presets.blacklist.label");
|
||||
|
||||
if (edit == null || edit.state == PresetTagState.BLACKLIST) {
|
||||
return translate("presets.blacklist.label");
|
||||
} else if (edit.state == PresetTagState.WHITELIST) {
|
||||
return translate("presets.whitelist.label");
|
||||
} else if (edit.state == PresetTagState.BLACKLIST_PLUS) {
|
||||
return translate("presets.blacklistPlus.label");
|
||||
}
|
||||
|
||||
return translate("presets.blacklist.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTooltips(List<String> tooltip) {
|
||||
if (edit != null) {
|
||||
tooltip.add(
|
||||
edit.whitelist ? translate("presets.whitelist.tooltip")
|
||||
: translate("presets.blacklist.tooltip"));
|
||||
if (edit.state == PresetTagState.BLACKLIST) {
|
||||
tooltip.add(translate("presets.blacklist.tooltip"));
|
||||
} else if (edit.state == PresetTagState.WHITELIST) {
|
||||
tooltip.add(translate("presets.whitelist.tooltip"));
|
||||
} else if (edit.state == PresetTagState.BLACKLIST_PLUS) {
|
||||
tooltip.add(translate("presets.blacklistPlus.tooltip"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public void itemsLoaded() {
|
||||
|
||||
if (presetsDir != null) {
|
||||
listbox = new SubsetListBox(presetsDir);
|
||||
|
||||
edit = null;
|
||||
openListBox = false;
|
||||
selectedDisplayName.setText("");
|
||||
|
||||
ItemList.updateFilter.restart();
|
||||
PresetsRecipeFilter.blacklist = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public PresetsWidget() {
|
||||
API.addItemFilter(this);
|
||||
API.addRecipeFilter(new PresetsRecipeFilter());
|
||||
ItemList.loadCallbacks.add(this);
|
||||
}
|
||||
|
||||
protected static void setEditedTag(final PresetTag tag) {
|
||||
edit = tag;
|
||||
openListBox = false;
|
||||
@@ -564,19 +697,15 @@ public class PresetsWidget extends Widget {
|
||||
if (edit != null) {
|
||||
|
||||
if (mouseSelection != null && mouseSelection.items.contains(item)) {
|
||||
return mouseSelection.append != edit.whitelist;
|
||||
return mouseSelection.append != (edit.state == PresetTagState.WHITELIST);
|
||||
}
|
||||
|
||||
return !edit.matches(item);
|
||||
}
|
||||
|
||||
if (!listbox.getSelected().isEmpty()) {
|
||||
final List<PresetTag> selected = listbox.getSelected();
|
||||
|
||||
for (int idx = 0; idx < selected.size(); idx++) {
|
||||
if (!selected.get(idx).matches(item)) {
|
||||
return true;
|
||||
}
|
||||
for (PresetTag tag : listbox.getSelected()) {
|
||||
if (!tag.matches(item)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,12 +748,10 @@ public class PresetsWidget extends Widget {
|
||||
}
|
||||
|
||||
protected static void hideItem(final ItemStack stack, boolean append) {
|
||||
final String guid = StackInfo.getItemStackGUID(stack);
|
||||
|
||||
if (append) {
|
||||
edit.items.add(guid);
|
||||
edit.items.add(stack);
|
||||
} else {
|
||||
edit.items.remove(guid);
|
||||
edit.items.remove(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,24 +764,44 @@ public class PresetsWidget extends Widget {
|
||||
}
|
||||
|
||||
public static void loadPresets(final String worldPath) {
|
||||
final File dir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + worldPath);
|
||||
presetsDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + worldPath + "/presets");
|
||||
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
if (!presetsDir.getParentFile().exists()) {
|
||||
presetsDir.getParentFile().mkdirs();
|
||||
}
|
||||
|
||||
if (!presetsDir.exists()) {
|
||||
presetsDir.mkdirs();
|
||||
}
|
||||
|
||||
listbox = new SubsetListBox(presetsDir);
|
||||
if (!(new File(presetsDir, "selected.ini")).exists()) {
|
||||
final File configPresets = new File(NEIClientConfig.configDir, "/presets");
|
||||
|
||||
edit = null;
|
||||
openListBox = false;
|
||||
selectedDisplayName.setText("");
|
||||
if (configPresets.exists()) {
|
||||
for (File file : configPresets.listFiles()) {
|
||||
try {
|
||||
InputStream src = new FileInputStream(file);
|
||||
OutputStream dst = new FileOutputStream(new File(presetsDir, file.getName()));
|
||||
|
||||
IOUtils.copy(src, dst);
|
||||
|
||||
src.close();
|
||||
dst.close();
|
||||
} catch (IOException e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (LayoutManager.itemsLoaded) {
|
||||
listbox = new SubsetListBox(presetsDir);
|
||||
|
||||
edit = null;
|
||||
openListBox = false;
|
||||
selectedDisplayName.setText("");
|
||||
ItemList.updateFilter.restart();
|
||||
PresetsRecipeFilter.blacklist = null;
|
||||
}
|
||||
|
||||
ItemList.updateFilter.restart();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -903,16 +1050,20 @@ public class PresetsWidget extends Widget {
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
public static boolean matches(ItemStack stack) {
|
||||
@Override
|
||||
public ItemFilter getFilter() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(ItemStack stack) {
|
||||
|
||||
if (edit != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
final List<PresetTag> selected = listbox.getSelected();
|
||||
|
||||
for (int idx = 0; idx < selected.size(); idx++) {
|
||||
if (!selected.get(idx).matches(stack)) {
|
||||
for (PresetTag tag : listbox.getSelected()) {
|
||||
if (!tag.matches(stack)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import codechicken.nei.util.TextHistory;
|
||||
|
||||
public abstract class RecipeSearchField extends TextField {
|
||||
|
||||
private static final TextHistory history = new TextHistory();
|
||||
|
||||
public RecipeSearchField(String ident) {
|
||||
super(ident);
|
||||
this.field.setVisible(false);
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return this.field.getVisible();
|
||||
}
|
||||
|
||||
public void setVisible(boolean visible) {
|
||||
this.field.setVisible(visible);
|
||||
}
|
||||
|
||||
protected abstract boolean noResults();
|
||||
|
||||
@Override
|
||||
public int getTextColour() {
|
||||
if (!text().isEmpty() && !noResults()) {
|
||||
return focused() ? 0xFFcc3300 : 0xFF993300;
|
||||
} else {
|
||||
return focused() ? 0xFFE0E0E0 : 0xFF909090;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lastKeyTyped(int keyID, char keyChar) {
|
||||
|
||||
if (focused() && NEIClientConfig.isKeyHashDown("gui.getprevioussearch")) {
|
||||
handleNavigateHistory(TextHistory.Direction.PREVIOUS);
|
||||
}
|
||||
|
||||
if (focused() && NEIClientConfig.isKeyHashDown("gui.getnextsearch")) {
|
||||
handleNavigateHistory(TextHistory.Direction.NEXT);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String filterText(String s) {
|
||||
return EnumChatFormatting.getTextWithoutFormattingCodes(s);
|
||||
}
|
||||
|
||||
public ItemFilter getFilter() {
|
||||
return SearchField.getFilter(text());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFocus(boolean focus) {
|
||||
final boolean previousFocus = field.isFocused();
|
||||
|
||||
if (previousFocus != focus) {
|
||||
history.add(text());
|
||||
}
|
||||
|
||||
super.setFocus(focus);
|
||||
}
|
||||
|
||||
private boolean handleNavigateHistory(TextHistory.Direction direction) {
|
||||
if (focused()) {
|
||||
return history.get(direction, text()).map(newText -> {
|
||||
setText(newText);
|
||||
return true;
|
||||
}).orElse(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -101,7 +101,6 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
if (button == 0) {
|
||||
if (focused() && (System.currentTimeMillis() - lastclicktime < 400)) { // double click
|
||||
NEIClientConfig.world.nbt.setBoolean("searchinventories", !searchInventories());
|
||||
NEIClientConfig.world.saveNBT();
|
||||
}
|
||||
lastclicktime = System.currentTimeMillis();
|
||||
}
|
||||
@@ -123,11 +122,11 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
if (isVisible() && NEIClientConfig.isKeyHashDown("gui.search")) {
|
||||
setFocus(true);
|
||||
}
|
||||
if (NEIClientConfig.isKeyHashDown("gui.getprevioussearch") && focused()) {
|
||||
if (focused() && NEIClientConfig.isKeyHashDown("gui.getprevioussearch")) {
|
||||
handleNavigateHistory(TextHistory.Direction.PREVIOUS);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.getnextsearch") && focused()) {
|
||||
if (focused() && NEIClientConfig.isKeyHashDown("gui.getnextsearch")) {
|
||||
handleNavigateHistory(TextHistory.Direction.NEXT);
|
||||
}
|
||||
}
|
||||
@@ -151,22 +150,33 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
try {
|
||||
pattern = Pattern.compile(search);
|
||||
} catch (PatternSyntaxException ignored) {}
|
||||
|
||||
return pattern == null || pattern.toString().length() == 0 ? null : pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFilter getFilter() {
|
||||
String s_filter = text().toLowerCase();
|
||||
return getFilter(text());
|
||||
}
|
||||
|
||||
public static ItemFilter getFilter(String s_filter) {
|
||||
List<ItemFilter> primary = new LinkedList<>();
|
||||
List<ItemFilter> secondary = new LinkedList<>();
|
||||
s_filter = s_filter.toLowerCase();
|
||||
|
||||
for (ISearchProvider p : searchProviders) {
|
||||
ItemFilter filter = p.getFilter(s_filter);
|
||||
if (filter != null) (p.isPrimary() ? primary : secondary).add(filter);
|
||||
}
|
||||
|
||||
if (!primary.isEmpty()) return new AnyMultiItemFilter(primary);
|
||||
if (!secondary.isEmpty()) return new AnyMultiItemFilter(secondary);
|
||||
if (!primary.isEmpty()) {
|
||||
return new AnyMultiItemFilter(primary);
|
||||
}
|
||||
|
||||
if (!secondary.isEmpty()) {
|
||||
return new AnyMultiItemFilter(secondary);
|
||||
}
|
||||
|
||||
return new EverythingItemFilter();
|
||||
}
|
||||
|
||||
|
||||
@@ -533,7 +533,6 @@ public class SubsetWidget extends Button implements ItemFilterProvider, ItemsLoa
|
||||
NBTTagList list = dirtyHiddenItems.getAndSet(null);
|
||||
if (list != null) {
|
||||
NEIClientConfig.world.nbt.setTag("hiddenItems", list);
|
||||
NEIClientConfig.world.saveNBT();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
public class ThreadOperationTimer extends Thread {
|
||||
|
||||
@@ -14,6 +14,8 @@ public abstract class Widget {
|
||||
|
||||
public void postDraw(int mx, int my) {}
|
||||
|
||||
public void postDrawTooltips(int mx, int my, List<String> tooltip) {}
|
||||
|
||||
public boolean handleClick(int mx, int my, int button) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.entity.passive.EntityPig;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.SpawnerAnimals;
|
||||
import net.minecraft.world.World;
|
||||
@@ -24,10 +25,13 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
public static int mobOverlay = 0;
|
||||
private static byte[] mobSpawnCache;
|
||||
private static long mobOverlayUpdateTime;
|
||||
private static String oregenPatternName;
|
||||
private static boolean hasOregenPatternBeenSet = false;
|
||||
|
||||
public static void reset() {
|
||||
mobOverlay = 0;
|
||||
chunkOverlay = 0;
|
||||
hasOregenPatternBeenSet = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,8 +39,13 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
if (Minecraft.getMinecraft().currentScreen != null) return;
|
||||
|
||||
if (KeyManager.keyStates.get("world.moboverlay").down) mobOverlay = (mobOverlay + 1) % 2;
|
||||
if (KeyManager.keyStates.get("world.chunkoverlay").down)
|
||||
if (KeyManager.keyStates.get("world.chunkoverlay").down) {
|
||||
chunkOverlay = (chunkOverlay + 1) % (NEIModContainer.isGT5Loaded() ? 4 : 3);
|
||||
// 0-2 (or 3 with gt)
|
||||
NEIClientUtils.printChatMessage(
|
||||
new ChatComponentText(NEIClientUtils.translate("chat.chunkoverlay." + chunkOverlay)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void render(float frame) {
|
||||
@@ -279,15 +288,33 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
GL11.glVertex3d(x2, y2, z1 + h);
|
||||
}
|
||||
} else if (chunkOverlay == 3) {
|
||||
int gx1 = (((entity.chunkCoordX < 0 ? entity.chunkCoordX - 3 : entity.chunkCoordX) / 3 * 3) << 4)
|
||||
- intOffsetX;
|
||||
int gz1 = (((entity.chunkCoordZ < 0 ? entity.chunkCoordZ - 3 : entity.chunkCoordZ) / 3 * 3) << 4)
|
||||
- intOffsetZ;
|
||||
if (entity.chunkCoordX < 0) {
|
||||
gx1 += 16;
|
||||
if (!hasOregenPatternBeenSet) {
|
||||
try {
|
||||
oregenPatternName = ((Enum<?>) Class.forName("gregtech.common.GT_Worldgenerator")
|
||||
.getDeclaredField("oregenPattern").get(null)).name();
|
||||
} catch (Exception ignored) {
|
||||
oregenPatternName = "AXISSYMMETRICAL";
|
||||
}
|
||||
hasOregenPatternBeenSet = true;
|
||||
}
|
||||
if (entity.chunkCoordZ < 0) {
|
||||
gz1 += 16;
|
||||
int gx1;
|
||||
int gz1;
|
||||
if (oregenPatternName.equals("EQUAL_SPACING")) {
|
||||
// gt oregen uses new regular pattern
|
||||
gx1 = ((Math.floorDiv(entity.chunkCoordX, 3) * 3) << 4) - intOffsetX;
|
||||
gz1 = ((Math.floorDiv(entity.chunkCoordZ, 3) * 3) << 4) - intOffsetZ;
|
||||
} else {
|
||||
// gt oregen uses old bugged pattern
|
||||
gx1 = (((entity.chunkCoordX < 0 ? entity.chunkCoordX - 3 : entity.chunkCoordX) / 3 * 3) << 4)
|
||||
- intOffsetX;
|
||||
gz1 = (((entity.chunkCoordZ < 0 ? entity.chunkCoordZ - 3 : entity.chunkCoordZ) / 3 * 3) << 4)
|
||||
- intOffsetZ;
|
||||
if (entity.chunkCoordX < 0) {
|
||||
gx1 += 16;
|
||||
}
|
||||
if (entity.chunkCoordZ < 0) {
|
||||
gz1 += 16;
|
||||
}
|
||||
}
|
||||
int gx2 = gx1 + 48;
|
||||
int gz2 = gz1 + 48;
|
||||
|
||||
@@ -12,6 +12,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import codechicken.nei.BookmarkContainerInfo;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.ItemSorter;
|
||||
import codechicken.nei.ItemStackSet;
|
||||
@@ -24,11 +27,13 @@ import codechicken.nei.SearchField;
|
||||
import codechicken.nei.SearchField.ISearchProvider;
|
||||
import codechicken.nei.SubsetWidget;
|
||||
import codechicken.nei.SubsetWidget.SubsetTag;
|
||||
import codechicken.nei.api.IRecipeFilter.IRecipeFilterProvider;
|
||||
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.GuiRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.ICraftingHandler;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
@@ -37,8 +42,6 @@ import codechicken.nei.recipe.RecipeCatalysts;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
/**
|
||||
* This is the main class that handles item property configuration. WARNING: DO NOT access this class until the world
|
||||
* has been loaded These methods should be called from INEIConfig implementors
|
||||
@@ -159,7 +162,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Adds an item to the item panel. Any items added using this function will override the default search pattern.
|
||||
*
|
||||
*
|
||||
* @param item an item with data
|
||||
*/
|
||||
public static void addItemListEntry(ItemStack item) {
|
||||
@@ -182,7 +185,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Add a custom KeyBinding to be configured in the Controls menu.
|
||||
*
|
||||
*
|
||||
* @param ident An identifier for your key, eg "shoot"
|
||||
* @param defaultKey The default value, commonly obtained from {@link Keyboard}
|
||||
*/
|
||||
@@ -194,7 +197,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Add a custom KeyBinding to be configured in the Controls menu.
|
||||
*
|
||||
*
|
||||
* @param ident An identifier for your key, eg "shoot"
|
||||
* @param defaultKey The default value, commonly obtained from {@link Keyboard}
|
||||
*/
|
||||
@@ -209,7 +212,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Add a new Layout Style for the NEI interface
|
||||
*
|
||||
*
|
||||
* @param styleID The Unique ID to be used for storing your style in the config and cycling through avaliable styles
|
||||
* @param style The style to add.
|
||||
*/
|
||||
@@ -219,7 +222,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Registers a new Infinite Item Handler.
|
||||
*
|
||||
*
|
||||
* @param handler The handler to be registered.
|
||||
*/
|
||||
public static void addInfiniteItemHandler(IInfiniteItemHandler handler) {
|
||||
@@ -228,7 +231,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Registers a new Infinite Item Handler.
|
||||
*
|
||||
*
|
||||
* @param block The block to handle, null for all.
|
||||
* @param handler The handler to be registered.
|
||||
*/
|
||||
@@ -238,7 +241,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Tells NEI not to perform any Fast Transfer operations on slots of a particular class
|
||||
*
|
||||
*
|
||||
* @param slotClass The class of slot to be exempted
|
||||
*/
|
||||
public static void addFastTransferExemptSlot(Class<? extends Slot> slotClass) {
|
||||
@@ -247,7 +250,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Register a new text handler for the block highlight tooltip with a layout specification (HEADER, BODY or FOOTER).
|
||||
*
|
||||
*
|
||||
* @param handler The handler to be registered.
|
||||
* @param layout A HUDAugmenterRegistry.Layout entry. HEADER is displayed before BODY which is displayed before
|
||||
* FOOTER.
|
||||
@@ -258,16 +261,22 @@ public class API {
|
||||
|
||||
/**
|
||||
* Register a mode handler for overriding NEI recipe/utility/cheat mode settings.
|
||||
*
|
||||
*
|
||||
* @param handler The handler to be registered.
|
||||
*/
|
||||
public static void registerModeHandler(INEIModeHandler handler) {
|
||||
NEIInfo.modeHandlers.add(handler);
|
||||
}
|
||||
|
||||
public static void addRecipeFilter(IRecipeFilterProvider filterProvider) {
|
||||
synchronized (GuiRecipe.recipeFilterers) {
|
||||
GuiRecipe.recipeFilterers.add(filterProvider);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a filter provider for the item panel.
|
||||
*
|
||||
*
|
||||
* @param filterProvider The filter provider to be registered.
|
||||
*/
|
||||
public static void addItemFilter(ItemFilterProvider filterProvider) {
|
||||
@@ -278,7 +287,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Adds a new tag to the item subset dropdown.
|
||||
*
|
||||
*
|
||||
* @param name The fully qualified name, Eg Blocks.MobSpawners. NOT case sensitive
|
||||
* @param filter A filter for matching items that fit in this subset
|
||||
*/
|
||||
@@ -288,7 +297,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Adds a new tag to the item subset dropdown.
|
||||
*
|
||||
*
|
||||
* @param name The fully qualified name, Eg Blocks.MobSpawners. NOT case sensitive
|
||||
* @param items An iterable of itemstacks to be added as a subset
|
||||
*/
|
||||
@@ -314,7 +323,7 @@ public class API {
|
||||
|
||||
/**
|
||||
* Adds a new sorting option to the item panel sort menu
|
||||
*
|
||||
*
|
||||
* @param name A unique id for this sort option. Will be used in the config for saving and translated in the options
|
||||
* gui. Note that if the translation key name.tip exists, it will be used for a tooltip
|
||||
*/
|
||||
@@ -325,7 +334,7 @@ public class API {
|
||||
/**
|
||||
* Adds an additional item list entry for an item, sorted after the rest of the items are found through the normal
|
||||
* process
|
||||
*
|
||||
*
|
||||
* @param item The item to add the variant for
|
||||
* @param variant The stack to appear in the item panel
|
||||
*/
|
||||
@@ -344,7 +353,7 @@ public class API {
|
||||
* 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
|
||||
@@ -365,7 +374,7 @@ public class API {
|
||||
* 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
|
||||
@@ -390,6 +399,11 @@ public class API {
|
||||
RecipeCatalysts.removeRecipeCatalyst(handlerID, stack);
|
||||
}
|
||||
|
||||
public static void registerBookmarkContainerHandler(Class<? extends GuiContainer> gui,
|
||||
IBookmarkContainerHandler handler) {
|
||||
BookmarkContainerInfo.registerBookmarkContainerHandler(gui, handler);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRecipeCatalyst(List<ItemStack> stacks, IRecipeHandler handler) {
|
||||
for (ItemStack stack : stacks) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package codechicken.nei.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IBookmarkContainerHandler {
|
||||
|
||||
void pullBookmarkItemsFromContainer(GuiContainer guiContainer, ArrayList<ItemStack> realItems);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package codechicken.nei.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
|
||||
public interface IRecipeFilter {
|
||||
|
||||
public static interface IRecipeFilterProvider {
|
||||
|
||||
public IRecipeFilter getFilter();
|
||||
}
|
||||
|
||||
public boolean matches(IRecipeHandler handler, List<PositionedStack> ingredients, PositionedStack result,
|
||||
List<PositionedStack> others);
|
||||
|
||||
}
|
||||
@@ -39,6 +39,8 @@ import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
|
||||
import codechicken.core.featurehack.GameDataManipulator;
|
||||
import codechicken.nei.InfiniteStackSizeHandler;
|
||||
import codechicken.nei.InfiniteToolHandler;
|
||||
@@ -55,9 +57,6 @@ import codechicken.nei.config.RegistryDumper;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.recipe.BrewingRecipeHandler;
|
||||
import codechicken.nei.recipe.RecipeItemInputHandler;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
package codechicken.nei.api;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import codechicken.nei.ItemPanel.ItemPanelSlot;
|
||||
import codechicken.nei.ItemPanels;
|
||||
import codechicken.nei.LayoutManager;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.BookmarkRecipeId;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
@@ -20,10 +28,31 @@ public abstract class ShortcutInputHandler {
|
||||
|
||||
public static boolean handleKeyEvent(ItemStack stackover) {
|
||||
|
||||
if (!NEIClientConfig.isLoaded()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.overlay_hide")) {
|
||||
return hideOverlayRecipe();
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.bookmark_pull_items")) {
|
||||
return ItemPanels.bookmarkPanel.pullBookmarkItems(ItemPanels.bookmarkPanel.getHoveredGroupId(true), false);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.bookmark_pull_items_ingredients")) {
|
||||
return ItemPanels.bookmarkPanel.pullBookmarkItems(ItemPanels.bookmarkPanel.getHoveredGroupId(true), true);
|
||||
}
|
||||
|
||||
if (stackover == null && NEIClientConfig.isKeyHashDown("gui.bookmark_recipe")) {
|
||||
final int groupId = ItemPanels.bookmarkPanel.getHoveredGroupId(true);
|
||||
|
||||
if (groupId != -1) {
|
||||
ItemPanels.bookmarkPanel.removeGroup(groupId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (stackover == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -34,6 +63,14 @@ public abstract class ShortcutInputHandler {
|
||||
return openOverlayRecipe(stackover, false);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.copy_name")) {
|
||||
return copyItemStackName(stackover);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.copy_oredict")) {
|
||||
return copyItemStackOreDictionary(stackover);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.overlay_use")) {
|
||||
return openOverlayRecipe(stackover, true);
|
||||
}
|
||||
@@ -67,9 +104,12 @@ public abstract class ShortcutInputHandler {
|
||||
|
||||
public static boolean handleMouseClick(ItemStack stackover) {
|
||||
|
||||
if (!NEIClientConfig.isLoaded()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (stackover != null) {
|
||||
final int button = Mouse.getEventButton();
|
||||
stackover = stackover.copy();
|
||||
|
||||
if (button == 0) {
|
||||
return GuiCraftingRecipe.openRecipeGui("item", stackover);
|
||||
@@ -91,14 +131,52 @@ public abstract class ShortcutInputHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean openOverlayRecipe(ItemStack stack, boolean shift) {
|
||||
private static boolean copyItemStackName(ItemStack stackover) {
|
||||
Toolkit.getDefaultToolkit().getSystemClipboard()
|
||||
.setContents(new StringSelection(stackover.getDisplayName()), null);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean copyItemStackOreDictionary(ItemStack stackover) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
for (int id : OreDictionary.getOreIDs(stackover)) {
|
||||
String oreDictionaryName = OreDictionary.getOreName(id);
|
||||
if (!"Unknown".equals(oreDictionaryName)) {
|
||||
builder.append(oreDictionaryName).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
if (builder.length() > 0) {
|
||||
builder.deleteCharAt(builder.length() - 1);
|
||||
}
|
||||
|
||||
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(builder.toString()), null);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean openOverlayRecipe(ItemStack stackover, boolean shift) {
|
||||
final GuiContainer gui = NEIClientUtils.getGuiContainer();
|
||||
|
||||
if (gui == null || gui instanceof GuiRecipe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return GuiCraftingRecipe.openRecipeGui("item", true, shift, stack);
|
||||
final Point mouseover = getMousePosition();
|
||||
ItemPanelSlot panelSlot = ItemPanels.bookmarkPanel.getSlotMouseOver(mouseover.x, mouseover.y);
|
||||
BookmarkRecipeId recipeId = null;
|
||||
|
||||
if (panelSlot != null) {
|
||||
recipeId = ItemPanels.bookmarkPanel.getBookmarkRecipeId(panelSlot.slotIndex);
|
||||
} else {
|
||||
recipeId = ItemPanels.bookmarkPanel.getBookmarkRecipeId(stackover);
|
||||
}
|
||||
|
||||
if (recipeId != null) {
|
||||
return GuiCraftingRecipe.overlayRecipe(stackover, recipeId, shift);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean saveRecipeInBookmark(ItemStack stack, boolean saveIngredients, boolean saveStackSize) {
|
||||
@@ -120,4 +198,5 @@ public abstract class ShortcutInputHandler {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,14 @@ import static codechicken.lib.asm.InsnComparator.getControlFlowLabels;
|
||||
import static codechicken.lib.asm.InsnComparator.matches;
|
||||
import static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES;
|
||||
import static org.objectweb.asm.ClassWriter.COMPUTE_MAXS;
|
||||
import static org.objectweb.asm.Opcodes.*;
|
||||
import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
|
||||
import static org.objectweb.asm.Opcodes.ACC_STATIC;
|
||||
import static org.objectweb.asm.Opcodes.ALOAD;
|
||||
import static org.objectweb.asm.Opcodes.ASM5;
|
||||
import static org.objectweb.asm.Opcodes.ILOAD;
|
||||
import static org.objectweb.asm.Opcodes.INVOKESPECIAL;
|
||||
import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
|
||||
import static org.objectweb.asm.Opcodes.IRETURN;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
package codechicken.nei.asm;
|
||||
|
||||
import static org.objectweb.asm.Opcodes.*;
|
||||
import static org.objectweb.asm.Opcodes.ACC_FINAL;
|
||||
import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
|
||||
import static org.objectweb.asm.Opcodes.ACC_STATIC;
|
||||
import static org.objectweb.asm.Opcodes.ALOAD;
|
||||
import static org.objectweb.asm.Opcodes.ASTORE;
|
||||
import static org.objectweb.asm.Opcodes.ATHROW;
|
||||
import static org.objectweb.asm.Opcodes.CHECKCAST;
|
||||
import static org.objectweb.asm.Opcodes.DUP;
|
||||
import static org.objectweb.asm.Opcodes.GETSTATIC;
|
||||
import static org.objectweb.asm.Opcodes.GOTO;
|
||||
import static org.objectweb.asm.Opcodes.IFNONNULL;
|
||||
import static org.objectweb.asm.Opcodes.INVOKEINTERFACE;
|
||||
import static org.objectweb.asm.Opcodes.INVOKESPECIAL;
|
||||
import static org.objectweb.asm.Opcodes.MONITORENTER;
|
||||
import static org.objectweb.asm.Opcodes.MONITOREXIT;
|
||||
import static org.objectweb.asm.Opcodes.NEW;
|
||||
import static org.objectweb.asm.Opcodes.PUTSTATIC;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.recipe.GuiRecipeTab;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
@@ -18,8 +20,6 @@ import codechicken.nei.recipe.IRecipeHandler;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import codechicken.nei.util.NBTJson;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
public class HandlerDumper extends DataDumper {
|
||||
|
||||
public HandlerDumper(String name) {
|
||||
|
||||
@@ -20,7 +20,11 @@ public class OptionIntegerField extends OptionTextField {
|
||||
if (s.length() == 0) return true;
|
||||
|
||||
try {
|
||||
Integer.parseInt(s);
|
||||
if (s.startsWith("0x")) {
|
||||
Long.parseLong(s.substring(2), 16);
|
||||
} else {
|
||||
Integer.parseInt(s);
|
||||
}
|
||||
return true;
|
||||
} catch (NumberFormatException nfe) {
|
||||
return false;
|
||||
@@ -30,8 +34,14 @@ public class OptionIntegerField extends OptionTextField {
|
||||
@Override
|
||||
public boolean isValidValue(String s) {
|
||||
if (s.length() == 0 || !isValidInput(s)) return false;
|
||||
int i = 0;
|
||||
|
||||
if (s.startsWith("0x")) {
|
||||
i = (int) Long.parseLong(s.substring(2), 16);
|
||||
} else {
|
||||
i = Integer.parseInt(s);
|
||||
}
|
||||
|
||||
int i = Integer.parseInt(s);
|
||||
return i >= min && i <= max;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package codechicken.nei.config;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
|
||||
@@ -8,12 +8,12 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.LayoutManager;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.LayoutManager;
|
||||
|
||||
public abstract class OptionStringSet extends Option {
|
||||
|
||||
public final LinkedList<String> options = new LinkedList<>();
|
||||
|
||||
@@ -11,7 +11,6 @@ import codechicken.nei.config.GuiOptionList.OptionScrollSlot;
|
||||
|
||||
public class OptionTextField extends Option {
|
||||
|
||||
private boolean focused = false;
|
||||
private TextField textField = new TextField("test") {
|
||||
|
||||
@Override
|
||||
@@ -25,16 +24,11 @@ public class OptionTextField extends Option {
|
||||
getTag().setValue(text());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean focused() {
|
||||
return focused;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFocus(boolean focus) {
|
||||
if (!focus && !isValidValue(text())) setText(renderTag().getValue());
|
||||
|
||||
focused = focus;
|
||||
super.setFocus(focus);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -12,20 +12,15 @@ import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* Event is posted every time the handler infos got registered or reloaded. During it, you can safely register your
|
||||
* custom handler info.
|
||||
*
|
||||
* <br>
|
||||
* This event does not have a result. {@link HasResult}<br>
|
||||
* custom handler info. <br>
|
||||
* This event does not have {@link HasResult result}.<br>
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class NEIRegisterHandlerInfosEvent extends Event {
|
||||
|
||||
public void registerHandlerInfo(String handlerName, String modName, String modId,
|
||||
Consumer<HandlerInfo.Builder> builder) {
|
||||
HandlerInfo.Builder b = new HandlerInfo.Builder(handlerName, modName, modId);
|
||||
builder.accept(b);
|
||||
HandlerInfo info = b.build();
|
||||
public void registerHandlerInfo(HandlerInfo info) {
|
||||
if (GuiRecipeTab.handlerMap.put(info.getHandlerName(), info) != null) {
|
||||
NEIClientConfig.logger.info("Replaced handler info for {}", info.getHandlerName());
|
||||
} else {
|
||||
@@ -33,6 +28,14 @@ public class NEIRegisterHandlerInfosEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
public void registerHandlerInfo(String handlerName, String modName, String modId,
|
||||
Consumer<HandlerInfo.Builder> builder) {
|
||||
HandlerInfo.Builder b = new HandlerInfo.Builder(handlerName, modName, modId);
|
||||
builder.accept(b);
|
||||
HandlerInfo info = b.build();
|
||||
registerHandlerInfo(info);
|
||||
}
|
||||
|
||||
public void registerHandlerInfo(Class<? extends IRecipeHandler> handlerClazz, String modName, String modId,
|
||||
Consumer<HandlerInfo.Builder> builder) {
|
||||
registerHandlerInfo(handlerClazz.getName(), modName, modId, builder);
|
||||
|
||||
@@ -5,7 +5,7 @@ import static codechicken.lib.gui.GuiDraw.fontRenderer;
|
||||
import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
import static codechicken.lib.gui.GuiDraw.renderEngine;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -14,6 +14,8 @@ import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@@ -35,6 +37,7 @@ import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
import codechicken.nei.util.ReadableNumberConverter;
|
||||
|
||||
public class GuiContainerManager {
|
||||
|
||||
@@ -159,33 +162,21 @@ public class GuiContainerManager {
|
||||
return namelist;
|
||||
}
|
||||
|
||||
public static String itemCountDetails(ItemStack stack) {
|
||||
final FluidStack fluid = StackInfo.getFluid(stack);
|
||||
int maxStackSize = stack.getMaxStackSize();
|
||||
int stackSize = stack.stackSize;
|
||||
String FULL_PATTERN = "Count: %s = %s * %s + %s";
|
||||
String SHORT_PATTERN = "Count: %s = %s * %s";
|
||||
|
||||
if (fluid != null) {
|
||||
maxStackSize = 144;
|
||||
stackSize = fluid.amount * Math.max(1, stack.stackSize);
|
||||
FULL_PATTERN = "Amount: %s L = %s * %s L + %s L";
|
||||
SHORT_PATTERN = "Amount: %s L = %s * %s L";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String countDetails(int stackSize, int maxStackSize, String fullPattern, String shortPattern) {
|
||||
if (maxStackSize > 1 && stackSize > maxStackSize) {
|
||||
final int remainder = stackSize % maxStackSize;
|
||||
|
||||
if (remainder > 0) {
|
||||
return String.format(
|
||||
FULL_PATTERN,
|
||||
fullPattern,
|
||||
NEIClientUtils.formatNumbers(stackSize),
|
||||
NEIClientUtils.formatNumbers(stackSize / maxStackSize),
|
||||
NEIClientUtils.formatNumbers(maxStackSize),
|
||||
NEIClientUtils.formatNumbers(remainder));
|
||||
} else {
|
||||
return String.format(
|
||||
SHORT_PATTERN,
|
||||
shortPattern,
|
||||
NEIClientUtils.formatNumbers(stackSize),
|
||||
NEIClientUtils.formatNumbers(stackSize / maxStackSize),
|
||||
NEIClientUtils.formatNumbers(maxStackSize));
|
||||
@@ -195,6 +186,31 @@ public class GuiContainerManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String itemCountDetails(ItemStack stack) {
|
||||
FluidStack fluid = StackInfo.getFluid(stack);
|
||||
if (fluid != null) {
|
||||
return fluidAmountDetails(fluid.amount * Math.max(1, stack.stackSize));
|
||||
} else {
|
||||
return countDetails(
|
||||
stack.stackSize,
|
||||
stack.getMaxStackSize(),
|
||||
"Count: %s = %s * %s + %s",
|
||||
"Count: %s = %s * %s");
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Nullable
|
||||
public static String fluidAmountDetails(FluidStack fluid) {
|
||||
return fluidAmountDetails(fluid.amount);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String fluidAmountDetails(int amount) {
|
||||
return countDetails(amount, 144, "Amount: %s L = %s * %s L + %s L", "Amount: %s L = %s * %s L");
|
||||
}
|
||||
|
||||
/**
|
||||
* The general name of this item.
|
||||
*
|
||||
@@ -254,17 +270,33 @@ public class GuiContainerManager {
|
||||
boolean glRescale = GL11.glGetBoolean(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
float zLevel = drawItems.zLevel += 100F;
|
||||
float scale = smallAmount ? 0.5f : 1f;
|
||||
|
||||
try {
|
||||
drawItems.renderItemAndEffectIntoGUI(fontRenderer, renderEngine, itemstack, i, j);
|
||||
|
||||
if (stackSize == null) {
|
||||
stackSize = itemstack.stackSize > 1 ? String.valueOf(itemstack.stackSize) : "";
|
||||
if (itemstack.stackSize > 1) {
|
||||
stackSize = ReadableNumberConverter.INSTANCE.toWideReadableForm(itemstack.stackSize);
|
||||
|
||||
if (stackSize.length() == 3) {
|
||||
scale = 0.8f;
|
||||
} else if (stackSize.length() == 4) {
|
||||
scale = 0.6f;
|
||||
} else if (stackSize.length() > 4) {
|
||||
scale = 0.5f;
|
||||
}
|
||||
|
||||
} else {
|
||||
stackSize = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (smallAmount) {
|
||||
if (scale != 1f) {
|
||||
|
||||
if (!stackSize.isEmpty()) {
|
||||
drawBigStackSize(i, j, stackSize);
|
||||
drawBigStackSize(i, j, stackSize, scale);
|
||||
}
|
||||
|
||||
// stackSize = "". it needed for correct draw item with alpha and blend
|
||||
@@ -296,16 +328,15 @@ public class GuiContainerManager {
|
||||
}
|
||||
|
||||
// copy from appeng.client.render.AppEngRenderItem
|
||||
protected static void drawBigStackSize(int offsetX, int offsetY, String stackSize) {
|
||||
final float scaleFactor = fontRenderer.getUnicodeFlag() ? 0.85f : 0.5f;
|
||||
final float inverseScaleFactor = 1.0f / scaleFactor;
|
||||
protected static void drawBigStackSize(int offsetX, int offsetY, String stackSize, float scale) {
|
||||
final float inverseScaleFactor = 1.0f / scale;
|
||||
|
||||
enable2DRender();
|
||||
GL11.glScaled(scaleFactor, scaleFactor, scaleFactor);
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
final int X = (int) (((float) offsetX + 16.0f - fontRenderer.getStringWidth(stackSize) * scaleFactor)
|
||||
final int X = (int) (((float) offsetX + 16.0f - fontRenderer.getStringWidth(stackSize) * scale)
|
||||
* inverseScaleFactor);
|
||||
final int Y = (int) (((float) offsetY + 16.0f - 7.0f * scaleFactor) * inverseScaleFactor);
|
||||
final int Y = (int) (((float) offsetY + 16.0f - 7.0f * scale) * inverseScaleFactor);
|
||||
fontRenderer.drawStringWithShadow(stackSize, X, Y, 16777215);
|
||||
|
||||
GL11.glScaled(inverseScaleFactor, inverseScaleFactor, inverseScaleFactor);
|
||||
@@ -499,6 +530,10 @@ public class GuiContainerManager {
|
||||
if (tooltip.size() > 0) tooltip.set(0, tooltip.get(0) + GuiDraw.TOOLTIP_LINESPACE); // add space after 'title'
|
||||
|
||||
drawPagedTooltip(font, mousex + 12, mousey - 12, tooltip);
|
||||
|
||||
for (IContainerDrawHandler drawHandler : drawHandlers) {
|
||||
drawHandler.postRenderTooltips(window, mousex, mousey, tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
private static int tooltipPage;
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
package codechicken.nei.guihook;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Spliterator;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package codechicken.nei.guihook;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
@@ -30,6 +32,17 @@ public interface IContainerDrawHandler {
|
||||
*/
|
||||
public void postRenderObjects(GuiContainer gui, int mousex, int mousey);
|
||||
|
||||
/**
|
||||
* Use this to draw things that should be drawn just after vanilla slot tooltips, on top of buttons and other
|
||||
* usually always-on-top widgets.
|
||||
*
|
||||
* @param gui An instance of the currentscreen
|
||||
* @param mousex The x position of the mouse in pixels from left
|
||||
* @param mousey The y position of the mouse in pixels from top
|
||||
* @param tooltip The contents of the tooltip that has previously been drawn
|
||||
*/
|
||||
default void postRenderTooltips(GuiContainer gui, int mousex, int mousey, List<String> tooltip) {}
|
||||
|
||||
/**
|
||||
* Render something over a slot before the item in the slot.
|
||||
*
|
||||
|
||||
@@ -6,20 +6,16 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.util.NBTJson;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.util.NBTJson;
|
||||
|
||||
public class BookmarkRecipeId {
|
||||
|
||||
public int position = -1;
|
||||
|
||||
public int recipetype = -1;
|
||||
|
||||
public String handlerName = null;
|
||||
|
||||
public List<NBTTagCompound> ingredients = new ArrayList<>();
|
||||
|
||||
@@ -8,12 +8,10 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
|
||||
import com.google.common.collect.ForwardingList;
|
||||
|
||||
// Do not directly extend ArrayList, see Effective Java Item 16
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
|
||||
public class CatalystInfoList extends ForwardingList<CatalystInfo> {
|
||||
|
||||
private final String handlerID;
|
||||
@@ -34,16 +32,21 @@ public class CatalystInfoList extends ForwardingList<CatalystInfo> {
|
||||
}
|
||||
|
||||
@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;
|
||||
public boolean add(@Nonnull CatalystInfo element) {
|
||||
return doAdd(element);
|
||||
}
|
||||
|
||||
public boolean add(@Nonnull CatalystInfo catalystInfo, boolean overwrite) {
|
||||
if (overwrite || !contains(catalystInfo)) {
|
||||
return add(catalystInfo);
|
||||
}
|
||||
super.add(catalystInfo);
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean doAdd(@Nonnull CatalystInfo catalystInfo) {
|
||||
catalystInfoList
|
||||
.removeIf(c -> NEIServerUtils.areStacksSameTypeCraftingWithNBT(c.getStack(), catalystInfo.getStack()));
|
||||
catalystInfoList.add(catalystInfo);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -118,8 +118,8 @@ public class DefaultOverlayHandler implements IOverlayHandler {
|
||||
ItemStack stack = slot.getStack();
|
||||
if (!canStack(stack, pstack)) continue;
|
||||
|
||||
FastTransferManager.clickSlot(gui, slot.slotNumber);
|
||||
int amount = Math.min(transferCap - transferred, stack.stackSize);
|
||||
FastTransferManager.clickSlot(gui, slot.slotNumber);
|
||||
for (int c = 0; c < amount; c++) {
|
||||
FastTransferManager.clickSlot(gui, dest.slotNumber, 1);
|
||||
transferred++;
|
||||
@@ -146,11 +146,20 @@ public class DefaultOverlayHandler implements IOverlayHandler {
|
||||
DistributedIngred istack = distrib.distrib;
|
||||
if (istack.numSlots == 0) return 0;
|
||||
|
||||
final int maxStackSize = istack.stack.getMaxStackSize();
|
||||
int allSlots = istack.invAmount;
|
||||
if (allSlots / istack.numSlots > istack.stack.getMaxStackSize())
|
||||
allSlots = istack.numSlots * istack.stack.getMaxStackSize();
|
||||
if (allSlots / istack.numSlots > maxStackSize) allSlots = istack.numSlots * maxStackSize;
|
||||
|
||||
quantity = Math.min(quantity, allSlots / istack.distributed);
|
||||
final int newQuantity = allSlots / istack.distributed;
|
||||
if (maxStackSize == 1) {
|
||||
// If non-stackable, fill up as much as possible of the other ingredients
|
||||
continue;
|
||||
}
|
||||
quantity = Math.min(quantity, newQuantity);
|
||||
}
|
||||
if (quantity == Integer.MAX_VALUE) {
|
||||
// Only possible if all ingredients were non-stackable
|
||||
quantity = 1;
|
||||
}
|
||||
|
||||
return quantity;
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@@ -16,6 +18,7 @@ import codechicken.nei.ItemPanels;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.stackinfo.GTFluidStackStringifyHandler;
|
||||
|
||||
public class GuiCraftingRecipe extends GuiRecipe<ICraftingHandler> {
|
||||
|
||||
@@ -23,46 +26,101 @@ public class GuiCraftingRecipe extends GuiRecipe<ICraftingHandler> {
|
||||
public static ArrayList<ICraftingHandler> serialCraftingHandlers = new ArrayList<>();
|
||||
|
||||
public static boolean openRecipeGui(String outputId, Object... results) {
|
||||
return openRecipeGui(outputId, false, false, results);
|
||||
return createRecipeGui(outputId, true, results) != null;
|
||||
}
|
||||
|
||||
public static boolean openRecipeGui(String outputId, final Boolean overlay, final Boolean shift,
|
||||
Object... results) {
|
||||
public static GuiRecipe<?> createRecipeGui(String outputId, boolean open, Object... results) {
|
||||
final Minecraft mc = NEIClientUtils.mc();
|
||||
final BookmarkRecipeId recipeId;
|
||||
|
||||
final BookmarkRecipeId recipeId = "item".equals(outputId)
|
||||
? getRecipeId(mc.currentScreen, (ItemStack) results[0])
|
||||
: getCurrentRecipe(mc.currentScreen);
|
||||
if ("item".equals(outputId)) {
|
||||
results = Arrays.asList(results).stream().map(rslt -> normalizeItemStack((ItemStack) rslt)).toArray();
|
||||
recipeId = getRecipeId(mc.currentScreen, (ItemStack) results[0]);
|
||||
} else if ("recipeId".equals(outputId)) {
|
||||
recipeId = (BookmarkRecipeId) results[1];
|
||||
} else {
|
||||
recipeId = getCurrentRecipe(mc.currentScreen);
|
||||
}
|
||||
|
||||
if (overlay && recipeId == null) return false;
|
||||
final ArrayList<ICraftingHandler> handlers = getCraftingHandlers(outputId, results);
|
||||
|
||||
if (!handlers.isEmpty()) {
|
||||
final GuiCraftingRecipe gui = new GuiCraftingRecipe(handlers, "recipeId".equals(outputId));
|
||||
|
||||
if (open) {
|
||||
mc.displayGuiScreen(gui);
|
||||
}
|
||||
|
||||
gui.openTargetRecipe(recipeId);
|
||||
return gui;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean overlayRecipe(ItemStack stack, BookmarkRecipeId recipeId, final Boolean shift) {
|
||||
|
||||
if (stack == null || recipeId == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final ArrayList<ICraftingHandler> handlers = getCraftingHandlers("recipeId", stack, recipeId);
|
||||
|
||||
if (!handlers.isEmpty()) {
|
||||
final GuiCraftingRecipe gui = new GuiCraftingRecipe(handlers, true);
|
||||
final int recipe = gui.openTargetRecipe(recipeId);
|
||||
|
||||
if (recipe != -1) {
|
||||
gui.overlayRecipe(recipe, shift);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ArrayList<ICraftingHandler> getCraftingHandlers(String outputId, Object... results) {
|
||||
ArrayList<ICraftingHandler> craftinghandlers = GuiCraftingRecipe.craftinghandlers;
|
||||
ArrayList<ICraftingHandler> serialCraftingHandlers = GuiCraftingRecipe.serialCraftingHandlers;
|
||||
Function<ICraftingHandler, ICraftingHandler> recipeHandlerFunction;
|
||||
|
||||
if ("recipeId".equals(outputId)) {
|
||||
ItemStack stack = (ItemStack) results[0];
|
||||
BookmarkRecipeId recipeId = (BookmarkRecipeId) results[1];
|
||||
craftinghandlers = filterByHandlerName(craftinghandlers, recipeId.handlerName);
|
||||
serialCraftingHandlers = filterByHandlerName(serialCraftingHandlers, recipeId.handlerName);
|
||||
recipeHandlerFunction = h -> h.getRecipeHandler("item", stack);
|
||||
} else {
|
||||
recipeHandlerFunction = h -> h.getRecipeHandler(outputId, results);
|
||||
}
|
||||
|
||||
final RecipeHandlerQuery<ICraftingHandler> recipeQuery = new RecipeHandlerQuery<>(
|
||||
h -> h.getRecipeHandler(outputId, results),
|
||||
recipeHandlerFunction,
|
||||
craftinghandlers,
|
||||
serialCraftingHandlers,
|
||||
"Error while looking up crafting recipe",
|
||||
"outputId: " + outputId,
|
||||
"results: " + Arrays.toString(results));
|
||||
|
||||
final ArrayList<ICraftingHandler> handlers = recipeQuery.runWithProfiling("recipe.concurrent.crafting");
|
||||
return recipeQuery.runWithProfiling("recipe.concurrent.crafting");
|
||||
}
|
||||
|
||||
if (!handlers.isEmpty()) {
|
||||
GuiCraftingRecipe gui = new GuiCraftingRecipe(handlers, recipeId);
|
||||
private static ArrayList<ICraftingHandler> filterByHandlerName(ArrayList<ICraftingHandler> craftinghandlers,
|
||||
String handlerName) {
|
||||
return craftinghandlers.stream().filter(h -> getHandlerName(h).equals(handlerName))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
mc.displayGuiScreen(gui);
|
||||
private static String getHandlerName(ICraftingHandler handler) {
|
||||
return GuiRecipeTab.getHandlerInfo(handler).getHandlerName();
|
||||
}
|
||||
|
||||
if (recipeId != null) {
|
||||
gui.openTargetRecipe(gui.recipeId);
|
||||
}
|
||||
|
||||
if (overlay) {
|
||||
gui.overlayRecipe(gui.recipeId.position, shift);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
private static ItemStack normalizeItemStack(ItemStack stack) {
|
||||
GTFluidStackStringifyHandler.replaceAE2FCFluidDrop = true;
|
||||
stack = StackInfo.loadFromNBT(StackInfo.itemStackToNBT(stack));
|
||||
GTFluidStackStringifyHandler.replaceAE2FCFluidDrop = false;
|
||||
return stack;
|
||||
}
|
||||
|
||||
protected static BookmarkRecipeId getRecipeId(GuiScreen gui, ItemStack stackover) {
|
||||
@@ -86,14 +144,15 @@ public class GuiCraftingRecipe extends GuiRecipe<ICraftingHandler> {
|
||||
return ItemPanels.bookmarkPanel.getBookmarkRecipeId(stackover);
|
||||
}
|
||||
|
||||
private GuiCraftingRecipe(ArrayList<ICraftingHandler> handlers, BookmarkRecipeId recipeId) {
|
||||
private GuiCraftingRecipe(ArrayList<ICraftingHandler> handlers, boolean limitToOneRecipe) {
|
||||
super(NEIClientUtils.mc().currentScreen);
|
||||
this.limitToOneRecipe = limitToOneRecipe;
|
||||
this.currenthandlers = handlers;
|
||||
this.recipeId = recipeId;
|
||||
}
|
||||
|
||||
public static void registerRecipeHandler(ICraftingHandler handler) {
|
||||
final String handlerId = handler.getHandlerId();
|
||||
|
||||
if (craftinghandlers.stream().anyMatch(h -> h.getHandlerId().equals(handlerId))
|
||||
|| serialCraftingHandlers.stream().anyMatch(h -> h.getHandlerId().equals(handlerId)))
|
||||
return;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -10,7 +10,10 @@ import java.net.URL;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -282,6 +285,20 @@ public abstract class GuiRecipeTab extends Widget {
|
||||
handlerMap.keySet().removeAll(handlerRemoverFromIMC);
|
||||
handlerMap.putAll(handlerAdderFromIMC);
|
||||
|
||||
if (!handlerAdderFromIMC.isEmpty()) {
|
||||
// If we're getting an IMC message, it probably means it should match
|
||||
Set<String> handlerIds = new HashSet<>(handlerMap.keySet());
|
||||
handlerAdderFromIMC.keySet().forEach(handlerName -> {
|
||||
if (!handlerIds.contains(handlerName)) {
|
||||
NEIClientConfig.logger.warn("Could not find a registered handlerID that matches " + handlerName);
|
||||
handlerIds.forEach(handler -> {
|
||||
if (handler.equalsIgnoreCase(handlerName)) {
|
||||
NEIClientConfig.logger.warn(" -- Did you mean: " + handler);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
NEIClientConfig.logger.info("Sending {}", NEIRegisterHandlerInfosEvent.class.getSimpleName());
|
||||
MinecraftForge.EVENT_BUS.post(new NEIRegisterHandlerInfosEvent());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import java.awt.*;
|
||||
import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -40,7 +43,7 @@ public class GuiRecipeTabs {
|
||||
categoriesPerPage = 0;
|
||||
numHandlers = guiRecipe.currenthandlers.size();
|
||||
|
||||
for (IRecipeHandler handler : guiRecipe.currenthandlers) {
|
||||
for (int i = 0; i < numHandlers; i++) {
|
||||
if (totalWidth + tabWidth < (guiRecipe.xSize - 4)) {
|
||||
totalWidth += tabWidth;
|
||||
categoriesPerPage++;
|
||||
@@ -76,9 +79,11 @@ public class GuiRecipeTabs {
|
||||
IRecipeHandler handler = guiRecipe.currenthandlers.get(index);
|
||||
int tabX = area.x + (i * tabWidth);
|
||||
|
||||
if (NEIClientConfig.useCreativeTabStyle())
|
||||
if (NEIClientConfig.useCreativeTabStyle()) {
|
||||
tabs.add(new GuiRecipeTabCreative(guiRecipe, handler, tabX, area.y));
|
||||
else tabs.add(new GuiRecipeTabJEI(guiRecipe, handler, tabX, area.y));
|
||||
} else {
|
||||
tabs.add(new GuiRecipeTabJEI(guiRecipe, handler, tabX, area.y));
|
||||
}
|
||||
}
|
||||
|
||||
// Maybe add buttons
|
||||
@@ -192,4 +197,18 @@ public class GuiRecipeTabs {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean mouseScrolled(int i) {
|
||||
Point mousePosition = getMousePosition();
|
||||
|
||||
// Switch between recipe handlers if the cursor is over the tabbar.
|
||||
if (NEIClientConfig.areJEIStyleTabsVisible() && area.contains(mousePosition)) {
|
||||
if (i < 0) guiRecipe.nextType();
|
||||
else guiRecipe.prevType();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,11 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.recipe.stackinfo.GTFluidStackStringifyHandler;
|
||||
|
||||
public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
|
||||
|
||||
@@ -14,31 +16,50 @@ public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
|
||||
public static ArrayList<IUsageHandler> serialUsageHandlers = new ArrayList<>();
|
||||
|
||||
public static boolean openRecipeGui(String inputId, Object... ingredients) {
|
||||
RecipeHandlerQuery<IUsageHandler> recipeQuery = new RecipeHandlerQuery<>(
|
||||
|
||||
if ("item".equals(inputId)) {
|
||||
ingredients = Arrays.asList(ingredients).stream().map(ingr -> normalizeItemStack((ItemStack) ingr))
|
||||
.toArray();
|
||||
}
|
||||
|
||||
final ArrayList<IUsageHandler> handlers = getUsageHandlers(inputId, ingredients);
|
||||
|
||||
if (!handlers.isEmpty()) {
|
||||
final Minecraft mc = NEIClientUtils.mc();
|
||||
final BookmarkRecipeId recipeId = getCurrentRecipe(mc.currentScreen);
|
||||
final GuiUsageRecipe gui = new GuiUsageRecipe(handlers);
|
||||
|
||||
mc.displayGuiScreen(gui);
|
||||
gui.openTargetRecipe(recipeId);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private GuiUsageRecipe(ArrayList<IUsageHandler> handlers) {
|
||||
super(NEIClientUtils.mc().currentScreen);
|
||||
this.currenthandlers = handlers;
|
||||
}
|
||||
|
||||
public static ArrayList<IUsageHandler> getUsageHandlers(String inputId, Object... ingredients) {
|
||||
|
||||
final RecipeHandlerQuery<IUsageHandler> recipeQuery = new RecipeHandlerQuery<>(
|
||||
h -> getUsageOrCatalystHandler(h, inputId, ingredients),
|
||||
usagehandlers,
|
||||
serialUsageHandlers,
|
||||
"Error while looking up usage recipe",
|
||||
"inputId: " + inputId,
|
||||
"ingredients: " + Arrays.toString(ingredients));
|
||||
ArrayList<IUsageHandler> handlers = recipeQuery.runWithProfiling("recipe.concurrent.usage");
|
||||
if (handlers.isEmpty()) return false;
|
||||
|
||||
Minecraft mc = NEIClientUtils.mc();
|
||||
BookmarkRecipeId recipeId = getCurrentRecipe(mc.currentScreen);
|
||||
GuiUsageRecipe gui = new GuiUsageRecipe(handlers, recipeId);
|
||||
|
||||
mc.displayGuiScreen(gui);
|
||||
|
||||
gui.openTargetRecipe(gui.recipeId);
|
||||
|
||||
return true;
|
||||
return recipeQuery.runWithProfiling("recipe.concurrent.usage");
|
||||
}
|
||||
|
||||
private GuiUsageRecipe(ArrayList<IUsageHandler> handlers, BookmarkRecipeId recipeId) {
|
||||
super(NEIClientUtils.mc().currentScreen);
|
||||
this.currenthandlers = handlers;
|
||||
this.recipeId = recipeId;
|
||||
private static ItemStack normalizeItemStack(ItemStack stack) {
|
||||
GTFluidStackStringifyHandler.replaceAE2FCFluidDrop = true;
|
||||
stack = StackInfo.loadFromNBT(StackInfo.itemStackToNBT(stack));
|
||||
GTFluidStackStringifyHandler.replaceAE2FCFluidDrop = false;
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static void registerUsageHandler(IUsageHandler handler) {
|
||||
|
||||
@@ -131,6 +131,12 @@ public class HandlerInfo {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDisplayImage(DrawableResource drawable) {
|
||||
info.itemStack = null;
|
||||
info.image = drawable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDisplayImage(ResourceLocation location, int imageX, int imageY, int imageWidth,
|
||||
int imageHeight) {
|
||||
info.itemStack = null;
|
||||
|
||||
@@ -52,14 +52,14 @@ public interface IRecipeHandler {
|
||||
|
||||
/**
|
||||
* Draw the background of this recipe handler (basically the slot layout image).
|
||||
*
|
||||
*
|
||||
* @param recipe The recipe index to draw at this position.
|
||||
*/
|
||||
void drawBackground(int recipe);
|
||||
|
||||
/**
|
||||
* Draw the foreground of this recipe handler (for things like progress bars).
|
||||
*
|
||||
*
|
||||
* @param recipe The recipe index to draw at this position.
|
||||
*/
|
||||
void drawForeground(int recipe);
|
||||
@@ -74,11 +74,11 @@ public interface IRecipeHandler {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param recipetype The recipe index to get items for.
|
||||
* @param recipe 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.
|
||||
*/
|
||||
List<PositionedStack> getOtherStacks(int recipetype);
|
||||
List<PositionedStack> getOtherStacks(int recipe);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.ItemPanels;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.api.IOverlayHandler;
|
||||
import codechicken.nei.api.IRecipeOverlayRenderer;
|
||||
|
||||
class ItemsHistoryHandler implements ICraftingHandler, IUsageHandler {
|
||||
|
||||
@Override
|
||||
public ICraftingHandler getRecipeHandler(String outputId, Object... results) {
|
||||
|
||||
if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(outputId) && results[0] instanceof ItemStack) {
|
||||
ItemPanels.itemPanel.historyPanel.addItem((ItemStack) results[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IUsageHandler getUsageHandler(String inputId, Object... ingredients) {
|
||||
|
||||
if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(inputId) && ingredients[0] instanceof ItemStack) {
|
||||
ItemPanels.itemPanel.historyPanel.addItem((ItemStack) ingredients[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlay(GuiContainer gui, Container container, int recipe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipeOverlayRenderer getOverlayRenderer(GuiContainer gui, int recipe) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOverlayHandler getOverlayHandler(GuiContainer gui, int recipe) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> currenttip, int recipe) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack stack, List<String> currenttip, int recipe) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(GuiRecipe gui, int button, int recipe) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int numRecipes() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipe) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawForeground(int recipe) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredientStacks(int recipe) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks(int recipeType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResultStack(int recipe) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class ProfilerRecipeHandler implements ICraftingHandler, IUsageHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<PositionedStack> getOtherStacks(int recipetype) {
|
||||
public ArrayList<PositionedStack> getOtherStacks(int recipe) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,10 @@ import java.nio.channels.ReadableByteChannel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -22,11 +24,11 @@ import org.apache.commons.csv.CSVFormat;
|
||||
import org.apache.commons.csv.CSVParser;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
public class RecipeCatalysts {
|
||||
@@ -130,6 +132,8 @@ public class RecipeCatalysts {
|
||||
recipeCatalystMap.clear();
|
||||
URL handlerUrl = RecipeCatalysts.class.getResource("/assets/nei/csv/catalysts.csv");
|
||||
|
||||
resolveAdderQueue();
|
||||
|
||||
URL url;
|
||||
if (fromJar) {
|
||||
url = handlerUrl;
|
||||
@@ -181,7 +185,7 @@ public class RecipeCatalysts {
|
||||
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);
|
||||
NEIClientConfig.logger.debug("Couldn't find ItemStack " + itemName);
|
||||
continue;
|
||||
}
|
||||
CatalystInfo catalystInfo = new CatalystInfo(stack, priority);
|
||||
@@ -206,13 +210,23 @@ public class RecipeCatalysts {
|
||||
handlerID = handler;
|
||||
}
|
||||
|
||||
addOrPut(recipeCatalystMap, handlerID, catalystInfo);
|
||||
// Prefer info added by API if we're using default jar config.
|
||||
// If not, user config overwrites it.
|
||||
addOrPut(recipeCatalystMap, handlerID, catalystInfo, !fromJar);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.warn("Error parsing CSV");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (fromJar) {
|
||||
resolveRemoverQueue();
|
||||
}
|
||||
|
||||
updatePosition(getHeight(), true);
|
||||
}
|
||||
|
||||
private static void resolveAdderQueue() {
|
||||
for (Map.Entry<String, CatalystInfoList> entry : catalystsAdderFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
for (CatalystInfo catalyst : entry.getValue()) {
|
||||
@@ -227,6 +241,23 @@ public class RecipeCatalysts {
|
||||
}
|
||||
}
|
||||
|
||||
if (!catalystsAdderFromIMC.isEmpty()) {
|
||||
// If we're getting an IMC message, it probably means it should match
|
||||
Set<String> handlerIds = new HashSet<>(GuiRecipeTab.handlerMap.keySet());
|
||||
catalystsAdderFromIMC.keySet().forEach(handlerName -> {
|
||||
if (!handlerIds.contains(handlerName)) {
|
||||
NEIClientConfig.logger.warn("Could not find a registered handlerID that matches " + handlerName);
|
||||
handlerIds.forEach(handler -> {
|
||||
if (handler.equalsIgnoreCase(handlerName)) {
|
||||
NEIClientConfig.logger.warn(" -- Did you mean: " + handler);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static void resolveRemoverQueue() {
|
||||
for (Map.Entry<String, List<ItemStack>> entry : catalystsRemoverFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
if (recipeCatalystMap.containsKey(handlerID)) {
|
||||
@@ -242,8 +273,6 @@ public class RecipeCatalysts {
|
||||
entry.getValue().forEach(catalysts::remove);
|
||||
}
|
||||
}
|
||||
|
||||
updatePosition(getHeight(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,8 +288,13 @@ public class RecipeCatalysts {
|
||||
}
|
||||
|
||||
public static void addOrPut(Map<String, CatalystInfoList> map, String handlerID, CatalystInfo catalyst) {
|
||||
addOrPut(map, handlerID, catalyst, false);
|
||||
}
|
||||
|
||||
public static void addOrPut(Map<String, CatalystInfoList> map, String handlerID, CatalystInfo catalyst,
|
||||
boolean overwrite) {
|
||||
if (map.containsKey(handlerID)) {
|
||||
map.get(handlerID).add(catalyst);
|
||||
map.get(handlerID).add(catalyst, overwrite);
|
||||
} else {
|
||||
map.put(handlerID, new CatalystInfoList(handlerID, catalyst));
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
|
||||
profiler.start(profilerSection);
|
||||
try {
|
||||
ArrayList<T> handlers = getRecipeHandlersParallel();
|
||||
|
||||
if (error) {
|
||||
displayRecipeLookupError();
|
||||
}
|
||||
@@ -60,27 +61,37 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
|
||||
}
|
||||
|
||||
private ArrayList<T> getSerialHandlersWithRecipes() {
|
||||
|
||||
return serialRecipeHandlers.stream().map(handler -> {
|
||||
try {
|
||||
return recipeHandlerFunction.apply(handler);
|
||||
return isHidden(handler) ? null : recipeHandlerFunction.apply(handler);
|
||||
} catch (Throwable t) {
|
||||
printLog(t);
|
||||
error = true;
|
||||
return null;
|
||||
}
|
||||
}).filter(h -> h != null && h.numRecipes() > 0).collect(Collectors.toCollection(ArrayList::new));
|
||||
}).filter(h -> h != null && h.numRecipes() > 0 && SearchRecipeHandler.findFirst(h, (recipeIndex) -> true) != -1)
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
private ArrayList<T> getHandlersWithRecipes() throws InterruptedException, ExecutionException {
|
||||
|
||||
return ItemList.forkJoinPool.submit(() -> recipeHandlers.parallelStream().map(handler -> {
|
||||
try {
|
||||
return recipeHandlerFunction.apply(handler);
|
||||
return isHidden(handler) ? null : recipeHandlerFunction.apply(handler);
|
||||
} catch (Throwable t) {
|
||||
printLog(t);
|
||||
error = true;
|
||||
return null;
|
||||
}
|
||||
}).filter(h -> h != null && h.numRecipes() > 0).collect(Collectors.toCollection(ArrayList::new))).get();
|
||||
}).filter(h -> h != null && h.numRecipes() > 0 && SearchRecipeHandler.findFirst(h, (recipeIndex) -> true) != -1)
|
||||
.collect(Collectors.toCollection(ArrayList::new))).get();
|
||||
}
|
||||
|
||||
private boolean isHidden(T handler) {
|
||||
final String handlerName = handler.getHandlerId();
|
||||
final String handlerId = handler.getOverlayIdentifier();
|
||||
return NEIClientConfig.hiddenHandlers.stream().anyMatch(h -> h.equals(handlerId) || h.equals(handlerName));
|
||||
}
|
||||
|
||||
private void printLog(Throwable t) {
|
||||
|
||||
@@ -8,13 +8,13 @@ import net.minecraft.client.gui.inventory.GuiCrafting;
|
||||
import net.minecraft.client.gui.inventory.GuiFurnace;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import codechicken.nei.OffsetPositioner;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IOverlayHandler;
|
||||
import codechicken.nei.api.IStackPositioner;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
public class RecipeInfo {
|
||||
|
||||
private static class OverlayKey {
|
||||
@@ -113,5 +113,7 @@ public class RecipeInfo {
|
||||
|
||||
API.registerRecipeHandler(new ProfilerRecipeHandler(true));
|
||||
API.registerUsageHandler(new ProfilerRecipeHandler(false));
|
||||
API.registerRecipeHandler(new ItemsHistoryHandler());
|
||||
API.registerUsageHandler(new ItemsHistoryHandler());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.api.IRecipeFilter;
|
||||
|
||||
class SearchRecipeHandler<H extends IRecipeHandler> {
|
||||
|
||||
public H original;
|
||||
|
||||
private ArrayList<Integer> filteredRecipes;
|
||||
|
||||
private ArrayList<Integer> searchRecipes;
|
||||
|
||||
public SearchRecipeHandler(H handler) {
|
||||
this.original = handler;
|
||||
|
||||
if (this.original.numRecipes() == 0) {
|
||||
this.filteredRecipes = new ArrayList<>();
|
||||
} else {
|
||||
final Stream<Integer> items = IntStream.range(0, this.original.numRecipes()).boxed();
|
||||
final IRecipeFilter filter = this.searchingAvailable() ? GuiRecipe.getRecipeListFilter() : null;
|
||||
|
||||
if (filter == null) {
|
||||
this.filteredRecipes = items.collect(Collectors.toCollection(ArrayList::new));
|
||||
} else {
|
||||
this.filteredRecipes = items.filter(recipe -> mathRecipe(this.original, recipe, filter))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected static boolean mathRecipe(IRecipeHandler handler, int recipe, IRecipeFilter filter) {
|
||||
return filter.matches(
|
||||
handler,
|
||||
handler.getIngredientStacks(recipe),
|
||||
handler.getResultStack(recipe),
|
||||
handler.getOtherStacks(recipe));
|
||||
}
|
||||
|
||||
public boolean searchingAvailable() {
|
||||
return SearchRecipeHandler.searchingAvailable(this.original);
|
||||
}
|
||||
|
||||
private static boolean searchingAvailable(IRecipeHandler handler) {
|
||||
return handler instanceof TemplateRecipeHandler;
|
||||
}
|
||||
|
||||
public static int findFirst(IRecipeHandler handler, Predicate<Integer> predicate) {
|
||||
final IRecipeFilter filter = searchingAvailable(handler) ? GuiRecipe.getRecipeListFilter() : null;
|
||||
int refIndex = -1;
|
||||
|
||||
for (int recipeIndex = 0; recipeIndex < handler.numRecipes(); recipeIndex++) {
|
||||
if (filter == null || mathRecipe(handler, recipeIndex, filter)) {
|
||||
refIndex++;
|
||||
|
||||
if (predicate.test(recipeIndex)) {
|
||||
return refIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getSearchResult(IRecipeFilter filter) {
|
||||
|
||||
if (filteredRecipes.isEmpty() || !this.searchingAvailable()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ArrayList<Integer> filtered = null;
|
||||
final ArrayList<Integer> recipes = IntStream.range(0, filteredRecipes.size()).boxed()
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
|
||||
try {
|
||||
filtered = ItemList.forkJoinPool.submit(
|
||||
() -> recipes.parallelStream()
|
||||
.filter(recipe -> mathRecipe(this.original, filteredRecipes.get(recipe), filter))
|
||||
.collect(Collectors.toCollection(ArrayList::new)))
|
||||
.get();
|
||||
|
||||
filtered.sort((a, b) -> a - b);
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
return filtered;
|
||||
}
|
||||
|
||||
public void setSearchIndices(ArrayList<Integer> searchRecipes) {
|
||||
this.searchRecipes = searchRecipes;
|
||||
}
|
||||
|
||||
public int ref(int index) {
|
||||
|
||||
if (searchRecipes != null) {
|
||||
index = searchRecipes.get(index);
|
||||
}
|
||||
|
||||
return filteredRecipes.get(index);
|
||||
}
|
||||
|
||||
public int numRecipes() {
|
||||
|
||||
if (searchRecipes != null) {
|
||||
return searchRecipes.size();
|
||||
}
|
||||
|
||||
return filteredRecipes.size();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,14 +8,18 @@ import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
@@ -29,6 +33,13 @@ public class StackInfo {
|
||||
public static final ArrayList<IStackStringifyHandler> stackStringifyHandlers = new ArrayList<>();
|
||||
private static final HashMap<String, HashMap<String, String[]>> guidfilters = new HashMap<>();
|
||||
private static final WeakHashMap<ItemStack, String> guidcache = new WeakHashMap<>();
|
||||
private static final LinkedHashMap<ItemStack, FluidStack> fluidcache = new LinkedHashMap<ItemStack, FluidStack>() {
|
||||
|
||||
@Override
|
||||
protected boolean removeEldestEntry(Map.Entry<ItemStack, FluidStack> eldest) {
|
||||
return size() > 20;
|
||||
}
|
||||
};
|
||||
|
||||
static {
|
||||
stackStringifyHandlers.add(new DefaultStackStringifyHandler());
|
||||
@@ -49,11 +60,24 @@ public class StackInfo {
|
||||
return nbTag;
|
||||
}
|
||||
|
||||
public static ItemStack loadFromNBT(NBTTagCompound nbtTag, long customCount) {
|
||||
|
||||
if (nbtTag != null) {
|
||||
nbtTag = (NBTTagCompound) nbtTag.copy();
|
||||
nbtTag.setInteger("Count", (int) Math.max(Math.min(customCount, Integer.MAX_VALUE), 0));
|
||||
return loadFromNBT(nbtTag);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ItemStack loadFromNBT(NBTTagCompound nbtTag) {
|
||||
ItemStack stack = null;
|
||||
|
||||
for (int i = stackStringifyHandlers.size() - 1; i >= 0 && nbtTag != null && stack == null; i--) {
|
||||
stack = stackStringifyHandlers.get(i).convertNBTToItemStack(nbtTag);
|
||||
if (nbtTag != null) {
|
||||
for (int i = stackStringifyHandlers.size() - 1; i >= 0 && stack == null; i--) {
|
||||
stack = stackStringifyHandlers.get(i).convertNBTToItemStack(nbtTag);
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
@@ -76,15 +100,24 @@ public class StackInfo {
|
||||
}
|
||||
|
||||
public static FluidStack getFluid(ItemStack stack) {
|
||||
FluidStack fluid = null;
|
||||
FluidStack fluid = fluidcache.get(stack);
|
||||
|
||||
for (int i = stackStringifyHandlers.size() - 1; i >= 0 && fluid == null; i--) {
|
||||
fluid = stackStringifyHandlers.get(i).getFluid(stack);
|
||||
if (fluid == null && !fluidcache.containsKey(stack)) {
|
||||
|
||||
for (int i = stackStringifyHandlers.size() - 1; i >= 0 && fluid == null; i--) {
|
||||
fluid = stackStringifyHandlers.get(i).getFluid(stack);
|
||||
}
|
||||
|
||||
fluidcache.put(stack, fluid);
|
||||
}
|
||||
|
||||
return fluid;
|
||||
}
|
||||
|
||||
public static boolean isFluidContainer(ItemStack stack) {
|
||||
return stack.getItem() instanceof IFluidContainerItem || FluidContainerRegistry.isContainer(stack);
|
||||
}
|
||||
|
||||
public static String getItemStackGUID(ItemStack stack) {
|
||||
if (!guidcache.containsKey(stack)) {
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -29,8 +30,12 @@ import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.ItemList.AllMultiItemFilter;
|
||||
import codechicken.nei.LayoutManager;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
@@ -39,12 +44,12 @@ import codechicken.nei.api.DefaultOverlayRenderer;
|
||||
import codechicken.nei.api.IOverlayHandler;
|
||||
import codechicken.nei.api.IRecipeOverlayRenderer;
|
||||
import codechicken.nei.api.IStackPositioner;
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.guihook.IContainerInputHandler;
|
||||
import codechicken.nei.guihook.IContainerTooltipHandler;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
/**
|
||||
* A Template Recipe Handler! How about that. Because it was sooo hard, and more seriously required lots of copied code
|
||||
* to make a handler in the past. you can now extend this class to make your custom recipe handlers much easier to
|
||||
@@ -173,7 +178,7 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
|
||||
/**
|
||||
* This will perform default cycling of ingredients, mulitItem capable
|
||||
*
|
||||
*
|
||||
* @param cycle Current cycle step
|
||||
* @param ingredients List of ItemStacks to cycle
|
||||
* @return The provided list of ingredients, with their permutations cycled to a different permutation, if one
|
||||
@@ -181,36 +186,59 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
*/
|
||||
public List<PositionedStack> getCycledIngredients(int cycle, List<PositionedStack> ingredients) {
|
||||
|
||||
if (!NEIClientUtils.shiftKey()) {
|
||||
if (!NEIClientUtils.shiftKey() && !disableCycledIngredients) {
|
||||
if (NEIClientConfig.useJEIStyledCycledIngredients()) {
|
||||
jeiStyledRenderPermutation(ingredients, cycle);
|
||||
} else {
|
||||
for (int itemIndex = 0; itemIndex < ingredients.size(); itemIndex++) {
|
||||
randomRenderPermutation(ingredients.get(itemIndex), cycle + itemIndex);
|
||||
}
|
||||
randomRenderPermutation(ingredients, cycle);
|
||||
}
|
||||
}
|
||||
|
||||
return ingredients;
|
||||
}
|
||||
|
||||
public void randomRenderPermutation(PositionedStack stack, long cycle) {
|
||||
Random rand = new Random(cycle + offset);
|
||||
stack.setPermutationToRender(Math.abs(rand.nextInt()) % stack.items.length);
|
||||
protected void randomRenderPermutation(List<PositionedStack> stacks, long cycle) {
|
||||
final ItemFilter filter = getItemFilter();
|
||||
final int randCycle = Math.abs(new Random(cycle + offset).nextInt());
|
||||
|
||||
for (PositionedStack stack : stacks) {
|
||||
if (stack.items.length <= 1) continue;
|
||||
ArrayList<Integer> filtered = getFilteredIngredientAlternatives(stack, filter);
|
||||
if (filtered.isEmpty()) {
|
||||
stack.setPermutationToRender((int) (randCycle % stack.items.length));
|
||||
} else {
|
||||
stack.setPermutationToRender(filtered.get((int) (randCycle % filtered.size())));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void jeiStyledRenderPermutation(List<PositionedStack> stacks, long cycle) {
|
||||
protected void jeiStyledRenderPermutation(List<PositionedStack> stacks, long cycle) {
|
||||
final ItemFilter filter = getItemFilter();
|
||||
|
||||
for (PositionedStack stack : stacks) {
|
||||
stack.setPermutationToRender((int) (cycle % stack.items.length));
|
||||
if (stack.items.length <= 1) continue;
|
||||
ArrayList<Integer> filtered = getFilteredIngredientAlternatives(stack, filter);
|
||||
if (filtered.isEmpty()) {
|
||||
stack.setPermutationToRender((int) (cycle % stack.items.length));
|
||||
} else {
|
||||
stack.setPermutationToRender(filtered.get((int) (cycle % filtered.size())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected void randomRenderPermutation(PositionedStack stack, long cycle) {
|
||||
Random rand = new Random(cycle + offset);
|
||||
stack.setPermutationToRender((int) (Math.abs(rand.nextInt()) % stack.items.length));
|
||||
}
|
||||
|
||||
public void setIngredientPermutation(Collection<PositionedStack> ingredients, ItemStack ingredient) {
|
||||
for (PositionedStack stack : ingredients) {
|
||||
for (int i = 0; i < stack.items.length; i++) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, stack.items[i])) {
|
||||
stack.item = stack.items[i];
|
||||
stack.item.setItemDamage(ingredient.getItemDamage());
|
||||
Items.feather.setDamage(stack.item, Items.feather.getDamage(ingredient));
|
||||
if (ingredient.hasTagCompound()) {
|
||||
stack.item.setTagCompound((NBTTagCompound) ingredient.getTagCompound().copy());
|
||||
}
|
||||
@@ -395,11 +423,32 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
*/
|
||||
public LinkedList<RecipeTransferRect> transferRects = new LinkedList<>();
|
||||
|
||||
public static boolean disableCycledIngredients = true;
|
||||
|
||||
public TemplateRecipeHandler() {
|
||||
loadTransferRects();
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
}
|
||||
|
||||
protected static ItemFilter getItemFilter() {
|
||||
return new AllMultiItemFilter(
|
||||
item -> !ItemInfo.hiddenItems.contains(item),
|
||||
LayoutManager.presetsPanel != null ? LayoutManager.presetsPanel.getFilter() : null,
|
||||
GuiRecipe.searchField != null ? GuiRecipe.searchField.getFilter() : null);
|
||||
}
|
||||
|
||||
protected static ArrayList<Integer> getFilteredIngredientAlternatives(PositionedStack stack, ItemFilter filter) {
|
||||
final ArrayList<Integer> filtered = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < stack.items.length; i++) {
|
||||
if (filter.matches(stack.items[i])) {
|
||||
filtered.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
return filtered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all RecipeTransferRects to the transferRects list during this call. Afterward they may be added to the input
|
||||
* handler for the corresponding guis from getRecipeTransferRectGuis
|
||||
@@ -540,7 +589,8 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
|
||||
public TemplateRecipeHandler newInstance() {
|
||||
try {
|
||||
// Use the non parallel version since we might already be using the forkJoinPool and might have no threads
|
||||
// Use the non parallel version since we might already be using the forkJoinPool
|
||||
// and might have no threads
|
||||
// available
|
||||
// This will ideally have been pre-cached elsewhere and will be a NOOP
|
||||
findFuelsOnce();
|
||||
@@ -679,8 +729,12 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(GuiRecipe<?> gui, int button, int recipe) {
|
||||
if (button == 0) return transferRect(gui, recipe, false);
|
||||
else if (button == 1) return transferRect(gui, recipe, true);
|
||||
|
||||
if (button == 0) {
|
||||
return transferRect(gui, recipe, false);
|
||||
} else if (button == 1) {
|
||||
return transferRect(gui, recipe, true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -689,29 +743,58 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
public boolean mouseScrolled(GuiRecipe<?> gui, int scroll, int recipe) {
|
||||
if (!NEIClientUtils.shiftKey()) return false;
|
||||
|
||||
final Point offset = gui.getRecipePosition(recipe);
|
||||
final Point pos = getMousePosition();
|
||||
final Point offset = gui.getRecipePosition(recipe);
|
||||
final Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y);
|
||||
final PositionedStack overStack = getIngredientMouseOver(relMouse.x, relMouse.y, recipe);
|
||||
|
||||
for (PositionedStack pStack : getIngredientStacks(recipe)) {
|
||||
if ((new Rectangle4i(pStack.relx, pStack.rely, 18, 18)).contains(relMouse.x, relMouse.y)) {
|
||||
int index = pStack.items.length + scroll;
|
||||
if (overStack != null && overStack.items.length > 1) {
|
||||
final ItemFilter filter = getItemFilter();
|
||||
|
||||
for (int i = 0; i < pStack.items.length; i++) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(pStack.items[i], pStack.item)) {
|
||||
index = index + i;
|
||||
break;
|
||||
}
|
||||
if (NEIClientConfig.useJEIStyledCycledIngredients()) {
|
||||
ItemStack stack = overStack.item;
|
||||
for (PositionedStack pStack : getIngredientStacks(recipe)) {
|
||||
shiftPermutationToRender(pStack, stack, scroll, filter);
|
||||
}
|
||||
|
||||
pStack.setPermutationToRender(index % pStack.items.length);
|
||||
return true;
|
||||
} else {
|
||||
shiftPermutationToRender(overStack, overStack.item, scroll, filter);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void shiftPermutationToRender(PositionedStack pStack, ItemStack stack, int scroll, ItemFilter filter) {
|
||||
|
||||
for (int index = 0; index < pStack.items.length; index++) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(pStack.items[index], stack)) {
|
||||
ArrayList<Integer> filtered = getFilteredIngredientAlternatives(pStack, filter);
|
||||
|
||||
if (filtered.isEmpty()) {
|
||||
pStack.setPermutationToRender((int) ((pStack.items.length + scroll + index) % pStack.items.length));
|
||||
} else {
|
||||
pStack.setPermutationToRender(
|
||||
filtered.get((int) ((filtered.size() + scroll + index) % filtered.size())));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private PositionedStack getIngredientMouseOver(int mousex, int mousey, int recipe) {
|
||||
|
||||
for (PositionedStack pStack : getIngredientStacks(recipe)) {
|
||||
if ((new Rectangle4i(pStack.relx, pStack.rely, 18, 18)).contains(mousex, mousey)) {
|
||||
return pStack;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean transferRect(GuiRecipe<?> gui, int recipe, boolean usage) {
|
||||
Point offset = gui.getRecipePosition(recipe);
|
||||
return transferRect(gui, transferRects, offset.x, offset.y, usage);
|
||||
|
||||
@@ -21,7 +21,7 @@ public class DefaultStackStringifyHandler implements IStackStringifyHandler {
|
||||
|
||||
final NBTTagCompound nbTag = new NBTTagCompound();
|
||||
nbTag.setString("strId", strId);
|
||||
nbTag.setInteger("Count", Math.max(saveStackSize ? stack.stackSize : 1, 1));
|
||||
nbTag.setInteger("Count", saveStackSize ? stack.stackSize : 1);
|
||||
nbTag.setShort("Damage", (short) stack.getItemDamage());
|
||||
|
||||
if (stack.hasTagCompound()) {
|
||||
@@ -35,7 +35,7 @@ public class DefaultStackStringifyHandler implements IStackStringifyHandler {
|
||||
final String strId = nbtTag.getString("strId");
|
||||
|
||||
nbtTag = (NBTTagCompound) nbtTag.copy();
|
||||
nbtTag.setInteger("id", GameData.getItemRegistry().getId(strId)); // getObject
|
||||
nbtTag.setShort("id", (short) GameData.getItemRegistry().getId(strId)); // getObject
|
||||
|
||||
final ItemStack stack = ItemStack.loadItemStackFromNBT(nbtTag);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package codechicken.nei.recipe.stackinfo;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
@@ -9,16 +10,18 @@ import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import codechicken.nei.api.IStackStringifyHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class GTFluidStackStringifyHandler implements IStackStringifyHandler {
|
||||
|
||||
public static Class GTDisplayFluid = null;
|
||||
public static Method getFluidDisplayStack = null;
|
||||
public static Method getFluidFromDisplayStack = null;
|
||||
protected static Class<?> GTDisplayFluid = null;
|
||||
protected static Method getFluidDisplayStack = null;
|
||||
protected static Method getFluidFromDisplayStack = null;
|
||||
public static boolean replaceAE2FCFluidDrop = false;
|
||||
|
||||
static {
|
||||
try {
|
||||
final Class gtUtility = Class.forName("gregtech.api.util.GT_Utility");
|
||||
final Class<?> gtUtility = Class.forName("gregtech.api.util.GT_Utility");
|
||||
|
||||
GTDisplayFluid = Class.forName("gregtech.common.items.GT_FluidDisplayItem");
|
||||
getFluidFromDisplayStack = gtUtility.getMethod("getFluidFromDisplayStack", ItemStack.class);
|
||||
@@ -31,13 +34,13 @@ public class GTFluidStackStringifyHandler implements IStackStringifyHandler {
|
||||
|
||||
public NBTTagCompound convertItemStackToNBT(ItemStack stack, boolean saveStackSize) {
|
||||
|
||||
if (GTDisplayFluid != null && GTDisplayFluid.isInstance(stack.getItem())) {
|
||||
if (replaceAE2FCFluidDrop || stack.getItem() != GameRegistry.findItem("ae2fc", "fluid_drop")) {
|
||||
final FluidStack fluidStack = getFluid(stack);
|
||||
|
||||
if (fluidStack != null) {
|
||||
final NBTTagCompound nbTag = new NBTTagCompound();
|
||||
nbTag.setString("gtFluidName", fluidStack.getFluid().getName());
|
||||
nbTag.setInteger("Count", saveStackSize ? fluidStack.amount : 1);
|
||||
nbTag.setInteger("Count", saveStackSize ? fluidStack.amount : 144);
|
||||
return nbTag;
|
||||
}
|
||||
}
|
||||
@@ -66,17 +69,33 @@ public class GTFluidStackStringifyHandler implements IStackStringifyHandler {
|
||||
}
|
||||
|
||||
public FluidStack getFluid(ItemStack stack) {
|
||||
final Item item = stack.getItem();
|
||||
|
||||
if (getFluidFromDisplayStack != null && GTDisplayFluid != null && GTDisplayFluid.isInstance(stack.getItem())) {
|
||||
try {
|
||||
try {
|
||||
if (getFluidFromDisplayStack != null && GTDisplayFluid != null && GTDisplayFluid.isInstance(item)) {
|
||||
final Object obj = getFluidFromDisplayStack.invoke(null, stack);
|
||||
|
||||
if (obj != null) {
|
||||
return (FluidStack) obj;
|
||||
}
|
||||
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
} else if (item == GameRegistry.findItem("ae2fc", "fluid_packet")) {
|
||||
NBTTagCompound nbtTag = stack.getTagCompound();
|
||||
|
||||
return FluidStack.loadFluidStackFromNBT((NBTTagCompound) nbtTag.getTag("FluidStack"));
|
||||
} else if (item == GameRegistry.findItem("ae2fc", "fluid_drop")) {
|
||||
NBTTagCompound nbtTag = stack.getTagCompound();
|
||||
Fluid fluid = FluidRegistry.getFluid(nbtTag.getString("Fluid").toLowerCase());
|
||||
|
||||
if (fluid != null) {
|
||||
FluidStack fluidStack = new FluidStack(fluid, stack.stackSize);
|
||||
if (nbtTag.hasKey("FluidTag")) {
|
||||
fluidStack.tag = nbtTag.getCompoundTag("FluidTag");
|
||||
}
|
||||
return fluidStack;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Each line in this file should either be a comment (line starts with '#'), or a fully-qualified class name (that
|
||||
# includes the package name) for a recipe handler. Wildcard patterns ('*') can be used to catch multiple classes with a
|
||||
# single entry.
|
||||
# If you delete this file, it will be regenerated with the default height hacked handlers list.
|
||||
buildcraft.compat.nei.*
|
||||
cofh.thermalexpansion.plugins.nei.handlers.*
|
||||
crazypants.enderio.nei.*
|
||||
forestry.factory.recipes.nei.*
|
||||
ic2.neiIntegration.core.recipehandler.*
|
||||
mariculture.plugins.nei.*
|
||||
redgear.brewcraft.plugins.nei.*
|
||||
tconstruct.plugins.nei.*
|
||||
WayofTime.alchemicalWizardry.client.nei.*
|
||||
exnihilo.compatibility.nei.*
|
||||
blusunrize.immersiveengineering.client.nei.*
|
||||
@@ -0,0 +1,6 @@
|
||||
# This version of NEI loads recipes in parallel. Some recipe handlers have not been designed with that in mind and might
|
||||
# crash. List these handlers in this file to force them to be loaded single threaded. Each line in this file should
|
||||
# either be a comment (line starts with '#'), or a fully-qualified class name (that includes the package name) for a
|
||||
# recipe handler.
|
||||
# If you delete this file, it will be regenerated with the default serial handlers list.
|
||||
WayofTime.alchemicalWizardry.client.nei.NEIAlchemyRecipeHandler
|
||||
@@ -547,8 +547,9 @@ nc.crafting.nei.FissionRecipeHandler,NuclearCraft:fissionReactorGraphiteIdle,,Nu
|
||||
nc.crafting.nei.FissionSteamRecipeHandler,NuclearCraft:fissionReactorSteamIdle,,NuclearCraft,TRUE,,,,,,
|
||||
nc.crafting.nei.FusionRecipeHandler,NuclearCraft:fusionReactor,,NuclearCraft,TRUE,,,,,,
|
||||
nc.crafting.nei.FusionSteamRecipeHandler,NuclearCraft:fusionReactorSteam,,NuclearCraft,TRUE,,,,,,
|
||||
ganymedes01.etfuturum.NEI_EtFuturum_Config$NEI_Recipes_Smoker,etfuturum:smoker,,etfuturum,TRUE,,,,,,not working well
|
||||
ganymedes01.etfuturum.NEI_EtFuturum_Config$NEI_Recipes_BlastFurnace,etfuturum:blast_furnace,,etfuturum,TRUE,,,,,,not working well
|
||||
nc.crafting.nei.ElectrolyserRecipeHandler,NuclearCraft:electrolyserIdle,,NuclearCraft,TRUE,,,,,,
|
||||
nc.crafting.nei.CrusherRecipeHandler,NuclearCraft:crusherIdle,,NuclearCraft,TRUE,,,,,,
|
||||
nc.crafting.nei.ElectricCrusherRecipeHandler,NuclearCraft:electricCrusherIdle,,NuclearCraft,TRUE,,,,,,
|
||||
connor135246.campfirebackport.client.compat.nei.NEICampfireRecipeHandler,campfirebackport:campfire,,campfirebackport,TRUE,,,,,,
|
||||
connor135246.campfirebackport.client.compat.nei.NEICampfireRecipeHandler,campfirebackport:soul_campfire,,campfirebackport,TRUE,,,,,,
|
||||
connor135246.campfirebackport.client.compat.nei.NEICampfireStateChangerHandler,campfirebackport:campfire,,campfirebackport,TRUE,,,,,,
|
||||
@@ -1343,6 +1344,12 @@ tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSewer,MineFactoryRel
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerGrinder,MineFactoryReloaded:machine.0:13,,MineFactoryReloaded,TRUE,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerBioReactor,MineFactoryReloaded:machine.1:10,,MineFactoryReloaded,TRUE,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSlaughterhouse,MineFactoryReloaded:machine.1:13,,MineFactoryReloaded,TRUE,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerLaserDrill,MineFactoryReloaded:machine.2:0,,MineFactoryReloaded,TRUE,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerLaserDrill,MineFactoryReloaded:machine.2:1,,MineFactoryReloaded,TRUE,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSludgeBoiler,MineFactoryReloaded:machine.0:9,,MineFactoryReloaded,TRUE,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerMeatPacker,MineFactoryReloaded:machine.1:14,,MineFactoryReloaded,TRUE,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerComposter,MineFactoryReloaded:machine.0:11,,MineFactoryReloaded,TRUE,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerLavaFabricator,MineFactoryReloaded:machine.1:5,,MineFactoryReloaded,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe,ActuallyAdditions:itemBooklet,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIHairyBallRecipe,ActuallyAdditions:itemHairyBall,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICrusherRecipe$Double,ActuallyAdditions:blockGrinderDouble,,ActuallyAdditions,TRUE,,,,,,
|
||||
@@ -1371,3 +1378,45 @@ de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe,ActuallyAdditions:bl
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICompostRecipe,ActuallyAdditions:blockCompost,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe,ActuallyAdditions:blockAtomicReconstructor,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEITreasureChestRecipe,ActuallyAdditions:blockTreasureChest,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
factorization.nei.RecipeSlagFurnace,factorization:FzBlock:11,,factorization,TRUE,,,,,,
|
||||
factorization.nei.RecipeCrystallizer,factorization:FzBlock:19,,factorization,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.WorktableRecipeHandler,RotaryCraft:rotarycraft_item_machine:75,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.ToolChargingHandler,RotaryCraft:rotarycraft_item_machine:75,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.ToolCraftingHandler,RotaryCraft:rotarycraft_item_machine:75,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.BlastFurnaceHandler,RotaryCraft:rotarycraft_item_machine:45,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.GrinderHandler,RotaryCraft:rotarycraft_item_machine:11,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.ExtractorHandler,RotaryCraft:rotarycraft_item_machine:20,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FermenterHandler,RotaryCraft:rotarycraft_item_machine:7,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.CompactorHandler,RotaryCraft:rotarycraft_item_machine:22,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.PulseJetHandler,RotaryCraft:rotarycraft_item_machine:21,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FractionHandler,RotaryCraft:rotarycraft_item_machine:25,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.CrystallizerHandler,RotaryCraft:rotarycraft_item_machine:110,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FridgeHandler,RotaryCraft:rotarycraft_item_machine:118,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FillingStationHandler,RotaryCraft:rotarycraft_item_machine:101,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FrictionHandler,RotaryCraft:rotarycraft_item_machine:67,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FrictionHandler,minecraft:furnace,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.ComposterHandler,RotaryCraft:rotarycraft_item_machine:121,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.LavaMakerHandler,RotaryCraft:rotarycraft_item_machine:91,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.CentrifugeHandler,RotaryCraft:rotarycraft_item_machine:125,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.DryingBedHandler,RotaryCraft:rotarycraft_item_machine:127,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.WetterHandler,RotaryCraft:rotarycraft_item_machine:128,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FuelEnhancerHandler,RotaryCraft:rotarycraft_item_machine:86,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.DropProcessorHandler,RotaryCraft:rotarycraft_item_machine:129,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.ReactorCraft.NEI.SynthesizerHandler,ReactorCraft:reactorcraft_item_placer:14,,ReactorCraft,TRUE,,,,,,
|
||||
Reika.ReactorCraft.NEI.UProcessorHandler,ReactorCraft:reactorcraft_item_placer:9,,ReactorCraft,TRUE,,,,,,
|
||||
Reika.ReactorCraft.NEI.CentrifugeHandler,ReactorCraft:reactorcraft_item_placer:8,,ReactorCraft,TRUE,,,,,,
|
||||
Reika.ReactorCraft.NEI.ElectrolyzerHandler,ReactorCraft:reactorcraft_item_placer:16,,ReactorCraft,TRUE,,,,,,
|
||||
Reika.ReactorCraft.NEI.ElectrolyzerHandler,RotaryCraft:rotarycraft_item_machine:103,,RotaryCraft,TRUE,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.CrystalBrewerHandler,ChromatiCraft:chromaticraft_item_placer:7,,ChromatiCraft,TRUE,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.CrystalFurnaceHandler,ChromatiCraft:chromaticraft_item_placer:15,,ChromatiCraft,TRUE,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.GlowFireHandler,ChromatiCraft:chromaticraft_item_placer:60,,ChromatiCraft,TRUE,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.EnchantDecompHandler,ChromatiCraft:chromaticraft_item_placer:69,,ChromatiCraft,TRUE,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.FabricatorHandler,ChromatiCraft:chromaticraft_item_placer:23,,ChromatiCraft,TRUE,,,,,,
|
||||
tonius.neiintegration.mods.bigreactors.RecipeHandlerCyaniteReprocessor,BigReactors:BRDevice:0,,BigReactors,TRUE,,,,,,
|
||||
ru.nanolive.draconicplus.common.fusioncrafting.nei.FusionCraftingNEI,draconicplus:fusionCraftingCore,,draconicplus,TRUE,,,,,,
|
||||
techguns.nei.TechgunsFabricatorNEIRecipeHandler,Techguns:machineMultiBlock:4,,Techguns,TRUE,,,,,,
|
||||
techguns.nei.TechgunsReactionChamberNEIRecipeHandler,Techguns:machineMultiBlock:1,,Techguns,TRUE,,,,,,
|
||||
techguns.nei.TechgunsChemLabNEIRecipeHandler,Techguns:basicMachine:4,,Techguns,TRUE,,,,,,
|
||||
techguns.nei.TechgunsAmmoPressNEIRecipeHandler,Techguns:basicMachine:0,,Techguns,TRUE,,,,,,
|
||||
techguns.nei.TechgunsMetalPressNEIRecipeHandler,Techguns:basicMachine:1,,Techguns,TRUE,,,,,,
|
||||
techguns.nei.TechgunsChargingStationNEIRecipeHandler,Techguns:basicMachine:9,,Techguns,TRUE,,,,,,
|
||||
|
@@ -170,12 +170,12 @@ ic2.neiIntegration.core.recipehandler.BlockCutterRecipeHandler,IndustrialCraft 2
|
||||
ic2.neiIntegration.core.recipehandler.CentrifugeRecipeHandler,IndustrialCraft 2,IC2:blockMachine2:3,,IC2,TRUE,,,65,,5,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.CompressorRecipeHandler,IndustrialCraft 2,IC2:blockMachine:5,,IC2,TRUE,,,65,,5,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.ExtractorRecipeHandler,IndustrialCraft 2,IC2:blockMachine:4,,IC2,TRUE,,,65,,5,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.FluidCannerRecipeHandler,IndustrialCraft 2,IC2:blockMachine:6,,IC2,TRUE,,,75,,4,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.FluidCannerRecipeHandler,IndustrialCraft 2,IC2:blockMachine:6,,IC2,TRUE,,,85,,4,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.LatheRecipeHandler,IndustrialCraft 2,IC2:blockMachine3:8,,IC2,TRUE,,,65,,5,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.MaceratorRecipeHandler,IndustrialCraft 2,IC2:blockMachine:3,,IC2,TRUE,,,65,,5,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerCutting,IndustrialCraft 2,IC2:blockMachine2:4,,IC2,TRUE,,,55,,6,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerExtruding,IndustrialCraft 2,IC2:blockMachine2:4,,IC2,TRUE,,,55,,6,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerRolling,IndustrialCraft 2,IC2:blockMachine2:4,,IC2,TRUE,,,55,,6,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerCutting,IndustrialCraft 2,IC2:blockMachine2:4,,IC2,TRUE,,,65,,6,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerExtruding,IndustrialCraft 2,IC2:blockMachine2:4,,IC2,TRUE,,,65,,6,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerRolling,IndustrialCraft 2,IC2:blockMachine2:4,,IC2,TRUE,,,65,,6,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.OreWashingRecipeHandler,IndustrialCraft 2,IC2:blockMachine2:5,,IC2,TRUE,,,,,,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.ScrapboxRecipeHandler,IndustrialCraft 2,IC2:itemScrapbox,,IC2,TRUE,,,50,,6,,,,,,
|
||||
ic2.neiIntegration.core.recipehandler.SolidCannerRecipeHandler,IndustrialCraft 2,IC2:blockMachine2:9,,IC2,TRUE,,,,,,,,,,,
|
||||
@@ -373,11 +373,11 @@ NEIArcFurnaceHandlerCarrot Ingot,Immersive Engineering,minecraft:carrot,,Immersi
|
||||
NEIArcFurnaceHandlerExtraction,Immersive Engineering,minecraft:glowstone_dust,,ImmersiveEngineering,TRUE,,,65,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIShaderBagHandler,Immersive Engineering,ImmersiveEngineering:shaderBag,,ImmersiveEngineering,TRUE,,,65,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIBlueprintHandler,Immersive Engineering,ImmersiveEngineering:woodenDevice:5,,ImmersiveEngineering,TRUE,,,65,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEICokeOvenHandler,Immersive Engineering,ImmersiveEngineering:stoneDecoration:1,,ImmersiveEngineering,TRUE,,,71,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIBlastFurnaceHandler,Immersive Engineering,ImmersiveEngineering:stoneDecoration:2,,ImmersiveEngineering,TRUE,,,71,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEISqueezerHandler,Immersive Engineering,ImmersiveEngineering:metalMultiblock:2,,ImmersiveEngineering,TRUE,,,71,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIFermenterHandler,Immersive Engineering,ImmersiveEngineering:metalMultiblock:3,,ImmersiveEngineering,TRUE,,,71,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIRefineryHandler,Immersive Engineering,ImmersiveEngineering:metalMultiblock:4,,ImmersiveEngineering,TRUE,,,65,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEICokeOvenHandler,Immersive Engineering,ImmersiveEngineering:stoneDecoration:1,,ImmersiveEngineering,TRUE,,,71,166,2,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIBlastFurnaceHandler,Immersive Engineering,ImmersiveEngineering:stoneDecoration:2,,ImmersiveEngineering,TRUE,,,71,166,2,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEISqueezerHandler,Immersive Engineering,ImmersiveEngineering:metalMultiblock:2,,ImmersiveEngineering,TRUE,,1,64,166,2,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIFermenterHandler,Immersive Engineering,ImmersiveEngineering:metalMultiblock:3,,ImmersiveEngineering,TRUE,,1,64,166,2,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIRefineryHandler,Immersive Engineering,ImmersiveEngineering:metalMultiblock:4,,ImmersiveEngineering,TRUE,,,65,166,2,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIBottlingMachineHandler,Immersive Engineering,minecraft:glass_bottle,,ImmersiveEngineering,TRUE,,,65,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEIMetalPressHandler,Immersive Engineering,ImmersiveEngineering:metalMultiblock:13,,ImmersiveEngineering,TRUE,,,65,166,5,,,,,,
|
||||
blusunrize.immersiveengineering.client.nei.NEICrusherHandler,Immersive Engineering,ImmersiveEngineering:metalMultiblock:5,,ImmersiveEngineering,TRUE,,,71,166,5,,,,,,
|
||||
@@ -410,13 +410,13 @@ cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerCharger,Thermal Expansio
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerCraftingMachine,Thermal Expansion,ThermalExpansion:Frame,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerCraftingSecure,Thermal Expansion,ThermalExpansion:material:16,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerCraftingUpgrade,Thermal Expansion,ThermalExpansion:Frame:3,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerCrucible,Thermal Expansion,ThermalExpansion:Machine:4,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerCrucible,Thermal Expansion,ThermalExpansion:Machine:4,,ThermalExpansion,TRUE,,,65,166,2,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerFurnace,Thermal Expansion,ThermalExpansion:Machine:0,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerInsolator,Thermal Expansion,ThermalExpansion:Machine:11,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerInsolator,Thermal Expansion,ThermalExpansion:Machine:11,,ThermalExpansion,TRUE,,,65,166,2,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerPulverizer,Thermal Expansion,ThermalExpansion:Machine:1,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerSawmill,Thermal Expansion,ThermalExpansion:Machine:2,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerSmelter,Thermal Expansion,ThermalExpansion:Machine:3,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerTransposer,Thermal Expansion,ThermalExpansion:Machine:5,,ThermalExpansion,TRUE,,,65,166,5,,,,,,
|
||||
cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerTransposer,Thermal Expansion,ThermalExpansion:Machine:5,,ThermalExpansion,TRUE,,,65,166,2,,,,,,
|
||||
mekanism.client.nei.ChemicalCrystallizerRecipeHandler,Mekanism,Mekanism:MachineBlock2:8,,Mekanism,TRUE,,,79,,4,,,,,,
|
||||
mekanism.client.nei.ChemicalDissolutionChamberRecipeHandler,Mekanism,Mekanism:MachineBlock2:6,,Mekanism,TRUE,,,79,,4,,,,,,
|
||||
mekanism.client.nei.ChemicalInfuserRecipeHandler,Mekanism,Mekanism:MachineBlock2:2,,Mekanism,TRUE,,,80,,4,,,,,,
|
||||
@@ -437,7 +437,7 @@ mekanism.client.nei.ShapelessMekanismRecipeHandler,Mekanism,minecraft:crafting_t
|
||||
mekanism.client.nei.SolarNeutronRecipeHandler,Mekanism,Mekanism:MachineBlock3:1,,Mekanism,TRUE,,,70,,5,,,,,,
|
||||
mekanism.client.nei.ThermalEvaporationRecipeHandler,Mekanism,Mekanism:BasicBlock:14,,Mekanism,TRUE,,,62,,5,,,,,,
|
||||
exnihilo.compatibility.nei.RecipeHandlerHammer,Ex Nihilo,exnihilo:hammer_iron,,exnihilo,TRUE,,,58,,5,,,,,,
|
||||
exnihilo.compatibility.nei.RecipeHandlerSieve,Ex Nihilo,exnihilo:sifting_table,,exnihilo,TRUE,,,130,,2,,,,,,
|
||||
exnihilo.compatibility.nei.RecipeHandlerSieve,Ex Nihilo,exnihilo:sifting_table,,exnihilo,TRUE,,,130,,1,,,,,,
|
||||
gregtech.Alloy,GregTech-Addon,gregtech_addon:machine:56,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
|
||||
gregtech.Assembler,GregTech-Addon,gregtech_addon:machine:60,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
|
||||
gregtech.Bender,GregTech-Addon,gregtech_addon:machine:59,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
|
||||
@@ -496,8 +496,9 @@ nc.crafting.nei.FissionRecipeHandler,NuclearCraft,NuclearCraft:fissionReactorGra
|
||||
nc.crafting.nei.FissionSteamRecipeHandler,NuclearCraft,NuclearCraft:fissionReactorSteamIdle,,NuclearCraft,TRUE,,,,,,,,,,,
|
||||
nc.crafting.nei.FusionRecipeHandler,NuclearCraft,NuclearCraft:fusionReactor,,NuclearCraft,TRUE,,,,,,,,,,,
|
||||
nc.crafting.nei.FusionSteamRecipeHandler,NuclearCraft,NuclearCraft:fusionReactorSteam,,NuclearCraft,TRUE,,,,,,,,,,,
|
||||
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,,,,,,
|
||||
nc.crafting.nei.ElectrolyserRecipeHandler,NuclearCraft,NuclearCraft:electrolyserIdle,,NuclearCraft,TRUE,,,65,,4,,,,,,
|
||||
nc.crafting.nei.CrusherRecipeHandler,NuclearCraft,NuclearCraft:crusherIdle,,NuclearCraft,TRUE,,,65,,4,,,,,,
|
||||
nc.crafting.nei.ElectricCrusherRecipeHandler,NuclearCraft,NuclearCraft:electricCrusherIdle,,NuclearCraft,TRUE,,,65,,4,,,,,,
|
||||
connor135246.campfirebackport.client.compat.nei.NEICampfireRecipeHandler,Campfire Backport,campfirebackport:campfire,,campfirebackport,TRUE,,,65,166,5,,,,,,
|
||||
connor135246.campfirebackport.client.compat.nei.NEICampfireStateChangerHandler,Campfire Backport,campfirebackport:campfire_base,,campfirebackport,TRUE,,,65,166,5,,,,,,
|
||||
net.blay09.mods.excompressum.compat.nei.RecipeHandlerHeavySieve,Ex Compressum,excompressum:heavySieve,,excompressum,TRUE,,,130,166,5,,,,,,
|
||||
@@ -507,10 +508,15 @@ net.blay09.mods.excompressum.compat.nei.RecipeHandlerCompressedHammer,Ex Compres
|
||||
com.InfinityRaider.AgriCraft.compatibility.NEI.NEICropMutationHandler,AgriCraft,AgriCraft:cropsItem,,AgriCraft,TRUE,,,85,166,5,,,,,,
|
||||
com.InfinityRaider.AgriCraft.compatibility.NEI.NEICropProductHandler,AgriCraft,minecraft:farmland,,AgriCraft,TRUE,,,85,166,5,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerHarvester,MineFactory Reloaded,MineFactoryReloaded:machine.0:2,,MineFactoryReloaded,TRUE,,,,,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSewer,MineFactory Reloaded,MineFactoryReloaded:machine.0:10,,MineFactoryReloaded,TRUE,,,,,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSewer,MineFactory Reloaded,MineFactoryReloaded:machine.0:10,,MineFactoryReloaded,TRUE,,,,,5,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerGrinder,MineFactory Reloaded,MineFactoryReloaded:machine.0:13,,MineFactoryReloaded,TRUE,,,,,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerBioReactor,MineFactory Reloaded,MineFactoryReloaded:machine.1:10,,MineFactoryReloaded,TRUE,,,,,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerBioReactor,MineFactory Reloaded,MineFactoryReloaded:machine.1:10,,MineFactoryReloaded,TRUE,,,,,5,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSlaughterhouse,MineFactory Reloaded,MineFactoryReloaded:machine.1:13,,MineFactoryReloaded,TRUE,,,,,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerLaserDrill,MineFactory Reloaded,MineFactoryReloaded:machine.2:0,,MineFactoryReloaded,TRUE,,,,,5,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSludgeBoiler,MineFactory Reloaded,MineFactoryReloaded:machine.0:9,,MineFactoryReloaded,TRUE,,,,,5,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerMeatPacker,MineFactory Reloaded,MineFactoryReloaded:machine.1:14,,MineFactoryReloaded,TRUE,,,,,5,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerComposter,MineFactory Reloaded,MineFactoryReloaded:machine.0:11,,MineFactoryReloaded,TRUE,,,,,,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerLavaFabricator,MineFactory Reloaded,MineFactoryReloaded:machine.1:5,,MineFactoryReloaded,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe,Actually Additions,ActuallyAdditions:itemBooklet,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIHairyBallRecipe,Actually Additions,ActuallyAdditions:itemHairyBall,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICrusherRecipe$Double,Actually Additions,ActuallyAdditions:blockGrinderDouble,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
@@ -531,3 +537,45 @@ vazkii.botania.client.integration.nei.RecipeHandlerLexicaBotania,Botania,Botania
|
||||
neiplugins.forge.OreDictionaryList,NEIPlugins,minecraft:book,,NEIPlugins,TRUE,,,,,,,,,,,
|
||||
neiplugins.forge.FluidRegistryList,NEIPlugins,minecraft:bucket,,NEIPlugins,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEITreasureChestRecipe,Actually Additions,ActuallyAdditions:blockTreasureChest,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
factorization.nei.RecipeGrinder,Factorization,factorization:diamond_cutting_head,,factorization,TRUE,,,,,3,,,,,,
|
||||
factorization.nei.RecipeSlagFurnace,Factorization,factorization:FzBlock:11,,factorization,TRUE,,,,,3,,,,,,
|
||||
factorization.nei.RecipeCrystallizer,Factorization,factorization:FzBlock:19,,factorization,TRUE,,,100,,2,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.WorktableRecipeHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:75,,RotaryCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.ToolChargingHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:75,,RotaryCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.ToolCraftingHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:75,,RotaryCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.BlastFurnaceHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:45,,RotaryCraft,TRUE,,,115,,3,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.GrinderHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:11,,RotaryCraft,TRUE,,,70,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.ExtractorHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:20,,RotaryCraft,TRUE,,,115,,3,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FermenterHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:7,,RotaryCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.CompactorHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:22,,RotaryCraft,TRUE,,,115,,3,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.PulseJetHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:21,,RotaryCraft,TRUE,,,75,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FractionHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:25,,RotaryCraft,TRUE,,,,,,,,,,,Single Recipe
|
||||
Reika.RotaryCraft.ModInterface.NEI.CrystallizerHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:110,,RotaryCraft,TRUE,,,75,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FridgeHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:118,,RotaryCraft,TRUE,,,,,,,,,,,Single Recipe
|
||||
Reika.RotaryCraft.ModInterface.NEI.FillingStationHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:101,,RotaryCraft,TRUE,,,75,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FrictionHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:67,,RotaryCraft,TRUE,,,110,,3,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.ComposterHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:121,,RotaryCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.LavaMakerHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:91,,RotaryCraft,TRUE,,,75,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.CentrifugeHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:125,,RotaryCraft,TRUE,,,80,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.DryingBedHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:127,,RotaryCraft,TRUE,,,75,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.WetterHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:128,,RotaryCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.FuelEnhancerHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:86,,RotaryCraft,TRUE,,,,,,,,,,,
|
||||
Reika.RotaryCraft.ModInterface.NEI.DropProcessorHandler,RotaryCraft,RotaryCraft:rotarycraft_item_machine:129,,RotaryCraft,TRUE,,,,,,,,,,,Searching for the Usage of a Drop Processor results in a glitchy and useless first page
|
||||
Reika.ReactorCraft.NEI.SynthesizerHandler,ReactorCraft,ReactorCraft:reactorcraft_item_placer:14,,ReactorCraft,TRUE,,,75,,2,,,,,,
|
||||
Reika.ReactorCraft.NEI.UProcessorHandler,ReactorCraft,ReactorCraft:reactorcraft_item_placer:9,,ReactorCraft,TRUE,,,,,,,,,,,Single Recipe
|
||||
Reika.ReactorCraft.NEI.CentrifugeHandler,ReactorCraft,ReactorCraft:reactorcraft_item_placer:8,,ReactorCraft,TRUE,,,,,,,,,,,Single Recipe
|
||||
Reika.ReactorCraft.NEI.ElectrolyzerHandler,ReactorCraft,ReactorCraft:reactorcraft_item_placer:16,,ReactorCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.CrystalBrewerHandler,ChromatiCraft,ChromatiCraft:chromaticraft_item_placer:7,,ChromatiCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.CrystalFurnaceHandler,ChromatiCraft,ChromatiCraft:chromaticraft_item_placer:15,,ChromatiCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.GlowFireHandler,ChromatiCraft,ChromatiCraft:chromaticraft_item_placer:60,,ChromatiCraft,TRUE,,,,,,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.EnchantDecompHandler,ChromatiCraft,ChromatiCraft:chromaticraft_item_placer:69,,ChromatiCraft,TRUE,,,,,5,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.FabricatorHandler,ChromatiCraft,ChromatiCraft:chromaticraft_item_placer:23,,ChromatiCraft,TRUE,,,,,,,,,,,
|
||||
Reika.ChromatiCraft.ModInterface.NEI.PlantDustHandler,ChromatiCraft,ChromatiCraft:chromaticraft_block_decoflower:0,,ChromatiCraft,TRUE,,,,,3,,,,,,Anything other than 3 high tiling looks wrong
|
||||
tonius.neiintegration.mods.bigreactors.RecipeHandlerCyaniteReprocessor,Big Reactors,BigReactors:BRDevice:0,,BigReactors,TRUE,,,,,,,,,,,
|
||||
ru.nanolive.draconicplus.common.fusioncrafting.nei.FusionCraftingNEI,Draconic Plus,draconicplus:fusionCraftingCore,,draconicplus,TRUE,,,115,,2,,,,,,
|
||||
techguns.nei.TechgunsFabricatorNEIRecipeHandler,Techguns,Techguns:machineMultiBlock:4,,Techguns,TRUE,,,70,,3,,,,,,
|
||||
techguns.nei.TechgunsReactionChamberNEIRecipeHandler,Techguns,Techguns:machineMultiBlock:1,,Techguns,TRUE,,,70,,3,,,,,,
|
||||
techguns.nei.TechgunsChemLabNEIRecipeHandler,Techguns,Techguns:basicMachine:4,,Techguns,TRUE,,,70,,3,,,,,,
|
||||
techguns.nei.TechgunsAmmoPressNEIRecipeHandler,Techguns,Techguns:basicMachine:0,,Techguns,TRUE,,,75,,3,,,,,,
|
||||
techguns.nei.TechgunsMetalPressNEIRecipeHandler,Techguns,Techguns:basicMachine:1,,Techguns,TRUE,,,75,,3,,,,,,
|
||||
techguns.nei.TechgunsChargingStationNEIRecipeHandler,Techguns,Techguns:basicMachine:9,,Techguns,TRUE,,,65,,3,,,,,,
|
||||
|
@@ -44,6 +44,10 @@ nei.chat.rain.on=Déšť zapnut
|
||||
nei.chat.rain.off=Déšť vypnut
|
||||
nei.chat.time=Den %d. %d:00
|
||||
nei.chat.give.noitem=Nemáš žádný takový předmět.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI volby
|
||||
nei.options.back=Zpět
|
||||
|
||||
@@ -48,6 +48,10 @@ nei.chat.rain.on=Regen angeschaltet
|
||||
nei.chat.rain.off=Regen ausgeschaltet
|
||||
nei.chat.time=Tag %d. %d:00
|
||||
nei.chat.give.noitem=Solch ein Item gibt es nicht.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI-Optionen
|
||||
nei.options.back=Zurück
|
||||
|
||||
@@ -9,6 +9,7 @@ nei.key.ctrl.mac=CMD
|
||||
nei.bookmark.toggle=Bookmarks
|
||||
nei.bookmark.toggle.tip=Toggle visibility of the Bookmark Panel
|
||||
nei.bookmark.viewmode.toggle.tip=Toggle Bookmark View Mode
|
||||
nei.bookmark.pullBookmarkedItems.tip=Pull all bookmarked items from storage to inventory
|
||||
|
||||
nei.itempanel.quantity.default=One stack
|
||||
nei.itempanel.loading=Loading Item List...
|
||||
@@ -44,12 +45,16 @@ nei.inventory.magnet.enable=Enable magnet mode
|
||||
nei.inventory.magnet.1=Turn magnet mode on
|
||||
nei.inventory.magnet.0=Turn magnet mode off
|
||||
nei.inventory.dawn.enable=Enable dawn-noon
|
||||
nei.inventory.dawn.disable=Right-click: Disable dawn-noon phase
|
||||
nei.inventory.dawn.set=Set time to dawn
|
||||
nei.inventory.noon.enable=Enable noon-dusk
|
||||
nei.inventory.noon.disable=Right-click: Disable noon-dusk phase
|
||||
nei.inventory.noon.set=Set time to noon
|
||||
nei.inventory.dusk.enable=Enable dusk-midnight
|
||||
nei.inventory.dusk.disable=Right-click: Disable dusk-midnight phase
|
||||
nei.inventory.dusk.set=Set time to dusk
|
||||
nei.inventory.midnight.enable=Enable midnight-dawn
|
||||
nei.inventory.midnight.disable=Right-click: Disable midnight-dawn phase
|
||||
nei.inventory.midnight.set=Set time to midnight
|
||||
nei.inventory.heal=Heal the player
|
||||
nei.inventory.current.gamemode.0=Current gamemode: survival
|
||||
@@ -73,6 +78,10 @@ nei.chat.time=Day %d. %d:00
|
||||
nei.chat.give.noitem=No such item.
|
||||
nei.chat.recipe.error=There was error during loading recipe. Please check log for details.
|
||||
nei.chat.render.error=There was error during rendering item. Please check log for details.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI Options
|
||||
nei.options.back=Back
|
||||
@@ -102,6 +111,8 @@ nei.options.keys.gui.search=Focus Search Bar
|
||||
nei.options.keys.gui.bookmark=Add Bookmark
|
||||
nei.options.keys.gui.bookmark_recipe=Add Bookmark with Recipe
|
||||
nei.options.keys.gui.bookmark_count=Add Bookmark with Count
|
||||
nei.options.keys.gui.bookmark_pull_items=Pull all Bookmarked Items
|
||||
nei.options.keys.gui.bookmark_pull_items_ingredients=Pull all Bookmarked Ingredients
|
||||
nei.options.keys.gui.bookmark_recipe_count=Add Bookmark with Recipe & Count
|
||||
nei.options.keys.gui.hide_bookmarks=Toggle Bookmark Panel Visibility
|
||||
nei.options.keys.gui.overlay=Overlay Recipe
|
||||
@@ -110,6 +121,8 @@ nei.options.keys.gui.overlay_use=Use Overlay Recipe
|
||||
nei.options.keys.gui.getprevioussearch=Previous Search
|
||||
nei.options.keys.gui.getnextsearch=Next Search
|
||||
nei.options.keys.gui.next_tooltip=Next Tooltip
|
||||
nei.options.keys.gui.copy_name=Copy Item Name
|
||||
nei.options.keys.gui.copy_oredict=Copy Item OreDictionary
|
||||
nei.options.keys.world=World
|
||||
nei.options.keys.world.chunkoverlay=Chunk Boundary Overlay
|
||||
nei.options.keys.world.moboverlay=Mob Spawn Overlay
|
||||
@@ -136,18 +149,24 @@ nei.options.inventory.bookmarksEnabled.false=Hidden
|
||||
nei.options.inventory.jei_style_tabs=JEI Style Tabs
|
||||
nei.options.inventory.jei_style_tabs.true=Yes
|
||||
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.itemPresenceOverlay=Item Overlay on ?-Hover
|
||||
nei.options.inventory.itemPresenceOverlay.0=None
|
||||
nei.options.inventory.itemPresenceOverlay.1=Icon
|
||||
nei.options.inventory.itemPresenceOverlay.2=Background
|
||||
nei.options.inventory.slotHighlightPresent=Highlight Present Item
|
||||
nei.options.inventory.slotHighlightPresent.true=Yes
|
||||
nei.options.inventory.slotHighlightPresent.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
|
||||
nei.options.inventory.useNBTInBookmarks=Use NBT in Bookmarks
|
||||
nei.options.inventory.useNBTInBookmarks.true=Yes
|
||||
nei.options.inventory.useNBTInBookmarks.false=No
|
||||
nei.options.inventory.recipeTooltipsMode=Show recipe tooltips in Bookmarks
|
||||
nei.options.inventory.recipeTooltipsMode.0=None
|
||||
nei.options.inventory.recipeTooltipsMode.1=In Horizontal View
|
||||
nei.options.inventory.recipeTooltipsMode.2=In Vertical View
|
||||
nei.options.inventory.recipeTooltipsMode.3=Always
|
||||
nei.options.inventory.bookmarksAnimationEnabled=REI Style Animation in Bookmarks
|
||||
nei.options.inventory.bookmarksAnimationEnabled.true=Yes
|
||||
nei.options.inventory.bookmarksAnimationEnabled.false=No
|
||||
@@ -157,6 +176,9 @@ nei.options.inventory.showRecipeMarker.false=No
|
||||
nei.options.inventory.showItemQuantityWidget=Show Item Quantity Widget
|
||||
nei.options.inventory.showItemQuantityWidget.true=Yes
|
||||
nei.options.inventory.showItemQuantityWidget.false=No
|
||||
nei.options.inventory.centerSearchWidget=Center Search Widget
|
||||
nei.options.inventory.centerSearchWidget.true=Yes
|
||||
nei.options.inventory.centerSearchWidget.false=No
|
||||
nei.options.inventory.creative_tab_style=Creative or JEI tab style
|
||||
nei.options.inventory.creative_tab_style.true=Creative
|
||||
nei.options.inventory.creative_tab_style.false=JEI
|
||||
@@ -214,6 +236,15 @@ nei.options.inventory.invertMouseScrollTransfer.false=False
|
||||
nei.options.inventory.cacheItemRendering=Cache Item Rendering
|
||||
nei.options.inventory.cacheItemRendering.true=True
|
||||
nei.options.inventory.cacheItemRendering.false=False
|
||||
nei.options.inventory.history=History Panel
|
||||
nei.options.inventory.history.enabled=History Panel Visibility
|
||||
nei.options.inventory.history.enabled.true=Enabled
|
||||
nei.options.inventory.history.enabled.false=Disabled
|
||||
nei.options.inventory.history.historyColor=Color
|
||||
nei.options.inventory.history.useRows=Rows
|
||||
nei.options.inventory.history.splittingMode=Splitting Mode
|
||||
nei.options.inventory.history.splittingMode.0=Background
|
||||
nei.options.inventory.history.splittingMode.1=Dotted Line
|
||||
|
||||
nei.options.command=Commands
|
||||
nei.options.command.creative=Gamemode
|
||||
@@ -332,7 +363,9 @@ nei.presets.blacklist.label=B
|
||||
nei.presets.blacklist.tooltip=Blacklist
|
||||
nei.presets.whitelist.label=W
|
||||
nei.presets.whitelist.tooltip=Whitelist
|
||||
nei.presets.blacklistPlus.label=B+
|
||||
nei.presets.blacklistPlus.tooltip=Blacklist Plus
|
||||
nei.presets.textfield.tooltip.1=Enter - save
|
||||
nei.presets.textfield.tooltip.2=Escape - cancel
|
||||
nei.presets.label.tooltip=Double click to edit
|
||||
nei.presets.label.selected=%s Presets
|
||||
nei.presets.label.selected=%s Presets
|
||||
@@ -47,6 +47,10 @@ nei.chat.rain.on=Vihm sisse lülitatud
|
||||
nei.chat.rain.off=Vihm välja lülitatud
|
||||
nei.chat.time=Päev %d. %d:00
|
||||
nei.chat.give.noitem=Pole sellist asja olemas.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI Valikud
|
||||
nei.options.back=Tagasi
|
||||
|
||||
@@ -45,6 +45,10 @@ nei.chat.rain.on=Pluie activée
|
||||
nei.chat.rain.off=Pluie désactivée
|
||||
nei.chat.time=Jour %d. %d:00
|
||||
nei.chat.give.noitem=Objet inexistant.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI Options
|
||||
nei.options.back=Retour
|
||||
|
||||
@@ -48,6 +48,10 @@ nei.chat.rain.on=Pioggia attivata
|
||||
nei.chat.rain.off=Pioggia disattivata
|
||||
nei.chat.time=Giorno %d. %d:00
|
||||
nei.chat.give.noitem=Nessun oggetto del genere.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=Opzioni NEI
|
||||
nei.options.back=Indietro
|
||||
|
||||
@@ -43,6 +43,10 @@ nei.chat.rain.on=비 on
|
||||
nei.chat.rain.off=비 off
|
||||
nei.chat.time=%d번째 날. %d시 정각
|
||||
nei.chat.give.noitem=아이템이 없습니다.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI 옵션
|
||||
nei.options.back=뒤로
|
||||
|
||||
@@ -44,6 +44,10 @@ nei.chat.rain.on=Deszcz włączony
|
||||
nei.chat.rain.off=Deszcz wyączony
|
||||
nei.chat.time=Dzień %d. %d:00
|
||||
nei.chat.give.noitem=Nie ma takego przedmiotu.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=Opcje NEI
|
||||
nei.options.back=Wstecz
|
||||
|
||||
@@ -44,6 +44,10 @@ nei.chat.rain.on=Chuva ligada
|
||||
nei.chat.rain.off=Chuva desligada
|
||||
nei.chat.time=Dia %d. %d:00
|
||||
nei.chat.give.noitem=Nenhum item com esse nome.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=Opções do NEI
|
||||
nei.options.back=Voltar
|
||||
|
||||
@@ -47,6 +47,10 @@ nei.chat.rain.on=Дождь включён
|
||||
nei.chat.rain.off=Дождь выключен
|
||||
nei.chat.time=День %d. %d:00
|
||||
nei.chat.give.noitem=Нет такого предмета.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=Опции NEI
|
||||
nei.options.back=Назад
|
||||
|
||||
@@ -44,6 +44,10 @@ nei.chat.rain.on=Dážď bol zapnutý
|
||||
nei.chat.rain.off=Dážď bol vypnutý
|
||||
nei.chat.time=Deň %d. %d:00
|
||||
nei.chat.give.noitem=Žiaden takýto item.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=Nastavenia NEI
|
||||
nei.options.back=Späť
|
||||
|
||||
@@ -44,6 +44,10 @@ nei.chat.rain.on=Yağmur açıldı
|
||||
nei.chat.rain.off=Yağmur kapatıldı
|
||||
nei.chat.time=Gün %d. %d:00
|
||||
nei.chat.give.noitem=İtem verilemez.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI Ayarları
|
||||
nei.options.back=Geri
|
||||
|
||||
@@ -72,6 +72,10 @@ nei.chat.time=白天 %d. %d:00
|
||||
nei.chat.give.noitem=没有此物品
|
||||
nei.chat.recipe.error=加载合成表过程中出现错误.请查看日志了解详情.
|
||||
nei.chat.render.error=渲染物品过程中出现错误.请查看日志了解详情.
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI选项
|
||||
nei.options.back=后退
|
||||
@@ -108,6 +112,8 @@ nei.options.keys.gui.overlay_hide=隐藏覆盖合成表
|
||||
nei.options.keys.gui.overlay_use=使用覆盖合成表
|
||||
nei.options.keys.gui.getprevioussearch=上一个搜索
|
||||
nei.options.keys.gui.getnextsearch=下一个搜索
|
||||
nei.options.keys.gui.copy_name=复制物品名称
|
||||
nei.options.keys.gui.copy_oredict=复制物品矿词词典
|
||||
nei.options.keys.world=世界
|
||||
nei.options.keys.world.chunkoverlay=区块(chunks)边界显示
|
||||
nei.options.keys.world.moboverlay=刷怪区域显示
|
||||
@@ -134,18 +140,12 @@ nei.options.inventory.bookmarksEnabled.false=隐藏
|
||||
nei.options.inventory.jei_style_tabs=JEI标签页
|
||||
nei.options.inventory.jei_style_tabs.true=是
|
||||
nei.options.inventory.jei_style_tabs.false=否 [不会吧]
|
||||
nei.options.inventory.jei_style_item_presence_overlay=JEI风格物品覆盖?-悬停
|
||||
nei.options.inventory.jei_style_item_presence_overlay.true=是
|
||||
nei.options.inventory.jei_style_item_presence_overlay.false=否
|
||||
nei.options.inventory.jei_style_recipe_catalyst=JEI风格可执行合成表机器显示[测试中]
|
||||
nei.options.inventory.jei_style_recipe_catalyst.true=是
|
||||
nei.options.inventory.jei_style_recipe_catalyst.false=否
|
||||
nei.options.inventory.saveCurrentRecipeInBookmarksEnabled=保存书签中的当前合成表
|
||||
nei.options.inventory.saveCurrentRecipeInBookmarksEnabled.true=启用
|
||||
nei.options.inventory.saveCurrentRecipeInBookmarksEnabled.false=禁用
|
||||
nei.options.inventory.useNBTInBookmarks=在书签中启用NBT
|
||||
nei.options.inventory.useNBTInBookmarks.true=是
|
||||
nei.options.inventory.useNBTInBookmarks.false=否
|
||||
nei.options.inventory.bookmarksAnimationEnabled=REI风格书签动画
|
||||
nei.options.inventory.bookmarksAnimationEnabled.true=是
|
||||
nei.options.inventory.bookmarksAnimationEnabled.false=否
|
||||
@@ -267,7 +267,7 @@ nei.recipe.furnace=烧制
|
||||
nei.recipe.fuel=燃料
|
||||
nei.recipe.fuel.smeltCount=可冶炼%s个物品
|
||||
# Deprecated
|
||||
nei.recipe.fuel.required=需要%s个
|
||||
nei.recipe.fuel.required=需要%s个
|
||||
# Deprecated
|
||||
nei.recipe.fuel.processed=可烧制%s个
|
||||
# Deprecated
|
||||
|
||||
@@ -43,6 +43,10 @@ nei.chat.rain.on=開啟雨雪
|
||||
nei.chat.rain.off=關閉雨雪
|
||||
nei.chat.time=白天 %d. %d:00
|
||||
nei.chat.give.noitem=沒有此物品
|
||||
nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
|
||||
nei.options=NEI 選項
|
||||
nei.options.back=後退
|
||||
|
||||
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user