From db3dece804bf33f8d66c52fd18e47b8e49cab9de Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 18 Apr 2019 16:41:50 +1000 Subject: % Improved Mode handling on some tools, Electric lighter now has a projectile mode. $ Fixed Bombs not having a renderer. $ Fixed Mode changing on custom GT Tools. Fixes #80 --- .../core/entity/InternalEntityRegistry.java | 3 + .../entity/projectile/EntityLightningAttack.java | 76 ++++++++++++++++++++++ src/Java/gtPlusPlus/core/proxy/ClientProxy.java | 5 ++ 3 files changed, 84 insertions(+) create mode 100644 src/Java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java index e5c779adcf..aec82119cc 100644 --- a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java +++ b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java @@ -13,6 +13,7 @@ import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion; +import gtPlusPlus.core.entity.projectile.EntityLightningAttack; import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; import gtPlusPlus.core.entity.projectile.EntityThrowableBomb; import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; @@ -54,6 +55,8 @@ public class InternalEntityRegistry { EntityRegistry.registerModEntity(EntityThrowableBomb.class, "EntityThrowableBomb", mEntityID++, GTplusplus.instance, 64, 10, true); + EntityRegistry.registerModEntity(EntityLightningAttack.class, "EntityLightningAttack", mEntityID++, GTplusplus.instance, 64, 20, true); + /** * Globals, which generate spawn eggs. (Currently required for Giant chicken spawning) */ diff --git a/src/Java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java b/src/Java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java new file mode 100644 index 0000000000..868517d1db --- /dev/null +++ b/src/Java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java @@ -0,0 +1,76 @@ +package gtPlusPlus.core.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityLightningAttack extends EntityWitherSkull { + + public EntityLightningAttack(World p_i1793_1_) + { + super(p_i1793_1_); + this.setSize(0.3125F, 0.3125F); + } + + public EntityLightningAttack(World p_i1794_1_, EntityLivingBase p_i1794_2_, double p_i1794_3_, double p_i1794_5_, double p_i1794_7_) + { + super(p_i1794_1_, p_i1794_2_, p_i1794_3_, p_i1794_5_, p_i1794_7_); + this.setSize(0.3125F, 0.3125F); + } + + @SideOnly(Side.CLIENT) + public EntityLightningAttack(World p_i1795_1_, double p_i1795_2_, double p_i1795_4_, double p_i1795_6_, double p_i1795_8_, double p_i1795_10_, double p_i1795_12_) + { + super(p_i1795_1_, p_i1795_2_, p_i1795_4_, p_i1795_6_, p_i1795_8_, p_i1795_10_, p_i1795_12_); + this.setSize(0.3125F, 0.3125F); + } + + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70227_1_) { + + if (!this.worldObj.isRemote) { + if (p_70227_1_.entityHit != null) { + if (this.shootingEntity != null) { + if (p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F) + && !p_70227_1_.entityHit.isEntityAlive()) { + this.shootingEntity.heal(0.5F); + } + } else { + p_70227_1_.entityHit.attackEntityFrom(DamageSource.lava, 10.0F); + } + + if (p_70227_1_.entityHit instanceof EntityLivingBase) { + byte b0 = 0; + + if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL) { + b0 = 10; + } else if (this.worldObj.difficultySetting == EnumDifficulty.HARD) { + b0 = 40; + } + + if (b0 > 0) { + ((EntityLivingBase) p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 20 * b0, 1)); + ((EntityLivingBase) p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.confusion.id, 20 * b0, 1)); + ((EntityLivingBase) p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.weakness.id, 20 * b0, 1)); + } + } + } + + this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, + this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.setDead(); + } + } + + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java index c7374ca7d5..71befe0a37 100644 --- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java @@ -47,7 +47,9 @@ import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion; +import gtPlusPlus.core.entity.projectile.EntityLightningAttack; import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; +import gtPlusPlus.core.entity.projectile.EntityThrowableBomb; import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; import gtPlusPlus.core.handler.render.FirepitRender; import gtPlusPlus.core.item.ModItems; @@ -61,6 +63,7 @@ import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBat; import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.entity.RenderFireball; import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.entity.Entity; @@ -138,6 +141,8 @@ public class ClientProxy extends CommonProxy implements Runnable{ RenderingRegistry.registerEntityRenderingHandler(EntityTeslaTowerLightning.class, new RenderPlasmaBolt()); RenderingRegistry.registerEntityRenderingHandler(EntityGiantChickenBase.class, new RenderGiantChicken(new ModelGiantChicken(), 1f)); RenderingRegistry.registerEntityRenderingHandler(EntityBatKing.class, new RenderBatKing()); + RenderingRegistry.registerEntityRenderingHandler(EntityThrowableBomb.class, new RenderSnowball(ModItems.itemBomb, 1)); + RenderingRegistry.registerEntityRenderingHandler(EntityLightningAttack.class, new RenderFireball(1F)); /** * Tiles -- cgit From 90f2e5a230cfad500a06e09a5a1297dd3efb02fe Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 18 Apr 2019 16:57:20 +1000 Subject: % Made Bombs better. --- .../entity/projectile/EntityThrowableBomb.java | 46 ++++++++++++++++++---- .../item/general/throwables/ItemThrowableBomb.java | 3 +- 2 files changed, 40 insertions(+), 9 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java b/src/Java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java index 9e72daf687..49daa459e0 100644 --- a/src/Java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java +++ b/src/Java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java @@ -13,6 +13,7 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.EntityUtils; +import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; public class EntityThrowableBomb extends EntityThrowable { @@ -39,19 +40,26 @@ public class EntityThrowableBomb extends EntityThrowable { if (object.entityHit != null) { byte b0 = 6; if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)){ - object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0); - EntityUtils.setEntityOnFire(object.entityHit, 10); + object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 20); + EntityUtils.setEntityOnFire(object.entityHit, 20); object.entityHit.fireResistance = 0; ravage(EntityUtils.findBlockPosUnderEntity(object.entityHit)); } } - if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK){ - ravage(new BlockPos(xBlock, yBlock, zBlock)); + if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK){ + + ravage(new BlockPos(xBlock, yBlock, zBlock)); + for (BlockPos aSur : new BlockPos(xBlock, yBlock, zBlock).getSurroundingBlocks()) { + ravage(new BlockPos(aSur.xPos, aSur.yPos, aSur.zPos)); + for (BlockPos aSur2 : new BlockPos(aSur.xPos, aSur.yPos, aSur.zPos).getSurroundingBlocks()) { + //ravage(new BlockPos(aSur2.xPos, aSur2.yPos, aSur2.zPos)); + } + } } String mParticleType = "reddust"; int e=0; - for (int i = 0; i < 24; ++i) { + for (int i = 0; i < 127; ++i) { if ((e = MathUtils.randInt(0, 5)) <= 1){ if (e==0) mParticleType = "largesmoke"; @@ -68,19 +76,41 @@ public class EntityThrowableBomb extends EntityThrowable { private boolean ravage(BlockPos blockpos){ - int radius = 1; + int radius = 5; for (int i=(blockpos.xPos-radius);i<(blockpos.xPos+radius);i++){ for (int j=(blockpos.yPos-radius);j<(blockpos.yPos+radius);j++){ for (int h=(blockpos.zPos-radius);h<(blockpos.zPos+radius);h++){ - int mChance = MathUtils.randInt(1, 10); + int mChance = MathUtils.randInt(0, 100); if (mChance <= 3){ Block mBlockhit = worldObj.getBlock(i, j, h); this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); - //GT_Pollution.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos), mPol); + PollutionUtils.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos), 500); this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 0.01f, true); if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium){ worldObj.setBlock(i, j+1, h, Blocks.fire); diff --git a/src/Java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java b/src/Java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java index 9467c3a58c..e8f76ce64c 100644 --- a/src/Java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java +++ b/src/Java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java @@ -12,6 +12,7 @@ import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.NBTUtils; +import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -51,7 +52,7 @@ public class ItemThrowableBomb extends CoreItem { for (ItemStack aPlaySlot : player.inventory.mainInventory) { if (aPlaySlot != null) { for (ItemStack aLighter : mLighters) { - if (GT_Utility.areStacksEqual(aPlaySlot, aLighter)) { + if (GT_Utility.areStacksEqual(aPlaySlot, aLighter) || (aPlaySlot.getItem() instanceof MetaGeneratedGregtechTools && aPlaySlot.getItemDamage() == MetaGeneratedGregtechTools.ELECTRIC_LIGHTER)) { hasLighter = true; break; } -- cgit From 9ee4e1bff55c1af2bd313a97b71f6c722c5be703 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 18 Apr 2019 18:25:45 +1000 Subject: $ Small bit of work on the Deep Earth Drilling Platform. --- src/Java/gtPlusPlus/core/handler/AchievementHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/handler/AchievementHandler.java b/src/Java/gtPlusPlus/core/handler/AchievementHandler.java index 4cd5431ebd..9053875058 100644 --- a/src/Java/gtPlusPlus/core/handler/AchievementHandler.java +++ b/src/Java/gtPlusPlus/core/handler/AchievementHandler.java @@ -19,6 +19,7 @@ import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; @@ -43,7 +44,7 @@ public class AchievementHandler { GT_Log.out.println("Initializing GT++ achievements"); //register first - this.registerAchievement(aBaseAchievementName, 0, 0, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, Materials.Neutronium, Materials.Osmium, null), "", true); + this.registerAchievement(aBaseAchievementName, 0, 0, MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(MetaGeneratedGregtechTools.ANGLE_GRINDER, 1, Materials.Osmium, Materials.Osmium, null), "", true); //Useful Info boolean cores = CORE.ConfigSwitches.requireControlCores; -- cgit From ca4a99724a9c504972da28749a3214aa182075e1 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 20 Apr 2019 16:35:19 +1000 Subject: $ Possibly Fixed weird crash. --- src/Java/gtPlusPlus/core/item/ModItems.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 68aacd6943..e9d78f60b5 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -839,8 +839,10 @@ public final class ModItems { else { itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1); } - GT_Values.RA.addBlastRecipe(ELEMENT.getInstance().TITANIUM.getIngot(1), CI.getNumberedCircuit(16), itemHotTitaniumIngot, null, 10 * 20, 500, Materials.Titanium.mBlastFurnaceTemp); - + if (itemHotTitaniumIngot != null) { + GT_Values.RA.addBlastRecipe(ItemUtils.getItemStackOfAmountFromOreDict("ingotTitanium", 1), CI.getNumberedCircuit(16), itemHotTitaniumIngot, null, 10 * 20, 500, Materials.Titanium.mBlastFurnaceTemp); + } + //Special Sillyness if (true) { -- cgit From 812163905525cabc5cad13358454f22f3109adfb Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 21 Apr 2019 13:58:49 +1000 Subject: $ Moved EBF recipe to try fix NPE. --- src/Java/gtPlusPlus/core/item/ModItems.java | 3 --- src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index e9d78f60b5..9618f1ed86 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -839,9 +839,6 @@ public final class ModItems { else { itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1); } - if (itemHotTitaniumIngot != null) { - GT_Values.RA.addBlastRecipe(ItemUtils.getItemStackOfAmountFromOreDict("ingotTitanium", 1), CI.getNumberedCircuit(16), itemHotTitaniumIngot, null, 10 * 20, 500, Materials.Titanium.mBlastFurnaceTemp); - } //Special Sillyness if (true) { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 68f7bdd762..018ffb08e1 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -1736,6 +1736,20 @@ public class RECIPES_GREGTECH { MaterialUtils.getVoltageForTier(GTNH ? 3 : 2), 2800); + //Krypton Processing + if (ModItems.itemHotTitaniumIngot != null) { + GT_Values.RA.addBlastRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("ingotTitanium", 1), + CI.getNumberedCircuit(16), + GT_Values.NF, + GT_Values.NF, + ItemUtils.getItemStackOfAmountFromOreDict("ingotHotTitanium", 1), + null, + 10 * 20, + 500, + Materials.Titanium.mBlastFurnaceTemp); + } + } -- cgit From c72ea28733af1ea5fae10117b27155c90870850f Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 23 Apr 2019 13:49:19 +1000 Subject: + Added Rhugnor. + Added Carbyne as a proper material. $ Fixed ASM Derp in IC2 Hazmat transformer. --- src/Java/gtPlusPlus/core/common/CommonProxy.java | 8 +++++ src/Java/gtPlusPlus/core/handler/BookHandler.java | 2 +- src/Java/gtPlusPlus/core/item/ModItems.java | 4 ++- .../core/item/chemistry/GenericChem.java | 2 ++ src/Java/gtPlusPlus/core/material/ELEMENT.java | 1 + src/Java/gtPlusPlus/core/material/Material.java | 40 ++++++++++++++++++++++ .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 11 ++++++ 7 files changed, 66 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 301ca992a4..cacc471249 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -9,6 +9,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; +import gregtech.api.enums.OrePrefixes; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.ChunkManager; @@ -30,6 +31,7 @@ import gtPlusPlus.core.handler.events.GeneralTooltipEventHandler; import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler; import gtPlusPlus.core.handler.events.ZombieBackupSpawnEventHandler; import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.chemistry.GenericChem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.lib.LoadedMods; @@ -42,6 +44,7 @@ import gtPlusPlus.core.util.player.PlayerCache; import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner; import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO; import gtPlusPlus.xmod.galacticraft.handler.HandlerTooltip_GC; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.entity.Entity; import net.minecraftforge.common.ForgeChunkManager; @@ -107,6 +110,7 @@ public class CommonProxy { DEBUG_INIT.registerHandlers(); } + registerCustomItemsForMaterials(); ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner(); if (!mFluidsGenerated && ItemList.valueOf("Cell_Empty").hasBeenSet()) { @@ -216,5 +220,9 @@ public class CommonProxy { Utils.createNewMobSpawner(1, EntitySickBlaze.class); Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class); } + + public void registerCustomItemsForMaterials() { + Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1)); + } } diff --git a/src/Java/gtPlusPlus/core/handler/BookHandler.java b/src/Java/gtPlusPlus/core/handler/BookHandler.java index 462cbd8cdb..860946f513 100644 --- a/src/Java/gtPlusPlus/core/handler/BookHandler.java +++ b/src/Java/gtPlusPlus/core/handler/BookHandler.java @@ -118,7 +118,7 @@ public class BookHandler { //Test Novel //20/21/22 book_MultiMachineManual = writeBookTemplate( - "Manual_Multi_Machine", "Multi Machine Manual", "Alkalus", + "Manual_Multi_Machine", "Multi-Machine Manual", "Alkalus", new String[] { "This Multiblock, depending upon the mode used, can function as a variety of different machines. The idea behind this, was that most of these machines are rather niche compared to any others, as such, not used often.", "To build, you need to construct a hollow 3x3x3 structure made from Multi-Use casings, With a minimum of 6. Any Casing position can be substituted out with an Input Hatch/Bus, an Output Hatch/Bus, Muffler, Maint. Hatch or Energy Injector Hatch.", diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 9618f1ed86..51d41674d3 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -653,7 +653,9 @@ public final class ModItems { MaterialGenerator.generate(ALLOY.BABBIT_ALLOY, false); MaterialGenerator.generate(ALLOY.BLACK_TITANIUM, false); - + + // High Level Bioplastic + MaterialGenerator.generate(ELEMENT.STANDALONE.RHUGNOR, false, false); diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java index ec1d51b502..c64ad07d2a 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -23,6 +23,8 @@ public class GenericChem extends ItemPackage { public static final Material BAKELITE = new Material("Bakelite", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{90, 140, 140}, 120, 240, 23, 24, true, null, 0);//Not a GT Inherited Material public static final Material NYLON = new Material("Nylon", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{45, 45, 45}, 300, 600, 44, 48, true, null, 0);//Not a GT Inherited Material + public static final Material CARBYNE = new Material("Carbyne", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{25, 25, 25}, 2500, 5000, 63, 52, true, null, 0);//Not a GT Inherited Material + //Refined PTFE public static final Material TEFLON = new Material( diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index e972992391..9ba6fe0f1d 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -213,6 +213,7 @@ public final class ELEMENT { public static final Material CHRONOMATIC_GLASS = new Material("Chromatic Glass", MaterialState.SOLID, new short[]{255, 255, 255, 3}, 9200, 17550, 40, 51, false, "⌘☯𓍰 𓍱 𓍲 𓍳 𓍴 𓍵 𓍶 𓍷 𓍸 ☯⌘ ", 0);//Not a GT Inherited Material public static final Material ADVANCED_NITINOL = new Material("Advanced Nitinol", MaterialState.SOLID, TextureSets.ENRICHED.get(), ALLOY.NITINOL_60.getRGB(), 8400, 14377, 40, 51, true, "⚷⚙⚷ Ni4Ti6", 0);//Not a GT Inherited Material public static final Material HYPOGEN = new Material("Hypogen", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{220, 120, 75, 2}, 12255, 19377, 240, 251, true, "Hy⚶", 0);//Not a GT Inherited Material + public static final Material RHUGNOR = new Material("Rhugnor", MaterialState.SOLID, TextureSets.ENRICHED.get(), new short[]{190, 0, 255, 0}, 8750, 14757, 184, 142, true, "Fs⚶", 0);//Not a GT Inherited Material //funeris //Runescape materials diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 8fb3c5fc3b..6b6be32107 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -14,6 +14,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes; import gtPlusPlus.core.item.base.cell.BaseItemCell; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.state.MaterialState; @@ -1331,5 +1332,44 @@ public class Material { return 75; } } + + + + + public boolean registerComponentForMaterial(ComponentTypes aPrefix, ItemStack aStack) { + return registerComponentForMaterial(this, aPrefix.getGtOrePrefix(), aStack); + } + + public boolean registerComponentForMaterial(OrePrefixes aPrefix, ItemStack aStack) { + return registerComponentForMaterial(this, aPrefix, aStack); + } + + public static boolean registerComponentForMaterial(Material componentMaterial, ComponentTypes aPrefix, ItemStack aStack) { + return registerComponentForMaterial(componentMaterial, aPrefix.getGtOrePrefix(), aStack); + } + + public static boolean registerComponentForMaterial(Material componentMaterial, OrePrefixes aPrefix, ItemStack aStack) { + if (componentMaterial == null) { + return false; + } + //Register Component + Map aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName()); + if (aMap == null) { + aMap = new HashMap(); + } + String aKey = aPrefix.name(); + ItemStack x = aMap.get(aKey); + if (x == null) { + aMap.put(aKey, aStack); + Logger.MATERIALS("Registering a material component. Item: ["+componentMaterial.getUnlocalizedName()+"] Map: ["+aKey+"]"); + Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap); + return true; + } + else { + //Bad + Logger.MATERIALS("Tried to double register a material component. "); + return false; + } + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 018ffb08e1..483fce8ce5 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -17,6 +17,7 @@ import gregtech.api.util.ThermalFuel; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.chemistry.GenericChem; import gtPlusPlus.core.item.chemistry.IonParticles; import gtPlusPlus.core.item.chemistry.RocketFuels; import gtPlusPlus.core.item.crafting.ItemDummyResearch; @@ -26,6 +27,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.MaterialStack; +import gtPlusPlus.core.material.NONMATERIAL; import gtPlusPlus.core.material.ORES; import gtPlusPlus.core.material.Particle; import gtPlusPlus.core.material.nuclear.FLUORIDES; @@ -146,6 +148,15 @@ public class RECIPES_GREGTECH { 2048 * 4, (int) GT_Values.V[9], 600000000 * 2); + + //Rhugnor + GT_Values.RA.addFusionReactorRecipe( + GenericChem.TEFLON.getFluid(64), + ALLOY.PIKYONIUM.getFluid(128), + ELEMENT.STANDALONE.RHUGNOR.getFluid(8), + 2048 * 4, + (int) GT_Values.V[7], + 150000000 * 2); } -- cgit From 5412e231437d90d4fe45dab89bb5757211735e02 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Wed, 24 Apr 2019 11:11:11 +1000 Subject: $ Fixed the GT Proxy getter returning bad fields on the wrong side. (Server/Client) % Minor work on the Tree Farm. --- src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 722a4f3ff7..ef55792c63 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -463,13 +463,11 @@ public class ReflectionUtils { * therefore no more risk of code throwing NoClassDefFoundException. */ private static boolean isClassPresent(final String className) { - try { - Class.forName(className); - return true; - } catch (final Throwable ex) { - // Class or one of its dependencies is not present... - return false; + if (getClass(className) != null) { + return true; } + // Class or one of its dependencies is not present... + return false; } @Deprecated -- cgit From ac7d12986394ae1e8521728928a9404b9a102af3 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Wed, 24 Apr 2019 13:23:21 +1000 Subject: $ Fucked with TC4 integration. Enabled lots of logging. --- src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 4 ++-- src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index ceeff7e655..fe3934ed10 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -68,9 +68,9 @@ public class BaseItemComponent extends Item{ GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this)); if (LoadedMods.Thaumcraft) { - ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1); + //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1); if (componentMaterial.isRadioactive) { - ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel); + //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel); } } registerComponent(); diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index de47ed8225..6bb0ea8be8 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -58,9 +58,9 @@ public class BaseOreComponent extends Item{ registerComponent(); GT_OreDictUnificator.registerOre(componentType.getComponent()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this)); if (LoadedMods.Thaumcraft) { - ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1); + //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1); if (componentMaterial.isRadioactive) { - ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel); + //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel); } } -- cgit From ac3715298f2405ea9fb45bc79bd48f1851dd28aa Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Wed, 24 Apr 2019 13:35:04 +1000 Subject: $ Fixed StackOverflow, caused by my negligence to realise this was the base class lookup function. --- src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index ef55792c63..722a4f3ff7 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -463,11 +463,13 @@ public class ReflectionUtils { * therefore no more risk of code throwing NoClassDefFoundException. */ private static boolean isClassPresent(final String className) { - if (getClass(className) != null) { - return true; + try { + Class.forName(className); + return true; + } catch (final Throwable ex) { + // Class or one of its dependencies is not present... + return false; } - // Class or one of its dependencies is not present... - return false; } @Deprecated -- cgit