mirror of
https://github.com/GTNewHorizons/ThaumicHorizons.git
synced 2026-10-26 22:48:59 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
916808e245 | ||
|
|
31cd11ae4e | ||
|
|
84da10d17e | ||
|
|
7f576cc7d9 | ||
|
|
bd9ddad84c | ||
|
|
7ff16faec3 | ||
|
|
5104fb5871 | ||
|
|
c0a91fde66 | ||
|
|
632ef1bc56 | ||
|
|
b34849271b | ||
|
|
ac25bc65d4 | ||
|
|
7b128f0670 | ||
|
|
fcd0c9e762 | ||
|
|
4db0b1ac07 | ||
|
|
835386352e | ||
|
|
83bed04da1 | ||
|
|
5a6b05f13c | ||
|
|
16d9b525db | ||
|
|
b7291f8456 | ||
|
|
9e52237a2c | ||
|
|
ab3ee05667 | ||
|
|
a458218979 | ||
|
|
66e3b422ca | ||
|
|
51763e0f80 | ||
|
|
c88f2117f1 | ||
|
|
ce1a38322d | ||
|
|
3d41f068be | ||
|
|
44563de7c4 | ||
|
|
1e92c12a02 | ||
|
|
5cd824635f | ||
|
|
f692f4e072 | ||
|
|
4feb0093ca | ||
|
|
e8e06d158c | ||
|
|
23fd27450c | ||
|
|
61282f78b3 | ||
|
|
4ca137f310 | ||
|
|
93bb3ebe20 | ||
|
|
308cd69e21 | ||
|
|
224c3e9693 | ||
|
|
695bcfbb5b | ||
|
|
f6fd32b557 | ||
|
|
95c5e6d1f3 | ||
|
|
2599dd85c9 | ||
|
|
4799d7b2cd | ||
|
|
3b869b8c74 | ||
|
|
21ab790045 | ||
|
|
3f4f2ca548 | ||
|
|
79dc3475e0 | ||
|
|
e1dbd7fd2f | ||
|
|
0479b655f6 | ||
|
|
abdb44b545 | ||
|
|
f42bcf230b | ||
|
|
e985a0c763 | ||
|
|
d9867a343e | ||
|
|
c1b0d26bd5 | ||
|
|
d8788d1d22 | ||
|
|
3935278dd7 | ||
|
|
49c37a05d8 | ||
|
|
ec0a44d6dd | ||
|
|
b2186e92f9 | ||
|
|
f619f97928 | ||
|
|
f542637140 | ||
|
|
23469f5e5b | ||
|
|
c1730a50d9 | ||
|
|
1ef8e16e9c | ||
|
|
a084621884 | ||
|
|
f4f7e27bca | ||
|
|
db3f4e0cba | ||
|
|
2768e1b1eb | ||
|
|
0a54bd5465 | ||
|
|
892f8941e2 | ||
|
|
5b04ae1082 | ||
|
|
1dc5f139e5 |
No files matched your search
@@ -27,6 +27,7 @@ whitelist.json
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
*.sh
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
layout.json
|
||||
+5
-3
@@ -1,9 +1,11 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev')
|
||||
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.24-GTNH:dev')
|
||||
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.69:dev') {transitive = false}
|
||||
api("com.github.GTNewHorizons:GT5-Unofficial:5.99.99-mu57:dev") {transitive = false}
|
||||
api("com.ruling_0:MaterialLib:0.24.0-mu:dev")
|
||||
|
||||
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.5:dev')
|
||||
}
|
||||
+41
-3
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
# 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.
|
||||
@@ -162,6 +186,11 @@ modrinthRelations =
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId = 227914
|
||||
|
||||
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
|
||||
# Use client or server for mods that only support one environment. Defaults to client,server.
|
||||
# These tags describe where the mod can run, not whether installation is required on both sides.
|
||||
curseForgeEnvironments = client,server
|
||||
|
||||
# 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],
|
||||
@@ -174,6 +203,12 @@ curseForgeRelations = requiredDependency\:thaumcraft
|
||||
# projects. New projects should not use this parameter.
|
||||
# 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.
|
||||
@@ -203,3 +238,6 @@ curseForgeRelations = requiredDependency\:thaumcraft
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.parallel = true
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
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.
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/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/.
|
||||
@@ -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.
|
||||
@@ -172,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" )
|
||||
|
||||
@@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
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
+12
-24
@@ -19,12 +19,12 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ 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
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,30 +65,18 @@ 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
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
: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 %*
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
@@ -1,4 +1,5 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.46'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.31'
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import com.kentington.thaumichorizons.client.audio.VortexSound;
|
||||
import com.kentington.thaumichorizons.client.fx.FXSonic;
|
||||
@@ -166,6 +167,7 @@ import cpw.mods.fml.client.FMLClientHandler;
|
||||
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.eventhandler.SubscribeEvent;
|
||||
import thaumcraft.api.wands.IWandTriggerManager;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXBurst;
|
||||
@@ -184,6 +186,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void registerHandlers() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
MinecraftForge.EVENT_BUS.register(ThaumicHorizons.instance.renderEventHandler);
|
||||
final IResourceManager resourceManager = Minecraft.getMinecraft().getResourceManager();
|
||||
if (resourceManager instanceof IReloadableResourceManager) {
|
||||
@@ -198,6 +201,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void registerRenderers() {
|
||||
// spotless:off
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileNodeMonitor.class, new TileNodeMonitorRender());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSyntheticNode.class, new TileEtherealShardRender());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileVisDynamo.class, new TileVisDynamoRender());
|
||||
@@ -209,8 +213,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileVatMatrix.class, new TileVatMatrixRender(0));
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileBloodInfuser.class, new TileBloodInfuserRender());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSoulBeacon.class, new TileSoulBeaconRender());
|
||||
ClientRegistry
|
||||
.bindTileEntitySpecialRenderer(TileTransductionAmplifier.class, new TileTransductionAmplifierRender());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTransductionAmplifier.class, new TileTransductionAmplifierRender());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileRecombinator.class, new TileRecombinatorRender());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileVortexStabilizer.class, new TileVortexStabilizerRender());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileVortex.class, new TileVortexRender());
|
||||
@@ -220,61 +223,29 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAlchemitePrimed.class, new RenderAlchemitePrimed());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySyringe.class, new RenderSyringe());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBlastPhial.class, new BlastPhialRender());
|
||||
RenderingRegistry
|
||||
.registerEntityRenderingHandler(EntityChocolateCow.class, new RenderChocolateCow(new ModelCow(), 0.7f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityOrePig.class,
|
||||
new RenderOreBoar(new ModelPig(), new ModelPig(0.5f), 0.7f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityGuardianPanther.class,
|
||||
new RenderGuardianPanther(new ModelOcelot(), 1.0f));
|
||||
RenderingRegistry
|
||||
.registerEntityRenderingHandler(EntityFamiliar.class, new RenderFamiliar(new ModelFamiliar(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityGravekeeper.class,
|
||||
new RenderGravekeeper(new ModelOcelot(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityGoldChicken.class,
|
||||
new RenderGoldChicken(new ModelChicken(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityScholarChicken.class,
|
||||
new RenderScholarChicken(new ModelChicken(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityTaintPig.class,
|
||||
new RenderTaintfeeder(new ModelPig(), new ModelPig(0.5f), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityNetherHound.class,
|
||||
new RenderNetherHound(new ModelWolf(), new ModelWolf(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntitySeawolf.class,
|
||||
new RenderSeawolf(new ModelWolf(), new ModelWolf(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityLunarWolf.class,
|
||||
new RenderLunarWolf(new ModelWolf(), new ModelWolf(), 0.5f));
|
||||
RenderingRegistry
|
||||
.registerEntityRenderingHandler(EntityGolemTH.class, new RenderGolemTH(new ModelGolemTH(false)));
|
||||
RenderingRegistry
|
||||
.registerEntityRenderingHandler(EntityEndersteed.class, new RenderEndersteed(new ModelHorse(), 0.75f));
|
||||
RenderingRegistry
|
||||
.registerEntityRenderingHandler(EntityNightmare.class, new RenderNightmare(new ModelHorse(), 0.75f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChocolateCow.class, new RenderChocolateCow(new ModelCow(), 0.7f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityOrePig.class, new RenderOreBoar(new ModelPig(), new ModelPig(0.5f), 0.7f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGuardianPanther.class, new RenderGuardianPanther(new ModelOcelot(), 1.0f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFamiliar.class, new RenderFamiliar(new ModelFamiliar(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGravekeeper.class, new RenderGravekeeper(new ModelOcelot(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGoldChicken.class, new RenderGoldChicken(new ModelChicken(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityScholarChicken.class, new RenderScholarChicken(new ModelChicken(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintPig.class, new RenderTaintfeeder(new ModelPig(), new ModelPig(0.5f), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNetherHound.class, new RenderNetherHound(new ModelWolf(), new ModelWolf(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySeawolf.class, new RenderSeawolf(new ModelWolf(), new ModelWolf(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityLunarWolf.class, new RenderLunarWolf(new ModelWolf(), new ModelWolf(), 0.5f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGolemTH.class, new RenderGolemTH(new ModelGolemTH(false)));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEndersteed.class, new RenderEndersteed(new ModelHorse(), 0.75f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNightmare.class, new RenderNightmare(new ModelHorse(), 0.75f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBoatGreatwood.class, new RenderBoatGreatwood());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBoatThaumium.class, new RenderBoatThaumium());
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityMeatSlime.class,
|
||||
new RenderMeatSlime(new ModelSlime(16), new ModelSlime(0), 0.25f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityMercurialSlime.class,
|
||||
new RenderMercurialSlime(new ModelSlime(16), new ModelSlime(0), 0.25f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityVoltSlime.class,
|
||||
new RenderVoltSlime(new ModelSlime(16), new ModelSlime(0), 0.25f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(
|
||||
EntityMedSlime.class,
|
||||
new RenderMedSlime(new ModelSlime(16), new ModelSlime(0), 0.25f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMeatSlime.class, new RenderMeatSlime(new ModelSlime(16), new ModelSlime(0), 0.25f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMercurialSlime.class, new RenderMercurialSlime(new ModelSlime(16), new ModelSlime(0), 0.25f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityVoltSlime.class, new RenderVoltSlime(new ModelSlime(16), new ModelSlime(0), 0.25f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMedSlime.class, new RenderMedSlime(new ModelSlime(16), new ModelSlime(0), 0.25f));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySheeder.class, new RenderSheeder());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySoul.class, new RenderSoul());
|
||||
RenderingRegistry
|
||||
.registerEntityRenderingHandler(EntityLightningBoltFinite.class, new RenderLightningBoltFinite());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityLightningBoltFinite.class, new RenderLightningBoltFinite());
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicHorizons.itemSyringeBloodSample, new ItemSyringeRender());
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicHorizons.itemSyringeHuman, new ItemSyringeRender());
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicHorizons.itemSyringeEmpty, new ItemSyringeRender());
|
||||
@@ -282,6 +253,7 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicHorizons.itemCorpseEffigy, new ItemCorpseEffigyRender());
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicHorizons.itemInjector, new ItemInjectorRender());
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicHorizons.itemWandCastingDisposable, new ItemWandRenderer());
|
||||
// spotless:on
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -561,6 +533,14 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
private final Map<TileCoord, VortexSound> activeVortexSounds = new HashMap<>();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
activeVortexSounds.clear();
|
||||
ThaumicHorizons.instance.renderEventHandler.thingsThatSparkle.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playVortexSound(TileVortex tile) {
|
||||
if (tile == null || tile.isInvalid() || tile.getWorldObj() == null) return;
|
||||
|
||||
+1
-3
@@ -158,9 +158,7 @@ public class TileEtherealShardRender extends TileEntitySpecialRenderer {
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
} finally {
|
||||
} catch (Exception ignored) {} finally {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
+38
-50
@@ -7,13 +7,12 @@ package com.kentington.thaumichorizons.client.renderer.tile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -23,7 +22,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.client.lib.QuadHelper;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -34,25 +32,20 @@ public class TileVortexRender extends TileEntitySpecialRenderer {
|
||||
|
||||
public void renderTileEntityAt(final TileEntity tile, final double x, final double y, final double z,
|
||||
final float partialTicks) {
|
||||
if (!(tile instanceof final TileVortex node)) {
|
||||
if (!(tile instanceof final TileVortex node) || !node.clientSynced) {
|
||||
return;
|
||||
}
|
||||
final float size = 10.0f;
|
||||
final double viewDistance = 64.0;
|
||||
final EntityLivingBase viewer = Minecraft.getMinecraft().renderViewEntity;
|
||||
final boolean condition = true;
|
||||
final boolean depthIgnore = false;
|
||||
renderNode(
|
||||
viewer,
|
||||
viewDistance,
|
||||
condition,
|
||||
depthIgnore,
|
||||
size,
|
||||
Minecraft.getMinecraft().renderViewEntity,
|
||||
64.0,
|
||||
true,
|
||||
false,
|
||||
10.0f,
|
||||
tile.xCoord,
|
||||
tile.yCoord,
|
||||
tile.zCoord,
|
||||
partialTicks,
|
||||
((TileVortex) tile).aspects,
|
||||
node.aspects,
|
||||
node.count,
|
||||
node.collapsing,
|
||||
node.beams,
|
||||
@@ -72,6 +65,10 @@ public class TileVortexRender extends TileEntitySpecialRenderer {
|
||||
return;
|
||||
}
|
||||
float alpha = (float) ((viewDistance - distance) / viewDistance);
|
||||
// Camera-relative center — avoids float precision loss at large world coords.
|
||||
final double cx = x + 0.5 - RenderManager.renderPosX;
|
||||
final double cy = y + 0.5 - RenderManager.renderPosY;
|
||||
final double cz = z + 0.5 - RenderManager.renderPosZ;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569f);
|
||||
GL11.glDepthMask(false);
|
||||
@@ -79,7 +76,6 @@ public class TileVortexRender extends TileEntitySpecialRenderer {
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
final long time = nt / 5000000L;
|
||||
final float bscale = 0.25f;
|
||||
GL11.glPushMatrix();
|
||||
final float rad = ((float) Math.PI * 2F);
|
||||
@@ -101,10 +97,10 @@ public class TileVortexRender extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, aspect.getBlend());
|
||||
scale = MathHelper.sin(viewer.ticksExisted / (14.0f - count)) * bscale + bscale * 2.0f;
|
||||
scale = 0.4f;
|
||||
scale *= size;
|
||||
angle = time % (5000 + 500 * count) / (5000.0f + 500 * count) * rad;
|
||||
final long periodNs = (5000L + 500L * count) * 5_000_000L;
|
||||
angle = (float) ((double) (nt % periodNs) / periodNs) * rad;
|
||||
if (beams < 6 || timeOpen < 50) {
|
||||
UtilsFX.renderFacingStrip(
|
||||
x + 0.5,
|
||||
@@ -153,9 +149,9 @@ public class TileVortexRender extends TileEntitySpecialRenderer {
|
||||
if (!cheat && (beams < 6 || timeOpen < 50)) {
|
||||
UtilsFX.bindTexture(TileVortexRender.vortextex);
|
||||
renderVortex(
|
||||
x + 0.5,
|
||||
y + 0.5,
|
||||
z + 0.5,
|
||||
cx,
|
||||
cy,
|
||||
cz,
|
||||
angle * 20.0f * corescale / (1 + 2 * beams),
|
||||
scale / 5.0f * corescale,
|
||||
0.8f,
|
||||
@@ -190,10 +186,10 @@ public class TileVortexRender extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
scale = MathHelper.sin(viewer.ticksExisted / (14.0f - count)) * bscale + bscale * 2.0f;
|
||||
scale = 0.4f;
|
||||
scale *= size;
|
||||
angle = time % (5000 + 500 * count) / (5000.0f + 500 * count) * rad;
|
||||
final long periodNs2 = (5000L + 500L * count) * 5_000_000L;
|
||||
angle = (float) ((double) (nt % periodNs2) / periodNs2) * rad;
|
||||
UtilsFX.renderFacingStrip(
|
||||
x + 0.5,
|
||||
y + 0.5,
|
||||
@@ -233,37 +229,29 @@ public class TileVortexRender extends TileEntitySpecialRenderer {
|
||||
final float arYZ = ActiveRenderInfo.rotationYZ;
|
||||
final float arXY = ActiveRenderInfo.rotationXY;
|
||||
final float arXZ = ActiveRenderInfo.rotationXZ;
|
||||
final EntityPlayer player = (EntityPlayer) Minecraft.getMinecraft().renderViewEntity;
|
||||
final double iPX = player.prevPosX + (player.posX - player.prevPosX) * partialTicks;
|
||||
final double iPY = player.prevPosY + (player.posY - player.prevPosY) * partialTicks;
|
||||
final double iPZ = player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks;
|
||||
GL11.glTranslated(-iPX, -iPY, -iPZ);
|
||||
|
||||
// Rotate screen-plane basis vectors (H = right, V = up) by angle.
|
||||
// This avoids Rodrigues rotation around a qvec that shifts with every head movement,
|
||||
// which caused the vortex to jerk whenever the player moved the camera.
|
||||
final float cos = MathHelper.cos(angle);
|
||||
final float sin = MathHelper.sin(angle);
|
||||
final float hX = cos * arX + sin * arYZ;
|
||||
final float hY = sin * arXZ;
|
||||
final float hZ = cos * arZ + sin * arXY;
|
||||
final float vX = cos * arYZ - sin * arX;
|
||||
final float vY = cos * arXZ;
|
||||
final float vZ = cos * arXY - sin * arZ;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(220);
|
||||
tessellator.setColorRGBA_I(color, (int) (alpha * 255.0f));
|
||||
final Vec3 v1 = Vec3
|
||||
.createVectorHelper(-arX * scale - arYZ * scale, -arXZ * scale, -arZ * scale - arXY * scale);
|
||||
final Vec3 v2 = Vec3.createVectorHelper(-arX * scale + arYZ * scale, arXZ * scale, -arZ * scale + arXY * scale);
|
||||
final Vec3 v3 = Vec3.createVectorHelper(arX * scale + arYZ * scale, arXZ * scale, arZ * scale + arXY * scale);
|
||||
final Vec3 v4 = Vec3.createVectorHelper(arX * scale - arYZ * scale, -arXZ * scale, arZ * scale - arXY * scale);
|
||||
if (angle != 0.0f) {
|
||||
final Vec3 pvec = Vec3.createVectorHelper(iPX, iPY, iPZ);
|
||||
final Vec3 tvec = Vec3.createVectorHelper(px, py, pz);
|
||||
final Vec3 qvec = pvec.subtract(tvec).normalize();
|
||||
QuadHelper.setAxis(qvec, angle).rotate(v1);
|
||||
QuadHelper.setAxis(qvec, angle).rotate(v2);
|
||||
QuadHelper.setAxis(qvec, angle).rotate(v3);
|
||||
QuadHelper.setAxis(qvec, angle).rotate(v4);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float f3 = 1.0f;
|
||||
final float f4 = 0.0f;
|
||||
final float f5 = 1.0f;
|
||||
tessellator.setNormal(0.0f, 0.0f, -1.0f);
|
||||
tessellator.addVertexWithUV(px + v1.xCoord, py + v1.yCoord, pz + v1.zCoord, f2, f5);
|
||||
tessellator.addVertexWithUV(px + v2.xCoord, py + v2.yCoord, pz + v2.zCoord, f3, f5);
|
||||
tessellator.addVertexWithUV(px + v3.xCoord, py + v3.yCoord, pz + v3.zCoord, f3, f4);
|
||||
tessellator.addVertexWithUV(px + v4.xCoord, py + v4.yCoord, pz + v4.zCoord, f2, f4);
|
||||
tessellator
|
||||
.addVertexWithUV(px + (-hX - vX) * scale, py + (-hY - vY) * scale, pz + (-hZ - vZ) * scale, 0.0, 1.0);
|
||||
tessellator
|
||||
.addVertexWithUV(px + (-hX + vX) * scale, py + (-hY + vY) * scale, pz + (-hZ + vZ) * scale, 1.0, 1.0);
|
||||
tessellator.addVertexWithUV(px + (hX + vX) * scale, py + (hY + vY) * scale, pz + (hZ + vZ) * scale, 1.0, 0.0);
|
||||
tessellator.addVertexWithUV(px + (hX - vX) * scale, py + (hY - vY) * scale, pz + (hZ - vZ) * scale, 0.0, 0.0);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@ import com.kentington.thaumichorizons.common.tiles.TileVatSlave;
|
||||
import com.kentington.thaumichorizons.common.tiles.TileVisDynamo;
|
||||
import com.kentington.thaumichorizons.common.tiles.TileVortex;
|
||||
import com.kentington.thaumichorizons.common.tiles.TileVortexStabilizer;
|
||||
import com.ruling_0.materiallib.api.MaterialLibAPI;
|
||||
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
@@ -240,9 +241,8 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.OrePrefixes;
|
||||
import gregtech.api.util.GTOreDictUnificator;
|
||||
import gregtech.api.enums.materials.Materials;
|
||||
import gregtech.api.enums.materials.Shapes;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
@@ -503,10 +503,10 @@ public class ThaumicHorizons {
|
||||
ROD_CRYSTAL = new WandRod(
|
||||
"disposable",
|
||||
250,
|
||||
null,
|
||||
new ItemStack(Blocks.bedrock),
|
||||
99,
|
||||
new ResourceLocation("thaumichorizons", "textures/models/crystalRod.png"));
|
||||
CAP_CRYSTAL = new WandCap("disposable", 0.9F, null, 99);
|
||||
CAP_CRYSTAL = new WandCap("disposable", 0.9F, new ItemStack(Blocks.bedrock), 99);
|
||||
CAP_CRYSTAL.setTexture(new ResourceLocation("thaumichorizons", "textures/models/crystalCap.png"));
|
||||
ROD_CRYSTAL.setGlowing(true);
|
||||
blockSynthNode = new BlockSyntheticNode();
|
||||
@@ -2082,17 +2082,17 @@ public class ThaumicHorizons {
|
||||
.add(Aspect.AURA, 32).add(Aspect.MIND, 16).add(Aspect.ELDRITCH, 64),
|
||||
new ItemStack(itemPlanarConduit),
|
||||
new ItemStack[] { new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
GTOreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Glass, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.lens, Materials.InfusedOrder, 1L),
|
||||
MaterialLibAPI.getStack(Materials.Glass, Shapes.gemExquisite, 1),
|
||||
MaterialLibAPI.getStack(Materials.InfusedOrder, Shapes.lens, 1),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
GTOreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Glass, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.lens, Materials.InfusedOrder, 1L),
|
||||
MaterialLibAPI.getStack(Materials.Glass, Shapes.gemExquisite, 1),
|
||||
MaterialLibAPI.getStack(Materials.InfusedOrder, Shapes.lens, 1),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
GTOreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Glass, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.lens, Materials.InfusedOrder, 1L),
|
||||
MaterialLibAPI.getStack(Materials.Glass, Shapes.gemExquisite, 1),
|
||||
MaterialLibAPI.getStack(Materials.InfusedOrder, Shapes.lens, 1),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
GTOreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Glass, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.lens, Materials.InfusedOrder, 1L) });
|
||||
MaterialLibAPI.getStack(Materials.Glass, Shapes.gemExquisite, 1),
|
||||
MaterialLibAPI.getStack(Materials.InfusedOrder, Shapes.lens, 1) });
|
||||
recipeKeystone1 = ThaumcraftApi.addInfusionCraftingRecipe(
|
||||
"planarKeystone",
|
||||
new ItemStack(itemKeystone),
|
||||
@@ -2102,11 +2102,11 @@ public class ThaumicHorizons {
|
||||
new ItemStack(Items.ender_eye),
|
||||
new ItemStack[] { new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 3),
|
||||
GTOreDictUnificator.get(OrePrefixes.lens, Materials.Glass, 1L),
|
||||
MaterialLibAPI.getStack(Materials.Glass, Shapes.lens, 1),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 3),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 3),
|
||||
GTOreDictUnificator.get(OrePrefixes.lens, Materials.Glass, 1L),
|
||||
MaterialLibAPI.getStack(Materials.Glass, Shapes.lens, 1),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 3) });
|
||||
recipeSlot = ThaumcraftApi.addInfusionCraftingRecipe(
|
||||
"planarKeystone",
|
||||
@@ -2115,18 +2115,18 @@ public class ThaumicHorizons {
|
||||
(new AspectList()).add(Aspect.VOID, 48).add(Aspect.TRAVEL, 64).add(Aspect.AIR, 64)
|
||||
.add(Aspect.MECHANISM, 32).add(Aspect.ELDRITCH, 64).add(Aspect.MAGIC, 16),
|
||||
new ItemStack(itemPlanarConduit),
|
||||
new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Void, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Enderium, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Void, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.InfusedGold, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Void, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.InfusedGold, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Void, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Enderium, 1L),
|
||||
GTOreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L) });
|
||||
new ItemStack[] { MaterialLibAPI.getStack(Materials.Void, Shapes.plateDense, 1),
|
||||
MaterialLibAPI.getStack(Materials.Titanium, Shapes.screw, 1),
|
||||
MaterialLibAPI.getStack(Materials.Enderium, Shapes.plateDense, 1),
|
||||
MaterialLibAPI.getStack(Materials.Void, Shapes.plateDense, 1),
|
||||
MaterialLibAPI.getStack(Materials.InfusedGold, Shapes.plateDense, 1),
|
||||
MaterialLibAPI.getStack(Materials.Titanium, Shapes.screw, 1),
|
||||
MaterialLibAPI.getStack(Materials.Void, Shapes.plateDense, 1),
|
||||
MaterialLibAPI.getStack(Materials.Titanium, Shapes.screw, 1),
|
||||
MaterialLibAPI.getStack(Materials.InfusedGold, Shapes.plateDense, 1),
|
||||
MaterialLibAPI.getStack(Materials.Void, Shapes.plateDense, 1),
|
||||
MaterialLibAPI.getStack(Materials.Enderium, Shapes.plateDense, 1),
|
||||
MaterialLibAPI.getStack(Materials.Titanium, Shapes.screw, 1) });
|
||||
} else {
|
||||
recipeKeystone = ThaumcraftApi.addInfusionCraftingRecipe(
|
||||
"pocketPlane",
|
||||
|
||||
+86
-322
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package com.kentington.thaumichorizons.common.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
@@ -81,28 +77,16 @@ public class BlockGatewayPortal extends Block {
|
||||
if (world.getBlock(x + 1, y, z) == ThaumicHorizons.blockGateway) {
|
||||
slotZ = z;
|
||||
switch (md) {
|
||||
case 6 -> {
|
||||
slotX = x + 1;
|
||||
}
|
||||
case 7 -> {
|
||||
slotX = x;
|
||||
}
|
||||
case 9 -> {
|
||||
slotX = x - 1;
|
||||
}
|
||||
case 6 -> slotX = x + 1;
|
||||
case 7 -> slotX = x;
|
||||
case 9 -> slotX = x - 1;
|
||||
}
|
||||
} else {
|
||||
slotX = x;
|
||||
switch (md) {
|
||||
case 6 -> {
|
||||
slotZ = z + 1;
|
||||
}
|
||||
case 7 -> {
|
||||
slotZ = z;
|
||||
}
|
||||
case 9 -> {
|
||||
slotZ = z - 1;
|
||||
}
|
||||
case 6 -> slotZ = z + 1;
|
||||
case 7 -> slotZ = z;
|
||||
case 9 -> slotZ = z - 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -117,7 +101,7 @@ public class BlockGatewayPortal extends Block {
|
||||
}
|
||||
}
|
||||
final TileEntity te = world.getTileEntity(slotX, slotY, slotZ);
|
||||
if (te instanceof TileSlot) {
|
||||
if (te instanceof TileSlot && ((TileSlot) te).portalOpen) {
|
||||
((TileSlot) te).destroyPortal();
|
||||
}
|
||||
}
|
||||
@@ -151,313 +135,93 @@ public class BlockGatewayPortal extends Block {
|
||||
|| world.getBlock(x + 1, y, z) == ThaumicHorizons.blockPortal
|
||||
|| world.getBlock(x - 1, y, z) == ThaumicHorizons.blockGateway
|
||||
|| world.getBlock(x - 1, y, z) == ThaumicHorizons.blockPortal;
|
||||
Label_0410: {
|
||||
switch (world.getBlockMetadata(x, y, z)) {
|
||||
case 0 -> {
|
||||
switch (side) {
|
||||
case 0 -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
case 1 -> {
|
||||
return this.stone;
|
||||
}
|
||||
case 2 -> {
|
||||
if (isXAligned) {
|
||||
return this.CornerTR;
|
||||
}
|
||||
return this.stone;
|
||||
}
|
||||
case 3 -> {
|
||||
if (isXAligned) {
|
||||
return this.CornerTL;
|
||||
}
|
||||
return this.stone;
|
||||
}
|
||||
case 4 -> {
|
||||
if (isXAligned) {
|
||||
return this.stone;
|
||||
}
|
||||
return this.CornerTL;
|
||||
}
|
||||
case 5 -> {
|
||||
if (isXAligned) {
|
||||
return this.stone;
|
||||
}
|
||||
return this.CornerTR;
|
||||
}
|
||||
default -> {
|
||||
return this.leftSide(isXAligned, side);
|
||||
}
|
||||
}
|
||||
}
|
||||
case 1, 2, 3 -> {
|
||||
return this.leftSide(isXAligned, side);
|
||||
}
|
||||
case 4 -> {
|
||||
switch (side) {
|
||||
case 0 -> {
|
||||
return this.stone;
|
||||
}
|
||||
case 1 -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
case 2 -> {
|
||||
if (isXAligned) {
|
||||
return this.CornerBR;
|
||||
}
|
||||
return this.stone;
|
||||
}
|
||||
case 3 -> {
|
||||
if (isXAligned) {
|
||||
return this.CornerBL;
|
||||
}
|
||||
return this.stone;
|
||||
}
|
||||
case 4 -> {
|
||||
if (isXAligned) {
|
||||
return this.stone;
|
||||
}
|
||||
return this.CornerBL;
|
||||
}
|
||||
case 5 -> {
|
||||
if (isXAligned) {
|
||||
return this.stone;
|
||||
}
|
||||
return this.CornerBR;
|
||||
}
|
||||
default -> {
|
||||
break Label_0410;
|
||||
}
|
||||
}
|
||||
}
|
||||
case 5 -> {
|
||||
switch (side) {
|
||||
case 0: {
|
||||
return this.lapiz;
|
||||
}
|
||||
case 1: {
|
||||
return this.stone;
|
||||
}
|
||||
case 2: {
|
||||
if (isXAligned) {
|
||||
return this.topR;
|
||||
}
|
||||
}
|
||||
case 3: {
|
||||
if (isXAligned) {
|
||||
return this.topL;
|
||||
}
|
||||
}
|
||||
case 4: {
|
||||
if (!isXAligned) {
|
||||
return this.topL;
|
||||
}
|
||||
}
|
||||
case 5: {
|
||||
if (!isXAligned) {
|
||||
return this.topR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this.lapiz;
|
||||
}
|
||||
case 6, 7, 9 -> {
|
||||
return this.bottomSide(isXAligned, side);
|
||||
}
|
||||
case 8 -> {
|
||||
switch (side) {
|
||||
case 0: {
|
||||
return this.lapiz;
|
||||
}
|
||||
case 1: {
|
||||
return this.stone;
|
||||
}
|
||||
case 2: {
|
||||
if (isXAligned) {
|
||||
return this.topL;
|
||||
}
|
||||
}
|
||||
case 3: {
|
||||
if (isXAligned) {
|
||||
return this.topR;
|
||||
}
|
||||
}
|
||||
case 4: {
|
||||
if (!isXAligned) {
|
||||
return this.topR;
|
||||
}
|
||||
}
|
||||
case 5: {
|
||||
if (!isXAligned) {
|
||||
return this.topL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this.lapiz;
|
||||
}
|
||||
case 10 -> {
|
||||
switch (side) {
|
||||
case 0 -> {
|
||||
return this.stone;
|
||||
}
|
||||
case 1 -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
case 2 -> {
|
||||
if (isXAligned) {
|
||||
return this.CornerTL;
|
||||
}
|
||||
return this.stone;
|
||||
}
|
||||
case 3 -> {
|
||||
if (isXAligned) {
|
||||
return this.CornerTR;
|
||||
}
|
||||
return this.stone;
|
||||
}
|
||||
case 4 -> {
|
||||
if (isXAligned) {
|
||||
return this.stone;
|
||||
}
|
||||
return this.CornerTR;
|
||||
}
|
||||
case 5 -> {
|
||||
if (isXAligned) {
|
||||
return this.stone;
|
||||
}
|
||||
return this.CornerTL;
|
||||
}
|
||||
default -> {
|
||||
return this.rightSide(isXAligned, side);
|
||||
}
|
||||
}
|
||||
}
|
||||
case 11, 12, 13 -> {
|
||||
return this.rightSide(isXAligned, side);
|
||||
}
|
||||
case 14 -> {
|
||||
switch (side) {
|
||||
case 0 -> {
|
||||
return this.stone;
|
||||
}
|
||||
case 1 -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
case 2 -> {
|
||||
if (isXAligned) {
|
||||
return this.CornerBL;
|
||||
}
|
||||
return this.stone;
|
||||
}
|
||||
case 3 -> {
|
||||
if (isXAligned) {
|
||||
return this.CornerBR;
|
||||
}
|
||||
return this.stone;
|
||||
}
|
||||
case 4 -> {
|
||||
if (isXAligned) {
|
||||
return this.stone;
|
||||
}
|
||||
return this.CornerBR;
|
||||
}
|
||||
case 5 -> {
|
||||
if (isXAligned) {
|
||||
return this.stone;
|
||||
}
|
||||
return this.CornerBL;
|
||||
}
|
||||
default -> {
|
||||
break Label_0410;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.lapiz;
|
||||
return switch (world.getBlockMetadata(x, y, z)) {
|
||||
case 0 -> switch (side) {
|
||||
case 0 -> this.lapiz;
|
||||
case 1 -> this.stone;
|
||||
case 2 -> isXAligned ? this.CornerTR : this.stone;
|
||||
case 3 -> isXAligned ? this.CornerTL : this.stone;
|
||||
case 4 -> isXAligned ? this.stone : this.CornerTL;
|
||||
case 5 -> isXAligned ? this.stone : this.CornerTR;
|
||||
default -> this.leftSide(isXAligned, side);
|
||||
};
|
||||
case 1, 2, 3 -> this.leftSide(isXAligned, side);
|
||||
case 4 -> switch (side) {
|
||||
case 0 -> this.stone;
|
||||
case 1 -> this.lapiz;
|
||||
case 2 -> isXAligned ? this.CornerBR : this.stone;
|
||||
case 3 -> isXAligned ? this.CornerBL : this.stone;
|
||||
case 4 -> isXAligned ? this.stone : this.CornerBL;
|
||||
case 5 -> isXAligned ? this.stone : this.CornerBR;
|
||||
default -> this.lapiz;
|
||||
};
|
||||
case 5 -> switch (side) {
|
||||
case 0 -> this.lapiz;
|
||||
case 1 -> this.stone;
|
||||
case 2 -> isXAligned ? this.topR : this.stone;
|
||||
case 3 -> isXAligned ? this.topL : this.stone;
|
||||
case 4 -> isXAligned ? this.stone : this.topL;
|
||||
case 5 -> isXAligned ? this.stone : this.topR;
|
||||
default -> this.lapiz;
|
||||
};
|
||||
case 6, 7, 9 -> this.bottomSide(isXAligned, side);
|
||||
case 8 -> switch (side) {
|
||||
case 0 -> this.lapiz;
|
||||
case 1 -> this.stone;
|
||||
case 2 -> isXAligned ? this.topL : this.stone;
|
||||
case 3 -> isXAligned ? this.topR : this.stone;
|
||||
case 4 -> isXAligned ? this.stone : this.topR;
|
||||
case 5 -> isXAligned ? this.stone : this.topL;
|
||||
default -> this.lapiz;
|
||||
};
|
||||
case 10 -> switch (side) {
|
||||
case 0 -> this.lapiz;
|
||||
case 1 -> this.stone;
|
||||
case 2 -> isXAligned ? this.CornerTL : this.stone;
|
||||
case 3 -> isXAligned ? this.CornerTR : this.stone;
|
||||
case 4 -> isXAligned ? this.stone : this.CornerTR;
|
||||
case 5 -> isXAligned ? this.stone : this.CornerTL;
|
||||
default -> this.rightSide(isXAligned, side);
|
||||
};
|
||||
case 11, 12, 13 -> this.rightSide(isXAligned, side);
|
||||
case 14 -> switch (side) {
|
||||
case 0 -> this.stone;
|
||||
case 1 -> this.lapiz;
|
||||
case 2 -> isXAligned ? this.CornerBL : this.stone;
|
||||
case 3 -> isXAligned ? this.CornerBR : this.stone;
|
||||
case 4 -> isXAligned ? this.stone : this.CornerBR;
|
||||
case 5 -> isXAligned ? this.stone : this.CornerBL;
|
||||
default -> this.lapiz;
|
||||
};
|
||||
default -> this.lapiz;
|
||||
};
|
||||
}
|
||||
|
||||
IIcon leftSide(final boolean xAligned, final int side) {
|
||||
if (xAligned) {
|
||||
switch (side) {
|
||||
case 2 -> {
|
||||
return this.R;
|
||||
}
|
||||
case 3 -> {
|
||||
return this.L;
|
||||
}
|
||||
case 4 -> {
|
||||
return this.stone;
|
||||
}
|
||||
default -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (side) {
|
||||
case 2 -> {
|
||||
return this.stone;
|
||||
}
|
||||
case 4 -> {
|
||||
return this.L;
|
||||
}
|
||||
case 5 -> {
|
||||
return this.R;
|
||||
}
|
||||
default -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
}
|
||||
}
|
||||
return switch (side) {
|
||||
case 2 -> xAligned ? this.R : this.stone;
|
||||
case 3 -> xAligned ? this.L : this.lapiz;
|
||||
case 4 -> xAligned ? this.stone : this.L;
|
||||
case 5 -> xAligned ? this.lapiz : this.R;
|
||||
default -> this.lapiz;
|
||||
};
|
||||
}
|
||||
|
||||
IIcon rightSide(final boolean xAligned, final int side) {
|
||||
if (xAligned) {
|
||||
switch (side) {
|
||||
case 2 -> {
|
||||
return this.L;
|
||||
}
|
||||
case 3 -> {
|
||||
return this.R;
|
||||
}
|
||||
case 5 -> {
|
||||
return this.stone;
|
||||
}
|
||||
default -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (side) {
|
||||
case 3 -> {
|
||||
return this.stone;
|
||||
}
|
||||
case 4 -> {
|
||||
return this.R;
|
||||
}
|
||||
case 5 -> {
|
||||
return this.L;
|
||||
}
|
||||
default -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
}
|
||||
}
|
||||
return switch (side) {
|
||||
case 2 -> xAligned ? this.L : this.lapiz;
|
||||
case 3 -> xAligned ? this.R : this.stone;
|
||||
case 4 -> xAligned ? this.lapiz : this.R;
|
||||
case 5 -> xAligned ? this.stone : this.L;
|
||||
default -> this.lapiz;
|
||||
};
|
||||
}
|
||||
|
||||
IIcon bottomSide(final boolean xAligned, final int side) {
|
||||
switch (side) {
|
||||
case 0 -> {
|
||||
return this.stone;
|
||||
}
|
||||
case 1 -> {
|
||||
return this.lapiz;
|
||||
}
|
||||
default -> {
|
||||
return this.B;
|
||||
}
|
||||
}
|
||||
return switch (side) {
|
||||
case 0 -> this.stone;
|
||||
case 1 -> this.lapiz;
|
||||
default -> this.B;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
import com.kentington.thaumichorizons.common.ThaumicHorizons;
|
||||
import com.kentington.thaumichorizons.common.lib.GatewayTeleporter;
|
||||
@@ -83,12 +84,12 @@ public class BlockPortalTH extends BlockBreakable {
|
||||
|
||||
public void onEntityCollidedWithBlock(final World world, final int x, final int y, final int z,
|
||||
final Entity player) {
|
||||
if (player.ridingEntity == null && player.riddenByEntity == null && player instanceof EntityPlayerMP) {
|
||||
if (player.timeUntilPortal > 0) {
|
||||
player.timeUntilPortal = 10;
|
||||
if (player.ridingEntity == null && player.riddenByEntity == null && player instanceof final EntityPlayerMP playerMP) {
|
||||
if (playerMP.timeUntilPortal > 0) {
|
||||
playerMP.timeUntilPortal = 10;
|
||||
return;
|
||||
}
|
||||
player.timeUntilPortal = 10;
|
||||
playerMP.timeUntilPortal = 10;
|
||||
int targetX = 0;
|
||||
int targetY = 0;
|
||||
int targetZ = 0;
|
||||
@@ -116,15 +117,21 @@ public class BlockPortalTH extends BlockBreakable {
|
||||
if (portal.length > 3) targetDim = portal[3];
|
||||
|
||||
final MinecraftServer mServer = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
((EntityPlayerMP) player).mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
(EntityPlayerMP) player,
|
||||
final WorldServer targetWorld = mServer.worldServerForDimension(targetDim);
|
||||
float exitYaw = playerMP.rotationYaw;
|
||||
// face perpendicular to portal plane, away from portal into the world
|
||||
if (targetWorld.getTileEntity(targetX, targetY + 2, targetZ) instanceof final TileSlot slotTE) {
|
||||
exitYaw = slotTE.xAligned ? 0.0f : 270.0f;
|
||||
}
|
||||
playerMP.mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
playerMP,
|
||||
targetDim,
|
||||
new GatewayTeleporter(
|
||||
mServer.worldServerForDimension(ThaumicHorizons.dimensionPocketId),
|
||||
targetWorld,
|
||||
targetX,
|
||||
targetY,
|
||||
targetZ,
|
||||
player.rotationYaw));
|
||||
exitYaw));
|
||||
} else {
|
||||
int slotY = y;
|
||||
int slotX = x;
|
||||
@@ -167,8 +174,8 @@ public class BlockPortalTH extends BlockBreakable {
|
||||
}
|
||||
}
|
||||
final MinecraftServer mServer2 = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
((EntityPlayerMP) player).mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
(EntityPlayerMP) player,
|
||||
playerMP.mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
playerMP,
|
||||
ThaumicHorizons.dimensionPocketId,
|
||||
new GatewayTeleporter(
|
||||
mServer2.worldServerForDimension(ThaumicHorizons.dimensionPocketId),
|
||||
|
||||
@@ -32,6 +32,7 @@ public class BlockSlot extends BlockContainer {
|
||||
|
||||
public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int md) {
|
||||
final TileSlot tco = (TileSlot) world.getTileEntity(x, y, z);
|
||||
if (tco == null) return;
|
||||
if (tco.portalOpen) {
|
||||
tco.destroyPortal();
|
||||
}
|
||||
@@ -59,15 +60,20 @@ public class BlockSlot extends BlockContainer {
|
||||
if (tco.portalOpen) {
|
||||
tco.destroyPortal();
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
} else if (!tco.portalOpen && player.getHeldItem().getItem() instanceof ItemWandCasting) {
|
||||
tco.makePortal(player);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
} else if (theItem != null && theItem.getItem() == ThaumicHorizons.itemKeystone
|
||||
&& theItem.stackTagCompound != null) {
|
||||
tco.insertKeystone(theItem.stackTagCompound.getInteger("dimension"));
|
||||
--theItem.stackSize;
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+13
-14
@@ -82,20 +82,19 @@ public class BlockSyntheticNode extends BlockContainer {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void breakBlock(final World p_149749_1_, final int p_149749_2_, final int p_149749_3_, final int p_149749_4_,
|
||||
final Block p_149749_5_, final int p_149749_6_) {
|
||||
final TileSyntheticNode tile = (TileSyntheticNode) p_149749_1_
|
||||
.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
if (tile != null) {
|
||||
for (final Aspect asp : tile.getMaxAspects().getAspects()) {
|
||||
final ItemStack essence = new ItemStack(
|
||||
ConfigItems.itemWispEssence,
|
||||
tile.getMaxAspects().getAmount(asp) / 4);
|
||||
((ItemWispEssence) ConfigItems.itemWispEssence).setAspects(essence, new AspectList().add(asp, 2));
|
||||
p_149749_1_.spawnEntityInWorld(
|
||||
new EntityItem(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, essence));
|
||||
}
|
||||
public void breakBlock(final World world, final int x, final int y, final int z, final Block block,
|
||||
final int meta) {
|
||||
if (!(world.getTileEntity(x, y, z) instanceof TileSyntheticNode tile)) {
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
return;
|
||||
}
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
for (final Aspect asp : tile.getMaxAspects().getAspects()) {
|
||||
final ItemStack essence = new ItemStack(
|
||||
ConfigItems.itemWispEssence,
|
||||
tile.getMaxAspects().getAmount(asp) / 4);
|
||||
((ItemWispEssence) ConfigItems.itemWispEssence).setAspects(essence, new AspectList().add(asp, 2));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x, y, z, essence));
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
}
|
||||
@@ -45,10 +45,10 @@ public class ContainerCase extends Container {
|
||||
new SlotLimitedByClass(ILens.class, this.input, a, 37 + a % 6 * 18, 51 + a / 6 * 18));
|
||||
}
|
||||
this.bindPlayerInventory(iinventory);
|
||||
if (!par2World.isRemote) {
|
||||
try {
|
||||
((InventoryCase) this.input).stackList = ((ItemLensCase) this.pouch.getItem()).getInventory(this.pouch);
|
||||
} catch (Exception ignored) {}
|
||||
if (!par2World.isRemote && this.pouch != null
|
||||
&& this.pouch.getItem() instanceof ItemLensCase lensCase
|
||||
&& this.input instanceof InventoryCase inv) {
|
||||
inv.stackList = lensCase.getInventory(this.pouch);
|
||||
}
|
||||
this.onCraftMatrixChanged(this.input);
|
||||
}
|
||||
|
||||
@@ -162,10 +162,8 @@ public class EntityGolemTH extends EntityGolemBase {
|
||||
this.getNavigator().setAvoidsWater(
|
||||
this.getGolemTHType() != EnumGolemTHType.ROCK && this.getGolemTHType() != EnumGolemTHType.METAL
|
||||
&& this.getGolemTHType() != EnumGolemTHType.REDSTONE);
|
||||
int bonus = 0;
|
||||
try {
|
||||
bonus = (this.getGolemDecoration().contains("H") ? 5 : 0);
|
||||
} catch (Exception ignored) {}
|
||||
final String decor = this.getGolemDecoration();
|
||||
final int bonus = decor == null ? 0 : (decor.contains("H") ? 5 : 0);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.getGolemTHType().health + bonus);
|
||||
return true;
|
||||
}
|
||||
@@ -667,10 +665,8 @@ public class EntityGolemTH extends EntityGolemBase {
|
||||
this.action = 6;
|
||||
} else if (par1 == 5) {
|
||||
this.healing = 5;
|
||||
int bonus = 0;
|
||||
try {
|
||||
bonus = (this.getGolemDecoration().contains("H") ? 5 : 0);
|
||||
} catch (Exception ignored) {}
|
||||
final String decor = this.getGolemDecoration();
|
||||
final int bonus = decor == null ? 0 : (decor.contains("H") ? 5 : 0);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.type.health + bonus);
|
||||
} else if (par1 == 6) {
|
||||
this.leftArm = 5;
|
||||
|
||||
+21
-18
@@ -401,7 +401,27 @@ public class ItemFocusLiquefaction extends ItemFocusBasic {
|
||||
final int meltable = this.isMeltableBlock(bi, md);
|
||||
final boolean flammable = bi.isFlammable(p.worldObj, x, y, z, ForgeDirection.UNKNOWN);
|
||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(bi, 1, md));
|
||||
if (result != null && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
|
||||
// Meltable blocks (e.g. stone) take priority over any furnace smelting recipe they may have,
|
||||
// otherwise mods that add a smelting recipe for stone (such as Et Futurum Requiem's smooth
|
||||
// stone) would prevent the stone -> lava transmutation.
|
||||
if (meltable > 0 && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
|
||||
if (meltable == 1) {
|
||||
p.worldObj.setBlockToAir(x, y, z);
|
||||
} else if (meltable == 2) {
|
||||
if (p.worldObj.provider.dimensionId != -1) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.water, 0, 3);
|
||||
} else {
|
||||
p.worldObj.setBlockToAir(x, y, z);
|
||||
}
|
||||
} else if (meltable == 3) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.dirt, 0, 3);
|
||||
} else if (meltable == 4) {
|
||||
Blocks.tnt.onBlockDestroyedByPlayer(p.worldObj, x, y, z, 1);
|
||||
p.worldObj.setBlockToAir(x, y, z);
|
||||
} else if (meltable == 6) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.lava, 0, 3);
|
||||
}
|
||||
} else if (result != null && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
|
||||
if (this.getUpgradeLevel(wand.getFocusItem(stack), ItemFocusLiquefaction.purity) > 0
|
||||
&& Utils.findSpecialMiningResult(new ItemStack(bi, 1, md), 9999.0f, p.worldObj.rand) != null) {
|
||||
final ItemStack pure = Utils
|
||||
@@ -433,23 +453,6 @@ public class ItemFocusLiquefaction extends ItemFocusBasic {
|
||||
theItem.setEntityItemStack(result.copy());
|
||||
p.worldObj.spawnEntityInWorld(theItem);
|
||||
}
|
||||
} else if (meltable > 0 && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
|
||||
if (meltable == 1) {
|
||||
p.worldObj.setBlockToAir(x, y, z);
|
||||
} else if (meltable == 2) {
|
||||
if (p.worldObj.provider.dimensionId != -1) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.water, 0, 3);
|
||||
} else {
|
||||
p.worldObj.setBlockToAir(x, y, z);
|
||||
}
|
||||
} else if (meltable == 3) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.dirt, 0, 3);
|
||||
} else if (meltable == 4) {
|
||||
Blocks.tnt.onBlockDestroyedByPlayer(p.worldObj, x, y, z, 1);
|
||||
p.worldObj.setBlockToAir(x, y, z);
|
||||
} else if (meltable == 6) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.lava, 0, 3);
|
||||
}
|
||||
} else if (flammable && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.fire);
|
||||
}
|
||||
|
||||
@@ -50,8 +50,11 @@ public class ItemKeystone extends Item {
|
||||
|
||||
public void addInformation(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final List par3List,
|
||||
final boolean par4) {
|
||||
if (par1ItemStack.getTagCompound() != null && par1ItemStack.getTagCompound().getInteger("dimension") != 0) {
|
||||
par3List.add(PocketPlaneData.planes.get(par1ItemStack.getTagCompound().getInteger("dimension")).name);
|
||||
if (par1ItemStack.getTagCompound() != null) {
|
||||
final int dim = par1ItemStack.getTagCompound().getInteger("dimension");
|
||||
if (dim >= 0 && dim < PocketPlaneData.planes.size()) {
|
||||
par3List.add(PocketPlaneData.planes.get(dim).name);
|
||||
}
|
||||
}
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
}
|
||||
@@ -71,9 +74,13 @@ public class ItemKeystone extends Item {
|
||||
float hitX, float hitY, float hitZ) {
|
||||
if (stack.getTagCompound() == null && player.dimension == ThaumicHorizons.dimensionPocketId
|
||||
&& !world.isRemote) {
|
||||
if (world.getTileEntity(x, y, z) instanceof TileVortex)
|
||||
(stack.stackTagCompound = new NBTTagCompound()).setInteger("dimension", (z + 128) / 256);
|
||||
return true;
|
||||
if (world.getTileEntity(x, y, z) instanceof final TileVortex vortex) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setInteger("dimension", vortex.dimensionID);
|
||||
player.inventory.markDirty();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return super.onItemUseFirst(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
|
||||
package com.kentington.thaumichorizons.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
@@ -43,6 +46,11 @@ public class ItemSyringeEmpty extends Item {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
par3List.add(new ItemStack(this, 1, 2));
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(final ItemStack par1ItemStack) {
|
||||
return "item.syringeEmpty";
|
||||
}
|
||||
@@ -60,6 +68,11 @@ public class ItemSyringeEmpty extends Item {
|
||||
final NBTTagCompound critterTag = new NBTTagCompound();
|
||||
critter.writeToNBT(critterTag);
|
||||
critterTag.setString("id", EntityList.getEntityString(ent));
|
||||
// Strip inventory-related tags - a blood sample should only carry genetic data
|
||||
critterTag.removeTag("Items");
|
||||
critterTag.removeTag("ArmorItem");
|
||||
critterTag.removeTag("SaddleItem");
|
||||
critterTag.removeTag("ChestedHorse");
|
||||
bloodSample.stackTagCompound.setString("critterName", ent.getCommandSenderName());
|
||||
bloodSample.stackTagCompound.setTag("critter", critterTag);
|
||||
if (p.inventory.addItemStackToInventory(bloodSample)) {
|
||||
|
||||
-4
@@ -85,10 +85,6 @@ public class ItemLensOrderEntropy extends Item implements ILens {
|
||||
try {
|
||||
text = stack.getDisplayName();
|
||||
} catch (Exception ignored) {}
|
||||
} else if (stack.getItem() != null) {
|
||||
try {
|
||||
text = stack.getItem().getItemStackDisplayName(stack);
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
if (scan.type == 2) {
|
||||
|
||||
@@ -171,7 +171,9 @@ public class EventHandlerEntity {
|
||||
final PotionEffect effect = new PotionEffect(Potion.resistance.id, Integer.MAX_VALUE, 0, true);
|
||||
effect.setCurativeItems(new ArrayList<>());
|
||||
entity.addPotionEffect(effect);
|
||||
ThaumicHorizons.instance.renderEventHandler.thingsThatSparkle.add(entity);
|
||||
if (entity.worldObj.isRemote) {
|
||||
ThaumicHorizons.instance.renderEventHandler.thingsThatSparkle.add(entity);
|
||||
}
|
||||
} else if (infusions[i] == 8 && !entity.getEntityData().hasKey("runicCharge")) {
|
||||
entity.getEntityData().setInteger("runicCharge", 6);
|
||||
} else if (infusions[i] == 7) {
|
||||
@@ -337,6 +339,7 @@ public class EventHandlerEntity {
|
||||
}
|
||||
}
|
||||
if (prop.hasPlayerInfusion(6) && event.entity.ticksExisted % 200 == 0
|
||||
&& player.getFoodStats().needFood()
|
||||
&& player.worldObj.isDaytime()
|
||||
&& player.worldObj.canBlockSeeTheSky(
|
||||
MathHelper.floor_double(player.posX),
|
||||
@@ -955,8 +958,11 @@ public class EventHandlerEntity {
|
||||
|
||||
@SubscribeEvent
|
||||
public void golemDies(final LivingDeathEvent event) {
|
||||
if (event.entity instanceof EntityGolemTH) {
|
||||
((EntityGolemTH) event.entity).die();
|
||||
if (event.entity.worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
if (event.entity instanceof EntityGolemTH golem) {
|
||||
golem.die();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,12 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.NoiseGeneratorOctaves;
|
||||
|
||||
import com.kentington.thaumichorizons.common.ThaumicHorizons;
|
||||
@@ -77,6 +80,17 @@ public class PocketPlaneData {
|
||||
return a.intValue() > a.floatValue() ? a.intValue() - 1 : a.intValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the block directly in the chunk for significant performance boost
|
||||
*/
|
||||
private static void setBlock(World world, int x, int y, int z, Block blockIn, int metadataIn) {
|
||||
WorldServer server = (WorldServer) world;
|
||||
Chunk chunk = server.theChunkProviderServer.loadChunk(x >> 4, z >> 4);
|
||||
chunk.func_150807_a(x & 15, y, z & 15, blockIn, metadataIn);
|
||||
chunk.setChunkModified();
|
||||
}
|
||||
|
||||
// TODO: Make pocket planes generate chunk-by-chunk using normal chunk generation
|
||||
public static void generatePocketPlane(final AspectList aspects, final PocketPlaneData data, final World world,
|
||||
final int vortexX, final int vortexY, final int vortexZ, final int returnID) {
|
||||
if (!world.isRemote) {
|
||||
@@ -105,13 +119,17 @@ public class PocketPlaneData {
|
||||
drawSphere(xCenter, yCenter, zCenter, data.radius, ThaumicHorizons.blockVoid, 0, world);
|
||||
for (int x = -2; x <= 2; ++x) {
|
||||
for (int z = -2; z <= 2; ++z) {
|
||||
world.setBlock(xCenter + x, yCenter, zCenter + z, ConfigBlocks.blockCosmeticSolid, 6, 0);
|
||||
setBlock(world, xCenter + x, yCenter, zCenter + z, ConfigBlocks.blockCosmeticSolid, 6);
|
||||
world.setBlockToAir(xCenter + x, yCenter + 1, zCenter + z);
|
||||
world.setBlockToAir(xCenter + x, yCenter + 2, zCenter + z);
|
||||
}
|
||||
}
|
||||
world.setBlock(xCenter, yCenter + 1, zCenter, ThaumicHorizons.blockVortex);
|
||||
final TileVortex vortex = (TileVortex) world.getTileEntity(xCenter, yCenter + 1, zCenter);
|
||||
setBlock(world, xCenter, yCenter + 1, zCenter, ThaumicHorizons.blockVortex, 0);
|
||||
TileEntity te = world.getTileEntity(xCenter, yCenter + 1, zCenter);
|
||||
if (!(te instanceof TileVortex)) {
|
||||
te = new TileVortex();
|
||||
}
|
||||
final TileVortex vortex = (TileVortex) te;
|
||||
vortex.cheat = true;
|
||||
vortex.returnID = returnID;
|
||||
vortex.dimensionID = PocketPlaneData.planes.size();
|
||||
@@ -123,7 +141,7 @@ public class PocketPlaneData {
|
||||
data.portalD = new int[4];
|
||||
PocketPlaneData.planes.add(data);
|
||||
PocketPlaneData.positions.put(pocketPlaneMAXID, Vec3.createVectorHelper(vortexX, vortexY, vortexZ));
|
||||
world.getChunkFromBlockCoords(vortexX, vortexZ).isModified = true;
|
||||
world.getChunkFromBlockCoords(xCenter, zCenter).isModified = true;
|
||||
creatures = 0;
|
||||
++pocketPlaneMAXID;
|
||||
}
|
||||
@@ -327,6 +345,7 @@ public class PocketPlaneData {
|
||||
level -= fastFloor((aspectFraction(Aspect.CLOTH, aspects) * data.radius));
|
||||
drewAnything = true;
|
||||
}
|
||||
|
||||
if (aspects.getAmount(Aspect.EARTH) > 0) {
|
||||
if (bio == BiomeGenBase.desert) {
|
||||
drawLayer(xCenter, yCenter, zCenter, data, world, Blocks.sand, 0, level, noise, bio, life, aspects);
|
||||
@@ -422,13 +441,13 @@ public class PocketPlaneData {
|
||||
if (top != bottom && level + y > 0) {
|
||||
if (y == top) {
|
||||
if (block != null) {
|
||||
world.setBlock(x + xCenter, y + level, z + zCenter, block, md, 0);
|
||||
setBlock(world, x + xCenter, y + level, z + zCenter, block, md);
|
||||
}
|
||||
if (block == Blocks.water) {
|
||||
if (bio != null && bio.getTempCategory() == BiomeGenBase.TempCategory.COLD) {
|
||||
world.setBlock(x + xCenter, y + level, z + zCenter, Blocks.ice, 0, 0);
|
||||
setBlock(world, x + xCenter, y + level, z + zCenter, Blocks.ice, 0);
|
||||
} else {
|
||||
world.setBlock(x + xCenter, y + level, z + zCenter, block, 0, 0);
|
||||
setBlock(world, x + xCenter, y + level, z + zCenter, block, 0);
|
||||
if ((life > 40 || aspects.getAmount(Aspect.BEAST) > 0)
|
||||
&& world.rand.nextInt(100) > 98
|
||||
&& creatures < MAX_CREATURES) {
|
||||
@@ -439,199 +458,199 @@ public class PocketPlaneData {
|
||||
++creatures;
|
||||
}
|
||||
if (life > 0 && world.rand.nextInt(100) > 98) {
|
||||
world.setBlock(x + xCenter, y + level + 1, z + zCenter, Blocks.waterlily, 0, 0);
|
||||
setBlock(world, x + xCenter, y + level + 1, z + zCenter, Blocks.waterlily, 0);
|
||||
}
|
||||
}
|
||||
} else if (block == Blocks.dirt) {
|
||||
if (life > 0 && world.isAirBlock(x + xCenter, y + level + 1, z + zCenter)) {
|
||||
world.setBlock(x + xCenter, y + level, z + zCenter, Blocks.grass, 0, 0);
|
||||
setBlock(world, x + xCenter, y + level, z + zCenter, Blocks.grass, 0);
|
||||
if (life >= 10) {
|
||||
if ((life >= 20 || aspects.getAmount(Aspect.CROP) > 0
|
||||
|| aspects.getAmount(Aspect.HARVEST) > 0)
|
||||
&& world.rand.nextInt(100) > 97) {
|
||||
switch (world.rand.nextInt(10)) {
|
||||
case 0 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level,
|
||||
z + zCenter,
|
||||
Blocks.farmland,
|
||||
0,
|
||||
0);
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.carrots,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 1 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level,
|
||||
z + zCenter,
|
||||
Blocks.farmland,
|
||||
0,
|
||||
0);
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.potatoes,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 2 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level,
|
||||
z + zCenter,
|
||||
Blocks.farmland,
|
||||
0,
|
||||
0);
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.wheat,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 3 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.melon_block,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 4 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.pumpkin,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 5 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.reeds,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 6 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level,
|
||||
z + zCenter,
|
||||
Blocks.mycelium,
|
||||
0,
|
||||
0);
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.red_mushroom,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 7 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level,
|
||||
z + zCenter,
|
||||
Blocks.mycelium,
|
||||
0,
|
||||
0);
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.brown_mushroom,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 8 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCustomPlant,
|
||||
2,
|
||||
0);
|
||||
2);
|
||||
}
|
||||
case 9 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCustomPlant,
|
||||
5,
|
||||
0);
|
||||
5);
|
||||
}
|
||||
}
|
||||
} else if ((life >= 15 || aspects.getAmount(Aspect.TREE) > 0)
|
||||
&& world.rand.nextInt(100) > 97) {
|
||||
switch (world.rand.nextInt(10)) {
|
||||
case 0 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.sapling,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
case 1 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.sapling,
|
||||
1,
|
||||
0);
|
||||
1);
|
||||
}
|
||||
case 2 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.sapling,
|
||||
2,
|
||||
0);
|
||||
2);
|
||||
}
|
||||
case 3 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.sapling,
|
||||
3,
|
||||
0);
|
||||
3);
|
||||
}
|
||||
case 4 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.sapling,
|
||||
4,
|
||||
0);
|
||||
4);
|
||||
}
|
||||
case 5 -> {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.sapling,
|
||||
5,
|
||||
0);
|
||||
5);
|
||||
}
|
||||
case 6 -> {
|
||||
if (((bio != null
|
||||
@@ -639,24 +658,24 @@ public class PocketPlaneData {
|
||||
|| aspects.getAmount(Aspect.MAGIC) > 10
|
||||
|| aspects.getAmount(Aspect.AURA) > 5)
|
||||
&& world.rand.nextInt(4) == 0) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCustomPlant,
|
||||
1,
|
||||
0);
|
||||
1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 7 -> {
|
||||
if (world.rand.nextInt(3) == 0) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCustomPlant,
|
||||
0,
|
||||
0);
|
||||
break;
|
||||
}
|
||||
@@ -667,40 +686,40 @@ public class PocketPlaneData {
|
||||
&& world.rand.nextInt(100) > 94) {
|
||||
final int random = world.rand.nextInt(18);
|
||||
if (random <= 15) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.red_flower,
|
||||
random,
|
||||
0);
|
||||
random);
|
||||
} else {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
Blocks.tallgrass,
|
||||
random - 16,
|
||||
0);
|
||||
random - 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
world.setBlock(x + xCenter, y + level, z + zCenter, block, 0, 0);
|
||||
setBlock(world, x + xCenter, y + level, z + zCenter, block, 0);
|
||||
}
|
||||
} else if (block == Blocks.sand) {
|
||||
world.setBlock(x + xCenter, y + level, z + zCenter, block, 0, 0);
|
||||
setBlock(world, x + xCenter, y + level, z + zCenter, block, 0);
|
||||
if (life > 10) {
|
||||
if (life >= 20 && world.rand.nextInt(100) > 98) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCustomPlant,
|
||||
3,
|
||||
0);
|
||||
3);
|
||||
} else if (world.rand.nextInt(100) > 97) {
|
||||
world.setBlock(x + xCenter, y + level + 1, z + zCenter, Blocks.cactus, 0, 0);
|
||||
setBlock(world, x + xCenter, y + level + 1, z + zCenter, Blocks.cactus, 0);
|
||||
}
|
||||
}
|
||||
} else if (block == ConfigBlocks.blockTaint && md == 2 && world.rand.nextInt(300) > 298) {
|
||||
@@ -708,12 +727,12 @@ public class PocketPlaneData {
|
||||
for (int ecks = 0; ecks < 3; ++ecks) {
|
||||
for (int zee = 0; zee < 2; ++zee) {
|
||||
for (int why = 0; why < 2; ++why) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter + ecks,
|
||||
y + level + why,
|
||||
z + zCenter + zee,
|
||||
ThaumicHorizons.blockBrain,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
@@ -722,12 +741,12 @@ public class PocketPlaneData {
|
||||
for (int ecks = 0; ecks < 2; ++ecks) {
|
||||
for (int zee = 0; zee < 3; ++zee) {
|
||||
for (int why = 0; why < 2; ++why) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter + ecks,
|
||||
y + level + why,
|
||||
z + zCenter + zee,
|
||||
ThaumicHorizons.blockBrain,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
@@ -736,7 +755,7 @@ public class PocketPlaneData {
|
||||
}
|
||||
if (bio != null && block.isNormalCube()
|
||||
&& bio.getTempCategory() == BiomeGenBase.TempCategory.COLD) {
|
||||
world.setBlock(x + xCenter, y + level + 1, z + zCenter, Blocks.snow_layer, 1, 0);
|
||||
setBlock(world, x + xCenter, y + level + 1, z + zCenter, Blocks.snow_layer, 1);
|
||||
}
|
||||
if ((life >= 50 || aspects.getAmount(Aspect.BEAST) > 0) && world.rand.nextInt(100) > 98) {
|
||||
EntityLiving critter = null;
|
||||
@@ -794,52 +813,46 @@ public class PocketPlaneData {
|
||||
++creatures;
|
||||
}
|
||||
if (aspects.getAmount(Aspect.ELDRITCH) > 0 && world.rand.nextInt(200) > 198) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCosmeticSolid,
|
||||
1,
|
||||
0);
|
||||
world.setBlock(
|
||||
1);
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCosmeticSolid,
|
||||
0,
|
||||
0);
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 2,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCosmeticSolid,
|
||||
0,
|
||||
0);
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 3,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockCosmeticSolid,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
if (aspects.getAmount(Aspect.CRAFT) > 0 && world.rand.nextInt(200) > 198) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
x + xCenter,
|
||||
y + level + 1,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockStoneDevice,
|
||||
1,
|
||||
0);
|
||||
1);
|
||||
}
|
||||
if (aspects.getAmount(Aspect.TAINT) > 0 && world.rand.nextInt(100) > 98) {
|
||||
world.setBlock(
|
||||
x + xCenter,
|
||||
y + level,
|
||||
z + zCenter,
|
||||
ConfigBlocks.blockTaintFibres,
|
||||
0,
|
||||
0);
|
||||
setBlock(world, x + xCenter, y + level, z + zCenter, ConfigBlocks.blockTaintFibres, 0);
|
||||
}
|
||||
if (aspects.getAmount(Aspect.TAINT) > 0 && world.rand.nextInt(200) > 198
|
||||
&& creatures < MAX_CREATURES) {
|
||||
@@ -856,7 +869,7 @@ public class PocketPlaneData {
|
||||
++creatures;
|
||||
}
|
||||
} else if (block != null) {
|
||||
world.setBlock(x + xCenter, y + level, z + zCenter, block, md, 0);
|
||||
setBlock(world, x + xCenter, y + level, z + zCenter, block, md);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -983,114 +996,114 @@ public class PocketPlaneData {
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z) != Blocks.water) {
|
||||
if (whichAspect == Aspect.EARTH) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
ConfigBlocks.blockCrystal,
|
||||
3,
|
||||
0);
|
||||
3);
|
||||
} else if (whichAspect == Aspect.AIR) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
ConfigBlocks.blockCrystal,
|
||||
0,
|
||||
0);
|
||||
} else if (whichAspect == Aspect.WATER) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
ConfigBlocks.blockCrystal,
|
||||
2,
|
||||
0);
|
||||
2);
|
||||
} else if (whichAspect == Aspect.FIRE) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
ConfigBlocks.blockCrystal,
|
||||
1,
|
||||
0);
|
||||
1);
|
||||
} else if (whichAspect == Aspect.ORDER) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
ConfigBlocks.blockCrystal,
|
||||
4,
|
||||
0);
|
||||
4);
|
||||
} else if (whichAspect == Aspect.ENTROPY) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
ConfigBlocks.blockCrystal,
|
||||
5,
|
||||
0);
|
||||
5);
|
||||
} else if (whichAspect == Aspect.DEATH || whichAspect == Aspect.UNDEAD) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
Blocks.skull,
|
||||
0,
|
||||
0);
|
||||
} else if (whichAspect == Aspect.SENSES) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
Blocks.lapis_block,
|
||||
0,
|
||||
0);
|
||||
} else if (whichAspect == Aspect.GREED) {
|
||||
if (world.rand.nextBoolean()) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
Blocks.gold_block,
|
||||
0,
|
||||
0);
|
||||
} else {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
Blocks.emerald_block,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
} else if (whichAspect == Aspect.METAL) {
|
||||
if (world.rand.nextBoolean()) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
Blocks.gold_block,
|
||||
0,
|
||||
0);
|
||||
} else {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
Blocks.iron_block,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
Blocks.air,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
@@ -1390,13 +1403,13 @@ public class PocketPlaneData {
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z) != Blocks.water) {
|
||||
world.setBlock(
|
||||
setBlock(
|
||||
world,
|
||||
xCenter - xSize + xOffset + x,
|
||||
yCenter + yOffset + y,
|
||||
zCenter - zSize + zOffset + z,
|
||||
block,
|
||||
md,
|
||||
0);
|
||||
md);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1473,38 +1486,38 @@ public class PocketPlaneData {
|
||||
int z = 0;
|
||||
int radiusError = error0;
|
||||
while (x >= z) {
|
||||
world.setBlock(x0 + x, y0 + y1, z0 + z, block, md, 0);
|
||||
world.setBlock(x0 + z, y0 + y1, z0 + x, block, md, 0);
|
||||
world.setBlock(x0 - x, y0 + y1, z0 + z, block, md, 0);
|
||||
world.setBlock(x0 - z, y0 + y1, z0 + x, block, md, 0);
|
||||
world.setBlock(x0 - x, y0 + y1, z0 - z, block, md, 0);
|
||||
world.setBlock(x0 - z, y0 + y1, z0 - x, block, md, 0);
|
||||
world.setBlock(x0 + x, y0 + y1, z0 - z, block, md, 0);
|
||||
world.setBlock(x0 + z, y0 + y1, z0 - x, block, md, 0);
|
||||
world.setBlock(x0 + x, y0 - y1, z0 + z, block, md, 0);
|
||||
world.setBlock(x0 + z, y0 - y1, z0 + x, block, md, 0);
|
||||
world.setBlock(x0 - x, y0 - y1, z0 + z, block, md, 0);
|
||||
world.setBlock(x0 - z, y0 - y1, z0 + x, block, md, 0);
|
||||
world.setBlock(x0 - x, y0 - y1, z0 - z, block, md, 0);
|
||||
world.setBlock(x0 - z, y0 - y1, z0 - x, block, md, 0);
|
||||
world.setBlock(x0 + x, y0 - y1, z0 - z, block, md, 0);
|
||||
world.setBlock(x0 + z, y0 - y1, z0 - x, block, md, 0);
|
||||
world.setBlock(x0 + y1, y0 + x, z0 + z, block, md, 0);
|
||||
world.setBlock(x0 + z, y0 + x, z0 + y1, block, md, 0);
|
||||
world.setBlock(x0 - y1, y0 + x, z0 + z, block, md, 0);
|
||||
world.setBlock(x0 - z, y0 + x, z0 + y1, block, md, 0);
|
||||
world.setBlock(x0 + y1, y0 + x, z0 - z, block, md, 0);
|
||||
world.setBlock(x0 + z, y0 + x, z0 - y1, block, md, 0);
|
||||
world.setBlock(x0 - y1, y0 + x, z0 - z, block, md, 0);
|
||||
world.setBlock(x0 - z, y0 + x, z0 - y1, block, md, 0);
|
||||
world.setBlock(x0 + y1, y0 - x, z0 + z, block, md, 0);
|
||||
world.setBlock(x0 + z, y0 - x, z0 + y1, block, md, 0);
|
||||
world.setBlock(x0 - y1, y0 - x, z0 + z, block, md, 0);
|
||||
world.setBlock(x0 - z, y0 - x, z0 + y1, block, md, 0);
|
||||
world.setBlock(x0 + y1, y0 - x, z0 - z, block, md, 0);
|
||||
world.setBlock(x0 + z, y0 - x, z0 - y1, block, md, 0);
|
||||
world.setBlock(x0 - y1, y0 - x, z0 - z, block, md, 0);
|
||||
world.setBlock(x0 - z, y0 - x, z0 - y1, block, md, 0);
|
||||
setBlock(world, x0 + x, y0 + y1, z0 + z, block, md);
|
||||
setBlock(world, x0 + z, y0 + y1, z0 + x, block, md);
|
||||
setBlock(world, x0 - x, y0 + y1, z0 + z, block, md);
|
||||
setBlock(world, x0 - z, y0 + y1, z0 + x, block, md);
|
||||
setBlock(world, x0 - x, y0 + y1, z0 - z, block, md);
|
||||
setBlock(world, x0 - z, y0 + y1, z0 - x, block, md);
|
||||
setBlock(world, x0 + x, y0 + y1, z0 - z, block, md);
|
||||
setBlock(world, x0 + z, y0 + y1, z0 - x, block, md);
|
||||
setBlock(world, x0 + x, y0 - y1, z0 + z, block, md);
|
||||
setBlock(world, x0 + z, y0 - y1, z0 + x, block, md);
|
||||
setBlock(world, x0 - x, y0 - y1, z0 + z, block, md);
|
||||
setBlock(world, x0 - z, y0 - y1, z0 + x, block, md);
|
||||
setBlock(world, x0 - x, y0 - y1, z0 - z, block, md);
|
||||
setBlock(world, x0 - z, y0 - y1, z0 - x, block, md);
|
||||
setBlock(world, x0 + x, y0 - y1, z0 - z, block, md);
|
||||
setBlock(world, x0 + z, y0 - y1, z0 - x, block, md);
|
||||
setBlock(world, x0 + y1, y0 + x, z0 + z, block, md);
|
||||
setBlock(world, x0 + z, y0 + x, z0 + y1, block, md);
|
||||
setBlock(world, x0 - y1, y0 + x, z0 + z, block, md);
|
||||
setBlock(world, x0 - z, y0 + x, z0 + y1, block, md);
|
||||
setBlock(world, x0 + y1, y0 + x, z0 - z, block, md);
|
||||
setBlock(world, x0 + z, y0 + x, z0 - y1, block, md);
|
||||
setBlock(world, x0 - y1, y0 + x, z0 - z, block, md);
|
||||
setBlock(world, x0 - z, y0 + x, z0 - y1, block, md);
|
||||
setBlock(world, x0 + y1, y0 - x, z0 + z, block, md);
|
||||
setBlock(world, x0 + z, y0 - x, z0 + y1, block, md);
|
||||
setBlock(world, x0 - y1, y0 - x, z0 + z, block, md);
|
||||
setBlock(world, x0 - z, y0 - x, z0 + y1, block, md);
|
||||
setBlock(world, x0 + y1, y0 - x, z0 - z, block, md);
|
||||
setBlock(world, x0 + z, y0 - x, z0 - y1, block, md);
|
||||
setBlock(world, x0 - y1, y0 - x, z0 - z, block, md);
|
||||
setBlock(world, x0 - z, y0 - x, z0 - y1, block, md);
|
||||
++z;
|
||||
if (radiusError < 0) {
|
||||
radiusError += 2 * z + 1;
|
||||
@@ -1631,7 +1644,7 @@ public class PocketPlaneData {
|
||||
if (which == 1) {
|
||||
for (int x = -1; x <= 1; ++x) {
|
||||
for (int y = 126; y <= 128; ++y) {
|
||||
world.setBlock(x, y, 256 * id + data.radius, ThaumicHorizons.blockVoid);
|
||||
setBlock(world, x, y, 256 * id + data.radius, ThaumicHorizons.blockVoid, 0);
|
||||
}
|
||||
}
|
||||
data.portalA[0] = 0;
|
||||
@@ -1640,7 +1653,7 @@ public class PocketPlaneData {
|
||||
} else if (which == 2) {
|
||||
for (int x = -1; x <= 1; ++x) {
|
||||
for (int y = 126; y <= 128; ++y) {
|
||||
world.setBlock(x, y, 256 * id - data.radius, ThaumicHorizons.blockVoid);
|
||||
setBlock(world, x, y, 256 * id - data.radius, ThaumicHorizons.blockVoid, 0);
|
||||
}
|
||||
}
|
||||
data.portalB[0] = 0;
|
||||
@@ -1649,7 +1662,7 @@ public class PocketPlaneData {
|
||||
} else if (which == 3) {
|
||||
for (int z = -1; z <= 1; ++z) {
|
||||
for (int y = 126; y <= 128; ++y) {
|
||||
world.setBlock(data.radius, y, 256 * id + z, ThaumicHorizons.blockVoid);
|
||||
setBlock(world, data.radius, y, 256 * id + z, ThaumicHorizons.blockVoid, 0);
|
||||
}
|
||||
}
|
||||
data.portalC[0] = 0;
|
||||
@@ -1658,7 +1671,7 @@ public class PocketPlaneData {
|
||||
} else if (which == 4) {
|
||||
for (int z = -1; z <= 1; ++z) {
|
||||
for (int y = 126; y <= 128; ++y) {
|
||||
world.setBlock(-data.radius, y, 256 * id + z, ThaumicHorizons.blockVoid);
|
||||
setBlock(world, -data.radius, y, 256 * id + z, ThaumicHorizons.blockVoid, 0);
|
||||
}
|
||||
}
|
||||
data.portalD[0] = 0;
|
||||
@@ -1673,8 +1686,8 @@ public class PocketPlaneData {
|
||||
if (which == 1) {
|
||||
for (int x = -1; x <= 1; ++x) {
|
||||
for (int y = 126; y <= 128; ++y) {
|
||||
world.setBlock(x, y, 256 * id + data.radius, ThaumicHorizons.blockPortal, 0, 3);
|
||||
world.setBlock(x, y, 256 * id + data.radius + 1, ThaumicHorizons.blockVoid);
|
||||
setBlock(world, x, y, 256 * id + data.radius, ThaumicHorizons.blockPortal, 0);
|
||||
setBlock(world, x, y, 256 * id + data.radius + 1, ThaumicHorizons.blockVoid, 0);
|
||||
}
|
||||
}
|
||||
data.portalA[0] = xCoord;
|
||||
@@ -1683,8 +1696,8 @@ public class PocketPlaneData {
|
||||
} else if (which == 2) {
|
||||
for (int x = -1; x <= 1; ++x) {
|
||||
for (int y = 126; y <= 128; ++y) {
|
||||
world.setBlock(x, y, 256 * id - data.radius, ThaumicHorizons.blockPortal, 2, 3);
|
||||
world.setBlock(x, y, 256 * id - data.radius - 1, ThaumicHorizons.blockVoid);
|
||||
setBlock(world, x, y, 256 * id - data.radius, ThaumicHorizons.blockPortal, 2);
|
||||
setBlock(world, x, y, 256 * id - data.radius - 1, ThaumicHorizons.blockVoid, 0);
|
||||
}
|
||||
}
|
||||
data.portalB[0] = xCoord;
|
||||
@@ -1693,8 +1706,8 @@ public class PocketPlaneData {
|
||||
} else if (which == 3) {
|
||||
for (int z = -1; z <= 1; ++z) {
|
||||
for (int y = 126; y <= 128; ++y) {
|
||||
world.setBlock(data.radius, y, 256 * id + z, ThaumicHorizons.blockPortal, 1, 3);
|
||||
world.setBlock(data.radius + 1, y, 256 * id + z, ThaumicHorizons.blockVoid);
|
||||
setBlock(world, data.radius, y, 256 * id + z, ThaumicHorizons.blockPortal, 1);
|
||||
setBlock(world, data.radius + 1, y, 256 * id + z, ThaumicHorizons.blockVoid, 0);
|
||||
}
|
||||
}
|
||||
data.portalC[0] = xCoord;
|
||||
@@ -1703,8 +1716,8 @@ public class PocketPlaneData {
|
||||
} else if (which == 4) {
|
||||
for (int z = -1; z <= 1; ++z) {
|
||||
for (int y = 126; y <= 128; ++y) {
|
||||
world.setBlock(-data.radius, y, 256 * id + z, ThaumicHorizons.blockPortal, 3, 3);
|
||||
world.setBlock(-data.radius - 1, y, 256 * id + z, ThaumicHorizons.blockVoid);
|
||||
setBlock(world, -data.radius, y, 256 * id + z, ThaumicHorizons.blockPortal, 3);
|
||||
setBlock(world, -data.radius - 1, y, 256 * id + z, ThaumicHorizons.blockVoid, 0);
|
||||
}
|
||||
}
|
||||
data.portalD[0] = xCoord;
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package com.kentington.thaumichorizons.common.lib;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
public class PocketPlaneThread implements Runnable {
|
||||
|
||||
PocketPlaneData data;
|
||||
AspectList aspects;
|
||||
World world;
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int returnID;
|
||||
|
||||
public PocketPlaneThread(final PocketPlaneData data, final AspectList aspects, final World world, final int x,
|
||||
final int y, final int z, final int returnID) {
|
||||
this.data = data;
|
||||
this.aspects = aspects;
|
||||
this.world = world;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.returnID = returnID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PocketPlaneData.generatePocketPlane(this.aspects, this.data, this.world, this.x, this.y, this.z, this.returnID);
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,14 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
int progress;
|
||||
static final int PROGRESS_MAX = 9600;
|
||||
public int souls;
|
||||
static final int MAX_SOULS = 16;
|
||||
int essentia;
|
||||
static final int ESSENTIA_MAX = 4000;
|
||||
// Threshold for drawing more essentia (3 MIND aspects * 1000 each)
|
||||
static final int ESSENTIA_DRAW_THRESHOLD = 3000;
|
||||
static final int ESSENTIA_PER_ASPECT = 1000;
|
||||
static final int SUCTION_PRESSURE = 128;
|
||||
static final double PLAYER_REACH_SQ = 64.0;
|
||||
public float rota;
|
||||
public int forging;
|
||||
|
||||
@@ -83,8 +89,8 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
public void addSoulBits(final int bits) {
|
||||
this.progress += bits;
|
||||
this.essentia -= bits;
|
||||
if (this.progress >= 9600) {
|
||||
this.progress -= 9600;
|
||||
while (this.progress >= PROGRESS_MAX) {
|
||||
this.progress -= PROGRESS_MAX;
|
||||
++this.souls;
|
||||
}
|
||||
this.forging = 3;
|
||||
@@ -94,12 +100,12 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
|
||||
@Override
|
||||
public boolean canAcceptSouls() {
|
||||
return this.essentia > 0 && this.souls < 16;
|
||||
return this.essentia > 0 && this.souls < MAX_SOULS;
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (this.essentia < 3000) {
|
||||
if (this.essentia < ESSENTIA_DRAW_THRESHOLD) {
|
||||
this.drawEssentia();
|
||||
}
|
||||
if (this.forging > 0) {
|
||||
@@ -113,7 +119,7 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
|
||||
public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
|
||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this
|
||||
&& p_70300_1_.getDistanceSq(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5) <= 64.0;
|
||||
&& p_70300_1_.getDistanceSq(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5) <= PLAYER_REACH_SQ;
|
||||
}
|
||||
|
||||
void drawEssentia() {
|
||||
@@ -158,12 +164,12 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
if (this.essentia <= 0) {
|
||||
return null;
|
||||
}
|
||||
return new AspectList().add(Aspect.MIND, (int) Math.ceil(this.essentia / 1000.0f));
|
||||
return new AspectList().add(Aspect.MIND, (int) Math.ceil(this.essentia / (float) ESSENTIA_PER_ASPECT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAspects(final AspectList aspects) {
|
||||
this.essentia = aspects.getAmount(Aspect.MIND) * 1000;
|
||||
this.essentia = aspects.getAmount(Aspect.MIND) * ESSENTIA_PER_ASPECT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,7 +194,7 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContainAmount(final Aspect tag, final int amount) {
|
||||
return tag.getTag().equals(Aspect.MIND.getTag()) && this.essentia / 1000 >= amount;
|
||||
return tag.getTag().equals(Aspect.MIND.getTag()) && this.essentia / ESSENTIA_PER_ASPECT >= amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -199,7 +205,7 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
@Override
|
||||
public int containerContains(final Aspect tag) {
|
||||
if (tag.getTag().equals(Aspect.MIND.getTag())) {
|
||||
return this.essentia / 1000;
|
||||
return this.essentia / ESSENTIA_PER_ASPECT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -229,7 +235,7 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
|
||||
@Override
|
||||
public int getSuctionAmount(final ForgeDirection face) {
|
||||
return (this.essentia < 3000) ? 128 : 0;
|
||||
return (this.essentia < ESSENTIA_DRAW_THRESHOLD) ? SUCTION_PRESSURE : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,8 +245,8 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
|
||||
@Override
|
||||
public int addEssentia(final Aspect aspect, final int amount, final ForgeDirection face) {
|
||||
if (this.essentia < 3000) {
|
||||
this.essentia += 1000;
|
||||
if (this.essentia < ESSENTIA_DRAW_THRESHOLD) {
|
||||
this.essentia += ESSENTIA_PER_ASPECT;
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
return 1;
|
||||
@@ -255,7 +261,7 @@ public class TileSoulforge extends TileThaumcraft implements ISoulReceiver, IEss
|
||||
|
||||
@Override
|
||||
public int getEssentiaAmount(final ForgeDirection face) {
|
||||
return this.essentia / 1000;
|
||||
return this.essentia / ESSENTIA_PER_ASPECT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -78,6 +78,45 @@ import thaumcraft.common.tiles.TilePedestal;
|
||||
|
||||
public class TileVat extends TileThaumcraft implements IAspectContainer, IEssentiaTransport, ISidedInventory {
|
||||
|
||||
// Timers and progress values (in ticks)
|
||||
private static final int CLONE_PROGRESS = 800;
|
||||
private static final int COUNT_DELAY = 10;
|
||||
private static final int HEAL_ASPECT_COOLDOWN = 40;
|
||||
private static final int LIFE_ASPECT_COOLDOWN = 50;
|
||||
private static final int EFFIGY_PROGRESS = 80;
|
||||
private static final int BLOOD_SAMPLE_INITIAL_PROGRESS = 40;
|
||||
private static final int INFUSER_SOUND_INTERVAL = 65;
|
||||
private static final int CRAFTCOUNT_WIND_DOWN_MAX = 50;
|
||||
private static final int INSTABILITY_EFFECT_CHANCE = 200;
|
||||
private static final int INSTABILITY_CRAFT_CHANCE = 500;
|
||||
private static final int INSTABILITY_INCREASE_CHANCE_BASE = 100;
|
||||
private static final int MAX_INSTABILITY = 25;
|
||||
|
||||
// Healing amounts
|
||||
private static final float STRONG_HEAL_AMOUNT = 8.0f;
|
||||
private static final float WEAK_HEAL_AMOUNT = 4.0f;
|
||||
|
||||
// Essentia costs
|
||||
private static final int EFFIGY_ESSENTIA_AMOUNT = 8;
|
||||
private static final int BLOOD_SAMPLE_LIFE_COST = 4;
|
||||
private static final int VIS_DRAIN_AMOUNT = 100;
|
||||
|
||||
// Instability damage divisor
|
||||
private static final float INSTABILITY_DAMAGE_DIVISOR = 10.0f;
|
||||
|
||||
// Pedestal search radius
|
||||
private static final int PEDESTAL_SEARCH_HORIZONTAL = 12;
|
||||
private static final int PEDESTAL_SEARCH_Y_DOWN = 5;
|
||||
private static final int PEDESTAL_SEARCH_Y_UP = 10;
|
||||
private static final int PEDESTAL_SYMMETRY_RANGE = 8;
|
||||
|
||||
// Self-infusion slots
|
||||
private static final int SELF_INFUSION_SLOTS = 12;
|
||||
private static final float SELF_INFUSION_INITIAL_HEALTH = 20.0f;
|
||||
|
||||
// Particle count for infuser effects
|
||||
private static final int INFUSER_PARTICLE_COUNT = 25;
|
||||
|
||||
public int mode;
|
||||
AspectList myEssentia;
|
||||
AspectList essentiaDemanded;
|
||||
@@ -86,7 +125,6 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
public ItemStack nutrients;
|
||||
public int progress;
|
||||
private EntityLivingBase entityContained;
|
||||
public final int CLONE_TIME = 800;
|
||||
public int[] selfInfusions;
|
||||
public float selfInfusionHealth;
|
||||
private final ArrayList<ChunkCoordinates> pedestals;
|
||||
@@ -105,7 +143,6 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
public int count;
|
||||
public int craftCount;
|
||||
public float startUp;
|
||||
private final int countDelay;
|
||||
ArrayList<ItemStack> ingredients;
|
||||
public HashMap<String, SourceFX> sourceFX;
|
||||
private NBTTagCompound entityNBTObj = null;
|
||||
@@ -119,8 +156,8 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
this.sample = null;
|
||||
this.nutrients = null;
|
||||
this.entityContained = null;
|
||||
this.selfInfusions = new int[12];
|
||||
this.selfInfusionHealth = 20.0f;
|
||||
this.selfInfusions = new int[SELF_INFUSION_SLOTS];
|
||||
this.selfInfusionHealth = SELF_INFUSION_INITIAL_HEALTH;
|
||||
this.pedestals = new ArrayList<>();
|
||||
this.dangerCount = 0;
|
||||
this.checkSurroundings = true;
|
||||
@@ -136,7 +173,6 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
this.itemCount = 0;
|
||||
this.count = 0;
|
||||
this.craftCount = 0;
|
||||
this.countDelay = 10;
|
||||
this.ingredients = new ArrayList<>();
|
||||
this.sourceFX = new HashMap<>();
|
||||
}
|
||||
@@ -196,7 +232,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
this.mode = 0;
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.selfInfusions = new int[12];
|
||||
this.selfInfusions = new int[SELF_INFUSION_SLOTS];
|
||||
--possibleJar.stackSize;
|
||||
}
|
||||
} else {
|
||||
@@ -273,22 +309,22 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
if (this.getEntityContained().getHealth() < this.getEntityContained().getMaxHealth()) {
|
||||
if (this.getEntityContained().getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) {
|
||||
if (this.myEssentia.getAmount(Aspect.HEAL) > 0 && this.progress <= 0) {
|
||||
this.getEntityContained().heal(8.0f);
|
||||
this.getEntityContained().heal(STRONG_HEAL_AMOUNT);
|
||||
this.myEssentia.remove(Aspect.HEAL, 1);
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.progress += 40;
|
||||
this.progress += HEAL_ASPECT_COOLDOWN;
|
||||
}
|
||||
if (this.getEntityContained().getHealth() < this.getEntityContained().getMaxHealth()
|
||||
&& this.essentiaDemanded.getAmount(Aspect.HEAL) < 1) {
|
||||
this.essentiaDemanded.add(Aspect.HEAL, 1);
|
||||
}
|
||||
if (this.myEssentia.getAmount(Aspect.LIFE) > 0 && this.progress <= 0) {
|
||||
this.getEntityContained().heal(4.0f);
|
||||
this.getEntityContained().heal(WEAK_HEAL_AMOUNT);
|
||||
this.myEssentia.remove(Aspect.LIFE, 1);
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.progress += 50;
|
||||
this.progress += LIFE_ASPECT_COOLDOWN;
|
||||
}
|
||||
if (this.getEntityContained().getHealth() < this.getEntityContained().getMaxHealth()
|
||||
&& this.essentiaDemanded.getAmount(Aspect.LIFE) < 1) {
|
||||
@@ -296,22 +332,22 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
}
|
||||
} else {
|
||||
if (this.myEssentia.getAmount(Aspect.UNDEAD) > 0 && this.progress <= 0) {
|
||||
this.getEntityContained().heal(8.0f);
|
||||
this.getEntityContained().heal(STRONG_HEAL_AMOUNT);
|
||||
this.myEssentia.remove(Aspect.UNDEAD, 1);
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.progress += 40;
|
||||
this.progress += HEAL_ASPECT_COOLDOWN;
|
||||
}
|
||||
if (this.getEntityContained().getHealth() < this.getEntityContained().getMaxHealth()
|
||||
&& this.essentiaDemanded.getAmount(Aspect.UNDEAD) < 1) {
|
||||
this.essentiaDemanded.add(Aspect.UNDEAD, 1);
|
||||
}
|
||||
if (this.myEssentia.getAmount(Aspect.DEATH) > 0 && this.progress <= 0) {
|
||||
this.getEntityContained().heal(4.0f);
|
||||
this.getEntityContained().heal(WEAK_HEAL_AMOUNT);
|
||||
this.myEssentia.remove(Aspect.DEATH, 1);
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.progress += 50;
|
||||
this.progress += LIFE_ASPECT_COOLDOWN;
|
||||
}
|
||||
if (this.getEntityContained().getHealth() < this.getEntityContained().getMaxHealth()
|
||||
&& this.essentiaDemanded.getAmount(Aspect.DEATH) < 1) {
|
||||
@@ -355,13 +391,14 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
}
|
||||
} else if (this.sample != null && this.sample.getItem() == ThaumicHorizons.itemCorpseEffigy) {
|
||||
this.mode = 3;
|
||||
this.essentiaDemanded = new AspectList().add(Aspect.LIFE, 8).add(Aspect.HEAL, 8);
|
||||
this.progress = 80;
|
||||
this.essentiaDemanded = new AspectList().add(Aspect.LIFE, EFFIGY_ESSENTIA_AMOUNT)
|
||||
.add(Aspect.HEAL, EFFIGY_ESSENTIA_AMOUNT);
|
||||
this.progress = EFFIGY_PROGRESS;
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
} else if (this.sample != null && this.nutrients != null) {
|
||||
this.mode = 1;
|
||||
this.essentiaDemanded = new AspectList().add(Aspect.LIFE, 4);
|
||||
this.essentiaDemanded = new AspectList().add(Aspect.LIFE, BLOOD_SAMPLE_LIFE_COST);
|
||||
if (this.sample.getItem() == ThaumicHorizons.itemSyringeBloodSample && this.sample.hasTagCompound()
|
||||
&& this.sample.stackTagCompound.getCompoundTag("critter") != null
|
||||
&& this.sample.stackTagCompound.getCompoundTag("critter").getCompoundTag("ForgeData") != null) {
|
||||
@@ -378,7 +415,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
}
|
||||
}
|
||||
}
|
||||
this.progress = 40;
|
||||
this.progress = BLOOD_SAMPLE_INITIAL_PROGRESS;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
}
|
||||
@@ -415,7 +452,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
if (this.nutrients.stackSize <= 0) {
|
||||
this.nutrients = null;
|
||||
}
|
||||
this.progress = 800;
|
||||
this.progress = CLONE_PROGRESS;
|
||||
this.essentiaDemanded = new AspectList();
|
||||
this.myEssentia = new AspectList();
|
||||
if (this.getEntityContained() == null) {
|
||||
@@ -437,7 +474,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
if (this.checkSurroundings) {
|
||||
this.checkSurroundings = false;
|
||||
this.getSurroundings();
|
||||
} else if (this.count % this.countDelay == 0) {
|
||||
} else if (this.count % COUNT_DELAY == 0) {
|
||||
this.craftCycle();
|
||||
this.markDirty();
|
||||
}
|
||||
@@ -463,7 +500,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
Thaumcraft.proxy.blockSparkle(this.worldObj, this.xCoord, this.yCoord - 2, this.zCoord, 16720418, 20);
|
||||
Thaumcraft.proxy.blockSparkle(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord, 16720418, 20);
|
||||
this.mode = 4;
|
||||
this.selfInfusionHealth = 20.0f;
|
||||
this.selfInfusionHealth = SELF_INFUSION_INITIAL_HEALTH;
|
||||
this.sample = null;
|
||||
this.essentiaDemanded = new AspectList();
|
||||
this.myEssentia = new AspectList();
|
||||
@@ -673,78 +710,75 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
private void getSurroundings() {
|
||||
final ArrayList<ChunkCoordinates> stuff = new ArrayList<>();
|
||||
this.pedestals.clear();
|
||||
try {
|
||||
for (int xx = -12; xx <= 12; ++xx) {
|
||||
for (int zz = -12; zz <= 12; ++zz) {
|
||||
boolean skip = false;
|
||||
for (int yy = -5; yy <= 10; ++yy) {
|
||||
if (xx != 0 || zz != 0) {
|
||||
final int x = this.xCoord + xx;
|
||||
final int y = this.yCoord - yy;
|
||||
final int z = this.zCoord + zz;
|
||||
final TileEntity te = this.worldObj.getTileEntity(x, y, z);
|
||||
if (!skip && yy > 0
|
||||
&& Math.abs(xx) <= 8
|
||||
&& Math.abs(zz) <= 8
|
||||
&& te instanceof TilePedestal) {
|
||||
this.pedestals.add(new ChunkCoordinates(x, y, z));
|
||||
skip = true;
|
||||
} else {
|
||||
final Block bi = this.worldObj.getBlock(x, y, z);
|
||||
if (bi == Blocks.skull
|
||||
|| (bi instanceof IInfusionStabiliser && ((IInfusionStabiliser) bi)
|
||||
.canStabaliseInfusion(this.getWorldObj(), x, y, z))) {
|
||||
stuff.add(new ChunkCoordinates(x, y, z));
|
||||
}
|
||||
for (int xx = -PEDESTAL_SEARCH_HORIZONTAL; xx <= PEDESTAL_SEARCH_HORIZONTAL; ++xx) {
|
||||
for (int zz = -PEDESTAL_SEARCH_HORIZONTAL; zz <= PEDESTAL_SEARCH_HORIZONTAL; ++zz) {
|
||||
boolean skip = false;
|
||||
for (int yy = -PEDESTAL_SEARCH_Y_DOWN; yy <= PEDESTAL_SEARCH_Y_UP; ++yy) {
|
||||
if (xx != 0 || zz != 0) {
|
||||
final int x = this.xCoord + xx;
|
||||
final int y = this.yCoord - yy;
|
||||
final int z = this.zCoord + zz;
|
||||
final TileEntity te = this.worldObj.getTileEntity(x, y, z);
|
||||
if (!skip && yy > 0
|
||||
&& Math.abs(xx) <= PEDESTAL_SYMMETRY_RANGE
|
||||
&& Math.abs(zz) <= PEDESTAL_SYMMETRY_RANGE
|
||||
&& te instanceof TilePedestal) {
|
||||
this.pedestals.add(new ChunkCoordinates(x, y, z));
|
||||
skip = true;
|
||||
} else {
|
||||
final Block bi = this.worldObj.getBlock(x, y, z);
|
||||
if (bi == Blocks.skull || (bi instanceof IInfusionStabiliser
|
||||
&& ((IInfusionStabiliser) bi).canStabaliseInfusion(this.getWorldObj(), x, y, z))) {
|
||||
stuff.add(new ChunkCoordinates(x, y, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.symmetry = 0;
|
||||
for (final ChunkCoordinates cc : this.pedestals) {
|
||||
boolean items = false;
|
||||
final int x2 = this.xCoord - cc.posX;
|
||||
final int z2 = this.zCoord - cc.posZ;
|
||||
TileEntity te2 = this.worldObj.getTileEntity(cc.posX, cc.posY, cc.posZ);
|
||||
if (te2 instanceof TilePedestal) {
|
||||
this.symmetry += 2;
|
||||
if (((TilePedestal) te2).getStackInSlot(0) != null) {
|
||||
++this.symmetry;
|
||||
items = true;
|
||||
}
|
||||
}
|
||||
final int xx2 = this.xCoord + x2;
|
||||
final int zz2 = this.zCoord + z2;
|
||||
te2 = this.worldObj.getTileEntity(xx2, cc.posY, zz2);
|
||||
if (te2 instanceof TilePedestal) {
|
||||
this.symmetry -= 2;
|
||||
if (((TilePedestal) te2).getStackInSlot(0) == null || !items) {
|
||||
continue;
|
||||
}
|
||||
--this.symmetry;
|
||||
}
|
||||
this.symmetry = 0;
|
||||
for (final ChunkCoordinates cc : this.pedestals) {
|
||||
boolean items = false;
|
||||
final int x2 = this.xCoord - cc.posX;
|
||||
final int z2 = this.zCoord - cc.posZ;
|
||||
TileEntity te2 = this.worldObj.getTileEntity(cc.posX, cc.posY, cc.posZ);
|
||||
if (te2 instanceof TilePedestal) {
|
||||
this.symmetry += 2;
|
||||
if (((TilePedestal) te2).getStackInSlot(0) != null) {
|
||||
++this.symmetry;
|
||||
items = true;
|
||||
}
|
||||
}
|
||||
float sym = 0.0f;
|
||||
for (final ChunkCoordinates cc2 : stuff) {
|
||||
final boolean items2 = false;
|
||||
final int x = this.xCoord - cc2.posX;
|
||||
final int z3 = this.zCoord - cc2.posZ;
|
||||
Block bi2 = this.worldObj.getBlock(cc2.posX, cc2.posY, cc2.posZ);
|
||||
if (bi2 == Blocks.skull || (bi2 instanceof IInfusionStabiliser && ((IInfusionStabiliser) bi2)
|
||||
.canStabaliseInfusion(this.getWorldObj(), cc2.posX, cc2.posY, cc2.posZ))) {
|
||||
sym += 0.1f;
|
||||
}
|
||||
final int xx3 = this.xCoord + x;
|
||||
final int zz3 = this.zCoord + z3;
|
||||
bi2 = this.worldObj.getBlock(xx3, cc2.posY, zz3);
|
||||
if (bi2 == Blocks.skull || (bi2 instanceof IInfusionStabiliser && ((IInfusionStabiliser) bi2)
|
||||
.canStabaliseInfusion(this.getWorldObj(), cc2.posX, cc2.posY, cc2.posZ))) {
|
||||
sym -= 0.2f;
|
||||
final int xx2 = this.xCoord + x2;
|
||||
final int zz2 = this.zCoord + z2;
|
||||
te2 = this.worldObj.getTileEntity(xx2, cc.posY, zz2);
|
||||
if (te2 instanceof TilePedestal) {
|
||||
this.symmetry -= 2;
|
||||
if (((TilePedestal) te2).getStackInSlot(0) == null || !items) {
|
||||
continue;
|
||||
}
|
||||
--this.symmetry;
|
||||
}
|
||||
this.symmetry += (int) sym;
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
float sym = 0.0f;
|
||||
for (final ChunkCoordinates cc2 : stuff) {
|
||||
final boolean items2 = false;
|
||||
final int x = this.xCoord - cc2.posX;
|
||||
final int z3 = this.zCoord - cc2.posZ;
|
||||
Block bi2 = this.worldObj.getBlock(cc2.posX, cc2.posY, cc2.posZ);
|
||||
if (bi2 == Blocks.skull || (bi2 instanceof IInfusionStabiliser && ((IInfusionStabiliser) bi2)
|
||||
.canStabaliseInfusion(this.getWorldObj(), cc2.posX, cc2.posY, cc2.posZ))) {
|
||||
sym += 0.1f;
|
||||
}
|
||||
final int xx3 = this.xCoord + x;
|
||||
final int zz3 = this.zCoord + z3;
|
||||
bi2 = this.worldObj.getBlock(xx3, cc2.posY, zz3);
|
||||
if (bi2 == Blocks.skull || (bi2 instanceof IInfusionStabiliser && ((IInfusionStabiliser) bi2)
|
||||
.canStabaliseInfusion(this.getWorldObj(), cc2.posX, cc2.posY, cc2.posZ))) {
|
||||
sym -= 0.2f;
|
||||
}
|
||||
}
|
||||
this.symmetry += (int) sym;
|
||||
}
|
||||
|
||||
private void doEffects() {
|
||||
@@ -752,7 +786,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
if (this.craftCount == 0) {
|
||||
this.worldObj
|
||||
.playSound(this.xCoord, this.yCoord, this.zCoord, "thaumcraft:infuserstart", 0.5f, 1.0f, false);
|
||||
} else if (this.craftCount % 65 == 0) {
|
||||
} else if (this.craftCount % INFUSER_SOUND_INTERVAL == 0) {
|
||||
this.worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, "thaumcraft:infuser", 0.5f, 1.0f, false);
|
||||
}
|
||||
++this.craftCount;
|
||||
@@ -764,15 +798,15 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
0.5f + this.worldObj.rand.nextFloat() * 0.2f,
|
||||
0.1f,
|
||||
0.7f + this.worldObj.rand.nextFloat() * 0.3f,
|
||||
25,
|
||||
INFUSER_PARTICLE_COUNT,
|
||||
-0.03f);
|
||||
} else if (this.craftCount > 0) {
|
||||
this.craftCount -= 2;
|
||||
if (this.craftCount < 0) {
|
||||
this.craftCount = 0;
|
||||
}
|
||||
if (this.craftCount > 50) {
|
||||
this.craftCount = 50;
|
||||
if (this.craftCount > CRAFTCOUNT_WIND_DOWN_MAX) {
|
||||
this.craftCount = CRAFTCOUNT_WIND_DOWN_MAX;
|
||||
}
|
||||
}
|
||||
if (this.mode == 2 && this.startUp != 1.0f) {
|
||||
@@ -858,7 +892,8 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
this.sourceFX.put(fxk, fx);
|
||||
}
|
||||
}
|
||||
if (this.mode == 2 && this.instability > 0 && this.worldObj.rand.nextInt(200) <= this.instability) {
|
||||
if (this.mode == 2 && this.instability > 0
|
||||
&& this.worldObj.rand.nextInt(INSTABILITY_EFFECT_CHANCE) <= this.instability) {
|
||||
Thaumcraft.proxy.nodeBolt(
|
||||
this.worldObj,
|
||||
this.xCoord + 0.5f,
|
||||
@@ -871,7 +906,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
}
|
||||
|
||||
public void craftCycle() {
|
||||
if (this.instability > 0 && this.worldObj.rand.nextInt(500) <= this.instability) {
|
||||
if (this.instability > 0 && this.worldObj.rand.nextInt(INSTABILITY_CRAFT_CHANCE) <= this.instability) {
|
||||
switch (this.worldObj.rand.nextInt(21)) {
|
||||
case 0, 2, 10, 13 -> {
|
||||
this.inEvEjectItem(0);
|
||||
@@ -920,24 +955,40 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
if (this.instability > 0 && this.entityContained != null) {
|
||||
float visDrawn = 999.0f;
|
||||
if (!this.worldObj.isRemote) {
|
||||
float temp = VisNetHandler
|
||||
.drainVis(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, Aspect.EARTH, 100);
|
||||
float temp = VisNetHandler.drainVis(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord + 1,
|
||||
this.zCoord,
|
||||
Aspect.EARTH,
|
||||
VIS_DRAIN_AMOUNT);
|
||||
if (temp < visDrawn) {
|
||||
visDrawn = temp;
|
||||
}
|
||||
temp = VisNetHandler
|
||||
.drainVis(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, Aspect.WATER, 100);
|
||||
temp = VisNetHandler.drainVis(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord + 1,
|
||||
this.zCoord,
|
||||
Aspect.WATER,
|
||||
VIS_DRAIN_AMOUNT);
|
||||
if (temp < visDrawn) {
|
||||
visDrawn = temp;
|
||||
}
|
||||
temp = VisNetHandler
|
||||
.drainVis(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, Aspect.ORDER, 100);
|
||||
temp = VisNetHandler.drainVis(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord + 1,
|
||||
this.zCoord,
|
||||
Aspect.ORDER,
|
||||
VIS_DRAIN_AMOUNT);
|
||||
if (temp < visDrawn) {
|
||||
visDrawn = temp;
|
||||
}
|
||||
}
|
||||
this.getEntityContained()
|
||||
.setHealth(this.getEntityContained().getHealth() - this.instability / 10.0f / (5.0f + visDrawn));
|
||||
this.getEntityContained().setHealth(
|
||||
this.getEntityContained().getHealth()
|
||||
- this.instability / INSTABILITY_DAMAGE_DIVISOR / (5.0f + visDrawn));
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
if (this.getEntityContained().getHealth() <= 0.0f) {
|
||||
this.killSubject();
|
||||
@@ -946,23 +997,38 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
} else if (this.instability > 0) {
|
||||
float visDrawn = 999.0f;
|
||||
if (!this.worldObj.isRemote) {
|
||||
float temp = VisNetHandler
|
||||
.drainVis(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, Aspect.EARTH, 100);
|
||||
float temp = VisNetHandler.drainVis(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord + 1,
|
||||
this.zCoord,
|
||||
Aspect.EARTH,
|
||||
VIS_DRAIN_AMOUNT);
|
||||
if (temp < visDrawn) {
|
||||
visDrawn = temp;
|
||||
}
|
||||
temp = VisNetHandler
|
||||
.drainVis(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, Aspect.WATER, 100);
|
||||
temp = VisNetHandler.drainVis(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord + 1,
|
||||
this.zCoord,
|
||||
Aspect.WATER,
|
||||
VIS_DRAIN_AMOUNT);
|
||||
if (temp < visDrawn) {
|
||||
visDrawn = temp;
|
||||
}
|
||||
temp = VisNetHandler
|
||||
.drainVis(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, Aspect.ORDER, 100);
|
||||
temp = VisNetHandler.drainVis(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord + 1,
|
||||
this.zCoord,
|
||||
Aspect.ORDER,
|
||||
VIS_DRAIN_AMOUNT);
|
||||
if (temp < visDrawn) {
|
||||
visDrawn = temp;
|
||||
}
|
||||
}
|
||||
this.selfInfusionHealth -= this.instability / 10.0f / (5.0f + visDrawn);
|
||||
this.selfInfusionHealth -= this.instability / INSTABILITY_DAMAGE_DIVISOR / (5.0f + visDrawn);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
if (this.selfInfusionHealth <= 0.0f) {
|
||||
this.killSubject();
|
||||
@@ -982,11 +1048,12 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
this.markDirty();
|
||||
return;
|
||||
}
|
||||
if (this.worldObj.rand.nextInt(100 - this.recipeInstability * 3) == 0) {
|
||||
if (this.worldObj.rand.nextInt(INSTABILITY_INCREASE_CHANCE_BASE - this.recipeInstability * 3)
|
||||
== 0) {
|
||||
++this.instability;
|
||||
}
|
||||
if (this.instability > 25) {
|
||||
this.instability = 25;
|
||||
if (this.instability > MAX_INSTABILITY) {
|
||||
this.instability = MAX_INSTABILITY;
|
||||
}
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
@@ -1354,7 +1421,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
this.nutrients = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("nutrients"));
|
||||
this.selfInfusions = nbttagcompound.getIntArray("selfInfusions");
|
||||
if (this.selfInfusions.length == 0) {
|
||||
this.selfInfusions = new int[12];
|
||||
this.selfInfusions = new int[SELF_INFUSION_SLOTS];
|
||||
}
|
||||
this.selfInfusionHealth = nbttagcompound.getFloat("selfInfusionHealth");
|
||||
}
|
||||
@@ -1515,7 +1582,7 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
|
||||
}
|
||||
}
|
||||
}
|
||||
this.selfInfusions = new int[12];
|
||||
this.selfInfusions = new int[SELF_INFUSION_SLOTS];
|
||||
this.setEntityContained(null);
|
||||
this.mode = 0;
|
||||
this.currentlySucking = null;
|
||||
|
||||
@@ -18,6 +18,8 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -31,7 +33,6 @@ import net.minecraftforge.common.DimensionManager;
|
||||
import com.kentington.thaumichorizons.common.ThaumicHorizons;
|
||||
import com.kentington.thaumichorizons.common.entities.EntityGolemTH;
|
||||
import com.kentington.thaumichorizons.common.lib.PocketPlaneData;
|
||||
import com.kentington.thaumichorizons.common.lib.PocketPlaneThread;
|
||||
import com.kentington.thaumichorizons.common.lib.VortexTeleporter;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
@@ -49,7 +50,7 @@ import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class TileVortex extends TileThaumcraft implements IWandable, IAspectContainer {
|
||||
|
||||
final int MAX_COUNT = 2400;
|
||||
private static final int MAX_COUNT = 2400;
|
||||
public int count;
|
||||
public int beams;
|
||||
public int dimensionID;
|
||||
@@ -58,139 +59,122 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
boolean ateDevices;
|
||||
public boolean collapsing;
|
||||
public boolean createdDimension;
|
||||
public boolean generating;
|
||||
public boolean cheat;
|
||||
public ArrayList<ItemStack> items;
|
||||
Thread ppThread;
|
||||
private boolean soundStarted = false;
|
||||
// true once the first S35 description packet has been received on the client
|
||||
public boolean clientSynced = false;
|
||||
private int lastSyncedBeams = -1;
|
||||
|
||||
public TileVortex() {
|
||||
this.aspects = new AspectList();
|
||||
this.ateDevices = false;
|
||||
this.collapsing = false;
|
||||
this.createdDimension = false;
|
||||
this.generating = false;
|
||||
this.cheat = false;
|
||||
this.items = new ArrayList<ItemStack>();
|
||||
this.ppThread = null;
|
||||
this.items = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
// Send one packet per tick when beams changes, so same-tick re/deHungrify
|
||||
// pairs don't produce two packets with an intermediate wrong value.
|
||||
if (!this.worldObj.isRemote && this.beams != this.lastSyncedBeams) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.lastSyncedBeams = this.beams;
|
||||
}
|
||||
|
||||
if (this.worldObj != null && this.worldObj.isRemote && !soundStarted) {
|
||||
ThaumicHorizons.proxy.playVortexSound(this);
|
||||
soundStarted = true;
|
||||
}
|
||||
|
||||
if (this.generating) {
|
||||
this.worldObj.createExplosion(
|
||||
null,
|
||||
this.xCoord + this.worldObj.rand.nextFloat(),
|
||||
this.yCoord + this.worldObj.rand.nextFloat(),
|
||||
this.zCoord + this.worldObj.rand.nextFloat(),
|
||||
1.0f,
|
||||
false);
|
||||
if (this.ppThread == null) {
|
||||
this.createDimension(null);
|
||||
return;
|
||||
}
|
||||
if (!this.ppThread.isAlive()) {
|
||||
this.generating = false;
|
||||
this.createdDimension = true;
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
} else {
|
||||
if (this.collapsing) {
|
||||
++this.count;
|
||||
if (this.count > 25) {
|
||||
if (this.createdDimension) {
|
||||
WorldServer wsd = DimensionManager.getWorld(ThaumicHorizons.dimensionPocketId);
|
||||
if (wsd != null) {
|
||||
wsd.setBlockToAir(0, 129, this.dimensionID * 256);
|
||||
}
|
||||
if (this.collapsing) {
|
||||
++this.count;
|
||||
if (this.count > 25) {
|
||||
if (this.createdDimension) {
|
||||
WorldServer wsd = DimensionManager.getWorld(ThaumicHorizons.dimensionPocketId);
|
||||
if (wsd != null) {
|
||||
wsd.setBlockToAir(0, 129, this.dimensionID * 256);
|
||||
}
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
if (worldObj.isRemote)
|
||||
Thaumcraft.proxy.burst(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 4.0f);
|
||||
BlockAiry.explodify(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
return;
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
if (worldObj.isRemote)
|
||||
Thaumcraft.proxy.burst(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 4.0f);
|
||||
BlockAiry.explodify(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
if (this.count < 50) {
|
||||
++this.count;
|
||||
} else {
|
||||
if (!this.ateDevices) {
|
||||
if (!this.cheat && this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
|
||||
for (int dx = -2; dx <= 2; ++dx) {
|
||||
for (int dy = -2; dy <= 2; ++dy) {
|
||||
for (int dz = -2; dz <= 2; ++dz) {
|
||||
if (dx != 0 || dy != 0 || dz != 0) {
|
||||
this.worldObj
|
||||
.setBlockToAir(this.xCoord + dx, this.yCoord + dy, this.zCoord + dz);
|
||||
if (worldObj.isRemote) Thaumcraft.proxy.burst(
|
||||
this.worldObj,
|
||||
this.xCoord + dx,
|
||||
this.yCoord + dy,
|
||||
this.zCoord + dz,
|
||||
4.0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.count < 50) {
|
||||
++this.count;
|
||||
} else {
|
||||
if (!this.ateDevices) {
|
||||
if (!this.cheat && this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
|
||||
for (int dx = -2; dx <= 2; ++dx) {
|
||||
for (int dy = -2; dy <= 2; ++dy) {
|
||||
for (int dz = -2; dz <= 2; ++dz) {
|
||||
if (dx != 0 || dy != 0 || dz != 0) {
|
||||
this.worldObj.setBlockToAir(this.xCoord + dx, this.yCoord + dy, this.zCoord + dz);
|
||||
if (worldObj.isRemote) Thaumcraft.proxy.burst(
|
||||
this.worldObj,
|
||||
this.xCoord + dx,
|
||||
this.yCoord + dy,
|
||||
this.zCoord + dz,
|
||||
4.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.ateDevices = true;
|
||||
}
|
||||
if (this.beams < 6 && !this.cheat
|
||||
&& this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
|
||||
this.handleHungryNode();
|
||||
} else if (!this.createdDimension && !this.generating) {
|
||||
this.handlePocketPlaneStuff();
|
||||
}
|
||||
if (!this.cheat) {
|
||||
this.count += 6 - this.beams;
|
||||
}
|
||||
if (this.count > MAX_COUNT && !this.cheat
|
||||
&& this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
|
||||
this.collapsing = true;
|
||||
this.count = 0;
|
||||
}
|
||||
if (this.createdDimension) {
|
||||
final List ents = this.worldObj.getEntitiesWithinAABB(
|
||||
EntityPlayerMP.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
this.xCoord + 1,
|
||||
this.yCoord + 1,
|
||||
this.zCoord + 1));
|
||||
if (ents.size() > 0) {
|
||||
for (final Object e : ents) {
|
||||
final EntityPlayerMP player = (EntityPlayerMP) e;
|
||||
if (player.ridingEntity == null && player.riddenByEntity == null) {
|
||||
final MinecraftServer mServer = FMLCommonHandler.instance()
|
||||
.getMinecraftServerInstance();
|
||||
if (player.timeUntilPortal > 0) {
|
||||
player.timeUntilPortal = 10;
|
||||
} else if (player.dimension != ThaumicHorizons.dimensionPocketId) {
|
||||
player.timeUntilPortal = 10;
|
||||
player.mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
player,
|
||||
ThaumicHorizons.dimensionPocketId,
|
||||
new VortexTeleporter(
|
||||
mServer.worldServerForDimension(ThaumicHorizons.dimensionPocketId),
|
||||
this.dimensionID));
|
||||
} else {
|
||||
player.timeUntilPortal = 10;
|
||||
player.mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
player,
|
||||
this.returnID,
|
||||
new VortexTeleporter(
|
||||
mServer.worldServerForDimension(this.returnID),
|
||||
this.dimensionID));
|
||||
}
|
||||
this.ateDevices = true;
|
||||
}
|
||||
if (this.beams < 6 && !this.cheat
|
||||
&& this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
|
||||
this.handleHungryNode();
|
||||
} else if (!this.createdDimension) {
|
||||
this.handlePocketPlaneStuff();
|
||||
}
|
||||
if (!this.cheat) {
|
||||
this.count += Math.max(0, 6 - this.beams);
|
||||
}
|
||||
if (this.count > MAX_COUNT && !this.cheat
|
||||
&& this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
|
||||
this.collapsing = true;
|
||||
this.count = 0;
|
||||
}
|
||||
if (this.createdDimension) {
|
||||
final List<EntityPlayerMP> ents = this.worldObj.getEntitiesWithinAABB(
|
||||
EntityPlayerMP.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
this.xCoord + 1,
|
||||
this.yCoord + 1,
|
||||
this.zCoord + 1));
|
||||
if (!ents.isEmpty()) {
|
||||
for (final EntityPlayerMP player : ents) {
|
||||
if (player.ridingEntity == null && player.riddenByEntity == null) {
|
||||
final MinecraftServer mServer = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if (player.timeUntilPortal > 0) {
|
||||
player.timeUntilPortal = 10;
|
||||
} else if (player.dimension != ThaumicHorizons.dimensionPocketId) {
|
||||
player.timeUntilPortal = 200;
|
||||
player.mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
player,
|
||||
ThaumicHorizons.dimensionPocketId,
|
||||
new VortexTeleporter(
|
||||
mServer.worldServerForDimension(ThaumicHorizons.dimensionPocketId),
|
||||
this.dimensionID));
|
||||
} else {
|
||||
player.timeUntilPortal = 200;
|
||||
player.mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
player,
|
||||
this.returnID,
|
||||
new VortexTeleporter(
|
||||
mServer.worldServerForDimension(this.returnID),
|
||||
this.dimensionID));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,7 +184,7 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
}
|
||||
|
||||
void handlePocketPlaneStuff() {
|
||||
final List ents = this.worldObj.getEntitiesWithinAABB(
|
||||
final List<Entity> ents = this.worldObj.getEntitiesWithinAABB(
|
||||
Entity.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
this.xCoord,
|
||||
@@ -209,12 +193,18 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
this.xCoord + 1,
|
||||
this.yCoord + 1,
|
||||
this.zCoord + 1).expand(1.0, 1.0, 1.0));
|
||||
if (ents != null && ents.size() > 0) {
|
||||
for (final Object ent : ents) {
|
||||
final Entity eo = (Entity) ent;
|
||||
if (ents != null && !ents.isEmpty()) {
|
||||
for (final Entity eo : ents) {
|
||||
if (eo instanceof final EntityItem item) {
|
||||
if (ThaumicHorizons.enablePocket && item.getEntityItem().getItem() == ConfigItems.itemEldritchObject
|
||||
&& item.getEntityItem().getItemDamage() == 3) {
|
||||
this.worldObj.createExplosion(
|
||||
null,
|
||||
this.xCoord + this.worldObj.rand.nextFloat(),
|
||||
this.yCoord + this.worldObj.rand.nextFloat(),
|
||||
this.zCoord + this.worldObj.rand.nextFloat(),
|
||||
1.0f,
|
||||
false);
|
||||
this.createDimension(item);
|
||||
item.setDead();
|
||||
} else {
|
||||
@@ -238,14 +228,15 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
} else
|
||||
if (item.getEntityItem().getItem() == ThaumicHorizons.itemCrystalWand) {
|
||||
final ItemStack theWand = new ItemStack(ThaumicHorizons.itemWandCastingDisposable);
|
||||
((ItemWandCasting) theWand.getItem()).setRod(theWand, ThaumicHorizons.ROD_CRYSTAL);
|
||||
((ItemWandCasting) theWand.getItem()).setCap(theWand, ThaumicHorizons.CAP_CRYSTAL);
|
||||
((ItemWandCasting) theWand.getItem()).storeVis(theWand, Aspect.EARTH, 25000);
|
||||
((ItemWandCasting) theWand.getItem()).storeVis(theWand, Aspect.AIR, 25000);
|
||||
((ItemWandCasting) theWand.getItem()).storeVis(theWand, Aspect.FIRE, 25000);
|
||||
((ItemWandCasting) theWand.getItem()).storeVis(theWand, Aspect.WATER, 25000);
|
||||
((ItemWandCasting) theWand.getItem()).storeVis(theWand, Aspect.ORDER, 25000);
|
||||
((ItemWandCasting) theWand.getItem()).storeVis(theWand, Aspect.ENTROPY, 25000);
|
||||
final ItemWandCasting wand = (ItemWandCasting) theWand.getItem();
|
||||
wand.setRod(theWand, ThaumicHorizons.ROD_CRYSTAL);
|
||||
wand.setCap(theWand, ThaumicHorizons.CAP_CRYSTAL);
|
||||
wand.storeVis(theWand, Aspect.EARTH, 25000);
|
||||
wand.storeVis(theWand, Aspect.AIR, 25000);
|
||||
wand.storeVis(theWand, Aspect.FIRE, 25000);
|
||||
wand.storeVis(theWand, Aspect.WATER, 25000);
|
||||
wand.storeVis(theWand, Aspect.ORDER, 25000);
|
||||
wand.storeVis(theWand, Aspect.ENTROPY, 25000);
|
||||
this.items.add(theWand);
|
||||
item.setDead();
|
||||
} else
|
||||
@@ -309,19 +300,19 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
if (DimensionManager.getWorld(ThaumicHorizons.dimensionPocketId) == null) {
|
||||
DimensionManager.initDimension(ThaumicHorizons.dimensionPocketId);
|
||||
}
|
||||
this.generating = true;
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.returnID = this.worldObj.provider.dimensionId;
|
||||
(this.ppThread = new Thread(
|
||||
new PocketPlaneThread(
|
||||
data,
|
||||
this.aspects,
|
||||
(World) MinecraftServer.getServer()
|
||||
.worldServerForDimension(ThaumicHorizons.dimensionPocketId),
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
this.returnID))).run();
|
||||
World world = server.worldServerForDimension(ThaumicHorizons.dimensionPocketId);
|
||||
PocketPlaneData.generatePocketPlane(
|
||||
this.aspects,
|
||||
data,
|
||||
world,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
this.returnID);
|
||||
this.createdDimension = true;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
this.markDirty();
|
||||
}
|
||||
@@ -375,24 +366,25 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
}
|
||||
}
|
||||
}
|
||||
final double var3 = (this.xCoord + 0.5 - eo.posX) / 15.0;
|
||||
final double var4 = (this.yCoord + 0.5 - eo.posY) / 15.0;
|
||||
final double var5 = (this.zCoord + 0.5 - eo.posZ) / 15.0;
|
||||
final double var6 = Math.sqrt(var3 * var3 + var4 * var4 + var5 * var5);
|
||||
double var7 = 1.0 - var6;
|
||||
final double dx = (this.xCoord + 0.5 - eo.posX) / 15.0;
|
||||
final double dy = (this.yCoord + 0.5 - eo.posY) / 15.0;
|
||||
final double dz = (this.zCoord + 0.5 - eo.posZ) / 15.0;
|
||||
final double dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
||||
double var7 = 1.0 - dist;
|
||||
final double modifier = 2.0 - this.beams / 3.0;
|
||||
if (var7 <= 0.0) {
|
||||
continue;
|
||||
}
|
||||
var7 *= var7;
|
||||
eo.motionX += var3 / var6 * var7 * 0.15 * modifier;
|
||||
eo.motionY += var4 / var6 * var7 * 0.25 * modifier;
|
||||
eo.motionZ += var5 / var6 * var7 * 0.15 * modifier;
|
||||
eo.motionX += dx / dist * var7 * 0.15 * modifier;
|
||||
eo.motionY += dy / dist * var7 * 0.25 * modifier;
|
||||
eo.motionZ += dz / dist * var7 * 0.15 * modifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
if (!this.worldObj.isRemote && (this.beams <= 0 || this.worldObj.rand.nextInt(this.beams) == 0)) {
|
||||
if (!this.worldObj.isRemote
|
||||
&& (this.beams <= 0 || this.worldObj.rand.nextInt(Math.max(1, this.beams)) == 0)) {
|
||||
int tx2 = this.xCoord + this.worldObj.rand.nextInt(16) - this.worldObj.rand.nextInt(16);
|
||||
int ty2 = this.yCoord + this.worldObj.rand.nextInt(16) - this.worldObj.rand.nextInt(16);
|
||||
int tz2 = this.zCoord + this.worldObj.rand.nextInt(16) - this.worldObj.rand.nextInt(16);
|
||||
@@ -437,7 +429,6 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
nbttagcompound.setBoolean("ateDevices", this.ateDevices);
|
||||
nbttagcompound.setBoolean("collapsing", this.collapsing);
|
||||
nbttagcompound.setBoolean("createdDimension", this.createdDimension);
|
||||
nbttagcompound.setBoolean("isGenerating", this.generating);
|
||||
nbttagcompound.setBoolean("cheat", this.cheat);
|
||||
final NBTTagList tlist = new NBTTagList();
|
||||
nbttagcompound.setTag("aspects", tlist);
|
||||
@@ -468,7 +459,6 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
this.ateDevices = nbttagcompound.getBoolean("ateDevices");
|
||||
this.collapsing = nbttagcompound.getBoolean("collapsing");
|
||||
this.createdDimension = nbttagcompound.getBoolean("createdDimension");
|
||||
this.generating = nbttagcompound.getBoolean("isGenerating");
|
||||
this.cheat = nbttagcompound.getBoolean("cheat");
|
||||
final AspectList al = new AspectList();
|
||||
final NBTTagList tlist = nbttagcompound.getTagList("aspects", 10);
|
||||
@@ -490,7 +480,7 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
@Override
|
||||
public int onWandRightClick(final World world, final ItemStack wandstack, final EntityPlayer player, final int x,
|
||||
final int y, final int z, final int side, final int md) {
|
||||
if (!this.worldObj.isRemote && this.items.size() > 0) {
|
||||
if (!this.worldObj.isRemote && !this.items.isEmpty()) {
|
||||
final ItemStack item = this.items.get(0);
|
||||
final EntityItem key = new EntityItem(this.worldObj);
|
||||
key.setEntityItemStack(item);
|
||||
@@ -579,6 +569,19 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public net.minecraft.network.Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeCustomNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
this.readCustomNBT(pkt.func_148857_g());
|
||||
this.clientSynced = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
+43
-22
@@ -39,7 +39,7 @@ public class TileVortexStabilizer extends TileThaumcraft implements IWandable {
|
||||
public boolean redstoned;
|
||||
public ForgeDirection dir;
|
||||
public Object theBeam;
|
||||
public Entity[] sonicFX;
|
||||
private Entity[] sonicFX;
|
||||
|
||||
public TileVortexStabilizer() {
|
||||
this.xTarget = Integer.MAX_VALUE;
|
||||
@@ -86,20 +86,20 @@ public class TileVortexStabilizer extends TileThaumcraft implements IWandable {
|
||||
if (this.hasTarget) {
|
||||
this.reHungrifyTarget();
|
||||
this.hasTarget = false;
|
||||
} else if (!this.hasTarget
|
||||
&& this.worldObj.getTileEntity(mop.blockX, mop.blockY, mop.blockZ) instanceof INode) {
|
||||
this.hasTarget = true;
|
||||
this.target = this.worldObj.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
||||
this.prevType = ((INode) this.worldObj
|
||||
.getTileEntity(mop.blockX, mop.blockY, mop.blockZ)).getNodeType().ordinal();
|
||||
this.deHungrifyTarget();
|
||||
} else
|
||||
if (!this.hasTarget && this.worldObj
|
||||
.getTileEntity(mop.blockX, mop.blockY, mop.blockZ) instanceof TileVortex) {
|
||||
this.hasTarget = true;
|
||||
this.target = this.worldObj.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
||||
this.deHungrifyTarget();
|
||||
}
|
||||
}
|
||||
// Separate if (not else if) so a new valid target is acquired in the same tick,
|
||||
// preventing a window where beams is decremented but not yet restored.
|
||||
final TileEntity newTE = this.worldObj.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
||||
if (newTE instanceof INode) {
|
||||
this.hasTarget = true;
|
||||
this.target = newTE;
|
||||
this.prevType = ((INode) newTE).getNodeType().ordinal();
|
||||
this.deHungrifyTarget();
|
||||
} else if (newTE instanceof TileVortex) {
|
||||
this.hasTarget = true;
|
||||
this.target = newTE;
|
||||
this.deHungrifyTarget();
|
||||
}
|
||||
this.xTarget = mop.blockX;
|
||||
this.yTarget = mop.blockY;
|
||||
this.zTarget = mop.blockZ;
|
||||
@@ -166,25 +166,46 @@ public class TileVortexStabilizer extends TileThaumcraft implements IWandable {
|
||||
|
||||
public void reHungrifyTarget() {
|
||||
if (this.target instanceof INode) {
|
||||
((INode) this.target).setNodeType(NodeType.values()[this.prevType]);
|
||||
} else if (this.target instanceof final TileVortex tileVortex) {
|
||||
--tileVortex.beams;
|
||||
if (!isNodeTargetedByOtherStabilizer()) {
|
||||
((INode) this.target).setNodeType(NodeType.values()[this.prevType]);
|
||||
}
|
||||
} else if (this.target instanceof TileVortex) {
|
||||
--((TileVortex) this.target).beams;
|
||||
}
|
||||
if (this.target != null) {
|
||||
this.target.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.target.xCoord, this.target.yCoord, this.target.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isNodeTargetedByOtherStabilizer() {
|
||||
// A stabilizer can only reach a node from up to 10 blocks away in one of 6 directions,
|
||||
// so check those 60 positions instead of scanning all loaded tile entities.
|
||||
int tx = this.target.xCoord;
|
||||
int ty = this.target.yCoord;
|
||||
int tz = this.target.zCoord;
|
||||
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) {
|
||||
for (int dist = 1; dist <= 10; dist++) {
|
||||
TileEntity te = this.worldObj
|
||||
.getTileEntity(tx - d.offsetX * dist, ty - d.offsetY * dist, tz - d.offsetZ * dist);
|
||||
if (te instanceof TileVortexStabilizer && te != this) {
|
||||
TileVortexStabilizer other = (TileVortexStabilizer) te;
|
||||
if (other.hasTarget && other.target == this.target) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void deHungrifyTarget() {
|
||||
if (this.target instanceof INode) {
|
||||
((INode) this.target).setNodeType(NodeType.NORMAL);
|
||||
} else if (this.target instanceof final TileVortex tileVortex) {
|
||||
++tileVortex.beams;
|
||||
} else if (this.target instanceof TileVortex) {
|
||||
++((TileVortex) this.target).beams;
|
||||
}
|
||||
if (this.target != null) {
|
||||
this.target.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.target.xCoord, this.target.yCoord, this.target.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user