mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Compare commits
94
Commits
2.8.0
..
2.12.5-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfd7aa0b63 | ||
|
|
27d3a6605b | ||
|
|
f3a91d0bb0 | ||
|
|
bbe1e7f50f | ||
|
|
a301460c05 | ||
|
|
284252d01e | ||
|
|
13233ce226 | ||
|
|
8ff5a8cf52 | ||
|
|
b9e61335e3 | ||
|
|
e21f0d4b71 | ||
|
|
0272517b10 | ||
|
|
8782f7c6a7 | ||
|
|
58676ab46d | ||
|
|
1b1f29248b | ||
|
|
444ba9b2eb | ||
|
|
2127d30d16 | ||
|
|
e724c5f6db | ||
|
|
5268737e2e | ||
|
|
5b3fdb573b | ||
|
|
c075644243 | ||
|
|
b0149792dc | ||
|
|
fb797174fc | ||
|
|
a899b9247a | ||
|
|
7fe9061716 | ||
|
|
e95d6c870c | ||
|
|
0a584bbefd | ||
|
|
997ab33afd | ||
|
|
29477bd935 | ||
|
|
5339e50417 | ||
|
|
6d278db79d | ||
|
|
dd74a57537 | ||
|
|
4f2618d03b | ||
|
|
824f17a455 | ||
|
|
c2cbc66645 | ||
|
|
fdb350d6f5 | ||
|
|
df4a8cfca9 | ||
|
|
af8b938126 | ||
|
|
f908d2edd5 | ||
|
|
a35c36c677 | ||
|
|
eff2d13893 | ||
|
|
942f8a398b | ||
|
|
00e831c20f | ||
|
|
716c464ac0 | ||
|
|
7fbffb3aa7 | ||
|
|
7b02309128 | ||
|
|
c9be818502 | ||
|
|
3e96d49fef | ||
|
|
64d179543c | ||
|
|
e1d8a847a9 | ||
|
|
38fb7fc71f | ||
|
|
6479b0b635 | ||
|
|
5b388b5cba | ||
|
|
3cc1026704 | ||
|
|
2a548be7d8 | ||
|
|
dce00bbc74 | ||
|
|
63bf13c964 | ||
|
|
2151886e83 | ||
|
|
aeb6392d52 | ||
|
|
c221b7b03b | ||
|
|
bf664d00c8 | ||
|
|
7f7c4083cc | ||
|
|
d3f9b102d6 | ||
|
|
0f74be83ac | ||
|
|
a61d4b6d9f | ||
|
|
e4d716addb | ||
|
|
393eec213c | ||
|
|
40ce1b4c61 | ||
|
|
292be28f00 | ||
|
|
3809971825 | ||
|
|
db796ae830 | ||
|
|
d92266f5e3 | ||
|
|
304fed71dd | ||
|
|
bd2506a479 | ||
|
|
62a9677326 | ||
|
|
b259785bbc | ||
|
|
d4191557af | ||
|
|
6670fcdb5f | ||
|
|
2058c309d4 | ||
|
|
2633f752f3 | ||
|
|
8ce7293034 | ||
|
|
0432ff0d30 | ||
|
|
180509a1a9 | ||
|
|
1f27b14054 | ||
|
|
22e8c36aae | ||
|
|
0212dd084a | ||
|
|
d54311fb11 | ||
|
|
4a20fa3b06 | ||
|
|
97e8cdf407 | ||
|
|
0c75584ccb | ||
|
|
47ffee8cd3 | ||
|
|
3660fb23b5 | ||
|
|
b1388aeb80 | ||
|
|
d922bfbdbf | ||
|
|
7c2c6b7966 |
No files matched your search
@@ -30,3 +30,4 @@ src/main/resources/mixins.*([!.]).json
|
||||
*.bat
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
layout.json
|
||||
-1591
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id("com.gtnewhorizons.gtnhconvention")
|
||||
}
|
||||
+25
-16
@@ -1,23 +1,32 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:Baubles:1.0.1.14:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-195-GTNH:api')
|
||||
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev')
|
||||
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-752-GTNH:api')
|
||||
api('com.github.GTNewHorizons:ThaumicBoots:1.5.2:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Electro-Magic-Tools'
|
||||
exclude module: 'Baubles'
|
||||
}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.9.1-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.6:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.29:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.4.11:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.5.19:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.1-GTNH:api') {transitive=false}
|
||||
|
||||
compileOnly('curse.maven:computercraft-67504:2269339')
|
||||
compileOnly('curse.maven:cofh-lib-220333:2388748')
|
||||
compileOnly('curse.maven:cofh-core-69162:2388751')
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.13.6-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.5.0:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.6:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.8.0:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.9.15:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.14.14-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.7.2:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenCore:1.4.10:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.6-GTNH:api') {transitive=false}
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:api') {transitive=false}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.134:dev") {exclude group: 'com.github.GTNewHorizons', module: 'ThaumicTinkerer'}
|
||||
compileOnly('curse.maven:computercraft-67504:2269339')
|
||||
compileOnly('curse.maven:cofh-core-69162:2388751')
|
||||
|
||||
// For testing purposes
|
||||
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:Electro-Magic-Tools:1.7.6:dev")
|
||||
|
||||
runtimeOnly('com.github.GTNewHorizons:TCNEIAdditions:1.5.4:dev') {
|
||||
exclude module: 'Baubles'
|
||||
}
|
||||
}
|
||||
+174
-25
@@ -1,66 +1,215 @@
|
||||
# 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.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
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 = true
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# 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 = true
|
||||
|
||||
# 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
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# 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!
|
||||
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this 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 CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# 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: UniMixins 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 customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||
# runClientWorkingDirectory = run/client
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||
# runServerWorkingDirectory = run/server
|
||||
|
||||
# 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
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e1118b4c7c2858d28154d086dbff010e/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/832229f0f6f0be60ed817c5a5e5848eb/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,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 +85,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 -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -111,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -130,10 +132,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 +146,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 +154,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
|
||||
@@ -166,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -198,16 +202,15 @@ 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, 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" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+13
-12
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -43,11 +45,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,22 +59,21 @@ 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
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
+8
-20
@@ -1,27 +1,15 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'GTNH Maven'
|
||||
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||
allowInsecureProtocol
|
||||
}
|
||||
maven {
|
||||
name 'ic2'
|
||||
url 'https://maven.ic2.player.to/'
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
name = 'glease'
|
||||
url = 'https://maven.glease.net/repos/releases/'
|
||||
}
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://cursemaven.com'
|
||||
content {
|
||||
includeGroup "curse.maven"
|
||||
filter {
|
||||
includeGroup('net.glease')
|
||||
}
|
||||
|
||||
}
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name = "GTNH Maven"
|
||||
url = uri("https://nexus.gtnewhorizons.com/repository/public/")
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons")
|
||||
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("com.gtnewhorizons.gtnhsettingsconvention") version "2.0.5"
|
||||
}
|
||||
|
||||
|
||||
+19
-29
@@ -8,7 +8,6 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
@@ -17,63 +16,54 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
import thaumic.tinkerer.common.registry.TTRegistry;
|
||||
|
||||
public final class PlacementMirrorPredictionRenderer {
|
||||
|
||||
RenderBlocks blockRender = new RenderBlocks();
|
||||
private final RenderBlocks blockRender;
|
||||
|
||||
public PlacementMirrorPredictionRenderer() {
|
||||
this.blockRender = new RenderBlocks();
|
||||
blockRender.useInventoryTint = false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldRenderLast(RenderWorldLastEvent event) {
|
||||
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
List<EntityPlayer> playerEntities = world.playerEntities;
|
||||
for (EntityPlayer player : playerEntities) {
|
||||
ItemStack currentStack = player.getCurrentEquippedItem();
|
||||
if (currentStack != null
|
||||
&& currentStack.getItem()
|
||||
== ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class)
|
||||
&& ItemPlacementMirror.getBlock(currentStack) != Blocks.air) {
|
||||
if (currentStack != null && currentStack.getItem() == TTRegistry.itemPlacementMirror) {
|
||||
renderPlayerLook(player, currentStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderPlayerLook(EntityPlayer player, ItemStack stack) {
|
||||
ChunkCoordinates[] coords = ItemPlacementMirror.getBlocksToPlace(stack, player);
|
||||
if (ItemPlacementMirror.hasBlocks(stack, player, coords)) {
|
||||
ItemStack block = new ItemStack(
|
||||
ItemPlacementMirror.getBlock(stack),
|
||||
1,
|
||||
ItemPlacementMirror.getBlockMeta(stack));
|
||||
ChunkCoordinates lastCoords = new ChunkCoordinates(0, 0, 0);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Block requiredBlock = ItemPlacementMirror.getBlock(stack);
|
||||
if (requiredBlock == null) return;
|
||||
int requiredMetadata = ItemPlacementMirror.getBlockMeta(stack);
|
||||
List<ChunkCoordinates> coords = ItemPlacementMirror.getBlocksToPlace(stack, player);
|
||||
if (ItemPlacementMirror.hasBlocks(player, requiredBlock, requiredMetadata, coords.size())) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 0.6F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
for (ChunkCoordinates coord : coords) {
|
||||
renderBlockAt(block, coord, lastCoords);
|
||||
lastCoords = coord;
|
||||
renderBlockAt(requiredBlock, requiredMetadata, coord);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
}
|
||||
|
||||
private void renderBlockAt(ItemStack block, ChunkCoordinates pos, ChunkCoordinates last) {
|
||||
if (block.getItem() == null) return;
|
||||
private void renderBlockAt(Block block, int metadata, ChunkCoordinates pos) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(
|
||||
pos.posX + 0.5 - RenderManager.renderPosX,
|
||||
pos.posY + 0.5 - RenderManager.renderPosY,
|
||||
pos.posZ + 0.5 - RenderManager.renderPosZ);
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 0.6F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
blockRender.useInventoryTint = false;
|
||||
blockRender.renderBlockAsItem(Block.getBlockFromItem(block.getItem()), block.getItemDamage(), 1F);
|
||||
|
||||
blockRender.renderBlockAsItem(block, metadata, 1F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
package thaumic.tinkerer.client.core.handler.kami;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
@@ -44,7 +44,11 @@ import thaumic.tinkerer.client.render.block.kami.RenderWarpGate;
|
||||
import thaumic.tinkerer.client.render.item.RenderGenericSeeds;
|
||||
import thaumic.tinkerer.client.render.item.RenderMobDisplay;
|
||||
import thaumic.tinkerer.client.render.item.kami.RenderPlacementMirror;
|
||||
import thaumic.tinkerer.client.render.tile.*;
|
||||
import thaumic.tinkerer.client.render.tile.RenderTileAnimationTablet;
|
||||
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.kami.RenderTileWarpGate;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.tile.TileEnchanter;
|
||||
|
||||
@@ -38,7 +38,6 @@ public class GuiAnimationTablet extends GuiContainer {
|
||||
int x, y;
|
||||
|
||||
TileAnimationTablet tablet;
|
||||
List<GuiButtonAT> buttonListAT = new ArrayList<>();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
|
||||
public GuiAnimationTablet(TileAnimationTablet tablet, InventoryPlayer playerInv) {
|
||||
@@ -51,25 +50,26 @@ public class GuiAnimationTablet extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListAT.clear();
|
||||
addButton(new GuiButtonAT(0, x + xSize / 2 - 7, y + 60, tablet.redstone));
|
||||
addButton(new GuiButtonATRadio(1, x + 52, y + 15, tablet.leftClick, radioButtons));
|
||||
addButton(new GuiButtonATRadio(2, x + 111, y + 15, !tablet.leftClick, radioButtons));
|
||||
buttonList = buttonListAT;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonAT button) {
|
||||
buttonListAT.add(button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
var button0 = (GuiButtonAT) buttonList.get(0);
|
||||
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListAT.get(0).buttonEnabled = !buttonListAT.get(0).buttonEnabled;
|
||||
else {
|
||||
button0.buttonEnabled = !button0.buttonEnabled;
|
||||
}
|
||||
|
||||
tablet.leftClick = buttonListAT.get(1).buttonEnabled;
|
||||
tablet.redstone = buttonListAT.get(0).buttonEnabled;
|
||||
tablet.leftClick = ((GuiButtonAT) buttonList.get(1)).buttonEnabled;
|
||||
tablet.redstone = button0.buttonEnabled;
|
||||
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketTabletButton(tablet));
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ public class GuiMobMagnet extends GuiContainer {
|
||||
ItemStack stack = null;
|
||||
TileMobMagnet mobMagnet;
|
||||
|
||||
List<GuiButtonMM> buttonListMM = new ArrayList<>();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
|
||||
public GuiMobMagnet(TileMobMagnet tile, InventoryPlayer playerInv) {
|
||||
@@ -55,23 +54,21 @@ public class GuiMobMagnet extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListMM.clear();
|
||||
addButton(new GuiButtonMMRadio(0, x + 100, y + 28, mobMagnet.adult, radioButtons));
|
||||
addButton(new GuiButtonMMRadio(1, x + 100, y + 48, !mobMagnet.adult, radioButtons));
|
||||
buttonList = buttonListMM;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonMM button) {
|
||||
buttonListMM.add(button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListMM.get(0).enabled = !buttonListMM.get(0).enabled;
|
||||
else buttonList.get(0).enabled = !buttonList.get(0).enabled;
|
||||
|
||||
mobMagnet.adult = buttonListMM.get(0).enabled;
|
||||
mobMagnet.adult = buttonList.get(0).enabled;
|
||||
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketMobMagnetButton(mobMagnet));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ public class GuiRemotePlacer extends GuiContainer {
|
||||
|
||||
int x, y;
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
List<GuiButtonRP> buttonListRP = new ArrayList<>();
|
||||
TileRPlacer placer;
|
||||
Aspect aspectHovered = null;
|
||||
|
||||
@@ -43,23 +42,24 @@ public class GuiRemotePlacer extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListRP.clear();
|
||||
addButton(new GuiButtonRPRadio(0, x + 100, y + 0, placer.blocks == 1, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(1, x + 100, y + 13, placer.blocks == 2, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(2, x + 100, y + 26, placer.blocks == 3, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(3, x + 100, y + 39, placer.blocks == 4, radioButtons));
|
||||
buttonList = buttonListRP;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonRP button) {
|
||||
buttonListRP.add(button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListRP.get(0).buttonEnabled = !buttonListRP.get(0).buttonEnabled;
|
||||
if (par1GuiButton instanceof IRadioButton iRadioButton) iRadioButton.enableFromClick();
|
||||
else {
|
||||
var button0 = (GuiButtonRP) buttonList.get(0);
|
||||
button0.buttonEnabled = !button0.buttonEnabled;
|
||||
}
|
||||
|
||||
placer.blocks = par1GuiButton.id + 1;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Desktop;
|
||||
import java.net.URI;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
@@ -30,10 +30,8 @@ public class GuiButtonWG extends GuiButton {
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if (enabled) {
|
||||
par1Minecraft.renderEngine.bindTexture(gui);
|
||||
int y = !enabled ? 13 : 0;
|
||||
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
|
||||
}
|
||||
par1Minecraft.renderEngine.bindTexture(gui);
|
||||
int y = !enabled ? 13 : 0;
|
||||
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui.kami;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ public class RenderInfusedCrops implements ISimpleBlockRenderingHandler {
|
||||
Aspect aspect = BlockInfusedGrain.getAspect(world, x, y, z);
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
if (aspect != null && !aspect.isPrimal()) {
|
||||
// Hex to RGB code from vanilla tesselator
|
||||
float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F;
|
||||
@@ -34,15 +35,14 @@ public class RenderInfusedCrops implements ISimpleBlockRenderingHandler {
|
||||
float b = (aspect.getColor() & 0xFF) / 255.0F;
|
||||
|
||||
GL11.glColor4f(r, g, b, 1F);
|
||||
Tessellator.instance.setColorRGBA_I(aspect.getColor(), 255);
|
||||
tess.setColorRGBA_I(aspect.getColor(), 255);
|
||||
}
|
||||
|
||||
renderer.setOverrideBlockTexture(block.getIcon(world, x, y, z, world.getBlockMetadata(x, y, z)));
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tess.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
renderer.renderBlockCropsImpl(block, world.getBlockMetadata(x, y, z), x, y - 0.0625F, z);
|
||||
renderer.clearOverrideBlockTexture();
|
||||
// Tessellator.instance.setColorOpaque_I(0xFFFFFF);
|
||||
// tess.setColorOpaque_I(0xFFFFFF);
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -3,7 +3,6 @@ package thaumic.tinkerer.client.render.item;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -19,8 +18,6 @@ import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
*/
|
||||
public class RenderGenericSeeds implements IItemRenderer {
|
||||
|
||||
private static RenderItem renderItem = new RenderItem();
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
if (type == ItemRenderType.INVENTORY) return true;
|
||||
|
||||
@@ -2,7 +2,6 @@ package thaumic.tinkerer.client.render.item;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -16,8 +15,6 @@ import thaumic.tinkerer.common.item.ItemMobDisplay;
|
||||
|
||||
public class RenderMobDisplay implements IItemRenderer {
|
||||
|
||||
private static RenderItem renderItem = new RenderItem();
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack itemStack, ItemRenderType itemRenderType) {
|
||||
return true;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package thaumic.tinkerer.client.render.item.kami;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
@@ -15,9 +13,6 @@ import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
|
||||
public class RenderPlacementMirror implements IItemRenderer {
|
||||
|
||||
RenderItem render = new RenderItem();
|
||||
ItemRenderer renderer = new ItemRenderer(Minecraft.getMinecraft());
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
@@ -69,6 +64,7 @@ public class RenderPlacementMirror implements IItemRenderer {
|
||||
break;
|
||||
}
|
||||
case INVENTORY: {
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(45f, 0f, 1f, 0f);
|
||||
GL11.glScalef(1.5f, 1.8f, 1.8f);
|
||||
@@ -77,6 +73,7 @@ public class RenderPlacementMirror implements IItemRenderer {
|
||||
|
||||
renderItem(ItemRenderType.EQUIPPED, item, data);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -47,12 +47,18 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
|
||||
int rotation = meta == 2 ? 270 : meta == 3 ? 90 : meta == 4 ? 0 : 180;
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(d0, d1, d2);
|
||||
renderOverlay(tile, overlayCenter, -1, false, false, 0.65, 0.13F, 0F);
|
||||
if (tile.leftClick) renderOverlay(tile, overlayLeft, 1, false, true, 1, 0.13F, 0F);
|
||||
else renderOverlay(tile, overlayRight, 1, false, true, 1, 0.131F, 0F);
|
||||
renderOverlay(tile, overlayIndent, 0, false, false, 0.5F, 0.13F, rotation + 90F);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
renderOverlay(tile, overlayCenter, -1, false, 0.65, 0.13F, partialTicks);
|
||||
if (tile.leftClick) renderOverlay(tile, overlayLeft, 1, true, 1, 0.13F, partialTicks);
|
||||
else renderOverlay(tile, overlayRight, 1, true, 1, 0.131F, partialTicks);
|
||||
renderIndents(tile, rotation + 90F);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glRotatef(rotation, 0F, 1F, 0F);
|
||||
GL11.glTranslated(0.1, 0.2 + Math.cos(System.currentTimeMillis() / 600D) / 18F, 0.5);
|
||||
@@ -60,9 +66,10 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(translations[0], translations[1], translations[2]);
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glTranslatef(0.5F, 0F, 0.5F);
|
||||
GL11.glRotatef(tile.swingProgress, 0F, 0F, 1F);
|
||||
float swingProgress = tile.getRenderSwingProgress(partialTicks);
|
||||
GL11.glRotatef(swingProgress, 0F, 0F, 1F);
|
||||
GL11.glTranslatef(-0.5F, 0F, -0.5F);
|
||||
GL11.glTranslatef(-tile.swingProgress / 250F, tile.swingProgress / 1000F, 0F);
|
||||
GL11.glTranslatef(-swingProgress / 250F, swingProgress / 1000F, 0F);
|
||||
GL11.glRotatef((float) Math.cos(System.currentTimeMillis() / 400F) * 5F, 1F, 0F, 1F);
|
||||
renderItem(tile);
|
||||
GL11.glPopMatrix();
|
||||
@@ -72,6 +79,8 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
ItemStack stack = tablet.getStackInSlot(0);
|
||||
if (stack != null) {
|
||||
EntityItem entityitem = new EntityItem(tablet.getWorldObj(), 0.0D, 0.0D, 0.0D, stack);
|
||||
entityitem.worldObj = tablet.getWorldObj();
|
||||
int stackSize = entityitem.getEntityItem().stackSize;
|
||||
entityitem.getEntityItem().stackSize = 1;
|
||||
entityitem.hoverStart = 0.0F;
|
||||
GL11.glPushMatrix();
|
||||
@@ -81,25 +90,24 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
RenderItem.renderInFrame = false;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
entityitem.getEntityItem().stackSize = stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderOverlay(TileAnimationTablet tablet, ResourceLocation texture, int rotationMod,
|
||||
boolean useLighting, boolean useBlend, double size, float height, float forceDeg) {
|
||||
private void renderOverlay(TileAnimationTablet tablet, ResourceLocation texture, int rotationMod, boolean useBlend,
|
||||
double size, float height, float partialTicks) {
|
||||
Minecraft mc = ClientHelper.minecraft();
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
if (!useLighting) GL11.glDisable(GL11.GL_LIGHTING);
|
||||
if (useBlend) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
GL11.glTranslatef(0.5F, height, 0.5F);
|
||||
float deg = rotationMod == 0 ? forceDeg : (float) (tablet.ticksExisted * rotationMod % 360F);
|
||||
float deg = (tablet.getTicksExisted(partialTicks) * rotationMod % 360F);
|
||||
GL11.glRotatef(deg, 0F, 1F, 0F);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
double size1 = size / 2;
|
||||
double size2 = -size1;
|
||||
@@ -109,8 +117,33 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
tess.addVertexWithUV(size1, 0, size2, 1, 0);
|
||||
tess.addVertexWithUV(size2, 0, size2, 0, 0);
|
||||
tess.draw();
|
||||
GL11.glDepthMask(true);
|
||||
if (!useLighting) GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
private void renderIndents(TileAnimationTablet tablet, float forceDeg) {
|
||||
Minecraft mc = ClientHelper.minecraft();
|
||||
mc.renderEngine.bindTexture(overlayIndent);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.5F, (float) 0.13, 0.5F);
|
||||
GL11.glRotatef(forceDeg, 0F, 1F, 0F);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
final double size1 = 0.25;
|
||||
final double size2 = -0.25;
|
||||
tess.startDrawingQuads();
|
||||
tess.addVertexWithUV(size2, 0, size1, 0, 1);
|
||||
tess.addVertexWithUV(size1, 0, size1, 1, 1);
|
||||
tess.addVertexWithUV(size1, 0, size2, 1, 0);
|
||||
tess.addVertexWithUV(size2, 0, size2, 0, 0);
|
||||
tess.draw();
|
||||
int acceleration = tablet.getWorldAcceleratorBonus();
|
||||
if (acceleration != 0) {
|
||||
GL11.glRotatef(90, -1, 0, 0);
|
||||
GL11.glScalef(0.02f, -0.02f, 0.02f);
|
||||
final String s = 'x' + Integer.toString(acceleration);
|
||||
final int width = mc.fontRenderer.getStringWidth(s);
|
||||
GL11.glTranslatef(-width / 2f, 10f + mc.fontRenderer.FONT_HEIGHT / 2f, 0);
|
||||
mc.fontRenderer.drawString(s, 0, 0, 0xFFFFFF);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.tile;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.tile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -20,6 +22,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.client.renderers.block.BlockJarRenderer;
|
||||
import thaumcraft.client.renderers.tile.ItemJarFilledRenderer;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumic.tinkerer.common.block.tile.TileFunnel;
|
||||
|
||||
public class RenderTileFunnel extends TileEntitySpecialRenderer {
|
||||
@@ -34,12 +37,12 @@ public class RenderTileFunnel extends TileEntitySpecialRenderer {
|
||||
if (stack != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(d0 + 0.5, d1 + 0.365, d2 + 0.5);
|
||||
// if(Block.getBlockFromItem(stack.getItem())== ConfigBlocks.blockJar) {
|
||||
// GL11.glTranslatef(0F, 0.25F, 0F);
|
||||
// jarRenderer.renderInventoryBlock(ConfigBlocks.blockJar, 0, 0, new RenderBlocks());
|
||||
// }
|
||||
// else
|
||||
jarRenderer1.renderItem(IItemRenderer.ItemRenderType.ENTITY, stack, (Object[]) null);
|
||||
if (Block.getBlockFromItem(stack.getItem()) == ConfigBlocks.blockJar) {
|
||||
GL11.glTranslatef(0F, 0.25F, 0F);
|
||||
jarRenderer.renderInventoryBlock(ConfigBlocks.blockJar, stack.getItemDamage(), 0, new RenderBlocks());
|
||||
} else {
|
||||
jarRenderer1.renderItem(IItemRenderer.ItemRenderType.ENTITY, stack, (Object[]) null);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.tile;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
|
||||
@@ -26,7 +26,11 @@ import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import thaumcraft.common.CommonProxy;
|
||||
@@ -52,6 +56,10 @@ public class ThaumicTinkerer {
|
||||
@SidedProxy(clientSide = LibMisc.CLIENT_PROXY, serverSide = LibMisc.COMMON_PROXY)
|
||||
public static TTCommonProxy proxy;
|
||||
|
||||
public static boolean isBootsActive = false;
|
||||
public static boolean gtLoaded;
|
||||
public static final String BOOTS = "thaumicboots";
|
||||
|
||||
public static CommonProxy tcProxy;
|
||||
public static SimpleNetworkWrapper netHandler = NetworkRegistry.INSTANCE.newSimpleChannel(LibMisc.MOD_ID + "|B");
|
||||
|
||||
@@ -70,6 +78,10 @@ public class ThaumicTinkerer {
|
||||
"register",
|
||||
"thaumic.tinkerer.common.compat.TTinkererProvider.callbackRegister");
|
||||
}
|
||||
if (Loader.isModLoaded(BOOTS)) {
|
||||
isBootsActive = true;
|
||||
}
|
||||
gtLoaded = Loader.isModLoaded("gregtech");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -44,6 +43,7 @@ import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibGuiIDs;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.TTRegistry;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
@@ -98,37 +98,32 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (tablet != null) {
|
||||
if (tablet.getIsBreaking()) {}
|
||||
ItemStack itemstack = tablet.heldItem;
|
||||
if (itemstack != null) {
|
||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (int j1 = 0; j1 < tablet.getSizeInventory(); ++j1) {
|
||||
ItemStack itemstack = tablet.getStackInSlot(j1);
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
|
||||
.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (itemstack != null) {
|
||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
|
||||
.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(
|
||||
par1World,
|
||||
par2 + f,
|
||||
par3 + f1,
|
||||
par4 + f2,
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(
|
||||
par1World,
|
||||
par2 + f,
|
||||
par3 + f1,
|
||||
par4 + f2,
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
|
||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +137,8 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
|
||||
if (par1World.isRemote) return;
|
||||
TileEntity te = par1World.getTileEntity(par2, par3, par4);
|
||||
if (!(te instanceof TileAnimationTablet tablet) || !tablet.redstone) return;
|
||||
|
||||
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)
|
||||
|| par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
|
||||
@@ -149,9 +146,10 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
boolean on = (meta & 8) != 0;
|
||||
|
||||
if (power && !on) {
|
||||
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta | 8, 4);
|
||||
} else if (!power && on) par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 7, 4);
|
||||
} else if (!power && on) {
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 7, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -159,37 +157,17 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
if (tile != null && tile instanceof TileAnimationTablet) {
|
||||
TileAnimationTablet tablet = (TileAnimationTablet) tile;
|
||||
if (tablet.redstone && tablet.swingProgress == 0) {
|
||||
tablet.findEntities(tablet.getTargetLoc());
|
||||
tablet.initiateSwing();
|
||||
par1World.addBlockEvent(
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class),
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
TileAnimationTablet tablet = (TileAnimationTablet) tile;
|
||||
if (tile instanceof TileAnimationTablet tablet) {
|
||||
if (par5EntityPlayer.getCurrentEquippedItem() != null
|
||||
&& par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
|
||||
int meta = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean activated = (meta & 8) != 0;
|
||||
if (!activated && !tablet.getIsBreaking() && tablet.swingProgress == 0) {
|
||||
if (!activated && !tablet.getIsBreaking() && tablet.isIdle()) {
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta == 5 ? 2 : meta + 1, 1 | 2);
|
||||
par1World.playSoundEffect(par2, par3, par4, "thaumcraft:tool", 0.6F, 1F);
|
||||
} else par5EntityPlayer
|
||||
@@ -229,11 +207,6 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
return new TileAnimationTablet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ANIMATION_TABLET;
|
||||
@@ -268,10 +241,9 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
-8,
|
||||
2,
|
||||
4,
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class))).setWarp(1)
|
||||
.setParents(LibResearch.KEY_MAGNETS).setPages(
|
||||
new ResearchPage("0"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_ANIMATION_TABLET));
|
||||
new ItemStack(TTRegistry.dynamismTablet)).setWarp(1).setParents(LibResearch.KEY_MAGNETS).setPages(
|
||||
new ResearchPage("0"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_ANIMATION_TABLET));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -279,7 +251,7 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_ANIMATION_TABLET,
|
||||
LibResearch.KEY_ANIMATION_TABLET,
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class)),
|
||||
new ItemStack(TTRegistry.dynamismTablet),
|
||||
new AspectList().add(Aspect.AIR, 25).add(Aspect.ORDER, 15).add(Aspect.FIRE, 10),
|
||||
"GIG",
|
||||
"ICI",
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -135,11 +134,6 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
return new TileAspectAnalyzer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ASPECT_ANALYZER;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -153,11 +152,6 @@ public class BlockEnchanter extends BlockModContainer {
|
||||
return new TileEnchanter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ENCHANTER;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -179,11 +178,6 @@ public class BlockFunnel extends BlockModContainer {
|
||||
return new TileFunnel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.FUNNEL;
|
||||
|
||||
@@ -136,11 +136,6 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -48,11 +46,6 @@ public class BlockGolemConnector extends BlockCamo {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.GOLEMCONNECTOR;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
@@ -53,11 +52,6 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
|
||||
return new TileInfusedFarmland();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.BLOCK_INFUSED_FARMLAND;
|
||||
|
||||
@@ -200,11 +200,6 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
return currentAspect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.INFUSED_GRAIN_BLOCK;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -191,11 +190,6 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
|
||||
return (metadata & 2) == 2 ? new TileMobMagnet() : new TileMagnet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.MAGNET;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -42,11 +40,6 @@ public abstract class BlockMod extends Block implements ITTinkererBlock {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -65,11 +64,6 @@ public class BlockPlatform extends BlockCamo {
|
||||
return new TileCamo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.PLATFORM;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -83,11 +82,6 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
return new TileRPlacer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.REMOTE_PLACER;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -182,11 +181,6 @@ public class BlockRepairer extends BlockModContainer {
|
||||
return new TileRepairer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.REPAIRER;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -94,11 +93,6 @@ public class BlockSummon extends Block implements ITTinkererBlock {
|
||||
: par1 == ForgeDirection.DOWN.ordinal() ? Block.getBlockFromName("obsidian").getIcon(0, 0) : iconSide;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.SPAWNER;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -81,10 +81,8 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList result = new ArrayList();
|
||||
result.add(true);
|
||||
return result;
|
||||
public Block[] getMetaBlocks() {
|
||||
return new Block[] { new BlockTravelSlab(true) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -32,11 +30,6 @@ public class BlockTravelStairs extends BlockStairs implements ITTinkererBlock {
|
||||
setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.TRAVEL_STAIRS;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -88,10 +88,8 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList result = new ArrayList();
|
||||
result.add(true);
|
||||
return result;
|
||||
public Block[] getMetaBlocks() {
|
||||
return new Block[] { new BlockWardSlab(true) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,6 @@ import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -123,7 +122,15 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
world.setBlock(xT, yT, zT, targetTransform, 0, 3);
|
||||
}
|
||||
}
|
||||
if (blockMeta >= 15) {
|
||||
|
||||
if (blockMeta < 15 && blockMeta > 0) {
|
||||
// Randomly increase the age of a fire
|
||||
// 0 meta is considered a source and never increases, for any other meta we have a chance to increase
|
||||
final int newMeta = Math.min(blockMeta + rand.nextInt(3) / 2, 15);
|
||||
if (newMeta > blockMeta) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, newMeta, 4);
|
||||
}
|
||||
} else if (blockMeta >= 15) {
|
||||
// No spreading if we're at max meta
|
||||
return;
|
||||
}
|
||||
@@ -381,11 +388,6 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
return MapColor.tntColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -130,17 +130,16 @@ public class BlockBedrockPortal extends BlockMod {
|
||||
(EntityPlayerMP) entity,
|
||||
ConfigHandler.bedrockDimensionID,
|
||||
new TeleporterBedrock((WorldServer) par1World));
|
||||
if (entity.worldObj.getBlock(par2, 250, par4) == Blocks.bedrock) {
|
||||
entity.worldObj.setBlock(par2, 250, par4, Blocks.air);
|
||||
if (entity.worldObj.isAirBlock(par2, 249, par4)) {
|
||||
entity.worldObj.setBlock(par2, 249, par4, Blocks.stone);
|
||||
}
|
||||
if (entity.worldObj.getBlock(par2, 251, par4) == Blocks.bedrock) {
|
||||
entity.worldObj.setBlock(par2, 251, par4, Blocks.air);
|
||||
}
|
||||
if (entity.worldObj.getBlock(par2, 252, par4) == Blocks.bedrock) {
|
||||
entity.worldObj.setBlock(par2, 252, par4, Blocks.air);
|
||||
}
|
||||
if (entity.worldObj.getBlock(par2, 253, par4) == Blocks.bedrock) {
|
||||
entity.worldObj.setBlock(par2, 253, par4, Blocks.air);
|
||||
for (int i = 250; i < 254; i++) {
|
||||
Block block = entity.worldObj.getBlock(par2, i, par4);
|
||||
// something seems to be turning our bedrock to plain stone
|
||||
// let's also check that
|
||||
if (block == Blocks.stone || block == Blocks.bedrock) {
|
||||
entity.worldObj.setBlockToAir(par2, i, par4);
|
||||
}
|
||||
}
|
||||
if (entity.worldObj.getBlock(par2, 254, par4) == Blocks.bedrock) {
|
||||
entity.worldObj.setBlock(par2, 254, par4, this);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.kami;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -151,11 +150,6 @@ public class BlockWarpGate extends BlockModContainer {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.WARP_GATE;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -130,11 +129,6 @@ public class BlockDarkQuartz extends BlockMod {
|
||||
pillarDarkQuartzIcon = IconHelper.forName(par1IconRegister, "pillarDarkQuartz1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.DARK_QUARTZ;
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -83,10 +83,8 @@ public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList result = new ArrayList();
|
||||
result.add(true);
|
||||
return result;
|
||||
public Block[] getMetaBlocks() {
|
||||
return new Block[] { new BlockDarkQuartzSlab(true) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -35,11 +33,6 @@ public class BlockDarkQuartzStairs extends BlockStairs implements ITTinkererBloc
|
||||
setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.DARK_QUARTZ_STAIRS;
|
||||
|
||||
@@ -37,7 +37,8 @@ import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") })
|
||||
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft"),
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2") })
|
||||
public class TileAspectAnalyzer extends TileEntity implements IInventory, SimpleComponent, IPeripheral, IMovableTile {
|
||||
|
||||
ItemStack[] inventorySlots = new ItemStack[1];
|
||||
@@ -230,11 +231,13 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,9 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2")
|
||||
public class TileCamo extends TileEntity implements IMovableTile {
|
||||
|
||||
private static final String TAG_CAMO = "camo";
|
||||
@@ -73,10 +75,12 @@ public class TileCamo extends TileEntity implements IMovableTile {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
}
|
||||
@@ -30,6 +30,7 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
@@ -41,6 +42,7 @@ import thaumic.tinkerer.common.enchantment.core.EnchantmentManager;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibFeatures;
|
||||
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2")
|
||||
public class TileEnchanter extends TileEntity implements ISidedInventory, IMovableTile {
|
||||
|
||||
private static final String TAG_ENCHANTS = "enchantsIntArray";
|
||||
@@ -494,10 +496,12 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.mobilizer.BlockMobilizer;
|
||||
|
||||
@@ -117,16 +117,13 @@ public class TileEntityMobilizer extends TileEntity {
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
TileEntity passenger = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
|
||||
IAppEngApi api = AEApi.instance();
|
||||
|
||||
// Prevent the passenger from popping off. Not sent to clients.
|
||||
worldObj.setBlock(targetX, yCoord, targetZ, Block.getBlockFromName("stone"), 0, 0);
|
||||
// Move non-TE blocks
|
||||
Block passengerId = worldObj.getBlock(xCoord, yCoord + 1, zCoord);
|
||||
|
||||
if (worldObj.isAirBlock(xCoord, yCoord + 1, zCoord)
|
||||
|| passengerId.canPlaceBlockAt(worldObj, targetX, yCoord + 1, targetZ)) {
|
||||
|
||||
if (passenger == null) {
|
||||
if (passengerId != Block.getBlockFromName("bedrock")
|
||||
&& passengerId != Block.getBlockFromName("")) {
|
||||
@@ -143,7 +140,8 @@ public class TileEntityMobilizer extends TileEntity {
|
||||
}
|
||||
}
|
||||
// If AE is installed, use its handler
|
||||
} else if (api != null) {
|
||||
} else if (Loader.isModLoaded("appliedenergistics2")) {
|
||||
IAppEngApi api = AEApi.instance();
|
||||
if (api.registries().movable().askToMove(passenger)) {
|
||||
worldObj.setBlock(
|
||||
targetX,
|
||||
@@ -159,34 +157,29 @@ public class TileEntityMobilizer extends TileEntity {
|
||||
api.registries().movable().doneMoving(passenger);
|
||||
passenger.validate();
|
||||
}
|
||||
|
||||
// Handler IMovableTiles and vanilla TEs without AE
|
||||
} else if (passenger instanceof IMovableTile
|
||||
|| passenger.getClass().getName().startsWith("net.minecraft.tileentity")) {
|
||||
boolean imovable = passenger instanceof IMovableTile;
|
||||
if (imovable) ((IMovableTile) passenger).prepareToMove();
|
||||
worldObj.setBlock(
|
||||
targetX,
|
||||
yCoord + 1,
|
||||
targetZ,
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord),
|
||||
worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord),
|
||||
3);
|
||||
passenger.invalidate();
|
||||
worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord);
|
||||
} else if (passenger.getClass().getName().startsWith("net.minecraft.tileentity")) {
|
||||
worldObj.setBlock(
|
||||
targetX,
|
||||
yCoord + 1,
|
||||
targetZ,
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord),
|
||||
worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord),
|
||||
3);
|
||||
passenger.invalidate();
|
||||
worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord);
|
||||
|
||||
// IMovableHandler default code
|
||||
Chunk c = worldObj.getChunkFromBlockCoords(targetX, targetZ);
|
||||
// IMovableHandler default code
|
||||
Chunk c = worldObj.getChunkFromBlockCoords(targetX, targetZ);
|
||||
|
||||
c.func_150812_a(targetX & 0xF, yCoord + 1, targetZ & 0xF, passenger);
|
||||
c.func_150812_a(targetX & 0xF, yCoord + 1, targetZ & 0xF, passenger);
|
||||
|
||||
if (c.isChunkLoaded) {
|
||||
worldObj.addTileEntity(passenger);
|
||||
worldObj.markBlockForUpdate(targetX, yCoord + 1, targetZ);
|
||||
}
|
||||
if (imovable) ((IMovableTile) passenger).doneMoving();
|
||||
passenger.validate();
|
||||
}
|
||||
if (c.isChunkLoaded) {
|
||||
worldObj.addTileEntity(passenger);
|
||||
worldObj.markBlockForUpdate(targetX, yCoord + 1, targetZ);
|
||||
}
|
||||
passenger.validate();
|
||||
}
|
||||
}
|
||||
// Move self
|
||||
this.invalidate();
|
||||
|
||||
@@ -5,8 +5,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2")
|
||||
public class TileEntityRelay extends TileEntity implements IMovableTile {
|
||||
|
||||
public boolean hasPartner;
|
||||
@@ -137,10 +139,12 @@ public class TileEntityRelay extends TileEntity implements IMovableTile {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
}
|
||||
@@ -26,15 +26,18 @@ import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.aspects.IEssentiaContainerItem;
|
||||
import thaumcraft.common.blocks.ItemJarFilled;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.tiles.TileJarFillable;
|
||||
import thaumcraft.common.tiles.TileJarFillableVoid;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2")
|
||||
public class TileFunnel extends TileEntity implements ISidedInventory, IAspectContainer, IMovableTile {
|
||||
|
||||
ItemStack[] inventorySlots = new ItemStack[1];
|
||||
@@ -51,7 +54,7 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo
|
||||
Aspect aspect = aspectList.getAspects()[0];
|
||||
|
||||
TileEntity tile = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
if (tile != null && tile instanceof TileEntityHopper) {
|
||||
if (tile instanceof TileEntityHopper) {
|
||||
TileEntity tile1 = getHopperFacing(
|
||||
tile.xCoord,
|
||||
tile.yCoord,
|
||||
@@ -69,6 +72,18 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo
|
||||
jar1.addToContainer(aspect, 1);
|
||||
item.setAspects(jar, aspectList.remove(aspect, 1));
|
||||
}
|
||||
// "AspectFilter" is used for the jar label
|
||||
if (aspectList.getAmount(aspectList.getAspects()[0]) == 0
|
||||
&& !jar.stackTagCompound.hasKey("AspectFilter")) {
|
||||
String itemName = jar.getUnlocalizedName();
|
||||
if (itemName.equals("item.BlockJarFilledItem")) {
|
||||
setInventorySlotContents(0, new ItemStack(ConfigBlocks.blockJar));
|
||||
} else if (itemName.equals("item.BlockJarFilledItem.void")) {
|
||||
setInventorySlotContents(0, new ItemStack(ConfigBlocks.blockJar));
|
||||
getStackInSlot(0).setItemDamage(3);
|
||||
}
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -277,10 +292,12 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package thaumic.tinkerer.common.block.tile;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
@@ -34,7 +34,8 @@ import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.helper.MiscHelper;
|
||||
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") })
|
||||
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft"),
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2") })
|
||||
public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile, SimpleComponent {
|
||||
|
||||
@Override
|
||||
@@ -146,11 +147,13 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile,
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
|
||||
@Callback(doc = "function():boolean -- Returns Whether magnet is pushing or pulling")
|
||||
|
||||
@@ -34,6 +34,7 @@ import li.cil.oc.api.machine.Context;
|
||||
import thaumic.tinkerer.common.item.ItemSoulMould;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2")
|
||||
public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTile {
|
||||
|
||||
private static final String TAG_ADULT = "adultCheck";
|
||||
@@ -230,10 +231,12 @@ public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTil
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
}
|
||||
@@ -27,6 +27,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
@@ -38,7 +39,7 @@ import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
/* import thaumic.tinkerer.common.compat.TinkersConstructCompat; */
|
||||
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2")
|
||||
public class TileRepairer extends TileEntity
|
||||
implements ISidedInventory, IAspectContainer, IEssentiaTransport, IMovableTile {
|
||||
|
||||
@@ -376,10 +377,12 @@ public class TileRepairer extends TileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
}
|
||||
+2
-4
@@ -29,13 +29,11 @@ public class ContainerIchorPouch extends ContainerPlayerInv {
|
||||
ItemStack pouch;
|
||||
int blockSlot;
|
||||
|
||||
public ContainerIchorPouch(EntityPlayer player) {
|
||||
public ContainerIchorPouch(EntityPlayer player, ItemStack bag) {
|
||||
super(player.inventory);
|
||||
|
||||
pouch = bag;
|
||||
this.player = player;
|
||||
pouch = player.getCurrentEquippedItem();
|
||||
blockSlot = player.inventory.currentItem + 27 + 13 * 9;
|
||||
|
||||
for (int y = 0; y < 9; y++) for (int x = 0; x < 13; x++)
|
||||
addSlotToContainer(new SlotNoPouches(inv, y * 13 + x, 12 + x * 18, 8 + y * 18));
|
||||
initPlayerInv();
|
||||
|
||||
@@ -13,76 +13,180 @@ package thaumic.tinkerer.common.block.tile.tablet;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import thaumcraft.common.lib.FakeThaumcraftPlayer;
|
||||
public final class TabletFakePlayer extends FakePlayer {
|
||||
|
||||
public class TabletFakePlayer extends FakeThaumcraftPlayer {
|
||||
private final TileAnimationTablet tablet;
|
||||
|
||||
TileAnimationTablet tablet;
|
||||
|
||||
public TabletFakePlayer(TileAnimationTablet tablet) { // ,String name) {
|
||||
public TabletFakePlayer(TileAnimationTablet tablet) {
|
||||
super(
|
||||
tablet.getWorldObj(),
|
||||
(WorldServer) tablet.getWorldObj(),
|
||||
new GameProfile(UUID.fromString("a8f026a0-135b-11e4-9191-0800200c9a66"), "[ThaumcraftTablet]"));
|
||||
// super(tablet.getWorldObj(),"[ThaumcraftTablet]");
|
||||
this.tablet = tablet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDead() {
|
||||
inventory.clearInventory(null, -1);
|
||||
super.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) {
|
||||
// NO-OP
|
||||
this.playerNetServerHandler = new DummyNetHandlerPlayServer(MinecraftServer.getServer(), this);
|
||||
this.width = 0;
|
||||
this.height = 0;
|
||||
this.boundingBox.setBounds(this.posX, this.posY, this.posZ, this.posX, this.posY, this.posZ);
|
||||
this.rotationPitch = -15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
capabilities.isCreativeMode = false;
|
||||
|
||||
posX = tablet.xCoord + 0.5;
|
||||
posY = tablet.yCoord + 1.6;
|
||||
posZ = tablet.zCoord + 0.5;
|
||||
|
||||
if (riddenByEntity != null) riddenByEntity.ridingEntity = null;
|
||||
if (ridingEntity != null) ridingEntity.riddenByEntity = null;
|
||||
riddenByEntity = null;
|
||||
ridingEntity = null;
|
||||
|
||||
this.posX = tablet.xCoord + 0.5f;
|
||||
this.posY = tablet.yCoord + 0.5f;
|
||||
this.posZ = tablet.zCoord + 0.5f;
|
||||
this.inventory.currentItem = 0;
|
||||
motionX = motionY = motionZ = 0;
|
||||
setHealth(20);
|
||||
isDead = false;
|
||||
|
||||
this.capabilities.isCreativeMode = false;
|
||||
|
||||
int meta = tablet.getBlockMetadata() & 7;
|
||||
int rotation = meta == 2 ? 180 : meta == 3 ? 0 : meta == 4 ? 90 : -90;
|
||||
rotationYaw = rotationYawHead = rotation;
|
||||
rotationPitch = -15;
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
||||
if (i != inventory.currentItem) {
|
||||
ItemStack stack = inventory.getStackInSlot(i);
|
||||
if (stack != null) {
|
||||
entityDropItem(stack, 1.0f);
|
||||
inventory.setInventorySlotContents(i, null);
|
||||
}
|
||||
rotationYaw = rotationYawHead = rotation;
|
||||
// Drop everything except for held item
|
||||
for (int i = 1; i < inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = inventory.getStackInSlot(i);
|
||||
if (stack != null) {
|
||||
entityDropItem(stack, 0);
|
||||
inventory.setInventorySlotContents(i, null);
|
||||
}
|
||||
}
|
||||
syncSlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChatMessage(IChatComponent var1) {}
|
||||
public void syncSlots() {
|
||||
this.inventory.mainInventory[0] = tablet.heldItem;
|
||||
}
|
||||
|
||||
// Copied from Minecraft and PlayerControllerMP
|
||||
public boolean sendUseItem(ItemStack stack) {
|
||||
if (!ForgeEventFactory.onPlayerInteract(this, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1, worldObj)
|
||||
.isCanceled()) {
|
||||
int i = stack.stackSize;
|
||||
ItemStack itemstack1 = stack.useItemRightClick(worldObj, this);
|
||||
if (itemstack1 == stack && itemstack1.stackSize == i) {
|
||||
return false;
|
||||
}
|
||||
inventory.mainInventory[0] = itemstack1;
|
||||
|
||||
if (itemstack1.stackSize <= 0) {
|
||||
inventory.mainInventory[0] = null;
|
||||
MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this, itemstack1));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// copied from PlayerController#onPlayerRightClick
|
||||
public boolean onPlayerRightClick(ItemStack stack, int x, int y, int z, int side, float f, float f1, float f2) {
|
||||
Item item = stack.getItem();
|
||||
if (item != null && item.onItemUseFirst(stack, this, worldObj, x, y, z, side, f, f1, f2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
if (block.onBlockActivated(worldObj, x, y, z, this, side, f, f1, f2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!stack.tryPlaceItemIntoWorld(this, worldObj, x, y, z, side, f, f1, f2)) {
|
||||
return false;
|
||||
}
|
||||
if (stack.stackSize <= 0) {
|
||||
MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this, stack));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getPlayerCoordinates() {
|
||||
return new ChunkCoordinates(tablet.xCoord, tablet.yCoord, tablet.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isMovementBlocked() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBePushed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPosition(double x, double y, double z) {
|
||||
// NO-OP (the position is set at creation)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDead() {
|
||||
// NO-OP (this should never happen...?)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mountEntity(Entity entityIn) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHealth(float p_70606_1_) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLivingUpdate() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChatMessage(IChatComponent var1) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChatComponentMessage(IChatComponent chatmessagecomponent) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
private static final class DummyNetHandlerPlayServer extends NetHandlerPlayServer {
|
||||
|
||||
public DummyNetHandlerPlayServer(MinecraftServer server, FakePlayer player) {
|
||||
super(server, new NetworkManager(false), player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetworkTick() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket(Packet packetIn) {
|
||||
// NO-OP
|
||||
}
|
||||
}
|
||||
}
|
||||
+420
-398
File diff suppressed because it is too large.
Load diff
+10
-6
@@ -31,7 +31,11 @@ import dan200.computercraft.api.lua.ILuaContext;
|
||||
import dan200.computercraft.api.lua.LuaException;
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import ic2.api.energy.tile.*;
|
||||
import ic2.api.energy.tile.IEnergyAcceptor;
|
||||
import ic2.api.energy.tile.IEnergyConductor;
|
||||
import ic2.api.energy.tile.IEnergyEmitter;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
@@ -253,35 +257,35 @@ public class TileTransvectorInterface extends TileTransvector
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "CoFHLib")
|
||||
@Optional.Method(modid = "CoFHCore")
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IEnergyHandler ? ((IEnergyHandler) tile).receiveEnergy(from, maxReceive, simulate) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "CoFHLib")
|
||||
@Optional.Method(modid = "CoFHCore")
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IEnergyHandler ? ((IEnergyHandler) tile).extractEnergy(from, maxExtract, simulate) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "CoFHLib")
|
||||
@Optional.Method(modid = "CoFHCore")
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IEnergyHandler ? ((IEnergyHandler) tile).getEnergyStored(from) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "CoFHLib")
|
||||
@Optional.Method(modid = "CoFHCore")
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IEnergyHandler ? ((IEnergyHandler) tile).getMaxEnergyStored(from) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "CoFHLib")
|
||||
@Optional.Method(modid = "CoFHCore")
|
||||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IEnergyHandler ? ((IEnergyHandler) tile).canConnectEnergy(from) : false;
|
||||
|
||||
-6
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.transvector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -134,11 +133,6 @@ public class BlockTransvectorDislocator extends BlockCamo {
|
||||
return new TileTransvectorDislocator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.DISLOCATOR;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.transvector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
@@ -49,11 +47,6 @@ public class BlockTransvectorInterface extends BlockCamo {
|
||||
return new TileTransvectorInterface();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.INTERFACE;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package thaumic.tinkerer.common.compat;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class EMTCompat {
|
||||
|
||||
public static final boolean EMTLoaded = Loader.isModLoaded("EMT");
|
||||
public static Item electricHoe;
|
||||
|
||||
public static void init() {
|
||||
electricHoe = GameRegistry.findItem("EMT", "ElectricHoeGrowth");
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,12 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import dan200.computercraft.api.turtle.*;
|
||||
import dan200.computercraft.api.turtle.ITurtleAccess;
|
||||
import dan200.computercraft.api.turtle.ITurtleUpgrade;
|
||||
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||
import dan200.computercraft.api.turtle.TurtleSide;
|
||||
import dan200.computercraft.api.turtle.TurtleUpgradeType;
|
||||
import dan200.computercraft.api.turtle.TurtleVerb;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.BlockGas;
|
||||
import thaumic.tinkerer.common.item.ItemGasRemover;
|
||||
|
||||
@@ -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);
|
||||
|
||||
+4
-6
@@ -29,9 +29,8 @@ public class DimensionalShardDropHandler {
|
||||
public void onEntityLivingDrops(LivingDropsEvent event) {
|
||||
if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
|
||||
if (event.entityLiving instanceof EntityEnderman
|
||||
&& event.entityLiving.dimension == ConfigHandler.endDimensionID
|
||||
&& Math.random() <= 1D / 32D)
|
||||
event.drops.add(
|
||||
&& event.entityLiving.dimension == ConfigHandler.endDimensionID)
|
||||
for (int i = 0; i <= event.lootingLevel; i++) if (Math.random() <= 1D / 32D) event.drops.add(
|
||||
new EntityItem(
|
||||
event.entityLiving.worldObj,
|
||||
event.entityLiving.posX,
|
||||
@@ -43,9 +42,8 @@ public class DimensionalShardDropHandler {
|
||||
7)));
|
||||
|
||||
if (event.entityLiving instanceof EntityPigZombie
|
||||
&& event.entityLiving.dimension == ConfigHandler.netherDimensionID
|
||||
&& Math.random() <= 1D / 16D)
|
||||
event.drops.add(
|
||||
&& event.entityLiving.dimension == ConfigHandler.netherDimensionID)
|
||||
for (int i = 0; i <= event.lootingLevel; i++) if (Math.random() <= 1D / 32D) event.drops.add(
|
||||
new EntityItem(
|
||||
event.entityLiving.worldObj,
|
||||
event.entityLiving.posX,
|
||||
|
||||
@@ -208,7 +208,13 @@ public class AspectCropLootManager {
|
||||
|
||||
addAspectLoot(Aspect.ENERGY, new ItemStack(ConfigItems.itemResource, 12));
|
||||
|
||||
addAspectLoot(Aspect.MAGIC, "shard");
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 0));
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 1));
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 2));
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 3));
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 4));
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 5));
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 6));
|
||||
|
||||
addAspectLoot(Aspect.HEAL, new ItemStack(Items.golden_apple));
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package thaumic.tinkerer.common.core.helper;
|
||||
|
||||
import net.minecraft.block.IGrowable;
|
||||
import static thaumic.tinkerer.common.compat.EMTCompat.EMTLoaded;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
@@ -8,6 +10,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.block.BlockInfusedGrain;
|
||||
import thaumic.tinkerer.common.compat.EMTCompat;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
|
||||
/**
|
||||
@@ -26,26 +29,31 @@ public class BonemealEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isMagicHoe(ItemStack stack) {
|
||||
if (stack == null) return false;
|
||||
var item = stack.getItem();
|
||||
return item == ConfigItems.itemHoeElemental || (EMTLoaded && item == EMTCompat.electricHoe);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if (!event.world.isRemote) {
|
||||
if (event.world.getBlock(event.x, event.y, event.z) instanceof BlockInfusedGrain) {
|
||||
if (event.entityPlayer != null && event.entityPlayer.getCurrentEquippedItem() != null) {
|
||||
if (event.entityPlayer.getCurrentEquippedItem().getItem() == ConfigItems.itemHoeElemental) {
|
||||
IGrowable igrowable = (IGrowable) event.world.getBlock(event.x, event.y, event.z);
|
||||
var world = event.world;
|
||||
if (world.isRemote) return;
|
||||
if (!(world.getBlock(event.x, event.y, event.z) instanceof BlockInfusedGrain igrowable)) return;
|
||||
|
||||
if (igrowable.func_149851_a(event.world, event.x, event.y, event.z, event.world.isRemote)) {
|
||||
if (!event.world.isRemote) {
|
||||
if (igrowable.func_149852_a(event.world, event.world.rand, event.x, event.y, event.z)) {
|
||||
igrowable.func_149853_b(event.world, event.world.rand, event.x, event.y, event.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
event.entityPlayer.getCurrentEquippedItem().damageItem(25, event.entityPlayer);
|
||||
Thaumcraft.proxy.blockSparkle(event.world, event.x, event.y, event.z, 0, 2);
|
||||
}
|
||||
}
|
||||
var player = event.entityPlayer;
|
||||
if (player == null) return;
|
||||
|
||||
var hoeOfGrowth = player.getCurrentEquippedItem();
|
||||
if (!isMagicHoe(hoeOfGrowth)) return;
|
||||
|
||||
if (igrowable.func_149851_a(world, event.x, event.y, event.z, false)) {
|
||||
if (igrowable.func_149852_a(world, world.rand, event.x, event.y, event.z)) {
|
||||
igrowable.func_149853_b(world, world.rand, event.x, event.y, event.z);
|
||||
}
|
||||
}
|
||||
|
||||
hoeOfGrowth.damageItem(25, player);
|
||||
Thaumcraft.proxy.blockSparkle(world, event.x, event.y, event.z, 0, 2);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,32 @@ import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.monster.*;
|
||||
import net.minecraft.entity.passive.*;
|
||||
import net.minecraft.entity.monster.EntityBlaze;
|
||||
import net.minecraft.entity.monster.EntityCaveSpider;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityIronGolem;
|
||||
import net.minecraft.entity.monster.EntityMagmaCube;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.entity.monster.EntitySilverfish;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.entity.monster.EntitySnowman;
|
||||
import net.minecraft.entity.monster.EntitySpider;
|
||||
import net.minecraft.entity.monster.EntityWitch;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.passive.EntityBat;
|
||||
import net.minecraft.entity.passive.EntityChicken;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.entity.passive.EntityMooshroom;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
import net.minecraft.entity.passive.EntityPig;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.passive.EntitySquid;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -34,11 +34,24 @@ import li.cil.oc.api.Driver;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
import thaumcraft.api.wands.WandCap;
|
||||
import thaumcraft.api.wands.WandRod;
|
||||
import thaumcraft.common.tiles.*;
|
||||
import thaumcraft.common.tiles.TileAlembic;
|
||||
import thaumcraft.common.tiles.TileArcaneBore;
|
||||
import thaumcraft.common.tiles.TileCentrifuge;
|
||||
import thaumcraft.common.tiles.TileCrucible;
|
||||
import thaumcraft.common.tiles.TileDeconstructionTable;
|
||||
import thaumcraft.common.tiles.TileInfusionMatrix;
|
||||
import thaumcraft.common.tiles.TileJarBrain;
|
||||
import thaumcraft.common.tiles.TileJarFillable;
|
||||
import thaumcraft.common.tiles.TileJarNode;
|
||||
import thaumcraft.common.tiles.TileNode;
|
||||
import thaumcraft.common.tiles.TileSensor;
|
||||
import thaumcraft.common.tiles.TileTubeFilter;
|
||||
import thaumcraft.common.tiles.TileWandPedestal;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.tile.TileFunnel;
|
||||
import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface;
|
||||
import thaumic.tinkerer.common.compat.EMTCompat;
|
||||
import thaumic.tinkerer.common.compat.EnderIO;
|
||||
import thaumic.tinkerer.common.compat.FumeTool;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
@@ -59,12 +72,21 @@ import thaumic.tinkerer.common.item.kami.wand.RodIchorcloth;
|
||||
import thaumic.tinkerer.common.lib.LibMisc;
|
||||
import thaumic.tinkerer.common.network.GuiHandler;
|
||||
import thaumic.tinkerer.common.network.PlayerTracker;
|
||||
import thaumic.tinkerer.common.network.packet.*;
|
||||
import thaumic.tinkerer.common.network.packet.PacketEnchanterAddEnchant;
|
||||
import thaumic.tinkerer.common.network.packet.PacketEnchanterStartWorking;
|
||||
import thaumic.tinkerer.common.network.packet.PacketMobMagnetButton;
|
||||
import thaumic.tinkerer.common.network.packet.PacketPlacerButton;
|
||||
import thaumic.tinkerer.common.network.packet.PacketTabletButton;
|
||||
import thaumic.tinkerer.common.network.packet.kami.PacketSoulHearts;
|
||||
import thaumic.tinkerer.common.network.packet.kami.PacketToggleArmor;
|
||||
import thaumic.tinkerer.common.network.packet.kami.PacketWarpGateButton;
|
||||
import thaumic.tinkerer.common.network.packet.kami.PacketWarpGateTeleport;
|
||||
import thaumic.tinkerer.common.peripheral.OpenComputers.*;
|
||||
import thaumic.tinkerer.common.peripheral.OpenComputers.DriverArcaneBore;
|
||||
import thaumic.tinkerer.common.peripheral.OpenComputers.DriverArcaneEar;
|
||||
import thaumic.tinkerer.common.peripheral.OpenComputers.DriverBrainInAJar;
|
||||
import thaumic.tinkerer.common.peripheral.OpenComputers.DriverDeconstructor;
|
||||
import thaumic.tinkerer.common.peripheral.OpenComputers.DriverEssentiaTransport;
|
||||
import thaumic.tinkerer.common.peripheral.OpenComputers.DriverIAspectContainer;
|
||||
import thaumic.tinkerer.common.peripheral.PeripheralHandler;
|
||||
import thaumic.tinkerer.common.potion.ModPotions;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
@@ -137,6 +159,8 @@ public class TTCommonProxy {
|
||||
} else {
|
||||
ThaumicTinkerer.log.info("Skipping TC Multipart integration");
|
||||
}
|
||||
|
||||
EMTCompat.init();
|
||||
}
|
||||
|
||||
protected void registerPackets() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.block.fire.*;
|
||||
import thaumic.tinkerer.common.block.fire.BlockFireAir;
|
||||
import thaumic.tinkerer.common.block.fire.BlockFireChaos;
|
||||
import thaumic.tinkerer.common.block.fire.BlockFireEarth;
|
||||
import thaumic.tinkerer.common.block.fire.BlockFireIgnis;
|
||||
import thaumic.tinkerer.common.block.fire.BlockFireOrder;
|
||||
import thaumic.tinkerer.common.block.fire.BlockFireWater;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererItem;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
@@ -27,11 +30,6 @@ public class ItemBlockFire extends ItemBlock implements ITTinkererItem {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return ((ITTinkererBlock) field_150939_a).getBlockName();
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -39,11 +37,6 @@ public class ItemBlockMagnet extends ItemBlock implements ITTinkererItem {
|
||||
return "tile." + (par1ItemStack.getItemDamage() == 0 ? LibBlockNames.MAGNET : LibBlockNames.MOB_MAGNET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.MAGNET;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -66,7 +64,7 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer
|
||||
|
||||
public ItemBloodSword() {
|
||||
super(EnumHelper.addToolMaterial("TT_BLOOD", 0, 950, 0, 0, ThaumcraftApi.toolMatThaumium.getEnchantability()));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -112,60 +110,6 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDrops(LivingDropsEvent event) {
|
||||
if (event.source.damageType.equals("player")) {
|
||||
|
||||
EntityPlayer player = (EntityPlayer) event.source.getEntity();
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack != null && stack.getItem() == this
|
||||
&& stack.stackTagCompound != null
|
||||
&& stack.stackTagCompound.getInteger("Activated") == 1) {
|
||||
Aspect[] aspects = EnumMobAspect.getAspectsForEntity(event.entity);
|
||||
// ScanResult sr=new ScanResult((byte)2,0,0,event.entity,"");
|
||||
// AspectList as=ScanManager.getScanAspects(sr,event.entity.worldObj);
|
||||
// if(as!=null && as.size()!=0){
|
||||
if (aspects != null) {
|
||||
event.drops.removeAll(event.drops);
|
||||
// for(Aspect a:as.getAspects()){
|
||||
for (Aspect a : aspects) {
|
||||
addDrops(event, ItemMobAspect.getStackFromAspect(a));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDamageTaken(LivingAttackEvent event) {
|
||||
if (event.entity == null) return;
|
||||
|
||||
if (event.entity.worldObj.isRemote) return;
|
||||
|
||||
boolean handle = handleNext == 0;
|
||||
if (!handle) handleNext--;
|
||||
|
||||
if (event.entityLiving instanceof EntityPlayer && handle) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack itemInUse = player.itemInUse;
|
||||
if (itemInUse != null && itemInUse.getItem() == this) {
|
||||
|
||||
event.setCanceled(true);
|
||||
handleNext = 3;
|
||||
player.attackEntityFrom(DamageSource.magic, 3);
|
||||
}
|
||||
}
|
||||
|
||||
if (handle) {
|
||||
Entity source = event.source.getSourceOfDamage();
|
||||
if (source != null && source instanceof EntityLivingBase) {
|
||||
EntityLivingBase attacker = (EntityLivingBase) source;
|
||||
ItemStack itemInUse = attacker.getHeldItem();
|
||||
if (itemInUse != null && itemInUse.getItem() == this) attacker.attackEntityFrom(DamageSource.magic, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
|
||||
@@ -187,11 +131,6 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer
|
||||
return cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.BLOOD_SWORD;
|
||||
@@ -239,4 +178,62 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer
|
||||
new ItemStack(Items.diamond),
|
||||
new ItemStack(Items.ghast_tear));
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDrops(LivingDropsEvent event) {
|
||||
if (event.source.damageType.equals("player")) {
|
||||
|
||||
EntityPlayer player = (EntityPlayer) event.source.getEntity();
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack != null && stack.getItem() == ItemBloodSword.this
|
||||
&& stack.stackTagCompound != null
|
||||
&& stack.stackTagCompound.getInteger("Activated") == 1) {
|
||||
Aspect[] aspects = EnumMobAspect.getAspectsForEntity(event.entity);
|
||||
// ScanResult sr=new ScanResult((byte)2,0,0,event.entity,"");
|
||||
// AspectList as=ScanManager.getScanAspects(sr,event.entity.worldObj);
|
||||
// if(as!=null && as.size()!=0){
|
||||
if (aspects != null) {
|
||||
event.drops.removeAll(event.drops);
|
||||
// for(Aspect a:as.getAspects()){
|
||||
for (Aspect a : aspects) {
|
||||
addDrops(event, ItemMobAspect.getStackFromAspect(a));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDamageTaken(LivingAttackEvent event) {
|
||||
if (event.entity == null) return;
|
||||
|
||||
if (event.entity.worldObj.isRemote) return;
|
||||
|
||||
boolean handle = handleNext == 0;
|
||||
if (!handle) handleNext--;
|
||||
|
||||
if (event.entityLiving instanceof EntityPlayer && handle) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack itemInUse = player.itemInUse;
|
||||
if (itemInUse != null && itemInUse.getItem() == ItemBloodSword.this) {
|
||||
|
||||
event.setCanceled(true);
|
||||
handleNext = 3;
|
||||
player.attackEntityFrom(DamageSource.magic, 3);
|
||||
}
|
||||
}
|
||||
|
||||
if (handle) {
|
||||
Entity source = event.source.getSourceOfDamage();
|
||||
if (source != null && source instanceof EntityLivingBase) {
|
||||
EntityLivingBase attacker = (EntityLivingBase) source;
|
||||
ItemStack itemInUse = attacker.getHeldItem();
|
||||
if (itemInUse != null && itemInUse.getItem() == ItemBloodSword.this)
|
||||
attacker.attackEntityFrom(DamageSource.magic, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,222 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Nov 24, 2013, 7:31:51 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.core.helper.EnumMobAspect;
|
||||
import thaumic.tinkerer.common.lib.LibItemNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererItem;
|
||||
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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkererItem {
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
|
||||
return super.getItemUseAction(par1ItemStack);
|
||||
}
|
||||
|
||||
private static final int DAMAGE = 10;
|
||||
|
||||
public ItemBloodSword() {
|
||||
super(EnumHelper.addToolMaterial("TT_BLOOD", 0, 950, 0, 0, ThaumcraftApi.toolMatThaumium.getEnchantability()));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
private IIcon activeIcon;
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||
<<<<<<< HEAD
|
||||
if(stack==null)
|
||||
return itemIcon;
|
||||
if(stack.stackTagCompound==null)
|
||||
return itemIcon;
|
||||
return stack.stackTagCompound.getInteger("Activated") == 1 ? activeIcon : itemIcon;
|
||||
=======
|
||||
return (stack.stackTagCompound != null && stack.stackTagCompound.getInteger("Activated") == 1) ? activeIcon : itemIcon;
|
||||
>>>>>>> develop
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
activeIcon = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getItemAttributeModifiers() {
|
||||
Multimap multimap = HashMultimap.create();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", DAMAGE, 0));
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 0.25, 1));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
static int handleNext = 0;
|
||||
|
||||
public void addDrops(LivingDropsEvent event, ItemStack dropStack) {
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDrops(LivingDropsEvent event) {
|
||||
if (event.source.damageType.equals("player")) {
|
||||
|
||||
EntityPlayer player = (EntityPlayer) event.source.getEntity();
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack != null && stack.getItem() == this && stack.stackTagCompound != null && stack.stackTagCompound.getInteger("Activated") == 1) {
|
||||
Aspect[] aspects = EnumMobAspect.getAspectsForEntity(event.entity);
|
||||
//ScanResult sr=new ScanResult((byte)2,0,0,event.entity,"");
|
||||
//AspectList as=ScanManager.getScanAspects(sr,event.entity.worldObj);
|
||||
//if(as!=null && as.size()!=0){
|
||||
if (aspects != null) {
|
||||
event.drops.removeAll(event.drops);
|
||||
//for(Aspect a:as.getAspects()){
|
||||
for (Aspect a : aspects) {
|
||||
addDrops(event, ItemMobAspect.getStackFromAspect(a));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDamageTaken(LivingAttackEvent event) {
|
||||
if (event.entity.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
boolean handle = handleNext == 0;
|
||||
if (!handle)
|
||||
handleNext--;
|
||||
|
||||
if (event.entityLiving instanceof EntityPlayer && handle) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack itemInUse = player.itemInUse;
|
||||
if (itemInUse != null && itemInUse.getItem() == this) {
|
||||
|
||||
event.setCanceled(true);
|
||||
handleNext = 3;
|
||||
player.attackEntityFrom(DamageSource.magic, 3);
|
||||
}
|
||||
}
|
||||
|
||||
if (handle) {
|
||||
Entity source = event.source.getSourceOfDamage();
|
||||
if (source != null && source instanceof EntityLivingBase) {
|
||||
EntityLivingBase attacker = (EntityLivingBase) source;
|
||||
ItemStack itemInUse = attacker.getHeldItem();
|
||||
if (itemInUse != null && itemInUse.getItem() == this)
|
||||
attacker.attackEntityFrom(DamageSource.magic, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World par2World,
|
||||
EntityPlayer par3EntityPlayer) {
|
||||
|
||||
ItemStack cache = super.onItemRightClick(stack, par2World, par3EntityPlayer);
|
||||
if (par3EntityPlayer.isSneaking() && !par2World.isRemote) {
|
||||
if (stack.stackTagCompound == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
if (stack.stackTagCompound.getInteger("Activated") == 0) {
|
||||
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.bloodSword.activateEssentiaHarvest"));
|
||||
stack.stackTagCompound.setInteger("Activated", 1);
|
||||
} else {
|
||||
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.bloodSword.deactivateEssentiaHarvest"));
|
||||
stack.stackTagCompound.setInteger("Activated", 0);
|
||||
}
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.BLOOD_SWORD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldDisplayInTab() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (TTResearchItem) new TTResearchItem(LibResearch.KEY_BLOOD_SWORD, new AspectList().add(Aspect.HUNGER, 2).add(Aspect.WEAPON, 1).add(Aspect.FLESH, 1).add(Aspect.SOUL, 1), -4, 6, 3, new ItemStack(this)).setParents(LibResearch.KEY_CLEANSING_TALISMAN)
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_BLOOD_SWORD), new ResearchPage("1")).setSecondary();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_BLOOD_SWORD, new ItemStack(this), 6, new AspectList().add(Aspect.HUNGER, 20).add(Aspect.DARKNESS, 5).add(Aspect.SOUL, 10).add(Aspect.MAN, 6), new ItemStack(ConfigItems.itemSwordThaumium),
|
||||
new ItemStack(Items.rotten_flesh), new ItemStack(Items.porkchop), new ItemStack(Items.beef), new ItemStack(Items.bone), new ItemStack(Items.diamond), new ItemStack(Items.ghast_tear));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,4 +292,12 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
|
||||
public String getItemName() {
|
||||
return LibItemNames.CLEANSING_TALISMAN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack talisman, ItemStack material) {
|
||||
if (material != null
|
||||
&& material.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemDarkQuartz.class))
|
||||
return true;
|
||||
return super.getIsRepairable(talisman, material);
|
||||
}
|
||||
}
|
||||
@@ -11,10 +11,9 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -48,10 +47,8 @@ public class ItemGas extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList<Object> result = new ArrayList<>();
|
||||
result.add(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousLight.class));
|
||||
return result;
|
||||
public Item[] getMetaItems() {
|
||||
return new Item[] { new ItemGas(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousLight.class)) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -65,6 +66,7 @@ public class ItemGasRemover extends ItemBase {
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
Item[] gasTypes = ThaumicTinkerer.registry.getItemArrayFromClass(ItemGas.class);
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_GAS_REMOVER,
|
||||
LibResearch.KEY_GAS_REMOVER,
|
||||
@@ -76,9 +78,9 @@ public class ItemGasRemover extends ItemBase {
|
||||
'D',
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemDarkQuartz.class)),
|
||||
'T',
|
||||
new ItemStack(ThaumicTinkerer.registry.getItemFromClass(ItemGas.class).get(0)),
|
||||
new ItemStack(gasTypes[0]),
|
||||
'G',
|
||||
new ItemStack(ThaumicTinkerer.registry.getItemFromClass(ItemGas.class).get(1)),
|
||||
new ItemStack(gasTypes[1]),
|
||||
'Q',
|
||||
new ItemStack(Items.quartz));
|
||||
}
|
||||
|
||||
@@ -13,7 +13,11 @@ import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.lib.LibItemNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.*;
|
||||
import thaumic.tinkerer.common.registry.ItemBase;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererInfusionRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipeMulti;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
|
||||
public class ItemInfusedInkwell extends ItemBase implements IScribeTools {
|
||||
|
||||
@@ -118,11 +118,6 @@ public class ItemInfusedPotion extends ItemPotion implements ITTinkererItem {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.INFUSED_POTION;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
@@ -138,11 +137,6 @@ public class ItemInfusedSeeds extends ItemSeeds implements ITTinkererItem {
|
||||
: icons[BlockInfusedGrain.getNumberFromAspectForTexture(getAspect(stack))];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.INFUSED_SEEDS;
|
||||
|
||||
@@ -19,7 +19,11 @@ import thaumic.tinkerer.common.block.tile.TileSummon;
|
||||
import thaumic.tinkerer.common.core.helper.NumericAspectHelper;
|
||||
import thaumic.tinkerer.common.lib.LibItemNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.*;
|
||||
import thaumic.tinkerer.common.registry.ItemBase;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererInfusionRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipeMulti;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
|
||||
public class ItemMobAspect extends ItemBase {
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -112,11 +111,6 @@ public class ItemRevealingHelm extends ItemArmor
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.REVEALING_HELM;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
@@ -22,15 +20,10 @@ public class ItemTravelSlab extends ItemSlab implements ITTinkererItem {
|
||||
super(
|
||||
par1,
|
||||
(BlockSlab) ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockTravelSlab.class).get(1),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockTravelSlab.class, 1),
|
||||
false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.TRAVEL_SLAB;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
@@ -22,15 +20,10 @@ public class ItemWardSlab extends ItemSlab implements ITTinkererItem {
|
||||
super(
|
||||
par1,
|
||||
(BlockSlab) ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockWardSlab.class).get(1),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockWardSlab.class, 1),
|
||||
false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.WARD_SLAB;
|
||||
|
||||
@@ -43,6 +43,7 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.common.entity.EntityMagicMissile;
|
||||
|
||||
public class ItemFocusDeflect extends ItemModFocus {
|
||||
|
||||
@@ -63,7 +64,7 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
range = wand.getFocusEnlarge(stack);
|
||||
}
|
||||
|
||||
List<Entity> projectiles = p.worldObj.getEntitiesWithinAABB(
|
||||
var projectiles = p.worldObj.getEntitiesWithinAABB(
|
||||
IProjectile.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
p.posX - (4 + range),
|
||||
@@ -73,7 +74,9 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
p.posY + (3 + range),
|
||||
p.posZ + (3 + range)));
|
||||
|
||||
for (Entity e : projectiles) {
|
||||
for (var projectile : projectiles) {
|
||||
if (!(projectile instanceof Entity e)) continue;
|
||||
|
||||
if (CheckBlackList(e) || ProjectileHelper.getOwner(e) == p) continue;
|
||||
Vector3 motionVec = new Vector3(e.motionX, e.motionY, e.motionZ).normalize().multiply(
|
||||
Math.sqrt(
|
||||
@@ -87,24 +90,25 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
e.posX += motionVec.x;
|
||||
e.posY += motionVec.y;
|
||||
e.posZ += motionVec.z;
|
||||
|
||||
checkBotaniaMagicMissile(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkBotaniaMagicMissile(Entity e) {
|
||||
if (!Loader.isModLoaded("Botania")) return;
|
||||
if (e instanceof EntityMagicMissile) {
|
||||
e.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) {
|
||||
switch (rank) {
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
}
|
||||
return null;
|
||||
return switch (rank) {
|
||||
case 1, 3, 5 -> new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 2, 4 -> new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private static boolean CheckBlackList(Entity entity) {
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ItemFocusDislocation extends ItemModFocus {
|
||||
stack.getItemDamage(),
|
||||
1 | 2);
|
||||
((ItemBlock) stack.getItem()).field_150939_a
|
||||
.onBlockPlacedBy(world, mop.blockX, mop.blockY, mop.blockZ, player, itemstack);
|
||||
.onBlockPlacedBy(world, mop.blockX, mop.blockY, mop.blockZ, player, stack);
|
||||
NBTTagCompound tileCmp = getStackTileEntity(itemstack);
|
||||
if (tileCmp != null && !tileCmp.hasNoTags()) {
|
||||
TileEntity tile1 = TileEntity.createAndLoadEntity(tileCmp);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.foci;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -58,11 +57,6 @@ public abstract class ItemModFocus extends ItemFocusBasic implements ITTinkererI
|
||||
if (hasDepth()) depth = IconHelper.forItem(par1IconRegister, this, "Depth");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
@@ -35,11 +33,6 @@ public class ItemBlockWarpGate extends ItemBlock implements ITTinkererItem {
|
||||
return TTCommonProxy.kamiRarity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.WARP_GATE;
|
||||
|
||||
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user