From afcb143d7dbb2644395aa69af3de6e355b425e1d Mon Sep 17 00:00:00 2001 From: HbmMods Date: Fri, 4 May 2018 22:07:14 +0200 Subject: [PATCH] Satellite linker, satellite save structure functionality, chip --- assets/hbm/lang/de_DE.lang | 12 + assets/hbm/lang/en_US.lang | 12 + .../blocks/machine_satlinker_side.png | Bin 0 -> 574 bytes .../textures/blocks/machine_satlinker_top.png | Bin 0 -> 515 bytes assets/hbm/textures/gui/gui_linker.png | Bin 0 -> 1317 bytes assets/hbm/textures/gui/gui_sat_interface.png | Bin 0 -> 2265 bytes assets/hbm/textures/models/missileAA.png | Bin 0 -> 7609 bytes com/hbm/blocks/ModBlocks.java | 6 + com/hbm/blocks/bomb/LaunchPad.java | 42 +-- com/hbm/blocks/machine/MachineSatLinker.java | 129 ++++++++ com/hbm/blocks/test/TestEventTester.java | 8 +- com/hbm/entity/missile/EntityCarrier.java | 56 +++- .../missile/EntityMissileAntiBallistic.java | 294 ++++++++---------- com/hbm/handler/GUIHandler.java | 19 ++ .../container/ContainerMachineSatLinker.java | 83 +++++ .../inventory/gui/GUIMachineSatLinker.java | 60 ++++ com/hbm/items/ModItems.java | 18 +- com/hbm/items/tool/ItemSatChip.java | 33 ++ com/hbm/main/MainRegistry.java | 7 +- com/hbm/main/ResourceManager.java | 1 + com/hbm/packet/TEMissilePacket.java | 2 + .../render/entity/RenderMissileGeneric.java | 4 +- .../tileentity/RenderLaunchPadTier1.java | 6 + com/hbm/saveddata/SatelliteSaveStructure.java | 9 +- com/hbm/saveddata/SatelliteSavedData.java | 32 +- .../machine/TileEntityMachineRadar.java | 7 +- .../machine/TileEntityMachineSatLinker.java | 189 +++++++++++ 27 files changed, 830 insertions(+), 199 deletions(-) create mode 100644 assets/hbm/textures/blocks/machine_satlinker_side.png create mode 100644 assets/hbm/textures/blocks/machine_satlinker_top.png create mode 100644 assets/hbm/textures/gui/gui_linker.png create mode 100644 assets/hbm/textures/gui/gui_sat_interface.png create mode 100644 assets/hbm/textures/models/missileAA.png create mode 100644 com/hbm/blocks/machine/MachineSatLinker.java create mode 100644 com/hbm/inventory/container/ContainerMachineSatLinker.java create mode 100644 com/hbm/inventory/gui/GUIMachineSatLinker.java create mode 100644 com/hbm/items/tool/ItemSatChip.java create mode 100644 com/hbm/tileentity/machine/TileEntityMachineSatLinker.java diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 867d8cd21..31c0005cd 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -20,6 +20,8 @@ achievement.c44=Kapitel 44 achievement.c44.desc=Galvanisch verzinkt! ...das macht in der Übersetzung sowas von keinen Sinn. achievement.c20_5=Kapitel [ZWANZIG KOMMA FÜNF] achievement.c20_5.desc=??? +achievement.space=Die finale Grenz-ach vergiss es +achievement.space.desc=Scheitere in jeder möglichen Weise und verschwende 90 Millionen Dollar an Forschungsgeldern. potion.hbm_taint=Verdorben potion.hbm_taint_boost=Verdorbenes Herz @@ -228,6 +230,8 @@ tile.turret_cwis.name=Phalanx Mk-15 CIWS tile.turret_cheapo.name=Billigsdorfer Gatling-Geschütz tile.machine_radar.name=Radar container.radar=Radar +tile.machine_satlinker.name=Satelliten-ID-Manager +container.satLinker=SatLink-Gerät item.turret_control.name=Geschützsteuerung item.turret_chip.name=Geschütz-KI-Chip @@ -796,6 +800,7 @@ item.cell_anti_schrabidium.name=Antischrabidiumzelle item.singularity.name=Singularität item.singularity_counter_resonant.name=Eingefasste nicht-resonante Singularität item.singularity_super_heated.name=Supererhitzte resonante Singularität +item.singularity_spark.name=Spark'sche Singularität item.black_hole.name=Miniatur Schwarzes Loch item.crystal_xen.name=Künstlicher Xen-Kristall item.pellet_antimatter.name=Antimateriencluster @@ -1277,6 +1282,13 @@ item.missile_taint.name=Verdorbene Rakete item.missile_micro.name=Mikro-Atomrakete item.missile_carrier.name=HTR-01 Trägerrakete +item.sat_mapper.name=Oberflächen-Abtastungssatellit +item.sat_scanner.name=Satellit mit Tiefenscanning-Modul +item.sat_radar.name=Radar-Überwachungssatellit +item.sat_laser.name=Orbitaler Todesstrahl +item.sat_foeq.name=PEAF - Mk.I FOEQ Dunasonde mit experimenter nuklearer Schubdüse +item.sat_resonator.name=Xeniumresonator-Satellit +item.sat_chip.name=Satelliten-ID-Chip item.hazmat_helmet.name=Strahlenschutzhelm item.hazmat_plate.name=Strahlenschutzbrustplatte diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 282d8f12e..9b0513e9a 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -20,6 +20,8 @@ achievement.c44=Chapter 44 achievement.c44.desc=Galvanized! I mean, zinc! achievement.c20_5=Chapter [TWENTY POINT FIVE] achievement.c20_5.desc=??? +achievement.space=The Final Front-ah forget it +achievement.space.desc=Fail in every way possible and waste funds worth 90 million dollars. potion.hbm_taint=Tainted potion.hbm_taint_boost=Tainted Heart @@ -240,6 +242,8 @@ tile.turret_cwis.name=Phalanx Mk-15 CIWS tile.turret_cheapo.name=Cheapo Gatling Sentry tile.machine_radar.name=Radar container.radar=Radar +tile.machine_satlinker.name=Satellite ID Manager +container.satLinker=SatLink Device item.turret_control.name=Turret Controller item.turret_chip.name=Turret AI-Chip @@ -795,6 +799,7 @@ item.cell_anti_schrabidium.name=Antischrabidium Cell item.singularity.name=Singularity item.singularity_counter_resonant.name=Contained Counter-Resonant Singularity item.singularity_super_heated.name=Superheated Resonating Singularity +item.singularity_spark.name=Spark Singularity item.black_hole.name=Miniature Black Hole item.crystal_xen.name=Artificial Xen Crystal item.pellet_antimatter.name=Antimatter Cluster @@ -1276,6 +1281,13 @@ item.missile_taint.name=Taint-Tipped Missile item.missile_micro.name=Micro-Nuclear Missile item.missile_carrier.name=HTR-01 Carrier Rocket +item.sat_mapper.name=Surface Mapping Satellite +item.sat_scanner.name=Satellite with Depth-Resource Scanning Module +item.sat_radar.name=Radar Survey Satellite +item.sat_laser.name=Orbital Death Ray +item.sat_foeq.name=PEAF - Mk.I FOEQ Duna Probe with experimental Nuclear Propulsion +item.sat_resonator.name=Xenium Resonator Satellite +item.sat_chip.name=Satellite ID-Chip item.hazmat_helmet.name=Hazmat Helmet item.hazmat_plate.name=Hazmat Chestplate diff --git a/assets/hbm/textures/blocks/machine_satlinker_side.png b/assets/hbm/textures/blocks/machine_satlinker_side.png new file mode 100644 index 0000000000000000000000000000000000000000..161f74fcc52cf51aeba992efc686225debacd795 GIT binary patch literal 574 zcmV-E0>S->P)BXdd;Pjo_ous z!0W z@4B=)eSF`?vMi*OtU=joY z#lr$-&Opz=t7Ad(*LldGdDq=2b{q%OG-)=Qad%kPMGO*|RLH>08JIaE1{Nus&C+hS z34#ECOnN_@;2(qJlb2vwBkI?;@mo8NgOrj+qXEEbwW8PSq3b%6>5NvV&&Ap0b`CTx z#bWV09y#g?uv{(yFmnb#oP)hu31uF@kNPKIojll1-~GKW=Ra{>mt@4?^u%C1_Q|C8 zfiQJIoV-X;G9v~M{slFxpp+Y~ZQI_-*Geda5XviuMhKyRojsub0zfZNbC>Un{Qv*} M07*qoM6N<$g0WNsoB#j- literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/machine_satlinker_top.png b/assets/hbm/textures/blocks/machine_satlinker_top.png new file mode 100644 index 0000000000000000000000000000000000000000..78f60404ddcbdceb73f73331dc385ada65227135 GIT binary patch literal 515 zcmV+e0{s1nP)15)sn(pj=ABHrKNddnfsZZ6_@ zgUkH`jzz>9w42Kj5XxB&BOHOYl%o`yrfJf2@pTAElk3uFdLQzB^3D6aPnf%?xr+jn z5JL64D8IMAXYQgL$5B#BrM&EA`+C2JIslZElGBqHl%;F;09ZzG#pgQid|)_%nh=6N zUp&74e$8E(rp96s?ReAFXc+MLSWt66&j>;oPo@C;_5T47MO!eAv#&^!gqP1+gv%9A z-biLMk3&<3S8p9U?G_J@9#r5sjw|qby{6M{Vd!-ljRt-X4(~sOAP5+aZW&Le6*vcT z7+`RHL%3XVadt@9kt_+YEl3XB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@~ literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/gui/gui_sat_interface.png b/assets/hbm/textures/gui/gui_sat_interface.png new file mode 100644 index 0000000000000000000000000000000000000000..b36b6745af969c55fd4f7766999458b5cbe01707 GIT binary patch literal 2265 zcmcguSyx6J)a=Wf>4C7Cw~4$Yzxwi?Ya4s)8(nG6WF94hgaZK{47P*cK6G zDU5tbGNhH-}#;M-8=riXH}JT zl>q>%o*r%i0KlLr3@FM&A~fY05)yK$E}rKVp^>flcN_qU_dMNBpT|^i=q=ytQ~su~ z!GPzh({OnnmE<3&Wf9FuNnW)nMp7+hOBI<1=#YIE6l}H;HRLC_;DXbwhwLnG-F@P9 zWwt9hvlLzK&134sY8LW;@f?U$0GMeUkKVE>YiwGH>aU*#3p8JQnL*&i(NZ zG#hW$iEraBNH7LoGV2wv>`(vtI+Z7TV5TvolSwYp`=(fD{|(!N*rA)IBqDY*2A@kh-IKaf9-9?i z?jxM&&G*a#e%#LWGa-}&Ct<8UJ86O3;#c%+kS7hIYOcYYUBxa<8tu{x5n%)L&i;LQ zIb=>gC3nNfcqA&Eay7 zY=|O=Su^`*g1q+)0_tPG5{P*gE*g1?q6@I9MiE--y6n3|X|$?6%v}+9jB5g2ivm+p za__uC5Fv09(v3+CW(^8qbIp=sbubmGEi>|Tk`f@&*anAe;UJ~~%i~@eK0;Cfx+iqw zB|Jl_+|94>CRgE@et9IgSEd8T-eN|VYazd^w8vb2BdKy(8{26H14ZdZ)-xRrFaV$L zwVmIXwvi)J;>!ax66%Yg(QMfi&mqS}l@n@xAUMTmb3FDq>Nqn_Vgx-h2C{#& zJP!$`=7SU)YIaTJz}Pa^8y!&r^2n>4XYaos$N?rO?`8#{%G=+!gbz;qSt5lIaWkhb z{|F&ay@bCmVhu0bhKfzbKI2w)8v7fu^m8hY+a3`~a!I=Rdl>3bH$q&0KdT7JhNVu@ z-{S|h10Q^RMS23dGTPGZKU~pgr(7bpO#1Og1jz2-?e-iI?}4o`vuy`)gu2+Xk|SOY zFFm!FVirRhz(ykw1PzVE()#yL1t2zcsb@31 zL+srhu4afuU6OYcO89e3=dFSIRs{gZ2!A6Q8#5>DrSwc%G#4A>BoT}*N*7wgOM!Jk z_ADKioXFyUB4EGnl z5Le`A+!&VgQ}%OdQnG@MNx9YV3gh;+ka^i{@iO`9D83KXCH!&G$6NF zDj@JZX$qDJ(SX*IZm~||BMJQgPSpYS2{hboHN%NF+7U>o0scWJOp&jzZ|V9=?`}rgI&Wy+Mm<~sl z`;^G?t&b6-cVO{$`_Tm#@ekHP{f7|Xv9?y3m)@*v_C7wue5Kf;Zy}1(&+S63=x2oy z4F^*>YzARRk3BLk^vfhZ=Q?I{`jdH+_WE&B-k{SzDz(p45Wm2z6~MO#bcIR2jtOG~ z3a5=tvl8Y~l{0p8watGGb4S$reJ2%?62mNvQ{HUB&DnFOX?PT2ffNi zqZ;t20A<)=2R$GpY(>7_4bwX>v}>xXNM$g5GR3nl)NN6eAa}Z-Be1U$B-ZXee3b+4 t1wGf`VLo1-nmtTYR)Ibt|7%RWl){+C>2@~v>uUGzc)I(#5nLkj{{#E1<4*tp literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/models/missileAA.png b/assets/hbm/textures/models/missileAA.png new file mode 100644 index 0000000000000000000000000000000000000000..0c74ad1502ab7ec7e308543a132d905a62cec67d GIT binary patch literal 7609 zcmbVR_dgrn_qI!IS}Q5FwPLH$3N5Or)fz?B3Q~KueIsg>sMe}IgKDLZ*bzv zXxq^s$g}iA7uDW4geR^a)<{-cc9F}hAXz2fG5%hyxh3uoV(>L@YZ)D`9&pQd}9x7Mr9#m_*dHp;ZI2F}D;4wcIF{zjbOiBiT>w zcnA)aSdfwXUOo|WcDjS#*$OJ}U#`7L3+%9SLabt5mbjOy z`Vz!nLe46RiFr&}#<0!4iZ#Ic_r^|;hDtUap-4FmG5b!_$f)8{ z^XMiQCNNy0PMrZxLQPrAWjK5K_T!8eCNNi z4v7baUo3!qZ;YeVXRHU!Yrnll+vnBZ>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0~61(Ng-I1kS5e#onp`F?OWh}!j2@B*j(v#SG}yoQW-on(XG^W GjQT&8AP}= 75000) - { - EntityMissileAntiBallistic missile = new EntityMissileAntiBallistic(p_149695_1_, xCoord, zCoord, x + 0.5F, y + 2F, z + 0.5F); - if (!p_149695_1_.isRemote) - p_149695_1_.spawnEntityInWorld(missile); - entity.power -= 75000; - entity.slots[0] = null; p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F); } @@ -391,16 +381,6 @@ public class LaunchPad extends BlockContainer implements IBomb { p_149695_1_.spawnEntityInWorld(missile); entity.power -= 75000; - entity.slots[0] = null; - p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F); - } - if(entity.slots[0] != null && entity.slots[0].getItem() == ModItems.missile_anti_ballistic && entity.power >= 75000) - { - EntityMissileAntiBallistic missile = new EntityMissileAntiBallistic(p_149695_1_, xCoord, zCoord, x + 0.5F, y + 2F, z + 0.5F); - if (!p_149695_1_.isRemote) - p_149695_1_.spawnEntityInWorld(missile); - entity.power -= 75000; - entity.slots[0] = null; p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F); } @@ -442,6 +422,12 @@ public class LaunchPad extends BlockContainer implements IBomb { missile.posX = x + 0.5F; missile.posY = y + 0.5F; missile.posZ = z + 0.5F; + + if(entity.slots[1] != null) + missile.setPayload(entity.slots[1]); + + entity.slots[1] = null; + if (!p_149695_1_.isRemote) p_149695_1_.spawnEntityInWorld(missile); entity.power -= 75000; @@ -449,6 +435,22 @@ public class LaunchPad extends BlockContainer implements IBomb { entity.slots[0] = null; p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F); } + + if(entity.slots[0] != null && entity.slots[0].getItem() == ModItems.missile_anti_ballistic && entity.power >= 75000) + { + EntityMissileAntiBallistic missile = new EntityMissileAntiBallistic(p_149695_1_); + missile.posX = x + 0.5F; + missile.posY = y + 0.5F; + missile.posZ = z + 0.5F; + + if (!p_149695_1_.isRemote) + p_149695_1_.spawnEntityInWorld(missile); + + entity.power -= 75000; + + entity.slots[0] = null; + p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F); + } } } diff --git a/com/hbm/blocks/machine/MachineSatLinker.java b/com/hbm/blocks/machine/MachineSatLinker.java new file mode 100644 index 000000000..9f45cb9dc --- /dev/null +++ b/com/hbm/blocks/machine/MachineSatLinker.java @@ -0,0 +1,129 @@ +package com.hbm.blocks.machine; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.lib.RefStrings; +import com.hbm.main.MainRegistry; +import com.hbm.tileentity.machine.TileEntityMachineShredder; +import com.hbm.tileentity.machine.TileEntityMachineSatLinker; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class MachineSatLinker extends BlockContainer { + + private final Random field_149933_a = new Random(); + private Random rand; + private static boolean keepInventory; + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + public MachineSatLinker(Material p_i45386_1_) { + super(p_i45386_1_); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityMachineSatLinker(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_satlinker_top"); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_satlinker_side"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + if(world.isRemote) + { + return true; + } else if(!player.isSneaking()) + { + TileEntityMachineSatLinker entity = (TileEntityMachineSatLinker) world.getTileEntity(x, y, z); + if(entity != null) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_satlinker, world, x, y, z); + } + return true; + } else { + return false; + } + } + + @Override + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { + if (!keepInventory) + { + ISidedInventory tileentityfurnace = (ISidedInventory)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (tileentityfurnace != null) + { + for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j1 = this.field_149933_a.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3; + entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3; + p_149749_1_.spawnEntityInWorld(entityitem); + } + } + } + + p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + } + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + +} diff --git a/com/hbm/blocks/test/TestEventTester.java b/com/hbm/blocks/test/TestEventTester.java index cb7b3ae8c..c1593d0a7 100644 --- a/com/hbm/blocks/test/TestEventTester.java +++ b/com/hbm/blocks/test/TestEventTester.java @@ -15,6 +15,7 @@ import com.hbm.entity.projectile.EntityMeteor; import com.hbm.main.MainRegistry; import com.hbm.main.ModEventHandler; import com.hbm.potion.PotionEffectTaint; +import com.hbm.saveddata.SatelliteSaveStructure; import com.hbm.saveddata.SatelliteSavedData; import com.hbm.world.Meteorite; @@ -245,9 +246,10 @@ public class TestEventTester extends Block { worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj)); return true; } - par5EntityPlayer.addChatComponentMessage(new ChatComponentText(String.valueOf(data.globalAccessThingy))); - data.globalAccessThingy = itemRand.nextInt(10000); - par5EntityPlayer.addChatComponentMessage(new ChatComponentText(String.valueOf(data.globalAccessThingy))); + + for(SatelliteSaveStructure sat : data.satellites) { + par5EntityPlayer.addChatComponentMessage(new ChatComponentText(sat.satelliteID + ": " + sat.satelliteType.name())); + } data.markDirty(); } diff --git a/com/hbm/entity/missile/EntityCarrier.java b/com/hbm/entity/missile/EntityCarrier.java index 505ff243c..166b79994 100644 --- a/com/hbm/entity/missile/EntityCarrier.java +++ b/com/hbm/entity/missile/EntityCarrier.java @@ -5,12 +5,20 @@ import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.entity.particle.EntitySmokeFX; import com.hbm.explosion.ExplosionChaos; import com.hbm.explosion.ExplosionLarge; +import com.hbm.items.ModItems; +import com.hbm.items.tool.ItemSatChip; import com.hbm.main.MainRegistry; +import com.hbm.saveddata.SatelliteSaveStructure; +import com.hbm.saveddata.SatelliteSaveStructure.SatelliteType; +import com.hbm.saveddata.SatelliteSavedData; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; @@ -21,6 +29,8 @@ import net.minecraftforge.common.ForgeChunkManager.Type; public class EntityCarrier extends EntityThrowable { double acceleration = 0.00D; + + private ItemStack payload; public EntityCarrier(World p_i1582_1_) { super(p_i1582_1_); @@ -97,15 +107,59 @@ public class EntityCarrier extends EntityThrowable { //this.setDead(); if(this.posY > 600) { - this.setDead(); + deployPayload(); } } + + private void deployPayload() { + + if(payload != null) { + + if(payload.getItem() == ModItems.flame_pony) { + ExplosionLarge.spawnTracers(worldObj, posX, posY, posZ, 25); + for(Object p : worldObj.playerEntities) + ((EntityPlayer)p).triggerAchievement(MainRegistry.achSpace); + } + + if(payload.getItem() instanceof ItemSatChip) { + SatelliteSavedData data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites"); + if(data == null) { + worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj)); + } + + int freq = ItemSatChip.getFreq(payload); + + if(!data.isFreqTaken(freq)) { + if(payload.getItem() == ModItems.sat_mapper) + data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.MAPPER)); + if(payload.getItem() == ModItems.sat_scanner) + data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.SCANNER)); + if(payload.getItem() == ModItems.sat_radar) + data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.RADAR)); + if(payload.getItem() == ModItems.sat_laser) + data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.LASER)); + if(payload.getItem() == ModItems.sat_foeq) + data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.RELAY)); + if(payload.getItem() == ModItems.sat_resonator) + data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.RESONATOR)); + + data.markDirty(); + } + } + } + + this.setDead(); + } @Override protected void entityInit() { this.dataWatcher.addObject(8, 1); } + public void setPayload(ItemStack stack) { + this.payload = stack.copy(); + } + private void disengageBoosters() { this.dataWatcher.updateObject(8, 0); diff --git a/com/hbm/entity/missile/EntityMissileAntiBallistic.java b/com/hbm/entity/missile/EntityMissileAntiBallistic.java index d2dc92202..28b6881a7 100644 --- a/com/hbm/entity/missile/EntityMissileAntiBallistic.java +++ b/com/hbm/entity/missile/EntityMissileAntiBallistic.java @@ -1,191 +1,163 @@ package com.hbm.entity.missile; +import java.util.List; + import com.hbm.calc.EasyLocation; import com.hbm.entity.particle.EntityDSmokeFX; +import com.hbm.entity.particle.EntitySmokeFX; import com.hbm.explosion.ExplosionChaos; +import com.hbm.explosion.ExplosionLarge; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -public class EntityMissileAntiBallistic extends EntityMissileBase { +public class EntityMissileAntiBallistic extends Entity { - EasyLocation missile; - Entity missile0; + int activationTimer; public EntityMissileAntiBallistic(World p_i1582_1_) { super(p_i1582_1_); } - - public EntityMissileAntiBallistic(World p_i1582_1_, int x, int z, double a, double b, double c) { - super(p_i1582_1_, x, z, a, b, c); - } @Override - public void onUpdate() - { - System.out.println(phase); + public void onUpdate() { - this.baseHeight = 35; + if(activationTimer < 40) { + activationTimer++; + + motionY = 1.5D; - this.posX += this.motionX; - this.posY += this.motionY; - this.posZ += this.motionZ; - - if(missile0 == null) + this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0); + this.rotation(); + + if(!this.worldObj.isRemote) + this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0)); + + } else { + + if(activationTimer == 40) { + ExplosionLarge.spawnParticlesRadial(worldObj, posX, posY, posZ, 15); + activationTimer = 100; + } + + for(int i = 0; i < 5; i++) { + + targetMissile(); + + this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0); + this.rotation(); + + if(!this.worldObj.isRemote) + this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0)); + + List list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5)); + + for(Entity e : list) { + if(e instanceof EntityMissileBaseAdvanced) { + ExplosionLarge.explode(worldObj, posX, posY, posZ, 15F, true, false, true); + this.setDead(); + return; + } + } + } + } + + if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air && + this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.water && + this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.flowing_water) { + + if(!this.worldObj.isRemote) + { + ExplosionLarge.explode(worldObj, posX, posY, posZ, 10F, true, true, true); + } + this.setDead(); + return; + } + + } + + protected void rotation() { + float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { - missile0 = ExplosionChaos.getHomingTarget(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25, this); + ; } - if(missile0 != null) + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - missile = new EasyLocation(missile0.posX, missile0.posY, missile0.posZ); - this.phase = -1; + this.prevRotationPitch += 360.0F; } - - this.rotation(); - - switch(phase) + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - case -1: - if(missile0 != null) - { - freePizzaGoddammit(missile); - this.missileSpeed = 3; - if(missile0.posX + 2 > this.posX && missile0.posX - 2 < this.posX && - missile0.posY + 2 > this.posY && missile0.posY - 2 < this.posY && - missile0.posZ + 2 > this.posZ && missile0.posZ - 2 < this.posZ) - { - if(!this.worldObj.isRemote) - { - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true); - } - this.setDead(); - missile0.setDead(); - //ExplosionChaos.delMissiles(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5, (Entity)this); - } - } - break; - - case 0: - if(loc0 != null) - { - freePizzaGoddammit(loc0); - if(loc0.posX + 2 > this.posX && loc0.posX - 2 < this.posX && - loc0.posY + 2 > this.posY && loc0.posY - 2 < this.posY && - loc0.posZ + 2 > this.posZ && loc0.posZ - 2 < this.posZ) - { - this.phase = 1; - } - } - break; - case 1: - if(loc1 != null) - { - freePizzaGoddammit(loc1); - if(loc1.posX + 2 > this.posX && loc1.posX - 2 < this.posX && - loc1.posY + 2 > this.posY && loc1.posY - 2 < this.posY && - loc1.posZ + 2 > this.posZ && loc1.posZ - 2 < this.posZ) - { - this.phase = 2; - } - } - break; - case 2: - if(loc2 != null) - { - freePizzaGoddammit(loc2); - if(loc2.posX + 2 > this.posX && loc2.posX - 2 < this.posX && - loc2.posY + 2 > this.posY && loc2.posY - 2 < this.posY && - loc2.posZ + 2 > this.posZ && loc2.posZ - 2 < this.posZ) - { - this.phase = 3; - } - } - break; - case 3: - if(loc3 != null) - { - freePizzaGoddammit(loc3); - if(loc3.posX + 2 > this.posX && loc3.posX - 2 < this.posX && - loc3.posY + 2 > this.posY && loc3.posY - 2 < this.posY && - loc3.posZ + 2 > this.posZ && loc3.posZ - 2 < this.posZ) - { - this.phase = 4; - } - } - break; - case 4: - if(loc4 != null) - { - freePizzaGoddammit(loc4); - if(loc4.posX + 2 > this.posX && loc4.posX - 2 < this.posX && - loc4.posY + 2 > this.posY && loc4.posY - 2 < this.posY && - loc4.posZ + 2 > this.posZ && loc4.posZ - 2 < this.posZ) - { - this.phase = 5; - } - } - break; - case 5: - if(loc5 != null) - { - freePizzaGoddammit(loc5); - if(loc5.posX + 2 > this.posX && loc5.posX - 2 < this.posX && - loc5.posY + 2 > this.posY && loc5.posY - 2 < this.posY && - loc5.posZ + 2 > this.posZ && loc5.posZ - 2 < this.posZ) - { - this.phase = 6; - } - } - break; - case 6: - if(loc6 != null) - { - freePizzaGoddammit(loc6); - if(loc6.posX + 2 > this.posX && loc6.posX - 2 < this.posX && - loc6.posY + 2 > this.posY && loc6.posY - 2 < this.posY && - loc6.posZ + 2 > this.posZ && loc6.posZ - 2 < this.posZ) - { - this.phase = 7; - } - } - break; - case 7: - if(loc7 != null) - { - freePizzaGoddammit(loc7); - if(loc7.posX + 2 > this.posX && loc7.posX - 2 < this.posX && - loc7.posY + 2 > this.posY && loc7.posY - 2 < this.posY && - loc7.posZ + 2 > this.posZ && loc7.posZ - 2 < this.posZ) - { - this.phase = 8; - } - } - break; - case 8: - if(target != null) - { - freePizzaGoddammit(target); - if(target.posX + 2 > this.posX && target.posX - 2 < this.posX && - target.posY + 2 > this.posY && target.posY - 2 < this.posY && - target.posZ + 2 > this.posZ && target.posZ - 2 < this.posZ) - { - this.phase = -1; - } - } - break; + this.prevRotationYaw -= 360.0F; } - - this.worldObj.spawnEntityInWorld(new EntityDSmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0)); - - if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air && this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.water && this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.flowing_water) + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - if(!this.worldObj.isRemote) - { - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true); - } - this.setDead(); + this.prevRotationYaw += 360.0F; } + } + + private void targetMissile() { + + List list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 500, 0, posZ - 500, posX + 500, 5000, posZ + 500)); + + Entity target = null; + double closest = 1000D; + + for(Entity e : list) { + if(e instanceof EntityMissileBaseAdvanced) { + double dis = Math.sqrt(Math.pow(e.posX - posX, 2) + Math.pow(e.posY - posY, 2) + Math.pow(e.posZ - posZ, 2)); + + if(dis < closest) { + closest = dis; + target = e; + } + } + } + + if(target != null) { + + Vec3 vec = Vec3.createVectorHelper(target.posX - posX, target.posY - posY, target.posZ - posZ); + + vec.normalize(); + + this.motionX = vec.xCoord * 0.065D; + this.motionY = vec.yCoord * 0.065D; + this.motionZ = vec.zCoord * 0.065D; + } + } + + @Override + protected void entityInit() { + + } + + @Override + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + + } + + @Override + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + + } + + @Override + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + return distance < 500000; } } diff --git a/com/hbm/handler/GUIHandler.java b/com/hbm/handler/GUIHandler.java index a7b27c481..d50379ec8 100644 --- a/com/hbm/handler/GUIHandler.java +++ b/com/hbm/handler/GUIHandler.java @@ -67,6 +67,7 @@ import com.hbm.tileentity.machine.TileEntityNukeFurnace; import com.hbm.tileentity.machine.TileEntityReactorMultiblock; import com.hbm.tileentity.machine.TileEntityReiXMainframe; import com.hbm.tileentity.machine.TileEntityRtgFurnace; +import com.hbm.tileentity.machine.TileEntityMachineSatLinker; import com.hbm.tileentity.machine.TileEntityWatzCore; import net.minecraft.entity.player.EntityPlayer; @@ -638,6 +639,15 @@ public class GUIHandler implements IGuiHandler { } return null; } + + case ModBlocks.guiID_satlinker: + { + if(entity instanceof TileEntityMachineSatLinker) + { + return new ContainerMachineSatLinker(player.inventory, (TileEntityMachineSatLinker) entity); + } + return null; + } } return null; } @@ -1206,6 +1216,15 @@ public class GUIHandler implements IGuiHandler { } return null; } + + case ModBlocks.guiID_satlinker: + { + if(entity instanceof TileEntityMachineSatLinker) + { + return new GUIMachineSatLinker(player.inventory, (TileEntityMachineSatLinker) entity); + } + return null; + } } } else { //CLIENTONLY GUIS diff --git a/com/hbm/inventory/container/ContainerMachineSatLinker.java b/com/hbm/inventory/container/ContainerMachineSatLinker.java new file mode 100644 index 000000000..1f20735ee --- /dev/null +++ b/com/hbm/inventory/container/ContainerMachineSatLinker.java @@ -0,0 +1,83 @@ +package com.hbm.inventory.container; + +import com.hbm.tileentity.machine.TileEntityMachineSiren; +import com.hbm.tileentity.machine.TileEntityMachineSatLinker; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerMachineSatLinker extends Container { + + private TileEntityMachineSatLinker diFurnace; + + public ContainerMachineSatLinker(InventoryPlayer invPlayer, TileEntityMachineSatLinker tedf) { + + diFurnace = tedf; + + this.addSlotToContainer(new Slot(tedf, 0, 44, 35)); + this.addSlotToContainer(new Slot(tedf, 1, 80, 35)); + this.addSlotToContainer(new Slot(tedf, 2, 116, 35)); + + for(int i = 0; i < 3; i++) + { + for(int j = 0; j < 9; j++) + { + this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for(int i = 0; i < 9; i++) + { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting crafting) { + super.addCraftingToCrafters(crafting); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(par2); + + if (var4 != null && var4.getHasStack()) + { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (par2 <= 0) { + if (!this.mergeItemStack(var5, 1, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(var5, 0, 1, false)) + { + return null; + } + + if (var5.stackSize == 0) + { + var4.putStack((ItemStack) null); + } + else + { + var4.onSlotChanged(); + } + } + + return var3; + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return diFurnace.isUseableByPlayer(player); + } +} diff --git a/com/hbm/inventory/gui/GUIMachineSatLinker.java b/com/hbm/inventory/gui/GUIMachineSatLinker.java new file mode 100644 index 000000000..c921f4072 --- /dev/null +++ b/com/hbm/inventory/gui/GUIMachineSatLinker.java @@ -0,0 +1,60 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.container.ContainerMachineSatLinker; +import com.hbm.inventory.container.ContainerMachineSiren; +import com.hbm.items.tool.ItemCassette.TrackType; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.machine.TileEntityMachineSiren; +import com.hbm.tileentity.machine.TileEntityMachineSatLinker; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUIMachineSatLinker extends GuiInfoContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_linker.png"); + private TileEntityMachineSatLinker siren; + + public GUIMachineSatLinker(InventoryPlayer invPlayer, TileEntityMachineSatLinker tedf) { + super(new ContainerMachineSatLinker(invPlayer, tedf)); + siren = tedf; + + this.xSize = 176; + this.ySize = 166; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + String[] text = new String[] { "The first slot will copy the satellite/chip's", + "frequency and paste it to the second slot." }; + this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text); + + String[] text1 = new String[] { "The third slot will randomize the", + "satellite/chip's frequency."}; + this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, text1); + } + + @Override + protected void drawGuiContainerForegroundLayer(int i, int j) { + String name = this.siren.hasCustomInventoryName() ? this.siren.getInventoryName() : I18n.format(this.siren.getInventoryName()); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + this.drawInfoPanel(guiLeft - 16, guiTop + 36, 16, 16, 2); + this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 16, 16, 16, 3); + } +} diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index dc34e13a0..3f7924b7d 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -682,6 +682,8 @@ public class ModItems { public static Item sat_radar; public static Item sat_laser; public static Item sat_foeq; + public static Item sat_resonator; + public static Item sat_chip; public static Item gun_rpg; public static Item gun_rpg_ammo; @@ -1824,11 +1826,13 @@ public class ModItems { missile_taint = new Item().setUnlocalizedName("missile_taint").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_taint"); missile_micro = new Item().setUnlocalizedName("missile_micro").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_micro"); missile_carrier = new Item().setUnlocalizedName("missile_carrier").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_carrier"); - sat_mapper = new Item().setUnlocalizedName("sat_mapper").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_mapper"); - sat_scanner = new Item().setUnlocalizedName("sat_scanner").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_scanner"); - sat_radar = new Item().setUnlocalizedName("sat_radar").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_radar"); - sat_laser = new Item().setUnlocalizedName("sat_laser").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_laser"); - sat_foeq = new Item().setUnlocalizedName("sat_foeq").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_foeq"); + sat_mapper = new ItemSatChip().setUnlocalizedName("sat_mapper").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_mapper"); + sat_scanner = new ItemSatChip().setUnlocalizedName("sat_scanner").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_scanner"); + sat_radar = new ItemSatChip().setUnlocalizedName("sat_radar").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_radar"); + sat_laser = new ItemSatChip().setUnlocalizedName("sat_laser").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_laser"); + sat_foeq = new ItemSatChip().setUnlocalizedName("sat_foeq").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_foeq"); + sat_resonator = new ItemSatChip().setUnlocalizedName("sat_resonator").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_resonator"); + sat_chip = new ItemSatChip().setUnlocalizedName("sat_chip").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_chip"); gun_rpg = new GunRpg().setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_rpg_new"); gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_new"); @@ -3125,7 +3129,7 @@ public class ModItems { //Missiles GameRegistry.registerItem(missile_generic, missile_generic.getUnlocalizedName()); - //GameRegistry.registerItem(missile_anti_ballistic, missile_anti_ballistic.getUnlocalizedName()); + GameRegistry.registerItem(missile_anti_ballistic, missile_anti_ballistic.getUnlocalizedName()); GameRegistry.registerItem(missile_incendiary, missile_incendiary.getUnlocalizedName()); GameRegistry.registerItem(missile_cluster, missile_cluster.getUnlocalizedName()); GameRegistry.registerItem(missile_buster, missile_buster.getUnlocalizedName()); @@ -3152,6 +3156,8 @@ public class ModItems { GameRegistry.registerItem(sat_radar, sat_radar.getUnlocalizedName()); GameRegistry.registerItem(sat_laser, sat_laser.getUnlocalizedName()); GameRegistry.registerItem(sat_foeq, sat_foeq.getUnlocalizedName()); + GameRegistry.registerItem(sat_resonator, sat_resonator.getUnlocalizedName()); + GameRegistry.registerItem(sat_chip, sat_chip.getUnlocalizedName()); //Guns GameRegistry.registerItem(gun_revolver_iron, gun_revolver_iron.getUnlocalizedName()); diff --git a/com/hbm/items/tool/ItemSatChip.java b/com/hbm/items/tool/ItemSatChip.java new file mode 100644 index 000000000..6c02e17ca --- /dev/null +++ b/com/hbm/items/tool/ItemSatChip.java @@ -0,0 +1,33 @@ +package com.hbm.items.tool; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class ItemSatChip extends Item { + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) + { + list.add("Satellite frequency: " + getFreq(itemstack)); + } + + public static int getFreq(ItemStack stack) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + return 0; + } + return stack.stackTagCompound.getInteger("freq"); + } + + public static void setFreq(ItemStack stack, int i) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + stack.stackTagCompound.setInteger("freq", i); + } + +} diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index 3886f55be..3ce778cc9 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -266,6 +266,7 @@ import com.hbm.tileentity.machine.TileEntityMachineUF6Tank; import com.hbm.tileentity.machine.TileEntityNukeFurnace; import com.hbm.tileentity.machine.TileEntityReactorMultiblock; import com.hbm.tileentity.machine.TileEntityRtgFurnace; +import com.hbm.tileentity.machine.TileEntityMachineSatLinker; import com.hbm.tileentity.machine.TileEntityStructureMarker; import com.hbm.tileentity.machine.TileEntityWatzCore; @@ -390,6 +391,7 @@ public class MainRegistry public static Achievement achPotato; public static Achievement achC44; public static Achievement achC20_5; + public static Achievement achSpace; public static boolean enableDebugMode = true; public static boolean enableMycelium = false; @@ -620,6 +622,7 @@ public class MainRegistry GameRegistry.registerTileEntity(TileEntityCelPrimePort.class, "tileentity_cel_prime_connector"); GameRegistry.registerTileEntity(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage"); GameRegistry.registerTileEntity(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine"); + GameRegistry.registerTileEntity(TileEntityMachineSatLinker.class, "tileentity_satlinker"); EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true); @@ -915,6 +918,7 @@ public class MainRegistry achPotato = new Achievement("achievement.potato", "potato", -2, 0, ModItems.battery_potatos, null).initIndependentStat().setSpecial().registerStat(); achC44 = new Achievement("achievement.c44", "c44", 2, -2, ModItems.gun_revolver_pip, null).initIndependentStat().setSpecial().registerStat(); achC20_5 = new Achievement("achievement.c20_5", "c20_5", 4, -2, ModItems.gun_dampfmaschine, null).initIndependentStat().setSpecial().registerStat(); + achSpace = new Achievement("achievement.space", "space", 4, 0, ModItems.missile_carrier, null).initIndependentStat().setSpecial().registerStat(); AchievementPage.registerAchievementPage(new AchievementPage("Nuclear Tech", new Achievement[]{ achSacrifice, @@ -924,7 +928,8 @@ public class MainRegistry achSelenium, achPotato, achC44, - achC20_5 + achC20_5, + achSpace })); OreDictionary.registerOre("ingotUranium", ModItems.ingot_uranium); diff --git a/com/hbm/main/ResourceManager.java b/com/hbm/main/ResourceManager.java index ee55aeae6..133bff9a9 100644 --- a/com/hbm/main/ResourceManager.java +++ b/com/hbm/main/ResourceManager.java @@ -182,6 +182,7 @@ public class ResourceManager { public static final ResourceLocation missileV2_IN_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_IN.png"); public static final ResourceLocation missileV2_CL_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_CL.png"); public static final ResourceLocation missileV2_BU_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_BU.png"); + public static final ResourceLocation missileAA_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileAA.png"); public static final ResourceLocation missileStrong_HE_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_HE.png"); public static final ResourceLocation missileStrong_IN_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_IN.png"); public static final ResourceLocation missileStrong_CL_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_CL.png"); diff --git a/com/hbm/packet/TEMissilePacket.java b/com/hbm/packet/TEMissilePacket.java index bdf56a672..c5c9094d6 100644 --- a/com/hbm/packet/TEMissilePacket.java +++ b/com/hbm/packet/TEMissilePacket.java @@ -70,6 +70,8 @@ public class TEMissilePacket implements IMessage { type = 19; if(stack.getItem() == ModItems.missile_carrier) type = 20; + if(stack.getItem() == ModItems.missile_anti_ballistic) + type = 21; } } diff --git a/com/hbm/render/entity/RenderMissileGeneric.java b/com/hbm/render/entity/RenderMissileGeneric.java index 1aefc0ecf..b85530a43 100644 --- a/com/hbm/render/entity/RenderMissileGeneric.java +++ b/com/hbm/render/entity/RenderMissileGeneric.java @@ -36,8 +36,8 @@ public class RenderMissileGeneric extends Render { bindTexture(ResourceManager.missileV2_CL_tex); if(p_76986_1_ instanceof EntityMissileBunkerBuster) bindTexture(ResourceManager.missileV2_BU_tex); - /*if(p_76986_1_ instanceof EntityMissileAntiBallistic) - bindTexture(missileAATexture);*/ + if(p_76986_1_ instanceof EntityMissileAntiBallistic) + bindTexture(ResourceManager.missileAA_tex); ResourceManager.missileV2.renderAll(); GL11.glPopMatrix(); } diff --git a/com/hbm/render/tileentity/RenderLaunchPadTier1.java b/com/hbm/render/tileentity/RenderLaunchPadTier1.java index 8c8250802..2c5c93995 100644 --- a/com/hbm/render/tileentity/RenderLaunchPadTier1.java +++ b/com/hbm/render/tileentity/RenderLaunchPadTier1.java @@ -187,6 +187,12 @@ public class RenderLaunchPadTier1 extends TileEntitySpecialRenderer { ResourceManager.missileBooster.renderAll(); GL11.glTranslated(0.0D, 0.0D, 1.25D); } + if(state == 21) + { + GL11.glScalef(1.0F, 1.0F, 1.0F); + bindTexture(ResourceManager.missileAA_tex); + ResourceManager.missileV2.renderAll(); + } GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/com/hbm/saveddata/SatelliteSaveStructure.java b/com/hbm/saveddata/SatelliteSaveStructure.java index b475aa4e2..72c0033c4 100644 --- a/com/hbm/saveddata/SatelliteSaveStructure.java +++ b/com/hbm/saveddata/SatelliteSaveStructure.java @@ -11,7 +11,14 @@ public class SatelliteSaveStructure { public int satelliteID; public SatelliteType satelliteType; - enum SatelliteType { + public SatelliteSaveStructure() { } + + public SatelliteSaveStructure(int id, SatelliteType type) { + satelliteID = id; + satelliteType = type; + } + + public enum SatelliteType { //Prints map remotely MAPPER, diff --git a/com/hbm/saveddata/SatelliteSavedData.java b/com/hbm/saveddata/SatelliteSavedData.java index 8f807b1a6..56612c97a 100644 --- a/com/hbm/saveddata/SatelliteSavedData.java +++ b/com/hbm/saveddata/SatelliteSavedData.java @@ -1,12 +1,18 @@ package com.hbm.saveddata; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.WorldSavedData; public class SatelliteSavedData extends WorldSavedData { - public int globalAccessThingy; + public int satCount; + + public List satellites = new ArrayList(); + private World worldObj; public SatelliteSavedData(String p_i2141_1_) { @@ -19,15 +25,35 @@ public class SatelliteSavedData extends WorldSavedData { this.worldObj = p_i1678_1_; this.markDirty(); } + + public boolean isFreqTaken(int freq) { + + for(SatelliteSaveStructure sat : satellites) + if(sat.satelliteID == freq) + return true; + + return false; + } @Override public void readFromNBT(NBTTagCompound nbt) { - globalAccessThingy = nbt.getInteger("gat"); + satCount = nbt.getInteger("satCount"); + + for(int i = 0; i < satCount; i++) { + SatelliteSaveStructure struct = new SatelliteSaveStructure(); + struct.readFromNBT(nbt, i); + + satellites.add(struct); + } } @Override public void writeToNBT(NBTTagCompound nbt) { - nbt.setInteger("gat", globalAccessThingy); + nbt.setInteger("satCount", satellites.size()); + + for(int i = 0; i < satellites.size(); i++) { + satellites.get(i).writeToNBT(nbt, i); + } } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineRadar.java b/com/hbm/tileentity/machine/TileEntityMachineRadar.java index f6fd0fe60..36069542b 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineRadar.java +++ b/com/hbm/tileentity/machine/TileEntityMachineRadar.java @@ -3,6 +3,7 @@ package com.hbm.tileentity.machine; import java.util.ArrayList; import java.util.List; +import com.hbm.entity.missile.EntityMissileAntiBallistic; import com.hbm.entity.missile.EntityMissileBaseAdvanced; import com.hbm.entity.projectile.EntityRocketHoming; import com.hbm.interfaces.IConsumer; @@ -103,10 +104,14 @@ public class TileEntityMachineRadar extends TileEntity implements IConsumer { continue; }*/ - + if(e instanceof EntityPlayer && e.posY >= yCoord + MainRegistry.radarBuffer) { nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, 5, (int)e.posY }); } + + if(e instanceof EntityMissileAntiBallistic && e.posY >= yCoord + MainRegistry.radarBuffer) { + nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, 4, (int)e.posY }); + } } for(Entity e : allMissiles) { diff --git a/com/hbm/tileentity/machine/TileEntityMachineSatLinker.java b/com/hbm/tileentity/machine/TileEntityMachineSatLinker.java new file mode 100644 index 000000000..f042d31a1 --- /dev/null +++ b/com/hbm/tileentity/machine/TileEntityMachineSatLinker.java @@ -0,0 +1,189 @@ +package com.hbm.tileentity.machine; + +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.inventory.FluidTank; +import com.hbm.items.ModItems; +import com.hbm.items.tool.ItemSatChip; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMachineSatLinker extends TileEntity implements ISidedInventory { + + private ItemStack slots[]; + + //public static final int maxFill = 64 * 3; + + private static final int[] slots_top = new int[] {0}; + private static final int[] slots_bottom = new int[] {1}; + private static final int[] slots_side = new int[] {2}; + + private String customName; + + public TileEntityMachineSatLinker() { + slots = new ItemStack[3]; + } + + @Override + public int getSizeInventory() { + return slots.length; + } + + @Override + public ItemStack getStackInSlot(int i) { + return slots[i]; + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + if(slots[i] != null) + { + ItemStack itemStack = slots[i]; + slots[i] = null; + return itemStack; + } else { + return null; + } + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemStack) { + slots[i] = itemStack; + if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return this.hasCustomInventoryName() ? this.customName : "container.satLinker"; + } + + @Override + public boolean hasCustomInventoryName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String name) { + this.customName = name; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) + { + return false; + }else{ + return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64; + } + } + + @Override + public void openInventory() {} + @Override + public void closeInventory() {} + + @Override + public boolean isItemValidForSlot(int i, ItemStack stack) { + return false; + } + + @Override + public ItemStack decrStackSize(int i, int j) { + if(slots[i] != null) + { + if(slots[i].stackSize <= j) + { + ItemStack itemStack = slots[i]; + slots[i] = null; + return itemStack; + } + ItemStack itemStack1 = slots[i].splitStack(j); + if (slots[i].stackSize == 0) + { + slots[i] = null; + } + + return itemStack1; + } else { + return null; + } + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList list = nbt.getTagList("items", 10); + + slots = new ItemStack[getSizeInventory()]; + + for(int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound nbt1 = list.getCompoundTagAt(i); + byte b0 = nbt1.getByte("slot"); + if(b0 >= 0 && b0 < slots.length) + { + slots[b0] = ItemStack.loadItemStackFromNBT(nbt1); + } + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + NBTTagList list = new NBTTagList(); + + for(int i = 0; i < slots.length; i++) + { + if(slots[i] != null) + { + NBTTagCompound nbt1 = new NBTTagCompound(); + nbt1.setByte("slot", (byte)i); + slots[i].writeToNBT(nbt1); + list.appendTag(nbt1); + } + } + nbt.setTag("items", list); + } + + @Override + public int[] getAccessibleSlotsFromSide(int p_94128_1_) + { + return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side); + } + + @Override + public boolean canInsertItem(int i, ItemStack itemStack, int j) { + return this.isItemValidForSlot(i, itemStack); + } + + @Override + public boolean canExtractItem(int i, ItemStack itemStack, int j) { + return true; + } + + @Override + public void updateEntity() { + + if(!worldObj.isRemote) + { + if(slots[0] != null && slots[1] != null && slots[0].getItem() instanceof ItemSatChip && slots[1].getItem() instanceof ItemSatChip) { + ItemSatChip.setFreq(slots[1], ItemSatChip.getFreq(slots[0])); + } + + if(slots[2] != null && slots[2].getItem() instanceof ItemSatChip) { + ItemSatChip.setFreq(slots[2], worldObj.rand.nextInt(100000)); + } + } + } +}