Compare commits

..
Author SHA1 Message Date
Mary Hopson 560dc3d267 Finish NBT saving, fix output slot, allow "batch" for large nodes 2025-07-27 14:03:04 -04:00
Mary Hopson 87639e10f1 UI and model improvements 2025-07-27 02:04:29 -04:00
Mary Hopson f116039c2d Logic improvements 2025-07-21 09:05:25 -04:00
Mary Hopson fe350b1248 Basic rendering 2025-07-21 07:42:51 -04:00
Mary Hopson ee9a3b5d15 Add research 2024-10-09 23:22:07 -04:00
Mary Hopson fd928438fc Rename machine to visweaver 2024-10-09 18:01:19 -04:00
Mary Hopson d4b8ad8f8e Update GUI 2024-10-09 17:40:37 -04:00
Mary Hopson c4d699a0bf Update recipemap to support centivis types 2024-10-09 03:32:53 -04:00
Mary Hopson 449ef424a3 Makes the block semi-functional. Has an inventory and can transmute items from a simple recipe map 2024-10-09 02:35:29 -04:00
Mary Hopson 6789bd3967 Boilerplate 2024-10-08 23:15:17 -04:00
Raven Szewczyk 6670fcdb5f Share both research and discovered aspects list with the knowledge sharing tome (#41)
* Update buildscript, switch to RFG tag generation

* Share both research and discovered aspects list with the knowledge sharing book
2024-07-17 16:38:52 +00:00
Martin Robertz 2058c309d4 update 2024-05-22 22:45:09 +02:00
Under 2633f752f3 Add configs for annoying Kami features (#40)
1. Kami/Ichor Leggings have had the "produce light" ability config'ed and disabled by default.
2. Kami/Ichor boots have had the "dirt into grass" ability config'ed but left enabled by default.

Just let me know if the general consensus would be that the dirt into grass should also be disabled by default and I'll swap that to default to false as well.
2024-05-21 15:01:33 -04:00
Martin Robertz 8ce7293034 update 2024-04-19 20:05:19 +02:00
chochem 0432ff0d30 be more specific (#39) 2024-04-19 00:51:01 +01:00
Abdiel Kavash 180509a1a9 Fix crashes related to high level enchantments. (#38)
* Fix crashes with high level enchantments.

* bs+d
2024-04-13 00:55:55 +02:00
Raven Szewczyk 1f27b14054 [ci skip] upgraded build system 2024-02-04 20:02:27 +00:00
Martin Robertz 22e8c36aae update deps+bs 2024-01-31 22:50:58 +01:00
Jurre Groenendijk 0212dd084a Fix typo in thaumic restorer page (#37) 2024-01-31 22:50:08 +01:00
Martin Robertz d54311fb11 update bs+deps 2024-01-12 20:58:37 +01:00
Raven Szewczyk 4a20fa3b06 [ci skip] upgraded build system 2024-01-08 21:29:54 +00:00
Martin Robertz 97e8cdf407 update gradle + deps + bs 2023-12-26 22:01:21 +01:00
Abdiel Kavash 0c75584ccb Talisman of Remedium no longer wastes durability trying to remove permanent debuffs. It also accepts the Unbreaking enchant. (#36)
* Talisman of Remedium accepts Unbreaking enchant.

* Talisman of Remedium no longer removes debuffs with duration < 1 second.

* Talisman of Remedium does not waste durability trying to remove "permanent" debuffs.

* Use a map on player's UUID instead of single variables.
2023-12-26 11:09:31 +01:00
Angus Grewal 47ffee8cd3 Added balancing configs for Shadowbeam Focus. (#35) 2023-11-25 15:48:33 +01:00
39 changed files with 1350 additions and 1766 deletions

No files matched your search

+2 -1621
View File
File diff suppressed because it is too large. Load diff
+11 -11
View File
@@ -1,20 +1,20 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-261-GTNH:api')
api('com.github.GTNewHorizons:Baubles:1.0.4:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-402-GTNH:api')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Botania:1.10.0-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.18:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.5.2:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderStorage:1.4.12:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:waila:1.6.0:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.10.5-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.3.4:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:Botania:1.11.1-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderStorage:1.6.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:waila:1.8.0:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.12.1-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.4.8:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.2.1:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api') {transitive=false}
compileOnly('curse.maven:computercraft-67504:2269339')
compileOnly('curse.maven:cofh-lib-220333:2388748')
+150 -24
View File
@@ -1,66 +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 = Thaumic Tinkerer
# 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 = ThaumicTinkerer
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = thaumic.tinkerer
# WHY is there no version field?
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
# Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
useModGroupForPublishing = false
# Will update your build.gradle automatically whenever an update is available
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
autoUpdateBuildScript = false
# Version of Minecraft to target
minecraftVersion = 1.7.10
# Version of Minecraft Forge to target
forgeVersion = 10.13.4.1614
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
channel = stable
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
mappingsVersion = 12
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mods 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 = LibMisc.java
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = false
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = false
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass = thaumic.tinkerer.Tags
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
gradleTokenVersion = GRADLETOKEN_VERSION
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [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.
# 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
# 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 = ThaumicTinkerer_at.cfg
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = true
# Adds some debug arguments like verbose output and export
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = true
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass = preloader.ThaumicTLoaderContainer
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
# responsibility to check the license and request permission for distribution if required.
usesShadowedDependencies = false
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# 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, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# 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 =
# 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
Binary file not shown.
+2 -1
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+14 -10
View File
@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
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
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -130,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Vendored
+10 -10
View File
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
+5 -10
View File
@@ -4,10 +4,10 @@ pluginManagement {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons.retrofuturagradle")
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
gradlePluginPortal()
@@ -17,12 +17,7 @@ pluginManagement {
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.23'
}
blowdryerSetup {
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
//devLocal '.' // Use this when testing config updates locally
}
@@ -0,0 +1,36 @@
package thaumic.tinkerer.api;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.Aspect;
public class VisweaverRecipe {
private final int centivisCost;
private final Aspect centivisType;
private final ItemStack input;
private final ItemStack output;
VisweaverRecipe(int centivisCost, Aspect centivisType, ItemStack input, ItemStack output) {
this.centivisCost = centivisCost;
this.centivisType = centivisType;
this.input = input;
this.output = output;
}
public int getCentivisCost() {
return centivisCost;
}
public Aspect getCentivisType() {
return centivisType;
}
public ItemStack getInput() {
return input;
}
public ItemStack getOutput() {
return output;
}
}
@@ -0,0 +1,27 @@
package thaumic.tinkerer.api;
import net.minecraft.item.ItemStack;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
import thaumcraft.api.aspects.Aspect;
import thaumic.tinkerer.common.core.helper.ItemHashStrategy;
public class VisweaverRecipeMap {
/*
* Hashmap using a hashing strategy suited to comparing items
*/
private static final Object2ObjectOpenCustomHashMap<ItemStack, VisweaverRecipe> recipeMap = new Object2ObjectOpenCustomHashMap<>(
new ItemHashStrategy());
private VisweaverRecipeMap() {}
public static VisweaverRecipe lookup(ItemStack input) {
return recipeMap.get(input);
}
public static void putRecipe(int centivisCost, Aspect centivisType, ItemStack input, ItemStack output) {
VisweaverRecipe recipe = new VisweaverRecipe(centivisCost, centivisType, input, output);
recipeMap.put(input, recipe);
}
}
@@ -40,6 +40,7 @@ import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.client.render.block.RenderInfusedCrops;
import thaumic.tinkerer.client.render.block.RenderMagnet;
import thaumic.tinkerer.client.render.block.RenderRepairer;
import thaumic.tinkerer.client.render.block.RenderVisweaver;
import thaumic.tinkerer.client.render.block.kami.RenderWarpGate;
import thaumic.tinkerer.client.render.item.RenderGenericSeeds;
import thaumic.tinkerer.client.render.item.RenderMobDisplay;
@@ -49,12 +50,14 @@ import thaumic.tinkerer.client.render.tile.RenderTileEnchanter;
import thaumic.tinkerer.client.render.tile.RenderTileFunnel;
import thaumic.tinkerer.client.render.tile.RenderTileMagnet;
import thaumic.tinkerer.client.render.tile.RenderTileRepairer;
import thaumic.tinkerer.client.render.tile.RenderTileVisweaver;
import thaumic.tinkerer.client.render.tile.kami.RenderTileWarpGate;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.tile.TileEnchanter;
import thaumic.tinkerer.common.block.tile.TileFunnel;
import thaumic.tinkerer.common.block.tile.TileMagnet;
import thaumic.tinkerer.common.block.tile.TileRepairer;
import thaumic.tinkerer.common.block.tile.TileVisweaver;
import thaumic.tinkerer.common.block.tile.kami.TileWarpGate;
import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
import thaumic.tinkerer.common.compat.FumeTool;
@@ -114,6 +117,7 @@ public class TTClientProxy extends TTCommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEnchanter.class, new RenderTileEnchanter());
ClientRegistry.bindTileEntitySpecialRenderer(TileFunnel.class, new RenderTileFunnel());
ClientRegistry.bindTileEntitySpecialRenderer(TileRepairer.class, new RenderTileRepairer());
ClientRegistry.bindTileEntitySpecialRenderer(TileVisweaver.class, new RenderTileVisweaver());
LibRenderIDs.idGrain = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(LibRenderIDs.idGrain, new RenderInfusedCrops());
@@ -127,8 +131,10 @@ public class TTClientProxy extends TTCommonProxy {
LibRenderIDs.idMagnet = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idRepairer = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idFire = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idVisweaver = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new RenderMagnet());
RenderingRegistry.registerBlockHandler(new RenderRepairer());
RenderingRegistry.registerBlockHandler(new RenderVisweaver());
MinecraftForgeClient.registerItemRenderer(
ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class),
@@ -0,0 +1,78 @@
package thaumic.tinkerer.client.gui;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.block.tile.TileVisweaver;
import thaumic.tinkerer.common.block.tile.container.ContainerVisweaver;
public class GUIVisweaver extends GuiContainer {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_VISWEAVER);
public TileVisweaver visweaver;
public List<String> tooltip = new ArrayList<>();
int x, y;
ItemStack lastTickStack;
ItemStack currentStack;
public GUIVisweaver(TileVisweaver visweaver, InventoryPlayer inv) {
super(new ContainerVisweaver(visweaver, inv));
this.visweaver = visweaver;
lastTickStack = visweaver.getStackInSlot(0);
currentStack = visweaver.getStackInSlot(0);
}
@Override
public void initGui() {
super.initGui();
x = (width - xSize) / 2;
y = (height - ySize) / 2;
}
@Override
public void updateScreen() {
currentStack = visweaver.getStackInSlot(0);
lastTickStack = currentStack;
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
GL11.glColor4f(1F, 1F, 1F, 1F);
mc.renderEngine.bindTexture(gui);
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
GL11.glEnable(GL11.GL_BLEND);
if (visweaver.isWorking()) {
int pixels = (int) (67D * ((double) visweaver.getInternalVis() / (double) visweaver.getRequiredVis()));
// Draw aspect color to fill
Color color = new Color(visweaver.getCvType().getColor());
GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
drawTexturedModalRect(x + 56, y + 35, 185, 10, pixels, 8);
}
// Draw aspect "container" over progressbar
GL11.glColor3f(1F, 1F, 1F);
drawTexturedModalRect(x + 49, y + 34, 178, 0, 78, 10);
GL11.glDisable(GL11.GL_BLEND);
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
if (!tooltip.isEmpty()) ClientHelper.renderTooltip(par1 - x, par2 - y, tooltip);
tooltip.clear();
}
}
@@ -15,6 +15,7 @@ public final class LibRenderIDs {
public static int idMagnet = -1;
public static int idRepairer = -1;
public static int idVisweaver = -1;
public static int idWarpGate = -1;
@@ -32,6 +32,7 @@ public final class LibResources {
public static final String GUI_ICHOR_POUCH = PREFIX_GUI + "ichorPouch.png";
public static final String GUI_WARP_GATE = PREFIX_GUI + "warpGate.png";
public static final String GUI_REMOTE_PLACER = PREFIX_GUI + "remotePlacer.png";
public static final String GUI_VISWEAVER = PREFIX_GUI + "visweaver.png";
public static final String MISC_R_ENCHANTING = PREFIX_MISC + "r_enchanting.png";
public static final String MISC_AT_CENTER = PREFIX_MISC + "atCenter.png";
@@ -54,6 +55,7 @@ public final class LibResources {
public static final String MODEL_ARMOR_ICHOR_2 = PREFIX_MODEL + "ichor2.png";
public static final String MODEL_ARMOR_ICHOR_GEM_1 = PREFIX_MODEL + "ichorGem1.png";
public static final String MODEL_ARMOR_ICHOR_GEM_2 = PREFIX_MODEL + "ichorGem2.png";
public static final String MODEL_VISWEAVER = PREFIX_MODEL + "visweaver.png";
public static final String ENCHANT_PROTECTION = PREFIX_ENCHANTS + "protection.png";
public static final String ENCHANT_FIRE_PROTECTION = PREFIX_ENCHANTS + "fireProtection.png";
@@ -0,0 +1,134 @@
package thaumic.tinkerer.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import thaumcraft.api.aspects.Aspect;
public class ModelVisweaver extends ModelBase {
public ModelRenderer base;
public ModelRenderer top;
public ModelRenderer pillar1;
public ModelRenderer pillar2;
public ModelRenderer pillar3;
public ModelRenderer pillar4;
public ModelRenderer orbBase;
public ModelRenderer orbIgnis;
public ModelRenderer orbAqua;
public ModelRenderer orbAer;
public ModelRenderer orbTerra;
public ModelRenderer orbOrdo;
public ModelRenderer orbPerditio;
public ModelRenderer orbCarrier;
public ModelVisweaver() {
this.textureWidth = 64;
this.textureHeight = 36;
this.pillar1 = new ModelRenderer(this, 0, 0);
this.pillar1.setRotationPoint(-7.0F, 14.0F, 5.0F);
this.pillar1.addBox(0.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F);
this.pillar2 = new ModelRenderer(this, 0, 0);
this.pillar2.setRotationPoint(5.0F, 14.0F, 5.0F);
this.pillar2.addBox(0.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F);
this.pillar3 = new ModelRenderer(this, 0, 0);
this.pillar3.setRotationPoint(5.0F, 14.0F, -7.0F);
this.pillar3.addBox(0.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F);
this.pillar4 = new ModelRenderer(this, 0, 0);
this.pillar4.setRotationPoint(-7.0F, 14.0F, -7.0F);
this.pillar4.addBox(0.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F);
this.top = new ModelRenderer(this, 0, 0);
this.top.setRotationPoint(-8.0F, 12.0F, -8.0F);
this.top.addBox(0.0F, 0.0F, 0.0F, 16, 2, 16, 0.0F);
this.base = new ModelRenderer(this, 0, 18);
this.base.setRotationPoint(-8.0F, 22.0F, -8.0F);
this.base.addBox(0.0F, 0.0F, 0.0F, 16, 2, 16, 0.0F);
this.orbBase = new ModelRenderer(this, 48, 0);
this.orbBase.setRotationPoint(0, 8, 0);
this.orbBase.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2, 0.0F);
this.orbIgnis = new ModelRenderer(this, 56, 4);
this.orbIgnis.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2, 0.0F);
this.orbIgnis.setRotationPoint(0, 8, 0);
this.orbAqua = new ModelRenderer(this, 56, 12);
this.orbAqua.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2, 0.0F);
this.orbAqua.setRotationPoint(0, 8, 0);
this.orbAer = new ModelRenderer(this, 56, 8);
this.orbAer.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2, 0.0F);
this.orbAer.setRotationPoint(0, 8, 0);
this.orbTerra = new ModelRenderer(this, 48, 8);
this.orbTerra.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2, 0.0F);
this.orbTerra.setRotationPoint(0, 8, 0);
this.orbOrdo = new ModelRenderer(this, 48, 12);
this.orbOrdo.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2, 0.0F);
this.orbOrdo.setRotationPoint(0, 8, 0);
this.orbPerditio = new ModelRenderer(this, 48, 4);
this.orbPerditio.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2, 0.0F);
this.orbPerditio.setRotationPoint(0, 8, 0);
this.orbCarrier = new ModelRenderer(this);
this.orbCarrier.addChild(this.orbBase);
this.orbCarrier.addChild(this.orbIgnis);
this.orbCarrier.addChild(this.orbAqua);
this.orbCarrier.addChild(this.orbAer);
this.orbCarrier.addChild(this.orbTerra);
this.orbCarrier.addChild(this.orbOrdo);
this.orbCarrier.addChild(this.orbPerditio);
}
public void render(boolean isWorking, int tickCounter, Aspect cvType) {
final float scale = 1F / 16F;
float xyRotate = (float) tickCounter / 20F;
float zRotate = (float) tickCounter / 100F;
orbCarrier.rotationPointX = (float) Math.sin((float) tickCounter / 10.0F) * 2.0F;
float orbitRotation = ((float) tickCounter / 40F) % (2F * (float) Math.PI);
setRotateAngle(orbCarrier, 0F, orbitRotation, 0F);
ModelRenderer toRender = getToRender(isWorking, cvType);
setRotateAngle(toRender, xyRotate, xyRotate, zRotate);
toRender.render(scale);
this.pillar3.render(scale);
this.top.render(scale);
this.pillar4.render(scale);
this.base.render(scale);
this.pillar1.render(scale);
this.pillar2.render(scale);
}
private ModelRenderer getToRender(boolean isWorking, Aspect cvType) {
ModelRenderer toRender = orbBase;
if (isWorking) {
if (cvType == Aspect.AIR) {
toRender = orbAer;
} else if (cvType == Aspect.FIRE) {
toRender = orbIgnis;
} else if (cvType == Aspect.ORDER) {
toRender = orbOrdo;
} else if (cvType == Aspect.ENTROPY) {
toRender = orbPerditio;
} else if (cvType == Aspect.WATER) {
toRender = orbAqua;
} else if (cvType == Aspect.EARTH) {
toRender = orbTerra;
}
}
return toRender;
}
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
@@ -0,0 +1,39 @@
package thaumic.tinkerer.client.render.block;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.common.block.tile.TileVisweaver;
public class RenderVisweaver implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
GL11.glPushMatrix();
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileVisweaver(), 0.0D, 0.0D, 0.0D, 0.0F);
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
return false;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return LibRenderIDs.idVisweaver;
}
}
@@ -0,0 +1,44 @@
package thaumic.tinkerer.client.render.tile;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.client.model.ModelVisweaver;
import thaumic.tinkerer.common.block.tile.TileVisweaver;
public class RenderTileVisweaver extends TileEntitySpecialRenderer {
private static final ResourceLocation modelTex = new ResourceLocation(LibResources.MODEL_VISWEAVER);
ModelVisweaver model = new ModelVisweaver();
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
TileVisweaver visweaver = (TileVisweaver) tileentity;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslatef((float) x, (float) y, (float) z);
ClientHelper.minecraft().renderEngine.bindTexture(modelTex);
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
GL11.glScalef(1F, -1F, -1F);
model.render(visweaver.isWorking(), visweaver.getTickCounter(), visweaver.getCvType());
GL11.glRotatef(90F, 1F, 0F, 0F);
GL11.glTranslatef(0F, 0F, -0.6F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
@@ -0,0 +1,150 @@
package thaumic.tinkerer.common.block;
import static thaumic.tinkerer.common.lib.LibBlockNames.VISWEAVER;
import java.util.ArrayList;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.api.VisweaverRecipeMap;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.tile.TileVisweaver;
import thaumic.tinkerer.common.item.ItemSpellCloth;
import thaumic.tinkerer.common.lib.LibGuiIDs;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererInfusionRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
public class BlockVisweaver extends BlockModContainer {
IIcon iconBottom;
IIcon iconTop;
IIcon iconSides;
public BlockVisweaver() {
super(Material.wood);
setHardness(5F);
setResistance(10F);
VisweaverRecipeMap.putRecipe(25, Aspect.FIRE, new ItemStack(Items.bed), new ItemStack(Items.spider_eye));
VisweaverRecipeMap.putRecipe(50, Aspect.EARTH, new ItemStack(Items.brick), new ItemStack(Items.netherbrick));
}
@Override
public Class<? extends TileEntity> getTileEntity() {
return TileVisweaver.class;
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
if (!par1World.isRemote) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if (tile != null) {
par1World.markBlockForUpdate(par2, par3, par4);
par5EntityPlayer
.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_VISWEAVER, par1World, par2, par3, par4);
}
}
return true;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return Blocks.planks.getIcon(0, 1);
}
@Override
public TileEntity createNewTileEntity(World world, int var2) {
return new TileVisweaver();
}
@Override
public ArrayList<Object> getSpecialParameters() {
return null;
}
@Override
public String getBlockName() {
return VISWEAVER;
}
// Only register as part of the GTNH modpack
@Override
public boolean shouldRegister() {
// return Loader.isModLoaded("dreamcraft");
return true;
}
@Override
public boolean shouldDisplayInTab() {
return true;
}
@Override
public int getRenderType() {
return LibRenderIDs.idVisweaver;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_VISWEAVER,
new AspectList().add(Aspect.FIRE, 1).add(Aspect.WATER, 1).add(Aspect.EARTH, 1).add(Aspect.AIR, 1)
.add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
-4,
0,
2,
new ItemStack(this)).setParents(LibResearch.KEY_SPELL_CLOTH)
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_VISWEAVER));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererInfusionRecipe(
LibResearch.KEY_VISWEAVER,
new ItemStack(this),
15,
new AspectList().add(Aspect.MAGIC, 50).add(Aspect.ENERGY, 20).add(Aspect.ELDRITCH, 20)
.add(Aspect.VOID, 20).add(Aspect.MIND, 10),
new ItemStack(Items.bed),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigItems.itemResource, 1, 2),
new ItemStack(ConfigItems.itemResource, 1, 2),
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemSpellCloth.class)));
}
}
@@ -0,0 +1,276 @@
package thaumic.tinkerer.common.block.tile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.visnet.VisNetHandler;
import thaumic.tinkerer.api.VisweaverRecipe;
import thaumic.tinkerer.api.VisweaverRecipeMap;
import thaumic.tinkerer.common.lib.LibBlockNames;
public class TileVisweaver extends TileEntity implements IInventory {
private static final String TAG_INTERNAL_VIS = "internalVis";
private static final String TAG_REQUIRED_VIS = "requiredVis";
private static final String TAG_WORKING = "working";
private static final String TAG_ASPECT = "cvType";
private static final String TAG_INPUT = "currentInput";
private static final String TAG_OUTPUT = "currentOutput";
private int tickCounter;
private int internalVis = 0;
private boolean working = false;
private ItemStack currentOutput;
private ItemStack currentInput;
private Aspect cvType;
private int requiredVis;
ItemStack[] inventorySlots = new ItemStack[2];
@Override
public void updateEntity() {
tickCounter++;
if (worldObj.isRemote) return;
if (working) {
ItemStack currentStack = getStackInSlot(0);
if (currentStack == null || currentInput == null || !currentStack.isItemEqual(currentInput)) {
flushRecipe();
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
if (tickCounter % 20 != 0) return;
if (!working) {
recipeCheck();
} else {
internalVis += VisNetHandler.drainVis(this.worldObj, this.xCoord, this.yCoord, this.zCoord, cvType, 500);
progressRecipe();
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
private void progressRecipe() {
if (internalVis >= requiredVis) {
internalVis -= requiredVis;
finishRecipe();
}
}
private void flushRecipe() {
internalVis = 0;
requiredVis = 0;
currentOutput = null;
currentInput = null;
cvType = null;
working = false;
}
private void recipeCheck() {
VisweaverRecipe recipe = VisweaverRecipeMap.lookup(getStackInSlot(0));
if (recipe != null) {
ItemStack output = recipe.getOutput();
if (canAddToSlot(output, 1) <= 0) return;
cvType = recipe.getCentivisType();
requiredVis = recipe.getCentivisCost();
currentOutput = output;
currentInput = recipe.getInput();
working = true;
}
}
private void finishRecipe() {
decrStackSize(0, 1);
addToSlot(currentOutput, 1);
ItemStack input = getStackInSlot(0);
if (input != null && currentInput.isItemEqual(input) && canAddToSlot(currentOutput, 1) > 0) {
progressRecipe();
} else {
flushRecipe();
recipeCheck();
}
}
@Override
public int getSizeInventory() {
return inventorySlots.length;
}
@Override
public ItemStack getStackInSlot(int slotIn) {
return inventorySlots[slotIn];
}
@Override
public ItemStack decrStackSize(int i, int j) {
if (inventorySlots[i] != null) {
ItemStack stackAt;
if (inventorySlots[i].stackSize <= j) {
stackAt = inventorySlots[i];
inventorySlots[i] = null;
} else {
stackAt = inventorySlots[i].splitStack(j);
if (inventorySlots[i].stackSize == 0) inventorySlots[i] = null;
}
return stackAt;
}
return null;
}
/**
* Returns the amount of items from the input stack that can be stacked into this slot
*/
public int canAddToSlot(ItemStack input, int slot) {
ItemStack currentStack = getStackInSlot(slot);
if (currentStack == null) return Math.min(64, input.stackSize);
if (!currentStack.isItemEqual(input)) return 0;
return Math.min(input.stackSize, 64 - currentStack.stackSize);
}
public void addToSlot(ItemStack stack, int slot) {
int movable = canAddToSlot(stack, slot);
if (movable == 0) return;
ItemStack currentStack = getStackInSlot(slot);
ItemStack newStack = stack.copy();
if (currentStack == null) {
newStack.stackSize = movable;
setInventorySlotContents(slot, newStack);
} else {
currentStack.stackSize += movable;
}
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
return getStackInSlot(i);
}
@Override
public void setInventorySlotContents(int i, ItemStack stack) {
inventorySlots[i] = stack;
}
@Override
public String getInventoryName() {
return LibBlockNames.VISWEAVER;
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this
&& entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
}
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
super.onDataPacket(net, pkt);
readFromNBT(pkt.func_148857_g());
}
@Override
public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
super.readFromNBT(par1NBTTagCompound);
working = par1NBTTagCompound.getBoolean(TAG_WORKING);
internalVis = par1NBTTagCompound.getInteger(TAG_INTERNAL_VIS);
requiredVis = par1NBTTagCompound.getInteger(TAG_REQUIRED_VIS);
cvType = Aspect.getAspect(par1NBTTagCompound.getString(TAG_ASPECT));
currentInput = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag(TAG_INPUT));
currentOutput = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag(TAG_OUTPUT));
NBTTagList var2 = par1NBTTagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
inventorySlots = new ItemStack[getSizeInventory()];
for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
NBTTagCompound var4 = var2.getCompoundTagAt(var3);
byte var5 = var4.getByte("Slot");
if (var5 >= 0 && var5 < inventorySlots.length) inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4);
}
}
@Override
public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
super.writeToNBT(par1NBTTagCompound);
NBTTagCompound input = new NBTTagCompound();
NBTTagCompound output = new NBTTagCompound();
par1NBTTagCompound.setBoolean(TAG_WORKING, working);
par1NBTTagCompound.setInteger(TAG_INTERNAL_VIS, internalVis);
par1NBTTagCompound.setInteger(TAG_REQUIRED_VIS, requiredVis);
if (working) {
par1NBTTagCompound.setString(TAG_ASPECT, cvType.getTag());
par1NBTTagCompound.setTag(TAG_INPUT, currentInput.writeToNBT(input));
par1NBTTagCompound.setTag(TAG_OUTPUT, currentOutput.writeToNBT(output));
}
NBTTagList var2 = new NBTTagList();
for (int var3 = 0; var3 < inventorySlots.length; ++var3) {
if (inventorySlots[var3] != null) {
NBTTagCompound var4 = new NBTTagCompound();
var4.setByte("Slot", (byte) var3);
inventorySlots[var3].writeToNBT(var4);
var2.appendTag(var4);
}
}
par1NBTTagCompound.setTag("Items", var2);
}
@Override
public S35PacketUpdateTileEntity getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound);
}
@Override
public boolean isItemValidForSlot(int index, ItemStack stack) {
return index == 0;
}
public boolean isWorking() {
return working;
}
public int getTickCounter() {
return tickCounter;
}
public Aspect getCvType() {
return cvType;
}
public int getInternalVis() {
return internalVis;
}
public int getRequiredVis() {
return requiredVis;
}
}
@@ -0,0 +1,74 @@
package thaumic.tinkerer.common.block.tile.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import thaumic.tinkerer.common.block.tile.TileVisweaver;
public class ContainerVisweaver extends ContainerPlayerInv {
TileVisweaver visweaver;
public ContainerVisweaver(TileVisweaver visweaver, InventoryPlayer playerInv) {
super(playerInv);
this.visweaver = visweaver;
addSlotToContainer(new Slot(visweaver, 0, 20, 30));
addSlotToContainer(new SlotVisweaverOutput(visweaver, 1, 140, 30));
initPlayerInv();
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(index);
if (slot != null && slot.getHasStack()) {
ItemStack stackInSlot = slot.getStack();
itemstack = stackInSlot.copy();
if (index == 0 || index == 1) {
if (!this.mergeItemStack(stackInSlot, 2, 38, true)) {
return null;
}
slot.onSlotChange(stackInSlot, itemstack);
} else {
if (!this.mergeItemStack(stackInSlot, 0, 1, false)) {
return null;
}
}
if (stackInSlot.stackSize == 0) {
slot.putStack(null);
} else {
slot.onSlotChanged();
}
if (stackInSlot.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(player, stackInSlot);
}
return itemstack;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return visweaver.isUseableByPlayer(player);
}
public static class SlotVisweaverOutput extends Slot {
public SlotVisweaverOutput(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) {
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
}
@Override
public boolean isItemValid(ItemStack stack) {
return false;
}
}
}
@@ -47,9 +47,16 @@ public final class ConfigHandler {
public static int netherDimensionID;
public static int endDimensionID;
public static int bedrockDimensionID = 19;
public static boolean shouldKamiLegsDoLightFeature = false;
public static boolean shouldKamiBootsDoGrass = true;
public static int soulHeartHeight;
public static int visShadowbeamOrder;
public static int visShadowbeamAir;
public static int visShadowbeamEntropy;
public static int baseDamageShadowbeam;
private static Configuration config;
public static void loadConfig(File configFile) {
@@ -59,6 +66,8 @@ public final class ConfigHandler {
new ConfigCategory("enchantments");
new ConfigCategory("general.kami");
new ConfigCategory("balance.shadowbeam");
config.addCustomCategoryComment("general.kami", "These will only be used if KAMI is enabled.");
config.load();
@@ -143,6 +152,39 @@ public final class ConfigHandler {
.getInt("Water Potion id", "potions", 89, 30, 1023, "Set to the potion id for water potion");
potionAirId = config.getInt("Air Potion id", "potions", 86, 30, 1023, "Set to the potion id for air potion");
// Shadowbeam Balance
visShadowbeamAir = config.getInt(
"aer vis cost",
"balance.shadowbeam",
15,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
"vis cost for the aer aspect, 1/100th in-game");
visShadowbeamOrder = config.getInt(
"ordo vis cost",
"balance.shadowbeam",
25,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
"vis cost for the ordo aspect, 1/100th in-game");
visShadowbeamEntropy = config.getInt(
"perditio vis cost",
"balance.shadowbeam",
25,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
"vis cost for the perditio aspect, 1/100th in-game");
baseDamageShadowbeam = config.getInt(
"shadowbeam base damage",
"balance.shadowbeam",
8,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
"base damage of the shadowbeam focus");
if (enableKami) {
bedrockDimensionID = config.getInt(
@@ -188,6 +230,16 @@ public final class ConfigHandler {
-1023,
1023,
"The Dimension ID for the End, leave at 1 if you don't modify it with another mod/plugin.");
shouldKamiLegsDoLightFeature = config.getBoolean(
"Kami Leggings Light Placing Feature Enabled",
"general.kami",
shouldKamiLegsDoLightFeature,
"Sets if Legs of the Burning Mantle (Awakened Kami leggings) will do the effect where it places lights near you.");
shouldKamiBootsDoGrass = config.getBoolean(
"Kami Boots Dirt into Grass Feature Enabled",
"general.kami",
shouldKamiBootsDoGrass,
"Sets if Boots of the Horizontal Shield (Awakened Kami Boots) will do the effect where dirt under you turns into grass.");
}
LibEnchantIDs.idAscentBoost = loadEnchant(LibEnchantNames.ASCENT_BOOST, LibEnchantIDs.idAscentBoost);
@@ -208,7 +208,7 @@ public class AspectCropLootManager {
addAspectLoot(Aspect.ENERGY, new ItemStack(ConfigItems.itemResource, 12));
addAspectLoot(Aspect.MAGIC, "shard");
addAspectLoot(Aspect.MAGIC, "materialAspectShard");
addAspectLoot(Aspect.HEAL, new ItemStack(Items.golden_apple));
@@ -0,0 +1,26 @@
package thaumic.tinkerer.common.core.helper;
import java.util.Objects;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import it.unimi.dsi.fastutil.Hash;
/*
* Simple hashing strategy that can properly compare items
*/
public class ItemHashStrategy implements Hash.Strategy<ItemStack> {
@Override
public int hashCode(@Nullable ItemStack key) {
return key == null ? 0 : Objects.hash(key.getItem(), key.getItemDamage());
}
@Override
public boolean equals(@Nullable ItemStack key, @Nullable ItemStack value) {
if (key == null || value == null) return false;
return key.isItemEqual(value);
}
}
@@ -71,7 +71,7 @@ public class ModEnchantmentHandler {
int finalStrike = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.finalStrike, heldItem);
if (finalStrike > 0) {
Random rand = new Random();
if (rand.nextInt(20 - finalStrike) == 0) {
if ((finalStrike >= 19 || rand.nextInt(20 - finalStrike) == 0)) {
event.ammount *= 3;
}
}
@@ -154,10 +154,14 @@ public class ModEnchantmentHandler {
int quickDraw = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.idQuickDraw, heldItem);
ItemStack usingItem = player.itemInUse;
int time = player.itemInUseCount;
if (quickDraw > 0 && usingItem != null && usingItem.getItem() instanceof ItemBow)
if ((usingItem.getItem().getMaxItemUseDuration(usingItem) - time) % (6 - quickDraw) == 0)
player.itemInUseCount = time - 1;
if (quickDraw > 0 && usingItem != null && usingItem.getItem() instanceof ItemBow) {
int speedup = quickDraw / 6;
quickDraw = quickDraw % 6;
if (player.itemInUseCount % (6 - quickDraw) == 0) {
speedup++;
}
player.itemInUseCount = Math.max(2, player.itemInUseCount - speedup);
}
}
}
@@ -12,7 +12,10 @@
package thaumic.tinkerer.common.item;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.UUID;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
@@ -26,8 +29,6 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import org.apache.commons.lang3.ArrayUtils;
import baubles.api.BaubleType;
import baubles.api.BaublesApi;
import baubles.api.IBauble;
@@ -60,6 +61,11 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
private IIcon enabledIcon;
private static final int EFFECT_BURNING = -1;
// 0 = no effect, otherwise either EFFECT_BURNING or the ID of the effect removed.
private HashMap<UUID, Integer> mLastEffectRemoved = new HashMap<>();
private final HashMap<UUID, Collection<Integer>> mPermanentEffects = new HashMap<>();
public ItemCleansingTalisman() {
setMaxStackSize(1);
setMaxDamage(LibFeatures.CLEANSING_TALISMAN_USES);
@@ -142,6 +148,12 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
return EnumRarity.uncommon;
}
@Override
public int getItemEnchantability() {
// Equivalent to iron.
return 10;
}
@Override
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.AMULET;
@@ -153,15 +165,48 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
if (isEnabled(par1ItemStack) && !par2World.isRemote) {
if (player.ticksExisted % 20 == 0) {
if (player instanceof EntityPlayer) {
boolean removed = false;
int damage = 1;
Collection<PotionEffect> potions = player.getActivePotionEffects();
int lastEffectRemoved;
Collection<Integer> permanentEffects;
UUID uuid = player.getUniqueID();
if (mPermanentEffects.containsKey(uuid)) {
lastEffectRemoved = mLastEffectRemoved.get(uuid);
permanentEffects = mPermanentEffects.get(uuid);
} else {
lastEffectRemoved = 0;
permanentEffects = new HashSet<>();
mLastEffectRemoved.put(uuid, lastEffectRemoved);
mPermanentEffects.put(uuid, permanentEffects);
}
// All effects we try to remove in this operation, including permanent effects.
Collection<Integer> effectsToRemove = new HashSet<>();
// One new effect we remove this operation, with a durability cost.
int effectRemoved = 0;
if (player.isBurning()) {
player.extinguish();
removed = true;
} else for (PotionEffect potion : potions) {
if (permanentEffects.contains(EFFECT_BURNING)) {
// Remove permanent effects at no cost.
effectsToRemove.add(EFFECT_BURNING);
} else if (lastEffectRemoved == EFFECT_BURNING) {
// We removed burning last time, player is on fire permanently.
permanentEffects.add(EFFECT_BURNING);
effectsToRemove.add(EFFECT_BURNING);
} else if (effectRemoved == 0) {
// Actually remove burning.
effectsToRemove.add(EFFECT_BURNING);
effectRemoved = EFFECT_BURNING;
}
}
Collection<PotionEffect> potions = player.getActivePotionEffects();
for (PotionEffect potion : potions) {
// Skip effects without a duration; e.g., dolly, TiC cleaver, etc.
if (potion.duration < 20) {
continue;
}
int id = potion.getPotionID();
boolean badEffect;
badEffect = ReflectionHelper.getPrivateValue(
@@ -171,28 +216,57 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
if (Potion.potionTypes[id] instanceof PotionWarpWard) {
badEffect = false;
}
if (badEffect) {
player.removePotionEffect(id);
removed = true;
int[] warpPotionIDs = new int[] { Config.potionBlurredID, Config.potionDeathGazeID,
Config.potionInfVisExhaustID, Config.potionSunScornedID, Config.potionUnHungerID };
if (ArrayUtils.contains(warpPotionIDs, potion.getPotionID())) {
damage = 10;
if (permanentEffects.contains(id)) {
// Remove permanent effects at no cost.
effectsToRemove.add(id);
} else if (lastEffectRemoved == id) {
// We removed this effect last time, player is affected by this permanently.
effectsToRemove.add(id);
permanentEffects.add(id);
} else if (effectRemoved == 0) {
// Actually remove the effect.
effectsToRemove.add(id);
effectRemoved = id;
}
break;
}
}
if (removed) {
for (int effectID : effectsToRemove) {
if (effectID == EFFECT_BURNING) {
player.extinguish();
} else {
player.removePotionEffect(effectID);
}
}
// True if some permanent effects are no longer affecting the player.
boolean permanentRemoved = permanentEffects.retainAll(effectsToRemove);
if (effectRemoved != 0) {
int damage = 1;
if (effectRemoved == Config.potionBlurredID || effectRemoved == Config.potionDeathGazeID
|| effectRemoved == Config.potionInfVisExhaustID
|| effectRemoved == Config.potionSunScornedID
|| effectRemoved == Config.potionUnHungerID) {
damage = 10;
}
par1ItemStack.damageItem(damage, player);
if (par1ItemStack.getItemDamage() <= 0) {
BaublesApi.getBaubles((EntityPlayer) player).setInventorySlotContents(0, null); // Slot 0 =
// Talisman
// Slot
if (par1ItemStack.stackSize <= 0) {
// Slot 0 = talisman slot.
BaublesApi.getBaubles((EntityPlayer) player).setInventorySlotContents(0, null);
}
}
if (effectRemoved != 0 || permanentRemoved) {
par2World.playSoundAtEntity(player, "thaumcraft:wand", 0.3F, 0.1F);
}
lastEffectRemoved = effectRemoved;
mLastEffectRemoved.put(uuid, lastEffectRemoved);
}
}
}
@@ -1,6 +1,5 @@
package thaumic.tinkerer.common.item;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,9 +16,12 @@ import net.minecraftforge.common.util.Constants;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigItems;
import thaumcraft.common.lib.research.PlayerKnowledge;
import thaumcraft.common.lib.research.ResearchManager;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
@@ -36,7 +38,9 @@ import thaumic.tinkerer.common.research.TTResearchItem;
public class ItemShareBook extends ItemBase {
private static final String TAG_PLAYER = "player";
private static final String NON_ASIGNED = "[none]";
private static final String TAG_RESEARCH = "research";
private static final String TAG_ASPECTS = "aspects";
private static final String NON_ASSIGNED = "[none]";
public ItemShareBook() {
super();
@@ -83,44 +87,57 @@ public class ItemShareBook extends ItemBase {
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
String name = getPlayerName(par1ItemStack);
if (name.endsWith(NON_ASIGNED)) {
setPlayerName(par1ItemStack, par3EntityPlayer.getGameProfile().getName());
setPlayerResearch(par1ItemStack, par3EntityPlayer.getGameProfile().getName());
if (!par2World.isRemote)
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.write"));
} else sync: {
List<String> researchesDone = ResearchManager.getResearchForPlayer(name);
if (researchesDone == null) {
if (par2World.isRemote) researchesDone = getPlayerResearch(par1ItemStack);
else {
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync"));
break sync;
}
public ItemStack onItemRightClick(ItemStack bookStack, World world, EntityPlayer player) {
String name = getPlayerName(bookStack);
if (name.endsWith(NON_ASSIGNED)) {
setPlayerName(bookStack, player.getGameProfile().getName());
savePlayerResearch(ItemNBTHelper.getNBT(bookStack), player.getGameProfile().getName());
if (!world.isRemote) {
player.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.write"));
}
} else {
// Try to load latest research for the saved player, fall back to the stored NBT if it fails.
final NBTTagCompound researchSource;
if (ResearchManager.getResearchForPlayer(name) != null) {
researchSource = new NBTTagCompound();
savePlayerResearch(researchSource, name);
} else {
researchSource = ItemNBTHelper.getNBT(bookStack);
}
for (String key : researchesDone)
ThaumicTinkerer.tcProxy.getResearchManager().completeResearch(par3EntityPlayer, key);
loadPlayerResearch(researchSource, player);
if (!par2World.isRemote)
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync"));
if (!world.isRemote) {
player.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync"));
}
}
return par1ItemStack;
return bookStack;
}
private List<String> getPlayerResearch(ItemStack par1ItemStack) {
List<String> retVals = new ArrayList<>();
NBTTagCompound cmp = ItemNBTHelper.getNBT(par1ItemStack);
if (!cmp.hasKey("research")) return retVals;
NBTTagList list = cmp.getTagList("research", Constants.NBT.TAG_STRING);
for (int i = 0; i < list.tagCount(); i++) {
retVals.add(list.getStringTagAt(i));
private void loadPlayerResearch(NBTTagCompound cmp, EntityPlayer player) {
// Ensure full TC player data gets loaded
final String playerName = player.getGameProfile().getName();
ResearchManager.getResearchForPlayer(playerName);
if (cmp.hasKey(TAG_RESEARCH)) {
final NBTTagList list = cmp.getTagList(TAG_RESEARCH, Constants.NBT.TAG_STRING);
for (int i = 0; i < list.tagCount(); i++) {
final String research = list.getStringTagAt(i);
ThaumicTinkerer.tcProxy.getResearchManager().completeResearch(player, research);
}
}
if (cmp.hasKey(TAG_ASPECTS)) {
final PlayerKnowledge pk = ThaumicTinkerer.tcProxy.getPlayerKnowledge();
final NBTTagList list = cmp.getTagList(TAG_ASPECTS, Constants.NBT.TAG_STRING);
for (int i = 0; i < list.tagCount(); i++) {
final String aspectTag = list.getStringTagAt(i);
final Aspect aspect = Aspect.getAspect(aspectTag);
if (aspect != null) {
pk.addDiscoveredAspect(playerName, aspect);
}
}
ResearchManager.scheduleSave(player);
}
return retVals;
}
@Override
@@ -134,7 +151,7 @@ public class ItemShareBook extends ItemBase {
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
String name = getPlayerName(par1ItemStack);
par3List.add(
name.equals(NON_ASIGNED) ? StatCollector.translateToLocal("ttmisc.shareTome.noAssign")
name.equals(NON_ASSIGNED) ? StatCollector.translateToLocal("ttmisc.shareTome.noAssign")
: String.format(StatCollector.translateToLocal("ttmisc.shareTome.playerName"), name));
}
@@ -144,21 +161,32 @@ public class ItemShareBook extends ItemBase {
}
private String getPlayerName(ItemStack stack) {
return ItemNBTHelper.getString(stack, TAG_PLAYER, NON_ASIGNED);
return ItemNBTHelper.getString(stack, TAG_PLAYER, NON_ASSIGNED);
}
private void setPlayerName(ItemStack stack, String playerName) {
ItemNBTHelper.setString(stack, TAG_PLAYER, playerName);
}
private void setPlayerResearch(ItemStack stack, String playername) {
List<String> researchesDone = ResearchManager.getResearchForPlayer(playername);
NBTTagCompound cmp = ItemNBTHelper.getNBT(stack);
NBTTagList list = new NBTTagList();
for (String tag : researchesDone) {
list.appendTag(new NBTTagString(tag));
private void savePlayerResearch(NBTTagCompound target, String playername) {
// also loads the aspect list
final List<String> researchesDone = ResearchManager.getResearchForPlayer(playername);
// Save all unlocked research notes.
final NBTTagList researchList = new NBTTagList();
for (final String tag : researchesDone) {
researchList.appendTag(new NBTTagString(tag));
}
cmp.setTag("research", list);
target.setTag(TAG_RESEARCH, researchList);
// Save all discovered aspect types.
final PlayerKnowledge pk = Thaumcraft.proxy.getPlayerKnowledge();
final NBTTagList aspectsToSave = new NBTTagList();
final AspectList aspectsDiscovered = pk.getAspectsDiscovered(playername);
if (aspectsDiscovered == null) {
return;
}
aspectsDiscovered.aspects.keySet().stream().map(Aspect::getTag).sorted().map(NBTTagString::new)
.forEach(aspectsToSave::appendTag);
target.setTag(TAG_ASPECTS, aspectsToSave);
}
@Override
@@ -67,11 +67,13 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv {
player.jumpMovementFactor = player.isSprinting() ? 0.05F : 0.04F;
player.fallDistance = 0F;
int x = (int) player.posX;
int y = (int) player.posY - 1;
int z = (int) player.posZ;
if (player.worldObj.getBlock(x, y, z) == Blocks.dirt && player.worldObj.getBlockMetadata(x, y, z) == 0)
player.worldObj.setBlock(x, y, z, Blocks.grass, 0, 2);
if (ConfigHandler.shouldKamiBootsDoGrass) {
int x = (int) player.posX;
int y = (int) player.posY - 1;
int z = (int) player.posZ;
if (player.worldObj.getBlock(x, y, z) == Blocks.dirt && player.worldObj.getBlockMetadata(x, y, z) == 0)
player.worldObj.setBlock(x, y, z, Blocks.grass, 0, 2);
}
}
@Override
@@ -85,7 +85,9 @@ public class ItemGemLegs extends ItemIchorclothArmorAdv {
if (player.isBurning()) player.heal(0.5F);
addPotionEffect(player, Potion.fireResistance, 119, -1);
setNearBrightNitor(player);
if (ConfigHandler.shouldKamiLegsDoLightFeature) {
setNearBrightNitor(player);
}
}
}
@@ -37,10 +37,10 @@ import thaumic.tinkerer.common.research.ResearchHelper;
public class ItemFocusShadowbeam extends ItemModKamiFocus {
private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, 500).add(Aspect.ENTROPY, 500)
.add(Aspect.AIR, 300);
private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, ConfigHandler.visShadowbeamOrder)
.add(Aspect.ENTROPY, ConfigHandler.visShadowbeamEntropy).add(Aspect.AIR, ConfigHandler.visShadowbeamAir);
private static final int DAMAGE = 100;
private static final int DAMAGE = ConfigHandler.baseDamageShadowbeam;
public ItemFocusShadowbeam() {
super();
@@ -37,4 +37,5 @@ public final class LibBlockIDs {
public static int idSpawner = 2633;
public static int idPortal = 2816;
public static int idGolemConnector = 2817;
public static int idVisweaver = 2818;
}
@@ -68,4 +68,6 @@ public final class LibBlockNames {
public static final String INFUSED_GRAIN_BLOCK = INFUSED_GRAIN_BASE + "Block";
public static final String FORCEFIELD = "forcefield";
public static final String VISWEAVER = "visweaver";
}
@@ -22,4 +22,5 @@ public final class LibGuiIDs {
public static final int GUI_ID_ICHOR_POUCH = 50;
public static final int GUI_ID_WARP_GATE = 51;
public static final int GUI_ID_WARP_GATE_DESTINATIONS = 52;
public static final int GUI_ID_VISWEAVER = 53;
}
@@ -11,11 +11,13 @@
*/
package thaumic.tinkerer.common.lib;
import thaumic.tinkerer.Tags;
public final class LibMisc {
public static final String MOD_ID = "ThaumicTinkerer";
public static final String MOD_NAME = "Thaumic Tinkerer";
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String VERSION = Tags.VERSION;
public static final String NETWORK_CHANNEL = MOD_ID;
@@ -41,6 +41,7 @@ public final class LibResearch {
public static final String KEY_ENCHANT_DESINTEGRATE = "TTENCH_DESINTEGRATE";
public static final String KEY_ENCHANT_QUICK_DRAW = "TTENCH_QUICK_DRAW";
public static final String KEY_ENCHANT_VAMPIRISM = "TTENCH_VAMPIRISM";
public static final String KEY_VISWEAVER = "VISWEAVER";
public static final String KEY_ENCHANT_DISPERSED_STRIKE = "TTENCH_DISPERSED";
public static final String KEY_ENCHANT_FINAL_STRIKE = "TTENCH_FINAL";
@@ -16,6 +16,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import thaumic.tinkerer.client.gui.GUIVisweaver;
import thaumic.tinkerer.client.gui.GuiAnimationTablet;
import thaumic.tinkerer.client.gui.GuiAspectAnalyzer;
import thaumic.tinkerer.client.gui.GuiEnchanting;
@@ -28,11 +29,13 @@ import thaumic.tinkerer.common.block.tile.TileAspectAnalyzer;
import thaumic.tinkerer.common.block.tile.TileEnchanter;
import thaumic.tinkerer.common.block.tile.TileMobMagnet;
import thaumic.tinkerer.common.block.tile.TileRPlacer;
import thaumic.tinkerer.common.block.tile.TileVisweaver;
import thaumic.tinkerer.common.block.tile.container.ContainerAnimationTablet;
import thaumic.tinkerer.common.block.tile.container.ContainerAspectAnalyzer;
import thaumic.tinkerer.common.block.tile.container.ContainerEnchanter;
import thaumic.tinkerer.common.block.tile.container.ContainerMobMagnet;
import thaumic.tinkerer.common.block.tile.container.ContainerRemotePlacer;
import thaumic.tinkerer.common.block.tile.container.ContainerVisweaver;
import thaumic.tinkerer.common.block.tile.container.kami.ContainerIchorPouch;
import thaumic.tinkerer.common.block.tile.container.kami.ContainerWarpGate;
import thaumic.tinkerer.common.block.tile.kami.TileWarpGate;
@@ -58,6 +61,9 @@ public class GuiHandler implements IGuiHandler {
case LibGuiIDs.GUI_ID_ASPECT_ANALYZER:
return new ContainerAspectAnalyzer((TileAspectAnalyzer) tile, player.inventory);
case LibGuiIDs.GUI_ID_VISWEAVER:
return new ContainerVisweaver((TileVisweaver) tile, player.inventory);
case LibGuiIDs.GUI_ID_ICHOR_POUCH:
if (!isDimensionAllowed(player)) return null;
return new ContainerIchorPouch(player);
@@ -86,6 +92,9 @@ public class GuiHandler implements IGuiHandler {
case LibGuiIDs.GUI_ID_ASPECT_ANALYZER:
return new GuiAspectAnalyzer((TileAspectAnalyzer) tile, player.inventory);
case LibGuiIDs.GUI_ID_VISWEAVER:
return new GUIVisweaver((TileVisweaver) tile, player.inventory);
case LibGuiIDs.GUI_ID_ICHOR_POUCH:
if (!isDimensionAllowed(player)) return null;
return new GuiIchorPouch(new ContainerIchorPouch(player));
@@ -180,6 +180,7 @@ tile.Levitational Locomotive.name=Levitational Locomotive
tile.Levitational Locomotive Relay.name=Levitational Locomotive Relay
tile.golemConnector.name=Golem Connector
tile.remotePlacer.name=Remote Placer
tile.visweaver.name=Visweaver
# KAMI BLOCK NAMES
tile.warpGate.name=Celestial Gateway
@@ -440,7 +441,7 @@ ttresearch.page.REVEALING_HELM.0=As it turns out, goggles don't offer much prote
# -- THAUMIC REHABILITATOR
ttresearch.name.REPAIRER=Thaumic Restorer
ttresearch.lore.REPAIRER=Undoing the damage you've done
ttresearch.page.REPAIRER.0=You created a new contraption to restore broken tools. By right clicking this block with a broken tool and hooking it to essentia tubes, it'll gather essentia to repair the tool.<BR><BR>The essentia that will repair, items is Instrumentum.<BR><BR>Looking at the block with goggles of revealing also shows how worn down the item in it still is. Redstone current will be emitted while an item is being repaired.
ttresearch.page.REPAIRER.0=You created a new contraption to restore broken tools. By right clicking this block with a broken tool and hooking it to essentia tubes, it'll gather essentia to repair the tool.<BR><BR>The essentia that will repair items is Instrumentum.<BR><BR>Looking at the block with goggles of revealing also shows how worn down the item in it still is. Redstone current will be emitted while an item is being repaired.
# -- WAND FOCUS: DISTORTION
ttresearch.name.FOCUS_DEFLECT=Wand Focus: Distortion
@@ -623,6 +624,11 @@ ttresearch.page.INFUSED_POTIONS.3=There are two ways to give crops primal tenden
ttresearch.page.INFUSED_POTIONS.4=Crops will also drain tendencies from nearby crops. A crop will drain points from an adjacent crop with an equal or greater number of points.
ttresearch.page.INFUSED_POTIONS.5=Some plants will create special grain, which can be made into potions. <BR> Earth infused potions summons barriers between mobs that attack you. <BR> Fire infused potions trap your enemies in a sphere of fire. <BR> Air infused potions send your enemies up in the air. <BR> Water infused potions chill surrounding lava.
# -- VISWEAVER
ttresearch.name.VISWEAVER=Visweaver
ttresearch.lore.VISWEAVER=Transmutation through vis
ttresearch.page.VISWEAVER.0=Some objects in this world can be altered to different states purely by nudging the balance of primal essentia, it seems. You've designed a device to do just that by infusing large amounts of centivis into items.
# -- WAILA
ttwaila.nothing=Nothing
ttwaila.currentTool=Current Tool: %s
@@ -441,7 +441,7 @@ ttresearch.page.REVEALING_HELM.0=As it turns out, goggles don't offer much prote
# -- THAUMIC REHABILITATOR
ttresearch.name.REPAIRER=Réparateur thaumique
ttresearch.lore.REPAIRER=L'outil du parfait Patrick
ttresearch.page.REPAIRER.0=You created a new contraption to restore broken tools. By right clicking this block with a broken tool and hooking it to essentia tubes, it'll gather essentia to repair the tool.<BR><BR>The essentia that will repair, items is Instrumentum.<BR><BR>Looking at the block with goggles of revealing also shows how worn down the item in it still is. Redstone current will be emitted while an item is being repaired.
ttresearch.page.REPAIRER.0=You created a new contraption to restore broken tools. By right clicking this block with a broken tool and hooking it to essentia tubes, it'll gather essentia to repair the tool.<BR><BR>The essentia that will repair items is Instrumentum.<BR><BR>Looking at the block with goggles of revealing also shows how worn down the item in it still is. Redstone current will be emitted while an item is being repaired.
# -- WAND FOCUS: DISTORTION
ttresearch.name.FOCUS_DEFLECT=Foci de baguette: Distortion
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB