From fc73abeed807c5d9f4a8b9edd695cc68f4a18cad Mon Sep 17 00:00:00 2001 From: Bob Date: Wed, 29 Jul 2020 00:17:43 +0200 Subject: [PATCH] new radiation mechanics, IF shotgun ammo --- src/main/java/assets/hbm/lang/de_DE.lang | 3 + src/main/java/assets/hbm/lang/en_US.lang | 3 + .../hbm/textures/blocks/waste_grass_side.png | Bin 0 -> 684 bytes .../hbm/textures/blocks/waste_grass_top.png | Bin 0 -> 404 bytes .../hbm/textures/items/ammo_12gauge_sleek.png | Bin 0 -> 357 bytes .../hbm/textures/items/ammo_4gauge_sleek.png | Bin 0 -> 366 bytes .../assets/hbm/textures/items/coin_base.png | Bin 0 -> 279 bytes .../hbm/textures/items/coin_chopper.png | Bin 0 -> 430 bytes .../hbm/textures/items/coin_creeper.png | Bin 0 -> 389 bytes .../hbm/textures/items/coin_maskman.png | Bin 0 -> 430 bytes .../hbm/textures/items/coin_radiation.png | Bin 0 -> 431 bytes .../com/hbm/entity/mob/EntityMaskMan.java | 24 +++++- .../hbm/entity/mob/EntityNuclearCreeper.java | 1 + .../hbm/entity/mob/EntityTaintedCreeper.java | 1 + .../{ => ai}/EntityAINuclearCreeperSwell.java | 4 +- .../entity/mob/ai/EntityAIShootTarget.java | 57 ++++++++++++++ .../{ => ai}/EntityAITaintedCreeperSwell.java | 4 +- .../entity/projectile/EntityBulletBase.java | 34 ++++++++ .../hbm/handler/BulletConfigSyncingUtil.java | 6 ++ .../hbm/handler/RadiationWorldHandler.java | 73 ++++++++++++++++++ .../handler/guncfg/BulletConfigFactory.java | 58 ++++++++++++++ .../hbm/handler/guncfg/Gun12GaugeFactory.java | 11 +++ .../hbm/handler/guncfg/Gun20GaugeFactory.java | 15 ++++ .../hbm/handler/guncfg/Gun4GaugeFactory.java | 11 +++ src/main/java/com/hbm/items/ModItems.java | 13 ++++ .../com/hbm/items/special/ItemCustomLore.java | 3 +- .../java/com/hbm/items/weapon/ItemAmmo.java | 9 +++ .../java/com/hbm/main/CraftingManager.java | 3 + src/main/java/com/hbm/main/MainRegistry.java | 4 + .../java/com/hbm/main/ModEventHandler.java | 7 +- .../com/hbm/saveddata/RadiationSavedData.java | 4 +- 31 files changed, 339 insertions(+), 9 deletions(-) create mode 100644 src/main/java/assets/hbm/textures/blocks/waste_grass_side.png create mode 100644 src/main/java/assets/hbm/textures/blocks/waste_grass_top.png create mode 100644 src/main/java/assets/hbm/textures/items/ammo_12gauge_sleek.png create mode 100644 src/main/java/assets/hbm/textures/items/ammo_4gauge_sleek.png create mode 100644 src/main/java/assets/hbm/textures/items/coin_base.png create mode 100644 src/main/java/assets/hbm/textures/items/coin_chopper.png create mode 100644 src/main/java/assets/hbm/textures/items/coin_creeper.png create mode 100644 src/main/java/assets/hbm/textures/items/coin_maskman.png create mode 100644 src/main/java/assets/hbm/textures/items/coin_radiation.png rename src/main/java/com/hbm/entity/mob/{ => ai}/EntityAINuclearCreeperSwell.java (92%) create mode 100644 src/main/java/com/hbm/entity/mob/ai/EntityAIShootTarget.java rename src/main/java/com/hbm/entity/mob/{ => ai}/EntityAITaintedCreeperSwell.java (92%) create mode 100644 src/main/java/com/hbm/handler/RadiationWorldHandler.java diff --git a/src/main/java/assets/hbm/lang/de_DE.lang b/src/main/java/assets/hbm/lang/de_DE.lang index f8ed5b796..c7ec8feb9 100644 --- a/src/main/java/assets/hbm/lang/de_DE.lang +++ b/src/main/java/assets/hbm/lang/de_DE.lang @@ -317,6 +317,7 @@ item.ammo_12gauge_du.name=Kaliber 12 Schrot (Uranbeschichtung) item.ammo_12gauge_incendiary.name=Kaliber 12 Schrot (Brand) item.ammo_12gauge_marauder.name=Kaliber 12 Taktische Anti-Marauder Schrotpatrone item.ammo_12gauge_shrapnel.name=Kaliber 12 Schrot (Schrapnell) +item.ammo_12gauge_sleek.name=Kaliber 12 Schrot (IF-F&E) item.ammo_20gauge.name=Kaliber 20 Schrot item.ammo_20gauge_caustic.name=Kaliber 20 Schrot (Ätzend) item.ammo_20gauge_explosive.name=Kaliber 20 Schrot (Explosiv) @@ -324,6 +325,7 @@ item.ammo_20gauge_flechette.name=Kaliber 20 Flechet item.ammo_20gauge_incendiary.name=Kaliber 20 Schrot (Brand) item.ammo_20gauge_shock.name=Kaliber 20 Schrot (Schock) item.ammo_20gauge_shrapnel.name=Kaliber 20 Schrot (Schrapnell) +item.ammo_20gauge_sleek.name=Kaliber 20 Schrot (IF-F&E) item.ammo_20gauge_slug.name=Kaliber 20 Brenneke item.ammo_20gauge_wither.name=Kaliber 20 Schrot (Wither) item.ammo_22lr.name=.22 lfB Patrone @@ -340,6 +342,7 @@ item.ammo_44_silver.name=.44 Magnum Patrone (Gebäude) item.ammo_44_star.name=.44 Magnum Patrone (Sternenmetall) item.ammo_4gauge.name=Kaliber 20 Schrot item.ammo_4gauge_explosive.name=23mm Granate +item.ammo_4gauge_sleek.name=Kaliber 4 Schrot (IF-F&E) item.ammo_4gauge_slug.name=Kaliber 4 Brenneke item.ammo_50ae.name=.50 AE Patrone item.ammo_50ae_ap.name=.50 AE Patrone (Panzerbrechend) diff --git a/src/main/java/assets/hbm/lang/en_US.lang b/src/main/java/assets/hbm/lang/en_US.lang index aef543518..1a7c6073f 100644 --- a/src/main/java/assets/hbm/lang/en_US.lang +++ b/src/main/java/assets/hbm/lang/en_US.lang @@ -317,6 +317,7 @@ item.ammo_12gauge_du.name=12 Gauge Buckshot (Uranium Coated) item.ammo_12gauge_incendiary.name=12 Gauge Buckshot (Incendiary) item.ammo_12gauge_marauder.name=12 Gauge Tactical Anti-Marauder Shell item.ammo_12gauge_shrapnel.name=12 Gauge Buckshot (Shrapnel) +item.ammo_12gauge_sleek.name=12 Gauge Buckshot (IF-R&D) item.ammo_20gauge.name=20 Gauge Buckshot item.ammo_20gauge_caustic.name=20 Gauge Buckshot (Caustic) item.ammo_20gauge_explosive.name=20 Gauge Buckshot (Explosive) @@ -324,6 +325,7 @@ item.ammo_20gauge_flechette.name=20 Gauge Flechette Shell item.ammo_20gauge_incendiary.name=20 Gauge Buckshot (Incendiary) item.ammo_20gauge_shock.name=20 Gauge Buckshot (Shock) item.ammo_20gauge_shrapnel.name=20 Gauge Buckshot (Shrapnel) +item.ammo_20gauge_sleek.name=20 Gauge Buckshot (IF-R&D) item.ammo_20gauge_slug.name=20 Gauge Brenneke Slug item.ammo_20gauge_wither.name=20 Gauge Buckshot (Withering) item.ammo_22lr.name=.22 LR Round @@ -340,6 +342,7 @@ item.ammo_44_silver.name=.44 Magnum Bullet (Building) item.ammo_44_star.name=.44 Magnum Bullet (Starmetal) item.ammo_4gauge.name=4 Gauge Buckshot item.ammo_4gauge_explosive.name=23mm Grenade +item.ammo_4gauge_sleek.name=4 Gauge Buckshot (IF-R&D) item.ammo_4gauge_slug.name=4 Gauge Solid Steel Slug item.ammo_50ae.name=.50 AE Round item.ammo_50ae_ap.name=.50 AE Round (Armor Piercing) diff --git a/src/main/java/assets/hbm/textures/blocks/waste_grass_side.png b/src/main/java/assets/hbm/textures/blocks/waste_grass_side.png new file mode 100644 index 0000000000000000000000000000000000000000..080b3c426081418bf2b35e3a9d0f1e328fd8dc1a GIT binary patch literal 684 zcmV;d0#p5oP)6{QZh4EGfB*?NvGpNW=M-?_44ta@0{nnz88<~ zJA;!U0HP>j+ct`Sg2BlU#XrI5)MhFXqSfvbjZD&N_fet&LIDB2)gh_W951V1k~KOqDa_V$mE zg8{PhvpjpeNq9;jAWc&KvX4;RsSq}c432&?=aV?D)mdJgXXnjVGO0M&@a@As2m()D z{{-OR;~vkSz5~Gb;La^aGc1-D=K-jhP14C2+vO^5Wm0hfG{f>Vz{=7BzPAtWIfYWi zdyM4PXcxCU13;lvIj7Ufm^VmFUkYuw=1eM1ul}8ANTJ;wpcxjnJ1{fHEL!P@$T)L8}0<#aj-gla@S`mlqy6+3f)v5sZ+=5 z^bveMc2%9LsW`_6yJ&`WK1LS@;Mz=r@pLYhiy{DCGeG6nkeb;<)f?VtE{0}UUbBlL zxS6^p+3tDQ-!4~KSz2IyHBX^b@zNOIOmfBgYX02RNN$ZxaSK&%c;<0Lcj#YDhCnBx S>1Q|q0000D)fK$&5SJD4C2)0x;tcNFCL`m=6~c_Z zZSZ{DA={3UVDCEsKwMS@CpjS7j{fGfdI&Q@m=#k}-Y`yZb)^TC3P9!BMO6g=tzcyj z*RFdR?t1FF@R4wqp_Jp?LvMM>_BrTF08tB_5yYnOmhH*lCNv1H#p;uXI^37$5 zwtLc13Q3;2mqVS<}BplF|bPj^%2}e#8lN()jr-aRW%Vg zdz0o0S&Y#D>X*pvz5cjPmo7@u3VD0|GKUaMRc$hvoIvspKo(;p+#L=(8jUE5g71(n zz#fuP!h6qfIK(-30?7fYs1pw6b9fwp<|@iu@H0tLzhCKWGdNnjdz4x#OLr8LZ?tD zbO{KJhMYjMN5kKt#5i*8rb8cS(39S$Ckgnc;H?`Mc|t^Jtwl-+F~-q)Q50OQR%qK6 z-uuN}e)4*~zMALA@!%mAhzYoV0EPgab7-0d#uyl5end9g0+$W|-(P_u0syeq0su}Q zXKc0wnx>h&PW}cx;y)u^UR~eC9I_l@F~;wQdXm2IcxT3x@L}WFh+=~GK9bo0!gwg zOV)KwRpoC0RFzd#v8pPD5U8r`y6&oY78oLzPV(ZLVu<{?c!=b=FFJq00wT>e`v3p{ M07*qoM6N<$f{K}yXaE2J literal 0 HcmV?d00001 diff --git a/src/main/java/assets/hbm/textures/items/coin_base.png b/src/main/java/assets/hbm/textures/items/coin_base.png new file mode 100644 index 0000000000000000000000000000000000000000..6478120c71d4d3c46638c84bd242f193508a3485 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf+kdl#nbtdJl)TKf>EP7c+r*wBzI#WtF#jPzpIZml^5!2{$hdTY)0cRU z2etpJKQRAU@#Jo!R8*>HUjMzQ^x)>j0tuGPr#GkG4T)Qv!rSk}(7-D$nK5a>%z&`1 zsgsT!F!AnjYIwguhIy^O!PzH!9Dm)i6?tc!x6C8i`nA<_E<=OUGtVo?q#Z405^k4@ za{V4HP;+B`!A`w3Q=K?`CYJ;=Op^}_`x?F@^W3uCrL4NL{`U*ha~QY5Qd+4x0j2RjgUr!6k=&_qY$(dD=Q@so77hN17f3% z{gs0Mz$S%F1gnrjxW*9BB9enxBznnY6N@CreOZW3voO2QJG1W${4p{=T}->xY2@MR zMe5r`ashg-i?S8Uwr1x_K2<0ahdtK?h{8Dw`5GaA|9UymIZKMXTN8Xup8?5^ zPD@ufwHX_X5lDq)LSm$eDTKRN>_XVsFkGqJ1l1D)K(Hj&m*qs;Km<+|hzl(u4*pww Y0|hC;$@^y}L;wH)07*qoM6N<$g3!vfWdHyG literal 0 HcmV?d00001 diff --git a/src/main/java/assets/hbm/textures/items/coin_creeper.png b/src/main/java/assets/hbm/textures/items/coin_creeper.png new file mode 100644 index 0000000000000000000000000000000000000000..792e1f6bea5327eb00429475a9f06f10b833e43a GIT binary patch literal 389 zcmV;00eb$4P)O-wiyTM7X_w1tnzlps??*oj(?zpl=xGX|%+8tqe38hNg>eBEjUt@3 z4w28ZzL5X(coJb6Eis#~aP#nHnK%S^!#0YLQi?>S&c-qUuQu>RHDKMI%~$BO8|a-h zQ7jc1eAc_f_0w(z*c3EO38B+&80Yiu5v$Oeg07+x)Y+(9`_S)S8F#?3%6dGbVQ7^N jfWc0IypWDO_;0ZVS%<6d-TW+#00000NkvXXu0mjfI$NOw literal 0 HcmV?d00001 diff --git a/src/main/java/assets/hbm/textures/items/coin_maskman.png b/src/main/java/assets/hbm/textures/items/coin_maskman.png new file mode 100644 index 0000000000000000000000000000000000000000..c9a624e7d3bb7b857ae545e871c41e4948df1d6b GIT binary patch literal 430 zcmV;f0a5;mP)6HbX7A7_NUo7cB$_LfzQ8pKrI2VOOL1Sp2XGCI zMkT>Fpw_A>H*`d@i7Q01xwY?(RgB%-?4F9ZnPleo{N8^9e~hW$9*Vc4!V@kYPSiFo zOK=!Pn6|;R19#4MCK^rE;b9a3`0z}Cj4~t@W;;usiLS$U_c1!q=)j-?g>D)0Pr+uE zJQLQt31N@o{MIGc)ItZE*Wn0d1Z5OfELL)?Sdt`Ty}RJ)r^mCKwsDz_ZopP-1)U5+ z!X8CsFy6BY6yfd~yPK;OywzJ~XJf_Fc@?+^H!$5Y)xheRl~$FmF~oA(`KNGp^?((N z`LVyaene@7GOE%w)>yn974jYG^|$?XI`d{k>z#EmSQ44frKan41f@ zym|8eLt_ize%Neh2}uQjmpDPbK)!IL|G@qJX_eh;p^S1pCxft2HsHY%4eCZ^)WLs? YZ{Rt&5@F;rt^fc407*qoM6N<$f}(H1N&o-= literal 0 HcmV?d00001 diff --git a/src/main/java/assets/hbm/textures/items/coin_radiation.png b/src/main/java/assets/hbm/textures/items/coin_radiation.png new file mode 100644 index 0000000000000000000000000000000000000000..0a71626c14bb065a3960ccf9ebdf9a3c6eac3934 GIT binary patch literal 431 zcmV;g0Z{&lP)Y6h%**Oh`J52zGX&NW{V-U?td#AXtbJi6Hq4{s1d0 zTS+aJVkJfiN>D-2Ca_g7h_YZLX_hQI&c-6_nEkNQ*9^?expUur1Ana4ZwG^qgF)!x z#D3!4*k%BBEDM>H$ZTe~j!z~EjYZ+JlX@J^Wl%kvi}Q!Lvnc#(J18IaHs^ofzQ^@# zn^wDv<9Jxl_f%^`HXUt2NP+JYf|aZI@)TO>-#=ZH50&i&WG+Lk-a>ntVj+)m z6^$p`IBY&PsMbiC4APl2LJEWw25!A{X|=l?pEdyuETk|FObg3PQz6^h(`cnbwzt-1 zOt6)^oA4B(Jr@gk9LK};G^N$)*i;gypn5jSRVa5T5)vPQcT0!KQy7ICPqxYCt 5 && dist < 10; + } + } + + @Override + public boolean continueExecuting() { + return this.shouldExecute() || !this.owner.getNavigator().noPath(); + } + + @Override + public void updateTask() { + + timer--; + + if(timer <= 0) { + timer = delay; + + EntityBulletBase bullet = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.G20_SHRAPNEL, owner, target, 1.6F, 0); + owner.worldObj.spawnEntityInWorld(bullet); + owner.playSound("hbm:weapon.sawShoot", 1.0F, 2.0F); + } + } +} diff --git a/src/main/java/com/hbm/entity/mob/EntityAITaintedCreeperSwell.java b/src/main/java/com/hbm/entity/mob/ai/EntityAITaintedCreeperSwell.java similarity index 92% rename from src/main/java/com/hbm/entity/mob/EntityAITaintedCreeperSwell.java rename to src/main/java/com/hbm/entity/mob/ai/EntityAITaintedCreeperSwell.java index 149aa3ec3..b53fda9c2 100644 --- a/src/main/java/com/hbm/entity/mob/EntityAITaintedCreeperSwell.java +++ b/src/main/java/com/hbm/entity/mob/ai/EntityAITaintedCreeperSwell.java @@ -1,4 +1,6 @@ -package com.hbm.entity.mob; +package com.hbm.entity.mob.ai; + +import com.hbm.entity.mob.EntityTaintedCreeper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.EntityAIBase; diff --git a/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java b/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java index 393def65a..3935b5116 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java +++ b/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java @@ -58,6 +58,10 @@ public class EntityBulletBase extends Entity implements IProjectile { this.config = BulletConfigSyncingUtil.pullConfig(config); this.dataWatcher.updateObject(18, config); this.renderDistanceWeight = 10.0D; + + this.dataWatcher.updateObject(16, (byte)this.config.style); + this.dataWatcher.updateObject(17, (byte)this.config.trail); + this.setSize(0.5F, 0.5F); } @@ -87,6 +91,36 @@ public class EntityBulletBase extends Entity implements IProjectile { this.dataWatcher.updateObject(17, (byte)this.config.trail); } + public EntityBulletBase(World world, int config, EntityLivingBase entity, EntityLivingBase target, float motion, float deviation) { + super(world); + + this.config = BulletConfigSyncingUtil.pullConfig(config); + this.dataWatcher.updateObject(18, config); + this.shooter = entity; + + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + + this.posY = entity.posY + entity.getEyeHeight() - 0.10000000149011612D; + double d0 = target.posX - entity.posX; + double d1 = target.boundingBox.minY + target.height / 3.0F - this.posY; + double d2 = target.posZ - entity.posZ; + double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + + if (d3 >= 1.0E-7D) { + float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(entity.posX + d4, this.posY, entity.posZ + d5, f2, f3); + this.yOffset = 0.0F; + this.setThrowableHeading(d0, d1, d2, motion, deviation); + } + + this.dataWatcher.updateObject(16, (byte)this.config.style); + this.dataWatcher.updateObject(17, (byte)this.config.trail); + } + @Override public void setThrowableHeading(double moX, double moY, double moZ, float mult1, float mult2) { diff --git a/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java b/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java index 1b866385f..9278b9984 100644 --- a/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java +++ b/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java @@ -33,6 +33,7 @@ public class BulletConfigSyncingUtil { public static int G20_CAUSTIC = i++; public static int G20_SHOCK = i++; public static int G20_WITHER = i++; + public static int G20_SLEEK = i++; public static int ROCKET_NORMAL = i++; public static int ROCKET_HE = i++; @@ -63,6 +64,7 @@ public class BulletConfigSyncingUtil { public static int G12_SHRAPNEL = i++; public static int G12_DU = i++; public static int G12_AM = i++; + public static int G12_SLEEK = i++; public static int LR22_NORMAL = i++; public static int LR22_AP = i++; @@ -109,6 +111,7 @@ public class BulletConfigSyncingUtil { public static int G4_NORMAL = i++; public static int G4_SLUG = i++; public static int G4_EXPLOSIVE = i++; + public static int G4_SLEEK = i++; public static int SPECIAL_OSIPR = i++; public static int SPECIAL_OSIPR_CHARGED = i++; @@ -185,6 +188,7 @@ public class BulletConfigSyncingUtil { configSet.put(G20_CAUSTIC, Gun20GaugeFactory.get20GaugeCausticConfig()); configSet.put(G20_SHOCK, Gun20GaugeFactory.get20GaugeShockConfig()); configSet.put(G20_WITHER, Gun20GaugeFactory.get20GaugeWitherConfig()); + configSet.put(G20_SLEEK, Gun20GaugeFactory.get20GaugeSleekConfig()); configSet.put(ROCKET_NORMAL, GunRocketFactory.getRocketConfig()); configSet.put(ROCKET_HE, GunRocketFactory.getRocketHEConfig()); @@ -215,6 +219,7 @@ public class BulletConfigSyncingUtil { configSet.put(G12_SHRAPNEL, Gun12GaugeFactory.get12GaugeShrapnelConfig()); configSet.put(G12_DU, Gun12GaugeFactory.get12GaugeDUConfig()); configSet.put(G12_AM, Gun12GaugeFactory.get12GaugeAMConfig()); + configSet.put(G12_SLEEK, Gun12GaugeFactory.get12GaugeSleekConfig()); configSet.put(LR22_NORMAL, Gun22LRFactory.get22LRConfig()); configSet.put(LR22_AP, Gun22LRFactory.get22LRAPConfig()); @@ -261,6 +266,7 @@ public class BulletConfigSyncingUtil { configSet.put(G4_NORMAL, Gun4GaugeFactory.get4GaugeConfig()); configSet.put(G4_SLUG, Gun4GaugeFactory.get4GaugeSlugConfig()); configSet.put(G4_EXPLOSIVE, Gun4GaugeFactory.get4GaugeExplosiveConfig()); + configSet.put(G4_SLEEK, Gun4GaugeFactory.get4GaugeSleekConfig()); configSet.put(SPECIAL_OSIPR, GunOSIPRFactory.getPulseConfig()); configSet.put(SPECIAL_OSIPR_CHARGED, GunOSIPRFactory.getPulseChargedConfig()); diff --git a/src/main/java/com/hbm/handler/RadiationWorldHandler.java b/src/main/java/com/hbm/handler/RadiationWorldHandler.java new file mode 100644 index 000000000..3884bb2dc --- /dev/null +++ b/src/main/java/com/hbm/handler/RadiationWorldHandler.java @@ -0,0 +1,73 @@ +package com.hbm.handler; + +import java.util.List; +import java.util.Map.Entry; + +import com.hbm.saveddata.RadiationSavedData; + +import net.minecraft.init.Blocks; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.gen.ChunkProviderServer; + +public class RadiationWorldHandler { + + public static void handleWorldDestruction(World world) { + + if(!(world instanceof WorldServer)) + return; + + WorldServer serv = (WorldServer)world; + + RadiationSavedData data = RadiationSavedData.getData(serv); + List loadedChunks = ((ChunkProviderServer) serv.getChunkProvider()).func_152380_a(); + + int count = 50;//MainRegistry.worldRad; + int threshold = 5;//MainRegistry.worldRadThreshold; + + Object[] entries = data.contamination.entrySet().toArray(); + + if(entries.length == 0) + return; + + Entry randEnt = (Entry) entries[world.rand.nextInt(entries.length)]; + + ChunkCoordIntPair coords = randEnt.getKey(); + Chunk chunk = world.getChunkFromChunkCoords(coords.chunkXPos, coords.chunkZPos); + + for(int i = 0; i < 1; i++) { + + + if(randEnt == null || randEnt.getValue() < threshold) + continue; + + if(chunk != null && loadedChunks.contains(chunk)) { + + for(int a = 0; a < 16; a ++) { + for(int b = 0; b < 16; b ++) { + + if(world.rand.nextInt(3) != 0) + continue; + + int x = coords.getCenterXPos() - 8 + a; + int z = coords.getCenterZPosition() - 8 + b; + int y = world.getHeightValue(x, z) - world.rand.nextInt(2); + + if(world.getBlock(x, y, z) == Blocks.grass) { + world.setBlock(x, y, z, Blocks.dirt); + } else if(world.getBlock(x, y, z) == Blocks.tallgrass) { + world.setBlock(x, y, z, Blocks.air); + } else if(world.getBlock(x, y, z) == Blocks.leaves) { + world.setBlock(x, y, z, Blocks.air); + } else if(world.getBlock(x, y, z) == Blocks.leaves2) { + world.setBlock(x, y, z, Blocks.air); + } + } + } + } + } + } + +} diff --git a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java index 0822ffcb0..8213402d0 100644 --- a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java @@ -1,9 +1,12 @@ package com.hbm.handler.guncfg; import java.util.List; +import java.util.Random; +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; import com.hbm.interfaces.IBulletUpdateBehavior; @@ -109,6 +112,61 @@ public class BulletConfigFactory { return bullet; } + public static BulletConfiguration standardAirstrikeConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 5.0F; + bullet.spread = 0.0F; + bullet.wear = 50; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = false; + bullet.doesPenetrate = false; + bullet.doesBreakGlass = false; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.leadChance = 0; + bullet.vPFX = "reddust"; + + bullet.bImpact = new IBulletImpactBehavior() { + + @Override + public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) { + + if(bullet.worldObj.isRemote) + return; + + Random rand = bullet.worldObj.rand; + int count = rand.nextInt(11) + 95; + + for(int i = 0; i < count; i++) { + + double dx = bullet.posX + rand.nextGaussian() * 4; + double dy = bullet.posY + 25 + rand.nextGaussian() * 5; + double dz = bullet.posZ + rand.nextGaussian() * 4; + + Vec3 motion = Vec3.createVectorHelper(bullet.posX - dx, bullet.posY - dy, bullet.posZ - dz); + motion = motion.normalize(); + + EntityBulletBase bolt = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.R556_FLECHETTE_DU); + bolt.setPosition(dx, dy, dz); + bolt.setThrowableHeading(motion.xCoord, motion.yCoord, motion.zCoord, 0.5F, 0.1F); + bullet.worldObj.spawnEntityInWorld(bolt); + + if(i < 30) { + EntityBSmokeFX bsmoke = new EntityBSmokeFX(bullet.worldObj); + bsmoke.setPosition(dx, dy, dz); + bullet.worldObj.spawnEntityInWorld(bsmoke); + } + } + } + }; + + return bullet; + } + public static BulletConfiguration standardRocketConfig() { BulletConfiguration bullet = new BulletConfiguration(); diff --git a/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java index 31cffe9d3..09771cc07 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java @@ -44,6 +44,7 @@ public class Gun12GaugeFactory { config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL); config.config.add(BulletConfigSyncingUtil.G12_DU); config.config.add(BulletConfigSyncingUtil.G12_AM); + config.config.add(BulletConfigSyncingUtil.G12_SLEEK); return config; } @@ -78,6 +79,7 @@ public class Gun12GaugeFactory { config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL); config.config.add(BulletConfigSyncingUtil.G12_DU); config.config.add(BulletConfigSyncingUtil.G12_AM); + config.config.add(BulletConfigSyncingUtil.G12_SLEEK); return config; } @@ -158,5 +160,14 @@ public class Gun12GaugeFactory { return bullet; } + + public static BulletConfiguration get12GaugeSleekConfig() { + + BulletConfiguration bullet = BulletConfigFactory.standardAirstrikeConfig(); + + bullet.ammo = ModItems.ammo_12gauge_sleek; + + return bullet; + } } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun20GaugeFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun20GaugeFactory.java index 401333c34..23d784e63 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun20GaugeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun20GaugeFactory.java @@ -58,6 +58,7 @@ public class Gun20GaugeFactory { config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC); config.config.add(BulletConfigSyncingUtil.G20_SHOCK); config.config.add(BulletConfigSyncingUtil.G20_WITHER); + config.config.add(BulletConfigSyncingUtil.G20_SLEEK); return config; } @@ -84,6 +85,7 @@ public class Gun20GaugeFactory { config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC); config.config.add(BulletConfigSyncingUtil.G20_SHOCK); config.config.add(BulletConfigSyncingUtil.G20_WITHER); + config.config.add(BulletConfigSyncingUtil.G20_SLEEK); return config; } @@ -110,6 +112,7 @@ public class Gun20GaugeFactory { config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC); config.config.add(BulletConfigSyncingUtil.G20_SHOCK); config.config.add(BulletConfigSyncingUtil.G20_WITHER); + config.config.add(BulletConfigSyncingUtil.G20_SLEEK); return config; } @@ -137,6 +140,7 @@ public class Gun20GaugeFactory { config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC); config.config.add(BulletConfigSyncingUtil.G20_SHOCK); config.config.add(BulletConfigSyncingUtil.G20_WITHER); + config.config.add(BulletConfigSyncingUtil.G20_SLEEK); return config; } @@ -164,6 +168,7 @@ public class Gun20GaugeFactory { config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC); config.config.add(BulletConfigSyncingUtil.G20_SHOCK); config.config.add(BulletConfigSyncingUtil.G20_WITHER); + config.config.add(BulletConfigSyncingUtil.G20_SLEEK); return config; } @@ -191,6 +196,7 @@ public class Gun20GaugeFactory { config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC_FIRE); config.config.add(BulletConfigSyncingUtil.G20_SHOCK_FIRE); config.config.add(BulletConfigSyncingUtil.G20_WITHER_FIRE); + config.config.add(BulletConfigSyncingUtil.G20_SLEEK); return config; } @@ -327,5 +333,14 @@ public class Gun20GaugeFactory { return bullet; } + + public static BulletConfiguration get20GaugeSleekConfig() { + + BulletConfiguration bullet = BulletConfigFactory.standardAirstrikeConfig(); + + bullet.ammo = ModItems.ammo_20gauge_sleek; + + return bullet; + } } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun4GaugeFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun4GaugeFactory.java index c68c000cb..34f6a174c 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun4GaugeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun4GaugeFactory.java @@ -50,6 +50,7 @@ public class Gun4GaugeFactory { config.config.add(BulletConfigSyncingUtil.G4_NORMAL); config.config.add(BulletConfigSyncingUtil.G4_SLUG); config.config.add(BulletConfigSyncingUtil.G4_EXPLOSIVE); + config.config.add(BulletConfigSyncingUtil.G4_SLEEK); return config; } @@ -98,6 +99,7 @@ public class Gun4GaugeFactory { config.config.add(BulletConfigSyncingUtil.G4_NORMAL); config.config.add(BulletConfigSyncingUtil.G4_SLUG); config.config.add(BulletConfigSyncingUtil.G4_EXPLOSIVE); + config.config.add(BulletConfigSyncingUtil.G4_SLEEK); return config; } @@ -142,4 +144,13 @@ public class Gun4GaugeFactory { return bullet; } + + public static BulletConfiguration get4GaugeSleekConfig() { + + BulletConfiguration bullet = BulletConfigFactory.standardAirstrikeConfig(); + + bullet.ammo = ModItems.ammo_4gauge_sleek; + + return bullet; + } } diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 58014ed7b..8ab22f726 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -738,6 +738,8 @@ public class ModItems { public static Item canned_bark; public static Item can_key; + public static Item coin_maskman; + public static Item rod_empty; public static Item rod_uranium; public static Item rod_th232; @@ -1117,6 +1119,7 @@ public class ModItems { public static Item ammo_12gauge_incendiary; public static Item ammo_12gauge_shrapnel; public static Item ammo_12gauge_du; + public static Item ammo_12gauge_sleek; public static Item ammo_12gauge_marauder; public static Item ammo_20gauge; public static Item ammo_20gauge_slug; @@ -1127,9 +1130,11 @@ public class ModItems { public static Item ammo_20gauge_caustic; public static Item ammo_20gauge_shock; public static Item ammo_20gauge_wither; + public static Item ammo_20gauge_sleek; public static Item ammo_4gauge; public static Item ammo_4gauge_slug; public static Item ammo_4gauge_explosive; + public static Item ammo_4gauge_sleek; public static Item ammo_357_desh; public static Item ammo_44; public static Item ammo_44_ap; @@ -2576,6 +2581,7 @@ public class ModItems { canned_bark = new ItemLemon(2, 5, false).setUnlocalizedName("canned_bark").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_bark"); can_key = new Item().setUnlocalizedName("can_key").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_key"); + coin_maskman = new ItemCustomLore().setUnlocalizedName("coin_maskman").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coin_maskman"); recycled_ground = new Item().setUnlocalizedName("recycled_ground").setCreativeTab(null).setTextureName(RefStrings.MODID + ":recycled_ground"); recycled_rock = new Item().setUnlocalizedName("recycled_rock").setCreativeTab(null).setTextureName(RefStrings.MODID + ":recycled_rock"); @@ -2933,6 +2939,7 @@ public class ModItems { ammo_12gauge_incendiary = new ItemAmmo().setUnlocalizedName("ammo_12gauge_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_12gauge_incendiary"); ammo_12gauge_shrapnel = new ItemAmmo().setUnlocalizedName("ammo_12gauge_shrapnel").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_12gauge_shrapnel"); ammo_12gauge_du = new ItemAmmo().setUnlocalizedName("ammo_12gauge_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_12gauge_du"); + ammo_12gauge_sleek = new ItemAmmo().setUnlocalizedName("ammo_12gauge_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_12gauge_sleek"); ammo_12gauge_marauder = new ItemAmmo().setUnlocalizedName("ammo_12gauge_marauder").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_12gauge_marauder"); ammo_20gauge = new ItemAmmo().setUnlocalizedName("ammo_20gauge").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge"); ammo_20gauge_slug = new ItemAmmo().setUnlocalizedName("ammo_20gauge_slug").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_slug"); @@ -2943,9 +2950,11 @@ public class ModItems { ammo_20gauge_caustic = new ItemAmmo().setUnlocalizedName("ammo_20gauge_caustic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_caustic"); ammo_20gauge_shock = new ItemAmmo().setUnlocalizedName("ammo_20gauge_shock").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_shock"); ammo_20gauge_wither = new ItemAmmo().setUnlocalizedName("ammo_20gauge_wither").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_wither"); + ammo_20gauge_sleek = new ItemAmmo().setUnlocalizedName("ammo_20gauge_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_sleek"); ammo_4gauge = new ItemAmmo().setUnlocalizedName("ammo_4gauge").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_4gauge"); ammo_4gauge_slug = new ItemAmmo().setUnlocalizedName("ammo_4gauge_slug").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_4gauge_slug"); ammo_4gauge_explosive = new ItemAmmo().setUnlocalizedName("ammo_4gauge_explosive").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_4gauge_explosive"); + ammo_4gauge_sleek = new ItemAmmo().setUnlocalizedName("ammo_4gauge_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_4gauge_sleek"); ammo_5mm = new ItemAmmo().setUnlocalizedName("ammo_5mm").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_5mm"); ammo_5mm_explosive = new ItemAmmo().setUnlocalizedName("ammo_5mm_explosive").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_5mm_explosive"); ammo_5mm_du = new ItemAmmo().setUnlocalizedName("ammo_5mm_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_5mm_du"); @@ -5141,6 +5150,7 @@ public class ModItems { GameRegistry.registerItem(ammo_12gauge_incendiary, ammo_12gauge_incendiary.getUnlocalizedName()); GameRegistry.registerItem(ammo_12gauge_shrapnel, ammo_12gauge_shrapnel.getUnlocalizedName()); GameRegistry.registerItem(ammo_12gauge_du, ammo_12gauge_du.getUnlocalizedName()); + GameRegistry.registerItem(ammo_12gauge_sleek, ammo_12gauge_sleek.getUnlocalizedName()); GameRegistry.registerItem(ammo_12gauge_marauder, ammo_12gauge_marauder.getUnlocalizedName()); GameRegistry.registerItem(ammo_20gauge, ammo_20gauge.getUnlocalizedName()); GameRegistry.registerItem(ammo_20gauge_slug, ammo_20gauge_slug.getUnlocalizedName()); @@ -5151,9 +5161,11 @@ public class ModItems { GameRegistry.registerItem(ammo_20gauge_caustic, ammo_20gauge_caustic.getUnlocalizedName()); GameRegistry.registerItem(ammo_20gauge_shock, ammo_20gauge_shock.getUnlocalizedName()); GameRegistry.registerItem(ammo_20gauge_wither, ammo_20gauge_wither.getUnlocalizedName()); + GameRegistry.registerItem(ammo_20gauge_sleek, ammo_20gauge_sleek.getUnlocalizedName()); GameRegistry.registerItem(ammo_4gauge, ammo_4gauge.getUnlocalizedName()); GameRegistry.registerItem(ammo_4gauge_slug, ammo_4gauge_slug.getUnlocalizedName()); GameRegistry.registerItem(ammo_4gauge_explosive, ammo_4gauge_explosive.getUnlocalizedName()); + GameRegistry.registerItem(ammo_4gauge_sleek, ammo_4gauge_sleek.getUnlocalizedName()); GameRegistry.registerItem(ammo_44, ammo_44.getUnlocalizedName()); GameRegistry.registerItem(ammo_44_ap, ammo_44_ap.getUnlocalizedName()); GameRegistry.registerItem(ammo_44_du, ammo_44_du.getUnlocalizedName()); @@ -5519,6 +5531,7 @@ public class ModItems { GameRegistry.registerItem(cap_star, cap_star.getUnlocalizedName()); GameRegistry.registerItem(ring_pull, ring_pull.getUnlocalizedName()); GameRegistry.registerItem(can_key, can_key.getUnlocalizedName()); + GameRegistry.registerItem(coin_maskman, coin_maskman.getUnlocalizedName()); //Chaos GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/special/ItemCustomLore.java b/src/main/java/com/hbm/items/special/ItemCustomLore.java index 7d7e173e0..76a6c752f 100644 --- a/src/main/java/com/hbm/items/special/ItemCustomLore.java +++ b/src/main/java/com/hbm/items/special/ItemCustomLore.java @@ -431,7 +431,8 @@ public class ItemCustomLore extends Item { this == ModItems.nugget_daffergon || this == ModItems.nugget_verticium || this == ModItems.powder_australium || this == ModItems.powder_weidanium || this == ModItems.powder_reiium || this == ModItems.powder_unobtainium || - this == ModItems.powder_daffergon || this == ModItems.powder_verticium) + this == ModItems.powder_daffergon || this == ModItems.powder_verticium || + this == ModItems.coin_maskman) { return EnumRarity.uncommon; } diff --git a/src/main/java/com/hbm/items/weapon/ItemAmmo.java b/src/main/java/com/hbm/items/weapon/ItemAmmo.java index 7ac5d768c..cd7fa2d73 100644 --- a/src/main/java/com/hbm/items/weapon/ItemAmmo.java +++ b/src/main/java/com/hbm/items/weapon/ItemAmmo.java @@ -34,6 +34,9 @@ public class ItemAmmo extends Item { list.add(EnumChatFormatting.BLUE + "+ Instantly removes annoying and unbalanced enemies"); list.add(EnumChatFormatting.YELLOW + "* No drawbacks lole"); } + if(this == ModItems.ammo_12gauge_sleek) { + list.add(EnumChatFormatting.YELLOW + "* Fires a tracer which summons a storm of DU-flechettes"); + } //20 GAUGE if(this == ModItems.ammo_20gauge_flechette) { @@ -78,6 +81,9 @@ public class ItemAmmo extends Item { list.add(EnumChatFormatting.BLUE + "+ Increased damage"); list.add(EnumChatFormatting.BLUE + "+ Withering"); } + if(this == ModItems.ammo_20gauge_sleek) { + list.add(EnumChatFormatting.YELLOW + "* Fires a tracer which summons a storm of DU-flechettes"); + } //23mm if(this == ModItems.ammo_4gauge_slug) { @@ -93,6 +99,9 @@ public class ItemAmmo extends Item { list.add(EnumChatFormatting.RED + "- Highly increased wear"); list.add(EnumChatFormatting.RED + "- Single projectile"); } + if(this == ModItems.ammo_4gauge_sleek) { + list.add(EnumChatFormatting.YELLOW + "* Fires a tracer which summons a storm of DU-flechettes"); + } //.357 MAGNUM if(this == ModItems.ammo_357_desh) { diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index bed0708f0..4dffcbe92 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -831,11 +831,14 @@ public class CraftingManager { GameRegistry.addRecipe(new ItemStack(ModItems.ammo_12gauge_incendiary, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_12gauge, 'A', ModItems.powder_fire }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_12gauge_shrapnel, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_12gauge, 'A', ModBlocks.gravel_obsidian }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_12gauge_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_12gauge, 'A', ModItems.ingot_u238 }); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_12gauge_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_12gauge, 'A', ModItems.coin_maskman }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_20gauge_incendiary, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_20gauge, 'A', ModItems.powder_fire }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_20gauge_shrapnel, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_20gauge, 'A', ModBlocks.gravel_obsidian }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_20gauge_caustic, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_20gauge, 'A', ModItems.powder_poison }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_20gauge_shock, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_20gauge, 'A', "dustDiamond" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_20gauge_wither, 4), new Object[] { "BCB", "CAC", "BCB", 'B', ModItems.ammo_20gauge, 'A', Blocks.soul_sand, 'C', "dustCoal" })); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_20gauge_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_20gauge, 'A', ModItems.coin_maskman }); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_4gauge_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_4gauge, 'A', ModItems.coin_maskman }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_44_ap, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_44, 'A', ModItems.ingot_dura_steel }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_44_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_44, 'A', ModItems.ingot_u238 }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_44_phosphorus, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_44, 'A', ModItems.ingot_phosphorus }); diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index e86353e3d..922d55f09 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -319,6 +319,8 @@ public class MainRegistry public static int fogRad = 100; public static int fogCh = 20; public static float hellRad = 0.1F; + public static int worldRad = 10; + public static int worldRadThreshold = 20; public static int generalOverride = 0; public static int polaroidID = 1; @@ -1532,6 +1534,8 @@ public class MainRegistry Property netherRad = config.get(CATEGORY_NUKE, "6.09_netherRad", 10); netherRad.comment = "RAD/s in the nether in hundredths"; hellRad = netherRad.getInt() * 0.01F; + worldRad = createConfigInt(config, CATEGORY_NUKE, "6.10_worldRadCount", "How many block operations radiation can perform per tick", 10); + worldRadThreshold = createConfigInt(config, CATEGORY_NUKE, "6.11_worldRadThreshold", "The least amount of RADs required for block modification to happen", 20); final String CATEGORY_MISSILE = "07_missile_machines"; Property propRadarRange = config.get(CATEGORY_MISSILE, "7.00_radarRange", 1000); diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 6c863b464..e9d99dbb8 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -14,6 +14,7 @@ import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.projectile.EntityBurningFOEQ; import com.hbm.entity.projectile.EntityMeteor; import com.hbm.handler.ArmorUtil; +import com.hbm.handler.RadiationWorldHandler; import com.hbm.handler.VersionChecker; import com.hbm.items.ModItems; import com.hbm.items.armor.ArmorFSB; @@ -28,6 +29,7 @@ import com.hbm.saveddata.RadiationSavedData; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; @@ -217,7 +219,7 @@ public class ModEventHandler } } - if(event.world.getTotalWorldTime() % 20 == 0) { + if(event.world.getTotalWorldTime() % 20 == 0 && event.phase == Phase.START) { data.updateSystem(); } @@ -361,6 +363,9 @@ public class ModEventHandler } } /// RADIATION STUFF END /// + + if(event.phase == Phase.START) + RadiationWorldHandler.handleWorldDestruction(event.world); } @SubscribeEvent diff --git a/src/main/java/com/hbm/saveddata/RadiationSavedData.java b/src/main/java/com/hbm/saveddata/RadiationSavedData.java index abd024f40..d5058f5e6 100644 --- a/src/main/java/com/hbm/saveddata/RadiationSavedData.java +++ b/src/main/java/com/hbm/saveddata/RadiationSavedData.java @@ -68,8 +68,8 @@ public class RadiationSavedData extends WorldSavedData { float rad = struct.getValue(); //struct.radiation *= 0.999F; - rad *= 0.99F; - rad -= 0.5F; + rad *= 0.999F; + rad -= 0.05F; if(rad <= 0) { rad = 0;