Compare commits

..
25 changed files with 445 additions and 561 deletions

No files matched your search

+1
View File
@@ -27,6 +27,7 @@ whitelist.json
*.iws
src/main/resources/mixins.*.json
*.bat
*.sh
*.DS_Store
!gradlew.bat
layout.json
+3 -3
View File
@@ -1,10 +1,10 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-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.548:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.54.168:dev') {transitive = false}
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.0:dev')
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.5:dev')
}
+5
View File
@@ -186,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],
+10 -10
View File
@@ -1,12 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
toolchainVendor=ADOPTIUM
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
Binary file not shown.
+3 -1
View File
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-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
Vendored
+3 -3
View File
@@ -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/b631911858264c0b6e4d6603d677ff5218766cee/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/.
Vendored
+12 -23
View File
@@ -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,29 +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
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
@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 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.31'
}
@@ -3243,7 +3243,7 @@ public class ThaumicHorizons {
critterRecipes.add(
new CreatureInfusionRecipe(
"cowInfusion",
EntityList.getEntityID(new EntityMooshroom(null)),
-EntityList.getEntityID(new EntityMooshroom(null)),
2,
(new AspectList()).add(Aspect.PLANT, 8).add(Aspect.BEAST, 4),
EntityCow.class,
@@ -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);
}
}
@@ -8,8 +8,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -28,11 +26,10 @@ public class EntityEndersteed extends EntityHorse {
this.initialized = false;
}
@Override
public void readEntityFromNBT(final NBTTagCompound p_70037_1_) {
super.readEntityFromNBT(p_70037_1_);
if (!(this.initialized = p_70037_1_.getBoolean("initialized"))) {
final Multimap<String, AttributeModifier> map = HashMultimap.create();
final Multimap map = HashMultimap.create();
map.put("generic.movementSpeed", new AttributeModifier("generic.movementSpeed", 0.1, 1));
map.put("horse.jumpStrength", new AttributeModifier("horse.jumpStrength", 0.25, 1));
map.put("generic.maxHealth", new AttributeModifier("generic.maxHealth", 4.0, 1));
@@ -41,13 +38,11 @@ public class EntityEndersteed extends EntityHorse {
}
}
@Override
public void writeEntityToNBT(final NBTTagCompound p_70014_1_) {
super.writeEntityToNBT(p_70014_1_);
p_70014_1_.setBoolean("initialized", this.initialized);
}
@Override
public void setJumpPower(final int p_110206_1_) {
final double blocks = p_110206_1_ / 7.0;
this.teleportTo(
@@ -56,7 +51,6 @@ public class EntityEndersteed extends EntityHorse {
this.posZ + blocks * Math.cos(Math.toRadians(this.rotationYaw)));
}
@Override
public String getCommandSenderName() {
if (this.hasCustomNameTag()) {
return this.getCustomNameTag();
@@ -64,15 +58,6 @@ public class EntityEndersteed extends EntityHorse {
return StatCollector.translateToLocal("entity.ThaumicHorizons.Endersteed.name");
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.Endersteed.name");
}
}
protected boolean teleportTo(final double p_70825_1_, final double p_70825_3_, final double p_70825_5_) {
final EnderTeleportEvent event = new EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0.0f);
if (MinecraftForge.EVENT_BUS.post(event)) {
@@ -10,8 +10,6 @@ import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -28,27 +26,16 @@ public class EntityFamiliar extends EntityOcelot {
super(p_i1688_1_);
}
@Override
public String getCommandSenderName() {
return this.hasCustomNameTag() ? this.getCustomNameTag()
: (this.isTamed() ? StatCollector.translateToLocal("entity.ThaumicHorizons.Familiar.name")
: super.getCommandSenderName());
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag() || !this.isTamed()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.Familiar.name");
}
}
@Override
public void updateAITick() {
super.updateAITick();
if (this.ticksExisted % 10 == 0) {
final List<EntityPlayer> players = this.worldObj.getEntitiesWithinAABB(
final List<EntityPlayer> players = (List<EntityPlayer>) this.worldObj.getEntitiesWithinAABB(
EntityPlayer.class,
AxisAlignedBB.getBoundingBox(
this.posX - 5.0,
@@ -22,11 +22,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
@@ -130,7 +128,6 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public boolean isValidTarget(final Entity target) {
if (!this.berserk) {
return super.isValidTarget(target) || target instanceof EntityCreeper;
@@ -140,7 +137,6 @@ public class EntityGolemTH extends EntityGolemBase {
&& !target.getCommandSenderName().equals(this.getCommandSenderName());
}
@Override
public boolean setupGolem() {
super.setupGolem();
if (this.getCore() == -1) {
@@ -172,7 +168,6 @@ public class EntityGolemTH extends EntityGolemBase {
return true;
}
@Override
public boolean attackEntityFrom(final DamageSource ds, float par2) {
this.paused = false;
if (ds == DamageSource.cactus) {
@@ -197,7 +192,6 @@ public class EntityGolemTH extends EntityGolemBase {
return super.attackEntityFrom(ds, par2);
}
@Override
public int getCarryLimit() {
int base = this.type.carry;
if (this.worldObj.isRemote) {
@@ -207,7 +201,6 @@ public class EntityGolemTH extends EntityGolemBase {
return base;
}
@Override
public float getAIMoveSpeed() {
if (this.paused || this.inactive) {
return 0.0f;
@@ -228,7 +221,6 @@ public class EntityGolemTH extends EntityGolemBase {
return speed;
}
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if (!this.worldObj.isRemote) {
@@ -247,13 +239,37 @@ public class EntityGolemTH extends EntityGolemBase {
if (this.ticksExisted % 10 == 0 && this.worldObj.rand.nextInt(500) == 0) {
final EntityPlayer player = this.worldObj.getPlayerEntityByName(this.getOwnerName());
switch (this.voidCount) {
case 0, 1, 2 -> {
case 0 -> {
if (player != null) {
final ChatComponentTranslation message = new ChatComponentTranslation(
"thaumichorizons.golemWarning" + this.voidCount);
message.setChatStyle(
new ChatStyle().setColor(EnumChatFormatting.DARK_PURPLE).setItalic(true));
player.addChatMessage(message);
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.DARK_PURPLE
+ StatCollector
.translateToLocal("thaumichorizons.golemWarning1")));
break;
}
}
case 1 -> {
if (player != null) {
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.DARK_PURPLE
+ StatCollector
.translateToLocal("thaumichorizons.golemWarning2")));
break;
}
}
case 2 -> {
if (player != null) {
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.DARK_PURPLE
+ StatCollector
.translateToLocal("thaumichorizons.golemWarning3")));
break;
}
}
case 3 -> {
@@ -279,7 +295,7 @@ public class EntityGolemTH extends EntityGolemBase {
if (this.regenTimer <= 0) {
this.regenTimer = this.type.regenDelay;
if (this.decoration.contains("F")) {
this.regenTimer = (this.regenTimer * 2) / 3;
this.regenTimer *= (int) 0.66f;
}
if (!this.worldObj.isRemote && this.getHealth() < this.getMaxHealth()) {
this.worldObj.setEntityState(this, (byte) 5);
@@ -289,25 +305,23 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public boolean isWithinHomeDistance(final int par1, final int par2, final int par3) {
return this.getCore() == -1 || super.isWithinHomeDistance(par1, par2, par3);
}
@Override
public void setFire(final int par1) {
if (!this.type.fireResist) {
super.setFire(par1);
}
}
@Override
public void writeEntityToNBT(final NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setByte("GolemTypeTH", (byte) this.type.ordinal());
nbt.setByte("GolemType", (byte) EnumGolemType.FLESH.ordinal());
if (this.blocky != null) {
final String s = "block";
final Block blocky = this.blocky;
nbt.setInteger(s, Block.getIdFromBlock(this.blocky));
} else {
nbt.setInteger("block", 0);
@@ -320,21 +334,24 @@ public class EntityGolemTH extends EntityGolemBase {
nbt.setBoolean("explosive", this.kaboom);
}
@Override
public void readEntityFromNBT(final NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
this.type = EnumGolemTHType.getType(nbt.getByte("GolemTypeTH"));
final int upgradeSlots = this.type.upgrades + (this.advanced ? 1 : 0);
this.upgrades = new byte[this.type.upgrades + (this.advanced ? 1 : 0)];
final int ul = this.upgrades.length;
this.upgrades = nbt.getByteArray("upgrades");
if (upgradeSlots != this.upgrades.length) {
byte[] tt = Arrays.copyOf(this.upgrades, upgradeSlots);
if (this.upgrades.length < upgradeSlots) {
Arrays.fill(tt, this.upgrades.length, upgradeSlots, (byte) -1);
if (ul != this.upgrades.length) {
final byte[] tt = new byte[ul];
for (int a = 0; a < ul; ++a) {
tt[a] = -1;
}
for (int a = 0; a < this.upgrades.length; ++a) {
if (a < ul) {
tt[a] = this.upgrades[a];
}
}
this.upgrades = tt;
}
StringBuilder st = new StringBuilder();
for (final byte c : this.upgrades) {
st.append(Integer.toHexString(c));
@@ -351,7 +368,6 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
protected void damageEntity(final DamageSource ds, final float par2) {
if (ds.isFireDamage() && this.type.fireResist) {
return;
@@ -359,7 +375,6 @@ public class EntityGolemTH extends EntityGolemBase {
super.damageEntity(ds, par2);
}
@Override
public int getTotalArmorValue() {
int var1 = super.getTotalArmorValue() + this.type.armor;
if (this.decoration.contains("V")) {
@@ -469,6 +484,7 @@ public class EntityGolemTH extends EntityGolemBase {
this.md,
3);
final SimpleNetworkWrapper instance = PacketHandler.INSTANCE;
final Block blocky = this.blocky;
instance.sendToAllAround(
new PacketFXBlocksplosion(
Block.getIdFromBlock(this.blocky),
@@ -500,6 +516,7 @@ public class EntityGolemTH extends EntityGolemBase {
this.md,
3);
final SimpleNetworkWrapper instance2 = PacketHandler.INSTANCE;
final Block blocky2 = this.blocky;
instance2.sendToAllAround(
new PacketFXBlocksplosion(
Block.getIdFromBlock(this.blocky),
@@ -533,6 +550,7 @@ public class EntityGolemTH extends EntityGolemBase {
this.md,
3);
final SimpleNetworkWrapper instance3 = PacketHandler.INSTANCE;
final Block blocky3 = this.blocky;
instance3.sendToAllAround(
new PacketFXBlocksplosion(
Block.getIdFromBlock(this.blocky),
@@ -566,6 +584,7 @@ public class EntityGolemTH extends EntityGolemBase {
this.md,
3);
final SimpleNetworkWrapper instance4 = PacketHandler.INSTANCE;
final Block blocky4 = this.blocky;
instance4.sendToAllAround(
new PacketFXBlocksplosion(
Block.getIdFromBlock(this.blocky),
@@ -586,10 +605,10 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public void writeSpawnData(final ByteBuf data) {
super.writeSpawnData(data);
if (this.blocky != null) {
final Block blocky = this.blocky;
data.writeInt(Block.getIdFromBlock(this.blocky));
} else {
data.writeInt(0);
@@ -601,7 +620,6 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public void readSpawnData(final ByteBuf data) {
super.readSpawnData(data);
this.blocky = Block.getBlockById(data.readInt());
@@ -612,38 +630,18 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public String getCommandSenderName() {
if (this.hasCustomNameTag()) {
return this.getCustomNameTag();
}
if (this.blocky == null || this.blocky == Blocks.air) {
return StatCollector.translateToLocal("entity.ThaumicHorizons.GolemTH.voidling.name");
}
return StatCollector.translateToLocalFormatted("entity.ThaumicHorizons.GolemTH.name", getBlockLangKey());
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag()) {
return super.func_145748_c_();
}
if (this.blocky == null || this.blocky == Blocks.air) {
return new ChatComponentTranslation("entity.ThaumicHorizons.GolemTH.voidling.name");
}
return new ChatComponentTranslation("entity.ThaumicHorizons.GolemTH.name", getBlockLangKey());
}
private String getBlockLangKey() {
final ItemStack stack = new ItemStack(this.blocky, 1, this.md);
if (stack.getItem() != null) {
return stack.getUnlocalizedName();
return stack.getDisplayName() + " Golem";
}
return this.blocky.getUnlocalizedName();
if (this.blocky == null || this.blocky == Blocks.air) {
return "Voidling Golem";
}
return this.blocky.getLocalizedName() + " Golem";
}
public EnumGolemType getGolemType() {
@@ -17,9 +17,7 @@ import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -46,32 +44,20 @@ public class EntityGravekeeper extends EntityOcelot {
this.targetTasks.addTask(10, new EntityAINearestAttackableTarget(this, EntityInhabitedZombie.class, 0, false));
}
@Override
public boolean attackEntityAsMob(final Entity p_70652_1_) {
return (p_70652_1_ instanceof EntityLivingBase && ((EntityLivingBase) p_70652_1_).isEntityUndead())
|| p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), 2.0f);
}
@Override
public String getCommandSenderName() {
return this.hasCustomNameTag() ? this.getCustomNameTag()
: (this.isTamed() ? StatCollector.translateToLocal("entity.ThaumicHorizons.Gravekeeper.name")
: super.getCommandSenderName());
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag() || !this.isTamed()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.Gravekeeper.name");
}
}
@Override
public void updateAITick() {
super.updateAITick();
final List<EntityLivingBase> critters = this.worldObj.getEntitiesWithinAABB(
final List<EntityLivingBase> critters = (List<EntityLivingBase>) this.worldObj.getEntitiesWithinAABB(
EntityLivingBase.class,
AxisAlignedBB.getBoundingBox(
this.posX - 5.0,
@@ -100,14 +86,12 @@ public class EntityGravekeeper extends EntityOcelot {
}
}
@Override
protected void entityInit() {
super.entityInit();
final byte b0 = this.dataWatcher.getWatchableObjectByte(16);
this.dataWatcher.updateObject(16, (byte) (b0 | 0x4));
}
@Override
public boolean isTamed() {
return true;
}
@@ -23,9 +23,7 @@ import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -51,14 +49,12 @@ public class EntityGuardianPanther extends EntityOcelot implements IEntityInfuse
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(24.0);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5000000119209289);
}
@Override
public boolean interact(final EntityPlayer p_70085_1_) {
final ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
if (itemstack != null && itemstack.getItem() instanceof final ItemFood itemfood) {
@@ -74,45 +70,30 @@ public class EntityGuardianPanther extends EntityOcelot implements IEntityInfuse
return super.interact(p_70085_1_);
}
@Override
public boolean attackEntityAsMob(final Entity p_70652_1_) {
return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), 6.0f);
}
@Override
public String getCommandSenderName() {
return this.hasCustomNameTag() ? this.getCustomNameTag()
: (this.isTamed() ? StatCollector.translateToLocal("entity.ThaumicHorizons.GuardianPanther.name")
: super.getCommandSenderName());
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag() || !this.isTamed()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.GuardianPanther.name");
}
}
@Override
public void updateAITick() {
super.updateAITick();
}
@Override
protected void entityInit() {
super.entityInit();
final byte b0 = this.dataWatcher.getWatchableObjectByte(16);
this.dataWatcher.updateObject(16, (byte) (b0 | 0x4));
}
@Override
public boolean isTamed() {
return true;
}
@Override
public void resetStats() {
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(24.0);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5000000119209289);
@@ -12,8 +12,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
@@ -128,16 +126,6 @@ public class EntityNightmare extends EntityEndersteed {
return StatCollector.translateToLocal("entity.ThaumicHorizons.NightmareTH.name");
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.NightmareTH.name");
}
}
@Override
public void onUpdate() {
final AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(
this.boundingBox.minX,
@@ -189,7 +177,6 @@ public class EntityNightmare extends EntityEndersteed {
}
}
@Override
public void setInWeb() {
this.isInWeb = false;
this.fallDistance = 0.0f;
@@ -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);
}
@@ -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)) {
@@ -339,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),
@@ -35,7 +35,9 @@ 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;
@@ -78,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) {
@@ -106,12 +119,12 @@ 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);
setBlock(world, xCenter, yCenter + 1, zCenter, ThaumicHorizons.blockVortex, 0);
TileEntity te = world.getTileEntity(xCenter, yCenter + 1, zCenter);
if (!(te instanceof TileVortex)) {
te = new TileVortex();
@@ -332,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);
@@ -427,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) {
@@ -444,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
@@ -644,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;
}
@@ -672,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) {
@@ -713,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);
}
}
@@ -727,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);
}
}
@@ -741,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;
@@ -799,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) {
@@ -861,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);
}
}
}
@@ -988,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);
}
}
@@ -1395,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);
}
}
}
@@ -1478,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;
@@ -1636,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;
@@ -1645,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;
@@ -1654,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;
@@ -1663,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;
@@ -1678,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;
@@ -1688,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;
@@ -1698,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;
@@ -1708,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);
}
}
@@ -1239,22 +1239,25 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
EntityLivingBase created = null;
if ((Integer) out < 0) {
created = (EntityLivingBase) EntityList.createEntityByID(-(Integer) out, this.worldObj);
} else {
final ModContainer mc = Loader.instance().getIndexedModList().get("ThaumicHorizons");
try {
created = (EntityLivingBase) EntityRegistry.instance().lookupModSpawn(mc, (Integer) out)
.getEntityClass().getConstructor(World.class).newInstance(this.worldObj);
} catch (InvocationTargetException e) {
e.getCause().printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
}
}
final ModContainer mc = Loader.instance().getIndexedModList().get("ThaumicHorizons");
try {
created = (EntityLivingBase) EntityRegistry.instance().lookupModSpawn(mc, (Integer) out)
.getEntityClass().getConstructor(World.class).newInstance(this.worldObj);
} catch (InvocationTargetException e) {
e.getCause().printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
if (created != null) {
created.copyLocationAndAnglesFrom(this.getEntityContained());
created.copyDataFrom(this.getEntityContained(), true);
if (created instanceof IEntityInfusedStats) {
((IEntityInfusedStats) created).resetStats();
}
this.setEntityContained(created);
}
created.copyLocationAndAnglesFrom(this.getEntityContained());
created.copyDataFrom(this.getEntityContained(), true);
if (created instanceof IEntityInfusedStats) {
((IEntityInfusedStats) created).resetStats();
}
this.setEntityContained(created);
} else if (out instanceof NBTBase) {
final NBTTagCompound tagMods = (NBTTagCompound) out;
final Multimap map = HashMultimap.create();
@@ -33,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;
@@ -60,10 +59,8 @@ 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;
@@ -74,10 +71,8 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
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() {
@@ -95,114 +90,91 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
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 += 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 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 = 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));
}
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));
}
}
}
@@ -212,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,
@@ -221,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 {
@@ -322,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))).start();
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();
}
@@ -451,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);
@@ -482,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);
@@ -504,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);
@@ -87,8 +87,6 @@ entity.ThaumicHorizons.VoltSlime.name=Volt Slime
entity.ThaumicHorizons.MedSlime.name=Medslime
entity.ThaumicHorizons.Sheeder.name=Sheeder
entity.ThaumicHorizons.LostSoul.name=Lost Soul
entity.ThaumicHorizons.GolemTH.name=%s Golem
entity.ThaumicHorizons.GolemTH.voidling.name=Voidling Golem
###POTIONS###