From 7e0c8425eca0e2ea097e4aad0d44ed8cdb0f4690 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 25 May 2018 13:40:27 +1000 Subject: + Added loader for Thaumcraft Researcher Machine. $ Fixed Staballoy constructs exploding as soon as they spawn. $ Fixed chicken renderer. $ Fixed a bug arising from getRandomFromArray(int[]) where it could get index OOB. --- .../core/client/renderer/RenderGiantChicken.java | 79 +------- .../entity/monster/EntityStaballoyConstruct.java | 204 +++++++++++---------- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 + src/Java/gtPlusPlus/core/util/math/MathUtils.java | 6 +- .../xmod/gregtech/api/enums/GregtechItemList.java | 4 +- ...GregtechMetaTileEntityThaumcraftResearcher.java | 146 +++------------ .../gregtech/GregtechPollutionDevices.java | 7 - .../gregtech/GregtechThaumcraftDevices.java | 26 +++ .../xmod/thaumcraft/util/ThaumcraftUtils.java | 2 - 9 files changed, 170 insertions(+), 305 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java (limited to 'src/Java') diff --git a/src/Java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java b/src/Java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java index d3c1e852d9..59621ef830 100644 --- a/src/Java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java +++ b/src/Java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java @@ -4,13 +4,9 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderChicken; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; +import net.minecraft.entity.passive.EntityChicken; import net.minecraft.util.ResourceLocation; -import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.util.reflect.ReflectionUtils; @SideOnly(Side.CLIENT) @@ -36,81 +32,12 @@ public class RenderGiantChicken extends RenderChicken { super(p_i1252_1_, p_i1252_2_); } - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render= 50) { + //Logger.INFO("Construct has low hp, trying to enable explosions. HP: "+this.getHealth()+", Max: "+this.getMaxHealth()+", Mod: "+modifier); + //Logger.INFO("Construct required HP to be <= "+amountToExplode); + float r = MathUtils.randFloat(0, 10); + if (r <= 0.1){ + this.isReadyToExplode = true; + //Logger.INFO("Construct can now explode."); + } + } } - } + //Handle Exploding + else if (hp <= amountToExplode && isReadyToExplode){ + //Logger.INFO("Trying to explode. ["+this.fuse+"]"); + if (this.fuse-- <= 0){ + //Logger.INFO("Fuse has run out."); + this.setDead(); + if (!this.worldObj.isRemote) + { + this.explode(); + } + } + else { + //Logger.INFO("Ticking fuse and spawning particles."); - //Handle Exploding - if (isReadyToExplode){ - if (this.fuse-- <= 0){ - this.setDead(); + int maxFuse = 60; + int fuseUsed = maxFuse-this.fuse; + float var2 = (float) (fuseUsed * 0.1); - if (!this.worldObj.isRemote) - { - this.explode(); - } - } - else { - - int maxFuse = 60; - int fuseUsed = maxFuse-this.fuse; - float var2 = (float) (fuseUsed * 0.1); - - this.setSize(1.4F+(var2/2), 2.9F+(var2/2)); - - float r = MathUtils.randFloat(0, 1); - int r2 = MathUtils.randInt(5, 15); - for (int o=0;o