From 2b424e8295b7071b85a2960a87da91bf0dd3df02 Mon Sep 17 00:00:00 2001 From: Maxim Date: Sat, 22 Jul 2023 16:12:12 +0200 Subject: Implement generic processing logic (#697) * Migrated extruder * Migrated alloy smelter * Migrated arc furnace * Migrated centrifuge * Migrated ICO * Migrated cutter * Migrated dehydrator * Migrated electrolyzer * Migrated fluid heater * Migrated forge hammer * Forgot gtpp machines are cursed * Migrated mac * Migrated mixer * Migrated molecular transformer * Migrated bender * Migrated sifter * Migrated thermal centrifuge * Migrated VF * Migrated washer * Migrated wiremill * Migrated Volcanus * Migrated adv implo compressor * Migrated XL turbines * Migrated chemplant * Migrated MABS * Migrated ABS * Migrated cyclotron * Migrated Zhuhai * Migrated rock breaker * Migrated rocketdyne * Migrated semifluid generator * Migrated QFT * Minor optimization * Migrate refinery * Migrated solar tower * Migrated TGS * Migrated duplicator * Migrated PSS * Migrated algae pond * Migrated froth flotation cell * Migrated LTFR * Migrated LPF * Migrated sparge tower * Migrated salt * Migrated isamill * Migrate DT * Migrated HE * Migrated mass fab * Migrated chisel * Migrated boiler * Migrated steam machines * Migrated amazon * Disable batch mode button on XL turbines * Update dependencies.gradle * Updated dep * Addressed first batch of reviews * Migrated assembler * Removed unused checkRecipe methods * Forgot these * Fix and cleanup chemplant * Removed getAmounfOfOutputs * Removed special multi behavior * Migrated sound mostly * Addressed new reviews * Fix build fail and chisel sound * Derp * More reviews addressed * Oversight on chemplant batchmode * Fix DT speed bonus * Removed iron blast furnace * Removed generator array * Removed * Simplify rocket engine logic * Removed left over artifacts * Minor fixes * Removed nerf chips * Removed tesla tower * Revert and fix chemplant recipe map * Fix chemplant catalyst damaging * Addressed reviews * Derp --------- Co-authored-by: Martin Robertz --- .../core/entity/EntityTeslaTowerLightning.java | 180 --------------------- .../core/entity/InternalEntityRegistry.java | 14 -- 2 files changed, 194 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java (limited to 'src/main/java/gtPlusPlus/core/entity') diff --git a/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java b/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java deleted file mode 100644 index 82615309b0..0000000000 --- a/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java +++ /dev/null @@ -1,180 +0,0 @@ -package gtPlusPlus.core.entity; - -import java.util.List; -import java.util.Random; -import java.util.UUID; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.effect.EntityWeatherEffect; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.World; - -import gtPlusPlus.api.damage.DamageTeslaTower; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.random.XSTR; -import gtPlusPlus.core.util.minecraft.EntityUtils; - -public class EntityTeslaTowerLightning extends EntityWeatherEffect { - - /** Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. */ - private int lightningState; - /** A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt */ - public long boltVertex; - /** - * Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. - */ - private int boltLivingTime; - - private final UUID boltID; - private final UUID boltOwnerID; - - private final Entity boltValidDamageTarget; - - public EntityTeslaTowerLightning(World p_i1703_1_, double p_i1703_2_, double p_i1703_4_, double p_i1703_6_, - Entity valid, UUID owner) { - super(p_i1703_1_); - Logger.INFO("Plasma Bolt - Created."); - Random rand = new XSTR(p_i1703_1_.getSeed()); - this.setLocationAndAngles(p_i1703_2_, p_i1703_4_, p_i1703_6_, 0.0F, 0.0F); - this.lightningState = 2; - this.boltVertex = rand.nextLong(); - this.boltLivingTime = (1) + rand.nextInt(3) + 1; - this.boltValidDamageTarget = valid; - this.boltID = UUID.randomUUID(); - this.boltOwnerID = owner; - - // Puts fires out - if (!p_i1703_1_.isRemote && p_i1703_1_.getGameRules().getGameRuleBooleanValue("doFireTick") - && (p_i1703_1_.difficultySetting == EnumDifficulty.NORMAL - || p_i1703_1_.difficultySetting == EnumDifficulty.HARD) - && p_i1703_1_.doChunksNearChunkExist( - MathHelper.floor_double(p_i1703_2_), - MathHelper.floor_double(p_i1703_4_), - MathHelper.floor_double(p_i1703_6_), - 10)) { - Logger.INFO("Plasma Bolt - Putting out fires?."); - int i = MathHelper.floor_double(p_i1703_2_); - int j = MathHelper.floor_double(p_i1703_4_); - int k = MathHelper.floor_double(p_i1703_6_); - - if (p_i1703_1_.getBlock(i, j, k).getMaterial() == Material.fire) { - p_i1703_1_.setBlock(i, j, k, Blocks.air); - } - - for (i = 0; i < 4; ++i) { - j = MathHelper.floor_double(p_i1703_2_) + rand.nextInt(3) - 1; - k = MathHelper.floor_double(p_i1703_4_) + rand.nextInt(3) - 1; - int l = MathHelper.floor_double(p_i1703_6_) + rand.nextInt(3) - 1; - - if (p_i1703_1_.getBlock(j, k, l).getMaterial() == Material.fire) { - p_i1703_1_.setBlock(j, k, l, Blocks.air); - } - } - } - } - - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() { - // Logger.INFO("Zap"); - super.onUpdate(); - Logger.INFO("Plasma Bolt - Tick."); - Random rand = new XSTR(this.worldObj.getSeed()); - - if (this.lightningState == 2) { - Logger.INFO("Plasma Bolt - Playing Sound."); - this.worldObj.playSoundEffect( - this.posX, - this.posY, - this.posZ, - "ambient.weather.thunder", - 10000.0F, - 0.8F + rand.nextFloat() * 0.2F); - } - --this.lightningState; - - if (this.lightningState >= 0) { - Logger.INFO("Plasma Bolt - state >= 0."); - if (this.worldObj.isRemote) { - Logger.INFO("Plasma Bolt - World is remote, resetting state to 2."); - this.worldObj.lastLightningBolt = 2; - } else { - Logger.INFO("Plasma Bolt - World is server side."); - double d0 = 3.0D; - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity( - this, - AxisAlignedBB.getBoundingBox( - this.posX - d0, - this.posY - d0, - this.posZ - d0, - this.posX + d0, - this.posY + 6.0D + d0, - this.posZ + d0)); - - for (int l = 0; l < list.size(); ++l) { - Entity entity = list.get(l); - if (this.boltValidDamageTarget.getUniqueID().equals(entity.getUniqueID())) { - if (!entity.getUniqueID().equals(boltOwnerID)) { - Logger.INFO("Plasma Bolt - Hurting Entity."); - Logger.INFO("Plasma Bolt - " + entity.getCommandSenderName() + "."); - // if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this)) - EntityUtils.doFireDamage(entity, 5); - EntityUtils.doDamage(entity, new DamageTeslaTower(entity), 20); - } - } - } - } - } - - if (this.lightningState < 0) { - Logger.INFO("Plasma Bolt - state < 0."); - if (this.boltLivingTime == 0) { - Logger.INFO("Plasma Bolt - setting dead."); - this.setDead(); - } else if (this.lightningState < -rand.nextInt(10)) { - Logger.INFO("Plasma Bolt - dunno."); - --this.boltLivingTime; - this.lightningState = 1; - this.boltVertex = rand.nextLong(); - // Puts fires out. - if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") - && this.worldObj.doChunksNearChunkExist( - MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ), - 10)) { - Logger.INFO("Plasma Bolt - Putting fires out [2]."); - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.posY); - int k = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.fire) { - this.worldObj.setBlock(i, j, k, Blocks.air); - } - } - } - } - } - - @Override - protected void entityInit() {} - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {} - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {} -} diff --git a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java index e4f82ea80e..1254d9bdff 100644 --- a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java +++ b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java @@ -83,8 +83,6 @@ public class InternalEntityRegistry { Utils.rgbtoHexValue(20, 200, 20), Utils.rgbtoHexValue(20, 20, 20)); - // EntityRegistry.registerGlobalEntityID(EntitySickBlaze.class, "sickBlaze", - // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(75, 175, 75)); EntityRegistry .registerModEntity(EntitySickBlaze.class, "sickBlaze", mEntityID++, GTplusplus.instance, 64, 20, true); ItemCustomSpawnEgg.registerEntityForSpawnEgg( @@ -93,18 +91,6 @@ public class InternalEntityRegistry { Utils.rgbtoHexValue(40, 180, 40), Utils.rgbtoHexValue(75, 75, 75)); - // EntityRegistry.registerGlobalEntityID(EntityTeslaTowerLightning.class, "plasmaBolt", - // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(125, 125, - // 125)); - EntityRegistry.registerModEntity( - EntityTeslaTowerLightning.class, - "plasmaBolt", - mEntityID++, - GTplusplus.instance, - 64, - 5, - true); - EntityRegistry.registerModEntity( EntityThrowableBomb.class, "EntityThrowableBomb", -- cgit