mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
470601170a | ||
|
|
40c0ea5f53 | ||
|
|
18c787153c | ||
|
|
dc9e4688a3 | ||
|
|
853ad538df | ||
|
|
d8b69c4311 | ||
|
|
c8d5cf92d2 | ||
|
|
a0f95ee27b | ||
|
|
c27af147bf | ||
|
|
c101bb2e6d | ||
|
|
6c25bcee2a | ||
|
|
1f3e772def | ||
|
|
a6047ee7ec | ||
|
|
85189235ce | ||
|
|
964d3391e4 | ||
|
|
92b212d5e0 | ||
|
|
1972b9ab2b | ||
|
|
99e23607f5 | ||
|
|
63423b8913 | ||
|
|
0d3d390e22 | ||
|
|
96ffb23eae | ||
|
|
d5b1802379 | ||
|
|
a4a4af3087 | ||
|
|
c1d71d767e | ||
|
|
ef9221265d | ||
|
|
cedfe231c3 | ||
|
|
f64efe15c8 | ||
|
|
0905f7b806 | ||
|
|
425af1d868 | ||
|
|
3ec494d713 | ||
|
|
744c39aba8 | ||
|
|
f297a522a9 | ||
|
|
7be29e459e | ||
|
|
c8f7742df5 | ||
|
|
bbe1e7f50f | ||
|
|
8ff5a8cf52 | ||
|
|
b9e61335e3 | ||
|
|
0272517b10 | ||
|
|
8782f7c6a7 | ||
|
|
58676ab46d | ||
|
|
2127d30d16 | ||
|
|
5268737e2e | ||
|
|
c075644243 | ||
|
|
e95d6c870c | ||
|
|
6d278db79d | ||
|
|
4f2618d03b | ||
|
|
c2cbc66645 | ||
|
|
df4a8cfca9 | ||
|
|
00e831c20f | ||
|
|
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 | ||
|
|
acbc864d76 |
No files matched your search
@@ -0,0 +1,17 @@
|
||||
name: Optimize images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
push:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
jobs:
|
||||
optimize-images:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||
secrets: inherit
|
||||
+2
-1
@@ -26,7 +26,8 @@ whitelist.json
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
src/main/resources/mixins.*([!.]).json
|
||||
*.bat
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
layout.json
|
||||
-1262
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id("com.gtnewhorizons.gtnhconvention")
|
||||
}
|
||||
+21
-17
@@ -1,23 +1,27 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:Baubles:1.0.1.14:dev')
|
||||
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-195-GTNH:api')
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev')
|
||||
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive=false}
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-994-GTNH:api')
|
||||
api('com.github.GTNewHorizons:ThaumicBoots:1.5.12:dev') {transitive=false}
|
||||
|
||||
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
|
||||
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.25-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.5.14:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.31:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.8.3:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.19.30:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.14.93-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.7.10:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenCore:1.4.16:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.47-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.54.01: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.24:dev")
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.3:dev')
|
||||
}
|
||||
+197
-26
@@ -1,64 +1,235 @@
|
||||
# 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 modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# 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
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# 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 = false
|
||||
usesMixins = true
|
||||
|
||||
# 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 = false
|
||||
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the 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/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/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-7.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-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/b631911858264c0b6e4d6603d677ff5218766cee/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,10 +85,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -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
|
||||
@@ -114,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.
|
||||
@@ -133,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.
|
||||
@@ -144,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
|
||||
@@ -152,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
|
||||
@@ -169,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" )
|
||||
|
||||
@@ -197,16 +198,19 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, 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.26"
|
||||
}
|
||||
|
||||
|
||||
@@ -13,15 +13,15 @@ package thaumic.tinkerer.client.core.handler;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.client.gui.GuiResearchRecipe;
|
||||
import thaumic.tinkerer.client.core.handler.kami.ToolModeHUDHandler;
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.client.gui.GuiResearchPeripheral;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class ClientTickHandler {
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@ import net.minecraft.client.settings.KeyBinding;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv;
|
||||
|
||||
/**
|
||||
* Created by Katrina on 28/02/14.
|
||||
|
||||
@@ -23,12 +23,12 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.common.item.foci.ItemFocusDislocation;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public final class HUDHandler {
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ package thaumic.tinkerer.client.core.handler.kami;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.network.packet.kami.PacketToggleArmor;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
/**
|
||||
* Created by Katrina on 02/03/14.
|
||||
|
||||
+20
-30
@@ -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;
|
||||
@@ -16,64 +15,55 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -20,12 +20,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
|
||||
public final class SoulHeartClientHandler {
|
||||
|
||||
@@ -95,8 +95,6 @@ public final class SoulHeartClientHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// GL11.glEnable(3008);
|
||||
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -22,10 +22,10 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
|
||||
|
||||
public final class ToolModeHUDHandler {
|
||||
|
||||
|
||||
@@ -20,6 +20,14 @@ import net.minecraftforge.client.EnumHelperClient;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
|
||||
import thaumic.tinkerer.client.core.handler.GemArmorKeyHandler;
|
||||
@@ -37,7 +45,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;
|
||||
@@ -47,21 +59,18 @@ import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
import thaumic.tinkerer.common.block.tile.kami.TileWarpGate;
|
||||
import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
|
||||
import thaumic.tinkerer.common.compat.FumeTool;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.proxy.TTCommonProxy;
|
||||
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
import thaumic.tinkerer.common.item.ItemMobDisplay;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
import thaumic.tinkerer.common.item.kami.foci.ItemFocusShadowbeam;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import thaumic.tinkerer.common.potion.PotionEffectHandlerClient;
|
||||
|
||||
public class TTClientProxy extends TTCommonProxy {
|
||||
public final class TTClientProxy extends TTCommonProxy {
|
||||
|
||||
private PotionEffectHandlerClient potionHandlerClient;
|
||||
|
||||
public static EntityPlayer getPlayer() {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
@@ -70,18 +79,21 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
if (Loader.isModLoaded("ComputerCraft")) {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
if (LoadedMods.computerCraftLoaded) {
|
||||
MinecraftForge.EVENT_BUS.register(new FumeTool());
|
||||
}
|
||||
|
||||
if (ConfigHandler.enableKami)
|
||||
if (ConfigHandler.enableKami) {
|
||||
// kamiRarity = EnumHelperClient.addRarity("KAMI", 0x6, "Kami");
|
||||
|
||||
kamiRarity = EnumHelperClient.addEnum(
|
||||
new Class[][] { { EnumRarity.class, EnumChatFormatting.class, String.class } },
|
||||
EnumRarity.class,
|
||||
"KAMI",
|
||||
EnumChatFormatting.LIGHT_PURPLE,
|
||||
"Kami");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,6 +116,22 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
|
||||
this.potionHandlerClient = new PotionEffectHandlerClient();
|
||||
MinecraftForge.EVENT_BUS.register(potionHandlerClient);
|
||||
FMLCommonHandler.instance().bus().register(potionHandlerClient);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientDisconnect(FMLNetworkEvent.ClientDisconnectionFromServerEvent event) {
|
||||
if (this.potionHandlerClient != null) {
|
||||
MinecraftForge.EVENT_BUS.unregister(potionHandlerClient);
|
||||
FMLCommonHandler.instance().bus().unregister(potionHandlerClient);
|
||||
this.potionHandlerClient = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void registerTiles() {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAnimationTablet.class, new RenderTileAnimationTablet());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileMagnet.class, new RenderTileMagnet());
|
||||
@@ -126,9 +154,11 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderMagnet());
|
||||
RenderingRegistry.registerBlockHandler(new RenderRepairer());
|
||||
|
||||
RenderMobDisplay mobDisplayRenderer = new RenderMobDisplay();
|
||||
MinecraftForge.EVENT_BUS.register(mobDisplayRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class),
|
||||
new RenderMobDisplay());
|
||||
mobDisplayRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class),
|
||||
new RenderGenericSeeds());
|
||||
|
||||
@@ -38,8 +38,7 @@ public class GuiAnimationTablet extends GuiContainer {
|
||||
int x, y;
|
||||
|
||||
TileAnimationTablet tablet;
|
||||
List<GuiButtonAT> buttonListAT = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
|
||||
public GuiAnimationTablet(TileAnimationTablet tablet, InventoryPlayer playerInv) {
|
||||
super(new ContainerAnimationTablet(tablet, 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;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class GuiEnchanting extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ENCHANTER);
|
||||
public TileEnchanter enchanter;
|
||||
public List<String> tooltip = new ArrayList();
|
||||
public List<String> tooltip = new ArrayList<>();
|
||||
int x, y;
|
||||
GuiButtonEnchantment[] enchantButtons = new GuiButtonEnchantment[16];
|
||||
List<Integer> lastTickEnchants;
|
||||
@@ -56,8 +56,8 @@ public class GuiEnchanting extends GuiContainer {
|
||||
this.enchanter = enchanter;
|
||||
lastTickStack = enchanter.getStackInSlot(0);
|
||||
currentStack = enchanter.getStackInSlot(0);
|
||||
lastTickEnchants = new ArrayList(enchanter.enchantments);
|
||||
lastTickLevels = new ArrayList(enchanter.levels);
|
||||
lastTickEnchants = new ArrayList<>(enchanter.enchantments);
|
||||
lastTickLevels = new ArrayList<>(enchanter.levels);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -173,8 +173,8 @@ public class GuiEnchanting extends GuiContainer {
|
||||
buildButtonList();
|
||||
|
||||
lastTickStack = currentStack;
|
||||
lastTickEnchants = new ArrayList(enchanter.enchantments);
|
||||
lastTickLevels = new ArrayList(enchanter.enchantments);
|
||||
lastTickEnchants = new ArrayList<>(enchanter.enchantments);
|
||||
lastTickLevels = new ArrayList<>(enchanter.enchantments);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,7 +231,7 @@ public class GuiEnchanting extends GuiContainer {
|
||||
}
|
||||
|
||||
if (mx > x && mx <= x + 10 && my > y - size && my <= y) {
|
||||
List<String> tooltip = new ArrayList();
|
||||
List<String> tooltip = new ArrayList<>();
|
||||
tooltip.add('\u00a7' + aspect.getChatcolor() + aspect.getName());
|
||||
tooltip.add(current + "/" + totalCost);
|
||||
this.tooltip = tooltip;
|
||||
|
||||
@@ -42,8 +42,7 @@ public class GuiMobMagnet extends GuiContainer {
|
||||
ItemStack stack = null;
|
||||
TileMobMagnet mobMagnet;
|
||||
|
||||
List<GuiButtonMM> buttonListMM = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
|
||||
public GuiMobMagnet(TileMobMagnet tile, InventoryPlayer playerInv) {
|
||||
super(new ContainerMobMagnet(tile, 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));
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@ public class GuiRemotePlacer extends GuiContainer {
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ASPECT_ANALYZER);
|
||||
|
||||
int x, y;
|
||||
List<IRadioButton> radioButtons = new ArrayList();
|
||||
List<GuiButtonRP> buttonListRP = new ArrayList();
|
||||
List<IRadioButton> radioButtons = 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,15 +11,15 @@
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Desktop;
|
||||
import java.net.URI;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.client.gui.GuiResearchRecipe;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.client.gui.GuiResearchRecipe;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiResearchPeripheral extends GuiResearchRecipe {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class GuiButtonEnchant extends GuiButton {
|
||||
&& par3 >= yPosition
|
||||
&& par3 < yPosition + 15
|
||||
&& !enchanter.working) {
|
||||
List<String> tooltip = new ArrayList();
|
||||
List<String> tooltip = new ArrayList<>();
|
||||
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("ttmisc.startEnchant"));
|
||||
parent.tooltip = tooltip;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GuiButtonEnchantment extends GuiButton {
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
if (par2 >= xPosition && par2 < xPosition + 16 && par3 >= yPosition && par3 < yPosition + 16) {
|
||||
List<String> tooltip = new ArrayList();
|
||||
List<String> tooltip = new ArrayList<>();
|
||||
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal(enchant.getName()));
|
||||
for (Aspect aspect : data.aspects.getAspectsSorted()) tooltip.add(
|
||||
" \u00a7" + aspect.getChatcolor()
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ public class GuiIchorPouch extends GuiContainer {
|
||||
|
||||
// Overridden to prevent a dupe
|
||||
// See issue 367
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int slot) {
|
||||
if (this.mc.gameSettings.keyBindsHotbar[this.mc.thePlayer.inventory.currentItem].getKeyCode() != slot) {
|
||||
super.checkHotbarKeys(slot);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class GuiWarpGateDestinations extends GuiScreen {
|
||||
int lastMouseX, lastMouseY;
|
||||
int x, y;
|
||||
int ticks;
|
||||
List<String> tooltip = new ArrayList();
|
||||
List<String> tooltip = new ArrayList<>();
|
||||
|
||||
public GuiWarpGateDestinations(TileWarpGate warpGate) {
|
||||
this.warpGate = warpGate;
|
||||
@@ -113,7 +113,7 @@ public class GuiWarpGateDestinations extends GuiScreen {
|
||||
int gateY = warpGate.zCoord - y;
|
||||
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
|
||||
List<Object[]> coords = new ArrayList();
|
||||
List<Object[]> coords = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < warpGate.getSizeInventory(); i++) {
|
||||
ItemStack stack = warpGate.getStackInSlot(i);
|
||||
|
||||
@@ -32,6 +32,7 @@ public final class LibResources {
|
||||
public static final String GUI_ICHOR_POUCH = PREFIX_GUI + "ichorPouch.png";
|
||||
public static final String GUI_WARP_GATE = PREFIX_GUI + "warpGate.png";
|
||||
public static final String GUI_REMOTE_PLACER = PREFIX_GUI + "remotePlacer.png";
|
||||
public static final String NEI_RECIPE_ARROW = PREFIX_GUI + "neiRecipeArrow.png";
|
||||
|
||||
public static final String MISC_R_ENCHANTING = PREFIX_MISC + "r_enchanting.png";
|
||||
public static final String MISC_AT_CENTER = PREFIX_MISC + "atCenter.png";
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package thaumic.tinkerer.client.nei;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
|
||||
public class NEIConfig implements IConfigureNEI {
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
if (!LoadedMods.aspectRecipeIndexLoaded) return;
|
||||
AspectRecipeIndexIntegration.register();
|
||||
|
||||
NEIInfusedSeedRecipeHandler seedHandler = new NEIInfusedSeedRecipeHandler();
|
||||
API.registerRecipeHandler(seedHandler);
|
||||
API.registerUsageHandler(seedHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Thaumic Tinkerer NEI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
// This needs to be an inner class to prevent a NoClassDefFoundError from class loading when ARI isn't loaded.
|
||||
private static class AspectRecipeIndexIntegration {
|
||||
|
||||
public static void register() {
|
||||
TemplateRecipeHandler handler = new NEINecromancyHandler();
|
||||
GuiCraftingRecipe.craftinghandlers.add(handler);
|
||||
GuiUsageRecipe.usagehandlers.add(handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
package thaumic.tinkerer.client.nei;
|
||||
|
||||
import static thaumic.tinkerer.client.lib.LibResources.NEI_RECIPE_ARROW;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumic.tinkerer.common.core.helper.AspectCropLootManager;
|
||||
import thaumic.tinkerer.common.core.helper.AspectCropLootManager.LootEntry;
|
||||
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
|
||||
public class NEIInfusedSeedRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
private static final int SLOT_NUM_X = 9;
|
||||
private static final DecimalFormat CHANCE_FORMAT = new DecimalFormat("#.##");
|
||||
|
||||
public static class DropInfo {
|
||||
|
||||
public final ItemStack stack;
|
||||
public final float chance;
|
||||
|
||||
public DropInfo(ItemStack stack, float chance) {
|
||||
this.stack = stack;
|
||||
this.chance = chance;
|
||||
}
|
||||
}
|
||||
|
||||
public static class SeedDropRecipeWrapper {
|
||||
|
||||
public final ItemStack seed;
|
||||
public final List<DropInfo> drops;
|
||||
|
||||
public SeedDropRecipeWrapper(ItemStack seed, List<DropInfo> drops) {
|
||||
this.seed = seed;
|
||||
this.drops = drops;
|
||||
}
|
||||
}
|
||||
|
||||
public class CachedSeedRecipe extends CachedRecipe {
|
||||
|
||||
private final List<PositionedStack> input = new ArrayList<>();
|
||||
private final List<PositionedStack> outputs = new ArrayList<>();
|
||||
public final SeedDropRecipeWrapper wrapper;
|
||||
public int rows = 0;
|
||||
|
||||
public CachedSeedRecipe(SeedDropRecipeWrapper recipe) {
|
||||
this.wrapper = recipe;
|
||||
this.input.add(new PositionedStack(recipe.seed, 74, 4));
|
||||
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
for (DropInfo drop : recipe.drops) {
|
||||
int xPos = 3 + 18 * col;
|
||||
int yPos = 36 + 18 * row;
|
||||
|
||||
this.outputs.add(new PositionedStack(drop.stack, xPos, yPos));
|
||||
|
||||
col++;
|
||||
if (col >= SLOT_NUM_X) {
|
||||
col = 0;
|
||||
row++;
|
||||
}
|
||||
}
|
||||
|
||||
this.rows = col == 0 ? row - 1 : row;
|
||||
if (this.rows < 0) this.rows = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks() {
|
||||
return outputs;
|
||||
}
|
||||
}
|
||||
|
||||
private List<SeedDropRecipeWrapper> getSeedRecipes() {
|
||||
List<SeedDropRecipeWrapper> recipes = new ArrayList<>();
|
||||
Map<Aspect, List<LootEntry>> allLoot = AspectCropLootManager.getAllLoot();
|
||||
|
||||
for (Map.Entry<Aspect, List<LootEntry>> entry : allLoot.entrySet()) {
|
||||
Aspect aspect = entry.getKey();
|
||||
List<LootEntry> lootList = entry.getValue();
|
||||
|
||||
if (lootList == null || lootList.isEmpty()) continue;
|
||||
|
||||
int totalWeight = 0;
|
||||
for (LootEntry loot : lootList) {
|
||||
totalWeight += loot.weight;
|
||||
}
|
||||
|
||||
List<DropInfo> drops = new ArrayList<>();
|
||||
for (LootEntry loot : lootList) {
|
||||
if (loot.stack != null) {
|
||||
float chance = ((float) loot.weight / totalWeight) * 100f;
|
||||
drops.add(new DropInfo(loot.stack.copy(), chance));
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack seedStack = ItemInfusedSeeds.getStackFromAspect(aspect);
|
||||
|
||||
recipes.add(new SeedDropRecipeWrapper(seedStack, drops));
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(73, 22, 18, 12), getOverlayIdentifier()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(getOverlayIdentifier()) && getClass() == NEIInfusedSeedRecipeHandler.class) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
for (DropInfo drop : recipe.drops) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(result, drop.stack)) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
if (ingredient != null && ingredient.getItem() instanceof ItemInfusedSeeds) {
|
||||
Aspect aspectIn = ItemInfusedSeeds.getAspect(ingredient);
|
||||
|
||||
if (aspectIn != null) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
Aspect aspectRecipe = ItemInfusedSeeds.getAspect(recipe.seed);
|
||||
if (aspectIn == aspectRecipe || aspectIn.getTag().equals(aspectRecipe.getTag())) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeHeight(int recipeIndex) {
|
||||
return 36 + 18 * (((CachedSeedRecipe) this.arecipes.get(recipeIndex)).rows + 1) + 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
|
||||
GuiDraw.drawTexturedModalRect(74, 3, 7, 83, 18, 18);
|
||||
|
||||
CachedSeedRecipe recipe = (CachedSeedRecipe) this.arecipes.get(recipeIndex);
|
||||
int totalDrops = recipe.outputs.size();
|
||||
|
||||
for (int i = 0; i < totalDrops; i++) {
|
||||
int col = i % SLOT_NUM_X;
|
||||
int row = i / SLOT_NUM_X;
|
||||
int xPos = 2 + 18 * col;
|
||||
int yPos = 35 + 18 * row;
|
||||
|
||||
GuiDraw.drawTexturedModalRect(xPos, yPos, 7, 83, 18, 18);
|
||||
}
|
||||
|
||||
GuiDraw.changeTexture(NEI_RECIPE_ARROW);
|
||||
|
||||
GuiDraw.drawTexturedModalRect(74, 20, 0, 0, 18, 14);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack stack, List<String> currenttip, int recipeIndex) {
|
||||
CachedSeedRecipe recipe = (CachedSeedRecipe) this.arecipes.get(recipeIndex);
|
||||
|
||||
for (DropInfo drop : recipe.wrapper.drops) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(stack, drop.stack)) {
|
||||
|
||||
String chancePrefix = StatCollector.translateToLocal("tt.nei.chance");
|
||||
|
||||
String chanceStr = CHANCE_FORMAT.format(drop.chance) + "%";
|
||||
currenttip.add(EnumChatFormatting.GRAY + chancePrefix + ": " + EnumChatFormatting.YELLOW + chanceStr);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "minecraft:textures/gui/container/inventory.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return "tt_infused_seeds_drops";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHandlerId() {
|
||||
return "tt_infused_seeds_drops";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tt.nei.category.infusedseeds");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package thaumic.tinkerer.client.nei;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.glease.tc4tweak.api.infusionrecipe.RecipeIngredient;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.gtnewhorizons.aspectrecipeindex.nei.InfusionRecipeHandler;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.helper.EnumMobAspect;
|
||||
import thaumic.tinkerer.common.item.ItemMobAspect;
|
||||
import thaumic.tinkerer.common.item.ItemMobDisplay;
|
||||
|
||||
public class NEINecromancyHandler extends InfusionRecipeHandler {
|
||||
|
||||
public static final String OVERLAY = "thaumictinkerer.necromancy";
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tile.spawner.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return OVERLAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeHeight(int recipe) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(this.getOverlayIdentifier())) {
|
||||
for (EnumMobAspect value : EnumMobAspect.values()) {
|
||||
new NecromancyCachedRecipe(value);
|
||||
}
|
||||
} else if (outputId.equals("item")) {
|
||||
this.loadCraftingRecipes((ItemStack) results[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
if (result.getItem() instanceof ItemMobDisplay display) {
|
||||
EnumMobAspect type = display.getEntityType(result);
|
||||
for (EnumMobAspect value : EnumMobAspect.values()) {
|
||||
if (value == type) {
|
||||
new NecromancyCachedRecipe(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
loadUsageRecipes(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
if (!(ingredient.getItem() instanceof ItemMobAspect)) {
|
||||
return;
|
||||
}
|
||||
Aspect target = ItemMobAspect.getAspect(ingredient);
|
||||
if (target == null) return;
|
||||
for (EnumMobAspect value : EnumMobAspect.values()) {
|
||||
for (Aspect aspect : value.aspects) {
|
||||
if (aspect == target) {
|
||||
new NecromancyCachedRecipe(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
loadCraftingRecipes(inputId, ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
GL11.glPushMatrix();
|
||||
GuiDraw.changeTexture(THAUM_OVERLAYS);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glScalef(1.75F, 1.75F, 1.0F);
|
||||
GL11.glTranslatef(-0.5F, -1F, 0);
|
||||
GuiDraw.drawTexturedModalRect(27, 8, 207, 78, 42, 42); // Runic matrix drawing
|
||||
GL11.glTranslatef(0.5F, 1F, 0);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInstability(int recipeIndex) {}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipeIndex) {
|
||||
drawSeeAllRecipesLabel(2);
|
||||
}
|
||||
|
||||
protected class NecromancyCachedRecipe extends InfusionCachedRecipe {
|
||||
|
||||
public NecromancyCachedRecipe(EnumMobAspect enumMobAspect) {
|
||||
super(0, true);
|
||||
setIngredients(enumMobAspect.aspects);
|
||||
setResult(enumMobAspect);
|
||||
this.aspects = new AspectList();
|
||||
addIfValid();
|
||||
}
|
||||
|
||||
private void setResult(EnumMobAspect enumMobAspect) {
|
||||
ItemStack result = new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class));
|
||||
((ItemMobDisplay) result.getItem()).setEntityType(result, enumMobAspect);
|
||||
this.result = new PositionedStack(result, OUTPUT_X, 39, false);
|
||||
}
|
||||
|
||||
private void setIngredients(Aspect[] aspects) {
|
||||
if (aspects.length < 3) return;
|
||||
addSurroundingItems(
|
||||
Arrays.asList(
|
||||
RecipeIngredient.item(true, ItemMobAspect.getStackFromAspect(aspects[0])),
|
||||
RecipeIngredient.item(true, ItemMobAspect.getStackFromAspect(aspects[1])),
|
||||
RecipeIngredient.item(true, ItemMobAspect.getStackFromAspect(aspects[2]))));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int itemOffset() {
|
||||
return -24;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,10 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.common.block.BlockInfusedGrain;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
/**
|
||||
* Created by pixlepix on 8/4/14.
|
||||
@@ -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();
|
||||
|
||||
@@ -18,10 +18,10 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.client.render.tile.RenderTileMagnet;
|
||||
import thaumic.tinkerer.common.block.tile.TileMagnet;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderMagnet implements ISimpleBlockRenderingHandler {
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderRepairer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import thaumcraft.client.renderers.block.BlockRenderer;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.common.block.kami.BlockWarpGate;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderWarpGate extends BlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -126,12 +123,5 @@ public class RenderGenericSeeds implements IItemRenderer {
|
||||
tesselator.draw();
|
||||
}
|
||||
|
||||
private void setColorForAspect(Aspect aspect) {
|
||||
// if(!aspect.isPrimal()){
|
||||
// float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F;
|
||||
// float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F;
|
||||
// float b = (aspect.getColor() & 0xFF) / 255.0F;
|
||||
// GL11.glColor3f(r, g, b);
|
||||
// }
|
||||
}
|
||||
private void setColorForAspect(Aspect aspect) {}
|
||||
}
|
||||
@@ -1,22 +1,42 @@
|
||||
package thaumic.tinkerer.client.render.item;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
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;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import thaumic.tinkerer.common.core.helper.EnumMobAspect;
|
||||
import thaumic.tinkerer.common.item.ItemMobDisplay;
|
||||
|
||||
public class RenderMobDisplay implements IItemRenderer {
|
||||
|
||||
private static RenderItem renderItem = new RenderItem();
|
||||
private static final int ATTRIB_MASK = GL11.GL_ENABLE_BIT | GL11.GL_CURRENT_BIT
|
||||
| GL11.GL_DEPTH_BUFFER_BIT
|
||||
| GL11.GL_COLOR_BUFFER_BIT
|
||||
| GL11.GL_LIGHTING_BIT
|
||||
| GL11.GL_TEXTURE_BIT;
|
||||
|
||||
private final EnumMap<EnumMobAspect, EntityLiving> cache = new EnumMap<>(EnumMobAspect.class);
|
||||
private World cachedWorld;
|
||||
|
||||
private void setCachedWorld(World world) {
|
||||
cache.clear();
|
||||
cachedWorld = world;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world == cachedWorld) setCachedWorld(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack itemStack, ItemRenderType itemRenderType) {
|
||||
@@ -31,67 +51,34 @@ public class RenderMobDisplay implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType itemRenderType, ItemStack itemStack, Object... objects) {
|
||||
ItemMobDisplay item = (ItemMobDisplay) itemStack.getItem();
|
||||
if (!(itemStack.getItem() instanceof ItemMobDisplay item)) return;
|
||||
EnumMobAspect aspect = item.getEntityType(itemStack);
|
||||
Entity entity = null;
|
||||
float f1 = 0.4f;
|
||||
float verticalOffset = 0.0f;
|
||||
if (aspect != null) {
|
||||
entity = EnumMobAspect.getEntityFromCache(aspect, null);
|
||||
f1 = aspect.getScale();
|
||||
verticalOffset = aspect.getVerticalOffset();
|
||||
}
|
||||
switch (itemRenderType) {
|
||||
case ENTITY:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.5, 0.2 + verticalOffset, 0.5);
|
||||
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
|
||||
GL11.glScalef(f1, f1, f1);
|
||||
EntityItem eItem = (EntityItem) objects[1];
|
||||
if (entity != null) {
|
||||
entity.worldObj = (Minecraft.getMinecraft() != null) ? Minecraft.getMinecraft().theWorld : null;
|
||||
if (entity.worldObj != null) {
|
||||
Render renderer = RenderManager.instance.getEntityRenderObject(entity);
|
||||
entity.setWorld(eItem.worldObj);
|
||||
entity.copyLocationAndAnglesFrom(eItem);
|
||||
if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
// if (renderWithLighting) RenderUtils.enableLightmap();
|
||||
renderer.doRender(entity, 0, 0, 0, 0, 0);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
entity.worldObj = null;
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
case EQUIPPED:
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
break;
|
||||
case INVENTORY:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.5, 0.2 + verticalOffset, 0.5);
|
||||
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
|
||||
GL11.glScalef(f1, f1, f1);
|
||||
if (entity != null) {
|
||||
entity.worldObj = (Minecraft.getMinecraft() != null) ? Minecraft.getMinecraft().theWorld : null;
|
||||
if (entity.worldObj != null) {
|
||||
Render renderer = RenderManager.instance.getEntityRenderObject(entity);
|
||||
if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
// if (renderWithLighting) RenderUtils.enableLightmap();
|
||||
renderer.doRender(entity, 0, 0, 0, 0, 0);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
entity.worldObj = null;
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
if (aspect == null) return;
|
||||
|
||||
case FIRST_PERSON_MAP:
|
||||
break;
|
||||
final World world = Minecraft.getMinecraft().theWorld;
|
||||
if (world != cachedWorld) setCachedWorld(world);
|
||||
if (world == null) return;
|
||||
|
||||
EntityLiving entity = cache.get(aspect);
|
||||
if (entity == null || entity.worldObj != world) {
|
||||
entity = aspect.createEntity(world);
|
||||
cache.put(aspect, entity);
|
||||
}
|
||||
|
||||
final Render renderer = RenderManager.instance.getEntityRenderObject(entity);
|
||||
if (renderer == null || renderer.getFontRendererFromRenderManager() == null) return;
|
||||
|
||||
float scale = aspect.getScale();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(ATTRIB_MASK);
|
||||
try {
|
||||
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glTranslatef(0, (-entity.height / 2) + aspect.getVerticalOffset(), 0.0F);
|
||||
renderer.doRender(entity, 0, 0, 0, 0, 0);
|
||||
} finally {
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,13 +13,8 @@ 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 type != ItemRenderType.INVENTORY && type!=ItemRenderType.ENTITY;
|
||||
// return type != ItemRenderType.INVENTORY ;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,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);
|
||||
@@ -79,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;
|
||||
|
||||
@@ -13,19 +13,27 @@ package thaumic.tinkerer.common;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.command.ICommandManager;
|
||||
import net.minecraft.command.ServerCommandManager;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
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.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.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import thaumcraft.common.CommonProxy;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumic.tinkerer.api.InterModCommsOperations;
|
||||
import thaumic.tinkerer.common.core.commands.KamiUnlockedCommand;
|
||||
import thaumic.tinkerer.common.core.commands.MaxResearchCommand;
|
||||
import thaumic.tinkerer.common.core.commands.SetTendencyCommand;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.proxy.TTCommonProxy;
|
||||
import thaumic.tinkerer.common.dim.WorldProviderBedrock;
|
||||
@@ -33,15 +41,6 @@ import thaumic.tinkerer.common.lib.LibMisc;
|
||||
import thaumic.tinkerer.common.peripheral.PeripheralHandler;
|
||||
import thaumic.tinkerer.common.registry.TTRegistry;
|
||||
import thaumic.tinkerer.common.research.KamiResearchItem;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
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.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
|
||||
@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES)
|
||||
public class ThaumicTinkerer {
|
||||
@@ -64,7 +63,7 @@ public class ThaumicTinkerer {
|
||||
log = event.getModLog();
|
||||
tcProxy = Thaumcraft.proxy;
|
||||
proxy.preInit(event);
|
||||
if (Loader.isModLoaded("Waila")) {
|
||||
if (LoadedMods.wailaLoaded) {
|
||||
FMLInterModComms.sendMessage(
|
||||
"Waila",
|
||||
"register",
|
||||
@@ -72,34 +71,6 @@ public class ThaumicTinkerer {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStart(FMLServerStartingEvent event) {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
ICommandManager command = server.getCommandManager();
|
||||
ServerCommandManager manager = (ServerCommandManager) command;
|
||||
manager.registerCommand(new SetTendencyCommand());
|
||||
manager.registerCommand(new MaxResearchCommand());
|
||||
manager.registerCommand(new KamiUnlockedCommand());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void HandleIMCMessages(FMLInterModComms.IMCEvent messages) {
|
||||
for (FMLInterModComms.IMCMessage message : messages.getMessages()) {
|
||||
if (message.key.equalsIgnoreCase(InterModCommsOperations.ADD_RESEARCH_BLACKLIST)) {
|
||||
String[] values = message.getStringValue().split(",");
|
||||
KamiResearchItem.Blacklist.addAll(Arrays.asList(values));
|
||||
}
|
||||
if (message.key.equalsIgnoreCase(InterModCommsOperations.ADD_CC_BLACKLIST)) {
|
||||
if (Loader.isModLoaded("ComputerCraft")) blackListCCDevices(message.getStringValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ComputerCraft")
|
||||
public void blackListCCDevices(String classname) {
|
||||
PeripheralHandler.Blacklist.add(classname);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
proxy.init(event);
|
||||
@@ -113,4 +84,32 @@ public class ThaumicTinkerer {
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
proxy.serverStarting(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
proxy.serverStopped(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void HandleIMCMessages(FMLInterModComms.IMCEvent messages) {
|
||||
for (FMLInterModComms.IMCMessage message : messages.getMessages()) {
|
||||
if (message.key.equalsIgnoreCase(InterModCommsOperations.ADD_RESEARCH_BLACKLIST)) {
|
||||
String[] values = message.getStringValue().split(",");
|
||||
KamiResearchItem.Blacklist.addAll(Arrays.asList(values));
|
||||
}
|
||||
if (message.key.equalsIgnoreCase(InterModCommsOperations.ADD_CC_BLACKLIST)) {
|
||||
if (LoadedMods.computerCraftLoaded) blackListCCDevices(message.getStringValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ComputerCraft")
|
||||
public void blackListCCDevices(String classname) {
|
||||
PeripheralHandler.Blacklist.add(classname);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -31,6 +30,8 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
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;
|
||||
@@ -42,13 +43,12 @@ 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;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAnimationTablet extends BlockModContainer {
|
||||
|
||||
@@ -91,10 +91,6 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
if (l1 == 3) b0 = 4;
|
||||
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);
|
||||
// TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
|
||||
// if(par5EntityLiving instanceof EntityPlayer) {
|
||||
// tablet.Owner = ((EntityPlayer) par5EntityLiving).username;
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,41 +98,32 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (tablet != null) {
|
||||
if (tablet.getIsBreaking()) {
|
||||
// ChunkCoordinates coords = tablet.getTargetLoc();
|
||||
// par1World.destroyBlockInWorldPartially(tablet.getFakePlayer().entityId, coords.posX, coords.posY,
|
||||
// coords.posZ, -1);
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,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);
|
||||
@@ -157,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
|
||||
@@ -167,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
|
||||
@@ -206,8 +176,6 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
|
||||
return true;
|
||||
} else {
|
||||
// if(tablet.Owner==null || tablet.Owner.equals(""))
|
||||
// tablet.Owner=par5EntityPlayer.username;
|
||||
par5EntityPlayer
|
||||
.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_TABLET, par1World, par2, par3, par4);
|
||||
}
|
||||
@@ -239,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;
|
||||
@@ -278,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
|
||||
@@ -289,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;
|
||||
@@ -34,6 +33,7 @@ import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.tile.TileAspectAnalyzer;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibGuiIDs;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
@@ -42,7 +42,6 @@ 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 cpw.mods.fml.common.Loader;
|
||||
|
||||
public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
|
||||
@@ -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;
|
||||
@@ -147,7 +141,7 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return Loader.isModLoaded("ComputerCraft");
|
||||
return LoadedMods.computerCraftLoaded;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,9 +27,9 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumic.tinkerer.common.block.tile.TileCamo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.block.tile.TileCamo;
|
||||
|
||||
public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -28,6 +27,8 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
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;
|
||||
@@ -45,8 +46,6 @@ 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 cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockEnchanter extends BlockModContainer {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BlockForcefield extends BlockMod {
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return new ArrayList<ItemStack>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -29,6 +28,8 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -42,8 +43,6 @@ 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 cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockFunnel extends BlockModContainer {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -25,12 +25,12 @@ import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
|
||||
|
||||
@@ -118,7 +118,7 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return new ArrayList(); // Empty List
|
||||
return new ArrayList<>(); // Empty List
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -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;
|
||||
|
||||
@@ -17,10 +17,10 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockGaseousLight extends BlockGas {
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockGaseousShadow extends BlockGas {
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -17,6 +15,7 @@ import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.block.tile.TileCamo;
|
||||
import thaumic.tinkerer.common.block.tile.TileGolemConnector;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe;
|
||||
@@ -24,7 +23,6 @@ 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 cpw.mods.fml.common.Loader;
|
||||
|
||||
public class BlockGolemConnector extends BlockCamo {
|
||||
|
||||
@@ -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;
|
||||
@@ -60,7 +53,7 @@ public class BlockGolemConnector extends BlockCamo {
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return Loader.isModLoaded("ComputerCraft");
|
||||
return LoadedMods.computerCraftLoaded;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
@@ -15,14 +14,14 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.block.tile.TileInfusedFarmland;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by pixlepix on 8/4/14.
|
||||
@@ -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;
|
||||
@@ -113,11 +107,13 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
|
||||
@Override
|
||||
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return p_149691_1_ == 1 ? (iconWet) : Blocks.dirt.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||
this.iconWet = IconHelper.forBlock(p_149651_1_, this);
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCrops;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -37,7 +38,6 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
|
||||
public static final int BREEDING_CHANCE = 10;
|
||||
private IIcon[][] icons;
|
||||
private TileInfusedGrain tileEntity;
|
||||
|
||||
// Returns 0-5 for primal aspects, or 6 if compound aspect
|
||||
public static int getNumberFromAspectForTexture(Aspect aspect) {
|
||||
@@ -116,25 +116,21 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int metadata) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileInfusedGrain) {
|
||||
tileEntity = (TileInfusedGrain) tile;
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
if (world == null) return ret;
|
||||
Random rand = new Random();
|
||||
int count = 1;
|
||||
for (int i = 0; i < count; i++) {
|
||||
TileInfusedGrain tileGrain = getTileEntitySafe(world, x, y, z);
|
||||
TileEntity tileGrain = world.getTileEntity(x, y, z);
|
||||
ItemStack seedStack = new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class));
|
||||
ItemInfusedSeeds.setAspect(seedStack, getAspectDropped(world, x, y, z, metadata));
|
||||
if (tileGrain != null) {
|
||||
ItemInfusedSeeds.setAspectTendencies(seedStack, tileGrain.primalTendencies);
|
||||
ItemInfusedSeeds.setAspectTendencies(seedStack, ((TileInfusedGrain) tileGrain).primalTendencies);
|
||||
}
|
||||
while (rand.nextInt(10000) < Math.pow(getPrimalTendencyCount(world, x, y, z, Aspect.ENTROPY), 2)) {
|
||||
seedStack.stackSize++;
|
||||
@@ -144,27 +140,42 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
}
|
||||
if (metadata >= 7) {
|
||||
do {
|
||||
Aspect aspect = getAspectSafe(world, x, y, z);
|
||||
Aspect aspect = getAspect(world, x, y, z);
|
||||
ItemStack retItem = AspectCropLootManager.getLootForAspect(aspect);
|
||||
if (retItem != null) ret.add(retItem);
|
||||
|
||||
} while (world.rand.nextInt(75) < getPrimalTendencyCount(world, x, y, z, Aspect.ORDER));
|
||||
}
|
||||
tileEntity = null;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
if (willHarvest) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.removedByPlayer(world, player, x, y, z, willHarvest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
super.harvestBlock(world, player, x, y, z, meta);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
public int getPrimalTendencyCount(World world, int x, int y, int z, Aspect aspect) {
|
||||
TileInfusedGrain tileGrain = getTileEntitySafe(world, x, y, z);
|
||||
return tileGrain != null ? tileGrain.primalTendencies.getAmount(aspect) : 0;
|
||||
TileEntity tileGrain = world.getTileEntity(x, y, z);
|
||||
return tileGrain instanceof TileInfusedGrain ? ((TileInfusedGrain) tileGrain).primalTendencies.getAmount(aspect)
|
||||
: 0;
|
||||
}
|
||||
|
||||
private void fertilizeSoil(World world, int x, int y, int z, int metadata) {
|
||||
if (metadata >= 7) {
|
||||
do {
|
||||
if (world.getTileEntity(x, y - 1, z) instanceof TileInfusedFarmland) {
|
||||
Aspect currentAspect = getAspectSafe(world, x, y, z);
|
||||
Aspect currentAspect = getAspect(world, x, y, z);
|
||||
((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).aspectList.add(currentAspect, 1);
|
||||
((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).reduceSaturatedAspects();
|
||||
world.markBlockForUpdate(x, y - 1, z);
|
||||
@@ -173,6 +184,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
// Prevent normal growth from occuring
|
||||
// Growth takes place in the tile entity
|
||||
@@ -180,7 +192,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
}
|
||||
|
||||
public Aspect getAspectDropped(World world, int x, int y, int z, int metadata) {
|
||||
Aspect currentAspect = getAspectSafe(world, x, y, z);
|
||||
Aspect currentAspect = getAspect(world, x, y, z);
|
||||
if (metadata >= 7 && currentAspect != null) {
|
||||
if (world.getTileEntity(x, y - 1, z) instanceof TileInfusedFarmland) {
|
||||
AspectList farmlandAspectList = ((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).aspectList;
|
||||
@@ -199,11 +211,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;
|
||||
@@ -249,31 +256,4 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
return null;
|
||||
}
|
||||
|
||||
private TileInfusedGrain getTileEntitySafe(World world, int x, int y, int z) {
|
||||
if (tileEntity != null) {
|
||||
return tileEntity;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile != null && tile instanceof TileInfusedGrain) {
|
||||
return (TileInfusedGrain) tile;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Aspect getAspectSafe(World world, int x, int y, int z) {
|
||||
if (tileEntity != null) {
|
||||
return tileEntity.aspect;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile != null && tile instanceof TileInfusedGrain) {
|
||||
return ((TileInfusedGrain) tile).aspect;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -30,6 +29,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -53,8 +54,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.RecipeHelper;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBlock {
|
||||
|
||||
@@ -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;
|
||||
@@ -284,7 +278,7 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
|
||||
|
||||
@Override
|
||||
public HashMap<Class<? extends TileEntity>, String> getAdditionalTileEntities() {
|
||||
HashMap<Class<? extends TileEntity>, String> r = new HashMap<Class<? extends TileEntity>, String>();
|
||||
HashMap<Class<? extends TileEntity>, String> r = new HashMap<>();
|
||||
r.put(TileMobMagnet.class, LibBlockNames.MOB_MAGNET);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -11,19 +11,17 @@
|
||||
*/
|
||||
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;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class BlockMod extends Block implements ITTinkererBlock {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -18,11 +18,11 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class BlockModContainer<T extends TileEntity> extends BlockContainer implements ITTinkererBlock {
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.item.ItemBrightNitor;
|
||||
import thaumic.tinkerer.common.item.kami.armor.ItemGemLegs;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockNitorGas extends BlockGas {
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -30,6 +29,8 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -37,6 +38,7 @@ import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.compat.TinkersConstructCompat;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
@@ -45,9 +47,6 @@ 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 cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockRepairer extends BlockModContainer {
|
||||
|
||||
@@ -128,7 +127,7 @@ public class BlockRepairer extends BlockModContainer {
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
int dmg;
|
||||
if (Loader.isModLoaded("TConstruct")) {
|
||||
if (LoadedMods.TConstructLoaded) {
|
||||
if (TinkersConstructCompat.isTConstructTool(itemstack)) {
|
||||
dmg = TinkersConstructCompat.getDamage(itemstack);
|
||||
} else dmg = itemstack.getItemDamage();
|
||||
@@ -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;
|
||||
@@ -25,6 +24,8 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
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;
|
||||
@@ -40,8 +41,6 @@ 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 cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockSummon extends Block implements ITTinkererBlock {
|
||||
|
||||
@@ -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;
|
||||
@@ -17,6 +17,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
@@ -27,8 +29,6 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by Katrina on 13/04/2015.
|
||||
@@ -64,11 +64,6 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
|
||||
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class));
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int idDropped(int par1, Random par2Random, int par3) {
|
||||
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ItemStack createStackedBlock(int par1) {
|
||||
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class));
|
||||
@@ -86,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,10 +1,9 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
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;
|
||||
@@ -23,6 +22,8 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
@@ -34,8 +35,6 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by Katrina on 13/04/2015.
|
||||
@@ -72,11 +71,6 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEn
|
||||
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class));
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int idDropped(int par1, Random par2Random, int par3) {
|
||||
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ItemStack createStackedBlock(int par1) {
|
||||
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class));
|
||||
@@ -94,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
|
||||
@@ -192,10 +184,9 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEn
|
||||
(double) (y + 1),
|
||||
(double) (z + 1)).expand(1.0D, 1.0D, 1.0D));
|
||||
if (!var10.isEmpty()) {
|
||||
Iterator iterator = var10.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
for (Object o : var10) {
|
||||
Entity entity = (Entity) o;
|
||||
if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer)) {
|
||||
Thaumcraft.proxy.blockRunes(
|
||||
world,
|
||||
|
||||
@@ -2,16 +2,16 @@ package thaumic.tinkerer.common.block.fire;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.helper.BlockTuple;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
|
||||
@@ -22,6 +22,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
public class BlockFireAir extends BlockFireBase {
|
||||
|
||||
private static HashMap<Block, Block> blockTransformation = null;
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.BLOCK_FIRE_AIR;
|
||||
@@ -51,25 +53,31 @@ public class BlockFireAir extends BlockFireBase {
|
||||
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.AIR, 5));
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
|
||||
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
|
||||
result.put(new BlockTuple(Blocks.log), new BlockTuple(Blocks.sand));
|
||||
result.put(new BlockTuple(Blocks.leaves), new BlockTuple(Blocks.sandstone));
|
||||
result.put(new BlockTuple(Blocks.leaves2), new BlockTuple(Blocks.sandstone));
|
||||
result.put(new BlockTuple(Blocks.log2), new BlockTuple(Blocks.sand));
|
||||
result.put(new BlockTuple(Blocks.ice), new BlockTuple(Blocks.glass));
|
||||
private static void initBlockTransformation() {
|
||||
blockTransformation = new HashMap<>();
|
||||
blockTransformation.put(Blocks.log, Blocks.sand);
|
||||
blockTransformation.put(Blocks.leaves, Blocks.sandstone);
|
||||
blockTransformation.put(Blocks.leaves2, Blocks.sandstone);
|
||||
blockTransformation.put(Blocks.log2, Blocks.sand);
|
||||
blockTransformation.put(Blocks.ice, Blocks.glass);
|
||||
if (ConfigHandler.enableCake) {
|
||||
result.put(new BlockTuple(Blocks.water), new BlockTuple(Blocks.cake));
|
||||
blockTransformation.put(Blocks.water, Blocks.cake);
|
||||
}
|
||||
result.put(new BlockTuple(Blocks.dirt), new BlockTuple(Blocks.sand));
|
||||
result.put(new BlockTuple(Blocks.grass), new BlockTuple(Blocks.sand));
|
||||
return result;
|
||||
blockTransformation.put(Blocks.dirt, Blocks.sand);
|
||||
blockTransformation.put(Blocks.grass, Blocks.sand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
|
||||
World w, int x, int y, int z) {
|
||||
public HashMap<Block, Block> getBlockTransformation() {
|
||||
if (blockTransformation == null) {
|
||||
initBlockTransformation();
|
||||
}
|
||||
|
||||
return blockTransformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package thaumic.tinkerer.common.block.fire;
|
||||
|
||||
import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.EAST;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
|
||||
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;
|
||||
|
||||
@@ -16,238 +20,180 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.helper.BlockTuple;
|
||||
import thaumic.tinkerer.common.item.ItemBlockFire;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock {
|
||||
|
||||
public static final String LARGESMOKE = "largesmoke";
|
||||
private IIcon[] icons;
|
||||
private IIcon itemIcon;
|
||||
|
||||
public abstract HashMap<BlockTuple, BlockTuple> getBlockTransformation();
|
||||
private static final Random random = new Random();
|
||||
|
||||
public boolean isTransmutationTarget(Block block, World w, int x, int y, int z) {
|
||||
public abstract HashMap<Block, Block> getBlockTransformation();
|
||||
|
||||
return isTransmutationTarget(new BlockTuple(block), w, x, y, z);
|
||||
public boolean isTransmutationTarget(Block block, IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation(w, x, y, z).containsKey(block);
|
||||
}
|
||||
|
||||
public boolean isTransmutationResult(Block block, World w, int x, int y, int z) {
|
||||
return isTransmutationResult(new BlockTuple(block), w, x, y, z);
|
||||
public boolean isTransmutationResult(Block block, IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation(w, x, y, z).containsValue(block);
|
||||
}
|
||||
|
||||
public boolean isTransmutationTarget(BlockTuple block, World w, int x, int y, int z) {
|
||||
return getBlockTransformation(w, x, y, z).keySet().contains(block);
|
||||
}
|
||||
|
||||
public boolean isTransmutationResult(BlockTuple block, World w, int x, int y, int z) {
|
||||
return getBlockTransformation(w, x, y, z).values().contains(block);
|
||||
}
|
||||
|
||||
public abstract HashMap<BlockTuple, BlockTuple> getBlockTransformation(World w, int x, int y, int z);
|
||||
public abstract HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z);
|
||||
|
||||
public boolean isNeighborTarget(World w, int x, int y, int z) {
|
||||
for (ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (w.blockExists(x + f.offsetX, y + f.offsetY, z + f.offsetZ) && isTransmutationTarget(
|
||||
w.getBlock(x + f.offsetX, y + f.offsetY, z + f.offsetZ),
|
||||
w,
|
||||
x + f.offsetX,
|
||||
y + f.offsetY,
|
||||
z + f.offsetZ)) {
|
||||
for (final ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) {
|
||||
final int xTar = x + f.offsetX;
|
||||
final int yTar = y + f.offsetY;
|
||||
final int zTar = z + f.offsetZ;
|
||||
if (!w.blockExists(xTar, yTar, zTar)) continue;
|
||||
|
||||
if (isTransmutationTarget(w.getBlock(xTar, yTar, zTar), w, xTar, yTar, zTar)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_,
|
||||
int p_149668_4_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getDecayChance(World w, int x, int y, int z) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random p_149745_1_) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World p_149738_1_) {
|
||||
return ConfigHandler.enableFireMechanics ? 200 : 0x7ffffff0;
|
||||
}
|
||||
|
||||
public void setBlockWithTransmutationTarget(World world, int x, int y, int z, int meta, Block block) {
|
||||
Random random = new Random();
|
||||
if (isTransmutationTarget(world.getBlock(x, z, y), world, x, y, z)
|
||||
&& random.nextInt(getDecayChance(world, x, y, z)) == 0) {
|
||||
world.setBlock(
|
||||
x,
|
||||
z,
|
||||
y,
|
||||
getBlockTransformation(world, x, y, z).get(new BlockTuple(world.getBlock(x, z, y))).block,
|
||||
getBlockTransformation(world, x, y, z).get(new BlockTuple(world.getBlock(x, z, y))).meta,
|
||||
3);
|
||||
final Block targetBlock = world.getBlock(x, y, z);
|
||||
if (isTransmutationTarget(targetBlock, world, x, y, z)) {
|
||||
final Block targetTransform = getBlockTransformation(world, x, y, z).get(targetBlock);
|
||||
world.setBlock(x, y, z, targetTransform, 0, 3);
|
||||
} else {
|
||||
world.setBlock(x, z, y, block, meta, 3);
|
||||
world.setBlock(x, y, z, block, meta, 3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
if (world.getGameRules().getGameRuleBooleanValue("doFireTick") && ConfigHandler.enableFire
|
||||
&& ConfigHandler.enableFireMechanics) {
|
||||
if (!(world.getGameRules().getGameRuleBooleanValue("doFireTick") && ConfigHandler.enableFire
|
||||
&& ConfigHandler.enableFireMechanics)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (world.isRaining() && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z)
|
||||
|| world.canLightningStrikeAt(x + 1, y, z)
|
||||
|| world.canLightningStrikeAt(x, y, z - 1)
|
||||
|| world.canLightningStrikeAt(x, y, z + 1))) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
} else {
|
||||
if (!isNeighborTarget(world, x, y, z)) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
if (rand.nextInt(20) == 0) {
|
||||
if (isNeighborTarget(world, x, y, z)) {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (isTransmutationTarget(
|
||||
world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ),
|
||||
world,
|
||||
x + dir.offsetX,
|
||||
y + dir.offsetY,
|
||||
z + dir.offsetZ)) {
|
||||
Random random = new Random();
|
||||
if (random.nextInt(
|
||||
getDecayChance(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))
|
||||
== 0) {
|
||||
world.setBlock(
|
||||
x + dir.offsetX,
|
||||
y + dir.offsetY,
|
||||
z + dir.offsetZ,
|
||||
getBlockTransformation(
|
||||
world,
|
||||
x + dir.offsetX,
|
||||
y + dir.offsetY,
|
||||
z + dir.offsetZ).get(
|
||||
new BlockTuple(
|
||||
world.getBlock(
|
||||
x + dir.offsetX,
|
||||
y + dir.offsetY,
|
||||
z + dir.offsetZ))).block,
|
||||
getBlockTransformation(
|
||||
world,
|
||||
x + dir.offsetX,
|
||||
y + dir.offsetY,
|
||||
z + dir.offsetZ).get(
|
||||
new BlockTuple(
|
||||
world.getBlock(
|
||||
x + dir.offsetX,
|
||||
y + dir.offsetY,
|
||||
z + dir.offsetZ))).meta,
|
||||
3);
|
||||
} else {
|
||||
world.setBlockToAir(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (world.isRaining() && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z)
|
||||
|| world.canLightningStrikeAt(x + 1, y, z)
|
||||
|| world.canLightningStrikeAt(x, y, z - 1)
|
||||
|| world.canLightningStrikeAt(x, y, z + 1))) {
|
||||
// Check if it's raining and if it can be put out by rain
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
}
|
||||
final int blockMeta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
// Source block doesn't burn out
|
||||
if (blockMeta != 0 && !isNeighborTarget(world, x, y, z)) {
|
||||
// Extinguish if there's no valid fuel around
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// Check Transforms
|
||||
if (rand.nextInt(20) == 0 && (isNeighborTarget(world, x, y, z))) {
|
||||
for (final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
final int xT = x + dir.offsetX;
|
||||
final int yT = y + dir.offsetY;
|
||||
final int zT = z + dir.offsetZ;
|
||||
final Block targetBlock = world.getBlock(xT, yT, zT);
|
||||
|
||||
final Block targetTransform = getBlockTransformation(world, xT, yT, zT).get(targetBlock);
|
||||
if (targetTransform == null) continue;
|
||||
|
||||
world.setBlock(xT, yT, zT, targetTransform, 0, 3);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + rand.nextInt(3));
|
||||
|
||||
final boolean highHumidity = world.isBlockHighHumidity(x, y, z);
|
||||
byte strMod = 0;
|
||||
|
||||
if (highHumidity) {
|
||||
strMod = -50;
|
||||
}
|
||||
|
||||
// Spread
|
||||
for (final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
this.tryCatchFire(
|
||||
world,
|
||||
x + dir.offsetX,
|
||||
y + dir.offsetY,
|
||||
z + dir.offsetZ,
|
||||
300 + strMod,
|
||||
rand,
|
||||
blockMeta,
|
||||
dir);
|
||||
}
|
||||
|
||||
for (int xt = x - 1; xt <= x + 1; xt++) {
|
||||
for (int zt = z - 1; zt <= z + 1; zt++) {
|
||||
for (int yt = y - 1; yt <= y + 2; yt++) {
|
||||
if (xt == x && yt == y && zt == z) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
int l = world.getBlockMetadata(x, y, z);
|
||||
int fireChance = this.getChanceOfNeighborsEncouragingFire(world, xt, yt, zt);
|
||||
|
||||
if (l < 15) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, l + rand.nextInt(3) / 2, 4);
|
||||
}
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + rand.nextInt(3));
|
||||
|
||||
boolean flag1 = world.isBlockHighHumidity(x, y, z);
|
||||
byte b0 = 0;
|
||||
|
||||
if (flag1) {
|
||||
b0 = -50;
|
||||
}
|
||||
|
||||
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
|
||||
this.tryCatchFire(
|
||||
world,
|
||||
x + direction.offsetX,
|
||||
y + direction.offsetY,
|
||||
z + direction.offsetZ,
|
||||
300 + b0,
|
||||
rand,
|
||||
l,
|
||||
direction);
|
||||
}
|
||||
|
||||
for (int i1 = x - 1; i1 <= x + 1; i1++) {
|
||||
for (int j1 = z - 1; j1 <= z + 1; j1++) {
|
||||
for (int k1 = y - 1; k1 <= y + 2; k1++) {
|
||||
if (i1 != x || k1 != y || j1 != z) {
|
||||
int l1 = 100;
|
||||
|
||||
int i2 = this.getChanceOfNeighborsEncouragingFire(world, i1, k1, j1);
|
||||
|
||||
if (i2 > 0) {
|
||||
int j2 = (i2 + 70) / (l + 30);
|
||||
j2 += 70;
|
||||
if (flag1) {
|
||||
j2 /= 2;
|
||||
}
|
||||
|
||||
if (j2 > 0 && rand.nextInt(l1) <= j2
|
||||
&& (!world.isRaining() || !world.canLightningStrikeAt(i1, k1, j1))
|
||||
&& !world.canLightningStrikeAt(i1 - 1, k1, z)
|
||||
&& !world.canLightningStrikeAt(i1 + 1, k1, j1)
|
||||
&& !world.canLightningStrikeAt(i1, k1, j1 - 1)
|
||||
&& !world.canLightningStrikeAt(i1, k1, j1 + 1)) {
|
||||
int k2 = l + rand.nextInt(5) / 4;
|
||||
|
||||
if (k2 > 15) {
|
||||
k2 = 15;
|
||||
}
|
||||
setBlockWithTransmutationTarget(world, i1, j1, k1, k2, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fireChance <= 0) {
|
||||
continue;
|
||||
}
|
||||
fireChance = ((fireChance + 70) / (blockMeta + 30)) + 70;
|
||||
if (highHumidity) {
|
||||
fireChance /= 2;
|
||||
}
|
||||
|
||||
if (fireChance <= 0 || rand.nextInt(100) > fireChance
|
||||
|| (world.isRaining() && world.canLightningStrikeAt(xt, yt, zt))
|
||||
|| world.canLightningStrikeAt(xt - 1, yt, z)
|
||||
|| world.canLightningStrikeAt(xt + 1, yt, zt)
|
||||
|| world.canLightningStrikeAt(xt, yt, zt - 1)
|
||||
|| world.canLightningStrikeAt(xt, yt, zt + 1)) {
|
||||
continue;
|
||||
}
|
||||
final int targetMeta = Math.min(blockMeta + 1, 15);
|
||||
setBlockWithTransmutationTarget(world, xt, yt, zt, targetMeta, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean func_149698_L() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getBlockFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
if (isTransmutationTarget(world.getBlock(x, y, z), (World) world, x, y, z)) {
|
||||
final Block block = world.getBlock(x, y, z);
|
||||
if (isTransmutationTarget(block, world, x, y, z)) {
|
||||
return 100;
|
||||
}
|
||||
if (isTransmutationResult(world.getBlock(x, y, z), (World) world, x, y, z)) {
|
||||
if (isTransmutationResult(block, world, x, y, z)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -255,27 +201,24 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
}
|
||||
|
||||
private void tryCatchFire(World world, int x, int y, int z, int strength, Random rand, int meta,
|
||||
ForgeDirection face) {
|
||||
int j1 = getBlockFlammability(world, x, y, z, face);
|
||||
ForgeDirection dir) {
|
||||
final int blockFlammability = getBlockFlammability(world, x, y, z, dir);
|
||||
|
||||
if (rand.nextInt(strength) < j1) {
|
||||
boolean flag = world.getBlock(x, y, z) == Blocks.tnt;
|
||||
if (rand.nextInt(strength) >= blockFlammability) {
|
||||
return;
|
||||
}
|
||||
final boolean isTnt = world.getBlock(x, y, z) == Blocks.tnt;
|
||||
|
||||
if (rand.nextInt(meta + 10) < 5 && !world.canLightningStrikeAt(x, y, z)) {
|
||||
int k1 = meta + rand.nextInt(5) / 4;
|
||||
if (rand.nextInt(meta + 10) < 5 && !world.canLightningStrikeAt(x, y, z)) {
|
||||
// Newer fires have a higher chance of transmuting
|
||||
final int nextMeta = Math.max(Math.min(meta + rand.nextInt(5) / 4, 15), 1);
|
||||
setBlockWithTransmutationTarget(world, x, y, z, nextMeta, this);
|
||||
} else {
|
||||
setBlockWithTransmutationTarget(world, x, y, z, 0, Blocks.air);
|
||||
}
|
||||
|
||||
if (k1 > 15) {
|
||||
k1 = 15;
|
||||
}
|
||||
|
||||
setBlockWithTransmutationTarget(world, x, y, z, k1, this);
|
||||
} else {
|
||||
setBlockWithTransmutationTarget(world, x, y, z, 0, Blocks.air);
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
Blocks.tnt.onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
}
|
||||
if (isTnt) {
|
||||
Blocks.tnt.onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,54 +243,52 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this block is collidable (only used by Fire). Args: x, y, z
|
||||
*/
|
||||
public boolean isCollidable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean canBlockCatchFire(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) {
|
||||
return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_) {
|
||||
return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP);
|
||||
public boolean canBlockCatchFire(IBlockAccess w, int x, int y, int z) {
|
||||
return canCatchFire(w, x, y, z, UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_,
|
||||
EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
|
||||
if (p_149689_5_ instanceof EntityPlayer)
|
||||
ThaumicTinkerer.log.info("Player: " + ((EntityPlayer) p_149689_5_).getDisplayName() + " placed TT Fire");
|
||||
@Deprecated
|
||||
public int func_149846_a(World w, int x, int y, int z, int chance) {
|
||||
return getChanceToEncourageFire(w, x, y, z, chance, UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World w, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
|
||||
if (entity instanceof EntityPlayer)
|
||||
ThaumicTinkerer.log.info("Player: " + ((EntityPlayer) entity).getDisplayName() + " placed TT Fire");
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) {
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World w, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return getBlockFlammability(world, x, y, z, face) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face) {
|
||||
int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
|
||||
final int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
|
||||
|
||||
return (newChance > oldChance ? newChance : oldChance);
|
||||
return (Math.max(newChance, oldChance));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
||||
* their own) Args: x, y, z, neighbor Block
|
||||
*/
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !this.canNeighborBurn(world, x, y, z)) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
@@ -357,6 +298,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
/**
|
||||
* Called whenever the block is added into the world. Args: world, x, y, z
|
||||
*/
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
if (world.provider.dimensionId > 0 || !Blocks.portal.func_150000_e(world, x, y, z)) {
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + world.rand.nextInt(10));
|
||||
@@ -366,13 +308,14 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
/**
|
||||
* A randomly called display update to be able to add particles or other items for display
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if (rand.nextInt(24) == 0) {
|
||||
world.playSound(
|
||||
(double) ((float) x + 0.5F),
|
||||
(double) ((float) y + 0.5F),
|
||||
(double) ((float) z + 0.5F),
|
||||
x + 0.5F,
|
||||
y + 0.5F,
|
||||
z + 0.5F,
|
||||
"fire.fire",
|
||||
1.0F + rand.nextFloat(),
|
||||
rand.nextFloat() * 0.7F + 0.3F,
|
||||
@@ -388,67 +331,63 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
&& !Blocks.fire.canCatchFire(world, x, y - 1, z, UP)) {
|
||||
if (Blocks.fire.canCatchFire(world, x - 1, y, z, EAST)) {
|
||||
for (l = 0; l < 2; ++l) {
|
||||
f = (float) x + rand.nextFloat() * 0.1F;
|
||||
f1 = (float) y + rand.nextFloat();
|
||||
f2 = (float) z + rand.nextFloat();
|
||||
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
f = x + rand.nextFloat() * 0.1F;
|
||||
f1 = y + rand.nextFloat();
|
||||
f2 = z + rand.nextFloat();
|
||||
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
if (Blocks.fire.canCatchFire(world, x + 1, y, z, WEST)) {
|
||||
for (l = 0; l < 2; ++l) {
|
||||
f = (float) (x + 1) - rand.nextFloat() * 0.1F;
|
||||
f1 = (float) y + rand.nextFloat();
|
||||
f2 = (float) z + rand.nextFloat();
|
||||
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
f = (x + 1) - rand.nextFloat() * 0.1F;
|
||||
f1 = y + rand.nextFloat();
|
||||
f2 = z + rand.nextFloat();
|
||||
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
if (Blocks.fire.canCatchFire(world, x, y, z - 1, SOUTH)) {
|
||||
for (l = 0; l < 2; ++l) {
|
||||
f = (float) x + rand.nextFloat();
|
||||
f1 = (float) y + rand.nextFloat();
|
||||
f2 = (float) z + rand.nextFloat() * 0.1F;
|
||||
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
f = x + rand.nextFloat();
|
||||
f1 = y + rand.nextFloat();
|
||||
f2 = z + rand.nextFloat() * 0.1F;
|
||||
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
if (Blocks.fire.canCatchFire(world, x, y, z + 1, NORTH)) {
|
||||
for (l = 0; l < 2; ++l) {
|
||||
f = (float) x + rand.nextFloat();
|
||||
f1 = (float) y + rand.nextFloat();
|
||||
f2 = (float) (z + 1) - rand.nextFloat() * 0.1F;
|
||||
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
f = x + rand.nextFloat();
|
||||
f1 = y + rand.nextFloat();
|
||||
f2 = (z + 1) - rand.nextFloat() * 0.1F;
|
||||
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
if (Blocks.fire.canCatchFire(world, x, y + 1, z, DOWN)) {
|
||||
for (l = 0; l < 2; ++l) {
|
||||
f = (float) x + rand.nextFloat();
|
||||
f1 = (float) (y + 1) - rand.nextFloat() * 0.1F;
|
||||
f2 = (float) z + rand.nextFloat();
|
||||
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
f = x + rand.nextFloat();
|
||||
f1 = (y + 1) - rand.nextFloat() * 0.1F;
|
||||
f2 = z + rand.nextFloat();
|
||||
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (l = 0; l < 3; ++l) {
|
||||
f = (float) x + rand.nextFloat();
|
||||
f1 = (float) y + rand.nextFloat() * 0.5F + 0.5F;
|
||||
f2 = (float) z + rand.nextFloat();
|
||||
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
f = x + rand.nextFloat();
|
||||
f1 = y + rand.nextFloat() * 0.5F + 0.5F;
|
||||
f2 = z + rand.nextFloat();
|
||||
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapColor getMapColor(int p_149728_1_) {
|
||||
return MapColor.tntColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
@@ -469,6 +408,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
return ItemBlockFire.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.icons = new IIcon[] { IconHelper.forName(iconRegister, this.getBlockName() + "_layer_0"),
|
||||
@@ -497,6 +437,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
itemIcon = IconHelper.forName(iconRegister, s);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFireIcon(int p_149840_1_) {
|
||||
return this.icons[p_149840_1_];
|
||||
@@ -505,19 +446,10 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
/**
|
||||
* Gets the block's texture. Args: side, meta
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return itemIcon;
|
||||
}
|
||||
|
||||
private static class FireInfo {
|
||||
|
||||
public int encouragement = 0;
|
||||
public int flammibility = 0;
|
||||
|
||||
public FireInfo(int flammibility, int encouragement) {
|
||||
this.flammibility = flammibility;
|
||||
this.encouragement = encouragement;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,10 @@ package thaumic.tinkerer.common.block.fire;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -12,7 +14,6 @@ import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.helper.BlockTuple;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
|
||||
@@ -23,6 +24,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
public class BlockFireChaos extends BlockFireBase {
|
||||
|
||||
private static HashMap<Block, Block> blockTransformation = null;
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.BLOCK_FIRE_CHAOS;
|
||||
@@ -60,31 +63,26 @@ public class BlockFireChaos extends BlockFireBase {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
|
||||
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
|
||||
result.put(
|
||||
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireAir.class)),
|
||||
new BlockTuple(Blocks.fire));
|
||||
result.put(
|
||||
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireWater.class)),
|
||||
new BlockTuple(Blocks.fire));
|
||||
result.put(
|
||||
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireEarth.class)),
|
||||
new BlockTuple(Blocks.fire));
|
||||
result.put(
|
||||
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireIgnis.class)),
|
||||
new BlockTuple(Blocks.fire));
|
||||
result.put(
|
||||
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireOrder.class)),
|
||||
new BlockTuple(Blocks.fire));
|
||||
|
||||
return result;
|
||||
private static void initBlockTransformation() {
|
||||
blockTransformation = new HashMap<>();
|
||||
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireAir.class), Blocks.fire);
|
||||
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireWater.class), Blocks.fire);
|
||||
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireEarth.class), Blocks.fire);
|
||||
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireIgnis.class), Blocks.fire);
|
||||
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireOrder.class), Blocks.fire);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
|
||||
World w, int x, int y, int z) {
|
||||
public HashMap<Block, Block> getBlockTransformation() {
|
||||
if (blockTransformation == null) {
|
||||
initBlockTransformation();
|
||||
}
|
||||
|
||||
return blockTransformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation();
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,16 @@ package thaumic.tinkerer.common.block.fire;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.helper.BlockTuple;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
|
||||
@@ -22,6 +22,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
public class BlockFireEarth extends BlockFireBase {
|
||||
|
||||
private static HashMap<Block, Block> blockTransformation = null;
|
||||
|
||||
public BlockFireEarth() {
|
||||
super();
|
||||
}
|
||||
@@ -55,33 +57,39 @@ public class BlockFireEarth extends BlockFireBase {
|
||||
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.EARTH, 5));
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
|
||||
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
|
||||
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.dirt));
|
||||
result.put(new BlockTuple(Blocks.gravel), new BlockTuple(Blocks.clay));
|
||||
result.put(new BlockTuple(Blocks.nether_brick), new BlockTuple(Blocks.planks));
|
||||
result.put(new BlockTuple(Blocks.nether_brick_fence), new BlockTuple(Blocks.fence));
|
||||
result.put(new BlockTuple(Blocks.nether_brick_stairs), new BlockTuple(Blocks.oak_stairs));
|
||||
result.put(new BlockTuple(Blocks.cactus), new BlockTuple(Blocks.log));
|
||||
result.put(new BlockTuple(Blocks.snow_layer), new BlockTuple(Blocks.tallgrass));
|
||||
result.put(new BlockTuple(Blocks.stone), new BlockTuple(Blocks.dirt));
|
||||
result.put(new BlockTuple(Blocks.mob_spawner), new BlockTuple(Blocks.iron_block));
|
||||
result.put(new BlockTuple(Blocks.log), new BlockTuple(Blocks.dirt));
|
||||
private static void initBlockTransformation() {
|
||||
blockTransformation = new HashMap<>();
|
||||
blockTransformation.put(Blocks.sand, Blocks.dirt);
|
||||
blockTransformation.put(Blocks.gravel, Blocks.clay);
|
||||
blockTransformation.put(Blocks.nether_brick, Blocks.planks);
|
||||
blockTransformation.put(Blocks.nether_brick_fence, Blocks.fence);
|
||||
blockTransformation.put(Blocks.nether_brick_stairs, Blocks.oak_stairs);
|
||||
blockTransformation.put(Blocks.cactus, Blocks.log);
|
||||
blockTransformation.put(Blocks.snow_layer, Blocks.tallgrass);
|
||||
blockTransformation.put(Blocks.stone, Blocks.dirt);
|
||||
blockTransformation.put(Blocks.mob_spawner, Blocks.iron_block);
|
||||
blockTransformation.put(Blocks.log, Blocks.dirt);
|
||||
|
||||
result.put(new BlockTuple(Blocks.log2), new BlockTuple(Blocks.dirt));
|
||||
blockTransformation.put(Blocks.log2, Blocks.dirt);
|
||||
|
||||
result.put(new BlockTuple(Blocks.leaves), new BlockTuple(Blocks.dirt));
|
||||
result.put(new BlockTuple(Blocks.leaves2), new BlockTuple(Blocks.dirt));
|
||||
result.put(new BlockTuple(Blocks.cobblestone), new BlockTuple(Blocks.dirt));
|
||||
result.put(new BlockTuple(Blocks.planks), new BlockTuple(Blocks.dirt));
|
||||
result.put(new BlockTuple(Blocks.glass), new BlockTuple(Blocks.dirt));
|
||||
return result;
|
||||
blockTransformation.put(Blocks.leaves, Blocks.dirt);
|
||||
blockTransformation.put(Blocks.leaves2, Blocks.dirt);
|
||||
blockTransformation.put(Blocks.cobblestone, Blocks.dirt);
|
||||
blockTransformation.put(Blocks.planks, Blocks.dirt);
|
||||
blockTransformation.put(Blocks.glass, Blocks.dirt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
|
||||
World w, int x, int y, int z) {
|
||||
public HashMap<Block, Block> getBlockTransformation() {
|
||||
if (blockTransformation == null) {
|
||||
initBlockTransformation();
|
||||
}
|
||||
|
||||
return blockTransformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation();
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,16 @@ package thaumic.tinkerer.common.block.fire;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.helper.BlockTuple;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
|
||||
@@ -22,6 +22,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
public class BlockFireIgnis extends BlockFireBase {
|
||||
|
||||
private static HashMap<Block, Block> blockTransformation = null;
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.BLOCK_FIRE_FIRE;
|
||||
@@ -51,34 +53,40 @@ public class BlockFireIgnis extends BlockFireBase {
|
||||
new AspectList().add(Aspect.FIRE, 10).add(Aspect.AIR, 5));
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
|
||||
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
|
||||
result.put(new BlockTuple(Blocks.grass), new BlockTuple(Blocks.netherrack));
|
||||
result.put(new BlockTuple(Blocks.dirt), new BlockTuple(Blocks.netherrack));
|
||||
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.soul_sand));
|
||||
result.put(new BlockTuple(Blocks.gravel), new BlockTuple(Blocks.soul_sand));
|
||||
result.put(new BlockTuple(Blocks.clay), new BlockTuple(Blocks.glowstone));
|
||||
result.put(new BlockTuple(Blocks.coal_ore), new BlockTuple(Blocks.quartz_ore));
|
||||
result.put(new BlockTuple(Blocks.iron_ore), new BlockTuple(Blocks.quartz_ore));
|
||||
result.put(new BlockTuple(Blocks.diamond_ore), new BlockTuple(Blocks.quartz_ore));
|
||||
result.put(new BlockTuple(Blocks.emerald_ore), new BlockTuple(Blocks.quartz_ore));
|
||||
result.put(new BlockTuple(Blocks.gold_block), new BlockTuple(Blocks.quartz_ore));
|
||||
result.put(new BlockTuple(Blocks.lapis_ore), new BlockTuple(Blocks.quartz_ore));
|
||||
result.put(new BlockTuple(Blocks.redstone_ore), new BlockTuple(Blocks.quartz_ore));
|
||||
result.put(new BlockTuple(Blocks.lit_redstone_ore), new BlockTuple(Blocks.quartz_ore));
|
||||
result.put(new BlockTuple(Blocks.water), new BlockTuple(Blocks.lava));
|
||||
result.put(new BlockTuple(Blocks.wheat), new BlockTuple(Blocks.nether_wart));
|
||||
result.put(new BlockTuple(Blocks.potatoes), new BlockTuple(Blocks.nether_wart));
|
||||
result.put(new BlockTuple(Blocks.carrots), new BlockTuple(Blocks.nether_wart));
|
||||
result.put(new BlockTuple(Blocks.red_flower), new BlockTuple(Blocks.brown_mushroom));
|
||||
result.put(new BlockTuple(Blocks.yellow_flower), new BlockTuple(Blocks.yellow_flower));
|
||||
return result;
|
||||
private static void initBlockTransformation() {
|
||||
blockTransformation = new HashMap<>();
|
||||
blockTransformation.put(Blocks.grass, Blocks.netherrack);
|
||||
blockTransformation.put(Blocks.dirt, Blocks.netherrack);
|
||||
blockTransformation.put(Blocks.sand, Blocks.soul_sand);
|
||||
blockTransformation.put(Blocks.gravel, Blocks.soul_sand);
|
||||
blockTransformation.put(Blocks.clay, Blocks.glowstone);
|
||||
blockTransformation.put(Blocks.coal_ore, Blocks.quartz_ore);
|
||||
blockTransformation.put(Blocks.iron_ore, Blocks.quartz_ore);
|
||||
blockTransformation.put(Blocks.diamond_ore, Blocks.quartz_ore);
|
||||
blockTransformation.put(Blocks.emerald_ore, Blocks.quartz_ore);
|
||||
blockTransformation.put(Blocks.gold_block, Blocks.quartz_ore);
|
||||
blockTransformation.put(Blocks.lapis_ore, Blocks.quartz_ore);
|
||||
blockTransformation.put(Blocks.redstone_ore, Blocks.quartz_ore);
|
||||
blockTransformation.put(Blocks.lit_redstone_ore, Blocks.quartz_ore);
|
||||
blockTransformation.put(Blocks.water, Blocks.lava);
|
||||
blockTransformation.put(Blocks.wheat, Blocks.nether_wart);
|
||||
blockTransformation.put(Blocks.potatoes, Blocks.nether_wart);
|
||||
blockTransformation.put(Blocks.carrots, Blocks.nether_wart);
|
||||
blockTransformation.put(Blocks.red_flower, Blocks.brown_mushroom);
|
||||
blockTransformation.put(Blocks.yellow_flower, Blocks.yellow_flower);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
|
||||
World w, int x, int y, int z) {
|
||||
public HashMap<Block, Block> getBlockTransformation() {
|
||||
if (blockTransformation == null) {
|
||||
initBlockTransformation();
|
||||
}
|
||||
|
||||
return blockTransformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation();
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,17 @@
|
||||
package thaumic.tinkerer.common.block.fire;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.helper.BlockTuple;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
|
||||
@@ -31,15 +22,15 @@ import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
public class BlockFireOrder extends BlockFireBase {
|
||||
|
||||
public HashMap<BlockTuple, BlockTuple> fireResults = new HashMap<BlockTuple, BlockTuple>();
|
||||
public HashMap<Block, Block> fireResults = new HashMap<>();
|
||||
private HashMap<Block, Block> oreDictinaryOresCache;
|
||||
|
||||
public BlockFireOrder() {
|
||||
super();
|
||||
fireResults.put(new BlockTuple(Blocks.stone), null);
|
||||
fireResults.put(new BlockTuple(Blocks.glass), null);
|
||||
fireResults.put(new BlockTuple(Blocks.sand), null);
|
||||
fireResults.put(new BlockTuple(Blocks.gravel), null);
|
||||
fireResults.put(Blocks.stone, null);
|
||||
fireResults.put(Blocks.glass, null);
|
||||
fireResults.put(Blocks.sand, null);
|
||||
fireResults.put(Blocks.gravel, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,107 +63,22 @@ public class BlockFireOrder extends BlockFireBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDecayChance(World world, int x, int y, int z) {
|
||||
int dropSize = world.getBlock(x, y, z).getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0).size();
|
||||
if (dropSize == 2) {
|
||||
return 2;
|
||||
}
|
||||
if (dropSize >= 3) {
|
||||
return 1;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
public HashMap<Block, Block> getOreDictionaryOres() {
|
||||
if (oreDictinaryOresCache == null) {
|
||||
HashMap<Block, Block> result = new HashMap<Block, Block>();
|
||||
for (String ore : OreDictionary.getOreNames()) {
|
||||
if (ore.startsWith("ore")) {
|
||||
for (String block : OreDictionary.getOreNames()) {
|
||||
if (block.startsWith("block") && block.substring(5).equalsIgnoreCase(ore.substring(3))) {
|
||||
if (OreDictionary.getOres(block).size() > 0 && OreDictionary.getOres(ore).size() > 0) {
|
||||
result.put(
|
||||
((ItemBlock) OreDictionary.getOres(ore).get(0).getItem()).field_150939_a,
|
||||
((ItemBlock) OreDictionary.getOres(block).get(0).getItem()).field_150939_a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oreDictinaryOresCache = result;
|
||||
}
|
||||
return oreDictinaryOresCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
|
||||
public HashMap<Block, Block> getBlockTransformation() {
|
||||
return fireResults;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTransmutationResult(BlockTuple block, World w, int x, int y, int z) {
|
||||
return getBlockTransformation(w, x, y, z).values().contains(block);
|
||||
}
|
||||
|
||||
public ItemStack getBlockCraftingResult(World w, ItemStack itemStack) {
|
||||
InventoryCrafting blockCraftInventory = new InventoryCrafting(new Container() {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityPlayer) {
|
||||
return false;
|
||||
}
|
||||
}, 3, 3);
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
blockCraftInventory.setInventorySlotContents(i, itemStack);
|
||||
}
|
||||
|
||||
return CraftingManager.getInstance().findMatchingRecipe(blockCraftInventory, w);
|
||||
}
|
||||
|
||||
private boolean allEqual(ArrayList<ItemStack> list) {
|
||||
for (ItemStack o : list) {
|
||||
if (!o.isItemEqual(list.get(0))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
public boolean isTransmutationResult(Block block, IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation(w, x, y, z).containsValue(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<BlockTuple, BlockTuple> getBlockTransformation(World w, int x, int y, int z) {
|
||||
|
||||
Block block = w.getBlock(x, y, z);
|
||||
int meta = w.getBlockMetadata(x, y, z);
|
||||
if (!fireResults.containsKey(new BlockTuple(block, meta))) {
|
||||
Block result = null;
|
||||
int resultMeta = 0;
|
||||
|
||||
ArrayList<ItemStack> drops = block.getDrops(w, x, y, z, meta, 0);
|
||||
if (drops.size() > 0 && (drops.size() == 1 || allEqual(drops))) {
|
||||
|
||||
ItemStack stack = drops.get(0);
|
||||
|
||||
ItemStack blockStack = getBlockCraftingResult(w, stack);
|
||||
if (blockStack == null) {
|
||||
ItemStack ingotStack = FurnaceRecipes.smelting().getSmeltingResult(stack);
|
||||
blockStack = getBlockCraftingResult(w, ingotStack);
|
||||
}
|
||||
if (blockStack != null && Block.getBlockFromItem(blockStack.getItem()) != null) {
|
||||
result = Block.getBlockFromItem(blockStack.getItem());
|
||||
resultMeta = blockStack.getItemDamage();
|
||||
}
|
||||
}
|
||||
|
||||
fireResults.put(new BlockTuple(block, meta), new BlockTuple(result, resultMeta));
|
||||
}
|
||||
return fireResults;
|
||||
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation();
|
||||
}
|
||||
|
||||
public boolean isTransmutationTarget(BlockTuple block, World w, int x, int y, int z) {
|
||||
return getBlockTransformation(w, x, y, z).keySet().contains(block)
|
||||
&& getBlockTransformation().get(block) != null
|
||||
&& getBlockTransformation().get(block).block != null;
|
||||
@Override
|
||||
public boolean isTransmutationTarget(Block block, IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation(w, x, y, z).containsKey(block) && getBlockTransformation().get(block) != null;
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,16 @@ package thaumic.tinkerer.common.block.fire;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.helper.BlockTuple;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
|
||||
@@ -22,6 +22,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
public class BlockFireWater extends BlockFireBase {
|
||||
|
||||
private static HashMap<Block, Block> blockTransformation = null;
|
||||
|
||||
public BlockFireWater() {
|
||||
super();
|
||||
}
|
||||
@@ -55,21 +57,27 @@ public class BlockFireWater extends BlockFireBase {
|
||||
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.WATER, 5));
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
|
||||
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
|
||||
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.ice));
|
||||
result.put(new BlockTuple(Blocks.netherrack), new BlockTuple(Blocks.snow));
|
||||
result.put(new BlockTuple(Blocks.soul_sand), new BlockTuple(Blocks.ice));
|
||||
result.put(new BlockTuple(Blocks.glowstone), new BlockTuple(Blocks.ice));
|
||||
result.put(new BlockTuple(Blocks.lava), new BlockTuple(Blocks.obsidian));
|
||||
result.put(new BlockTuple(Blocks.flowing_lava), new BlockTuple(Blocks.obsidian));
|
||||
return result;
|
||||
private static void initBlockTransformation() {
|
||||
blockTransformation = new HashMap<>();
|
||||
blockTransformation.put(Blocks.sand, Blocks.ice);
|
||||
blockTransformation.put(Blocks.netherrack, Blocks.snow);
|
||||
blockTransformation.put(Blocks.soul_sand, Blocks.ice);
|
||||
blockTransformation.put(Blocks.glowstone, Blocks.ice);
|
||||
blockTransformation.put(Blocks.lava, Blocks.obsidian);
|
||||
blockTransformation.put(Blocks.flowing_lava, Blocks.obsidian);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
|
||||
World w, int x, int y, int z) {
|
||||
public HashMap<Block, Block> getBlockTransformation() {
|
||||
if (blockTransformation == null) {
|
||||
initBlockTransformation();
|
||||
}
|
||||
|
||||
return blockTransformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
|
||||
return getBlockTransformation();
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,9 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.block.BlockMod;
|
||||
import thaumic.tinkerer.common.block.tile.kami.TileBedrockPortal;
|
||||
@@ -31,9 +34,6 @@ import thaumic.tinkerer.common.dim.WorldProviderBedrock;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBedrockPortal extends BlockMod {
|
||||
|
||||
@@ -98,6 +98,7 @@ public class BlockBedrockPortal extends BlockMod {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
if (par5 != 1 && par5 != 0 && !super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)) {
|
||||
return false;
|
||||
@@ -129,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;
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
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;
|
||||
@@ -24,8 +26,6 @@ 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 cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMobilizer extends BlockMod {
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
@@ -23,8 +25,6 @@ import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMobilizerRelay extends BlockMod {
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -24,6 +23,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.BlockMod;
|
||||
@@ -35,8 +36,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipeMulti;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockDarkQuartz extends BlockMod {
|
||||
|
||||
@@ -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;
|
||||
@@ -23,6 +23,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.item.quartz.ItemDarkQuartzSlab;
|
||||
@@ -32,8 +34,6 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock {
|
||||
|
||||
@@ -66,11 +66,6 @@ public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock {
|
||||
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class));
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int idDropped(int par1, Random par2Random, int par3) {
|
||||
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ItemStack createStackedBlock(int par1) {
|
||||
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class));
|
||||
@@ -88,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;
|
||||
|
||||
@@ -14,11 +14,6 @@ package thaumic.tinkerer.common.block.tile;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -27,18 +22,23 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import dan200.computercraft.api.lua.ILuaContext;
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
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];
|
||||
@@ -196,7 +196,7 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple
|
||||
|
||||
public Object[] getAspectsMethod() {
|
||||
AspectList aspects = getAspectList();
|
||||
Map<Double, String> retVals = new HashMap<Double, String>();
|
||||
Map<Double, String> retVals = new HashMap<>();
|
||||
if (aspects == null) return new Object[] { retVals };
|
||||
double i = 1;
|
||||
for (Aspect aspect : aspects.getAspectsSorted()) retVals.put(i++, aspect.getTag());
|
||||
@@ -205,7 +205,7 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple
|
||||
|
||||
public Object[] getAspectsAmountsMethod() {
|
||||
AspectList aspects = getAspectList();
|
||||
Map<String, Double> retVals = new HashMap<String, Double>();
|
||||
Map<String, Double> retVals = new HashMap<>();
|
||||
if (aspects == null) return new Object[] { retVals };
|
||||
for (Aspect aspect : aspects.getAspectsSorted())
|
||||
retVals.put(aspect.getTag(), (double) aspects.getAmount(aspect));
|
||||
@@ -231,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() {}
|
||||
}
|
||||
@@ -28,6 +28,10 @@ import net.minecraftforge.common.util.Constants;
|
||||
|
||||
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;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
@@ -37,10 +41,8 @@ import thaumic.tinkerer.common.core.helper.Tuple4Int;
|
||||
import thaumic.tinkerer.common.enchantment.core.EnchantmentManager;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibFeatures;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@Optional.Interface(iface = "appeng.api.movable.IMovableTile", modid = "appliedenergistics2")
|
||||
public class TileEnchanter extends TileEntity implements ISidedInventory, IMovableTile {
|
||||
|
||||
private static final String TAG_ENCHANTS = "enchantsIntArray";
|
||||
@@ -49,15 +51,15 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab
|
||||
private static final String TAG_CURRENT_ASPECTS = "currentAspects";
|
||||
private static final String TAG_WORKING = "working";
|
||||
|
||||
public List<Integer> enchantments = new ArrayList();
|
||||
public List<Integer> levels = new ArrayList();
|
||||
public List<Integer> enchantments = new ArrayList<>();
|
||||
public List<Integer> levels = new ArrayList<>();
|
||||
|
||||
public AspectList totalAspects = new AspectList();
|
||||
public AspectList currentAspects = new AspectList();
|
||||
|
||||
public boolean working = false;
|
||||
ItemStack[] inventorySlots = new ItemStack[2];
|
||||
private List<Tuple4Int> pillars = new ArrayList();
|
||||
private List<Tuple4Int> pillars = new ArrayList<>();
|
||||
|
||||
public void clearEnchants() {
|
||||
enchantments.clear();
|
||||
@@ -141,7 +143,7 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab
|
||||
AspectList wandAspects = wandItem.getAllVis(wand);
|
||||
|
||||
int missing, onWand;
|
||||
List<Aspect> aspectsThatCanGet = new ArrayList();
|
||||
List<Aspect> aspectsThatCanGet = new ArrayList<>();
|
||||
|
||||
for (Aspect aspect : LibFeatures.PRIMAL_ASPECTS) {
|
||||
missing = totalAspects.getAmount(aspect) - currentAspects.getAmount(aspect);
|
||||
@@ -207,8 +209,7 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab
|
||||
Aspect[] aspectArray = aspects.getAspects();
|
||||
int arrayLength = aspectArray.length;
|
||||
|
||||
for (int i$ = 0; i$ < arrayLength; ++i$) {
|
||||
Aspect aspect = aspectArray[i$];
|
||||
for (Aspect aspect : aspectArray) {
|
||||
int cost = aspects.getAmount(aspect) * 100;
|
||||
aspectList.add(aspect, cost);
|
||||
}
|
||||
@@ -495,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() {}
|
||||
}
|
||||
@@ -6,11 +6,11 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.mobilizer.BlockMobilizer;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.mobilizer.BlockMobilizer;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
|
||||
public class TileEntityMobilizer extends TileEntity {
|
||||
|
||||
@@ -67,6 +67,7 @@ public class TileEntityMobilizer extends TileEntity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
// Check for ghost TEs
|
||||
@@ -116,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("")) {
|
||||
@@ -142,7 +140,8 @@ public class TileEntityMobilizer extends TileEntity {
|
||||
}
|
||||
}
|
||||
// If AE is installed, use its handler
|
||||
} else if (api != null) {
|
||||
} else if (LoadedMods.AE2Loaded) {
|
||||
IAppEngApi api = AEApi.instance();
|
||||
if (api.registries().movable().askToMove(passenger)) {
|
||||
worldObj.setBlock(
|
||||
targetX,
|
||||
@@ -158,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();
|
||||
|
||||
@@ -4,9 +4,11 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
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;
|
||||
@@ -63,11 +65,13 @@ public class TileEntityRelay extends TileEntity implements IMovableTile {
|
||||
if (partnerX - xCoord != 0) {
|
||||
xInc = ((float) Math.copySign(.05, partnerX - xCoord)) * (worldObj.getTotalWorldTime() % 20);
|
||||
}
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (0.5 + i + xInc),
|
||||
(float) (yCoord + 0.5),
|
||||
(float) (j + 0.5 + zInc),
|
||||
xCoord < partnerX || zCoord > partnerX ? 2 : 14);
|
||||
if (worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (0.5 + i + xInc),
|
||||
(float) (yCoord + 0.5),
|
||||
(float) (j + 0.5 + zInc),
|
||||
xCoord < partnerX || zCoord > partnerX ? 2 : 14);
|
||||
}
|
||||
j += Math.copySign(1, partnerZ - zCoord);
|
||||
} while (j < partnerZ);
|
||||
i += Math.copySign(1, partnerX - xCoord);
|
||||
@@ -137,10 +141,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() {}
|
||||
}
|
||||
@@ -17,7 +17,8 @@ public class TileForcefield extends TileEntity {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
ticks--;
|
||||
|
||||
ThaumicTinkerer.tcProxy.blockSparkle(worldObj, xCoord, yCoord, zCoord, 255, 1);
|
||||
if (worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.blockSparkle(worldObj, xCoord, yCoord, zCoord, 255, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,16 +25,19 @@ import net.minecraft.util.Facing;
|
||||
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;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,18 +150,6 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
AspectList aspects = getAspects();
|
||||
// if(inventorySlots[i] != null && inventorySlots[i].itemID == ConfigItems.itemJarFilled.itemID && aspects ==
|
||||
// null) {
|
||||
// Aspect filter=((ItemJarFilled)inventorySlots[i].getItem()).getFilter(inventorySlots[i]);
|
||||
// inventorySlots[i] = new ItemStack(ConfigBlocks.blockJar,1,inventorySlots[i].getItemDamage());
|
||||
// if(filter!=null)
|
||||
// {
|
||||
// if(inventorySlots[i].getTagCompound()==null)
|
||||
// inventorySlots[i].setTagCompound(new NBTTagCompound());
|
||||
// inventorySlots[i].getTagCompound().setString("AspectFilter",filter.getTag());
|
||||
// }
|
||||
// onInventoryChanged();
|
||||
// }
|
||||
|
||||
return inventorySlots[i];
|
||||
}
|
||||
@@ -289,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,26 +1,29 @@
|
||||
package thaumic.tinkerer.common.block.tile;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
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;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import thaumcraft.common.entities.golems.EntityGolemBase;
|
||||
import thaumcraft.common.entities.golems.Marker;
|
||||
import thaumic.tinkerer.common.core.golems.EnumGolemCores;
|
||||
import thaumic.tinkerer.common.core.golems.EnumGolemDecorations;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
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 li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import thaumcraft.common.entities.golems.EntityGolemBase;
|
||||
import thaumcraft.common.entities.golems.Marker;
|
||||
import thaumic.tinkerer.common.core.golems.EnumGolemCores;
|
||||
import thaumic.tinkerer.common.core.golems.EnumGolemDecorations;
|
||||
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") })
|
||||
@@ -42,10 +45,9 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
|
||||
EntityGolemBase.class,
|
||||
AxisAlignedBB
|
||||
.getBoundingBox(xCoord - 30, yCoord - 30, zCoord - 30, xCoord + 30, yCoord + 30, zCoord + 30));
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityGolemBase entityGolem = (EntityGolemBase) iterator.next();
|
||||
for (Object o : list) {
|
||||
EntityGolemBase entityGolem = (EntityGolemBase) o;
|
||||
|
||||
if (entityGolem.getUniqueID().equals(golemConnected)) {
|
||||
this.golem = entityGolem;
|
||||
@@ -61,7 +63,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
|
||||
|
||||
public Object[] getGolemDecorationsImplementation() throws LuaException {
|
||||
if (golem == null || golem.decoration == null || golem.decoration.length() == 0) return new String[] {};
|
||||
HashMap<Double, String> decorations = new HashMap<Double, String>();
|
||||
HashMap<Double, String> decorations = new HashMap<>();
|
||||
for (int i = 0; i < golem.decoration.length(); i++) {
|
||||
EnumGolemDecorations golemDec = EnumGolemDecorations.getFromChar(golem.decoration.charAt(i));
|
||||
if (golemDec == null)
|
||||
@@ -218,7 +220,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
|
||||
private Object[] addMarkerImplementation(Map arguments) throws LuaException {
|
||||
if (golem == null) return new String[] {};
|
||||
ArrayList<Marker> markers = golem.getMarkers();
|
||||
if (markers == null) markers = new ArrayList<Marker>();
|
||||
if (markers == null) markers = new ArrayList<>();
|
||||
Marker mark = toMarkerImplementation(arguments);
|
||||
markers.add(mark);
|
||||
golem.setMarkers(markers);
|
||||
@@ -226,7 +228,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
|
||||
}
|
||||
|
||||
private Object[] newMarkerImplementation() {
|
||||
HashMap<String, Object> mark = new HashMap<String, Object>();
|
||||
HashMap<String, Object> mark = new HashMap<>();
|
||||
mark.put("posX", xCoord);
|
||||
mark.put("posY", yCoord);
|
||||
mark.put("posZ", zCoord);
|
||||
@@ -240,7 +242,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
|
||||
private Object[] setMarkersImplementation(Map arguments) throws LuaException {
|
||||
if (golem == null) return new String[] {};
|
||||
|
||||
ArrayList<Marker> arrList = new ArrayList<Marker>();
|
||||
ArrayList<Marker> arrList = new ArrayList<>();
|
||||
|
||||
for (Object map : arguments.values()) {
|
||||
Marker mark = toMarkerImplementation((Map) map);
|
||||
@@ -268,7 +270,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
|
||||
private Object[] getMarkersImplementation() {
|
||||
if (golem == null) return new String[] {};
|
||||
ArrayList<Marker> markers = golem.getMarkers();
|
||||
HashMap<Integer, HashMap<String, Object>> luaMarkers = new HashMap<Integer, HashMap<String, Object>>();
|
||||
HashMap<Integer, HashMap<String, Object>> luaMarkers = new HashMap<>();
|
||||
int i = 1;
|
||||
for (Marker mark : markers) {
|
||||
HashMap<String, Object> luaMarker = fromMarkerImplementation(mark);
|
||||
@@ -282,7 +284,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
|
||||
* @return
|
||||
*/
|
||||
private HashMap<String, Object> fromMarkerImplementation(Marker mark) {
|
||||
HashMap<String, Object> luaMarker = new HashMap<String, Object>();
|
||||
HashMap<String, Object> luaMarker = new HashMap<>();
|
||||
|
||||
luaMarker.put("posX", mark.x);
|
||||
luaMarker.put("posY", mark.y);
|
||||
|
||||
@@ -13,11 +13,6 @@ package thaumic.tinkerer.common.block.tile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -25,17 +20,22 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.helper.MiscHelper;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import dan200.computercraft.api.lua.ILuaContext;
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
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
|
||||
@@ -73,20 +73,16 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile,
|
||||
|
||||
if (distanceSqrd > 1) {
|
||||
MiscHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), speedMod * 0.25F);
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) x2, (float) y2, (float) z2, blue ? 2 : 4);
|
||||
if (worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) x2, (float) y2, (float) z2, blue ? 2 : 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IEntitySelector getEntitySelector() {
|
||||
return new IEntitySelector() {
|
||||
|
||||
@Override
|
||||
public boolean isEntityApplicable(Entity entity) {
|
||||
return entity instanceof EntityItem;
|
||||
}
|
||||
};
|
||||
return entity -> entity instanceof EntityItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -153,11 +149,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")
|
||||
|
||||
@@ -11,12 +11,7 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.tile;
|
||||
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -29,13 +24,17 @@ import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
|
||||
import thaumic.tinkerer.common.item.ItemSoulMould;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import dan200.computercraft.api.lua.ILuaContext;
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
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";
|
||||
@@ -44,24 +43,20 @@ public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTil
|
||||
|
||||
@Override
|
||||
IEntitySelector getEntitySelector() {
|
||||
return new IEntitySelector() {
|
||||
return entity -> {
|
||||
if (!(entity instanceof EntityLivingBase) || entity instanceof EntityPlayer) return false;
|
||||
|
||||
@Override
|
||||
public boolean isEntityApplicable(Entity entity) {
|
||||
if (!(entity instanceof EntityLivingBase) || entity instanceof EntityPlayer) return false;
|
||||
boolean can = false;
|
||||
if (entity instanceof EntityAgeable) can = adult != ((EntityAgeable) entity).isChild();
|
||||
else can = true;
|
||||
|
||||
boolean can = false;
|
||||
if (entity instanceof EntityAgeable) can = adult != ((EntityAgeable) entity).isChild();
|
||||
else can = true;
|
||||
|
||||
if (can && inventorySlots[0] != null) {
|
||||
String pattern = ItemSoulMould.getPatternName(inventorySlots[0]);
|
||||
String name = EntityList.getEntityString(entity);
|
||||
return name != null && name.equals(pattern);
|
||||
}
|
||||
|
||||
return can;
|
||||
if (can && inventorySlots[0] != null) {
|
||||
String pattern = ItemSoulMould.getPatternName(inventorySlots[0]);
|
||||
String name = EntityList.getEntityString(entity);
|
||||
return name != null && name.equals(pattern);
|
||||
}
|
||||
|
||||
return can;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -236,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() {}
|
||||
}
|
||||
@@ -25,24 +25,26 @@ import net.minecraft.tileentity.TileEntity;
|
||||
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.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.compat.TinkersConstructCompat;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
/* 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 {
|
||||
|
||||
private static final Map<Aspect, Integer> repairValues = new HashMap();
|
||||
private static final String TAG_TOOK_LAST_TICK = "tookLastTick";
|
||||
private static final Map<Aspect, Integer> repairValues = new HashMap<>();
|
||||
|
||||
static {
|
||||
repairValues.put(Aspect.TOOL, 8);
|
||||
@@ -52,31 +54,37 @@ public class TileRepairer extends TileEntity
|
||||
|
||||
public int ticksExisted = 0;
|
||||
public boolean tookLastTick = true;
|
||||
int dmgLastTick = 0;
|
||||
ItemStack[] inventorySlots = new ItemStack[1];
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (++ticksExisted % 10 == 0) {
|
||||
if (Loader.isModLoaded("TConstruct") && ConfigHandler.repairTConTools) {
|
||||
if (worldObj.isRemote) {
|
||||
if (tookLastTick) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (xCoord + 0.25 + Math.random() / 2F),
|
||||
(float) (yCoord + 1 + Math.random() / 2F),
|
||||
(float) (zCoord + 0.25 + Math.random() / 2F),
|
||||
0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
boolean oldTookLastTick = tookLastTick;
|
||||
tookLastTick = false;
|
||||
|
||||
if (LoadedMods.TConstructLoaded && ConfigHandler.repairTConTools) {
|
||||
if (inventorySlots[0] != null) {
|
||||
if (TinkersConstructCompat.isTConstructTool(inventorySlots[0])) {
|
||||
int dmg = TinkersConstructCompat.getDamage(inventorySlots[0]);
|
||||
if (dmg > 0) {
|
||||
int essentia = drawEssentia();
|
||||
TinkersConstructCompat.fixDamage(inventorySlots[0], essentia);
|
||||
int newDmg = TinkersConstructCompat.getDamage(inventorySlots[0]);
|
||||
tookLastTick = newDmg != dmg;
|
||||
markDirty();
|
||||
if (dmgLastTick != 0 && dmgLastTick != dmg) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (xCoord + 0.25 + Math.random() / 2F),
|
||||
(float) (yCoord + 1 + Math.random() / 2F),
|
||||
(float) (zCoord + 0.25 + Math.random() / 2F),
|
||||
0);
|
||||
tookLastTick = true;
|
||||
} else tookLastTick = false;
|
||||
} else tookLastTick = false;
|
||||
dmgLastTick = inventorySlots[0] == null ? 0
|
||||
: TinkersConstructCompat.getDamage(inventorySlots[0]);
|
||||
}
|
||||
if (tookLastTick != oldTookLastTick) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -84,20 +92,12 @@ public class TileRepairer extends TileEntity
|
||||
if (inventorySlots[0] != null && inventorySlots[0].getItemDamage() > 0) {
|
||||
int essentia = drawEssentia();
|
||||
int dmg = inventorySlots[0].getItemDamage();
|
||||
inventorySlots[0].setItemDamage(Math.max(0, dmg - essentia));
|
||||
int newDmg = Math.max(0, dmg - essentia);
|
||||
inventorySlots[0].setItemDamage(newDmg);
|
||||
tookLastTick = newDmg != dmg;
|
||||
markDirty();
|
||||
|
||||
if (dmgLastTick != 0 && dmgLastTick != dmg) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (xCoord + 0.25 + Math.random() / 2F),
|
||||
(float) (yCoord + 1 + Math.random() / 2F),
|
||||
(float) (zCoord + 0.25 + Math.random() / 2F),
|
||||
0);
|
||||
tookLastTick = true;
|
||||
} else tookLastTick = false;
|
||||
} else tookLastTick = false;
|
||||
|
||||
dmgLastTick = inventorySlots[0] == null ? 0 : inventorySlots[0].getItemDamage();
|
||||
}
|
||||
if (tookLastTick != oldTookLastTick) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ public class TileRepairer extends TileEntity
|
||||
}
|
||||
|
||||
public void readCustomNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
tookLastTick = par1NBTTagCompound.getBoolean(TAG_TOOK_LAST_TICK);
|
||||
NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
|
||||
inventorySlots = new ItemStack[1];
|
||||
|
||||
@@ -126,6 +127,7 @@ public class TileRepairer extends TileEntity
|
||||
}
|
||||
|
||||
public void writeCustomNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
par1NBTTagCompound.setBoolean(TAG_TOOK_LAST_TICK, tookLastTick);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
if (inventorySlots[0] != null) {
|
||||
NBTTagCompound tagList = new NBTTagCompound();
|
||||
@@ -235,20 +237,15 @@ public class TileRepairer extends TileEntity
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
|
||||
if (Loader.isModLoaded("TConstruct") && ConfigHandler.repairTConTools) {
|
||||
if (TinkersConstructCompat.isTConstructTool(itemstack)) {
|
||||
return itemstack != null;
|
||||
}
|
||||
}
|
||||
return itemstack != null && itemstack.getItem().isRepairable();
|
||||
return isRepairable(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
|
||||
return true;
|
||||
return !isRepairable(itemstack);
|
||||
}
|
||||
|
||||
int drawEssentia() {
|
||||
private int drawEssentia() {
|
||||
ForgeDirection orientation = getOrientation();
|
||||
TileEntity te = ThaumcraftApiHelper.getConnectableTile(worldObj, xCoord, yCoord, zCoord, orientation);
|
||||
if (te != null) {
|
||||
@@ -263,7 +260,7 @@ public class TileRepairer extends TileEntity
|
||||
return 0;
|
||||
}
|
||||
|
||||
ForgeDirection getOrientation() {
|
||||
private ForgeDirection getOrientation() {
|
||||
return ForgeDirection.getOrientation(getBlockMetadata());
|
||||
}
|
||||
|
||||
@@ -271,9 +268,12 @@ public class TileRepairer extends TileEntity
|
||||
public AspectList getAspects() {
|
||||
ItemStack stack = inventorySlots[0];
|
||||
if (stack == null) return null;
|
||||
if (Loader.isModLoaded("TConstruct") && ConfigHandler.repairTConTools) {
|
||||
if (TinkersConstructCompat.isTConstructTool(stack))
|
||||
if (LoadedMods.TConstructLoaded && TinkersConstructCompat.isTConstructTool(stack)) {
|
||||
if (ConfigHandler.repairTConTools) {
|
||||
return new AspectList().add(Aspect.ENTROPY, TinkersConstructCompat.getDamage(stack));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return new AspectList().add(Aspect.ENTROPY, stack.getItemDamage());
|
||||
}
|
||||
@@ -367,7 +367,7 @@ public class TileRepairer extends TileEntity
|
||||
|
||||
@Override
|
||||
public int getSuctionAmount(ForgeDirection arg0) {
|
||||
return arg0 == getOrientation() ? 128 : 0;
|
||||
return arg0 == getOrientation() && containsRepairableStack() ? 128 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -376,10 +376,27 @@ public class TileRepairer extends TileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public boolean prepareToMove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "appliedenergistics2")
|
||||
public void doneMoving() {}
|
||||
|
||||
private boolean containsRepairableStack() {
|
||||
return isRepairable(inventorySlots[0]);
|
||||
}
|
||||
|
||||
private boolean isRepairable(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return false;
|
||||
}
|
||||
if (LoadedMods.TConstructLoaded && TinkersConstructCompat.isTConstructTool(stack)) {
|
||||
return ConfigHandler.repairTConTools && TinkersConstructCompat.getDamage(stack) > 0;
|
||||
}
|
||||
return stack.getItem() != null && stack.getItem().isRepairable() && stack.getItemDamage() > 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,10 +3,10 @@ package thaumic.tinkerer.common.block.tile;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -19,121 +19,115 @@ public class TileSummon extends TileEntity {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (worldObj.getTotalWorldTime() % 300 != 0
|
||||
|| worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (worldObj.getTotalWorldTime() % 300 == 0) {
|
||||
if (worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) {
|
||||
return;
|
||||
}
|
||||
for (int radius = 1; radius < 6; radius++) {
|
||||
ArrayList<TileEntity> pedestals = new ArrayList<TileEntity>();
|
||||
for (int x = xCoord - radius; x <= xCoord + radius; x++) {
|
||||
for (int z = zCoord - radius; z <= zCoord + radius; z++) {
|
||||
TileEntity tile = worldObj.getTileEntity(x, yCoord, z);
|
||||
if (tile instanceof TilePedestal && ((TilePedestal) tile).getStackInSlot(0) != null
|
||||
&& ((TilePedestal) tile).getStackInSlot(0).getItem() instanceof ItemMobAspect) {
|
||||
pedestals.add(tile);
|
||||
}
|
||||
for (int radius = 1; radius < 6; radius++) {
|
||||
ArrayList<TilePedestal> pedestals = new ArrayList<>();
|
||||
for (int x = xCoord - radius; x <= xCoord + radius; x++) {
|
||||
for (int z = zCoord - radius; z <= zCoord + radius; z++) {
|
||||
TileEntity tile = worldObj.getTileEntity(x, yCoord, z);
|
||||
if (tile instanceof TilePedestal pedestal && pedestal.getStackInSlot(0) != null
|
||||
&& pedestal.getStackInSlot(0).getItem() instanceof ItemMobAspect) {
|
||||
pedestals.add(pedestal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < pedestals.size(); i++) {
|
||||
for (int j = 0; j < pedestals.size(); j++) {
|
||||
for (int k = 0; k < pedestals.size(); k++) {
|
||||
TilePedestal ped1 = (TilePedestal) pedestals.get(i);
|
||||
TilePedestal ped2 = (TilePedestal) pedestals.get(j);
|
||||
TilePedestal ped3 = (TilePedestal) pedestals.get(k);
|
||||
for (int i = 0; i < pedestals.size(); i++) {
|
||||
for (int j = 0; j < pedestals.size(); j++) {
|
||||
for (TilePedestal ped3 : pedestals) {
|
||||
TilePedestal ped1 = pedestals.get(i);
|
||||
TilePedestal ped2 = pedestals.get(j);
|
||||
|
||||
if ((ped1 != ped2) && (ped2 != ped3) && (ped1 != ped3)) {
|
||||
ArrayList<Aspect> aspects = new ArrayList<Aspect>();
|
||||
aspects.add(ItemMobAspect.getAspect(ped1.getStackInSlot(0)));
|
||||
if ((ped1 == ped2) || (ped2 == ped3) || (ped1 == ped3)) continue;
|
||||
ArrayList<Aspect> aspects = new ArrayList<>();
|
||||
aspects.add(ItemMobAspect.getAspect(ped1.getStackInSlot(0)));
|
||||
|
||||
aspects.add(ItemMobAspect.getAspect(ped2.getStackInSlot(0)));
|
||||
aspects.add(ItemMobAspect.getAspect(ped2.getStackInSlot(0)));
|
||||
|
||||
aspects.add(ItemMobAspect.getAspect(ped3.getStackInSlot(0)));
|
||||
aspects.add(ItemMobAspect.getAspect(ped3.getStackInSlot(0)));
|
||||
|
||||
for (EnumMobAspect recipe : EnumMobAspect.values()) {
|
||||
if (Arrays.asList(recipe.aspects).containsAll(aspects)
|
||||
&& aspects.containsAll(Arrays.asList(recipe.aspects))) {
|
||||
for (EnumMobAspect recipe : EnumMobAspect.values()) {
|
||||
if (!Arrays.asList(recipe.aspects).containsAll(aspects)
|
||||
|| !aspects.containsAll(Arrays.asList(recipe.aspects))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean isInfused = ItemMobAspect.isInfused(ped1.getStackInSlot(0))
|
||||
&& ItemMobAspect.isInfused(ped2.getStackInSlot(0))
|
||||
&& ItemMobAspect.isInfused(ped3.getStackInSlot(0));
|
||||
boolean isInfused = ItemMobAspect.isInfused(ped1.getStackInSlot(0))
|
||||
&& ItemMobAspect.isInfused(ped2.getStackInSlot(0))
|
||||
&& ItemMobAspect.isInfused(ped3.getStackInSlot(0));
|
||||
|
||||
if (isInfused && worldObj.getTotalWorldTime() % 1200 != 0) {
|
||||
return;
|
||||
}
|
||||
if (isInfused && worldObj.getTotalWorldTime() % 1200 != 0) return;
|
||||
|
||||
if (!isInfused) {
|
||||
ped1.setInventorySlotContents(0, null);
|
||||
ped2.setInventorySlotContents(0, null);
|
||||
ped3.setInventorySlotContents(0, null);
|
||||
}
|
||||
if (!isInfused) {
|
||||
ped1.setInventorySlotContents(0, null);
|
||||
ped2.setInventorySlotContents(0, null);
|
||||
ped3.setInventorySlotContents(0, null);
|
||||
}
|
||||
|
||||
if (!isInfused || ItemMobAspect
|
||||
.lastUsedTabletMatches(ped1.getStackInSlot(0), this)
|
||||
&& ItemMobAspect.lastUsedTabletMatches(ped2.getStackInSlot(0), this)
|
||||
&& ItemMobAspect.lastUsedTabletMatches(ped3.getStackInSlot(0), this)) {
|
||||
if (!isInfused || ItemMobAspect.lastUsedTabletMatches(ped1.getStackInSlot(0), this)
|
||||
&& ItemMobAspect.lastUsedTabletMatches(ped2.getStackInSlot(0), this)
|
||||
&& ItemMobAspect.lastUsedTabletMatches(ped3.getStackInSlot(0), this)) {
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
Entity spawn = EntityList
|
||||
.createEntityByName(recipe.toString(), worldObj);
|
||||
spawn.setLocationAndAngles(xCoord + .5, yCoord + 1, zCoord + .5, 0, 0);
|
||||
if (spawn instanceof EntitySkeleton && worldObj.provider.isHellWorld) {
|
||||
((EntitySkeleton) spawn).setSkeletonType(1);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(spawn);
|
||||
((EntityLiving) spawn).onSpawnWithEgg(null);
|
||||
((EntityLiving) spawn).playLivingSound();
|
||||
}
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.essentiaTrailFx(
|
||||
worldObj,
|
||||
ped1.xCoord,
|
||||
ped1.yCoord,
|
||||
ped1.zCoord,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
20,
|
||||
aspects.get(0).getColor(),
|
||||
20);
|
||||
ThaumicTinkerer.tcProxy.essentiaTrailFx(
|
||||
worldObj,
|
||||
ped2.xCoord,
|
||||
ped2.yCoord,
|
||||
ped2.zCoord,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
20,
|
||||
aspects.get(1).getColor(),
|
||||
20);
|
||||
ThaumicTinkerer.tcProxy.essentiaTrailFx(
|
||||
worldObj,
|
||||
ped3.xCoord,
|
||||
ped3.yCoord,
|
||||
ped3.zCoord,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
20,
|
||||
aspects.get(2).getColor(),
|
||||
20);
|
||||
}
|
||||
}
|
||||
if (isInfused) {
|
||||
ItemMobAspect.markLastUsedTablet(ped1.getStackInSlot(0), this);
|
||||
|
||||
ItemMobAspect.markLastUsedTablet(ped2.getStackInSlot(0), this);
|
||||
|
||||
ItemMobAspect.markLastUsedTablet(ped3.getStackInSlot(0), this);
|
||||
}
|
||||
|
||||
return;
|
||||
if (!worldObj.isRemote) {
|
||||
EntityLiving spawn = recipe.createEntity(worldObj);
|
||||
spawn.setLocationAndAngles(xCoord + .5, yCoord + 1, zCoord + .5, 0, 0);
|
||||
worldObj.spawnEntityInWorld(spawn);
|
||||
spawn.onSpawnWithEgg(null);
|
||||
if (spawn instanceof EntitySkeleton skeleton && skeleton.getSkeletonType() == 1) {
|
||||
// Needs to be done here instead of EnumMobAspect::setWither because
|
||||
// EntitySkeleton::onSpawnWithEgg sets the held item to a bow
|
||||
skeleton.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword));
|
||||
}
|
||||
spawn.playLivingSound();
|
||||
}
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.essentiaTrailFx(
|
||||
worldObj,
|
||||
ped1.xCoord,
|
||||
ped1.yCoord,
|
||||
ped1.zCoord,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
20,
|
||||
aspects.get(0).getColor(),
|
||||
20);
|
||||
ThaumicTinkerer.tcProxy.essentiaTrailFx(
|
||||
worldObj,
|
||||
ped2.xCoord,
|
||||
ped2.yCoord,
|
||||
ped2.zCoord,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
20,
|
||||
aspects.get(1).getColor(),
|
||||
20);
|
||||
ThaumicTinkerer.tcProxy.essentiaTrailFx(
|
||||
worldObj,
|
||||
ped3.xCoord,
|
||||
ped3.yCoord,
|
||||
ped3.zCoord,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
20,
|
||||
aspects.get(2).getColor(),
|
||||
20);
|
||||
}
|
||||
}
|
||||
if (isInfused) {
|
||||
ItemMobAspect.markLastUsedTablet(ped1.getStackInSlot(0), this);
|
||||
ItemMobAspect.markLastUsedTablet(ped2.getStackInSlot(0), this);
|
||||
ItemMobAspect.markLastUsedTablet(ped3.getStackInSlot(0), this);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.block.tile;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -24,10 +23,12 @@ public class TileWardedSlab extends TileEntity {
|
||||
return this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (this.count == 0) {
|
||||
@@ -45,10 +46,9 @@ public class TileWardedSlab extends TileEntity {
|
||||
(double) (this.yCoord + 3),
|
||||
(double) (this.zCoord + 1)).expand(0.1D, 0.1D, 0.1D));
|
||||
if (targets.size() > 0) {
|
||||
Iterator i$ = targets.iterator();
|
||||
|
||||
while (i$.hasNext()) {
|
||||
EntityLivingBase e = (EntityLivingBase) i$.next();
|
||||
for (Object target : targets) {
|
||||
EntityLivingBase e = (EntityLivingBase) target;
|
||||
if (!e.onGround && !(e instanceof EntityPlayer)) {
|
||||
e.addVelocity(
|
||||
(double) (-MathHelper.sin((e.rotationYaw + 180.0F) * 3.1415927F / 180.0F) * 0.2F),
|
||||
|
||||
+27
-5
@@ -29,20 +29,42 @@ 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();
|
||||
|
||||
if (!player.worldObj.isRemote) try {
|
||||
((InventoryIchorPouch) inv).stackList = ((ItemFocusPouch) pouch.getItem()).getInventory(pouch);
|
||||
} catch (Exception e) {}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initPlayerInv() {
|
||||
int ys = getInvYStart();
|
||||
int xs = getInvXStart();
|
||||
int held = player.inventory.currentItem;
|
||||
|
||||
for (int x = 0; x < 3; ++x) for (int y = 0; y < 9; ++y)
|
||||
addSlotToContainer(new Slot(player.inventory, y + x * 9 + 9, xs + y * 18, ys + x * 18));
|
||||
|
||||
for (int x = 0; x < 9; ++x) {
|
||||
if (x == held) {
|
||||
addSlotToContainer(new Slot(player.inventory, x, xs + x * 18, ys + 58) {
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(EntityPlayer p) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addSlotToContainer(new Slot(player.inventory, x, xs + x * 18, ys + 58));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,22 +51,23 @@ public class TileWarpGate extends TileEntity implements IInventory {
|
||||
if (!destGate.locked) {
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:wand", 1F, 1F);
|
||||
|
||||
for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) player.posX + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) player.posY + player.worldObj.rand.nextFloat(),
|
||||
(float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
6);
|
||||
|
||||
if (player.worldObj.isRemote) {
|
||||
for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) player.posX + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) player.posY + player.worldObj.rand.nextFloat(),
|
||||
(float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
6);
|
||||
}
|
||||
player.mountEntity(null);
|
||||
if (player instanceof EntityPlayerMP) ((EntityPlayerMP) player).playerNetServerHandler
|
||||
.setPlayerLocation(x + 0.5, y + 1.6, z + 0.5, player.rotationYaw, player.rotationPitch);
|
||||
|
||||
for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) player.posX + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) player.posY + player.worldObj.rand.nextFloat(),
|
||||
(float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
6);
|
||||
|
||||
if (player.worldObj.isRemote) {
|
||||
for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) player.posX + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) player.posY + player.worldObj.rand.nextFloat(),
|
||||
(float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
6);
|
||||
}
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:wand", 1F, 0.1F);
|
||||
return true;
|
||||
} else
|
||||
|
||||
Loaded 100 of 523 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user