From e4c453b4c1af06be617d5da78aacc507e354c73b Mon Sep 17 00:00:00 2001 From: Bob Date: Sun, 29 Nov 2020 17:58:10 +0100 Subject: [PATCH] the better part of the hadron, mister FBI himself --- src/main/java/assets/hbm/lang/de_DE.lang | 10 + src/main/java/assets/hbm/lang/en_US.lang | 10 + .../java/assets/hbm/textures/entity/fbi.png | Bin 0 -> 2331 bytes .../hbm/textures/gui/machine/gui_hadron.png | Bin 6148 -> 6101 bytes .../hbm/textures/items/particle_aelectron.png | Bin 0 -> 246 bytes .../hbm/textures/items/particle_aproton.png | Bin 0 -> 241 bytes .../hbm/textures/items/particle_muon.png | Bin 0 -> 273 bytes .../java/com/hbm/blocks/fluid/MudBlock.java | 3 +- .../com/hbm/blocks/generic/BarbedWire.java | 2 +- .../com/hbm/blocks/generic/BlockClorine.java | 3 +- .../hbm/blocks/machine/BlockHadronAccess.java | 9 +- .../java/com/hbm/entity/mob/EntityFBI.java | 19 + .../hbm/entity/projectile/EntityBullet.java | 2 +- .../entity/projectile/EntityBulletBase.java | 2 +- .../com/hbm/explosion/ExplosionChaos.java | 2 +- .../hbm/explosion/ExplosionNukeGeneric.java | 2 +- .../com/hbm/explosion/ExplosionThermo.java | 3 +- .../handler/guncfg/BulletConfigFactory.java | 2 +- .../java/com/hbm/inventory/gui/GUIHadron.java | 6 + src/main/java/com/hbm/items/ModItems.java | 36 ++ .../com/hbm/items/armor/ArmorEuphemium.java | 2 +- .../java/com/hbm/items/food/ItemEnergy.java | 7 + .../com/hbm/items/special/ItemCustomLore.java | 2 +- .../hbm/items/special/ItemRadioactive.java | 2 +- .../com/hbm/items/tool/WeaponSpecial.java | 2 +- src/main/java/com/hbm/main/ClientProxy.java | 26 ++ src/main/java/com/hbm/main/MainRegistry.java | 3 + .../java/com/hbm/main/ModEventHandler.java | 2 +- .../com/hbm/render/entity/mob/RenderFBI.java | 21 + .../java/com/hbm/render/model/ModelFBI.java | 13 + .../tileentity/machine/TileEntityAMSBase.java | 2 +- .../machine/TileEntityConverterHeRf.java | 23 +- .../machine/TileEntityConverterRfHe.java | 39 +- .../tileentity/machine/TileEntityCore.java | 2 +- .../tileentity/machine/TileEntityHadron.java | 433 +++++++++++++++++- .../machine/TileEntityLockableBase.java | 2 +- .../tileentity/machine/TileEntityTesla.java | 2 +- .../com/hbm/{handler => util}/ArmorUtil.java | 16 +- 38 files changed, 667 insertions(+), 43 deletions(-) create mode 100644 src/main/java/assets/hbm/textures/entity/fbi.png create mode 100644 src/main/java/assets/hbm/textures/items/particle_aelectron.png create mode 100644 src/main/java/assets/hbm/textures/items/particle_aproton.png create mode 100644 src/main/java/assets/hbm/textures/items/particle_muon.png create mode 100644 src/main/java/com/hbm/entity/mob/EntityFBI.java create mode 100644 src/main/java/com/hbm/render/entity/mob/RenderFBI.java create mode 100644 src/main/java/com/hbm/render/model/ModelFBI.java rename src/main/java/com/hbm/{handler => util}/ArmorUtil.java (94%) diff --git a/src/main/java/assets/hbm/lang/de_DE.lang b/src/main/java/assets/hbm/lang/de_DE.lang index 8f4637f8b..eaef51e83 100644 --- a/src/main/java/assets/hbm/lang/de_DE.lang +++ b/src/main/java/assets/hbm/lang/de_DE.lang @@ -1452,6 +1452,16 @@ item.part_carbon.name=Kohlenstoffstaubkiste item.part_copper.name=Kupferstaubkiste item.part_lithium.name=Lithiumstaubkiste item.part_plutonium.name=Plutoniumstaubkiste +item.particle_aelectron.name=Antielektronenkapsel +item.particle_amat.name=Antimaterienkapsel +item.particle_aproton.name=Antiprotonenkapsel +item.particle_aschrab.name=Antischrabidiumkapseö +item.particle_dark.name=Dunkle Materien Kapsel +item.particle_empty.name=Leere Partikelkapsel +item.particle_higgs.name=Higgs Bosonen Kapsel +item.particle_muon.name=Myonenkapsel +item.particle_sparkticle.name=Sparktikelkapsel +item.particle_strange.name=Strange Quark Capsule item.pedestal_steel.name=Stahlsockel item.pellet_advanced.name=Fortgeschrittenes Watzaufwertugspellet item.pellet_antimatter.name=Antimateriencluster diff --git a/src/main/java/assets/hbm/lang/en_US.lang b/src/main/java/assets/hbm/lang/en_US.lang index 3f5aa83f0..b4710e1da 100644 --- a/src/main/java/assets/hbm/lang/en_US.lang +++ b/src/main/java/assets/hbm/lang/en_US.lang @@ -1452,6 +1452,16 @@ item.part_carbon.name=Box of Carbon Dust item.part_copper.name=Box of Copper Dust item.part_lithium.name=Box of Lithium Dust item.part_plutonium.name=Box of Plutonium Dust +item.particle_aelectron.name=Antielectron Capsule +item.particle_amat.name=Antimatter Capsule +item.particle_aproton.name=Antiproton Capsule +item.particle_aschrab.name=Antischrabidium Capsule +item.particle_dark.name=Dark Matter Capsule +item.particle_empty.name=Empty Particle Capsule +item.particle_higgs.name=Higgs Boson Capsule +item.particle_muon.name=Muon Capsule +item.particle_sparkticle.name=Sparkticle Capsule +item.particle_strange.name=Strange Quark Capsule item.pedestal_steel.name=Steel Pedestal item.pellet_advanced.name=Advanced Watz Performance Improver item.pellet_antimatter.name=Antimatter Cluster diff --git a/src/main/java/assets/hbm/textures/entity/fbi.png b/src/main/java/assets/hbm/textures/entity/fbi.png new file mode 100644 index 0000000000000000000000000000000000000000..fa066f7e67f0e8c4d3f38f8dca7b32a3f4d1e060 GIT binary patch literal 2331 zcmV+$3FP*PP)66rzE9M#b{%M*w!~wTBy|+ z6B8AqiN;!Epf-Kz3ok7cY>R!hm>3fiV=OfE!52+wwKUq6CJIrR0cI=%EimZJaOd8$ z_wr%?Id@9s4q5~3hq-gk*>|74*80}>t+lVvVVvBvRgDO$peTX>@qZDVQ;Y#YaH^Q_ zIA0GvdO$k8<9ZI$X@ZF0RUsKBZTEdJUKO18SP_KaEU(&m@f%J%{sk8aILc$mzWg zs#gs;3>m_LWZh3FfRN*X{i)O;vcD0b^oc9T^+B#5qDK;+hzM)8zj$5!WKx8^#(b99 zgqAj)9HbgHp2#mR6zc^W=M`3F@kd%J-AO3A-oyB)>ynL)Ri7%(Ck2R;B}6kh3xZ*@ z5E1Wr-(EaL2UDe#xj_h`FwtldX-BxXNB?`z{T_gQ-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O-1rV%9Z5^t3TJK-_VTtQ_9HF<~b^#f)x$ozKC}j_USL zuWDyT*KioOHe+vkcci{YIVad=fW62OZ{gLQb&zIsoLH^%a>EB`h z)36Ki$eE;#I<-#C20r>!E^iG4v6AAyKx$1Ve0Wu~^V(F}eoQd=L;)X-HgSGA4!54)uwTmS$7 diff --git a/src/main/java/assets/hbm/textures/items/particle_aelectron.png b/src/main/java/assets/hbm/textures/items/particle_aelectron.png new file mode 100644 index 0000000000000000000000000000000000000000..23e8b7ed570982a5cba18c306f6f75070660fcda GIT binary patch literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf-hJ8jWdR_KNPPJ96M|)AP%o6&uc+(KFx@UNU9J zee35_j@%ZVJ)y%T`TgGomie4p!!p(;_DH^3Dsr(T{epwb;aLw&Y%MuHCeE0d+;f=4 zGF@Y-%Rj#F>fh}TIK6GYDmp9SW@+jL?xXMS^YHl^{ynDGdHLO(|6%1K`!sOz0YO~tAG9;33NDvr>mdKI;Vst0Abi*jsO4v literal 0 HcmV?d00001 diff --git a/src/main/java/assets/hbm/textures/items/particle_aproton.png b/src/main/java/assets/hbm/textures/items/particle_aproton.png new file mode 100644 index 0000000000000000000000000000000000000000..2fe5d3fa58565931ed1d76615fb97a38ad2c7f15 GIT binary patch literal 241 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf)3o9tBP*63Hg z+BTC_g6FWq!+o!<0w1Lw-Fne7T;$zvyH_`tw`9&zSn3jcJ@9T+w8&YOFpKAljwT+T zm*es=v7@8MaAI?zjADz%C*wQwzx-res=7{5jo|g<-8}E8m)}uJ5>?I5)&} TOgD1{`ia5Q)z4*}Q$iB}^k->1 literal 0 HcmV?d00001 diff --git a/src/main/java/com/hbm/blocks/fluid/MudBlock.java b/src/main/java/com/hbm/blocks/fluid/MudBlock.java index 782c448d2..4810eead5 100644 --- a/src/main/java/com/hbm/blocks/fluid/MudBlock.java +++ b/src/main/java/com/hbm/blocks/fluid/MudBlock.java @@ -3,9 +3,10 @@ package com.hbm.blocks.fluid; import java.util.Random; import com.hbm.blocks.ModBlocks; -import com.hbm.handler.ArmorUtil; import com.hbm.lib.ModDamageSource; import com.hbm.lib.RefStrings; +import com.hbm.util.ArmorUtil; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; diff --git a/src/main/java/com/hbm/blocks/generic/BarbedWire.java b/src/main/java/com/hbm/blocks/generic/BarbedWire.java index d63095f98..948ccdd74 100644 --- a/src/main/java/com/hbm/blocks/generic/BarbedWire.java +++ b/src/main/java/com/hbm/blocks/generic/BarbedWire.java @@ -1,9 +1,9 @@ package com.hbm.blocks.generic; import com.hbm.blocks.ModBlocks; -import com.hbm.handler.ArmorUtil; import com.hbm.lib.ModDamageSource; import com.hbm.potion.HbmPotion; +import com.hbm.util.ArmorUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; diff --git a/src/main/java/com/hbm/blocks/generic/BlockClorine.java b/src/main/java/com/hbm/blocks/generic/BlockClorine.java index 39dcb2511..5c25158f0 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockClorine.java +++ b/src/main/java/com/hbm/blocks/generic/BlockClorine.java @@ -2,7 +2,8 @@ package com.hbm.blocks.generic; import java.util.Random; -import com.hbm.handler.ArmorUtil; +import com.hbm.util.ArmorUtil; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; diff --git a/src/main/java/com/hbm/blocks/machine/BlockHadronAccess.java b/src/main/java/com/hbm/blocks/machine/BlockHadronAccess.java index a90c1c6ab..ee85b84c0 100644 --- a/src/main/java/com/hbm/blocks/machine/BlockHadronAccess.java +++ b/src/main/java/com/hbm/blocks/machine/BlockHadronAccess.java @@ -46,12 +46,19 @@ public class BlockHadronAccess extends Block { ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z)).getOpposite(); + for(ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + System.out.println(d.name() + " " + d.getOpposite().name()); + } + + System.out.println(dir.name()); + for(int i = 1; i < 3; i++) { if(world.getBlock(x + dir.offsetX * i, y + dir.offsetY * i, z + dir.offsetZ * i) == ModBlocks.hadron_core) { FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_hadron, world, x + dir.offsetX * i, y + dir.offsetY * i, z + dir.offsetZ * i); - } + + System.out.println(world.getBlock(x + dir.offsetX * i, y + dir.offsetY * i, z + dir.offsetZ * i).getUnlocalizedName()); } return true; diff --git a/src/main/java/com/hbm/entity/mob/EntityFBI.java b/src/main/java/com/hbm/entity/mob/EntityFBI.java new file mode 100644 index 000000000..c1a2a1522 --- /dev/null +++ b/src/main/java/com/hbm/entity/mob/EntityFBI.java @@ -0,0 +1,19 @@ +package com.hbm.entity.mob; + +import com.hbm.items.ModItems; + +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class EntityFBI extends EntityZombie { + + public EntityFBI(World p_i1745_1_) { + super(p_i1745_1_); + } + + protected void addRandomArmor() { + super.addRandomArmor(); + this.setCurrentItemOrArmor(0, new ItemStack(ModItems.gun_revolver_nopip)); + } +} diff --git a/src/main/java/com/hbm/entity/projectile/EntityBullet.java b/src/main/java/com/hbm/entity/projectile/EntityBullet.java index 1ffd09246..ee6300933 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityBullet.java +++ b/src/main/java/com/hbm/entity/projectile/EntityBullet.java @@ -35,9 +35,9 @@ import com.hbm.blocks.generic.RedBarrel; import com.hbm.entity.grenade.EntityGrenadeTau; import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.particle.EntityBSmokeFX; -import com.hbm.handler.ArmorUtil; import com.hbm.items.ModItems; import com.hbm.lib.ModDamageSource; +import com.hbm.util.ArmorUtil; import cpw.mods.fml.relauncher.ReflectionHelper; import cpw.mods.fml.relauncher.Side; diff --git a/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java b/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java index c6d630256..ebfc081ac 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java +++ b/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java @@ -15,12 +15,12 @@ import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionParticle; import com.hbm.explosion.ExplosionParticleB; -import com.hbm.handler.ArmorUtil; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.lib.ModDamageSource; import com.hbm.main.MainRegistry; import com.hbm.potion.HbmPotion; +import com.hbm.util.ArmorUtil; import com.hbm.util.BobMathUtil; import cpw.mods.fml.relauncher.ReflectionHelper; diff --git a/src/main/java/com/hbm/explosion/ExplosionChaos.java b/src/main/java/com/hbm/explosion/ExplosionChaos.java index 9be533a7e..b41920570 100644 --- a/src/main/java/com/hbm/explosion/ExplosionChaos.java +++ b/src/main/java/com/hbm/explosion/ExplosionChaos.java @@ -20,9 +20,9 @@ import com.hbm.entity.projectile.EntityRainbow; import com.hbm.entity.projectile.EntityRocket; import com.hbm.entity.projectile.EntityRubble; import com.hbm.entity.projectile.EntitySchrab; -import com.hbm.handler.ArmorUtil; import com.hbm.lib.ModDamageSource; import com.hbm.potion.HbmPotion; +import com.hbm.util.ArmorUtil; import net.minecraft.block.Block; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/hbm/explosion/ExplosionNukeGeneric.java b/src/main/java/com/hbm/explosion/ExplosionNukeGeneric.java index edfca1e1b..8438c276f 100644 --- a/src/main/java/com/hbm/explosion/ExplosionNukeGeneric.java +++ b/src/main/java/com/hbm/explosion/ExplosionNukeGeneric.java @@ -32,7 +32,6 @@ import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.entity.projectile.EntityExplosiveBeam; import com.hbm.entity.projectile.EntityMiniMIRV; import com.hbm.entity.projectile.EntityMiniNuke; -import com.hbm.handler.ArmorUtil; import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.ISource; import com.hbm.items.ModItems; @@ -40,6 +39,7 @@ import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; import com.hbm.main.MainRegistry; import com.hbm.tileentity.bomb.TileEntityTurretBase; +import com.hbm.util.ArmorUtil; import cofh.api.energy.IEnergyProvider; diff --git a/src/main/java/com/hbm/explosion/ExplosionThermo.java b/src/main/java/com/hbm/explosion/ExplosionThermo.java index b878197c7..4680323b3 100644 --- a/src/main/java/com/hbm/explosion/ExplosionThermo.java +++ b/src/main/java/com/hbm/explosion/ExplosionThermo.java @@ -4,7 +4,8 @@ import java.util.HashSet; import java.util.List; import com.hbm.blocks.ModBlocks; -import com.hbm.handler.ArmorUtil; +import com.hbm.util.ArmorUtil; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; diff --git a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java index a4375dc8b..c4e8ce91b 100644 --- a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java @@ -6,7 +6,6 @@ import java.util.Random; import com.hbm.config.BombConfig; import com.hbm.entity.particle.EntityBSmokeFX; import com.hbm.entity.projectile.EntityBulletBase; -import com.hbm.handler.ArmorUtil; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.interfaces.IBulletImpactBehavior; @@ -16,6 +15,7 @@ import com.hbm.lib.Library; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; import com.hbm.potion.HbmPotion; +import com.hbm.util.ArmorUtil; import com.hbm.util.BobMathUtil; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; diff --git a/src/main/java/com/hbm/inventory/gui/GUIHadron.java b/src/main/java/com/hbm/inventory/gui/GUIHadron.java index 30b5ef955..f7810c8c1 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIHadron.java +++ b/src/main/java/com/hbm/inventory/gui/GUIHadron.java @@ -66,5 +66,11 @@ public class GUIHadron extends GuiInfoContainer { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + if(hadron.isOn) + drawTexturedModalRect(guiLeft + 16, guiTop + 89, 206, 0, 18, 18); + + if(hadron.analysisOnly) + drawTexturedModalRect(guiLeft + 142, guiTop + 89, 206, 18, 18, 18); } } diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 21344e7c9..1941baed7 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -598,6 +598,18 @@ public class ModItems { public static Item cell_sas3; public static Item cell_antimatter; public static Item cell_anti_schrabidium; + + public static Item particle_empty; + public static Item particle_aproton; + public static Item particle_aelectron; + public static Item particle_amat; + public static Item particle_aschrab; + public static Item particle_higgs; + public static Item particle_muon; + public static Item particle_strange; + public static Item particle_dark; + public static Item particle_sparkticle; + public static Item pellet_antimatter; public static Item singularity; public static Item singularity_counter_resonant; @@ -2455,6 +2467,18 @@ public class ModItems { cell_tritium = new ItemRadioactive(0.5F).setUnlocalizedName("cell_tritium").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_tritium"); cell_sas3 = new ItemRadioactive(10F, false, true).setUnlocalizedName("cell_sas3").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_sas3"); cell_anti_schrabidium = new ItemDrop().setUnlocalizedName("cell_anti_schrabidium").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_anti_schrabidium"); + + particle_empty = new Item().setUnlocalizedName("particle_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":particle_empty"); + particle_aproton = new Item().setUnlocalizedName("particle_aproton").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_aproton"); + particle_aelectron = new Item().setUnlocalizedName("particle_aelectron").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_aelectron"); + particle_amat = new Item().setUnlocalizedName("particle_amat").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_amat"); + particle_aschrab = new Item().setUnlocalizedName("particle_aschrab").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_aschrab"); + particle_higgs = new Item().setUnlocalizedName("particle_higgs").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_higgs"); + particle_muon = new Item().setUnlocalizedName("particle_muon").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_muon"); + particle_strange = new Item().setUnlocalizedName("particle_strange").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_strange"); + particle_dark = new Item().setUnlocalizedName("particle_dark").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_dark"); + particle_sparkticle = new Item().setUnlocalizedName("particle_sparkticle").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_sparkticle"); + singularity = new ItemDrop().setUnlocalizedName("singularity").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.nuclear_waste).setTextureName(RefStrings.MODID + ":singularity"); singularity_counter_resonant = new ItemDrop().setUnlocalizedName("singularity_counter_resonant").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.nuclear_waste).setTextureName(RefStrings.MODID + ":singularity_alt"); singularity_super_heated = new ItemDrop().setUnlocalizedName("singularity_super_heated").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.nuclear_waste).setTextureName(RefStrings.MODID + ":singularity_5"); @@ -4621,6 +4645,18 @@ public class ModItems { GameRegistry.registerItem(cell_antimatter, cell_antimatter.getUnlocalizedName()); GameRegistry.registerItem(cell_anti_schrabidium, cell_anti_schrabidium.getUnlocalizedName()); + //Particle Containers + GameRegistry.registerItem(particle_empty, particle_empty.getUnlocalizedName()); + GameRegistry.registerItem(particle_aproton, particle_aproton.getUnlocalizedName()); + GameRegistry.registerItem(particle_aelectron, particle_aelectron.getUnlocalizedName()); + GameRegistry.registerItem(particle_amat, particle_amat.getUnlocalizedName()); + GameRegistry.registerItem(particle_aschrab, particle_aschrab.getUnlocalizedName()); + GameRegistry.registerItem(particle_higgs, particle_higgs.getUnlocalizedName()); + GameRegistry.registerItem(particle_muon, particle_muon.getUnlocalizedName()); + GameRegistry.registerItem(particle_strange, particle_strange.getUnlocalizedName()); + GameRegistry.registerItem(particle_dark, particle_dark.getUnlocalizedName()); + GameRegistry.registerItem(particle_sparkticle, particle_sparkticle.getUnlocalizedName()); + //OMG how the hell is that even possible!? GameRegistry.registerItem(singularity, singularity.getUnlocalizedName()); GameRegistry.registerItem(singularity_counter_resonant, singularity_counter_resonant.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/armor/ArmorEuphemium.java b/src/main/java/com/hbm/items/armor/ArmorEuphemium.java index 2a9a3e0f9..0e51169e8 100644 --- a/src/main/java/com/hbm/items/armor/ArmorEuphemium.java +++ b/src/main/java/com/hbm/items/armor/ArmorEuphemium.java @@ -9,9 +9,9 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -import com.hbm.handler.ArmorUtil; import com.hbm.items.ModItems; import com.hbm.lib.RefStrings; +import com.hbm.util.ArmorUtil; public class ArmorEuphemium extends ItemArmor { diff --git a/src/main/java/com/hbm/items/food/ItemEnergy.java b/src/main/java/com/hbm/items/food/ItemEnergy.java index a1400faf1..f8bfae04d 100644 --- a/src/main/java/com/hbm/items/food/ItemEnergy.java +++ b/src/main/java/com/hbm/items/food/ItemEnergy.java @@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; public class ItemEnergy extends Item { @@ -29,6 +30,12 @@ public class ItemEnergy extends Item { if (!world.isRemote) { + + if(player instanceof FakePlayer) { + world.newExplosion(player, player.posX, player.posY, player.posZ, 5F, true, true); + return super.onEaten(stack, world, player); + } + if(this == ModItems.can_smart) { player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); diff --git a/src/main/java/com/hbm/items/special/ItemCustomLore.java b/src/main/java/com/hbm/items/special/ItemCustomLore.java index b03766b4b..28d665637 100644 --- a/src/main/java/com/hbm/items/special/ItemCustomLore.java +++ b/src/main/java/com/hbm/items/special/ItemCustomLore.java @@ -3,9 +3,9 @@ package com.hbm.items.special; import java.util.List; import com.hbm.config.GeneralConfig; -import com.hbm.handler.ArmorUtil; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; +import com.hbm.util.ArmorUtil; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/com/hbm/items/special/ItemRadioactive.java b/src/main/java/com/hbm/items/special/ItemRadioactive.java index 507da3336..65cc98bd0 100644 --- a/src/main/java/com/hbm/items/special/ItemRadioactive.java +++ b/src/main/java/com/hbm/items/special/ItemRadioactive.java @@ -2,8 +2,8 @@ package com.hbm.items.special; import java.util.List; -import com.hbm.handler.ArmorUtil; import com.hbm.inventory.BreederRecipes; +import com.hbm.util.ArmorUtil; import com.hbm.util.ContaminationUtil; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/hbm/items/tool/WeaponSpecial.java b/src/main/java/com/hbm/items/tool/WeaponSpecial.java index 3c6e9b1f0..04559bfea 100644 --- a/src/main/java/com/hbm/items/tool/WeaponSpecial.java +++ b/src/main/java/com/hbm/items/tool/WeaponSpecial.java @@ -7,10 +7,10 @@ import com.google.common.collect.Multimap; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.entity.projectile.EntityRubble; -import com.hbm.handler.ArmorUtil; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; import com.hbm.potion.HbmPotion; +import com.hbm.util.ArmorUtil; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 2bd4d0c84..1f8773ebe 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -455,6 +455,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeBody.class, new RenderWormBody()); RenderingRegistry.registerEntityRenderingHandler(EntityDuck.class, new RenderDuck(new ModelChicken(), 0.3F)); RenderingRegistry.registerEntityRenderingHandler(EntityQuackos.class, new RenderQuacc(new ModelChicken(), 0.3F)); + RenderingRegistry.registerEntityRenderingHandler(EntityFBI.class, new RenderFBI()); //"particles" RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.smoke1, ModItems.smoke2, ModItems.smoke3, ModItems.smoke4, ModItems.smoke5, ModItems.smoke6, ModItems.smoke7, ModItems.smoke8 })); RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.b_smoke1, ModItems.b_smoke2, ModItems.b_smoke3, ModItems.b_smoke4, ModItems.b_smoke5, ModItems.b_smoke6, ModItems.b_smoke7, ModItems.b_smoke8 })); @@ -828,6 +829,31 @@ public class ClientProxy extends ServerProxy { double mZ = data.getDouble("mZ"); world.spawnParticle(data.getString("mode"), x, y, z, mX, mY, mZ); } + + if("hadron".equals(type)) { + + for(int i = 0; i < 30; i++) { + + EntityFX fx = null; + + if(i % 3 == 0) { + fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.0F, 0.0F, 0.0F); + } + if(i % 3 == 1) { + fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.01F, 1F); + } + if(i % 3 == 2) { + fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 1F, 1F, 0.1F); + } + + if(fx != null) { + fx.motionX = rand.nextGaussian() * 0.1; + fx.motionY = rand.nextGaussian() * 0.1; + fx.motionZ = rand.nextGaussian() * 0.1; + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + } + } } @Override diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index 957fba9b3..55937ff86 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -422,6 +422,8 @@ public class MainRegistry { GameRegistry.registerTileEntity(TileEntityPlasmaStruct.class, "tileentity_plasma_struct"); GameRegistry.registerTileEntity(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine"); GameRegistry.registerTileEntity(TileEntityHadronDiode.class, "tileentity_hadron_diode"); + GameRegistry.registerTileEntity(TileEntityHadronPower.class, "tileentity_hadron_power"); + GameRegistry.registerTileEntity(TileEntityHadron.class, "tileentity_hadron"); EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true); @@ -582,6 +584,7 @@ public class MainRegistry { EntityRegistry.registerGlobalEntityID(EntityMaskMan.class, "entity_mob_mask_man", EntityRegistry.findGlobalUniqueEntityId(), 0x818572, 0xC7C1B7); EntityRegistry.registerGlobalEntityID(EntityDuck.class, "entity_fucc_a_ducc", EntityRegistry.findGlobalUniqueEntityId(), 0xd0d0d0, 0xFFBF00); EntityRegistry.registerGlobalEntityID(EntityQuackos.class, "entity_elder_one", EntityRegistry.findGlobalUniqueEntityId(), 0xd0d0d0, 0xFFBF00); + EntityRegistry.registerGlobalEntityID(EntityFBI.class, "entity_ntm_fbi", EntityRegistry.findGlobalUniqueEntityId(), 0x008000, 0x404040); // EntityRegistry.registerGlobalEntityID(EntityBOTPrimeHead.class, // "entity_balls_o_tron_mk0", EntityRegistry.findGlobalUniqueEntityId(), diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index ef7d115bd..e0027ed3c 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -21,7 +21,6 @@ import com.hbm.entity.mob.EntityQuackos; import com.hbm.entity.mob.EntityTaintedCreeper; import com.hbm.entity.projectile.EntityBurningFOEQ; import com.hbm.entity.projectile.EntityMeteor; -import com.hbm.handler.ArmorUtil; import com.hbm.handler.BossSpawnHandler; import com.hbm.handler.RadiationWorldHandler; import com.hbm.handler.HTTPHandler; @@ -35,6 +34,7 @@ import com.hbm.packet.PlayerInformPacket; import com.hbm.packet.RadSurveyPacket; import com.hbm.saveddata.AuxSavedData; import com.hbm.saveddata.RadiationSavedData; +import com.hbm.util.ArmorUtil; import com.hbm.util.ContaminationUtil; import com.hbm.world.generator.TimedGenerator; diff --git a/src/main/java/com/hbm/render/entity/mob/RenderFBI.java b/src/main/java/com/hbm/render/entity/mob/RenderFBI.java new file mode 100644 index 000000000..171187979 --- /dev/null +++ b/src/main/java/com/hbm/render/entity/mob/RenderFBI.java @@ -0,0 +1,21 @@ +package com.hbm.render.entity.mob; + +import com.hbm.lib.RefStrings; +import com.hbm.render.model.ModelFBI; + +import net.minecraft.client.renderer.entity.RenderBiped; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; + +public class RenderFBI extends RenderBiped { + + private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/fbi.png"); + + public RenderFBI() { + super(new ModelFBI(), 0.5F, 1.0F); + } + + protected ResourceLocation getEntityTexture(EntityLiving entity) { + return texture; + } +} diff --git a/src/main/java/com/hbm/render/model/ModelFBI.java b/src/main/java/com/hbm/render/model/ModelFBI.java new file mode 100644 index 000000000..dd2eafb7b --- /dev/null +++ b/src/main/java/com/hbm/render/model/ModelFBI.java @@ -0,0 +1,13 @@ +package com.hbm.render.model; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.entity.Entity; + +public class ModelFBI extends ModelBiped { + + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + + this.aimedBow = true; + super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); + } +} diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityAMSBase.java b/src/main/java/com/hbm/tileentity/machine/TileEntityAMSBase.java index de31c04e8..5b25f413f 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityAMSBase.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityAMSBase.java @@ -5,7 +5,6 @@ import java.util.List; import com.hbm.entity.effect.EntityCloudFleijaRainbow; import com.hbm.entity.logic.EntityNukeExplosionMK4; -import com.hbm.handler.ArmorUtil; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.IFluidAcceptor; @@ -23,6 +22,7 @@ import com.hbm.packet.AuxGaugePacket; import com.hbm.packet.PacketDispatcher; import com.hbm.saveddata.SatelliteSavedData; import com.hbm.saveddata.satellites.SatelliteResonator; +import com.hbm.util.ArmorUtil; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityConverterHeRf.java b/src/main/java/com/hbm/tileentity/machine/TileEntityConverterHeRf.java index e63fd7116..70d7f9d65 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityConverterHeRf.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityConverterHeRf.java @@ -2,6 +2,7 @@ package com.hbm.tileentity.machine; import com.hbm.calc.Location; import com.hbm.interfaces.IConsumer; +import com.hbm.tileentity.TileEntityMachineBase; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyHandler; @@ -10,8 +11,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityConverterHeRf extends TileEntity implements IConsumer, IEnergyHandler { +public class TileEntityConverterHeRf extends TileEntityMachineBase implements IConsumer, IEnergyHandler { + public TileEntityConverterHeRf() { + super(0); + } + + @Override + public String getName() { + return ""; + } + public long power; public final long maxPower = 1000000; public EnergyStorage storage = new EnergyStorage(4000000, 2500000, 2500000); @@ -46,9 +56,19 @@ public class TileEntityConverterHeRf extends TileEntity implements IConsumer, IE storage.extractEnergy(energyTransferred, false); } } + + NBTTagCompound data = new NBTTagCompound(); + data.setInteger("rf", storage.getEnergyStored()); + data.setLong("he", power); + this.networkPack(data, 25); } } + public void networkUnpack(NBTTagCompound nbt) { + storage.setEnergyStored(nbt.getInteger("rf")); + power = nbt.getLong("he"); + } + @Override public boolean canConnectEnergy(ForgeDirection from) { return true; @@ -112,5 +132,4 @@ public class TileEntityConverterHeRf extends TileEntity implements IConsumer, IE public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { return 0; } - } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityConverterRfHe.java b/src/main/java/com/hbm/tileentity/machine/TileEntityConverterRfHe.java index 6310cf6c4..968c5c233 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityConverterRfHe.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityConverterRfHe.java @@ -6,14 +6,14 @@ import java.util.List; import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.ISource; import com.hbm.lib.Library; +import com.hbm.tileentity.TileEntityMachineBase; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyHandler; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityConverterRfHe extends TileEntity implements ISource, IEnergyHandler { +public class TileEntityConverterRfHe extends TileEntityMachineBase implements ISource, IEnergyHandler { public long power; public final long maxPower = 1000000; @@ -21,6 +21,15 @@ public class TileEntityConverterRfHe extends TileEntity implements ISource, IEne public int age = 0; public EnergyStorage storage = new EnergyStorage(4000000, 2500000, 2500000); + public TileEntityConverterRfHe() { + super(0); + } + + @Override + public String getName() { + return ""; + } + @Override public void updateEntity() { @@ -33,16 +42,26 @@ public class TileEntityConverterRfHe extends TileEntity implements ISource, IEne if(convert > 0) this.markDirty(); - } - age++; - if(age >= 20) - { - age = 0; + age++; + if(age >= 20) + { + age = 0; + } + + if(age == 9 || age == 19) + ffgeuaInit(); + + NBTTagCompound data = new NBTTagCompound(); + data.setInteger("rf", storage.getEnergyStored()); + data.setLong("he", power); + this.networkPack(data, 25); } - - if(age == 9 || age == 19) - ffgeuaInit(); + } + + public void networkUnpack(NBTTagCompound nbt) { + storage.setEnergyStored(nbt.getInteger("rf")); + power = nbt.getLong("he"); } @Override diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityCore.java b/src/main/java/com/hbm/tileentity/machine/TileEntityCore.java index f129e2f01..8384dde0f 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityCore.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityCore.java @@ -4,7 +4,6 @@ import java.util.List; import com.hbm.entity.effect.EntityCloudFleijaRainbow; import com.hbm.entity.logic.EntityNukeExplosionMK3; -import com.hbm.handler.ArmorUtil; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; @@ -12,6 +11,7 @@ import com.hbm.items.machine.ItemCatalyst; import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.util.ArmorUtil; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityHadron.java b/src/main/java/com/hbm/tileentity/machine/TileEntityHadron.java index 9ec7059c3..1884fa1de 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityHadron.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityHadron.java @@ -1,12 +1,26 @@ package com.hbm.tileentity.machine; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.List; +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.machine.BlockHadronCoil; +import com.hbm.blocks.machine.BlockHadronPlating; import com.hbm.interfaces.IConsumer; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.tileentity.machine.TileEntityHadronDiode.DiodeConfig; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; @@ -16,7 +30,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer public static final long maxPower = 1000000000; public boolean isOn = false; - public boolean analysis = true; + public boolean analysisOnly = true; public TileEntityHadron() { super(3); @@ -33,21 +47,47 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer if(!worldObj.isRemote) { drawPower(); + + if(particles.isEmpty() && slots[0] != null) { + ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()); + particles.add(new Particle(slots[0].getItem(), dir, xCoord, yCoord, zCoord)); + this.decrStackSize(0, 1); + } + + if(!particles.isEmpty()) + updateParticles(); + + for(Particle p : particlesToRemove) { + particles.remove(p); + } + + NBTTagCompound data = new NBTTagCompound(); + data.setBoolean("isOn", isOn); + data.setLong("power", power); + data.setBoolean("analysis", analysisOnly); + this.networkPack(data, 50); } } + @Override + public void networkUnpack(NBTTagCompound data) { + this.isOn = data.getBoolean("isOn"); + this.power = data.getLong("power"); + this.analysisOnly = data.getBoolean("analysis"); + } + @Override public void handleButtonPacket(int value, int meta) { if(meta == 0) this.isOn = !this.isOn; if(meta == 1) - this.analysis = !this.analysis; + this.analysisOnly = !this.analysisOnly; } private void drawPower() { - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + for(ForgeDirection dir : getRandomDirs()) { if(power == maxPower) return; @@ -69,10 +109,16 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer } } + private void finishParticle(Particle p, boolean analysisOnly) { + particlesToRemove.add(p); + worldObj.playSoundEffect(p.posX, p.posY, p.posZ, "random.orb", 10, 1); + } + static final int maxParticles = 1; List particles = new ArrayList(); + List particlesToRemove = new ArrayList(); - private void updateParticle() { + private void updateParticles() { for(Particle particle : particles) { particle.update(); @@ -95,7 +141,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer return maxPower; } - public static class Particle { + public class Particle { //Starting values Item item; @@ -107,6 +153,11 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer //Progressing values int momentum; int charge; + int analysis; + static final int maxCharge = 10; + boolean isCheckExempt = false; + + boolean expired = false; public Particle(Item item, ForgeDirection dir, int posX, int posY, int posZ) { this.item = item; @@ -115,12 +166,382 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer this.posY = posY; this.posZ = posZ; - this.charge = 10; + this.charge = maxCharge; this.momentum = 0; } + public void expire() { + + if(expired) + return; + + this.expired = true; + particlesToRemove.add(this); + worldObj.newExplosion(null, posX + 0.5, posY + 0.5, posZ + 0.5, 10, false, false); + System.out.println("Last dir: " + dir.name()); + System.out.println("Last pos: " + posX + " " + posY + " " + posZ); + Thread.currentThread().dumpStack(); + } + + public boolean isExpired() { + return this.expired; + } + public void update() { + if(expired) //just in case + return; + + this.charge--; + + changeDirection(this); + makeSteppy(this); + checkSegment(this); + isCheckExempt = false; //clearing up the exemption we might have held from the previous turn, AFTER stepping + + if(charge <= 0) + this.expire(); } } + + /** + * Moves the particle and does all the checks required to do so + * Handles diode entering behavior and whatnot + * @param p + */ + public void makeSteppy(Particle p) { + + ForgeDirection dir = p.dir; + + p.posX += dir.offsetX; + p.posY += dir.offsetY; + p.posZ += dir.offsetZ; + + int x = p.posX; + int y = p.posY; + int z = p.posZ; + + Block block = worldObj.getBlock(x, y, z); + TileEntity te = worldObj.getTileEntity(x, y, z); + + if(te instanceof TileEntityHadron) { + + if(p.analysis != 3) + p.expire(); + else + this.finishParticle(p, false); + + return; + } + + if(block.getMaterial() != Material.air && block != ModBlocks.hadron_diode) + p.expire(); + + if(coilValue(worldObj.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) > 0) + p.isCheckExempt = true; + } + + /** + * All the checks done *after* the particle moves one tile + * @param p + */ + public void checkSegment(Particle p) { + + ForgeDirection dir = p.dir; + int x = p.posX; + int y = p.posY; + int z = p.posZ; + + //we make a set of axis where the directional axis is 0 and the normals are 1 + //that allows us to easily iterate through a rectangle that is normal to our moving direction + int dX = 1 - Math.abs(dir.offsetX); + int dY = 1 - Math.abs(dir.offsetY); + int dZ = 1 - Math.abs(dir.offsetZ); + + //whether the particle has entered an analysis chamber + //-> all coils have to be air + //-> all platings have to be analysis chamber walls + boolean analysis = true; + + for(int a = x - dX * 2; a <= x + dX * 2; a++) { + for(int b = y - dY * 2; b <= y + dY * 2; b++) { + for(int c = z - dZ * 2; c <= z + dZ * 2;c++) { + + Block block = worldObj.getBlock(a, b, c); + + /** ignore the center for now */ + if(a == x && b == y && c == z) { + + //we are either in a diode or the core - no analysis for you now + if(block.getMaterial() != Material.air) + analysis = false; + + continue; + } + + int ix = Math.abs(x - a); + int iy = Math.abs(y - b); + int iz = Math.abs(z - c); + + /** check coils, all abs deltas are 1 or less */ + if(ix <= 1 && iy <= 1 && iz <= 1) { + + //are we exempt from the coil examination? nice, skip checks only for inner magnets, not the corners! + if(p.isCheckExempt && ix + iy + iz == 1) { + continue; + } + + //coil is air, analysis can remain true + if(block.getMaterial() == Material.air && analysis) { + continue; + } + + //not air -> not an analysis chamber + analysis = false; + + int coilVal = coilValue(block); + + //not a valid coil: kablam! + if(coilVal == 0) { + p.expire(); + } else { + p.momentum += coilVal; + } + + continue; + } + + /** now we check the plating, sum of all local positions being 3 or less gives us the outer plating without corners */ + if(ix + iy + iz <= 3) { + + //if the plating is for the analysis chamber, continue no matter what + if(isAnalysis(block)) + continue; + + //no analysis chamber -> turn off analysis and proceed + analysis = false; + + //a plating? good, continue + if(isPlating(block)) + continue; + + TileEntity te = worldObj.getTileEntity(a, b, c); + + //power plugs are also ok, might as well succ some energy when passing + if(te instanceof TileEntityHadronPower) { + + TileEntityHadronPower plug = (TileEntityHadronPower)te; + + int req = p.maxCharge - p.charge; //how many "charge points" the particle needs to be fully charged + long bit = plug.maxPower / p.maxCharge; //how much HE one "charge point" is + + int times = (int) (plug.getPower() / bit); //how many charges the plug has to offer + + int total = Math.min(req, times); //whichever is less, the charges in the plug or the required charges + + p.charge += total; + plug.setPower(plug.getPower() - total * bit); + + continue; + } + + //Are we exempt from checking the plating? skip all the plating blocks where branches could be + if(p.isCheckExempt && ix + iy + iz == 2) { + continue; + } + + System.out.println("Was exempt: " + p.isCheckExempt); + worldObj.setBlock(a, b, c, Blocks.dirt); + + p.expire(); + } + } + } + } + + if(analysis) { + + p.analysis++; + + //if the analysis chamber is too big, destroy + if(p.analysis > 3) + p.expire(); + + if(p.analysis == 2) { + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "hadron"); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5), new TargetPoint(worldObj.provider.dimensionId, p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5, 25)); + } + + //if operating in line accelerator mode, halt after 2 blocks and staart the reading + if(this.analysisOnly && p.analysis == 2) { + this.finishParticle(p, true); + } + + } else { + + //if the analysis stops despite being short of 3 steps in the analysis chamber, destroy + if(p.analysis > 0 && p.analysis < 3) + p.expire(); + } + } + + /** + * Checks whether we can go forward or if we might want to do a turn + * Handles the better part of the diode behavior + * @param p + */ + public void changeDirection(Particle p) { + + ForgeDirection dir = p.dir; + + int x = p.posX; + int y = p.posY; + int z = p.posZ; + + int nx = x + dir.offsetX; + int ny = y + dir.offsetY; + int nz = z + dir.offsetZ; + + Block next = worldObj.getBlock(nx, ny, nz); + + TileEntity te = worldObj.getTileEntity(nx, ny, nz); + + //the next block appears to be a diode, let's see if we can enter + if(te instanceof TileEntityHadronDiode) { + TileEntityHadronDiode diode = (TileEntityHadronDiode)te; + + if(diode.getConfig(p.dir.getOpposite().ordinal()) != DiodeConfig.IN) { + //it appears as if we have slammed into the side of a diode, ouch + p.expire(); + } + + //there's a diode ahead, turn off checks so we can make the curve + p.isCheckExempt = true; + + //the *next* block is a diode, we are not in it yet, which means no turning and no check exemption. too bad kiddo. + return; + } + + //instead of the next TE, we are looking at the current one - the diode (maybe) + te = worldObj.getTileEntity(x, y, z); + + //if we are currently in a diode, we might want to consider changing dirs + if(te instanceof TileEntityHadronDiode) { + + //since we are *in* a diode, we might want to call the warrant officer for + //an exemption for the coil check, because curves NEED holes to turn into, and + //checking for coils in spaces where there cannot be coils is quite not-good + p.isCheckExempt = true; + + TileEntityHadronDiode diode = (TileEntityHadronDiode)te; + + //the direction in which we were going anyway is an output, so we will keep going + if(diode.getConfig(dir.ordinal()) == DiodeConfig.OUT) { + return; + + //well then, iterate through some random directions and hope a valid output shows up + } else { + + List dirs = getRandomDirs(); + + for(ForgeDirection d : dirs) { + + if(d == dir || d == dir.getOpposite()) + continue; + + //looks like we can leave! + if(diode.getConfig(d.ordinal()) == DiodeConfig.OUT) { + //set the direction and leave this hellhole + p.dir = d; + return; + } + } + } + } + + //next step is air or the core, proceed + if(next.getMaterial() == Material.air || next == ModBlocks.hadron_core) + return; + + //so, the next block is most certainly a wall. not good. perhaps we could try turning? + if(coilValue(next) > 0) { + + ForgeDirection validDir = ForgeDirection.UNKNOWN; + + List dirs = getRandomDirs(); + + System.out.println("Starting as " + dir.name()); + + //let's look at every direction we could go in + for(ForgeDirection d : dirs) { + + if(d == dir || d == dir.getOpposite()) + continue; + + System.out.println("Trying " + d.name()); + + //there is air! we can pass! + if(worldObj.getBlock(x + d.offsetX, y + d.offsetY, z + d.offsetZ).getMaterial() == Material.air) { + + if(validDir == ForgeDirection.UNKNOWN) { + validDir = d; + System.out.println("yes"); + + //it seems like there are two or more possible ways, which is not allowed without a diode + //sorry kid, nothing personal + } else { + System.out.println("what"); + p.expire(); + return; + } + } + } + + //set the new direction + p.dir = validDir; + p.isCheckExempt = true; + return; + } + + p.expire(); + } + + /** + * Dear god please grant me the gift of death and end my eternal torment + * @return + */ + private List getRandomDirs() { + + List rands = Arrays.asList(new Integer[] {0, 1, 2, 3, 4, 5} ); + Collections.shuffle(rands); + List dirs = new ArrayList(); + for(Integer i : rands) { + dirs.add(ForgeDirection.getOrientation(i)); + } + return dirs; + } + + public int coilValue(Block b) { + + if(b instanceof BlockHadronCoil) + return ((BlockHadronCoil)b).factor; + + return 0; + } + + public boolean isPlating(Block b) { + + return b instanceof BlockHadronPlating || + b instanceof BlockHadronCoil || + b == ModBlocks.hadron_plating_glass || + b == ModBlocks.hadron_analysis_glass || + b == ModBlocks.hadron_access; + } + + public boolean isAnalysis(Block b) { + + return b == ModBlocks.hadron_analysis || + b == ModBlocks.hadron_analysis_glass; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityLockableBase.java b/src/main/java/com/hbm/tileentity/machine/TileEntityLockableBase.java index f5ec26020..7e32bc7b7 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityLockableBase.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityLockableBase.java @@ -1,9 +1,9 @@ package com.hbm.tileentity.machine; -import com.hbm.handler.ArmorUtil; import com.hbm.items.ModItems; import com.hbm.items.tool.ItemKey; import com.hbm.main.MainRegistry; +import com.hbm.util.ArmorUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityTesla.java b/src/main/java/com/hbm/tileentity/machine/TileEntityTesla.java index 8280fca0f..d0ffb6ae8 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityTesla.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityTesla.java @@ -8,11 +8,11 @@ import com.hbm.entity.mob.EntityCyberCrab; import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.mob.EntityTaintCrab; import com.hbm.entity.mob.EntityTeslaCrab; -import com.hbm.handler.ArmorUtil; import com.hbm.interfaces.IConsumer; import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.util.ArmorUtil; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/com/hbm/handler/ArmorUtil.java b/src/main/java/com/hbm/util/ArmorUtil.java similarity index 94% rename from src/main/java/com/hbm/handler/ArmorUtil.java rename to src/main/java/com/hbm/util/ArmorUtil.java index 847028324..df2e06767 100644 --- a/src/main/java/com/hbm/handler/ArmorUtil.java +++ b/src/main/java/com/hbm/util/ArmorUtil.java @@ -1,5 +1,6 @@ -package com.hbm.handler; +package com.hbm.util; +import com.hbm.handler.HazmatRegistry; import com.hbm.items.ModItems; import com.hbm.lib.Library; import com.hbm.potion.HbmPotion; @@ -107,10 +108,10 @@ public class ArmorUtil { if(armor[0] == null || armor[1] == null || armor[2] == null || armor[3] == null) return false; - if(isFaradayArmor(armor[0].getItem()) && - isFaradayArmor(armor[1].getItem()) && - isFaradayArmor(armor[2].getItem()) && - isFaradayArmor(armor[3].getItem())) + if(isFaradayArmor(armor[0]) && + isFaradayArmor(armor[1]) && + isFaradayArmor(armor[2]) && + isFaradayArmor(armor[3])) return true; return false; @@ -141,7 +142,7 @@ public class ArmorUtil { "spacesuit" }; - public static boolean isFaradayArmor(Item item) { + public static boolean isFaradayArmor(ItemStack item) { String name = item.getUnlocalizedName(); @@ -151,6 +152,9 @@ public class ArmorUtil { return true; } + if(HazmatRegistry.getCladding(item) > 0) + return true; + return false; }