mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-27 23:46:01 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18560992cd | ||
|
|
a767b0f922 | ||
|
|
61f8fbe1ce | ||
|
|
a8a49f2b6e | ||
|
|
bf7cc86247 | ||
|
|
d6650f6cc4 |
No files matched your search
+2
-1620
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev')
|
implementation('com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev')
|
||||||
|
|
||||||
shadowImplementation('au.com.bytecode:opencsv:2.4')
|
shadowImplementation('au.com.bytecode:opencsv:2.4')
|
||||||
}
|
}
|
||||||
+153
-24
@@ -1,63 +1,192 @@
|
|||||||
|
# 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 = Waila
|
modName = Waila
|
||||||
|
|
||||||
# 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 = Waila
|
modId = Waila
|
||||||
|
|
||||||
|
# Root package of the mod, used to find various classes in other properties,
|
||||||
|
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||||
modGroup = mcp.mobius.waila
|
modGroup = mcp.mobius.waila
|
||||||
|
|
||||||
# WHY is there no version field?
|
# Whether to use modGroup as the maven publishing group.
|
||||||
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
|
||||||
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
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
|
autoUpdateBuildScript = false
|
||||||
|
|
||||||
|
# Version of Minecraft to target
|
||||||
minecraftVersion = 1.7.10
|
minecraftVersion = 1.7.10
|
||||||
|
|
||||||
|
# Version of Minecraft Forge to target
|
||||||
forgeVersion = 10.13.4.1614
|
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
|
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
|
||||||
# restart Minecraft in development. Choose this dependent on your mod:
|
channel = stable
|
||||||
# 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 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
|
developmentEnvironmentUserName = Developer
|
||||||
|
|
||||||
# Define a source file of your project with:
|
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
# See https://github.com/bsideup/jabel for details on how this works.
|
||||||
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
enableModernJavaSyntax = true
|
||||||
# version in @Mod([...], version = VERSION, [...])
|
|
||||||
# Leave these properties empty to skip individual token replacements
|
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||||
replaceGradleTokenInFile = Waila.java
|
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||||
gradleTokenModId =
|
enableGenericInjection = true
|
||||||
gradleTokenModName =
|
|
||||||
|
# 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 = mcp.mobius.waila.Tags
|
||||||
|
|
||||||
|
# Name of the token containing the project's current version to generate/replace.
|
||||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod ID replacement token.
|
||||||
|
gradleTokenModId =
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod name replacement token.
|
||||||
|
gradleTokenModName =
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod Group replacement token.
|
||||||
gradleTokenGroupName =
|
gradleTokenGroupName =
|
||||||
|
|
||||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can
|
# [DEPRECATED]
|
||||||
|
# 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.
|
||||||
|
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.
|
# 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 = api
|
apiPackage = api
|
||||||
|
|
||||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
# 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 =
|
accessTransformersFile =
|
||||||
|
|
||||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||||
usesMixins = false
|
usesMixins = false
|
||||||
|
|
||||||
|
# Adds some debug arguments like verbose output and class export.
|
||||||
|
usesMixinDebug = false
|
||||||
|
|
||||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||||
mixinPlugin =
|
mixinPlugin =
|
||||||
|
|
||||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||||
mixinsPackage =
|
mixinsPackage =
|
||||||
|
|
||||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||||
# This parameter is for legacy compatibility only
|
# 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 =
|
coreModClass =
|
||||||
|
|
||||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
# 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!
|
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||||
containsMixinsAndOrCoreModOnly = false
|
containsMixinsAndOrCoreModOnly = false
|
||||||
|
|
||||||
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||||
# responsibility check the licence and request permission for distribution, if required.
|
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
|
usesShadowedDependencies = true
|
||||||
|
|
||||||
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories
|
# 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
|
||||||
|
|
||||||
|
# If disabled, won't rename the shadowed classes.
|
||||||
|
relocateShadowedDependencies = true
|
||||||
|
|
||||||
|
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
|
||||||
includeWellKnownRepositories = true
|
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
|
||||||
|
|
||||||
|
# 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 to Modrinth.
|
||||||
|
modrinthProjectId =
|
||||||
|
|
||||||
|
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||||
|
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||||
|
# 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 =
|
||||||
|
|
||||||
|
# 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 =
|
||||||
|
|
||||||
|
# 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 =
|
||||||
|
|
||||||
|
# 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
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -83,10 +83,8 @@ done
|
|||||||
# This is normally unused
|
# This is normally unused
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# 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
|
||||||
# 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"'
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -133,10 +131,13 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
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
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# 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 ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# 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" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
# double quotes to make sure that they get re-expanded; and
|
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# 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 -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
|||||||
Vendored
+10
-10
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|||||||
+5
-10
@@ -4,10 +4,10 @@ pluginManagement {
|
|||||||
maven {
|
maven {
|
||||||
// RetroFuturaGradle
|
// RetroFuturaGradle
|
||||||
name "GTNH Maven"
|
name "GTNH Maven"
|
||||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||||
allowInsecureProtocol = true
|
|
||||||
mavenContent {
|
mavenContent {
|
||||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
includeGroup("com.gtnewhorizons")
|
||||||
|
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
@@ -17,12 +17,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.19'
|
||||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blowdryerSetup {
|
|
||||||
repoSubfolder 'gtnhShared'
|
|
||||||
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
|
|
||||||
//devLocal '.' // Use this when testing config updates locally
|
|
||||||
}
|
|
||||||
@@ -39,15 +39,9 @@ import mcp.mobius.waila.utils.ModIdentification;
|
|||||||
@Mod(
|
@Mod(
|
||||||
modid = "Waila",
|
modid = "Waila",
|
||||||
name = "Waila",
|
name = "Waila",
|
||||||
version = "GRADLETOKEN_VERSION",
|
version = Tags.GRADLETOKEN_VERSION,
|
||||||
dependencies = "after:NotEnoughItems@[1.0.4.0,)",
|
dependencies = "after:NotEnoughItems@[1.0.4.0,)",
|
||||||
acceptableRemoteVersions = "*")
|
acceptableRemoteVersions = "*")
|
||||||
/*
|
|
||||||
* @NetworkMod(channels = {"Waila"},clientSideRequired=false, serverSideRequired=false, connectionHandler =
|
|
||||||
* WailaConnectionHandler.class, packetHandler = WailaPacketHandler.class, versionBounds="[1.5.0,)") //packetHandler =
|
|
||||||
* WailaPacketHandler.class)
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class Waila {
|
public class Waila {
|
||||||
|
|
||||||
// The instance of your mod that Forge uses.
|
// The instance of your mod that Forge uses.
|
||||||
@@ -75,7 +69,7 @@ public class Waila {
|
|||||||
eBus.setAccessible(true);
|
eBus.setAccessible(true);
|
||||||
EventBus FMLbus = (EventBus) eBus.get(FMLCommonHandler.instance().findContainerFor(this));
|
EventBus FMLbus = (EventBus) eBus.get(FMLCommonHandler.instance().findContainerFor(this));
|
||||||
FMLbus.register(this);
|
FMLbus.register(this);
|
||||||
} catch (Throwable t) {}
|
} catch (Throwable ignored) {}
|
||||||
|
|
||||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
||||||
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
|
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
|
||||||
@@ -90,29 +84,12 @@ public class Waila {
|
|||||||
public void postInit(FMLPostInitializationEvent event) {
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
proxy.registerHandlers();
|
proxy.registerHandlers();
|
||||||
ModIdentification.init();
|
ModIdentification.init();
|
||||||
|
|
||||||
/*
|
|
||||||
* if (ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_KEYBIND, true)){
|
|
||||||
* for (String key: ModIdentification.keyhandlerStrings.keySet()){ String orig = I18n.getString(key); if
|
|
||||||
* (orig.equals(key)) orig = LanguageRegistry.instance().getStringLocalization(key); if (orig.equals(key)) orig
|
|
||||||
* = LangUtil.translateG(key); if (orig.isEmpty()) orig = key; String modif; if (orig.startsWith("[") ||
|
|
||||||
* orig.contains(":")) modif = orig; else{ String id = ModIdentification.keyhandlerStrings.get(key); if
|
|
||||||
* (id.contains(".")) id = id.split("\\.")[0]; if (id.length() > 10) id = id.substring(0, 11); if (id.isEmpty())
|
|
||||||
* id = "????"; modif = String.format("[%s] %s", id, orig); }
|
|
||||||
* LanguageRegistry.instance().addStringLocalization(key, modif); } }
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void loadComplete(FMLLoadCompleteEvent event) {
|
public void loadComplete(FMLLoadCompleteEvent event) {
|
||||||
proxy.registerMods();
|
proxy.registerMods();
|
||||||
proxy.registerIMCs();
|
proxy.registerIMCs();
|
||||||
|
|
||||||
/*
|
|
||||||
* String[] ores = OreDictionary.getOreNames(); for (String s : ores) for (ItemStack stack :
|
|
||||||
* OreDictionary.getOres(s)) System.out.printf("%s : %s\n", s, stack);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class AgricultureModule {
|
public class AgricultureModule {
|
||||||
|
|
||||||
public static Class BlockCrop = null;
|
public static Class<?> BlockCrop = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class Agriculture = Class.forName("com.teammetallurgy.agriculture.Agriculture");
|
Class.forName("com.teammetallurgy.agriculture.Agriculture");
|
||||||
Waila.log.log(Level.INFO, "Agriculture mod found.");
|
Waila.log.log(Level.INFO, "Agriculture mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[Agriculture] Agriculture mod not found.");
|
Waila.log.log(Level.INFO, "[Agriculture] Agriculture mod not found.");
|
||||||
|
|||||||
@@ -11,14 +11,9 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class BCModule {
|
public class BCModule {
|
||||||
|
|
||||||
public static Class TileTank = null;
|
public static Class<?> TileTank = null;
|
||||||
public static Method TileTank_getTankInfo = null;
|
public static Method TileTank_getTankInfo = null;
|
||||||
|
|
||||||
// public static Class IPowerReceptor = null;
|
|
||||||
// public static Class PipeTransportPower = null;
|
|
||||||
// public static Class TileGenericPipe = null;
|
|
||||||
// public static Class TileEngine = null;
|
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
TileTank = Class.forName("buildcraft.factory.TileTank");
|
TileTank = Class.forName("buildcraft.factory.TileTank");
|
||||||
@@ -31,10 +26,8 @@ public class BCModule {
|
|||||||
|
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[BC] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[BC] Class not found. " + e);
|
||||||
return;
|
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
Waila.log.log(Level.WARN, "[BC] Method not found." + e);
|
Waila.log.log(Level.WARN, "[BC] Method not found." + e);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,7 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
|
|||||||
int liquidAmount = stack != null ? stack.amount : 0;
|
int liquidAmount = stack != null ? stack.amount : 0;
|
||||||
int capacity = tank != null ? tank.capacity : 0;
|
int capacity = tank != null ? tank.capacity : 0;
|
||||||
|
|
||||||
if (ConfigHandler.instance().getConfig("bc.tankamount"))
|
if (ConfigHandler.instance().getConfig("bc.tankamount")) currenttip.add(liquidAmount + "/" + capacity + " mB");
|
||||||
currenttip.add(String.valueOf(liquidAmount) + "/" + String.valueOf(capacity) + " mB");
|
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
@@ -63,14 +62,12 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FluidTankInfo getTank(IWailaDataAccessor accessor) {
|
public FluidTankInfo getTank(IWailaDataAccessor accessor) {
|
||||||
FluidTankInfo tank = null;
|
FluidTankInfo tank;
|
||||||
try {
|
try {
|
||||||
tank = ((FluidTankInfo[]) BCModule.TileTank_getTankInfo
|
tank = ((FluidTankInfo[]) BCModule.TileTank_getTankInfo
|
||||||
.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
|
.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Waila.log.log(
|
Waila.log.log(Level.ERROR, "[BC] Unhandled exception trying to access a tank for display !.\n" + e);
|
||||||
Level.ERROR,
|
|
||||||
"[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return tank;
|
return tank;
|
||||||
|
|||||||
@@ -2,26 +2,6 @@ package mcp.mobius.waila.addons.carpenters;
|
|||||||
|
|
||||||
public class CarpentersModule {
|
public class CarpentersModule {
|
||||||
|
|
||||||
public static Class TEBase = null;
|
public static void register() {}
|
||||||
public static Class BlockCarpentersDoor = null;
|
|
||||||
public static Class BlockCarpentersHatch = null;
|
|
||||||
|
|
||||||
public static void register() {
|
|
||||||
/*
|
|
||||||
* try{ Class CarpentersBlocks = Class.forName("carpentersblocks.CarpentersBlocks"); Waila.log.log(Level.INFO,
|
|
||||||
* "CarpentersBlocks mod found."); } catch (ClassNotFoundException e){ Waila.log.log(Level.INFO,
|
|
||||||
* "[CarpentersBlocks] CarpentersBlocks mod not found."); return; } try{ TEBase =
|
|
||||||
* Class.forName("carpentersblocks.tileentity.TEBase"); BlockCarpentersDoor =
|
|
||||||
* Class.forName("carpentersblocks.block.BlockCarpentersDoor"); BlockCarpentersHatch =
|
|
||||||
* Class.forName("carpentersblocks.block.BlockCarpentersHatch"); } catch (ClassNotFoundException e){
|
|
||||||
* Waila.log.log(Level.WARNING, "[CarpentersBlocks] Class not found. " + e); return; } catch (Exception e) {
|
|
||||||
* Waila.log.log(Level.WARNING, "[CarpentersBlocks] Error while loading module. " + e); return; }
|
|
||||||
* ModuleRegistrar.instance().addConfig("Carpenter's Blocks", "carpenters.hide");
|
|
||||||
* ModuleRegistrar.instance().registerStackProvider(new HUDCarpentersBlocksTE(), BlockCarpentersDoor);
|
|
||||||
* ModuleRegistrar.instance().registerStackProvider(new HUDCarpentersBlocksTE(), BlockCarpentersHatch);
|
|
||||||
* ModuleRegistrar.instance().registerSyncedNBTKey("data", TEBase);
|
|
||||||
* ModuleRegistrar.instance().registerSyncedNBTKey("cover_6", TEBase);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -16,15 +16,6 @@ public class HUDCarpentersBlocksTE implements IWailaDataProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
/*
|
|
||||||
* if (!config.getConfig("carpenters.hide")) return null; NBTTagCompound tag = accessor.getNBTData(); short data
|
|
||||||
* = tag.getShort("data"); short cover = tag.getShort("cover_6");
|
|
||||||
* if(CarpentersModule.BlockCarpentersDoor.isInstance(accessor.getBlock())){ int type = data & 0x7; if (type !=
|
|
||||||
* 5) return null; if (cover == 0) return null; return new ItemStack(cover & 0xfff, 0, (cover & 0xf000) >>> 12);
|
|
||||||
* } else if (CarpentersModule.BlockCarpentersHatch.isInstance(accessor.getBlock())){ int type = data & 0x7; if
|
|
||||||
* (type != 0) return null; if (cover == 0) return null; return new ItemStack(cover & 0xfff, 0, (cover & 0xf000)
|
|
||||||
* >>> 12); }
|
|
||||||
*/
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,18 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class EnderIOModule {
|
public class EnderIOModule {
|
||||||
|
|
||||||
public static Class TileCapacitorBank = null;
|
public static Class<?> TileCapacitorBank = null;
|
||||||
public static Method TCB_getMaxInput = null;
|
public static Method TCB_getMaxInput = null;
|
||||||
public static Method TCB_getMaxOutput = null;
|
public static Method TCB_getMaxOutput = null;
|
||||||
public static Method TCB_getEnergyStored = null;
|
public static Method TCB_getEnergyStored = null;
|
||||||
public static Method TCB_getMaxEnergyStored = null;
|
public static Method TCB_getMaxEnergyStored = null;
|
||||||
public static Method TCB_getMaxIO = null;
|
public static Method TCB_getMaxIO = null;
|
||||||
|
|
||||||
public static Class TileTesseract = null;
|
public static Class<?> TileTesseract = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class ModClass = Class.forName("crazypants.enderio.EnderIO");
|
Class.forName("crazypants.enderio.EnderIO");
|
||||||
Waila.log.log(Level.INFO, "EnderIO mod found.");
|
Waila.log.log(Level.INFO, "EnderIO mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[EnderIO] EnderIO mod not found.");
|
Waila.log.log(Level.INFO, "[EnderIO] EnderIO mod not found.");
|
||||||
@@ -44,9 +44,6 @@ public class EnderIOModule {
|
|||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Method not found." + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Method not found." + e);
|
||||||
return;
|
return;
|
||||||
// } catch (NoSuchFieldException e){
|
|
||||||
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
|
|
||||||
// return;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Unhandled exception." + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Unhandled exception." + e);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ public class HUDHandlerTesseract implements IWailaDataProvider {
|
|||||||
String channel = "%s : %s%s%s %s";
|
String channel = "%s : %s%s%s %s";
|
||||||
String freq;
|
String freq;
|
||||||
String frequser;
|
String frequser;
|
||||||
String owner;
|
|
||||||
|
|
||||||
if (config.getConfig("enderio.channel")) {
|
if (config.getConfig("enderio.channel")) {
|
||||||
|
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class EnderStorageModule {
|
public class EnderStorageModule {
|
||||||
|
|
||||||
public static Class TileFrequencyOwner = null;
|
public static Class<?> TileFrequencyOwner = null;
|
||||||
public static Field TileFrequencyOwner_Freq = null;
|
public static Field TileFrequencyOwner_Freq = null;
|
||||||
|
|
||||||
public static Class EnderStorageManager = null;
|
public static Class<?> EnderStorageManager = null;
|
||||||
public static Method GetColourFromFreq = null;
|
public static Method GetColourFromFreq = null;
|
||||||
|
|
||||||
public static Class TileEnderTank = null;
|
public static Class<?> TileEnderTank = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class EnderStorage = Class.forName("codechicken.enderstorage.EnderStorage");
|
Class.forName("codechicken.enderstorage.EnderStorage");
|
||||||
Waila.log.log(Level.INFO, "EnderStorage mod found.");
|
Waila.log.log(Level.INFO, "EnderStorage mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[EnderStorage] EnderStorage mod not found.");
|
Waila.log.log(Level.INFO, "[EnderStorage] EnderStorage mod not found.");
|
||||||
|
|||||||
@@ -9,18 +9,14 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class ETBModule {
|
public class ETBModule {
|
||||||
|
|
||||||
public static Class TileSocket = null;
|
public static Class<?> TileSocket = null;
|
||||||
public static Field Socket_sides = null;
|
public static Field Socket_sides = null;
|
||||||
public static Field Socket_configs = null;
|
public static Field Socket_configs = null;
|
||||||
// public static Field Socket_sideID = null;
|
|
||||||
// public static Field Socket_sideMeta = null;
|
|
||||||
// public static Field Socket_facID = null;
|
|
||||||
// public static Field Socket_facMeta = null;
|
|
||||||
|
|
||||||
public static Class SocketsMod = null;
|
public static Class<?> SocketsMod = null;
|
||||||
public static Field module = null;
|
public static Field module = null;
|
||||||
|
|
||||||
public static Class SideConfig = null;
|
public static Class<?> SideConfig = null;
|
||||||
public static Field SC_tank = null;
|
public static Field SC_tank = null;
|
||||||
public static Field SC_inventory = null;
|
public static Field SC_inventory = null;
|
||||||
public static Field SC_rsControl = null;
|
public static Field SC_rsControl = null;
|
||||||
@@ -28,7 +24,7 @@ public class ETBModule {
|
|||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class ModClass = Class.forName("emasher.sockets.TileSocket");
|
Class.forName("emasher.sockets.TileSocket");
|
||||||
Waila.log.log(Level.INFO, "Engineer Toolbox mod found.");
|
Waila.log.log(Level.INFO, "Engineer Toolbox mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[Engineer Toolbox] Engineer Toolbox mod not found.");
|
Waila.log.log(Level.INFO, "[Engineer Toolbox] Engineer Toolbox mod not found.");
|
||||||
@@ -40,18 +36,9 @@ public class ETBModule {
|
|||||||
TileSocket = Class.forName("emasher.sockets.TileSocket");
|
TileSocket = Class.forName("emasher.sockets.TileSocket");
|
||||||
Socket_sides = TileSocket.getField("sides");
|
Socket_sides = TileSocket.getField("sides");
|
||||||
Socket_configs = TileSocket.getField("configs");
|
Socket_configs = TileSocket.getField("configs");
|
||||||
// Socket_sideID = TileSocket.getField("sideID");
|
|
||||||
// Socket_sideMeta = TileSocket.getField("sideMeta");
|
|
||||||
// Socket_facID = TileSocket.getField("facID");
|
|
||||||
// Socket_facMeta = TileSocket.getField("facMeta");
|
|
||||||
|
|
||||||
SocketsMod = Class.forName("emasher.sockets.SocketsMod");
|
SocketsMod = Class.forName("emasher.sockets.SocketsMod");
|
||||||
module = SocketsMod.getField("module");
|
module = SocketsMod.getField("module");
|
||||||
// module = (Item)SocketsMod.getField("module").get(null);
|
|
||||||
/*
|
|
||||||
* if (module == null){ mod_Waila.log.log(Level.WARNING, "[Engineer Toolbox] module field is null !");
|
|
||||||
* return; }
|
|
||||||
*/
|
|
||||||
|
|
||||||
SideConfig = Class.forName("emasher.api.SideConfig");
|
SideConfig = Class.forName("emasher.api.SideConfig");
|
||||||
SC_tank = SideConfig.getField("tank");
|
SC_tank = SideConfig.getField("tank");
|
||||||
@@ -62,9 +49,6 @@ public class ETBModule {
|
|||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[Engineer Toolbox] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[Engineer Toolbox] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
// } catch (NoSuchMethodException e){
|
|
||||||
// Waila.log.log(Level.WARN, "[Engineer Toolbox] Method not found." + e);
|
|
||||||
// return;
|
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
Waila.log.log(Level.WARN, "[Engineer Toolbox] Field not found." + e);
|
Waila.log.log(Level.WARN, "[Engineer Toolbox] Field not found." + e);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ public class HUDHandlerSocket implements IWailaDataProvider {
|
|||||||
|
|
||||||
String configstr = "[ ";
|
String configstr = "[ ";
|
||||||
|
|
||||||
if (tank != -1) configstr += "\u00a79" + String.valueOf(tank) + " ";
|
if (tank != -1) configstr += "\u00a79" + tank + " ";
|
||||||
|
|
||||||
if (inventory != -1) configstr += "\u00a7a" + String.valueOf(inventory) + " ";
|
if (inventory != -1) configstr += "\u00a7a" + inventory + " ";
|
||||||
|
|
||||||
if (rsControl[0] || rsControl[1] || rsControl[2]) {
|
if (rsControl[0] || rsControl[1] || rsControl[2]) {
|
||||||
configstr += "\u00a7c";
|
configstr += "\u00a7c";
|
||||||
@@ -76,12 +76,6 @@ public class HUDHandlerSocket implements IWailaDataProvider {
|
|||||||
|
|
||||||
if (!configstr.equals("[ \u00a7r]")) tipstr += " " + configstr;
|
if (!configstr.equals("[ \u00a7r]")) tipstr += " " + configstr;
|
||||||
|
|
||||||
/*
|
|
||||||
* if ((tank != -1) && (inventory != -1)) tipstr += String.format("[ \u00a79%d \u00a7a%d \u00a7r]",
|
|
||||||
* tank, inventory); else if (tank != -1) tipstr += String.format("[ \u00a79%d \u00a7r]", tank);
|
|
||||||
* else if (inventory != -1) tipstr += String.format("[ \u00a7a%d \u00a7r]", inventory);
|
|
||||||
*/
|
|
||||||
|
|
||||||
currenttip.add(tipstr);
|
currenttip.add(tipstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,12 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class ExtraUtilitiesModule {
|
public class ExtraUtilitiesModule {
|
||||||
|
|
||||||
public static Class ModExtraUtilities = null;
|
public static Class<?> TileEntityDrum = null;
|
||||||
public static Class TileEntityDrum = null;
|
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Class ModExtraUtilities = Class.forName("com.rwtema.extrautils.ExtraUtils");
|
Class.forName("com.rwtema.extrautils.ExtraUtils");
|
||||||
Waila.log.log(Level.INFO, "ExtraUtilities mod found.");
|
Waila.log.log(Level.INFO, "ExtraUtilities mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[ExtraUtilities] ExtraUtilities mod not found.");
|
Waila.log.log(Level.INFO, "[ExtraUtilities] ExtraUtilities mod not found.");
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class GravestoneModule {
|
public class GravestoneModule {
|
||||||
|
|
||||||
public static Class BlockGraveStone = null;
|
public static Class<?> BlockGraveStone = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Class ModGravestone = Class.forName("GraveStone.ModGraveStone");
|
Class.forName("GraveStone.ModGraveStone");
|
||||||
Waila.log.log(Level.INFO, "GraveStone mod found.");
|
Waila.log.log(Level.INFO, "GraveStone mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[GraveStone] GraveStone mod not found.");
|
Waila.log.log(Level.INFO, "[GraveStone] GraveStone mod not found.");
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class HarvestcraftModule {
|
public class HarvestcraftModule {
|
||||||
|
|
||||||
public static Class TileEntityPamCrop = null;
|
public static Class<?> TileEntityPamCrop = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class PamHarvestCraft = Class.forName("assets.pamharvestcraft.PamHarvestCraft");
|
Class.forName("assets.pamharvestcraft.PamHarvestCraft");
|
||||||
Waila.log.log(Level.INFO, "PamHarvestCraft mod found.");
|
Waila.log.log(Level.INFO, "PamHarvestCraft mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[PamHarvestCraft] PamHarvestCraft mod not found.");
|
Waila.log.log(Level.INFO, "[PamHarvestCraft] PamHarvestCraft mod not found.");
|
||||||
|
|||||||
@@ -82,32 +82,32 @@ public class HUDHandlerTEGenerator implements IWailaDataProvider {
|
|||||||
|
|
||||||
if (IC2Module.TileBaseGenerator.isInstance(te)) {
|
if (IC2Module.TileBaseGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileBaseGenerator_storage.getDouble(te);
|
storage = IC2Module.TileBaseGenerator_storage.getDouble(te);
|
||||||
production = (long) IC2Module.TileBaseGenerator_production.getInt(te);
|
production = IC2Module.TileBaseGenerator_production.getInt(te);
|
||||||
maxStorage = (long) IC2Module.TileBaseGenerator_maxStorage.getShort(te);
|
maxStorage = IC2Module.TileBaseGenerator_maxStorage.getShort(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (IC2Module.TileGeoGenerator.isInstance(te)) {
|
else if (IC2Module.TileGeoGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileGeoGenerator_storage.getDouble(te);
|
storage = IC2Module.TileGeoGenerator_storage.getDouble(te);
|
||||||
production = (long) IC2Module.TileGeoGenerator_production.getInt(te);
|
production = IC2Module.TileGeoGenerator_production.getInt(te);
|
||||||
maxStorage = (long) IC2Module.TileGeoGenerator_maxStorage.getShort(te);
|
maxStorage = IC2Module.TileGeoGenerator_maxStorage.getShort(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (IC2Module.TileKineticGenerator.isInstance(te)) {
|
else if (IC2Module.TileKineticGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileKineticGenerator_storage.getDouble(te);
|
storage = IC2Module.TileKineticGenerator_storage.getDouble(te);
|
||||||
production = MathHelper.floor_double_long(IC2Module.TileKineticGenerator_production.getDouble(te));
|
production = MathHelper.floor_double_long(IC2Module.TileKineticGenerator_production.getDouble(te));
|
||||||
maxStorage = (long) IC2Module.TileKineticGenerator_maxStorage.getInt(te);
|
maxStorage = IC2Module.TileKineticGenerator_maxStorage.getInt(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (IC2Module.TileSemifluidGenerator.isInstance(te)) {
|
else if (IC2Module.TileSemifluidGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileSemifluidGenerator_storage.getDouble(te);
|
storage = IC2Module.TileSemifluidGenerator_storage.getDouble(te);
|
||||||
production = MathHelper.floor_double_long(IC2Module.TileSemifluidGenerator_production.getDouble(te));
|
production = MathHelper.floor_double_long(IC2Module.TileSemifluidGenerator_production.getDouble(te));
|
||||||
maxStorage = (long) IC2Module.TileSemifluidGenerator_maxStorage.getShort(te);
|
maxStorage = IC2Module.TileSemifluidGenerator_maxStorage.getShort(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (IC2Module.TileStirlingGenerator.isInstance(te)) {
|
else if (IC2Module.TileStirlingGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileStirlingGenerator_storage.getDouble(te);
|
storage = IC2Module.TileStirlingGenerator_storage.getDouble(te);
|
||||||
production = MathHelper.floor_double_long(IC2Module.TileStirlingGenerator_production.getDouble(te));
|
production = MathHelper.floor_double_long(IC2Module.TileStirlingGenerator_production.getDouble(te));
|
||||||
maxStorage = (long) IC2Module.TileStirlingGenerator_maxStorage.getShort(te);
|
maxStorage = IC2Module.TileStirlingGenerator_maxStorage.getShort(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
tag.setDouble("storage", storage);
|
tag.setDouble("storage", storage);
|
||||||
|
|||||||
@@ -9,27 +9,27 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class IC2Module {
|
public class IC2Module {
|
||||||
|
|
||||||
public static Class TileBaseGenerator = null;
|
public static Class<?> TileBaseGenerator = null;
|
||||||
public static Field TileBaseGenerator_storage = null;
|
public static Field TileBaseGenerator_storage = null;
|
||||||
public static Field TileBaseGenerator_maxStorage = null;
|
public static Field TileBaseGenerator_maxStorage = null;
|
||||||
public static Field TileBaseGenerator_production = null;
|
public static Field TileBaseGenerator_production = null;
|
||||||
|
|
||||||
public static Class TileGeoGenerator = null;
|
public static Class<?> TileGeoGenerator = null;
|
||||||
public static Field TileGeoGenerator_storage = null;
|
public static Field TileGeoGenerator_storage = null;
|
||||||
public static Field TileGeoGenerator_maxStorage = null;
|
public static Field TileGeoGenerator_maxStorage = null;
|
||||||
public static Field TileGeoGenerator_production = null;
|
public static Field TileGeoGenerator_production = null;
|
||||||
|
|
||||||
public static Class TileKineticGenerator = null;
|
public static Class<?> TileKineticGenerator = null;
|
||||||
public static Field TileKineticGenerator_storage = null;
|
public static Field TileKineticGenerator_storage = null;
|
||||||
public static Field TileKineticGenerator_maxStorage = null;
|
public static Field TileKineticGenerator_maxStorage = null;
|
||||||
public static Field TileKineticGenerator_production = null;
|
public static Field TileKineticGenerator_production = null;
|
||||||
|
|
||||||
public static Class TileSemifluidGenerator = null;
|
public static Class<?> TileSemifluidGenerator = null;
|
||||||
public static Field TileSemifluidGenerator_storage = null;
|
public static Field TileSemifluidGenerator_storage = null;
|
||||||
public static Field TileSemifluidGenerator_maxStorage = null;
|
public static Field TileSemifluidGenerator_maxStorage = null;
|
||||||
public static Field TileSemifluidGenerator_production = null;
|
public static Field TileSemifluidGenerator_production = null;
|
||||||
|
|
||||||
public static Class TileStirlingGenerator = null;
|
public static Class<?> TileStirlingGenerator = null;
|
||||||
public static Field TileStirlingGenerator_storage = null;
|
public static Field TileStirlingGenerator_storage = null;
|
||||||
public static Field TileStirlingGenerator_maxStorage = null;
|
public static Field TileStirlingGenerator_maxStorage = null;
|
||||||
public static Field TileStirlingGenerator_production = null;
|
public static Field TileStirlingGenerator_production = null;
|
||||||
@@ -68,7 +68,6 @@ public class IC2Module {
|
|||||||
TileStirlingGenerator_maxStorage = TileStirlingGenerator.getDeclaredField("maxEUStorage");
|
TileStirlingGenerator_maxStorage = TileStirlingGenerator.getDeclaredField("maxEUStorage");
|
||||||
TileStirlingGenerator_production = TileStirlingGenerator.getDeclaredField("production");
|
TileStirlingGenerator_production = TileStirlingGenerator.getDeclaredField("production");
|
||||||
|
|
||||||
// ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileBaseGenerator);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileBaseGenerator);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileGeoGenerator);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileGeoGenerator);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileKineticGenerator);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileKineticGenerator);
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class MagicalCropsModule {
|
public class MagicalCropsModule {
|
||||||
|
|
||||||
public static Class BlockMagicalCrops = null;
|
public static Class<?> BlockMagicalCrops = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class MagicalCrops = Class.forName("magicalcrops.mod_sCrops");
|
Class.forName("magicalcrops.mod_sCrops");
|
||||||
Waila.log.log(Level.INFO, "MagicalCrops mod found.");
|
Waila.log.log(Level.INFO, "MagicalCrops mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[MagicalCrops] MagicalCrops mod not found.");
|
Waila.log.log(Level.INFO, "[MagicalCrops] MagicalCrops mod not found.");
|
||||||
|
|||||||
@@ -7,12 +7,11 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class OpenBlocksModule {
|
public class OpenBlocksModule {
|
||||||
|
|
||||||
public static Class ModOpenBlocks = null;
|
public static Class<?> TileEntityTank = null;
|
||||||
public static Class TileEntityTank = null;
|
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class ModOpenBlocks = Class.forName("openblocks.OpenBlocks");
|
Class.forName("openblocks.OpenBlocks");
|
||||||
Waila.log.log(Level.INFO, "OpenBlocks mod found.");
|
Waila.log.log(Level.INFO, "OpenBlocks mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[OpenBlocks] OpenBlocks mod not found.");
|
Waila.log.log(Level.INFO, "[OpenBlocks] OpenBlocks mod not found.");
|
||||||
|
|||||||
@@ -41,12 +41,9 @@ public class HUDDecoratorRsGateLogic implements IWailaFMPDecorator {
|
|||||||
subID = NBTUtil.getNBTInteger(accessor.getNBTData(), "subID");
|
subID = NBTUtil.getNBTInteger(accessor.getNBTData(), "subID");
|
||||||
shape = NBTUtil.getNBTInteger(accessor.getNBTData(), "shape");
|
shape = NBTUtil.getNBTInteger(accessor.getNBTData(), "shape");
|
||||||
|
|
||||||
// orient = orient - ((orient & 0x10) + (orient & 0x8) + (orient & 0x4));
|
|
||||||
int hOrient = orient & 0x3;
|
int hOrient = orient & 0x3;
|
||||||
ForgeDirection vOrient = ForgeDirection.getOrientation((orient - (orient & 0x3)) >> 2);
|
ForgeDirection vOrient = ForgeDirection.getOrientation((orient - (orient & 0x3)) >> 2);
|
||||||
|
|
||||||
// System.out.printf("%s\n", ForgeDirection.getOrientation(vOrient));
|
|
||||||
|
|
||||||
if (vOrient == ForgeDirection.EAST) hOrient -= 1;
|
if (vOrient == ForgeDirection.EAST) hOrient -= 1;
|
||||||
|
|
||||||
if (vOrient == ForgeDirection.WEST) hOrient += 1;
|
if (vOrient == ForgeDirection.WEST) hOrient += 1;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public class ProjectRedModule {
|
|||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class ModClass = Class.forName("mrtjp.projectred.ProjectRedIntegration");
|
Class.forName("mrtjp.projectred.ProjectRedIntegration");
|
||||||
Waila.log.log(Level.INFO, "ProjectRed|Integration mod found.");
|
Waila.log.log(Level.INFO, "ProjectRed|Integration mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[ProjectRed] ProjectRed|Integration mod not found.");
|
Waila.log.log(Level.INFO, "[ProjectRed] ProjectRed|Integration mod not found.");
|
||||||
@@ -32,10 +32,6 @@ public class ProjectRedModule {
|
|||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_bgate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_bgate");
|
||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_agate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_agate");
|
||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_rgate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_rgate");
|
||||||
|
|
||||||
// ModuleRegistrar.instance().registerBlockDecorator(new HUDDecoratorRsGateLogic(), BlockMultipart);
|
|
||||||
// ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerRsGateLogic(), BlockMultipart);
|
|
||||||
// ModuleRegistrar.instance().registerSyncedNBTKey("*", BlockMultipart);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,14 +9,13 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class RailcraftModule {
|
public class RailcraftModule {
|
||||||
|
|
||||||
public static Class TileTankBase = null;
|
public static Class<?> TileTankBase = null;
|
||||||
public static Class ITankTile = null;
|
public static Class<?> ITankTile = null;
|
||||||
public static Method ITankTile_getTank = null;
|
public static Method ITankTile_getTank = null;
|
||||||
// public static Class StandardTank = null;
|
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class ModRailcraft = Class.forName("mods.railcraft.common.core.Railcraft");
|
Class.forName("mods.railcraft.common.core.Railcraft");
|
||||||
Waila.log.log(Level.INFO, "Railcraft mod found.");
|
Waila.log.log(Level.INFO, "Railcraft mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[Railcraft] Railcraft mod not found.");
|
Waila.log.log(Level.INFO, "[Railcraft] Railcraft mod not found.");
|
||||||
@@ -27,7 +26,6 @@ public class RailcraftModule {
|
|||||||
TileTankBase = Class.forName("mods.railcraft.common.blocks.machine.beta.TileTankBase");
|
TileTankBase = Class.forName("mods.railcraft.common.blocks.machine.beta.TileTankBase");
|
||||||
ITankTile = Class.forName("mods.railcraft.common.blocks.machine.ITankTile");
|
ITankTile = Class.forName("mods.railcraft.common.blocks.machine.ITankTile");
|
||||||
ITankTile_getTank = ITankTile.getMethod("getTank");
|
ITankTile_getTank = ITankTile.getMethod("getTank");
|
||||||
// StandardTank = Class.forName("mods.railcraft.common.fluids.tanks.StandardTank");
|
|
||||||
|
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[Railcraft] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[Railcraft] Class not found. " + e);
|
||||||
|
|||||||
@@ -16,15 +16,6 @@ public class HUDTileEntityCamo implements IWailaDataProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
/*
|
|
||||||
* if (!config.getConfig("secretrooms.hide")) return null; if (
|
|
||||||
* SecretRoomsModule.BlockCamoTrapDoor.isInstance(accessor.getBlock()) ){ return
|
|
||||||
* this.getTrapDoorBlock(accessor); } else if (
|
|
||||||
* SecretRoomsModule.BlockTorchLever.isInstance(accessor.getBlock()) ){ return new ItemStack(Blocks.torch); }
|
|
||||||
* else if (accessor.getNBTData() != null){ NBTTagCompound tag = accessor.getNBTData(); if (tag.hasKey("copyID")
|
|
||||||
* && tag.hasKey("copyMeta")){ int copyID = accessor.getNBTInteger(tag, "copyID"); int copyMeta =
|
|
||||||
* accessor.getNBTInteger(tag, "copyMeta"); return new ItemStack(copyID, 1, copyMeta); } }
|
|
||||||
*/
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,14 +38,6 @@ public class HUDTileEntityCamo implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack getTrapDoorBlock(IWailaDataAccessor accessor) {
|
private ItemStack getTrapDoorBlock(IWailaDataAccessor accessor) {
|
||||||
// modify coordinates to get hinge Block.
|
|
||||||
/*
|
|
||||||
* int i = accessor.getMetadata(); int j = accessor.getPosition().blockX; int k = accessor.getPosition().blockZ;
|
|
||||||
* if ((i & 3) == 0) { k++; } if ((i & 3) == 1) { k--; } if ((i & 3) == 2) { j++; } if ((i & 3) == 3) { j--; }
|
|
||||||
* int blockID = accessor.getWorld().getBlockId(j, accessor.getPosition().blockY, k); int blockMeta =
|
|
||||||
* accessor.getWorld().getBlockMetadata(j, accessor.getPosition().blockY, k); return new ItemStack(blockID, 1,
|
|
||||||
* blockMeta);
|
|
||||||
*/
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,27 +2,6 @@ package mcp.mobius.waila.addons.secretrooms;
|
|||||||
|
|
||||||
public class SecretRoomsModule {
|
public class SecretRoomsModule {
|
||||||
|
|
||||||
public static Class TileEntityCamo = null;
|
public static void register() {}
|
||||||
public static Class BlockTorchLever = null;
|
|
||||||
public static Class BlockCamoTrapDoor = null;
|
|
||||||
|
|
||||||
public static void register() {
|
|
||||||
/*
|
|
||||||
* try{ Class SecretRooms = Class.forName("com.github.AbrarSyed.secretroomsmod.common.SecretRooms");
|
|
||||||
* Waila.log.log(Level.INFO, "SecretRooms mod found."); } catch (ClassNotFoundException e){
|
|
||||||
* Waila.log.log(Level.INFO, "[SecretRooms] SecretRooms mod not found."); return; } try{ TileEntityCamo =
|
|
||||||
* Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.TileEntityCamo"); BlockTorchLever =
|
|
||||||
* Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.BlockTorchLever"); BlockCamoTrapDoor =
|
|
||||||
* Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.BlockCamoTrapDoor"); } catch
|
|
||||||
* (ClassNotFoundException e){ Waila.log.log(Level.WARNING, "[SecretRooms] Class not found. " + e); return; }
|
|
||||||
* catch (Exception e) { Waila.log.log(Level.WARNING, "[SecretRooms] Error while loading module. " + e); return;
|
|
||||||
* } ModuleRegistrar.instance().addConfig("SecretRooms", "secretrooms.hide");
|
|
||||||
* ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), TileEntityCamo);
|
|
||||||
* ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), BlockTorchLever);
|
|
||||||
* ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), BlockCamoTrapDoor);
|
|
||||||
* ModuleRegistrar.instance().registerSyncedNBTKey("copyID", TileEntityCamo);
|
|
||||||
* ModuleRegistrar.instance().registerSyncedNBTKey("copyMeta", TileEntityCamo);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ public class HUDHandlerStatues implements IWailaDataProvider {
|
|||||||
IWailaConfigHandler config) {
|
IWailaConfigHandler config) {
|
||||||
try {
|
try {
|
||||||
String skinName = (String) StatuesModule.skinName.get(accessor.getTileEntity());
|
String skinName = (String) StatuesModule.skinName.get(accessor.getTileEntity());
|
||||||
if (skinName.equals("")) {
|
if (skinName.isEmpty()) {
|
||||||
TileEntity belowEnt = accessor.getWorld().getTileEntity(
|
TileEntity belowEnt = accessor.getWorld().getTileEntity(
|
||||||
accessor.getPosition().blockX,
|
accessor.getPosition().blockX,
|
||||||
accessor.getPosition().blockY - 1,
|
accessor.getPosition().blockY - 1,
|
||||||
@@ -38,7 +38,7 @@ public class HUDHandlerStatues implements IWailaDataProvider {
|
|||||||
skinName = (String) StatuesModule.skinName.get(belowEnt);
|
skinName = (String) StatuesModule.skinName.get(belowEnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skinName.equals("")) {
|
if (skinName.isEmpty()) {
|
||||||
currenttip.clear();
|
currenttip.clear();
|
||||||
currenttip.add(WHITE + "Statue : Unknown");
|
currenttip.add(WHITE + "Statue : Unknown");
|
||||||
} else {
|
} else {
|
||||||
@@ -50,12 +50,6 @@ public class HUDHandlerStatues implements IWailaDataProvider {
|
|||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* String skinName = accessor.getNBTData().getString("skin"); if (skinName.equals("")){ if
|
|
||||||
* (accessor.getWorld().getBlockTileEntity(accessor.getPosition().blockX, accessor.getPosition().blockY - 1,
|
|
||||||
* accessor.getPosition().blockZ) != null){ } }
|
|
||||||
*/
|
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class StatuesModule {
|
public class StatuesModule {
|
||||||
|
|
||||||
public static Class TileEntityStatue = null;
|
public static Class<?> TileEntityStatue = null;
|
||||||
public static Field skinName = null;
|
public static Field skinName = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Class Statues = Class.forName("info.jbcs.minecraft.statues.Statues");
|
Class.forName("info.jbcs.minecraft.statues.Statues");
|
||||||
Waila.log.log(Level.INFO, "Statues mod found.");
|
Waila.log.log(Level.INFO, "Statues mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[Statues] Statues mod not found.");
|
Waila.log.log(Level.INFO, "[Statues] Statues mod not found.");
|
||||||
@@ -24,10 +24,7 @@ public class StatuesModule {
|
|||||||
try {
|
try {
|
||||||
TileEntityStatue = Class.forName("info.jbcs.minecraft.statues.TileEntityStatue");
|
TileEntityStatue = Class.forName("info.jbcs.minecraft.statues.TileEntityStatue");
|
||||||
skinName = TileEntityStatue.getDeclaredField("skinName");
|
skinName = TileEntityStatue.getDeclaredField("skinName");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException | NoSuchFieldException e) {
|
||||||
Waila.log.log(Level.WARN, "[Statues] Class not found. " + e);
|
|
||||||
return;
|
|
||||||
} catch (NoSuchFieldException e) {
|
|
||||||
Waila.log.log(Level.WARN, "[Statues] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[Statues] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import mcp.mobius.waila.utils.WailaExceptionHandler;
|
|||||||
|
|
||||||
public class HUDCargoManager implements IWailaDataProvider {
|
public class HUDCargoManager implements IWailaDataProvider {
|
||||||
|
|
||||||
private static String colors[] = { "NA", "Red", "Blue", "Yellow", "Green", "Dis." };
|
private static String[] colors = { "NA", "Red", "Blue", "Yellow", "Green", "Dis." };
|
||||||
private static String sides[] = { "Yellow", "Blue", "Green", "Red" };
|
private static String[] sides = { "Yellow", "Blue", "Green", "Red" };
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
@@ -73,15 +73,14 @@ public class HUDCargoManager implements IWailaDataProvider {
|
|||||||
int doReturn = accessor.getNBTInteger(tag, "doReturn");
|
int doReturn = accessor.getNBTInteger(tag, "doReturn");
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
int target = accessor.getNBTInteger(tag, "target" + String.valueOf(i));
|
int target = accessor.getNBTInteger(tag, "target" + i);
|
||||||
int color = accessor.getNBTInteger(tag, "color" + String.valueOf(i));
|
int color = accessor.getNBTInteger(tag, "color" + i);
|
||||||
int amount = accessor.getNBTInteger(tag, "amount" + String.valueOf(i));
|
int amount = accessor.getNBTInteger(tag, "amount" + i);
|
||||||
if (color == 5) continue;
|
if (color == 5) continue;
|
||||||
|
|
||||||
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
||||||
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
||||||
String sAmount = amount == 0 ? "All"
|
String sAmount = amount == 0 ? "All" : this.getAmount(amount) + " " + this.getAmountType(amount);
|
||||||
: String.valueOf(this.getAmount(amount) + " " + this.getAmountType(amount));
|
|
||||||
|
|
||||||
String selection = (String) StevesCartsModule.GetSelectionName
|
String selection = (String) StevesCartsModule.GetSelectionName
|
||||||
.invoke(StevesCartsModule.CargoItemSelection.cast(itemSelection.get(target)));
|
.invoke(StevesCartsModule.CargoItemSelection.cast(itemSelection.get(target)));
|
||||||
@@ -112,40 +111,17 @@ public class HUDCargoManager implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getAmount(int id) {
|
public int getAmount(int id) {
|
||||||
switch (id) {
|
return switch (id) {
|
||||||
case 1:
|
case 1, 7 -> 1;
|
||||||
return 1;
|
case 2, 9 -> 3;
|
||||||
|
case 3 -> 8;
|
||||||
case 2:
|
case 4 -> 16;
|
||||||
return 3;
|
case 5 -> 32;
|
||||||
|
case 6 -> 64;
|
||||||
case 3:
|
case 8 -> 2;
|
||||||
return 8;
|
case 10 -> 5;
|
||||||
|
default -> 0;
|
||||||
case 4:
|
};
|
||||||
return 16;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return 32;
|
|
||||||
|
|
||||||
case 6:
|
|
||||||
return 64;
|
|
||||||
|
|
||||||
case 7:
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
case 8:
|
|
||||||
return 2;
|
|
||||||
|
|
||||||
case 9:
|
|
||||||
return 3;
|
|
||||||
|
|
||||||
case 10:
|
|
||||||
return 5;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0 - MAX
|
// 0 - MAX
|
||||||
|
|||||||
@@ -28,25 +28,6 @@ public class HUDCartAssembler implements IWailaDataProvider {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
IWailaConfigHandler config) {
|
IWailaConfigHandler config) {
|
||||||
/*
|
|
||||||
* if (!config.getConfig("stevescarts.showall")) return currenttip; if
|
|
||||||
* (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()){ currenttip.add(ITALIC +
|
|
||||||
* "Press shift for more data"); return currenttip; } int currTime =
|
|
||||||
* accessor.getNBTInteger(accessor.getNBTData(), "currentTime"); int maxTime =
|
|
||||||
* accessor.getNBTInteger(accessor.getNBTData(), "maxTime"); int isAssembling =
|
|
||||||
* accessor.getNBTInteger(accessor.getNBTData(), "isAssembling"); NBTTagList slots =
|
|
||||||
* accessor.getNBTData().getTagList("Items"); boolean hasOutput = false; Item ItemCartModule = null; try {
|
|
||||||
* ItemCartModule = (Item)StevesCartsModule.ItemCartModule.get(null); } catch (Exception e) { currenttip =
|
|
||||||
* WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip); return
|
|
||||||
* currenttip; } for (int i = 0; i < slots.tagCount(); i++){ NBTTagCompound subtag =
|
|
||||||
* (NBTTagCompound)(slots.tagAt(i)); byte slot = subtag.getByte("Slot"); if (slot == 30) hasOutput = true; } if
|
|
||||||
* (isAssembling == 1){ currenttip.add(String.format("Time remaining : %.1f sec", (maxTime - currTime) /
|
|
||||||
* 20.0f)); NBTTagCompound output = accessor.getNBTData().getCompoundTag("Output"); short outID =
|
|
||||||
* output.getShort("id"); byte[] metas = output.getCompoundTag("tag").getByteArray("Modules"); for (byte b :
|
|
||||||
* metas){ currenttip.add(new ItemStack(ItemCartModule, 1, b).getDisplayName()); } } else if (hasOutput)
|
|
||||||
* currenttip.add(String.format("Time remaining : <Done>")); else
|
|
||||||
* currenttip.add(String.format("Time remaining : <Idle>"));
|
|
||||||
*/
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import mcp.mobius.waila.api.IWailaDataProvider;
|
|||||||
|
|
||||||
public class HUDLiquidManager implements IWailaDataProvider {
|
public class HUDLiquidManager implements IWailaDataProvider {
|
||||||
|
|
||||||
private static String colors[] = { "NA", "Red", "Blue", "Yellow", "Green", "Dis." };
|
private static String[] colors = { "NA", "Red", "Blue", "Yellow", "Green", "Dis." };
|
||||||
private static String sides[] = { "Yellow", "Blue", "Green", "Red" };
|
private static String[] sides = { "Yellow", "Blue", "Green", "Red" };
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
@@ -67,9 +67,8 @@ public class HUDLiquidManager implements IWailaDataProvider {
|
|||||||
int doReturn = accessor.getNBTInteger(tag, "doReturn");
|
int doReturn = accessor.getNBTInteger(tag, "doReturn");
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
int target = accessor.getNBTInteger(tag, "target" + String.valueOf(i));
|
int color = accessor.getNBTInteger(tag, "color" + i);
|
||||||
int color = accessor.getNBTInteger(tag, "color" + String.valueOf(i));
|
int amount = accessor.getNBTInteger(tag, "amount" + i);
|
||||||
int amount = accessor.getNBTInteger(tag, "amount" + String.valueOf(i));
|
|
||||||
|
|
||||||
String fluidName = "<Empty>";
|
String fluidName = "<Empty>";
|
||||||
int fluidAmount = 0;
|
int fluidAmount = 0;
|
||||||
@@ -84,10 +83,8 @@ public class HUDLiquidManager implements IWailaDataProvider {
|
|||||||
|
|
||||||
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
||||||
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
||||||
String sAmount = amount == 0 ? "All" : String.valueOf(this.getMaxAmountBuckets(amount)) + " mB";
|
String sAmount = amount == 0 ? "All" : this.getMaxAmountBuckets(amount) + " mB";
|
||||||
|
|
||||||
// String selection = (String)
|
|
||||||
// StevesCartsModule.GetSelectionName.invoke(StevesCartsModule.CargoItemSelection.cast(itemSelection.get(target)));
|
|
||||||
currenttip.add(
|
currenttip.add(
|
||||||
String.format(
|
String.format(
|
||||||
"Side %s %s[ %s ]%s[ %s , %s]%s[ %s ]",
|
"Side %s %s[ %s ]%s[ %s , %s]%s[ %s ]",
|
||||||
@@ -112,30 +109,19 @@ public class HUDLiquidManager implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxAmountBuckets(int id) {
|
public int getMaxAmountBuckets(int id) {
|
||||||
switch (id) {
|
return switch (id) {
|
||||||
case 1:
|
case 1 -> 250;
|
||||||
return 250;
|
case 2 -> 500;
|
||||||
case 2:
|
case 3 -> 750;
|
||||||
return 500;
|
case 4 -> 1000;
|
||||||
case 3:
|
case 5 -> 2000;
|
||||||
return 750;
|
case 6 -> 3000;
|
||||||
case 4:
|
case 7 -> 5000;
|
||||||
return 1000;
|
case 8 -> 7500;
|
||||||
case 5:
|
case 9 -> 10000;
|
||||||
return 2000;
|
case 10 -> 15000;
|
||||||
case 6:
|
default -> 0;
|
||||||
return 3000;
|
};
|
||||||
case 7:
|
|
||||||
return 5000;
|
|
||||||
case 8:
|
|
||||||
return 7500;
|
|
||||||
case 9:
|
|
||||||
return 10000;
|
|
||||||
case 10:
|
|
||||||
return 15000;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -60,16 +60,16 @@ public class HUDMinecartModular implements IWailaEntityProvider {
|
|||||||
byte[] metas = tag.getByteArray("Modules");
|
byte[] metas = tag.getByteArray("Modules");
|
||||||
|
|
||||||
for (int i = 0; i < metas.length; i++) {
|
for (int i = 0; i < metas.length; i++) {
|
||||||
if (tag.hasKey("module" + String.valueOf(i) + "Fuel")) {
|
if (tag.hasKey("module" + i + "Fuel")) {
|
||||||
|
|
||||||
int fuel = accessor.getNBTInteger(tag, "module" + String.valueOf(i) + "Fuel");
|
int fuel = accessor.getNBTInteger(tag, "module" + i + "Fuel");
|
||||||
currenttip.add(
|
currenttip.add(
|
||||||
new ItemStack(ItemCartModule, 1, metas[i])
|
new ItemStack(ItemCartModule, 1, metas[i])
|
||||||
.getDisplayName() + TAB + ALIGNRIGHT + " [ " + WHITE + fuel + GRAY + " POW ]");
|
.getDisplayName() + TAB + ALIGNRIGHT + " [ " + WHITE + fuel + GRAY + " POW ]");
|
||||||
|
|
||||||
} else if (tag.hasKey("module" + String.valueOf(i) + "Fluid")) {
|
} else if (tag.hasKey("module" + i + "Fluid")) {
|
||||||
|
|
||||||
NBTTagCompound subtag = tag.getCompoundTag("module" + String.valueOf(i) + "Fluid");
|
NBTTagCompound subtag = tag.getCompoundTag("module" + i + "Fluid");
|
||||||
if (subtag.hasKey("Amount")) {
|
if (subtag.hasKey("Amount")) {
|
||||||
int amount = accessor.getNBTInteger(subtag, "Amount");
|
int amount = accessor.getNBTInteger(subtag, "Amount");
|
||||||
String fluid = subtag.getString("FluidName");
|
String fluid = subtag.getString("FluidName");
|
||||||
@@ -78,7 +78,7 @@ public class HUDMinecartModular implements IWailaEntityProvider {
|
|||||||
+ ALIGNRIGHT
|
+ ALIGNRIGHT
|
||||||
+ " [ "
|
+ " [ "
|
||||||
+ WHITE
|
+ WHITE
|
||||||
+ String.valueOf(amount)
|
+ amount
|
||||||
+ GRAY
|
+ GRAY
|
||||||
+ " mB of "
|
+ " mB of "
|
||||||
+ WHITE
|
+ WHITE
|
||||||
|
|||||||
@@ -5,50 +5,13 @@ import java.lang.reflect.Method;
|
|||||||
|
|
||||||
public class StevesCartsModule {
|
public class StevesCartsModule {
|
||||||
|
|
||||||
public static Class TileEntityCartAssembler = null;
|
public static Class<?> CargoItemSelection = null;
|
||||||
public static Class TileEntityCargo = null;
|
|
||||||
public static Class TileEntityLiquid = null;
|
|
||||||
public static Class MinecartModular = null;
|
|
||||||
public static Class StevesItems = null;
|
|
||||||
public static Class CargoItemSelection = null;
|
|
||||||
|
|
||||||
public static Field ItemCartComponent = null; // Items.component
|
|
||||||
public static Field ItemCartModule = null; // Items.modules
|
public static Field ItemCartModule = null; // Items.modules
|
||||||
public static Field ItemSelections = null; // TileEntityCargo.itemSelections
|
public static Field ItemSelections = null; // TileEntityCargo.itemSelections
|
||||||
|
|
||||||
public static Method GetSelectionName = null; // CargoItemSelection.getName
|
public static Method GetSelectionName = null; // CargoItemSelection.getName
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {}
|
||||||
/*
|
|
||||||
* try{ Class ModStevesCarts = Class.forName("vswe.stevescarts.StevesCarts"); Waila.log.log(Level.INFO,
|
|
||||||
* "StevesCarts mod found."); } catch (ClassNotFoundException e){ Waila.log.log(Level.INFO,
|
|
||||||
* "[StevesCarts] StevesCarts mod not found."); return; } try{ TileEntityCartAssembler =
|
|
||||||
* Class.forName("vswe.stevescarts.TileEntities.TileEntityCartAssembler"); TileEntityCargo =
|
|
||||||
* Class.forName("vswe.stevescarts.TileEntities.TileEntityCargo"); TileEntityLiquid =
|
|
||||||
* Class.forName("vswe.stevescarts.TileEntities.TileEntityLiquid"); MinecartModular =
|
|
||||||
* Class.forName("vswe.stevescarts.Carts.MinecartModular"); StevesItems =
|
|
||||||
* Class.forName("vswe.stevescarts.Items.Items"); CargoItemSelection =
|
|
||||||
* Class.forName("vswe.stevescarts.Helpers.CargoItemSelection"); ItemCartComponent =
|
|
||||||
* StevesItems.getDeclaredField("component"); ItemCartModule = StevesItems.getDeclaredField("modules");
|
|
||||||
* ItemSelections = TileEntityCargo.getDeclaredField("itemSelections"); GetSelectionName =
|
|
||||||
* CargoItemSelection.getDeclaredMethod("getName"); } catch (ClassNotFoundException e){
|
|
||||||
* Waila.log.log(Level.WARNING, "[StevesCarts] Class not found. " + e); return; } catch (NoSuchFieldException e)
|
|
||||||
* { Waila.log.log(Level.WARNING, "[StevesCarts] Field not found. " + e); return; } catch (NoSuchMethodException
|
|
||||||
* e) { Waila.log.log(Level.WARNING, "[StevesCarts] Method not found. " + e); return; } catch (Exception e) {
|
|
||||||
* Waila.log.log(Level.WARNING, "[StevesCarts] Error while loading module. " + e); return; }
|
|
||||||
* ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.showall");
|
|
||||||
* ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.colorblind");
|
|
||||||
* ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.shifttoggle");
|
|
||||||
* ModuleRegistrar.instance().registerBodyProvider(new HUDCartAssembler(), TileEntityCartAssembler);
|
|
||||||
* ModuleRegistrar.instance().registerBodyProvider(new HUDCargoManager(), TileEntityCargo);
|
|
||||||
* ModuleRegistrar.instance().registerBodyProvider(new HUDLiquidManager(), TileEntityLiquid);
|
|
||||||
* ModuleRegistrar.instance().registerHeadProvider(new HUDMinecartModular(), MinecartModular);
|
|
||||||
* ModuleRegistrar.instance().registerBodyProvider(new HUDMinecartModular(), MinecartModular);
|
|
||||||
* ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityCartAssembler);
|
|
||||||
* ModuleRegistrar.instance().registerSyncedNBTKey("*", MinecartModular);
|
|
||||||
* ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityCargo);
|
|
||||||
* ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityLiquid);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
|||||||
if (tag.hasKey("Aspects")) {
|
if (tag.hasKey("Aspects")) {
|
||||||
NBTTagList taglist = tag.getTagList("Aspects", 10);
|
NBTTagList taglist = tag.getTagList("Aspects", 10);
|
||||||
|
|
||||||
List<String> unknownAspects = new ArrayList<String>();
|
List<String> unknownAspects = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < taglist.tagCount(); i++) {
|
for (int i = 0; i < taglist.tagCount(); i++) {
|
||||||
NBTTagCompound subtag = taglist.getCompoundTagAt(i);
|
NBTTagCompound subtag = taglist.getCompoundTagAt(i);
|
||||||
@@ -97,26 +97,21 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Object o : tileAspects.keySet()) {
|
for (Object o : tileAspects.keySet()) {
|
||||||
if ((Integer) tileAspects.get(o) > 0) {
|
if (tileAspects.get(o) > 0) {
|
||||||
if (playerAspects.containsKey(o)) {
|
if (playerAspects.containsKey(o)) {
|
||||||
NBTTagCompound cmptag = new NBTTagCompound();
|
NBTTagCompound cmptag = new NBTTagCompound();
|
||||||
cmptag.setString("key", (String) ThaumcraftModule.Aspect_getName.invoke(o));
|
cmptag.setString("key", (String) ThaumcraftModule.Aspect_getName.invoke(o));
|
||||||
cmptag.setInteger("value", (Integer) tileAspects.get(o));
|
cmptag.setInteger("value", tileAspects.get(o));
|
||||||
aspects.appendTag(cmptag);
|
aspects.appendTag(cmptag);
|
||||||
} else {
|
} else {
|
||||||
NBTTagCompound cmptag = new NBTTagCompound();
|
NBTTagCompound cmptag = new NBTTagCompound();
|
||||||
cmptag.setString("key", "???");
|
cmptag.setString("key", "???");
|
||||||
cmptag.setInteger("value", (Integer) tileAspects.get(o));
|
cmptag.setInteger("value", tileAspects.get(o));
|
||||||
aspects.appendTag(cmptag);
|
aspects.appendTag(cmptag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// for (int i = 0; i < aspects.tagCount(); i++){
|
|
||||||
// System.out.printf("%s : %s\n", aspects.getCompoundTagAt(i).getString("key"),
|
|
||||||
// aspects.getCompoundTagAt(i).getString("value"));
|
|
||||||
// }
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ public class ThaumcraftModule {
|
|||||||
|
|
||||||
public static Class<?> IGoggles = null;
|
public static Class<?> IGoggles = null;
|
||||||
|
|
||||||
// public static Class<?> TileAlchemyFurnace = null;
|
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
try {
|
try {
|
||||||
Thaumcraft = Class.forName("thaumcraft.common.Thaumcraft");
|
Thaumcraft = Class.forName("thaumcraft.common.Thaumcraft");
|
||||||
@@ -69,10 +67,8 @@ public class ThaumcraftModule {
|
|||||||
|
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[Thaumcraft] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[Thaumcraft] Class not found. " + e);
|
||||||
return;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[Thaumcraft] Unhandled exception." + e);
|
Waila.log.log(Level.WARN, "[Thaumcraft] Unhandled exception." + e);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class ThermalDynamicsModule {
|
public class ThermalDynamicsModule {
|
||||||
|
|
||||||
public static Class TileFluidDuct = null;
|
public static Class<?> TileFluidDuct = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
// XXX : We register the Fluiduct
|
// XXX : We register the Fluiduct
|
||||||
@@ -23,17 +23,6 @@ public class ThermalDynamicsModule {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks." + e);
|
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks." + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX : We register the IBlockInfo interface
|
|
||||||
/*
|
|
||||||
* try{ IBlockInfo = Class.forName("cofh.api.block.IBlockInfo"); IBlockInfo_getBlockInfo =
|
|
||||||
* IBlockInfo.getMethod("getBlockInfo", IBlockAccess.class, int.class, int.class, int.class,
|
|
||||||
* ForgeDirection.class, EntityPlayer.class, List.class, boolean.class);
|
|
||||||
* //ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
|
||||||
* ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIBlockInfo(), IBlockInfo);
|
|
||||||
* ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIBlockInfo(), IBlockInfo); } catch (Exception
|
|
||||||
* e){ Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading IBlockInfo hooks." + e); }
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -91,9 +91,7 @@ public class HUDHandlerCache implements IWailaDataProvider {
|
|||||||
try {
|
try {
|
||||||
tag.setInteger("MaxStored", (Integer) ThermalExpansionModule.TileCache_getMaxStored.invoke(te));
|
tag.setInteger("MaxStored", (Integer) ThermalExpansionModule.TileCache_getMaxStored.invoke(te));
|
||||||
tag.setInteger("Stored", (Integer) ThermalExpansionModule.TileCache_getStored.invoke(te));
|
tag.setInteger("Stored", (Integer) ThermalExpansionModule.TileCache_getStored.invoke(te));
|
||||||
} catch (InvocationTargetException e) {
|
} catch (InvocationTargetException | IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return tag;
|
return tag;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class HUDHandlerIBlockInfo implements IWailaDataProvider {
|
|||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
int y, int z) {
|
int y, int z) {
|
||||||
try {
|
try {
|
||||||
List info = new ArrayList();
|
List<Object> info = new ArrayList<>();
|
||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
ThermalExpansionModule.IBlockInfo_getBlockInfo
|
ThermalExpansionModule.IBlockInfo_getBlockInfo
|
||||||
.invoke(block, world, x, y, z, ForgeDirection.UNKNOWN, player, info, false);
|
.invoke(block, world, x, y, z, ForgeDirection.UNKNOWN, player, info, false);
|
||||||
|
|||||||
@@ -37,18 +37,12 @@ public class HUDHandlerISecureTile implements IWailaDataProvider {
|
|||||||
|
|
||||||
if (owner.equals("[None]")) return currenttip;
|
if (owner.equals("[None]")) return currenttip;
|
||||||
|
|
||||||
String access = "INVALID";
|
String access = switch (iaccess) {
|
||||||
switch (iaccess) {
|
case 0 -> LangUtil.translateG("hud.msg.public");
|
||||||
case 0:
|
case 1 -> LangUtil.translateG("hud.msg.restricted");
|
||||||
access = LangUtil.translateG("hud.msg.public");
|
case 2 -> LangUtil.translateG("hud.msg.private");
|
||||||
break;
|
default -> "INVALID";
|
||||||
case 1:
|
};
|
||||||
access = LangUtil.translateG("hud.msg.restricted");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
access = LangUtil.translateG("hud.msg.private");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
currenttip.add(
|
currenttip.add(
|
||||||
String.format("%s : \u00a7f%s\u00a7r [ %s ]", LangUtil.translateG("hud.msg.owner"), owner, access));
|
String.format("%s : \u00a7f%s\u00a7r [ %s ]", LangUtil.translateG("hud.msg.owner"), owner, access));
|
||||||
@@ -69,7 +63,7 @@ public class HUDHandlerISecureTile implements IWailaDataProvider {
|
|||||||
int y, int z) {
|
int y, int z) {
|
||||||
try {
|
try {
|
||||||
String owner = (String) ThermalExpansionModule.ISecureTile_getOwnerName.invoke(te);
|
String owner = (String) ThermalExpansionModule.ISecureTile_getOwnerName.invoke(te);
|
||||||
int access = ((Enum) ThermalExpansionModule.ISecureTile_getAccess.invoke(te)).ordinal();
|
int access = ((Enum<?>) ThermalExpansionModule.ISecureTile_getAccess.invoke(te)).ordinal();
|
||||||
|
|
||||||
tag.setString("Owner", owner);
|
tag.setString("Owner", owner);
|
||||||
tag.setInteger("Access", access);
|
tag.setInteger("Access", access);
|
||||||
|
|||||||
@@ -12,45 +12,42 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class ThermalExpansionModule {
|
public class ThermalExpansionModule {
|
||||||
|
|
||||||
public static Class IEnergyProvider = null;
|
public static Class<?> IEnergyProvider = null;
|
||||||
public static Method IEnergyProvider_getMaxStorage = null;
|
public static Method IEnergyProvider_getMaxStorage = null;
|
||||||
public static Method IEnergyProvider_getCurStorage = null;
|
public static Method IEnergyProvider_getCurStorage = null;
|
||||||
|
|
||||||
public static Class IEnergyReceiver = null;
|
public static Class<?> IEnergyReceiver = null;
|
||||||
public static Method IEnergyReceiver_getMaxStorage = null;
|
public static Method IEnergyReceiver_getMaxStorage = null;
|
||||||
public static Method IEnergyReceiver_getCurStorage = null;
|
public static Method IEnergyReceiver_getCurStorage = null;
|
||||||
|
|
||||||
public static Class IEnergyInfo = null;
|
public static Class<?> IEnergyInfo = null;
|
||||||
public static Method IEnergyInfo_getMaxStorage = null;
|
public static Method IEnergyInfo_getMaxStorage = null;
|
||||||
public static Method IEnergyInfo_getCurStorage = null;
|
public static Method IEnergyInfo_getCurStorage = null;
|
||||||
|
|
||||||
public static Class TileEnergyCell = null;
|
public static Class<?> TileEnergyCell = null;
|
||||||
public static Field TileEnergyCell_Recv = null;
|
public static Field TileEnergyCell_Recv = null;
|
||||||
public static Field TileEnergyCell_Send = null;
|
public static Field TileEnergyCell_Send = null;
|
||||||
|
|
||||||
public static Class TileTank = null;
|
public static Class<?> TileTank = null;
|
||||||
public static Method TileTank_getTankFluid = null;
|
public static Method TileTank_getTankFluid = null;
|
||||||
public static Method TileTank_getTankCapacity = null;
|
public static Method TileTank_getTankCapacity = null;
|
||||||
public static Method TileTank_getTankAmount = null;
|
public static Method TileTank_getTankAmount = null;
|
||||||
public static Field TileTank_mode = null;
|
public static Field TileTank_mode = null;
|
||||||
|
|
||||||
public static Class TileTesseract = null;
|
public static Class<?> TileTesseract = null;
|
||||||
public static Field TileTesseract_Item = null;
|
public static Field TileTesseract_Item = null;
|
||||||
public static Field TileTesseract_Fluid = null;
|
public static Field TileTesseract_Fluid = null;
|
||||||
public static Field TileTesseract_Energy = null;
|
public static Field TileTesseract_Energy = null;
|
||||||
|
|
||||||
public static Class ISecureTile = null;
|
public static Class<?> ISecureTile = null;
|
||||||
public static Method ISecureTile_getAccess = null;
|
public static Method ISecureTile_getAccess = null;
|
||||||
public static Method ISecureTile_getOwnerName = null;
|
public static Method ISecureTile_getOwnerName = null;
|
||||||
|
|
||||||
public static Class TileCache = null;
|
public static Class<?> TileCache = null;
|
||||||
public static Method TileCache_getItemStack = null;
|
public static Method TileCache_getItemStack = null;
|
||||||
public static Method TileCache_getMaxStored = null;
|
public static Method TileCache_getMaxStored = null;
|
||||||
public static Method TileCache_getStored = null;
|
public static Method TileCache_getStored = null;
|
||||||
|
|
||||||
public static Class BlockMultipart = null;
|
|
||||||
|
|
||||||
public static Class IBlockInfo = null;
|
|
||||||
public static Method IBlockInfo_getBlockInfo = null;
|
public static Method IBlockInfo_getBlockInfo = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
@@ -138,8 +135,6 @@ public class ThermalExpansionModule {
|
|||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.owner");
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.owner");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerISecureTile(), ISecureTile);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerISecureTile(), ISecureTile);
|
||||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerISecureTile(), ISecureTile);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerISecureTile(), ISecureTile);
|
||||||
// ModuleRegistrar.instance().registerSyncedNBTKey("Owner", ISecureTile);
|
|
||||||
// ModuleRegistrar.instance().registerSyncedNBTKey("Access", ISecureTile);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks." + e);
|
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks." + e);
|
||||||
@@ -160,17 +155,6 @@ public class ThermalExpansionModule {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX : We register the IBlockInfo interface
|
|
||||||
/*
|
|
||||||
* try{ IBlockInfo = Class.forName("cofh.api.block.IBlockInfo"); IBlockInfo_getBlockInfo =
|
|
||||||
* IBlockInfo.getMethod("getBlockInfo", IBlockAccess.class, int.class, int.class, int.class,
|
|
||||||
* ForgeDirection.class, EntityPlayer.class, List.class, boolean.class);
|
|
||||||
* //ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
|
||||||
* ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIBlockInfo(), IBlockInfo);
|
|
||||||
* ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIBlockInfo(), IBlockInfo); } catch (Exception
|
|
||||||
* e){ Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading IBlockInfo hooks." + e); }
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,14 +7,14 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class TwilightForestModule {
|
public class TwilightForestModule {
|
||||||
|
|
||||||
public static Class BlockTFRoots = null;
|
public static Class<?> BlockTFRoots = null;
|
||||||
public static Class BlockTFPlant = null;
|
public static Class<?> BlockTFPlant = null;
|
||||||
public static Class BlockTFSapling = null;
|
public static Class<?> BlockTFSapling = null;
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Class TwilightForestMod = Class.forName("twilightforest.TwilightForestMod");
|
Class.forName("twilightforest.TwilightForestMod");
|
||||||
Waila.log.log(Level.INFO, "TwilightForestMod mod found.");
|
Waila.log.log(Level.INFO, "TwilightForestMod mod found.");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[TwilightForestMod] TwilightForestMod mod not found.");
|
Waila.log.log(Level.INFO, "[TwilightForestMod] TwilightForestMod mod not found.");
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ public class HUDDecoratorVanilla implements IWailaBlockDecorator {
|
|||||||
|
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
// UIHelper.drawBillboardText(itemStack.getDisplayName(), accessor.getRenderingPosition(), 0.5F, 1.5F, 0.5F,
|
|
||||||
// accessor.getPartialFrame());
|
|
||||||
UIHelper.drawFloatingText("IN", accessor.getRenderingPosition(), 0.5F, 0.2F, -0.2F, 90F, 0F, 0F);
|
UIHelper.drawFloatingText("IN", accessor.getRenderingPosition(), 0.5F, 0.2F, -0.2F, 90F, 0F, 0F);
|
||||||
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), -0.2F, 0.2F, 0.5F, 90F, 90F, 0F);
|
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), -0.2F, 0.2F, 0.5F, 90F, 90F, 0F);
|
||||||
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), 1.2F, 0.2F, 0.5F, 90F, -90F, 0F);
|
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), 1.2F, 0.2F, 0.5F, 90F, -90F, 0F);
|
||||||
|
|||||||
@@ -87,8 +87,5 @@ public class HUDHandlerFurnace implements IWailaDataProvider {
|
|||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {}
|
||||||
// ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerFurnace(), TileEntityFurnace.class);
|
|
||||||
// ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerFurnace(), TileEntityFurnace.class);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockRedstoneOre;
|
import net.minecraft.block.BlockRedstoneOre;
|
||||||
|
import net.minecraft.block.BlockStoneSlab;
|
||||||
|
import net.minecraft.block.BlockWoodSlab;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
@@ -44,6 +46,8 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
|||||||
static Block log = Blocks.log;
|
static Block log = Blocks.log;
|
||||||
static Block log2 = Blocks.log2;
|
static Block log2 = Blocks.log2;
|
||||||
static Block quartz = Blocks.quartz_block;
|
static Block quartz = Blocks.quartz_block;
|
||||||
|
static Block anvil = Blocks.anvil;
|
||||||
|
static Block sapling = Blocks.sapling;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
@@ -51,16 +55,12 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
|||||||
|
|
||||||
if (block == silverfish && config.getConfig("vanilla.silverfish")) {
|
if (block == silverfish && config.getConfig("vanilla.silverfish")) {
|
||||||
int metadata = accessor.getMetadata();
|
int metadata = accessor.getMetadata();
|
||||||
switch (metadata) {
|
return switch (metadata) {
|
||||||
case 0:
|
case 0 -> new ItemStack(Blocks.stone);
|
||||||
return new ItemStack(Blocks.stone);
|
case 1 -> new ItemStack(Blocks.cobblestone);
|
||||||
case 1:
|
case 2 -> new ItemStack(Blocks.brick_block);
|
||||||
return new ItemStack(Blocks.cobblestone);
|
default -> null;
|
||||||
case 2:
|
};
|
||||||
return new ItemStack(Blocks.brick_block);
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block == redstone) {
|
if (block == redstone) {
|
||||||
@@ -96,6 +96,18 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
|||||||
return new ItemStack(block, 1, 2);
|
return new ItemStack(block, 1, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (block == anvil) {
|
||||||
|
return new ItemStack(block, 1, block.damageDropped(accessor.getMetadata()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block == sapling) {
|
||||||
|
return new ItemStack(block, 1, block.damageDropped(accessor.getMetadata()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block instanceof BlockStoneSlab || block instanceof BlockWoodSlab) {
|
||||||
|
return new ItemStack(block, 1, block.damageDropped(accessor.getMetadata()));
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -190,9 +202,7 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
|||||||
if (config.getConfig("vanilla.comparator")) if ((block == comparatorIdl) || (block == comparatorAct)) {
|
if (config.getConfig("vanilla.comparator")) if ((block == comparatorIdl) || (block == comparatorAct)) {
|
||||||
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? LangUtil.translateG("hud.msg.comparator")
|
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? LangUtil.translateG("hud.msg.comparator")
|
||||||
: LangUtil.translateG("hud.msg.substractor");
|
: LangUtil.translateG("hud.msg.substractor");
|
||||||
// int outputSignal = ((TileEntityComparator)entity).func_96100_a();
|
|
||||||
currenttip.add("Mode : " + mode);
|
currenttip.add("Mode : " + mode);
|
||||||
// currenttip.add(String.format("Out : %s", outputSignal));
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,13 +211,6 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
|||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* if (config.getConfig("vanilla.jukebox")) if (block == jukebox){ NBTTagCompound tag = accessor.getNBTData();
|
|
||||||
* Item record = null; if (tag.hasKey("Record")){ record = Item.itemsList[accessor.getNBTInteger(tag,
|
|
||||||
* "Record")]; currenttip.add(((ItemRecord)record).getRecordTitle()); } else {
|
|
||||||
* currenttip.add(LangUtil.translateG("hud.msg.empty")); } }
|
|
||||||
*/
|
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,8 +248,11 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
|||||||
ModuleRegistrar.instance().registerStackProvider(provider, log.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, log.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, log2.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, log2.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, quartz.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, quartz.getClass());
|
||||||
|
ModuleRegistrar.instance().registerStackProvider(provider, anvil.getClass());
|
||||||
|
ModuleRegistrar.instance().registerStackProvider(provider, sapling.getClass());
|
||||||
|
ModuleRegistrar.instance().registerStackProvider(provider, BlockStoneSlab.class);
|
||||||
|
ModuleRegistrar.instance().registerStackProvider(provider, BlockWoodSlab.class);
|
||||||
|
|
||||||
// ModuleRegistrar.instance().registerStackProvider(provider, Block.class);
|
|
||||||
ModuleRegistrar.instance().registerHeadProvider(provider, mobSpawner.getClass());
|
ModuleRegistrar.instance().registerHeadProvider(provider, mobSpawner.getClass());
|
||||||
ModuleRegistrar.instance().registerHeadProvider(provider, melonStem.getClass());
|
ModuleRegistrar.instance().registerHeadProvider(provider, melonStem.getClass());
|
||||||
ModuleRegistrar.instance().registerHeadProvider(provider, pumpkinStem.getClass());
|
ModuleRegistrar.instance().registerHeadProvider(provider, pumpkinStem.getClass());
|
||||||
@@ -254,8 +260,7 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
|||||||
ModuleRegistrar.instance().registerBodyProvider(provider, crops.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, crops.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, melonStem.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, melonStem.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, pumpkinStem.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, pumpkinStem.getClass());
|
||||||
// ModuleRegistrar.instance().registerBodyProvider(provider, carrot.getClass());
|
|
||||||
// ModuleRegistrar.instance().registerBodyProvider(provider, potato.getClass());
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, lever.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, lever.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, repeaterIdle.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, repeaterIdle.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, repeaterActv.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, repeaterActv.getClass());
|
||||||
@@ -283,10 +288,6 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
|||||||
ModuleRegistrar.instance().registerNBTProvider(provider, cocoa.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, cocoa.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, netherwart.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, netherwart.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, silverfish.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, silverfish.getClass());
|
||||||
|
|
||||||
// ModuleRegistrar.instance().registerDocTextFile("/mcp/mobius/waila/addons/vanillamc/WikiData.csv");
|
|
||||||
|
|
||||||
// ExternalModulesHandler.instance().registerBlockDecorator(new HUDDecoratorVanilla(), repeaterIdle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,25 +6,25 @@ import java.util.Set;
|
|||||||
|
|
||||||
public interface ITaggedList<E, T> extends List<E> {
|
public interface ITaggedList<E, T> extends List<E> {
|
||||||
|
|
||||||
public boolean add(E e, T tag);
|
boolean add(E e, T tag);
|
||||||
|
|
||||||
public boolean add(E e, Collection<? extends T> taglst);
|
boolean add(E e, Collection<? extends T> taglst);
|
||||||
|
|
||||||
public Set<T> getTags(E e);
|
Set<T> getTags(E e);
|
||||||
|
|
||||||
public Set<T> getTags(int index);
|
Set<T> getTags(int index);
|
||||||
|
|
||||||
public void addTag(E e, T tag);
|
void addTag(E e, T tag);
|
||||||
|
|
||||||
public void addTag(int index, T tag);
|
void addTag(int index, T tag);
|
||||||
|
|
||||||
public void removeTag(E e, T tag);
|
void removeTag(E e, T tag);
|
||||||
|
|
||||||
public void removeTag(int index, T tag);
|
void removeTag(int index, T tag);
|
||||||
|
|
||||||
public Set<E> getEntries(T tag);
|
Set<E> getEntries(T tag);
|
||||||
|
|
||||||
public void removeEntries(T tag);
|
void removeEntries(T tag);
|
||||||
|
|
||||||
public String getTagsAsString(E e);
|
String getTagsAsString(E e);
|
||||||
}
|
}
|
||||||
@@ -15,18 +15,15 @@ public interface IWailaConfigHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a set of all the currently loaded modules in the config handler.
|
* Returns a set of all the currently loaded modules in the config handler.
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public Set<String> getModuleNames();
|
Set<String> getModuleNames();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all the currently available options for a given module
|
* Returns all the currently available options for a given module
|
||||||
*
|
*
|
||||||
* @param modName Module name
|
* @param modName Module name
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public HashMap<String, String> getConfigKeys(String modName);
|
HashMap<String, String> getConfigKeys(String modName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current value of an option (true/false) with a default value if not set.
|
* Returns the current value of an option (true/false) with a default value if not set.
|
||||||
@@ -35,7 +32,7 @@ public interface IWailaConfigHandler {
|
|||||||
* @param defvalue Default values
|
* @param defvalue Default values
|
||||||
* @return Value of the option or defvalue if not set.
|
* @return Value of the option or defvalue if not set.
|
||||||
*/
|
*/
|
||||||
public boolean getConfig(String key, boolean defvalue);
|
boolean getConfig(String key, boolean defvalue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current value of an option (true/false) with a default value true if not set
|
* Returns the current value of an option (true/false) with a default value true if not set
|
||||||
@@ -43,5 +40,5 @@ public interface IWailaConfigHandler {
|
|||||||
* @param key Option to lookup
|
* @param key Option to lookup
|
||||||
* @return Value of the option or true if not set.
|
* @return Value of the option or true if not set.
|
||||||
*/
|
*/
|
||||||
public boolean getConfig(String key);
|
boolean getConfig(String key);
|
||||||
}
|
}
|
||||||
@@ -23,58 +23,58 @@ package mcp.mobius.waila.api;
|
|||||||
public interface IWailaRegistrar {
|
public interface IWailaRegistrar {
|
||||||
|
|
||||||
/* Add a config option in the section modname with displayed text configtext and access key keyname */
|
/* Add a config option in the section modname with displayed text configtext and access key keyname */
|
||||||
public void addConfig(String modname, String keyname, String configtext);
|
void addConfig(String modname, String keyname, String configtext);
|
||||||
|
|
||||||
public void addConfig(String modname, String keyname, String configtext, boolean defvalue);
|
void addConfig(String modname, String keyname, String configtext, boolean defvalue);
|
||||||
|
|
||||||
public void addConfigRemote(String modname, String keyname, String configtext);
|
void addConfigRemote(String modname, String keyname, String configtext);
|
||||||
|
|
||||||
public void addConfigRemote(String modname, String keyname, String configtext, boolean defvalue);
|
void addConfigRemote(String modname, String keyname, String configtext, boolean defvalue);
|
||||||
|
|
||||||
public void addConfig(String modname, String keyname);
|
void addConfig(String modname, String keyname);
|
||||||
|
|
||||||
public void addConfig(String modname, String keyname, boolean defvalue);
|
void addConfig(String modname, String keyname, boolean defvalue);
|
||||||
|
|
||||||
public void addConfigRemote(String modname, String keyname);
|
void addConfigRemote(String modname, String keyname);
|
||||||
|
|
||||||
public void addConfigRemote(String modname, String keyname, boolean defvalue);
|
void addConfigRemote(String modname, String keyname, boolean defvalue);
|
||||||
|
|
||||||
/* Register a stack overrider for the given blockID */
|
/* Register a stack overrider for the given blockID */
|
||||||
public void registerStackProvider(IWailaDataProvider dataProvider, Class block);
|
void registerStackProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
/* Same thing, but works on a class hierarchy instead */
|
/* Same thing, but works on a class hierarchy instead */
|
||||||
public void registerHeadProvider(IWailaDataProvider dataProvider, Class block);
|
void registerHeadProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
public void registerBodyProvider(IWailaDataProvider dataProvider, Class block);
|
void registerBodyProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
public void registerTailProvider(IWailaDataProvider dataProvider, Class block);
|
void registerTailProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
/* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */
|
/* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */
|
||||||
public void registerNBTProvider(IWailaDataProvider dataProvider, Class block);
|
void registerNBTProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
/* Entity text registration methods */
|
/* Entity text registration methods */
|
||||||
public void registerHeadProvider(IWailaEntityProvider dataProvider, Class entity);
|
void registerHeadProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
public void registerBodyProvider(IWailaEntityProvider dataProvider, Class entity);
|
void registerBodyProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
public void registerTailProvider(IWailaEntityProvider dataProvider, Class entity);
|
void registerTailProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
public void registerOverrideEntityProvider(IWailaEntityProvider dataProvider, Class entity);
|
void registerOverrideEntityProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
/* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */
|
/* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */
|
||||||
public void registerNBTProvider(IWailaEntityProvider dataProvider, Class entity);
|
void registerNBTProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
/* FMP Providers */
|
/* FMP Providers */
|
||||||
public void registerHeadProvider(IWailaFMPProvider dataProvider, String name);
|
void registerHeadProvider(IWailaFMPProvider dataProvider, String name);
|
||||||
|
|
||||||
public void registerBodyProvider(IWailaFMPProvider dataProvider, String name);
|
void registerBodyProvider(IWailaFMPProvider dataProvider, String name);
|
||||||
|
|
||||||
public void registerTailProvider(IWailaFMPProvider dataProvider, String name);
|
void registerTailProvider(IWailaFMPProvider dataProvider, String name);
|
||||||
|
|
||||||
/* The block decorators */
|
/* The block decorators */
|
||||||
public void registerDecorator(IWailaBlockDecorator decorator, Class block);
|
void registerDecorator(IWailaBlockDecorator decorator, Class block);
|
||||||
|
|
||||||
public void registerDecorator(IWailaFMPDecorator decorator, String name);
|
void registerDecorator(IWailaFMPDecorator decorator, String name);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent).
|
* Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent).
|
||||||
@@ -83,11 +83,7 @@ public interface IWailaRegistrar {
|
|||||||
* is deprecated in favor to registerNBTProvider. It will be removed in MC 1.8 !!!
|
* is deprecated in favor to registerNBTProvider. It will be removed in MC 1.8 !!!
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void registerSyncedNBTKey(String key, Class target);
|
void registerSyncedNBTKey(String key, Class target);
|
||||||
|
|
||||||
public void registerTooltipRenderer(String name, IWailaTooltipRenderer renderer);
|
void registerTooltipRenderer(String name, IWailaTooltipRenderer renderer);
|
||||||
|
|
||||||
/* UNUSED FOR NOW (Will be used for the ingame wiki */
|
|
||||||
// public void registerDocTextFile (String filename);
|
|
||||||
// public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item);
|
|
||||||
}
|
}
|
||||||
@@ -5,18 +5,8 @@ import java.util.LinkedHashMap;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public interface IWailaSummaryProvider {
|
public interface IWailaSummaryProvider {
|
||||||
|
|
||||||
/* This interface is used to control the display data in the description screen */
|
/* This interface is used to control the display data in the description screen */
|
||||||
|
|
||||||
/* BASIC TOOLS & ITEMS DATA */
|
|
||||||
// EnumToolMaterial getMaterial(ItemStack stack);
|
|
||||||
// String getMaterialName(ItemStack stack);
|
|
||||||
// String getEffectiveBlock(ItemStack stack);
|
|
||||||
// int getHarvestLevel(ItemStack stack);
|
|
||||||
// float getEfficiencyOnProperMaterial(ItemStack stack);
|
|
||||||
// int getEnchantability(ItemStack stack);
|
|
||||||
// int getDamageVsEntity(ItemStack stack);
|
|
||||||
// int getDurability(ItemStack stack);
|
|
||||||
|
|
||||||
LinkedHashMap<String, String> getSummary(ItemStack stack, LinkedHashMap<String, String> currentSummary,
|
LinkedHashMap<String, String> getSummary(ItemStack stack, LinkedHashMap<String, String> currentSummary,
|
||||||
IWailaConfigHandler config);
|
IWailaConfigHandler config);
|
||||||
}
|
}
|
||||||
@@ -67,17 +67,13 @@ public class SpecialChars {
|
|||||||
/**
|
/**
|
||||||
* Helper method to get a proper RENDER string. Just put the name of the renderer and the params in, and it will
|
* Helper method to get a proper RENDER string. Just put the name of the renderer and the params in, and it will
|
||||||
* give back a directly usable String for the tooltip.
|
* give back a directly usable String for the tooltip.
|
||||||
*
|
|
||||||
* @param name
|
|
||||||
* @param params
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public static String getRenderString(String name, String... params) {
|
public static String getRenderString(String name, String... params) {
|
||||||
String result = RENDER + "{" + name;
|
StringBuilder result = new StringBuilder(RENDER + "{" + name);
|
||||||
for (String s : params) {
|
for (String s : params) {
|
||||||
result += "," + s;
|
result.append(",").append(s);
|
||||||
}
|
}
|
||||||
result += "}";
|
result.append("}");
|
||||||
return result;
|
return result.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,9 +29,9 @@ public class ConfigHandler implements IWailaConfigHandler {
|
|||||||
}
|
}
|
||||||
/* === */
|
/* === */
|
||||||
|
|
||||||
private LinkedHashMap<String, ConfigModule> modules = new LinkedHashMap<String, ConfigModule>();
|
private LinkedHashMap<String, ConfigModule> modules = new LinkedHashMap<>();
|
||||||
private ArrayList<String> serverconfigs = new ArrayList<String>();
|
private ArrayList<String> serverconfigs = new ArrayList<>();
|
||||||
public HashMap<String, Boolean> forcedConfigs = new HashMap<String, Boolean>();
|
public HashMap<String, Boolean> forcedConfigs = new HashMap<>();
|
||||||
public Configuration config = null;
|
public Configuration config = null;
|
||||||
|
|
||||||
public void addModule(String modName, HashMap<String, String> options) {
|
public void addModule(String modName, HashMap<String, String> options) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public class ConfigModule {
|
|||||||
|
|
||||||
public ConfigModule(String _modName) {
|
public ConfigModule(String _modName) {
|
||||||
this.modName = _modName;
|
this.modName = _modName;
|
||||||
this.options = new HashMap<String, String>();
|
this.options = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigModule(String _modName, HashMap<String, String> _options) {
|
public ConfigModule(String _modName, HashMap<String, String> _options) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAcces
|
|||||||
this.blockResource = GameData.getBlockRegistry().getNameForObject(this.block);
|
this.blockResource = GameData.getBlockRegistry().getNameForObject(this.block);
|
||||||
try {
|
try {
|
||||||
this.stack = new ItemStack(this.block, 1, this.metadata);
|
this.stack = new ItemStack(this.block, 1, this.metadata);
|
||||||
} catch (Exception e) {}
|
} catch (Exception ignored) {}
|
||||||
|
|
||||||
} else if (this.mop.typeOfHit == MovingObjectType.ENTITY) {
|
} else if (this.mop.typeOfHit == MovingObjectType.ENTITY) {
|
||||||
this.block = null;
|
this.block = null;
|
||||||
@@ -131,7 +131,7 @@ public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAcces
|
|||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
try {
|
try {
|
||||||
this.tileEntity.writeToNBT(tag);
|
this.tileEntity.writeToNBT(tag);
|
||||||
} catch (Exception e) {}
|
} catch (Exception ignored) {}
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import net.minecraft.entity.Entity;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@@ -26,23 +25,19 @@ import mcp.mobius.waila.utils.WailaExceptionHandler;
|
|||||||
|
|
||||||
public class MetaDataProvider {
|
public class MetaDataProvider {
|
||||||
|
|
||||||
private Map<Integer, List<IWailaDataProvider>> headBlockProviders = new TreeMap<Integer, List<IWailaDataProvider>>();
|
private final Map<Integer, List<IWailaDataProvider>> headBlockProviders = new TreeMap<>();
|
||||||
private Map<Integer, List<IWailaDataProvider>> bodyBlockProviders = new TreeMap<Integer, List<IWailaDataProvider>>();
|
private final Map<Integer, List<IWailaDataProvider>> bodyBlockProviders = new TreeMap<>();
|
||||||
private Map<Integer, List<IWailaDataProvider>> tailBlockProviders = new TreeMap<Integer, List<IWailaDataProvider>>();
|
private Map<Integer, List<IWailaDataProvider>> tailBlockProviders = new TreeMap<>();
|
||||||
|
|
||||||
private Map<Integer, List<IWailaEntityProvider>> headEntityProviders = new TreeMap<Integer, List<IWailaEntityProvider>>();
|
private final Map<Integer, List<IWailaEntityProvider>> headEntityProviders = new TreeMap<>();
|
||||||
private Map<Integer, List<IWailaEntityProvider>> bodyEntityProviders = new TreeMap<Integer, List<IWailaEntityProvider>>();
|
private final Map<Integer, List<IWailaEntityProvider>> bodyEntityProviders = new TreeMap<>();
|
||||||
private Map<Integer, List<IWailaEntityProvider>> tailEntityProviders = new TreeMap<Integer, List<IWailaEntityProvider>>();
|
private final Map<Integer, List<IWailaEntityProvider>> tailEntityProviders = new TreeMap<>();
|
||||||
|
|
||||||
private Class prevBlock = null;
|
|
||||||
private Class prevTile = null;
|
|
||||||
|
|
||||||
public ItemStack identifyBlockHighlight(World world, EntityPlayer player, MovingObjectPosition mop,
|
public ItemStack identifyBlockHighlight(World world, EntityPlayer player, MovingObjectPosition mop,
|
||||||
DataAccessorCommon accessor) {
|
DataAccessorCommon accessor) {
|
||||||
Block block = accessor.getBlock();
|
Block block = accessor.getBlock();
|
||||||
int blockID = accessor.getBlockID();
|
|
||||||
|
|
||||||
if (IWailaBlock.class.isInstance(block)) {
|
if (block instanceof IWailaBlock) {
|
||||||
try {
|
try {
|
||||||
return ((IWailaBlock) block).getWailaStack(accessor, ConfigHandler.instance());
|
return ((IWailaBlock) block).getWailaStack(accessor, ConfigHandler.instance());
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
@@ -73,7 +68,7 @@ public class MetaDataProvider {
|
|||||||
&& accessor.isTimeElapsed(250)
|
&& accessor.isTimeElapsed(250)
|
||||||
&& ConfigHandler.instance().showTooltip()) {
|
&& ConfigHandler.instance().showTooltip()) {
|
||||||
accessor.resetTimer();
|
accessor.resetTimer();
|
||||||
HashSet<String> keys = new HashSet<String>();
|
HashSet<String> keys = new HashSet<>();
|
||||||
|
|
||||||
if (ModuleRegistrar.instance().hasSyncedNBTKeys(block))
|
if (ModuleRegistrar.instance().hasSyncedNBTKeys(block))
|
||||||
keys.addAll(ModuleRegistrar.instance().getSyncedNBTKeys(block));
|
keys.addAll(ModuleRegistrar.instance().getSyncedNBTKeys(block));
|
||||||
@@ -81,7 +76,7 @@ public class MetaDataProvider {
|
|||||||
if (ModuleRegistrar.instance().hasSyncedNBTKeys(accessor.getTileEntity()))
|
if (ModuleRegistrar.instance().hasSyncedNBTKeys(accessor.getTileEntity()))
|
||||||
keys.addAll(ModuleRegistrar.instance().getSyncedNBTKeys(accessor.getTileEntity()));
|
keys.addAll(ModuleRegistrar.instance().getSyncedNBTKeys(accessor.getTileEntity()));
|
||||||
|
|
||||||
if (keys.size() != 0 || ModuleRegistrar.instance().hasNBTProviders(block)
|
if (!keys.isEmpty() || ModuleRegistrar.instance().hasNBTProviders(block)
|
||||||
|| ModuleRegistrar.instance().hasNBTProviders(accessor.getTileEntity()))
|
|| ModuleRegistrar.instance().hasNBTProviders(accessor.getTileEntity()))
|
||||||
WailaPacketHandler.INSTANCE.sendToServer(new Message0x01TERequest(accessor.getTileEntity(), keys));
|
WailaPacketHandler.INSTANCE.sendToServer(new Message0x01TERequest(accessor.getTileEntity(), keys));
|
||||||
|
|
||||||
@@ -99,8 +94,7 @@ public class MetaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Interface IWailaBlock */
|
/* Interface IWailaBlock */
|
||||||
if (IWailaBlock.class.isInstance(block)) {
|
if (block instanceof IWailaBlock) {
|
||||||
TileEntity entity = world.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
|
||||||
if (layout == Layout.HEADER) try {
|
if (layout == Layout.HEADER) try {
|
||||||
return ((IWailaBlock) block).getWailaHead(itemStack, currenttip, accessor, ConfigHandler.instance());
|
return ((IWailaBlock) block).getWailaHead(itemStack, currenttip, accessor, ConfigHandler.instance());
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
@@ -173,12 +167,12 @@ public class MetaDataProvider {
|
|||||||
|
|
||||||
if (accessor.getEntity() != null && Waila.instance.serverPresent && accessor.isTimeElapsed(250)) {
|
if (accessor.getEntity() != null && Waila.instance.serverPresent && accessor.isTimeElapsed(250)) {
|
||||||
accessor.resetTimer();
|
accessor.resetTimer();
|
||||||
HashSet<String> keys = new HashSet<String>();
|
HashSet<String> keys = new HashSet<>();
|
||||||
|
|
||||||
if (ModuleRegistrar.instance().hasSyncedNBTKeys(accessor.getEntity()))
|
if (ModuleRegistrar.instance().hasSyncedNBTKeys(accessor.getEntity()))
|
||||||
keys.addAll(ModuleRegistrar.instance().getSyncedNBTKeys(accessor.getEntity()));
|
keys.addAll(ModuleRegistrar.instance().getSyncedNBTKeys(accessor.getEntity()));
|
||||||
|
|
||||||
if (keys.size() != 0 || ModuleRegistrar.instance().hasNBTEntityProviders(accessor.getEntity()))
|
if (!keys.isEmpty() || ModuleRegistrar.instance().hasNBTEntityProviders(accessor.getEntity()))
|
||||||
WailaPacketHandler.INSTANCE.sendToServer(new Message0x03EntRequest(accessor.getEntity(), keys));
|
WailaPacketHandler.INSTANCE.sendToServer(new Message0x03EntRequest(accessor.getEntity(), keys));
|
||||||
|
|
||||||
} else if (accessor.getEntity() != null && !Waila.instance.serverPresent && accessor.isTimeElapsed(250)) {
|
} else if (accessor.getEntity() != null && !Waila.instance.serverPresent && accessor.isTimeElapsed(250)) {
|
||||||
|
|||||||
@@ -29,34 +29,34 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
|||||||
|
|
||||||
private static ModuleRegistrar instance = null;
|
private static ModuleRegistrar instance = null;
|
||||||
|
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> headBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> headBlockProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> bodyBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> bodyBlockProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> tailBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> tailBlockProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> stackBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> stackBlockProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> NBTDataProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> NBTDataProviders = new LinkedHashMap<>();
|
||||||
|
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaBlockDecorator>> blockClassDecorators = new LinkedHashMap<Class, ArrayList<IWailaBlockDecorator>>();
|
public LinkedHashMap<Class, ArrayList<IWailaBlockDecorator>> blockClassDecorators = new LinkedHashMap<>();
|
||||||
|
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> headEntityProviders = new LinkedHashMap<Class, ArrayList<IWailaEntityProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> headEntityProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> bodyEntityProviders = new LinkedHashMap<Class, ArrayList<IWailaEntityProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> bodyEntityProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> tailEntityProviders = new LinkedHashMap<Class, ArrayList<IWailaEntityProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> tailEntityProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> overrideEntityProviders = new LinkedHashMap<Class, ArrayList<IWailaEntityProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> overrideEntityProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> NBTEntityProviders = new LinkedHashMap<Class, ArrayList<IWailaEntityProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaEntityProvider>> NBTEntityProviders = new LinkedHashMap<>();
|
||||||
|
|
||||||
public LinkedHashMap<String, ArrayList<IWailaFMPProvider>> headFMPProviders = new LinkedHashMap<String, ArrayList<IWailaFMPProvider>>();
|
public LinkedHashMap<String, ArrayList<IWailaFMPProvider>> headFMPProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<String, ArrayList<IWailaFMPProvider>> bodyFMPProviders = new LinkedHashMap<String, ArrayList<IWailaFMPProvider>>();
|
public LinkedHashMap<String, ArrayList<IWailaFMPProvider>> bodyFMPProviders = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<String, ArrayList<IWailaFMPProvider>> tailFMPProviders = new LinkedHashMap<String, ArrayList<IWailaFMPProvider>>();
|
public LinkedHashMap<String, ArrayList<IWailaFMPProvider>> tailFMPProviders = new LinkedHashMap<>();
|
||||||
|
|
||||||
public LinkedHashMap<String, ArrayList<IWailaFMPDecorator>> FMPClassDecorators = new LinkedHashMap<String, ArrayList<IWailaFMPDecorator>>();
|
public LinkedHashMap<String, ArrayList<IWailaFMPDecorator>> FMPClassDecorators = new LinkedHashMap<>();
|
||||||
|
|
||||||
public LinkedHashMap<Class, HashSet<String>> syncedNBTKeys = new LinkedHashMap<Class, HashSet<String>>();
|
public LinkedHashMap<Class, HashSet<String>> syncedNBTKeys = new LinkedHashMap<>();
|
||||||
|
|
||||||
public LinkedHashMap<String, LinkedHashMap<String, LinkedHashMap<String, String>>> wikiDescriptions = new LinkedHashMap<String, LinkedHashMap<String, LinkedHashMap<String, String>>>();
|
public LinkedHashMap<String, LinkedHashMap<String, LinkedHashMap<String, String>>> wikiDescriptions = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class, ArrayList<IWailaSummaryProvider>> summaryProviders = new LinkedHashMap<Class, ArrayList<IWailaSummaryProvider>>();
|
public LinkedHashMap<Class, ArrayList<IWailaSummaryProvider>> summaryProviders = new LinkedHashMap<>();
|
||||||
|
|
||||||
public LinkedHashMap<String, String> IMCRequests = new LinkedHashMap<String, String>();
|
public LinkedHashMap<String, String> IMCRequests = new LinkedHashMap<>();
|
||||||
|
|
||||||
public LinkedHashMap<String, IWailaTooltipRenderer> tooltipRenderers = new LinkedHashMap<String, IWailaTooltipRenderer>();
|
public LinkedHashMap<String, IWailaTooltipRenderer> tooltipRenderers = new LinkedHashMap<>();
|
||||||
|
|
||||||
private ModuleRegistrar() {
|
private ModuleRegistrar() {
|
||||||
instance = this;
|
instance = this;
|
||||||
@@ -201,7 +201,7 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
|||||||
dataProvider.getClass().getName(),
|
dataProvider.getClass().getName(),
|
||||||
clazz));
|
clazz));
|
||||||
|
|
||||||
if (!target.containsKey(clazz)) target.put(clazz, new ArrayList<T>());
|
if (!target.containsKey(clazz)) target.put(clazz, new ArrayList<>());
|
||||||
|
|
||||||
ArrayList<T> providers = target.get(clazz);
|
ArrayList<T> providers = target.get(clazz);
|
||||||
if (providers.contains(dataProvider)) return;
|
if (providers.contains(dataProvider)) return;
|
||||||
@@ -212,7 +212,7 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void registerSyncedNBTKey(String key, Class target) {
|
public void registerSyncedNBTKey(String key, Class target) {
|
||||||
if (!this.syncedNBTKeys.containsKey(target)) this.syncedNBTKeys.put(target, new HashSet<String>());
|
if (!this.syncedNBTKeys.containsKey(target)) this.syncedNBTKeys.put(target, new HashSet<>());
|
||||||
|
|
||||||
this.syncedNBTKeys.get(target).add(key);
|
this.syncedNBTKeys.get(target).add(key);
|
||||||
}
|
}
|
||||||
@@ -298,7 +298,7 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private <T> Map<Integer, List<T>> getProviders(Object obj, LinkedHashMap<Class, ArrayList<T>> target) {
|
private <T> Map<Integer, List<T>> getProviders(Object obj, LinkedHashMap<Class, ArrayList<T>> target) {
|
||||||
Map<Integer, List<T>> returnList = new TreeMap<Integer, List<T>>();
|
Map<Integer, List<T>> returnList = new TreeMap<>();
|
||||||
Integer index = 0;
|
Integer index = 0;
|
||||||
|
|
||||||
for (Class clazz : target.keySet()) {
|
for (Class clazz : target.keySet()) {
|
||||||
@@ -311,14 +311,14 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private <T> Map<Integer, List<T>> getProviders(String name, LinkedHashMap<String, ArrayList<T>> target) {
|
private <T> Map<Integer, List<T>> getProviders(String name, LinkedHashMap<String, ArrayList<T>> target) {
|
||||||
Map<Integer, List<T>> returnList = new TreeMap<Integer, List<T>>();
|
Map<Integer, List<T>> returnList = new TreeMap<>();
|
||||||
returnList.put(0, target.get(name));
|
returnList.put(0, target.get(name));
|
||||||
return returnList;
|
return returnList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public HashSet<String> getSyncedNBTKeys(Object target) {
|
public HashSet<String> getSyncedNBTKeys(Object target) {
|
||||||
HashSet<String> returnList = new HashSet<String>();
|
HashSet<String> returnList = new HashSet<>();
|
||||||
for (Class clazz : this.syncedNBTKeys.keySet())
|
for (Class clazz : this.syncedNBTKeys.keySet())
|
||||||
if (clazz.isInstance(target)) returnList.addAll(this.syncedNBTKeys.get(clazz));
|
if (clazz.isInstance(target)) returnList.addAll(this.syncedNBTKeys.get(clazz));
|
||||||
|
|
||||||
@@ -407,24 +407,6 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------- */
|
/* ----------------- */
|
||||||
/*
|
|
||||||
* @Override public void registerDocTextFile(String filename) { List<String[]> docData = null; int nentries = 0;
|
|
||||||
* try{ docData = this.readFileAsString(filename); } catch (IOException e){ Waila.log.log(Level.WARN,
|
|
||||||
* String.format("Error while accessing file %s : %s", filename, e)); return; } for (String[] ss : docData){ String
|
|
||||||
* modid = ss[0]; String name = ss[1]; String meta = ss[2]; String desc = ss[5].replace('$', '\n'); if
|
|
||||||
* (!(desc.trim().equals(""))){ if (!this.wikiDescriptions.containsKey(modid)) this.wikiDescriptions.put(modid, new
|
|
||||||
* LinkedHashMap <String, LinkedHashMap <String, String>>()); if
|
|
||||||
* (!this.wikiDescriptions.get(modid).containsKey(name)) this.wikiDescriptions.get(modid).put(name, new
|
|
||||||
* LinkedHashMap<String, String>()); this.wikiDescriptions.get(modid).get(name).put(meta, desc);
|
|
||||||
* System.out.printf("Registered %s %s %s\n", modid, name, meta); nentries += 1; } } // String[] sections =
|
|
||||||
* docData.split(">>>>"); // for (String s : sections){ // s.trim(); // if (!s.equals("")){ // try{ // String name =
|
|
||||||
* s.split("\r?\n",2)[0].trim(); // String desc = s.split("\r?\n",2)[1].trim(); // if
|
|
||||||
* (!this.wikiDescriptions.containsKey(modid)) // this.wikiDescriptions.put(modid, new LinkedHashMap <String,
|
|
||||||
* String>()); // this.wikiDescriptions.get(modid).put(name, desc); // nentries += 1; // }catch (Exception e){ //
|
|
||||||
* System.out.printf("%s\n", e); // } // } // } Waila.log.log(Level.INFO,
|
|
||||||
* String.format("Registered %s entries from %s", nentries, filename)); }
|
|
||||||
*/
|
|
||||||
|
|
||||||
public boolean hasDocTextModID(String modid) {
|
public boolean hasDocTextModID(String modid) {
|
||||||
return this.wikiDescriptions.containsKey(modid);
|
return this.wikiDescriptions.containsKey(modid);
|
||||||
}
|
}
|
||||||
@@ -465,10 +447,6 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<String[]> readFileAsString(String filePath) throws IOException {
|
private List<String[]> readFileAsString(String filePath) throws IOException {
|
||||||
// URL fileURL = this.getClass().getResource(filePath);
|
|
||||||
// File filedata = new File(fileURL);
|
|
||||||
// Reader paramReader = new InputStreamReader(this.getClass().getResourceAsStream(filePath));
|
|
||||||
|
|
||||||
InputStream in = getClass().getResourceAsStream(filePath);
|
InputStream in = getClass().getResourceAsStream(filePath);
|
||||||
BufferedReader input = new BufferedReader(new InputStreamReader(in));
|
BufferedReader input = new BufferedReader(new InputStreamReader(in));
|
||||||
CSVReader reader = new CSVReader(input);
|
CSVReader reader = new CSVReader(input);
|
||||||
@@ -477,10 +455,5 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
|||||||
reader.close();
|
reader.close();
|
||||||
|
|
||||||
return myEntries;
|
return myEntries;
|
||||||
/*
|
|
||||||
* StringBuffer fileData = new StringBuffer(); //BufferedReader reader = new BufferedReader(paramReader); char[]
|
|
||||||
* buf = new char[1024]; int numRead=0; while((numRead=input.read(buf)) != -1){ String readData =
|
|
||||||
* String.valueOf(buf, 0, numRead); fileData.append(readData); } input.close(); return fileData.toString();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,18 +12,18 @@ import mcp.mobius.waila.api.ITaggedList;
|
|||||||
|
|
||||||
public class TipList<E, T> extends ArrayList<E> implements ITaggedList<E, T> {
|
public class TipList<E, T> extends ArrayList<E> implements ITaggedList<E, T> {
|
||||||
|
|
||||||
Map<E, Set<T>> tags = new HashMap();
|
Map<E, Set<T>> tags = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean add(E e, T tag) {
|
public boolean add(E e, T tag) {
|
||||||
if (!tags.containsKey(e)) tags.put(e, new HashSet<T>());
|
if (!tags.containsKey(e)) tags.put(e, new HashSet<>());
|
||||||
tags.get(e).add(tag);
|
tags.get(e).add(tag);
|
||||||
return super.add(e);
|
return super.add(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean add(E e, Collection<? extends T> taglst) {
|
public boolean add(E e, Collection<? extends T> taglst) {
|
||||||
if (!tags.containsKey(e)) tags.put(e, new HashSet<T>());
|
if (!tags.containsKey(e)) tags.put(e, new HashSet<>());
|
||||||
tags.get(e).addAll(taglst);
|
tags.get(e).addAll(taglst);
|
||||||
|
|
||||||
return super.add(e);
|
return super.add(e);
|
||||||
@@ -33,7 +33,7 @@ public class TipList<E, T> extends ArrayList<E> implements ITaggedList<E, T> {
|
|||||||
public Set<T> getTags(E e) {
|
public Set<T> getTags(E e) {
|
||||||
Set<T> ret = tags.get(e);
|
Set<T> ret = tags.get(e);
|
||||||
if (ret == null && this.contains(e)) {
|
if (ret == null && this.contains(e)) {
|
||||||
tags.put(e, new HashSet<T>());
|
tags.put(e, new HashSet<>());
|
||||||
ret = tags.get(e);
|
ret = tags.get(e);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -46,7 +46,7 @@ public class TipList<E, T> extends ArrayList<E> implements ITaggedList<E, T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addTag(E e, T tag) {
|
public void addTag(E e, T tag) {
|
||||||
if (this.contains(e) && !tags.containsKey(e)) tags.put(e, new HashSet<T>());
|
if (this.contains(e) && !tags.containsKey(e)) tags.put(e, new HashSet<>());
|
||||||
|
|
||||||
tags.get(e).add(tag);
|
tags.get(e).add(tag);
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ public class TipList<E, T> extends ArrayList<E> implements ITaggedList<E, T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeTag(E e, T tag) {
|
public void removeTag(E e, T tag) {
|
||||||
if (this.contains(e) && !tags.containsKey(e)) tags.put(e, new HashSet<T>());
|
if (this.contains(e) && !tags.containsKey(e)) tags.put(e, new HashSet<>());
|
||||||
|
|
||||||
tags.get(e).remove(tag);
|
tags.get(e).remove(tag);
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ public class TipList<E, T> extends ArrayList<E> implements ITaggedList<E, T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<E> getEntries(T tag) {
|
public Set<E> getEntries(T tag) {
|
||||||
Set<E> ret = new HashSet();
|
Set<E> ret = new HashSet<>();
|
||||||
for (Entry<E, Set<T>> s : tags.entrySet()) {
|
for (Entry<E, Set<T>> s : tags.entrySet()) {
|
||||||
if (s.getValue().contains(tag)) ret.add(s.getKey());
|
if (s.getValue().contains(tag)) ret.add(s.getKey());
|
||||||
}
|
}
|
||||||
@@ -84,12 +84,13 @@ public class TipList<E, T> extends ArrayList<E> implements ITaggedList<E, T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTagsAsString(E e) {
|
public String getTagsAsString(E e) {
|
||||||
String ret = "";
|
StringBuilder ret = new StringBuilder();
|
||||||
for (T s : tags.get(e)) ret += s.toString() + ",";
|
for (T s : tags.get(e)) ret.append(s.toString()).append(",");
|
||||||
|
|
||||||
if (ret.length() > 0) ret = ret.substring(0, ret.length() - 1);
|
// noinspection SizeReplaceableByIsEmpty
|
||||||
|
if (ret.length() > 0) ret = new StringBuilder(ret.substring(0, ret.length() - 1));
|
||||||
|
|
||||||
return ret;
|
return ret.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import java.io.BufferedReader;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.util.SortedSet;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.IResource;
|
import net.minecraft.client.resources.IResource;
|
||||||
@@ -37,16 +37,16 @@ public class LangUtil {
|
|||||||
public String translate(String s, Object... format) {
|
public String translate(String s, Object... format) {
|
||||||
if (prefix != null && !s.startsWith(prefix + ".")) s = prefix + "." + s;
|
if (prefix != null && !s.startsWith(prefix + ".")) s = prefix + "." + s;
|
||||||
String ret = LanguageRegistry.instance().getStringLocalization(s);
|
String ret = LanguageRegistry.instance().getStringLocalization(s);
|
||||||
if (ret.length() == 0) ret = LanguageRegistry.instance().getStringLocalization(s, "en_US");
|
if (ret.isEmpty()) ret = LanguageRegistry.instance().getStringLocalization(s, "en_US");
|
||||||
if (ret.length() == 0) ret = StatCollector.translateToLocal(s);
|
if (ret.isEmpty()) ret = StatCollector.translateToLocal(s);
|
||||||
if (ret.length() == 0) return s;
|
if (ret.isEmpty()) return s;
|
||||||
if (format.length > 0) ret = String.format(ret, format);
|
if (format.length > 0) ret = String.format(ret, format);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addLangFile(InputStream resource, String lang) throws IOException {
|
public void addLangFile(InputStream resource, String lang) throws IOException {
|
||||||
LanguageRegistry reg = LanguageRegistry.instance();
|
LanguageRegistry reg = LanguageRegistry.instance();
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(resource, "UTF-8"));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(resource, StandardCharsets.UTF_8));
|
||||||
while (true) {
|
while (true) {
|
||||||
String read = reader.readLine();
|
String read = reader.readLine();
|
||||||
if (read == null) break;
|
if (read == null) break;
|
||||||
@@ -68,7 +68,7 @@ public class LangUtil {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public LangUtil addLangDir(ResourceLocation dir) {
|
public LangUtil addLangDir(ResourceLocation dir) {
|
||||||
IResourceManager resManager = Minecraft.getMinecraft().getResourceManager();
|
IResourceManager resManager = Minecraft.getMinecraft().getResourceManager();
|
||||||
for (Language lang : (SortedSet<Language>) Minecraft.getMinecraft().getLanguageManager().getLanguages()) {
|
for (Language lang : Minecraft.getMinecraft().getLanguageManager().getLanguages()) {
|
||||||
String langID = lang.getLanguageCode();
|
String langID = lang.getLanguageCode();
|
||||||
IResource langRes;
|
IResource langRes;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ public class ProxyClient extends ProxyServer {
|
|||||||
|
|
||||||
TrueTypeFont minecraftiaFont;
|
TrueTypeFont minecraftiaFont;
|
||||||
|
|
||||||
// public static LangUtil lang = LangUtil.loadLangDir("waila");
|
|
||||||
|
|
||||||
public ProxyClient() {}
|
public ProxyClient() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -35,8 +33,6 @@ public class ProxyClient extends ProxyServer {
|
|||||||
|
|
||||||
LangUtil.loadLangDir("waila");
|
LangUtil.loadLangDir("waila");
|
||||||
|
|
||||||
// TickRegistry.registerTickHandler(WailaTickHandler.instance(), Side.CLIENT);
|
|
||||||
|
|
||||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||||
try {
|
try {
|
||||||
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler").getDeclaredMethod("register").invoke(null);
|
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler").getDeclaredMethod("register").invoke(null);
|
||||||
@@ -55,8 +51,6 @@ public class ProxyClient extends ProxyServer {
|
|||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerEntities(), Entity.class);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerEntities(), Entity.class);
|
||||||
ModuleRegistrar.instance().registerTailProvider(new HUDHandlerEntities(), Entity.class);
|
ModuleRegistrar.instance().registerTailProvider(new HUDHandlerEntities(), Entity.class);
|
||||||
|
|
||||||
// ModuleRegistrar.instance().registerShortDataProvider(new SummaryProviderDefault(), Item.class);
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfig("General", "general.showents");
|
ModuleRegistrar.instance().addConfig("General", "general.showents");
|
||||||
ModuleRegistrar.instance().addConfig("General", "general.showhp");
|
ModuleRegistrar.instance().addConfig("General", "general.showhp");
|
||||||
ModuleRegistrar.instance().addConfig("General", "general.showcrop");
|
ModuleRegistrar.instance().addConfig("General", "general.showcrop");
|
||||||
|
|||||||
@@ -15,83 +15,83 @@ public class CommandDumpHandlers extends CommandBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCommandUsage(ICommandSender p_71518_1_) {
|
public String getCommandUsage(ICommandSender sender) {
|
||||||
return "/dumphandlers";
|
return "/dumphandlers";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
|
public void processCommand(ICommandSender sender, String[] args) {
|
||||||
|
|
||||||
System.out.printf("\n\n== HEAD BLOCK PROVIDERS ==\n");
|
System.out.print("\n\n== HEAD BLOCK PROVIDERS ==\n");
|
||||||
for (Class clazz : ModuleRegistrar.instance().headBlockProviders.keySet()) {
|
for (Class<?> clazz : ModuleRegistrar.instance().headBlockProviders.keySet()) {
|
||||||
System.out.printf("+ %s +\n", clazz.getName());
|
System.out.printf("+ %s +\n", clazz.getName());
|
||||||
for (IWailaDataProvider provider : ModuleRegistrar.instance().headBlockProviders.get(clazz)) {
|
for (IWailaDataProvider provider : ModuleRegistrar.instance().headBlockProviders.get(clazz)) {
|
||||||
System.out.printf(" - %s\n", provider.getClass().getName());
|
System.out.printf(" - %s\n", provider.getClass().getName());
|
||||||
}
|
}
|
||||||
System.out.printf("\n");
|
System.out.print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.printf("\n\n== BODY BLOCK PROVIDERS ==\n");
|
System.out.print("\n\n== BODY BLOCK PROVIDERS ==\n");
|
||||||
for (Class clazz : ModuleRegistrar.instance().bodyBlockProviders.keySet()) {
|
for (Class<?> clazz : ModuleRegistrar.instance().bodyBlockProviders.keySet()) {
|
||||||
System.out.printf("+ %s +\n", clazz.getName());
|
System.out.printf("+ %s +\n", clazz.getName());
|
||||||
for (IWailaDataProvider provider : ModuleRegistrar.instance().bodyBlockProviders.get(clazz)) {
|
for (IWailaDataProvider provider : ModuleRegistrar.instance().bodyBlockProviders.get(clazz)) {
|
||||||
System.out.printf(" - %s\n", provider.getClass().getName());
|
System.out.printf(" - %s\n", provider.getClass().getName());
|
||||||
}
|
}
|
||||||
System.out.printf("\n");
|
System.out.print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.printf("\n\n== TAIL BLOCK PROVIDERS ==\n");
|
System.out.print("\n\n== TAIL BLOCK PROVIDERS ==\n");
|
||||||
for (Class clazz : ModuleRegistrar.instance().tailBlockProviders.keySet()) {
|
for (Class<?> clazz : ModuleRegistrar.instance().tailBlockProviders.keySet()) {
|
||||||
System.out.printf("+ %s +\n", clazz.getName());
|
System.out.printf("+ %s +\n", clazz.getName());
|
||||||
for (IWailaDataProvider provider : ModuleRegistrar.instance().tailBlockProviders.get(clazz)) {
|
for (IWailaDataProvider provider : ModuleRegistrar.instance().tailBlockProviders.get(clazz)) {
|
||||||
System.out.printf(" - %s\n", provider.getClass().getName());
|
System.out.printf(" - %s\n", provider.getClass().getName());
|
||||||
}
|
}
|
||||||
System.out.printf("\n");
|
System.out.print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.printf("\n\n== STACK BLOCK PROVIDERS ==\n");
|
System.out.print("\n\n== STACK BLOCK PROVIDERS ==\n");
|
||||||
for (Class clazz : ModuleRegistrar.instance().stackBlockProviders.keySet()) {
|
for (Class<?> clazz : ModuleRegistrar.instance().stackBlockProviders.keySet()) {
|
||||||
System.out.printf("+ %s +\n", clazz.getName());
|
System.out.printf("+ %s +\n", clazz.getName());
|
||||||
for (IWailaDataProvider provider : ModuleRegistrar.instance().stackBlockProviders.get(clazz)) {
|
for (IWailaDataProvider provider : ModuleRegistrar.instance().stackBlockProviders.get(clazz)) {
|
||||||
System.out.printf(" - %s\n", provider.getClass().getName());
|
System.out.printf(" - %s\n", provider.getClass().getName());
|
||||||
}
|
}
|
||||||
System.out.printf("\n");
|
System.out.print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.printf("\n\n== HEAD ENTITY PROVIDERS ==\n");
|
System.out.print("\n\n== HEAD ENTITY PROVIDERS ==\n");
|
||||||
for (Class clazz : ModuleRegistrar.instance().headEntityProviders.keySet()) {
|
for (Class<?> clazz : ModuleRegistrar.instance().headEntityProviders.keySet()) {
|
||||||
System.out.printf("+ %s +\n", clazz.getName());
|
System.out.printf("+ %s +\n", clazz.getName());
|
||||||
for (IWailaEntityProvider provider : ModuleRegistrar.instance().headEntityProviders.get(clazz)) {
|
for (IWailaEntityProvider provider : ModuleRegistrar.instance().headEntityProviders.get(clazz)) {
|
||||||
System.out.printf(" - %s\n", provider.getClass().getName());
|
System.out.printf(" - %s\n", provider.getClass().getName());
|
||||||
}
|
}
|
||||||
System.out.printf("\n");
|
System.out.print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.printf("\n\n== BODY ENTITY PROVIDERS ==\n");
|
System.out.print("\n\n== BODY ENTITY PROVIDERS ==\n");
|
||||||
for (Class clazz : ModuleRegistrar.instance().bodyEntityProviders.keySet()) {
|
for (Class<?> clazz : ModuleRegistrar.instance().bodyEntityProviders.keySet()) {
|
||||||
System.out.printf("+ %s +\n", clazz.getName());
|
System.out.printf("+ %s +\n", clazz.getName());
|
||||||
for (IWailaEntityProvider provider : ModuleRegistrar.instance().bodyEntityProviders.get(clazz)) {
|
for (IWailaEntityProvider provider : ModuleRegistrar.instance().bodyEntityProviders.get(clazz)) {
|
||||||
System.out.printf(" - %s\n", provider.getClass().getName());
|
System.out.printf(" - %s\n", provider.getClass().getName());
|
||||||
}
|
}
|
||||||
System.out.printf("\n");
|
System.out.print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.printf("\n\n== TAIL ENTITY PROVIDERS ==\n");
|
System.out.print("\n\n== TAIL ENTITY PROVIDERS ==\n");
|
||||||
for (Class clazz : ModuleRegistrar.instance().tailEntityProviders.keySet()) {
|
for (Class<?> clazz : ModuleRegistrar.instance().tailEntityProviders.keySet()) {
|
||||||
System.out.printf("+ %s +\n", clazz.getName());
|
System.out.printf("+ %s +\n", clazz.getName());
|
||||||
for (IWailaEntityProvider provider : ModuleRegistrar.instance().tailEntityProviders.get(clazz)) {
|
for (IWailaEntityProvider provider : ModuleRegistrar.instance().tailEntityProviders.get(clazz)) {
|
||||||
System.out.printf(" - %s\n", provider.getClass().getName());
|
System.out.printf(" - %s\n", provider.getClass().getName());
|
||||||
}
|
}
|
||||||
System.out.printf("\n");
|
System.out.print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.printf("\n\n== STACK ENTITY PROVIDERS ==\n");
|
System.out.print("\n\n== STACK ENTITY PROVIDERS ==\n");
|
||||||
for (Class clazz : ModuleRegistrar.instance().overrideEntityProviders.keySet()) {
|
for (Class<?> clazz : ModuleRegistrar.instance().overrideEntityProviders.keySet()) {
|
||||||
System.out.printf("+ %s +\n", clazz.getName());
|
System.out.printf("+ %s +\n", clazz.getName());
|
||||||
for (IWailaEntityProvider provider : ModuleRegistrar.instance().overrideEntityProviders.get(clazz)) {
|
for (IWailaEntityProvider provider : ModuleRegistrar.instance().overrideEntityProviders.get(clazz)) {
|
||||||
System.out.printf(" - %s\n", provider.getClass().getName());
|
System.out.printf(" - %s\n", provider.getClass().getName());
|
||||||
}
|
}
|
||||||
System.out.printf("\n");
|
System.out.print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -103,8 +103,6 @@ public class CommandDumpHandlers extends CommandBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canCommandSenderUseCommand(ICommandSender sender) {
|
public boolean canCommandSenderUseCommand(ICommandSender sender) {
|
||||||
// if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager
|
|
||||||
// instanceof MemoryConnection) return true;
|
|
||||||
return super.canCommandSenderUseCommand(sender);
|
return super.canCommandSenderUseCommand(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class MouseEvent {
|
|||||||
WHEEL,
|
WHEEL,
|
||||||
ENTER,
|
ENTER,
|
||||||
LEAVE
|
LEAVE
|
||||||
};
|
}
|
||||||
|
|
||||||
public long timestamp;
|
public long timestamp;
|
||||||
public Minecraft mc;
|
public Minecraft mc;
|
||||||
@@ -41,12 +41,6 @@ public class MouseEvent {
|
|||||||
- (double) Mouse.getEventY() * (double) this.srcwidget.getSize().getY() / (double) this.mc.displayHeight
|
- (double) Mouse.getEventY() * (double) this.srcwidget.getSize().getY() / (double) this.mc.displayHeight
|
||||||
- 1.0;
|
- 1.0;
|
||||||
|
|
||||||
// this.x = Mouse.getEventX();
|
|
||||||
// this.y = Mouse.getEventY();
|
|
||||||
|
|
||||||
// System.out.printf("%s %s\n", this.x, this.y);
|
|
||||||
|
|
||||||
// this.z = Mouse.getEventDWheel();
|
|
||||||
this.z = Mouse.getDWheel();
|
this.z = Mouse.getDWheel();
|
||||||
|
|
||||||
for (int i = 0; i < buttonCount; i++) buttonState[i] = Mouse.isButtonDown(i);
|
for (int i = 0; i < buttonCount; i++) buttonState[i] = Mouse.isButtonDown(i);
|
||||||
@@ -55,16 +49,22 @@ public class MouseEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String retstring = String
|
StringBuilder retstring = new StringBuilder(
|
||||||
.format("MOUSE %s : [%s] [ %.2f %.2f %d ] [", this.type, this.timestamp, this.x, this.y, this.z);
|
String.format(
|
||||||
if (this.buttonCount < 5)
|
"MOUSE %s : [%s] [ %.2f %.2f %d ] [",
|
||||||
for (int i = 0; i < this.buttonCount; i++) retstring += String.format(" %s ", this.buttonState[i]);
|
this.type,
|
||||||
else for (int i = 0; i < 5; i++) retstring += String.format(" %s ", this.buttonState[i]);
|
this.timestamp,
|
||||||
retstring += "]";
|
this.x,
|
||||||
|
this.y,
|
||||||
|
this.z));
|
||||||
|
if (buttonCount < 5)
|
||||||
|
for (int i = 0; i < buttonCount; i++) retstring.append(String.format(" %s ", this.buttonState[i]));
|
||||||
|
else for (int i = 0; i < 5; i++) retstring.append(String.format(" %s ", this.buttonState[i]));
|
||||||
|
retstring.append("]");
|
||||||
|
|
||||||
if (this.button != -1) retstring += String.format(" Button %s", this.button);
|
if (this.button != -1) retstring.append(String.format(" Button %s", this.button));
|
||||||
|
|
||||||
return retstring;
|
return retstring.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the event type based on the previous mouse event.
|
// Returns the event type based on the previous mouse event.
|
||||||
@@ -82,9 +82,9 @@ public class MouseEvent {
|
|||||||
return this.type;
|
return this.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < this.buttonCount; i++) {
|
for (int i = 0; i < buttonCount; i++) {
|
||||||
if (this.buttonState[i] != me.buttonState[i]) {
|
if (this.buttonState[i] != me.buttonState[i]) {
|
||||||
if (this.buttonState[i] == true) this.type = EventType.CLICK;
|
if (this.buttonState[i]) this.type = EventType.CLICK;
|
||||||
else this.type = EventType.RELEASED;
|
else this.type = EventType.RELEASED;
|
||||||
this.button = i;
|
this.button = i;
|
||||||
return this.type;
|
return this.type;
|
||||||
@@ -93,7 +93,7 @@ public class MouseEvent {
|
|||||||
|
|
||||||
// MOVE & DRAG EVENTS (we moved the mouse and button 0 was clicked or not)
|
// MOVE & DRAG EVENTS (we moved the mouse and button 0 was clicked or not)
|
||||||
if ((this.x != me.x) || (this.y != me.y)) {
|
if ((this.x != me.x) || (this.y != me.y)) {
|
||||||
if (this.buttonState[0] == true) this.type = EventType.DRAG;
|
if (this.buttonState[0]) this.type = EventType.DRAG;
|
||||||
else this.type = EventType.MOVE;
|
else this.type = EventType.MOVE;
|
||||||
return this.type;
|
return this.type;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,15 +9,15 @@ import com.google.common.collect.Lists;
|
|||||||
|
|
||||||
public class ReverseIterator<T> implements Iterable<T> {
|
public class ReverseIterator<T> implements Iterable<T> {
|
||||||
|
|
||||||
private ListIterator<T> listIterator;
|
private final ListIterator<T> listIterator;
|
||||||
|
|
||||||
public ReverseIterator(Collection<T> wrappedList) {
|
public ReverseIterator(Collection<T> wrappedList) {
|
||||||
List list = Lists.newArrayList(wrappedList);
|
List<T> list = Lists.newArrayList(wrappedList);
|
||||||
this.listIterator = list.listIterator(wrappedList.size());
|
this.listIterator = list.listIterator(wrappedList.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Iterator<T> iterator() {
|
public Iterator<T> iterator() {
|
||||||
return new Iterator<T>() {
|
return new Iterator<>() {
|
||||||
|
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return listIterator.hasPrevious();
|
return listIterator.hasPrevious();
|
||||||
|
|||||||
@@ -21,25 +21,10 @@ public class UIHelper {
|
|||||||
|
|
||||||
Tessellator tess = Tessellator.instance;
|
Tessellator tess = Tessellator.instance;
|
||||||
tess.startDrawingQuads();
|
tess.startDrawingQuads();
|
||||||
tess.addVertexWithUV(
|
tess.addVertexWithUV(posX, posY + sizeY, zLevel, texU * f, (texV + texSizeV) * f);
|
||||||
(double) (posX + 0),
|
tess.addVertexWithUV(posX + sizeX, posY + sizeY, zLevel, (texU + texSizeU) * f, (texV + texSizeV) * f);
|
||||||
(double) (posY + sizeY),
|
tess.addVertexWithUV(posX + sizeX, posY, zLevel, (texU + texSizeU) * f, texV * f);
|
||||||
(double) zLevel,
|
tess.addVertexWithUV(posX, posY, zLevel, texU * f, texV * f);
|
||||||
texU * f,
|
|
||||||
(texV + texSizeV) * f);
|
|
||||||
tess.addVertexWithUV(
|
|
||||||
(double) (posX + sizeX),
|
|
||||||
(double) (posY + sizeY),
|
|
||||||
(double) zLevel,
|
|
||||||
(texU + texSizeU) * f,
|
|
||||||
(texV + texSizeV) * f);
|
|
||||||
tess.addVertexWithUV(
|
|
||||||
(double) (posX + sizeX),
|
|
||||||
(double) (posY + 0),
|
|
||||||
(double) zLevel,
|
|
||||||
(texU + texSizeU) * f,
|
|
||||||
texV * f);
|
|
||||||
tess.addVertexWithUV((double) (posX + 0), (double) (posY + 0), (double) zLevel, texU * f, texV * f);
|
|
||||||
tess.draw();
|
tess.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,11 +45,11 @@ public class UIHelper {
|
|||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setColorRGBA_F(red1, green1, blue1, alpha1);
|
tessellator.setColorRGBA_F(red1, green1, blue1, alpha1);
|
||||||
tessellator.addVertex((double) maxx, (double) miny, (double) zlevel);
|
tessellator.addVertex(maxx, miny, zlevel);
|
||||||
tessellator.addVertex((double) minx, (double) miny, (double) zlevel);
|
tessellator.addVertex(minx, miny, zlevel);
|
||||||
tessellator.setColorRGBA_F(red2, green2, blue2, alpha2);
|
tessellator.setColorRGBA_F(red2, green2, blue2, alpha2);
|
||||||
tessellator.addVertex((double) minx, (double) maxy, (double) zlevel);
|
tessellator.addVertex(minx, maxy, zlevel);
|
||||||
tessellator.addVertex((double) maxx, (double) maxy, (double) zlevel);
|
tessellator.addVertex(maxx, maxy, zlevel);
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
GL11.glShadeModel(GL11.GL_FLAT);
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
@@ -123,7 +108,6 @@ public class UIHelper {
|
|||||||
public static void drawBillboard(float posX, float posY, float posZ, float offX, float offY, float offZ, float rotX,
|
public static void drawBillboard(float posX, float posY, float posZ, float offX, float offY, float offZ, float rotX,
|
||||||
float rotY, float rotZ, double x1, double y1, double x2, double y2, int r, int g, int b, int a) {
|
float rotY, float rotZ, double x1, double y1, double x2, double y2, int r, int g, int b, int a) {
|
||||||
float f = 1.6F;
|
float f = 1.6F;
|
||||||
float f1 = 0.016666668F * f;
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
GL11.glTranslatef(posX + offX, posY + offY, posZ + offZ);
|
GL11.glTranslatef(posX + offX, posY + offY, posZ + offZ);
|
||||||
@@ -133,14 +117,12 @@ public class UIHelper {
|
|||||||
GL11.glRotatef(rotX, 1.0F, 0.0F, 0.0F);
|
GL11.glRotatef(rotX, 1.0F, 0.0F, 0.0F);
|
||||||
GL11.glRotatef(rotZ, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(rotZ, 0.0F, 0.0F, 1.0F);
|
||||||
|
|
||||||
// GL11.glScalef(-f1, -f1, f1);
|
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
// GL11.glDisable(GL11.GL_TEXTURE_2D);
|
|
||||||
drawRectangle(x1, y1, 0, x2, y2, 0, r, g, b, a);
|
drawRectangle(x1, y1, 0, x2, y2, 0, r, g, b, a);
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
@@ -196,16 +178,12 @@ public class UIHelper {
|
|||||||
float f1 = 0.016666668F * f;
|
float f1 = 0.016666668F * f;
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
// GL11.glTranslatef((float)accessor.getPosition().blockX + 0.0F, (float)accessor.getPosition().blockY + 0.5F,
|
|
||||||
// (float)accessor.getPosition().blockZ);
|
|
||||||
GL11.glTranslatef(posX + offX, posY + offY, posZ + offZ);
|
GL11.glTranslatef(posX + offX, posY + offY, posZ + offZ);
|
||||||
|
|
||||||
// GL11.glTranslatef(posX, posY, posZ);
|
|
||||||
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
|
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
|
||||||
GL11.glRotatef(rotY, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(rotY, 0.0F, 1.0F, 0.0F);
|
||||||
GL11.glRotatef(rotX, 1.0F, 0.0F, 0.0F);
|
GL11.glRotatef(rotX, 1.0F, 0.0F, 0.0F);
|
||||||
GL11.glRotatef(rotZ, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(rotZ, 0.0F, 0.0F, 1.0F);
|
||||||
// GL11.glTranslatef(offX, offY, offZ);
|
|
||||||
|
|
||||||
GL11.glScalef(-f1, -f1, f1);
|
GL11.glScalef(-f1, -f1, f1);
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
@@ -217,26 +195,14 @@ public class UIHelper {
|
|||||||
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
int j = fontrenderer.getStringWidth(text) / 2;
|
int j = fontrenderer.getStringWidth(text) / 2;
|
||||||
drawRectangle(
|
drawRectangle(-j - 1, 8 + b0, 0.0, j + 1, -1 + b0, 0.0, 0, 0, 0, 64);
|
||||||
(double) (-j - 1),
|
|
||||||
(double) (8 + b0),
|
|
||||||
0.0,
|
|
||||||
(double) (j + 1),
|
|
||||||
(double) (-1 + b0),
|
|
||||||
0.0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
64);
|
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, 553648127);
|
fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, 553648127);
|
||||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, -1);
|
fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, -1);
|
||||||
// GL11.glEnable(GL11.GL_LIGHTING);
|
|
||||||
// GL11.glDisable(GL11.GL_BLEND);
|
|
||||||
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ public enum CType {
|
|||||||
REL_X,
|
REL_X,
|
||||||
REL_Y,
|
REL_Y,
|
||||||
RELXY,
|
RELXY,
|
||||||
ABSXY;
|
ABSXY
|
||||||
}
|
}
|
||||||
@@ -84,9 +84,4 @@ public interface IWidget {
|
|||||||
void emit(Signal signal, Object... params);
|
void emit(Signal signal, Object... params);
|
||||||
|
|
||||||
void onWidgetEvent(IWidget srcwidget, Signal signal, Object... params);
|
void onWidgetEvent(IWidget srcwidget, Signal signal, Object... params);
|
||||||
|
|
||||||
// boolean onMouseEnter();
|
|
||||||
// boolean onMouseMoved();
|
|
||||||
// boolean onMouseLeave();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,5 +3,5 @@ package mcp.mobius.waila.gui.interfaces;
|
|||||||
public enum RenderPriority {
|
public enum RenderPriority {
|
||||||
LOW,
|
LOW,
|
||||||
MEDIUM,
|
MEDIUM,
|
||||||
HIGH;
|
HIGH
|
||||||
}
|
}
|
||||||
@@ -4,5 +4,5 @@ public enum Signal {
|
|||||||
DRAGGED,
|
DRAGGED,
|
||||||
CLICKED,
|
CLICKED,
|
||||||
VALUE_CHANGED,
|
VALUE_CHANGED,
|
||||||
GEOM_CHANGED;
|
GEOM_CHANGED
|
||||||
}
|
}
|
||||||
@@ -5,5 +5,5 @@ public enum WAlign {
|
|||||||
CENTER,
|
CENTER,
|
||||||
RIGHT,
|
RIGHT,
|
||||||
TOP,
|
TOP,
|
||||||
BOTTOM;
|
BOTTOM
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ public abstract class ScreenBase extends GuiScreen {
|
|||||||
public ScreenBase(GuiScreen parent) {
|
public ScreenBase(GuiScreen parent) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.mc = Minecraft.getMinecraft();
|
this.mc = Minecraft.getMinecraft();
|
||||||
this.widgets = new HashMap<String, IWidget>();
|
this.widgets = new HashMap<>();
|
||||||
|
|
||||||
this.addWidget("canvas", new LayoutCanvas());
|
this.addWidget("canvas", new LayoutCanvas());
|
||||||
|
|
||||||
@@ -41,9 +41,7 @@ public abstract class ScreenBase extends GuiScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IWidget delWidget(String name) {
|
public IWidget delWidget(String name) {
|
||||||
IWidget widget = this.getWidget(name);
|
return this.widgets.remove(name);
|
||||||
this.widgets.remove(widget);
|
|
||||||
return widget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IWidget getRoot() {
|
public IWidget getRoot() {
|
||||||
@@ -75,7 +73,7 @@ public abstract class ScreenBase extends GuiScreen {
|
|||||||
@Override
|
@Override
|
||||||
public void keyTyped(char keyChar, int keyID) {
|
public void keyTyped(char keyChar, int keyID) {
|
||||||
if (keyID == 1) if (this.parent == null) {
|
if (keyID == 1) if (this.parent == null) {
|
||||||
this.mc.displayGuiScreen((GuiScreen) null);
|
this.mc.displayGuiScreen(null);
|
||||||
this.mc.setIngameFocus();
|
this.mc.setIngameFocus();
|
||||||
} else this.mc.displayGuiScreen(this.parent);
|
} else this.mc.displayGuiScreen(this.parent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import mcp.mobius.waila.utils.Constants;
|
|||||||
|
|
||||||
public class ScreenHUDConfig extends ScreenBase {
|
public class ScreenHUDConfig extends ScreenBase {
|
||||||
|
|
||||||
private class EventCanvas extends LayoutBase {
|
private static class EventCanvas extends LayoutBase {
|
||||||
|
|
||||||
IWidget draggedWidget = null;
|
IWidget draggedWidget = null;
|
||||||
|
|
||||||
@@ -33,28 +33,6 @@ public class ScreenHUDConfig extends ScreenBase {
|
|||||||
super(parent);
|
super(parent);
|
||||||
this.setGeometry(new WidgetGeometry(0.0, 0.0, 100.0, 100.0, CType.RELXY, CType.RELXY));
|
this.setGeometry(new WidgetGeometry(0.0, 0.0, 100.0, 100.0, CType.RELXY, CType.RELXY));
|
||||||
|
|
||||||
/*
|
|
||||||
* IWidget layoutX = this.addWidget("LayoutX", new LayoutBase(this)); layoutX.setGeometry(new
|
|
||||||
* WidgetGeometry(40.0,50.0,20,60, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
|
||||||
* layoutX.addWidget("ButtonXAdd", new ButtonLabel(null, "+")).setGeometry(new WidgetGeometry(0.0,
|
|
||||||
* 0.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP)); layoutX.addWidget("ButtonXSub", new
|
|
||||||
* ButtonLabel(null, "-")).setGeometry(new WidgetGeometry(0.0,100.0,20,20, CType.RELXY, CType.ABSXY,
|
|
||||||
* WAlign.LEFT, WAlign.BOTTOM)); layoutX.addWidget("ValueDisplayX", new LabelFixedFont(null,
|
|
||||||
* "0")).setGeometry(new WidgetGeometry(50.0,50.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER,
|
|
||||||
* WAlign.CENTER));
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* IWidget layoutY = this.addWidget("LayoutY", new LayoutBase(this)); layoutY.setGeometry(new
|
|
||||||
* WidgetGeometry(50.0,50.0,20,60,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
|
||||||
* layoutY.addWidget("ButtonYAdd", new ButtonLabel(null, "+")).setGeometry(new WidgetGeometry(0.0,
|
|
||||||
* 0.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP)); layoutY.addWidget("ButtonYSub", new
|
|
||||||
* ButtonLabel(null, "-")).setGeometry(new WidgetGeometry(0.0,100.0,20,20, CType.RELXY, CType.ABSXY,
|
|
||||||
* WAlign.LEFT, WAlign.BOTTOM)); layoutY.addWidget("ValueDisplayY", new LabelFixedFont(null,
|
|
||||||
* "0")).setGeometry(new WidgetGeometry(50.0,50.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER,
|
|
||||||
* WAlign.CENTER));
|
|
||||||
*/
|
|
||||||
|
|
||||||
double picX = ConfigHandler.instance()
|
double picX = ConfigHandler.instance()
|
||||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX, 0) / 100.0;
|
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX, 0) / 100.0;
|
||||||
double picY = ConfigHandler.instance()
|
double picY = ConfigHandler.instance()
|
||||||
@@ -81,7 +59,7 @@ public class ScreenHUDConfig extends ScreenBase {
|
|||||||
WAlign.CENTER));
|
WAlign.CENTER));
|
||||||
|
|
||||||
this.addWidget("TextTuto1", new LabelFixedFont(null, "screen.label.dragtuto")).setGeometry(
|
this.addWidget("TextTuto1", new LabelFixedFont(null, "screen.label.dragtuto")).setGeometry(
|
||||||
new WidgetGeometry(50.0, 30.0, 20, 20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));;
|
new WidgetGeometry(50.0, 30.0, 20, 20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||||
|
|
||||||
IWidget layoutX = this.addWidget("LayoutX", new LayoutBase(this));
|
IWidget layoutX = this.addWidget("LayoutX", new LayoutBase(this));
|
||||||
layoutX.setGeometry(
|
layoutX.setGeometry(
|
||||||
@@ -169,8 +147,6 @@ public class ScreenHUDConfig extends ScreenBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseClick(MouseEvent event) {
|
public void onMouseClick(MouseEvent event) {
|
||||||
// System.out.println(this.getWidgetAtCoordinates(event.x, event.y));
|
|
||||||
|
|
||||||
if ((event.button == 0)
|
if ((event.button == 0)
|
||||||
&& (this.getWidget("Layout").getWidget("Picture").isWidgetAtCoordinates(event.x, event.y))) {
|
&& (this.getWidget("Layout").getWidget("Picture").isWidgetAtCoordinates(event.x, event.y))) {
|
||||||
this.getWidget("Layout").getWidget("Picture").onMouseClick(event);
|
this.getWidget("Layout").getWidget("Picture").onMouseClick(event);
|
||||||
@@ -180,8 +156,6 @@ public class ScreenHUDConfig extends ScreenBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseDrag(MouseEvent event) {
|
public void onMouseDrag(MouseEvent event) {
|
||||||
|
|
||||||
// if ((this.getWidgetAtCoordinates(event.x, event.y) == this) && (this.draggedWidget != null)){
|
|
||||||
if (this.draggedWidget != null) {
|
if (this.draggedWidget != null) {
|
||||||
this.draggedWidget.onMouseDrag(event);
|
this.draggedWidget.onMouseDrag(event);
|
||||||
} else {
|
} else {
|
||||||
@@ -276,7 +250,6 @@ public class ScreenHUDConfig extends ScreenBase {
|
|||||||
((LayoutMargin) this.getWidget("Layout")).setMargins(picSX / 2, picSX / 2, picSY / 2, picSY / 2);
|
((LayoutMargin) this.getWidget("Layout")).setMargins(picSX / 2, picSX / 2, picSY / 2, picSY / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// picture.emit(Signal.DRAGGED, picture.getPos());
|
|
||||||
this.updateData();
|
this.updateData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,20 +16,16 @@ import mcp.mobius.waila.utils.Constants;
|
|||||||
|
|
||||||
public class ScreenModuleConfig extends ScreenBase {
|
public class ScreenModuleConfig extends ScreenBase {
|
||||||
|
|
||||||
private String modName;
|
|
||||||
|
|
||||||
public ScreenModuleConfig(GuiScreen parent, String modname) {
|
public ScreenModuleConfig(GuiScreen parent, String modname) {
|
||||||
super(parent);
|
super(parent);
|
||||||
|
|
||||||
this.modName = modname;
|
|
||||||
|
|
||||||
this.getRoot().addWidget("ButtonContainer", new ButtonContainerLabel(this.getRoot(), 2, 100, 25.0));
|
this.getRoot().addWidget("ButtonContainer", new ButtonContainerLabel(this.getRoot(), 2, 100, 25.0));
|
||||||
this.getRoot().getWidget("ButtonContainer").setGeometry(
|
this.getRoot().getWidget("ButtonContainer").setGeometry(
|
||||||
new WidgetGeometry(0.0, 20.0, 100.0, 60.0, CType.RELXY, CType.RELXY, WAlign.LEFT, WAlign.TOP));
|
new WidgetGeometry(0.0, 20.0, 100.0, 60.0, CType.RELXY, CType.RELXY, WAlign.LEFT, WAlign.TOP));
|
||||||
|
|
||||||
ButtonContainerLabel buttonContainer = ((ButtonContainerLabel) this.getRoot().getWidget("ButtonContainer"));
|
ButtonContainerLabel buttonContainer = ((ButtonContainerLabel) this.getRoot().getWidget("ButtonContainer"));
|
||||||
|
|
||||||
for (String key : ConfigHandler.instance().getConfigKeys(this.modName).keySet()) {
|
for (String key : ConfigHandler.instance().getConfigKeys(modname).keySet()) {
|
||||||
if (ConfigHandler.instance().isServerRequired(key)) buttonContainer.addButton(
|
if (ConfigHandler.instance().isServerRequired(key)) buttonContainer.addButton(
|
||||||
new ButtonBooleanConfigRemote(
|
new ButtonBooleanConfigRemote(
|
||||||
this.getRoot(),
|
this.getRoot(),
|
||||||
@@ -37,7 +33,7 @@ public class ScreenModuleConfig extends ScreenBase {
|
|||||||
key,
|
key,
|
||||||
"screen.button.no",
|
"screen.button.no",
|
||||||
"screen.button.yes"),
|
"screen.button.yes"),
|
||||||
ConfigHandler.instance().getConfigKeys(this.modName).get(key));
|
ConfigHandler.instance().getConfigKeys(modname).get(key));
|
||||||
else buttonContainer.addButton(
|
else buttonContainer.addButton(
|
||||||
new ButtonBooleanConfig(
|
new ButtonBooleanConfig(
|
||||||
this.getRoot(),
|
this.getRoot(),
|
||||||
@@ -45,12 +41,7 @@ public class ScreenModuleConfig extends ScreenBase {
|
|||||||
key,
|
key,
|
||||||
"screen.button.no",
|
"screen.button.no",
|
||||||
"screen.button.yes"),
|
"screen.button.yes"),
|
||||||
ConfigHandler.instance().getConfigKeys(this.modName).get(key));
|
ConfigHandler.instance().getConfigKeys(modname).get(key));
|
||||||
// buttonContainer.addButton(new ButtonConfigRemote(-1, "No", "Yes",
|
|
||||||
// ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
|
|
||||||
// else
|
|
||||||
// buttonContainer.addButton(new ButtonConfigOption(-1, "No", "Yes",
|
|
||||||
// ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
|
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ public class ScreenEnchants extends ScreenBase {
|
|||||||
new WidgetGeometry(50.0, 50.0, 90.0, 80.0, CType.REL_X, CType.RELXY, WAlign.CENTER, WAlign.TOP));
|
new WidgetGeometry(50.0, 50.0, 90.0, 80.0, CType.REL_X, CType.RELXY, WAlign.CENTER, WAlign.TOP));
|
||||||
|
|
||||||
String columnName = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.name");
|
String columnName = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.name");
|
||||||
String columnMinLvl = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.minlvl");;
|
String columnMinLvl = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.minlvl");
|
||||||
String columnMaxLvl = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.maxlvl");;
|
String columnMaxLvl = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.maxlvl");
|
||||||
String columnWeight = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.weight");;
|
String columnWeight = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.weight");
|
||||||
|
|
||||||
((ViewTable) this.getRoot().getWidget("Table"))
|
((ViewTable) this.getRoot().getWidget("Table"))
|
||||||
.setColumnsTitle(columnName, columnMinLvl, columnMaxLvl, columnWeight, "\u00a7a\u00a7oMod")
|
.setColumnsTitle(columnName, columnMinLvl, columnMaxLvl, columnWeight, "\u00a7a\u00a7oMod")
|
||||||
@@ -80,9 +80,4 @@ public class ScreenEnchants extends ScreenBase {
|
|||||||
this.getRoot().getWidget("Layout_Title").adjustSize();
|
this.getRoot().getWidget("Layout_Title").adjustSize();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* public ScreenEnchants setStack(ItemStack stack){
|
|
||||||
* ((ItemStackDisplay)this.getRoot().getWidget("ItemStack")).setStack(stack); return this; }
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
@@ -21,23 +21,5 @@ public class ScreenTest extends ScreenBase {
|
|||||||
.addRow("test1", "test2", "test3").addRow("test1", "test2", "test3").addRow("test1", "test2", "test3")
|
.addRow("test1", "test2", "test3").addRow("test1", "test2", "test3").addRow("test1", "test2", "test3")
|
||||||
.addRow("test1", "test2", "test3").addRow("test1", "test2", "test3").addRow("test1", "test2", "test3")
|
.addRow("test1", "test2", "test3").addRow("test1", "test2", "test3").addRow("test1", "test2", "test3")
|
||||||
.addRow("test1", "test2", "test3");
|
.addRow("test1", "test2", "test3");
|
||||||
|
|
||||||
/*
|
|
||||||
* this.getRoot().addWidget("Test", new Row(null)).setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 20.0,
|
|
||||||
* CType.RELXY, CType.REL_X, WAlign.CENTER, WAlign.CENTER));
|
|
||||||
* ((Row)this.getRoot().getWidget("Test")).setColumnsText("aabbbbbbbbbbbbbbbbbbbbbbbbb","bb","cc");
|
|
||||||
* ((Row)this.getRoot().getWidget("Test")).setColumnsWidth(30.0,30.0,30.0);
|
|
||||||
* ((Row)this.getRoot().getWidget("Test")).setColumnsAlign(WAlign.LEFT, WAlign.CENTER, WAlign.CENTER);
|
|
||||||
*/
|
|
||||||
|
|
||||||
// this.getRoot().addWidget("TestLayout", new LayoutBase(null)).setGeometry(new WidgetGeometry(50.0, 50.0, 90.0,
|
|
||||||
// 90.0, CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
|
|
||||||
// ((LayoutBase)this.getRoot().getWidget("TestLayout")).setBackgroundColors(0xff505050, 0xff505050);
|
|
||||||
|
|
||||||
// this.getRoot().addWidget("Layout", new ViewportScrollable(null)).setGeometry(new
|
|
||||||
// WidgetGeometry(50.0,50.0,75.0,75.0,CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
|
|
||||||
// ((ViewportScrollable)this.getRoot().getWidget("Layout")).attachWidget(new PictureSwitch(this.getRoot(),
|
|
||||||
// "waila:textures/test.png", "waila:textures/test_solar.png")).setSize(900, 900);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,19 +13,11 @@ public class ScreenTest2 extends ScreenBase {
|
|||||||
|
|
||||||
public ScreenTest2(GuiScreen parent) {
|
public ScreenTest2(GuiScreen parent) {
|
||||||
super(parent);
|
super(parent);
|
||||||
// this.getRoot().addWidget("Picture", new PictureSwitch(this.getRoot(), "waila:textures/test.png",
|
|
||||||
// "waila:textures/test_solar.png"));
|
|
||||||
// this.getRoot().addWidget("Button", new ButtonInteger(this.getRoot(), "Val0", "Val1", "Val2"));
|
|
||||||
// this.getRoot().getWidget("Button").setGeometry(new WidgetGeometry(50.0D, 50.0D, 100.0D, 20.0D, true, false,
|
|
||||||
// WidgetAlign.CENTER, WidgetAlign.CENTER));
|
|
||||||
|
|
||||||
this.getRoot().addWidget("Buttons", new ButtonContainerLabel(this.getRoot(), 2, 100, 30.0));
|
this.getRoot().addWidget("Buttons", new ButtonContainerLabel(this.getRoot(), 2, 100, 30.0));
|
||||||
this.getRoot().getWidget("Buttons")
|
this.getRoot().getWidget("Buttons")
|
||||||
.setGeometry(new WidgetGeometry(0.0, 0.0, 100.0, 50.0, CType.RELXY, CType.RELXY));
|
.setGeometry(new WidgetGeometry(0.0, 0.0, 100.0, 50.0, CType.RELXY, CType.RELXY));
|
||||||
|
|
||||||
// ((ButtonContainer)this.getRoot().getWidget("Buttons")).addButton(new ButtonIntegerConfig(this.getRoot(),
|
|
||||||
// "testconfig", true, 0, "Val0", "Val1", "Val2"));
|
|
||||||
|
|
||||||
this.getRoot().addWidget("Text", new LabelFixedFont(this.getRoot(), "waila:textures/test.png"));
|
this.getRoot().addWidget("Text", new LabelFixedFont(this.getRoot(), "waila:textures/test.png"));
|
||||||
this.getRoot().getWidget("Text").setGeometry(
|
this.getRoot().getWidget("Text").setGeometry(
|
||||||
new WidgetGeometry(50.0D, 10.0D, 50.0D, 50.0D, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
new WidgetGeometry(50.0D, 10.0D, 50.0D, 50.0D, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||||
|
|||||||
@@ -27,11 +27,6 @@ public class FontHelper {
|
|||||||
|
|
||||||
private static String formatEscape = "\u00A7";
|
private static String formatEscape = "\u00A7";
|
||||||
|
|
||||||
/*
|
|
||||||
* public static void drawString(String s, float x, float y, TrueTypeFont font, float scaleX, float scaleY, float...
|
|
||||||
* rgba){ drawString(s,x,y,font,scaleX,scaleY,0,rgba); }
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static void drawString(String s, float x, float y, TrueTypeFont font, float scaleX, float scaleY,
|
public static void drawString(String s, float x, float y, TrueTypeFont font, float scaleX, float scaleY,
|
||||||
float rotationZ, float... rgba) {
|
float rotationZ, float... rgba) {
|
||||||
Minecraft mc = Minecraft.getMinecraft();
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
@@ -84,7 +79,6 @@ public class FontHelper {
|
|||||||
mc.entityRenderer.setupOverlayRendering();
|
mc.entityRenderer.setupOverlayRendering();
|
||||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
// GL11.glLoadMatrix(matrixData);
|
|
||||||
|
|
||||||
GL11.glLoadIdentity();
|
GL11.glLoadIdentity();
|
||||||
GL11.glOrtho(0, mc.displayWidth, 0, mc.displayHeight, -1, 1);
|
GL11.glOrtho(0, mc.displayWidth, 0, mc.displayHeight, -1, 1);
|
||||||
|
|||||||
@@ -22,17 +22,5 @@ public class Test {
|
|||||||
public static float[] white = { 1f, 1f, 1f, 1f };
|
public static float[] white = { 1f, 1f, 1f, 1f };
|
||||||
public static boolean init = false;
|
public static boolean init = false;
|
||||||
|
|
||||||
public static void initTest() {
|
public static void initTest() {}
|
||||||
return;
|
|
||||||
/*
|
|
||||||
* GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = e.getAllFonts(); {
|
|
||||||
* int max = 9; for(Font f : fonts){ boolean pass = true; for(TrueTypeFont ttf : testFonts){
|
|
||||||
* if(ttf.font.getFontName().startsWith(f.getFontName().substring(0, 1))){ pass = false; continue; } } if(pass){
|
|
||||||
* max--; if(max == 0){ break; } testFonts.add(FontLoader.loadSystemFont(f.getFontName(), 24f, false));
|
|
||||||
* testFonts.add(FontLoader.loadSystemFont(f.getFontName(), 24f, true)); } } } init = true; } public static void
|
|
||||||
* doTest(){ if(!init){ initTest(); } for(int i =0; i < testFonts.size(); i++){ int y = 10+i*12; int x = 10;
|
|
||||||
* FontHelper.drawString("He"+EnumChatFormatting.GOLD+"llo "+EnumChatFormatting.GREEN+"wor"+EnumChatFormatting.
|
|
||||||
* YELLOW+"ld", x, y, testFonts.get(i), 1f, 1f); }
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -212,8 +212,6 @@ public class TrueTypeFont {
|
|||||||
|
|
||||||
fontTextureID = loadImage(imgTemp);
|
fontTextureID = loadImage(imgTemp);
|
||||||
|
|
||||||
// .getTexture(font.toString(), imgTemp);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("Failed to create font.");
|
System.err.println("Failed to create font.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -232,15 +230,9 @@ public class TrueTypeFont {
|
|||||||
float RenderHeight = (SrcHeight / textureHeight);
|
float RenderHeight = (SrcHeight / textureHeight);
|
||||||
Tessellator t = Tessellator.instance;
|
Tessellator t = Tessellator.instance;
|
||||||
|
|
||||||
// t.setColorRGBA_F(0f, 0f, 0f, 1f);
|
|
||||||
|
|
||||||
t.addVertexWithUV(drawX, drawY, 0, TextureSrcX, TextureSrcY);
|
t.addVertexWithUV(drawX, drawY, 0, TextureSrcX, TextureSrcY);
|
||||||
// GL11.glTexCoord2f(TextureSrcX, TextureSrcY);
|
|
||||||
// GL11.glVertex2f(drawX, drawY);
|
|
||||||
|
|
||||||
t.addVertexWithUV(drawX, drawY + DrawHeight, 0, TextureSrcX, TextureSrcY + RenderHeight);
|
t.addVertexWithUV(drawX, drawY + DrawHeight, 0, TextureSrcX, TextureSrcY + RenderHeight);
|
||||||
// GL11.glTexCoord2f(TextureSrcX, TextureSrcY + RenderHeight);
|
|
||||||
// GL11.glVertex2f(drawX, drawY + DrawHeight);
|
|
||||||
|
|
||||||
t.addVertexWithUV(
|
t.addVertexWithUV(
|
||||||
drawX + DrawWidth,
|
drawX + DrawWidth,
|
||||||
@@ -248,12 +240,8 @@ public class TrueTypeFont {
|
|||||||
0,
|
0,
|
||||||
TextureSrcX + RenderWidth,
|
TextureSrcX + RenderWidth,
|
||||||
TextureSrcY + RenderHeight);
|
TextureSrcY + RenderHeight);
|
||||||
// GL11.glTexCoord2f(TextureSrcX + RenderWidth, TextureSrcY + RenderHeight);
|
|
||||||
// GL11.glVertex2f(drawX + DrawWidth, drawY + DrawHeight);
|
|
||||||
|
|
||||||
t.addVertexWithUV(drawX + DrawWidth, drawY, 0, TextureSrcX + RenderWidth, TextureSrcY);
|
t.addVertexWithUV(drawX + DrawWidth, drawY, 0, TextureSrcX + RenderWidth, TextureSrcY);
|
||||||
// GL11.glTexCoord2f(TextureSrcX + RenderWidth, TextureSrcY);
|
|
||||||
// GL11.glVertex2f(drawX + DrawWidth, drawY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getWidth(String whatchars) {
|
public float getWidth(String whatchars) {
|
||||||
@@ -274,9 +262,7 @@ public class TrueTypeFont {
|
|||||||
lastWidth = floatObject.width;
|
lastWidth = floatObject.width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// System.out.println("Size: "+totalwidth);
|
|
||||||
return this.fontMetrics.stringWidth(whatchars);
|
return this.fontMetrics.stringWidth(whatchars);
|
||||||
// return (totalwidth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getHeight() {
|
public float getHeight() {
|
||||||
@@ -350,7 +336,6 @@ public class TrueTypeFont {
|
|||||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, fontTextureID);
|
GL11.glBindTexture(GL11.GL_TEXTURE_2D, fontTextureID);
|
||||||
Tessellator t = Tessellator.instance;
|
Tessellator t = Tessellator.instance;
|
||||||
t.startDrawingQuads();
|
t.startDrawingQuads();
|
||||||
// GL11.glBegin(GL11.GL_QUADS);
|
|
||||||
if (rgba.length == 4) t.setColorRGBA_F(rgba[0], rgba[1], rgba[2], rgba[3]);
|
if (rgba.length == 4) t.setColorRGBA_F(rgba[0], rgba[1], rgba[2], rgba[3]);
|
||||||
while (i >= startIndex && i <= endIndex) {
|
while (i >= startIndex && i <= endIndex) {
|
||||||
|
|
||||||
@@ -397,8 +382,6 @@ public class TrueTypeFont {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
t.draw();
|
t.draw();
|
||||||
// GL11.glEnd();
|
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,7 +389,6 @@ public class TrueTypeFont {
|
|||||||
try {
|
try {
|
||||||
short width = (short) bufferedImage.getWidth();
|
short width = (short) bufferedImage.getWidth();
|
||||||
short height = (short) bufferedImage.getHeight();
|
short height = (short) bufferedImage.getHeight();
|
||||||
// textureLoader.bpp = bufferedImage.getColorModel().hasAlpha() ? (byte)32 : (byte)24;
|
|
||||||
int bpp = (byte) bufferedImage.getColorModel().getPixelSize();
|
int bpp = (byte) bufferedImage.getColorModel().getPixelSize();
|
||||||
ByteBuffer byteBuffer;
|
ByteBuffer byteBuffer;
|
||||||
DataBuffer db = bufferedImage.getData().getDataBuffer();
|
DataBuffer db = bufferedImage.getData().getDataBuffer();
|
||||||
@@ -441,12 +423,6 @@ public class TrueTypeFont {
|
|||||||
|
|
||||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
|
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
|
||||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
|
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
|
||||||
// GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
|
|
||||||
// GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_NEAREST);
|
|
||||||
|
|
||||||
// GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);
|
|
||||||
// GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_LINEAR);
|
|
||||||
// GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_NEAREST);
|
|
||||||
|
|
||||||
GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE);
|
GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE);
|
||||||
|
|
||||||
@@ -462,7 +438,6 @@ public class TrueTypeFont {
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
// System.exit(-1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import mcp.mobius.waila.overlay.DisplayUtil;
|
|||||||
|
|
||||||
public class ItemStackDisplay extends WidgetBase {
|
public class ItemStackDisplay extends WidgetBase {
|
||||||
|
|
||||||
ItemStack stack = null;
|
ItemStack stack;
|
||||||
|
|
||||||
public ItemStackDisplay(IWidget parent) {
|
public ItemStackDisplay(IWidget parent) {
|
||||||
this(parent, null);
|
this(parent, null);
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ public class LabelFixedFont extends WidgetBase {
|
|||||||
public void draw(Point pos) {
|
public void draw(Point pos) {
|
||||||
this.saveGLState();
|
this.saveGLState();
|
||||||
this.mc.fontRenderer.drawString(this.text, pos.getX(), pos.getY(), this.color);
|
this.mc.fontRenderer.drawString(this.text, pos.getX(), pos.getY(), this.color);
|
||||||
// this.mc.fontRenderer.drawString(this.text, pos.getX(), pos.getY(), this.color);
|
|
||||||
this.loadGLState();
|
this.loadGLState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,12 +32,4 @@ public class LayoutBase extends WidgetBase {
|
|||||||
this.bgcolor2 = bg2;
|
this.bgcolor2 = bg2;
|
||||||
this.renderBG = true;
|
this.renderBG = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @Override public void onMouseEnter(MouseEvent event) { IWidget widget = this.getWidgetAtCoordinates(event.x,
|
|
||||||
* event.y); if (widget != null && widget != this) widget.onMouseEnter(event); }
|
|
||||||
* @Override public void onMouseLeave(MouseEvent event) { IWidget widget = this.getWidgetAtCoordinates(event.x,
|
|
||||||
* event.y); if (widget != null && widget != this) widget.onMouseLeave(event); }
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,11 +28,6 @@ public class LayoutCanvas extends LayoutBase {
|
|||||||
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||||
this.setGeometry(0, 0, this.rez.getScaledWidth(), this.rez.getScaledHeight(), CType.ABSXY, CType.ABSXY);
|
this.setGeometry(0, 0, this.rez.getScaledWidth(), this.rez.getScaledHeight(), CType.ABSXY, CType.ABSXY);
|
||||||
|
|
||||||
/*
|
|
||||||
* this.draw(this.getPos()); for (IWidget widget: this.widgets.values()) if (widget.shouldRender())
|
|
||||||
* widget.draw();
|
|
||||||
*/
|
|
||||||
|
|
||||||
super.draw();
|
super.draw();
|
||||||
|
|
||||||
this.handleMouseInput();
|
this.handleMouseInput();
|
||||||
@@ -56,23 +51,18 @@ public class LayoutCanvas extends LayoutBase {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case CLICK:
|
case CLICK:
|
||||||
if (targetWidget != null) targetWidget.onMouseClick(event);
|
if (targetWidget != null) targetWidget.onMouseClick(event);
|
||||||
// this.onMouseClick(event);
|
|
||||||
break;
|
break;
|
||||||
case DRAG:
|
case DRAG:
|
||||||
if (targetWidget != null) targetWidget.onMouseDrag(event);
|
if (targetWidget != null) targetWidget.onMouseDrag(event);
|
||||||
// this.onMouseDrag(event);
|
|
||||||
break;
|
break;
|
||||||
case MOVE:
|
case MOVE:
|
||||||
if (targetWidget != null) targetWidget.onMouseMove(event);
|
if (targetWidget != null) targetWidget.onMouseMove(event);
|
||||||
// this.onMouseMove(event);
|
|
||||||
break;
|
break;
|
||||||
case RELEASED:
|
case RELEASED:
|
||||||
if (targetWidget != null) targetWidget.onMouseRelease(event);
|
if (targetWidget != null) targetWidget.onMouseRelease(event);
|
||||||
// this.onMouseRelease(event);
|
|
||||||
break;
|
break;
|
||||||
case WHEEL:
|
case WHEEL:
|
||||||
if (targetWidget != null) targetWidget.onMouseWheel(event);
|
if (targetWidget != null) targetWidget.onMouseWheel(event);
|
||||||
// this.onMouseWheel(event);
|
|
||||||
break;
|
break;
|
||||||
case ENTER:
|
case ENTER:
|
||||||
if (event.trgwidget != null) event.trgwidget.onMouseEnter(event);
|
if (event.trgwidget != null) event.trgwidget.onMouseEnter(event);
|
||||||
@@ -81,8 +71,6 @@ public class LayoutCanvas extends LayoutBase {
|
|||||||
this.lastMouseEvent.trgwidget.onMouseLeave(event);
|
this.lastMouseEvent.trgwidget.onMouseLeave(event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NONE:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,16 +39,9 @@ public class LayoutCropping extends LayoutBase {
|
|||||||
* this.rez.getScaleFactor(),
|
* this.rez.getScaleFactor(),
|
||||||
this.getSize().getX() * this.rez.getScaleFactor(),
|
this.getSize().getX() * this.rez.getScaleFactor(),
|
||||||
this.getSize().getY() * this.rez.getScaleFactor());
|
this.getSize().getY() * this.rez.getScaleFactor());
|
||||||
// GL11.glScissor(this.getPos().getX()*this.rez.getScaleFactor(),
|
|
||||||
// this.getPos().getY()*this.rez.getScaleFactor(), this.getSize().getX()*this.rez.getScaleFactor(),
|
|
||||||
// this.getSize().getY()*this.rez.getScaleFactor());
|
|
||||||
|
|
||||||
GL11.glTranslatef(xOffset, yOffset, 0.0f);
|
GL11.glTranslatef(xOffset, yOffset, 0.0f);
|
||||||
|
|
||||||
/*
|
|
||||||
* for (IWidget widget: this.widgets.values()) if (widget.shouldRender()) widget.draw();
|
|
||||||
*/
|
|
||||||
|
|
||||||
for (IWidget widget : this.renderQueue_LOW.values()) if (widget.shouldRender()) widget.draw();
|
for (IWidget widget : this.renderQueue_LOW.values()) if (widget.shouldRender()) widget.draw();
|
||||||
|
|
||||||
for (IWidget widget : this.renderQueue_MEDIUM.values()) if (widget.shouldRender()) widget.draw();
|
for (IWidget widget : this.renderQueue_MEDIUM.values()) if (widget.shouldRender()) widget.draw();
|
||||||
|
|||||||
@@ -37,13 +37,11 @@ public class PictureSwitch extends WidgetBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseEnter(MouseEvent event) {
|
public void onMouseEnter(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
mouseOver = true;
|
mouseOver = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseLeave(MouseEvent event) {
|
public void onMouseLeave(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
mouseOver = false;
|
mouseOver = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,17 +9,12 @@ import mcp.mobius.waila.gui.interfaces.WAlign;
|
|||||||
|
|
||||||
public class ViewTable extends WidgetBase {
|
public class ViewTable extends WidgetBase {
|
||||||
|
|
||||||
public class Cell extends WidgetBase {
|
public static class Cell extends WidgetBase {
|
||||||
|
|
||||||
public Cell(IWidget parent, String text, WAlign align) {
|
public Cell(IWidget parent, String text, WAlign align) {
|
||||||
super(parent);
|
super(parent);
|
||||||
|
|
||||||
// this.addWidget("Crop", new LayoutCropping(null)).setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 100.0,
|
|
||||||
// CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
|
|
||||||
|
|
||||||
switch (align) {
|
switch (align) {
|
||||||
case CENTER:
|
case CENTER:
|
||||||
// this.getWidget("Crop").addWidget("Text", new LabelFixedFont(null, text))
|
|
||||||
this.addWidget("Text", new LabelFixedFont(null, text)).setGeometry(
|
this.addWidget("Text", new LabelFixedFont(null, text)).setGeometry(
|
||||||
new WidgetGeometry(
|
new WidgetGeometry(
|
||||||
50.0,
|
50.0,
|
||||||
@@ -32,7 +27,6 @@ public class ViewTable extends WidgetBase {
|
|||||||
WAlign.CENTER));
|
WAlign.CENTER));
|
||||||
break;
|
break;
|
||||||
case LEFT:
|
case LEFT:
|
||||||
// this.getWidget("Crop").addWidget("Text", new LabelFixedFont(null, text))
|
|
||||||
this.addWidget("Text", new LabelFixedFont(null, text)).setGeometry(
|
this.addWidget("Text", new LabelFixedFont(null, text)).setGeometry(
|
||||||
new WidgetGeometry(
|
new WidgetGeometry(
|
||||||
5.0,
|
5.0,
|
||||||
@@ -45,7 +39,6 @@ public class ViewTable extends WidgetBase {
|
|||||||
WAlign.CENTER));
|
WAlign.CENTER));
|
||||||
break;
|
break;
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
// this.getWidget("Crop").addWidget("Text", new LabelFixedFont(null, text))
|
|
||||||
this.addWidget("Text", new LabelFixedFont(null, text)).setGeometry(
|
this.addWidget("Text", new LabelFixedFont(null, text)).setGeometry(
|
||||||
new WidgetGeometry(
|
new WidgetGeometry(
|
||||||
5.0,
|
5.0,
|
||||||
@@ -241,7 +234,7 @@ public class ViewTable extends WidgetBase {
|
|||||||
IWidget tableLayout = ((ViewportScrollable) (this.getWidget("Viewport"))).getAttachedWidget();
|
IWidget tableLayout = ((ViewportScrollable) (this.getWidget("Viewport"))).getAttachedWidget();
|
||||||
tableLayout.setSize(100.0, (this.nrows + 1) * 16);
|
tableLayout.setSize(100.0, (this.nrows + 1) * 16);
|
||||||
|
|
||||||
Row newRow = (Row) new Row(null);
|
Row newRow = new Row(null);
|
||||||
newRow.setColumnsWidth(this.widths);
|
newRow.setColumnsWidth(this.widths);
|
||||||
newRow.setColumnsText(strings);
|
newRow.setColumnsText(strings);
|
||||||
newRow.setColumnsAlign(this.aligns);
|
newRow.setColumnsAlign(this.aligns);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import mcp.mobius.waila.gui.interfaces.WAlign;
|
|||||||
|
|
||||||
public class ViewportScrollable extends WidgetBase {
|
public class ViewportScrollable extends WidgetBase {
|
||||||
|
|
||||||
public class Escalator extends WidgetBase {
|
public static class Escalator extends WidgetBase {
|
||||||
|
|
||||||
int yOffset = 0;
|
int yOffset = 0;
|
||||||
int sizeCursor = 8;
|
int sizeCursor = 8;
|
||||||
@@ -133,8 +133,6 @@ public class ViewportScrollable extends WidgetBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw() {
|
public void draw() {
|
||||||
// if (Display.wasResized())
|
|
||||||
|
|
||||||
if ((this.attachedWidget != null) && (this.attachedWidget.getSize().getY() > this.getSize().getY()))
|
if ((this.attachedWidget != null) && (this.attachedWidget.getSize().getY() > this.getSize().getY()))
|
||||||
this.getWidget("Escalator").show();
|
this.getWidget("Escalator").show();
|
||||||
else this.getWidget("Escalator").hide();
|
else this.getWidget("Escalator").hide();
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ public abstract class WidgetBase implements IWidget {
|
|||||||
|
|
||||||
protected IWidget parent;
|
protected IWidget parent;
|
||||||
protected WidgetGeometry geom;
|
protected WidgetGeometry geom;
|
||||||
protected LinkedHashMap<String, IWidget> widgets = new LinkedHashMap<String, IWidget>();
|
protected LinkedHashMap<String, IWidget> widgets = new LinkedHashMap<>();
|
||||||
protected LinkedHashMap<String, IWidget> renderQueue_HIGH = new LinkedHashMap<String, IWidget>();
|
protected LinkedHashMap<String, IWidget> renderQueue_HIGH = new LinkedHashMap<>();
|
||||||
protected LinkedHashMap<String, IWidget> renderQueue_MEDIUM = new LinkedHashMap<String, IWidget>();
|
protected LinkedHashMap<String, IWidget> renderQueue_MEDIUM = new LinkedHashMap<>();
|
||||||
protected LinkedHashMap<String, IWidget> renderQueue_LOW = new LinkedHashMap<String, IWidget>();
|
protected LinkedHashMap<String, IWidget> renderQueue_LOW = new LinkedHashMap<>();
|
||||||
protected Minecraft mc;
|
protected Minecraft mc;
|
||||||
protected TextureManager texManager;
|
protected TextureManager texManager;
|
||||||
protected ScaledResolution rez;
|
protected ScaledResolution rez;
|
||||||
@@ -88,14 +88,12 @@ public abstract class WidgetBase implements IWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWidget delWidget(String name) {
|
public IWidget delWidget(String name) {
|
||||||
IWidget widget = this.getWidget(name);
|
return this.widgets.remove(name);
|
||||||
this.widgets.remove(widget);
|
|
||||||
return widget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWidget getWidgetAtCoordinates(double posX, double posY) {
|
public IWidget getWidgetAtCoordinates(double posX, double posY) {
|
||||||
for (IWidget widget : new ReverseIterator<IWidget>(this.widgets.values()))
|
for (IWidget widget : new ReverseIterator<>(this.widgets.values()))
|
||||||
if ((posX >= widget.getPos().getX()) && (posX <= widget.getPos().getX() + widget.getSize().getX())
|
if ((posX >= widget.getPos().getX()) && (posX <= widget.getPos().getX() + widget.getSize().getX())
|
||||||
&& (posY >= widget.getPos().getY())
|
&& (posY >= widget.getPos().getY())
|
||||||
&& (posY <= widget.getPos().getY() + widget.getSize().getY()))
|
&& (posY <= widget.getPos().getY() + widget.getSize().getY()))
|
||||||
@@ -114,8 +112,7 @@ public abstract class WidgetBase implements IWidget {
|
|||||||
if (this.getLeft() > posx) return false;
|
if (this.getLeft() > posx) return false;
|
||||||
if (this.getRight() < posx) return false;
|
if (this.getRight() < posx) return false;
|
||||||
if (this.getTop() > posy) return false;
|
if (this.getTop() > posy) return false;
|
||||||
if (this.getBottom() < posy) return false;
|
return !(this.getBottom() < posy);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////
|
///////////////////////
|
||||||
@@ -141,10 +138,6 @@ public abstract class WidgetBase implements IWidget {
|
|||||||
|
|
||||||
this.draw(this.getPos());
|
this.draw(this.getPos());
|
||||||
|
|
||||||
/*
|
|
||||||
* for (IWidget widget: this.widgets.values()) if (widget.shouldRender()) widget.draw();
|
|
||||||
*/
|
|
||||||
|
|
||||||
for (IWidget widget : this.renderQueue_LOW.values()) if (widget.shouldRender()) widget.draw();
|
for (IWidget widget : this.renderQueue_LOW.values()) if (widget.shouldRender()) widget.draw();
|
||||||
|
|
||||||
for (IWidget widget : this.renderQueue_MEDIUM.values()) if (widget.shouldRender()) widget.draw();
|
for (IWidget widget : this.renderQueue_MEDIUM.values()) if (widget.shouldRender()) widget.draw();
|
||||||
@@ -215,7 +208,7 @@ public abstract class WidgetBase implements IWidget {
|
|||||||
this.geom.setPos(x, y, fracX, fracY);
|
this.geom.setPos(x, y, fracX, fracY);
|
||||||
this.emit(Signal.GEOM_CHANGED, this.geom);
|
this.emit(Signal.GEOM_CHANGED, this.geom);
|
||||||
return this;
|
return this;
|
||||||
};
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWidget setSize(double sx, double sy) {
|
public IWidget setSize(double sx, double sy) {
|
||||||
@@ -227,7 +220,7 @@ public abstract class WidgetBase implements IWidget {
|
|||||||
this.geom.setSize(sx, sy, fracX, fracY);
|
this.geom.setSize(sx, sy, fracX, fracY);
|
||||||
this.emit(Signal.GEOM_CHANGED, this.geom);
|
this.emit(Signal.GEOM_CHANGED, this.geom);
|
||||||
return this;
|
return this;
|
||||||
};
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWidget adjustSize() {
|
public IWidget adjustSize() {
|
||||||
@@ -270,33 +263,32 @@ public abstract class WidgetBase implements IWidget {
|
|||||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, boundTexIndex);
|
GL11.glBindTexture(GL11.GL_TEXTURE_2D, boundTexIndex);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GL11.glPopAttrib();
|
GL11.glPopAttrib();
|
||||||
// GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAlpha(float alpha) {
|
public void setAlpha(float alpha) {
|
||||||
this.alpha = alpha;
|
this.alpha = alpha;
|
||||||
};
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getAlpha() {
|
public float getAlpha() {
|
||||||
return this.alpha;
|
return this.alpha;
|
||||||
};
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show() {
|
public void show() {
|
||||||
this.isRendering = true;
|
this.isRendering = true;
|
||||||
};
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hide() {
|
public void hide() {
|
||||||
this.isRendering = false;
|
this.isRendering = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldRender() {
|
public boolean shouldRender() {
|
||||||
return this.isRendering;
|
return this.isRendering;
|
||||||
};
|
}
|
||||||
|
|
||||||
////////////////////
|
////////////////////
|
||||||
// INPUT HANDLING //
|
// INPUT HANDLING //
|
||||||
@@ -307,59 +299,36 @@ public abstract class WidgetBase implements IWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseClick(MouseEvent event) {
|
public void onMouseClick(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
if (this.parent != null) this.parent.onMouseClick(event);
|
if (this.parent != null) this.parent.onMouseClick(event);
|
||||||
|
|
||||||
// IWidget widget = this.getWidgetAtCoordinates(event.x, event.y);
|
|
||||||
// if (widget != null && widget != this)
|
|
||||||
// widget.onMouseClick(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseDrag(MouseEvent event) {
|
public void onMouseDrag(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
if (this.parent != null) this.parent.onMouseDrag(event);
|
if (this.parent != null) this.parent.onMouseDrag(event);
|
||||||
|
|
||||||
// IWidget widget = this.getWidgetAtCoordinates(event.x, event.y);
|
|
||||||
// if (widget != null && widget != this)
|
|
||||||
// widget.onMouseDrag(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseMove(MouseEvent event) {
|
public void onMouseMove(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
if (this.parent != null) this.parent.onMouseMove(event);
|
if (this.parent != null) this.parent.onMouseMove(event);
|
||||||
|
|
||||||
// IWidget widget = this.getWidgetAtCoordinates(event.x, event.y);
|
|
||||||
// if (widget != null && widget != this)
|
|
||||||
// widget.onMouseMove(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseRelease(MouseEvent event) {
|
public void onMouseRelease(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
if (this.parent != null) this.parent.onMouseRelease(event);
|
if (this.parent != null) this.parent.onMouseRelease(event);
|
||||||
|
|
||||||
// IWidget widget = this.getWidgetAtCoordinates(event.x, event.y);
|
|
||||||
// if (widget != null && widget != this)
|
|
||||||
// widget.onMouseRelease(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseWheel(MouseEvent event) {
|
public void onMouseWheel(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
if (this.parent != null) this.parent.onMouseWheel(event);
|
if (this.parent != null) this.parent.onMouseWheel(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseEnter(MouseEvent event) {
|
public void onMouseEnter(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
if (this.parent != null) this.parent.onMouseEnter(event);
|
if (this.parent != null) this.parent.onMouseEnter(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseLeave(MouseEvent event) {
|
public void onMouseLeave(MouseEvent event) {
|
||||||
// System.out.printf("%s %s\n", this, event);
|
|
||||||
if (this.parent != null) this.parent.onMouseLeave(event);
|
if (this.parent != null) this.parent.onMouseLeave(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,15 +8,12 @@ import mcp.mobius.waila.gui.interfaces.CType;
|
|||||||
import mcp.mobius.waila.gui.interfaces.IWidget;
|
import mcp.mobius.waila.gui.interfaces.IWidget;
|
||||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||||
|
|
||||||
// public class WidgetGeometry implements Cloneable{
|
|
||||||
public class WidgetGeometry {
|
public class WidgetGeometry {
|
||||||
|
|
||||||
// public enum Align {LEFT, CENTER, RIGHT, TOP, BOTTOM};
|
double x;
|
||||||
|
double y;
|
||||||
double x = -1;
|
double sx;
|
||||||
double y = -1;
|
double sy;
|
||||||
double sx = -1;
|
|
||||||
double sy = -1;
|
|
||||||
|
|
||||||
CType posType;
|
CType posType;
|
||||||
CType sizeType;
|
CType sizeType;
|
||||||
@@ -29,7 +26,7 @@ public class WidgetGeometry {
|
|||||||
WAlign alignX;
|
WAlign alignX;
|
||||||
WAlign alignY;
|
WAlign alignY;
|
||||||
|
|
||||||
public class PointDouble {
|
public static class PointDouble {
|
||||||
|
|
||||||
double x;
|
double x;
|
||||||
double y;
|
double y;
|
||||||
@@ -37,7 +34,7 @@ public class WidgetGeometry {
|
|||||||
public PointDouble(double x, double y) {
|
public PointDouble(double x, double y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
};
|
}
|
||||||
|
|
||||||
public double getX() {
|
public double getX() {
|
||||||
return this.x;
|
return this.x;
|
||||||
@@ -184,9 +181,4 @@ public class WidgetGeometry {
|
|||||||
this.alignX,
|
this.alignX,
|
||||||
this.alignY);
|
this.alignY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public WidgetGeometry clone() throws CloneNotSupportedException{
|
|
||||||
// return (WidgetGeometry)super.clone();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,6 @@ public class ButtonContainer extends WidgetBase {
|
|||||||
String buttonName = String.format("Button_%d", nButtons);
|
String buttonName = String.format("Button_%d", nButtons);
|
||||||
String layoutName = String.format("Layout_%d", nButtons);
|
String layoutName = String.format("Layout_%d", nButtons);
|
||||||
String layoutLabelName = String.format("LayoutLabel_%d", nButtons);
|
String layoutLabelName = String.format("LayoutLabel_%d", nButtons);
|
||||||
String labelName = String.format("Label_%d", nButtons);
|
|
||||||
|
|
||||||
this.addWidget(layoutName, new LayoutBase(this));
|
this.addWidget(layoutName, new LayoutBase(this));
|
||||||
this.addWidget(layoutLabelName, new LayoutBase(this));
|
this.addWidget(layoutLabelName, new LayoutBase(this));
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ public class PictureMovableRC extends WidgetBase {
|
|||||||
public void onMouseClick(MouseEvent event) {
|
public void onMouseClick(MouseEvent event) {
|
||||||
this.offsetX = event.x - this.geom.getUnalignedPos(this.parent).getX();
|
this.offsetX = event.x - this.geom.getUnalignedPos(this.parent).getX();
|
||||||
this.offsetY = event.y - this.geom.getUnalignedPos(this.parent).getY();
|
this.offsetY = event.y - this.geom.getUnalignedPos(this.parent).getY();
|
||||||
// System.out.printf("%s %s\n", this.offsetX, this.offsetY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -45,9 +44,6 @@ public class PictureMovableRC extends WidgetBase {
|
|||||||
((newX - this.parent.getLeft()) / this.parent.getSize().getX()) * 100.0,
|
((newX - this.parent.getLeft()) / this.parent.getSize().getX()) * 100.0,
|
||||||
((newY - this.parent.getTop()) / this.parent.getSize().getY()) * 100.0);
|
((newY - this.parent.getTop()) / this.parent.getSize().getY()) * 100.0);
|
||||||
|
|
||||||
// System.out.printf("%s\n", this.parent.getGeometry());
|
|
||||||
// System.out.printf("%s %s\n", this.parent.getPos(), this.parent.getSize());
|
|
||||||
|
|
||||||
this.emit(Signal.DRAGGED, this.getPos());
|
this.emit(Signal.DRAGGED, this.getPos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,117 +0,0 @@
|
|||||||
package mcp.mobius.waila.gui_old.widget_old;
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
|
|
||||||
public class Button2States extends GuiButton {
|
|
||||||
|
|
||||||
boolean state;
|
|
||||||
String label;
|
|
||||||
int labelSize;
|
|
||||||
String stateFalse;
|
|
||||||
String stateTrue;
|
|
||||||
|
|
||||||
public Button2States(int par1, String _stateFalse, String _stateTrue, String _label, int _labelSize, boolean _state) {
|
|
||||||
super(par1, 0, 0, 80, 20, _stateFalse);
|
|
||||||
state = _state;
|
|
||||||
label = _label;
|
|
||||||
stateFalse = _stateFalse;
|
|
||||||
stateTrue = _stateTrue;
|
|
||||||
labelSize = _labelSize;
|
|
||||||
this.displayString = state ? stateTrue:stateFalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Button2States(int par1, int par2, int par3, String _stateFalse, String _stateTrue, String _label, int _labelSize, boolean _state) {
|
|
||||||
super(par1, par2, par3, _stateFalse);
|
|
||||||
state = _state;
|
|
||||||
label = _label;
|
|
||||||
stateFalse = _stateFalse;
|
|
||||||
stateTrue = _stateTrue;
|
|
||||||
labelSize = _labelSize;
|
|
||||||
this.displayString = state ? stateTrue:stateFalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Button2States(int par1, int par2, int par3, int par4, int par5, String _stateFalse, String _stateTrue, String _label, int _labelSize, boolean _state) {
|
|
||||||
super(par1, par2, par3, par4, par5, _stateFalse);
|
|
||||||
state = _state;
|
|
||||||
label = _label;
|
|
||||||
stateFalse = _stateFalse;
|
|
||||||
stateTrue = _stateTrue;
|
|
||||||
labelSize = _labelSize;
|
|
||||||
this.displayString = state ? stateTrue:stateFalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3)
|
|
||||||
{
|
|
||||||
if (this.drawButton)
|
|
||||||
{
|
|
||||||
FontRenderer fontrenderer = par1Minecraft.fontRenderer;
|
|
||||||
|
|
||||||
//DONE : Changed from v1.5.2 to 1.6.2 resource handling
|
|
||||||
//par1Minecraft.renderEngine.bindTexture("/gui/gui.png");
|
|
||||||
ResourceLocation guipng = new ResourceLocation("textures/gui/widgets.png");
|
|
||||||
par1Minecraft.renderEngine.func_110577_a(guipng);
|
|
||||||
|
|
||||||
if (this.labelSize == -1)
|
|
||||||
labelSize = fontrenderer.getStringWidth(this.label) + 5;
|
|
||||||
|
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
this.field_82253_i = par2 >= this.xPosition + this.labelSize && par3 >= this.yPosition && par2 < this.xPosition + this.width + this.labelSize && par3 < this.yPosition + this.height;
|
|
||||||
int k = this.getHoverState(this.field_82253_i);
|
|
||||||
this.drawTexturedModalRect(this.xPosition + this.labelSize, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height);
|
|
||||||
this.drawTexturedModalRect(this.xPosition + this.labelSize + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height);
|
|
||||||
this.mouseDragged(par1Minecraft, par2, par3);
|
|
||||||
int l = 14737632;
|
|
||||||
|
|
||||||
if (!this.enabled)
|
|
||||||
{
|
|
||||||
l = -6250336;
|
|
||||||
}
|
|
||||||
else if (this.field_82253_i)
|
|
||||||
{
|
|
||||||
l = 16777120;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.labelSize + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
|
|
||||||
this.drawCenteredString(fontrenderer, this.label, this.xPosition + this.labelSize/2, this.yPosition + (this.height - 8) / 2, 14737632);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void pressButton(){
|
|
||||||
state = state?false:true;
|
|
||||||
this.displayString = state ? stateTrue:stateFalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getState(){
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3)
|
|
||||||
{
|
|
||||||
return this.enabled && this.drawButton && par2 >= this.xPosition + this.labelSize && par3 >= this.yPosition && par2 < this.xPosition + this.labelSize + this.width && par3 < this.yPosition + this.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHeight(){
|
|
||||||
return this.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWidth(){
|
|
||||||
return this.width + this.labelSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeight(int value){
|
|
||||||
this.height = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWidth(int value){
|
|
||||||
this.width = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
package mcp.mobius.waila.gui_old.widget_old;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
|
|
||||||
public class ButtonChangeScreen extends GuiButton {
|
|
||||||
|
|
||||||
GuiScreen linkedScreen;
|
|
||||||
|
|
||||||
public ButtonChangeScreen(int par1, String par4Str, GuiScreen _linkedScreen) {
|
|
||||||
super(par1, 0, 0, 80, 20, par4Str);
|
|
||||||
this.linkedScreen = _linkedScreen;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonChangeScreen(int par1, int par2, int par3, String par4Str, GuiScreen _linkedScreen) {
|
|
||||||
super(par1, par2, par3, par4Str);
|
|
||||||
this.linkedScreen = _linkedScreen;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonChangeScreen(int par1, int par2, int par3, int par4, int par5, String par6Str, GuiScreen _linkedScreen) {
|
|
||||||
super(par1, par2, par3, par4, par5, par6Str);
|
|
||||||
this.linkedScreen = _linkedScreen;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void pressButton(){
|
|
||||||
Minecraft mc = Minecraft.getMinecraft();
|
|
||||||
mc.displayGuiScreen(this.linkedScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHeight(){
|
|
||||||
return this.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWidth(){
|
|
||||||
return this.width;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeight(int value){
|
|
||||||
this.height = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWidth(int value){
|
|
||||||
this.width = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package mcp.mobius.waila.gui_old.widget_old;
|
|
||||||
|
|
||||||
import codechicken.nei.NEIClientConfig;
|
|
||||||
|
|
||||||
public class ButtonConfigNEI extends ButtonConfigOption {
|
|
||||||
|
|
||||||
public ButtonConfigNEI(int par1, String _stateFalse, String _stateTrue,
|
|
||||||
String _label, String _configKey) {
|
|
||||||
super(par1, _stateFalse, _stateTrue, _label, _configKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonConfigNEI(int par1, int par2, int par3, String _stateFalse, String _stateTrue, String _label, int _labelSize, boolean _state,
|
|
||||||
String _configKey) {
|
|
||||||
super(par1, par2, par3, _stateFalse, _stateTrue, _label, _labelSize,
|
|
||||||
_state, _configKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonConfigNEI(int par1, int par2, int par3, int par4, int par5,
|
|
||||||
String _stateFalse, String _stateTrue, String _label,
|
|
||||||
int _labelSize, boolean _state, String _configKey) {
|
|
||||||
super(par1, par2, par3, par4, par5, _stateFalse, _stateTrue, _label,
|
|
||||||
_labelSize, _state, _configKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setupInitialState(String _configKey, boolean _state){
|
|
||||||
this.configKey = _configKey;
|
|
||||||
this.state = NEIClientConfig.getSetting(this.configKey).getBooleanValue();
|
|
||||||
this.displayString = state ? stateTrue:stateFalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void pressButton(){
|
|
||||||
super.pressButton();
|
|
||||||
this.state = !NEIClientConfig.getSetting(this.configKey).getBooleanValue();
|
|
||||||
NEIClientConfig.getSetting(this.configKey).setBooleanValue(this.state);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
package mcp.mobius.waila.gui_old.widget_old;
|
|
||||||
|
|
||||||
import mcp.mobius.waila.mod_Waila;
|
|
||||||
import net.minecraftforge.common.Configuration;
|
|
||||||
import net.minecraftforge.common.Property;
|
|
||||||
|
|
||||||
public class ButtonConfigOption extends Button2States {
|
|
||||||
|
|
||||||
String configKey;
|
|
||||||
|
|
||||||
public ButtonConfigOption(int par1, String _stateFalse, String _stateTrue, String _label, String _configKey) {
|
|
||||||
super(par1, 0, 0, 80, 20, _stateFalse, _stateTrue, _label, -1, false);
|
|
||||||
this.setupInitialState(_configKey, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonConfigOption(int par1, String _stateFalse, String _stateTrue, String _label, String _configKey, boolean _state) {
|
|
||||||
super(par1, 0, 0, 80, 20, _stateFalse, _stateTrue, _label, -1, _state);
|
|
||||||
this.setupInitialState(_configKey, _state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonConfigOption(int par1, int par2, int par3, String _stateFalse, String _stateTrue, String _label, int _labelSize, boolean _state, String _configKey) {
|
|
||||||
super(par1, par2, par3, _stateFalse, _stateTrue, _label, _labelSize, _state);
|
|
||||||
this.setupInitialState(_configKey, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonConfigOption(int par1, int par2, int par3, int par4, int par5, String _stateFalse, String _stateTrue, String _label, int _labelSize, boolean _state, String _configKey) {
|
|
||||||
super(par1, par2, par3, par4, par5, _stateFalse, _stateTrue, _label, _labelSize, _state);
|
|
||||||
this.setupInitialState(_configKey, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setupInitialState(String _configKey, boolean _state){
|
|
||||||
this.configKey = _configKey;
|
|
||||||
this.state = this.readConfigKey(this.configKey, _state);
|
|
||||||
this.displayString = state ? stateTrue:stateFalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void pressButton(){
|
|
||||||
super.pressButton();
|
|
||||||
this.writeConfigKey(this.configKey, this.state);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void writeConfigKey(String keyname, boolean value){
|
|
||||||
mod_Waila.instance.config.getCategory(Configuration.CATEGORY_GENERAL).put(keyname, new Property(keyname,String.valueOf(value),Property.Type.BOOLEAN));
|
|
||||||
mod_Waila.instance.config.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean readConfigKey(String keyname, boolean _state){
|
|
||||||
mod_Waila.instance.config.load();
|
|
||||||
Property prop = mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, keyname, _state);
|
|
||||||
return prop.getBoolean(_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package mcp.mobius.waila.gui_old.widget_old;
|
|
||||||
|
|
||||||
import mcp.mobius.waila.mod_Waila;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
|
|
||||||
public class ButtonConfigRemote extends ButtonConfigOption {
|
|
||||||
|
|
||||||
public ButtonConfigRemote(int par1, String _stateFalse, String _stateTrue, String _label, String _configKey) {
|
|
||||||
super(par1, _stateFalse, _stateTrue, _label, _configKey);
|
|
||||||
}
|
|
||||||
public ButtonConfigRemote(int par1, String _stateFalse, String _stateTrue, String _label, String _configKey, boolean _state) {
|
|
||||||
super(par1, _stateFalse, _stateTrue, _label, _configKey, _state);
|
|
||||||
}
|
|
||||||
public ButtonConfigRemote(int par1, int par2, int par3, String _stateFalse, String _stateTrue, String _label, int _labelSize, boolean _state, String _configKey) {
|
|
||||||
super(par1, par2, par3, _stateFalse, _stateTrue, _label, _labelSize, _state, _configKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonConfigRemote(int par1, int par2, int par3, int par4, int par5, String _stateFalse, String _stateTrue, String _label, int _labelSize, boolean _state, String _configKey) {
|
|
||||||
super(par1, par2, par3, par4, par5, _stateFalse, _stateTrue, _label, _labelSize, _state, _configKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3)
|
|
||||||
{
|
|
||||||
this.enabled = mod_Waila.instance.serverPresent;
|
|
||||||
super.drawButton(par1Minecraft, par2, par3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3)
|
|
||||||
{
|
|
||||||
this.enabled = mod_Waila.instance.serverPresent;
|
|
||||||
return super.mousePressed(par1Minecraft, par2, par3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getHoverState(boolean par1)
|
|
||||||
{
|
|
||||||
this.enabled = mod_Waila.instance.serverPresent;
|
|
||||||
return super.getHoverState(par1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package mcp.mobius.waila.gui_old.widget_old;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
|
|
||||||
public class ContainerButtons {
|
|
||||||
|
|
||||||
GuiScreen parentScreen;
|
|
||||||
int posX, posY, width, height;
|
|
||||||
int maxLabelSize = 0;
|
|
||||||
int maxColumnWidth = 0;
|
|
||||||
|
|
||||||
ArrayList<GuiButton> buttons = new ArrayList<GuiButton>();
|
|
||||||
|
|
||||||
public ContainerButtons(GuiScreen _parentScreen, int _posX, int _posY, int _width, int _height) {
|
|
||||||
this.parentScreen = _parentScreen;
|
|
||||||
this.posX = _posX; this.posY = _posY;
|
|
||||||
this.width = _width; this.height = _height;
|
|
||||||
this.maxColumnWidth = this.width/2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addButton(GuiButton button){
|
|
||||||
|
|
||||||
this.buttons.add(button);
|
|
||||||
|
|
||||||
/*
|
|
||||||
FontRenderer fontrenderer = Minecraft.getMinecraft().fontRenderer;
|
|
||||||
if (button instanceof Button2States){
|
|
||||||
maxLabelSize = Math.max(maxLabelSize, fontrenderer.getStringWidth(((Button2States)button).label) + 5);
|
|
||||||
((Button2States)button).labelSize = maxLabelSize;
|
|
||||||
maxColumnWidth = Math.max(maxColumnWidth, ((Button2States)button).getWidth());
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
for (GuiButton other : this.buttons){
|
|
||||||
if (other instanceof Button2States)
|
|
||||||
((Button2States) other).labelSize = this.maxLabelSize;
|
|
||||||
|
|
||||||
if (other instanceof ButtonChangeScreen)
|
|
||||||
((ButtonChangeScreen) other).setWidth(maxColumnWidth);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (button instanceof Button2States){
|
|
||||||
((Button2States) button).setWidth(80);
|
|
||||||
((Button2States) button).labelSize = this.width/2 - 80;
|
|
||||||
button.xPosition = (this.buttons.size() - 1)%2 * this.width / 2 + this.posX;
|
|
||||||
button.yPosition = (this.buttons.size() - 1)/2 * 20 + this.posY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (button instanceof ButtonChangeScreen){
|
|
||||||
//((ButtonChangeScreen) button).setWidth(this.width/2);
|
|
||||||
((ButtonChangeScreen) button).setWidth(120);
|
|
||||||
button.xPosition = (this.buttons.size() - 1)%2 * this.width / 2 + this.posX + (this.width / 2 - ((ButtonChangeScreen) button).getWidth())/2;
|
|
||||||
button.yPosition = (this.buttons.size() - 1)/2 * 20 + this.posY;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.parentScreen.buttonList.add(button);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -43,7 +43,7 @@ public class DecoratorFMP implements IWailaBlockDecorator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
Class BlockMultipart = null;
|
Class<?> BlockMultipart;
|
||||||
try {
|
try {
|
||||||
BlockMultipart = Class.forName("codechicken.multipart.BlockMultipart");
|
BlockMultipart = Class.forName("codechicken.multipart.BlockMultipart");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class HUDHandlerBlocks implements IWailaDataProvider {
|
|||||||
if (s != null && !s.endsWith("Unnamed")) name = s;
|
if (s != null && !s.endsWith("Unnamed")) name = s;
|
||||||
|
|
||||||
if (name != null) currenttip.add(name);
|
if (name != null) currenttip.add(name);
|
||||||
} catch (Exception e) {}
|
} catch (Exception ignored) {}
|
||||||
|
|
||||||
if (itemStack.getItem() == Items.redstone) {
|
if (itemStack.getItem() == Items.redstone) {
|
||||||
int md = accessor.getMetadata();
|
int md = accessor.getMetadata();
|
||||||
@@ -48,7 +48,7 @@ public class HUDHandlerBlocks implements IWailaDataProvider {
|
|||||||
currenttip.set(currenttip.size() - 1, name + " " + s);
|
currenttip.set(currenttip.size() - 1, name + " " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currenttip.size() == 0) currenttip.add("< Unnamed >");
|
if (currenttip.isEmpty()) currenttip.add("< Unnamed >");
|
||||||
else {
|
else {
|
||||||
if (ConfigHandler.instance()
|
if (ConfigHandler.instance()
|
||||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_METADATA, true)) {
|
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_METADATA, true)) {
|
||||||
@@ -66,11 +66,6 @@ public class HUDHandlerBlocks implements IWailaDataProvider {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
IWailaConfigHandler config) {
|
IWailaConfigHandler config) {
|
||||||
/*
|
|
||||||
* if (ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTBLOCK, false)
|
|
||||||
* && currenttip.size() > 0 && !accessor.getPlayer().isSneaking()){ currenttip.clear(); currenttip.add(ITALIC +
|
|
||||||
* "Press shift for more data"); return currenttip; }
|
|
||||||
*/
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +75,7 @@ public class HUDHandlerBlocks implements IWailaDataProvider {
|
|||||||
currenttip.add(RENDER + "{Plip}" + RENDER + "{Plop,thisisatest,222,333}");
|
currenttip.add(RENDER + "{Plip}" + RENDER + "{Plop,thisisatest,222,333}");
|
||||||
|
|
||||||
String modName = ModIdentification.nameFromStack(itemStack);
|
String modName = ModIdentification.nameFromStack(itemStack);
|
||||||
if (modName != null && !modName.equals("")) {
|
if (modName != null && !modName.isEmpty()) {
|
||||||
currenttip.add(BLUE + ITALIC + modName);
|
currenttip.add(BLUE + ITALIC + modName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loaded 100 of 136 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user