diff --git a/src/main/java/assets/hbm/lang/de_DE.lang b/src/main/java/assets/hbm/lang/de_DE.lang index cb89c09cf..213359c64 100644 --- a/src/main/java/assets/hbm/lang/de_DE.lang +++ b/src/main/java/assets/hbm/lang/de_DE.lang @@ -16,6 +16,14 @@ achievement.c44.desc=Galvanisch verzinkt! ...das macht in der Übersetzung sowas achievement.c44=Kapitel 44 achievement.chemistry.desc=Bobmazon Level 3 (Betonziegel) achievement.chemistry=Chemie +achievement.digammaFeel.desc=the hollow within. +achievement.digammaFeel=The Terror of Feeling +achievement.digammaKauaiMoho.desc=Alles ist schrecklich, hier ist etwas heiße Schoki. +achievement.digammaKauaiMoho=Sing, sing mir das Lied der Kauai Moho +achievement.digammaKnow.desc=what this world is about. +achievement.digammaKnow=The Terror of Knowing +achievement.digammaSee.desc=into the abyss. +achievement.digammaSee=The Terror of Seeing achievement.fiend.desc=Sei gemein. achievement.fiend2.desc=Sei gemeiner. achievement.fiend2=Unhold 2: Noch unholdiger @@ -237,6 +245,10 @@ container.soyuzCapsule=Landekapsel container.soyuzLauncher=Soyuz-Startplatform container.teleLinker=TelLink-Gerät container.teleporter=Teleporter +container.turretChekhov=Tschechows Gewehr +container.turretFriendly=Mister Friendly +container.turretJeremy=Jeremy +container.turretTauon=Tauon container.uf6_tank=UF6 Tank container.wasteDrum=Abklingbecken-Trommel container.watzPowerplant=Watzkraftwerk @@ -244,6 +256,7 @@ container.watzPowerplant=Watzkraftwerk death.attack.acid=%1$s fiel in Säure. death.attack.ams=%1$s wurde in tödlichen Teilchen gebadet, die von der Menschheit erst benannt werden müssen. death.attack.amsCore=%1$s wurde vom Feuer einer Singularität verdampft. +death.attack.asbestos=%1$s hat sich für finanzielle Entschädigung qualifiziert. death.attack.bang=%1$s wurde in mundgerechte Stücke zerfetzt. death.attack.blackhole=%1$s wurde spaghettifiziert. death.attack.blender=%1$s wurde in kleine, mundgerechte Stücke geschnitten. @@ -533,6 +546,11 @@ item.ammo_rocket_rpc.name=84mm Raketengetriebene Kettensäge item.ammo_rocket_shrapnel.name=84mm Rakete (Schrapnell) item.ammo_rocket_sleek.name=84mm Rakete (IF-R&D) item.ammo_rocket_toxic.name=84mm Rakete (Chemisch) +item.ammo_shell.name=240mm Geschoss +item.ammo_shell_apfsds_du.name=240mm APFSTS-DU +item.ammo_shell_apfsds_t.name=240mm APFSTS-T +item.ammo_shell_explosive.name=240mm HE-Geschoss +item.ammo_shell_w9.name=240mm W9 Atomares Geschoss item.ams_catalyst_aluminium.name=Aluminium-Reaktionskatalysator item.ams_catalyst_beryllium.name=Beryllium-Reaktionskatalysator item.ams_catalyst_blank.name=Blanker Reaktionskatalysator @@ -878,6 +896,11 @@ item.cmb_shovel.name=CMB-Stahlschaufel item.cmb_sword.name=CMB-Stahlschwert item.cobalt_axe.name=Kobaltaxt item.cobalt_boots.name=Kobaltstiefel +item.cobalt_decorated_axe.name=Ausgezeichnete Kobaltaxt +item.cobalt_decorated_hoe.name=Ausgezeichnete Kobaltfeldhacke +item.cobalt_decorated_pickaxe.name=Ausgezeichnete Kobaltspitzhacke +item.cobalt_decorated_shovel.name=Ausgezeichnete Kobaltschaufel +item.cobalt_decorated_sword.name=Ausgezeichnete Kobaltschwert item.cobalt_helmet.name=Kobalthelm item.cobalt_hoe.name=Kobaltfeldhacke item.cobalt_legs.name=Kobaltbeinschutz @@ -960,6 +983,10 @@ item.detonator_deadman.name=Totmannzünder item.detonator_laser.name=Laserzünder item.detonator_multi.name=Mehrfach-Fernzünder item.diamond_gavel.name=Diamantener Richterhammer +item.dnt_boots.name=dienautronium stiefel +item.dnt_legs.name=dineuterium beine +item.dnt_helmet.name=dinotroniumu helme +item.dnt_plate.name=dineutrom brustplatte item.door_bunker.name=Bunkertür item.door_metal.name=Metalltür item.door_office.name=Bürotür @@ -1325,6 +1352,7 @@ item.ingot_uranium_fuel.name=Urankernbrennstoffbarren item.ingot_verticium.name=Verticiumbarren item.ingot_weidanium.name=Weidaniumbarren item.ink.name=林-Tinte +item.insert_doxium.name=Astolfium-dottierte Doxiumeinlage item.insert_du.name=DU-Einlage item.insert_era.name=Explosive Reaktivpaanzerungseinlage item.insert_esapi.name=ESAPI-Einlage @@ -1586,7 +1614,16 @@ item.niter.name=Salpeter item.nossy_hat.name=Fabulöser Hut item.nothing.name=Leer item.nuclear_waste.name=Atommüll +item.nuclear_waste_pearl.name=Atommüllperle item.nuclear_waste_tiny.name=Kleiner Haufen Atommüll +item.nuclear_waste_long.name=Langlebiger Atommüll +item.nuclear_waste_long_tiny.name=Kleiner Haufen langlebiger Atommüll +item.nuclear_waste_long_depleted.name=Zerfallender langlebiger Atommüll +item.nuclear_waste_long_depleted_tiny.name=Kleiner Haufen zerfallender langlebiger Atommüll +item.nuclear_waste_short.name=Kurzlebiger Atommüll +item.nuclear_waste_short_tiny.name=Kleiner Haufen kurzlebiger Atommüll +item.nuclear_waste_short_depleted.name=Zerfallender kurzlebiger Atommüll +item.nuclear_waste_short_depleted_tiny.name=Kleiner Haufen zerfallender kurzlebiger Atommüll item.nugget.name=Chicken Nugget item.nugget_australium.name=Australiumnugget item.nugget_beryllium.name=Berylliumnugget @@ -2026,10 +2063,15 @@ item.stamp_titanium_circuit.name=Schaltkreisstempel (Titan) item.stamp_titanium_flat.name=Flacher Stempel (Titan) item.stamp_titanium_plate.name=Plattenstempel (Titan) item.stamp_titanium_wire.name=Kabelstempel (Titan) +item.starmetal_axe.name=Sternenmetallaxt item.starmetal_boots.name=Sternenmetallstiefel item.starmetal_helmet.name=Sternenmetallhelm +item.starmetal_hoe.name=Sternenmetallfeldhacke item.starmetal_legs.name=Sternenmetallbeinschutz +item.starmetal_pickaxe.name=Sternenmetallspitzhacke item.starmetal_plate.name=Sternenmetallbrustpanzer +item.starmetal_shovel.name=Sternenmetallschaufel +item.starmetal_sword.name=Sternenmetallschwert item.static_sandwich.name=Sandwich mit Fernsehrauschen garniert item.stealth_boy.name=Mobile Tarnkappe item.steel_axe.name=Stahlaxt @@ -2735,13 +2777,17 @@ tile.tile_lab_broken.name=Gebrochene Labotfliesen tile.tile_lab_cracked.name=Gesprungene Laborfliesen tile.toxic_block.name=Stereotypischer grüner Schleim tile.turret_cheapo.name=Billigsdorfer Gatling-Geschütz +tile.turret_chekhov.name=Schweres MG-Geschütz "Tschechows Gewehr" tile.turret_cwis.name=Phalanx Mk-15 CIWS tile.turret_flamer.name=Flammenwerfergeschütz +tile.turret_friendly.name=Gatlingeschütz "Mister Friendly" tile.turret_heavy.name=Schweres MG-Geschütz +tile.turret_jeremy.name=Autokanonengeschütz "Jeremy" tile.turret_light.name=Leichtes MG-Geschütz tile.turret_rocket.name=Raketengeschütz tile.turret_spitfire.name=Geschütz für das ich noch keinen Namen habe [WIP] tile.turret_tau.name=Tauonengeschütz +tile.turret_tauon.name=XVL1456-Prototypengeschütz "Tauon" tile.vault_door.name=Vault-Tec Sprengtür tile.vent_chlorine.name=Chlorgas-Auslass tile.vent_chlorine_seal.name=Chlorgassiegel diff --git a/src/main/java/assets/hbm/lang/en_US.lang b/src/main/java/assets/hbm/lang/en_US.lang index c7867a0c4..c2560a134 100644 --- a/src/main/java/assets/hbm/lang/en_US.lang +++ b/src/main/java/assets/hbm/lang/en_US.lang @@ -18,6 +18,8 @@ achievement.chemistry.desc=Bobmazon Level 3 (Concrete Bricks) achievement.chemistry=Chemistry achievement.digammaFeel.desc=the hollow within. achievement.digammaFeel=The Terror of Feeling +achievement.digammaKauaiMoho.desc=Everything is awful, here's some hot choccy. +achievement.digammaKauaiMoho=Sing, sing me the song of the Kauai Moho achievement.digammaKnow.desc=what this world is about. achievement.digammaKnow=The Terror of Knowing achievement.digammaSee.desc=into the abyss. @@ -243,6 +245,10 @@ container.soyuzCapsule=Cargo Landing Capsule container.soyuzLauncher=Soyuz Launch Platform container.teleLinker=TelLink Device container.teleporter=Teleporter +container.turretChekhov=Chekhov's Gun +container.turretFriendly=Mister Friendly +container.turretJeremy=Jeremy +container.turretTauon=Tauon container.uf6_tank=UF6 Tank container.wasteDrum=Spent Fuel Pool Drum container.watzPowerplant=Watz Power Plant @@ -250,6 +256,7 @@ container.watzPowerplant=Watz Power Plant death.attack.acid=%1$s fell into acid. death.attack.ams=%1$s was bathed in deadly particles that have yet to be named by human science. death.attack.amsCore=%1$s was vaporized in the fire of a singularity. +death.attack.asbestos=%1$s is now entitled to financial compensation. death.attack.bang=%1$s was blasted into bite-sized pieces. death.attack.blackhole=%1$s was spaghettified. death.attack.blender=%1$s was chopped in small, bite-sized pieces. @@ -539,6 +546,11 @@ item.ammo_rocket_rpc.name=84mm Rocket Propelled Chainsaw item.ammo_rocket_shrapnel.name=84mm Rocket (Shrapnel) item.ammo_rocket_sleek.name=84mm Rocket (IF-R&D) item.ammo_rocket_toxic.name=84mm Rocket (Chemical) +item.ammo_shell.name=240mm Shell +item.ammo_shell_apfsds_du.name=240mm APFSTS-DU +item.ammo_shell_apfsds_t.name=240mm APFSTS-T +item.ammo_shell_explosive.name=240mm HE Shell +item.ammo_shell_w9.name=240mm W9 Nuclear Shell item.ams_catalyst_aluminium.name=Aluminium Reaction Catalyst item.ams_catalyst_beryllium.name=Beryllium Reaction Catalyst item.ams_catalyst_blank.name=Blank Reaction Catalyst @@ -884,6 +896,11 @@ item.cmb_shovel.name=CMB Steel Shovel item.cmb_sword.name=CMB Steel Sword item.cobalt_axe.name=Cobalt Axe item.cobalt_boots.name=Cobalt Boots +item.cobalt_decorated_axe.name=Decorated Cobalt Axe +item.cobalt_decorated_hoe.name=Decorated Cobalt Hoe +item.cobalt_decorated_pickaxe.name=Decorated Cobalt Pickaxe +item.cobalt_decorated_shovel.name=Decorated Cobalt Shovel +item.cobalt_decorated_sword.name=Decorated Cobalt Sword item.cobalt_helmet.name=Cobalt Helmet item.cobalt_hoe.name=Cobalt Hoe item.cobalt_legs.name=Cobalt Leggings @@ -966,6 +983,10 @@ item.detonator_deadman.name=Dead Man's Detonator item.detonator_laser.name=Laser Detonator item.detonator_multi.name=Multi Detonator item.diamond_gavel.name=Diamond Gavel +item.dnt_boots.name=dienautronium boots +item.dnt_legs.name=dineuterium legs +item.dnt_helmet.name=dinotroniumu helmet +item.dnt_plate.name=dineutrom chestplate item.door_bunker.name=Bunker Door item.door_metal.name=Metal Door item.door_office.name=Office Door @@ -1331,6 +1352,7 @@ item.ingot_uranium_fuel.name=Ingot of Uranium Fuel item.ingot_verticium.name=Verticium Ingot item.ingot_weidanium.name=Weidanium Ingot item.ink.name=林 Ink +item.insert_doxium.name=Astolfium-Doped Doxium Insert item.insert_du.name=DU Insert item.insert_era.name=Explosive Reactive Armor Insert item.insert_esapi.name=ESAPI Insert @@ -1592,7 +1614,16 @@ item.niter.name=Niter item.nossy_hat.name=Fabulous Hat item.nothing.name=Nothing item.nuclear_waste.name=Nuclear Waste +item.nuclear_waste_pearl.name=Nuclear Waste Pearl item.nuclear_waste_tiny.name=Tiny Pile of Nuclear Waste +item.nuclear_waste_long.name=Long-Lived Nuclear Waste +item.nuclear_waste_long_tiny.name=Tiny Pile of Long-Lived Nuclear Waste +item.nuclear_waste_long_depleted.name=Decayed Long-Lived Nuclear Waste +item.nuclear_waste_long_depleted_tiny.name=Tiny Pile of Decayed Long-Lived Nuclear Waste +item.nuclear_waste_short.name=Short-Lived Nuclear Waste +item.nuclear_waste_short_tiny.name=Tiny Pile of Short-Lived Nuclear Waste +item.nuclear_waste_short_depleted.name=Decayed Short-Lived Nuclear Waste +item.nuclear_waste_short_depleted_tiny.name=Tiny Pile of Decayed Short-Lived Nuclear Waste item.nugget.name=Chicken Nugget item.nugget_australium.name=Australium Nugget item.nugget_beryllium.name=Beryllium Nugget @@ -2032,10 +2063,15 @@ item.stamp_titanium_circuit.name=Circuit Stamp (Titanium) item.stamp_titanium_flat.name=Flat Stamp (Titanium) item.stamp_titanium_plate.name=Plate Stamp (Titanium) item.stamp_titanium_wire.name=Wire Stamp (Titanium) +item.starmetal_axe.name=Starmetal Axe item.starmetal_boots.name=Starmetal Boots item.starmetal_helmet.name=Starmetal Helmet +item.starmetal_hoe.name=Starmetal Hoe item.starmetal_legs.name=Starmetal Leggings +item.starmetal_pickaxe.name=Starmetal Pickaxe item.starmetal_plate.name=Starmetal Chestplate +item.starmetal_shovel.name=Starmetal Shovel +item.starmetal_sword.name=Starmetal Sword item.static_sandwich.name=Sandwich Garnished with TV Static item.stealth_boy.name=Stealth Device item.steel_axe.name=Steel Axe @@ -2741,13 +2777,17 @@ tile.tile_lab_broken.name=Broken Laboratory Tiles tile.tile_lab_cracked.name=Cracked Laboratory Tiles tile.toxic_block.name=Stereotypical Green Ooze tile.turret_cheapo.name=Cheapo Gatling Sentry +tile.turret_chekhov.name=Heavy Machine Gun Turret "Chekhov's Gun" tile.turret_cwis.name=Phalanx Mk-15 CIWS tile.turret_flamer.name=Flamethrower Turret +tile.turret_friendly.name=Chaingun Turret "Mister Friendly" tile.turret_heavy.name=Heavy Machine Gun Turret +tile.turret_jeremy.name=Autocannon Turret "Jeremy" tile.turret_light.name=Light Machine Gun Turret tile.turret_rocket.name=Rocket Turret tile.turret_spitfire.name=Turret I have no name for right now [WIP] tile.turret_tau.name=Tauon Turret +tile.turret_tauon.name=XVL1456 Prototype Turret "Tauon" tile.vault_door.name=Vault-Tec Blast Door tile.vent_chlorine.name=Chlorine Vent tile.vent_chlorine_seal.name=Chlorine Seal diff --git a/src/main/java/assets/hbm/textures/armor/dnt_1.png b/src/main/java/assets/hbm/textures/armor/dnt_1.png new file mode 100644 index 000000000..2ad054904 Binary files /dev/null and b/src/main/java/assets/hbm/textures/armor/dnt_1.png differ diff --git a/src/main/java/assets/hbm/textures/armor/dnt_2.png b/src/main/java/assets/hbm/textures/armor/dnt_2.png new file mode 100644 index 000000000..75f27f6a7 Binary files /dev/null and b/src/main/java/assets/hbm/textures/armor/dnt_2.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/turret_friendly.png b/src/main/java/assets/hbm/textures/blocks/turret_friendly.png new file mode 100644 index 000000000..2bf1c59ab Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/turret_friendly.png differ diff --git a/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_cannon.png b/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_cannon.png new file mode 100644 index 000000000..4f4453527 Binary files /dev/null and b/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_cannon.png differ diff --git a/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_friendly.png b/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_friendly.png new file mode 100644 index 000000000..549f5dffb Binary files /dev/null and b/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_friendly.png differ diff --git a/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_tau.png b/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_tau.png new file mode 100644 index 000000000..802dee996 Binary files /dev/null and b/src/main/java/assets/hbm/textures/gui/weapon/gui_turret_tau.png differ diff --git a/src/main/java/assets/hbm/textures/items/ammo_shell.png b/src/main/java/assets/hbm/textures/items/ammo_shell.png new file mode 100644 index 000000000..58c290e73 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ammo_shell.png differ diff --git a/src/main/java/assets/hbm/textures/items/ammo_shell_apfsds-du.png b/src/main/java/assets/hbm/textures/items/ammo_shell_apfsds-du.png new file mode 100644 index 000000000..a7cf4351f Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ammo_shell_apfsds-du.png differ diff --git a/src/main/java/assets/hbm/textures/items/ammo_shell_apfsds-t.png b/src/main/java/assets/hbm/textures/items/ammo_shell_apfsds-t.png new file mode 100644 index 000000000..4b8584f0b Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ammo_shell_apfsds-t.png differ diff --git a/src/main/java/assets/hbm/textures/items/ammo_shell_explosive.png b/src/main/java/assets/hbm/textures/items/ammo_shell_explosive.png new file mode 100644 index 000000000..631390f03 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ammo_shell_explosive.png differ diff --git a/src/main/java/assets/hbm/textures/items/ammo_shell_w9.png b/src/main/java/assets/hbm/textures/items/ammo_shell_w9.png new file mode 100644 index 000000000..ba0a47d71 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ammo_shell_w9.png differ diff --git a/src/main/java/assets/hbm/textures/items/cobalt_decorated_axe.png b/src/main/java/assets/hbm/textures/items/cobalt_decorated_axe.png new file mode 100644 index 000000000..2cbb4c665 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/cobalt_decorated_axe.png differ diff --git a/src/main/java/assets/hbm/textures/items/cobalt_decorated_hoe.png b/src/main/java/assets/hbm/textures/items/cobalt_decorated_hoe.png new file mode 100644 index 000000000..6e2d38f3c Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/cobalt_decorated_hoe.png differ diff --git a/src/main/java/assets/hbm/textures/items/cobalt_decorated_pickaxe.png b/src/main/java/assets/hbm/textures/items/cobalt_decorated_pickaxe.png new file mode 100644 index 000000000..8a5468feb Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/cobalt_decorated_pickaxe.png differ diff --git a/src/main/java/assets/hbm/textures/items/cobalt_decorated_shovel.png b/src/main/java/assets/hbm/textures/items/cobalt_decorated_shovel.png new file mode 100644 index 000000000..db8f5095a Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/cobalt_decorated_shovel.png differ diff --git a/src/main/java/assets/hbm/textures/items/cobalt_decorated_sword.png b/src/main/java/assets/hbm/textures/items/cobalt_decorated_sword.png new file mode 100644 index 000000000..73258a4a7 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/cobalt_decorated_sword.png differ diff --git a/src/main/java/assets/hbm/textures/items/dnt_boots.png b/src/main/java/assets/hbm/textures/items/dnt_boots.png new file mode 100644 index 000000000..17dcc97ad Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/dnt_boots.png differ diff --git a/src/main/java/assets/hbm/textures/items/dnt_helmet.png b/src/main/java/assets/hbm/textures/items/dnt_helmet.png new file mode 100644 index 000000000..e40ac1d4e Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/dnt_helmet.png differ diff --git a/src/main/java/assets/hbm/textures/items/dnt_legs.png b/src/main/java/assets/hbm/textures/items/dnt_legs.png new file mode 100644 index 000000000..6457bee1d Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/dnt_legs.png differ diff --git a/src/main/java/assets/hbm/textures/items/dnt_plate.png b/src/main/java/assets/hbm/textures/items/dnt_plate.png new file mode 100644 index 000000000..ab8190cae Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/dnt_plate.png differ diff --git a/src/main/java/assets/hbm/textures/items/starmetal_axe.png b/src/main/java/assets/hbm/textures/items/starmetal_axe.png new file mode 100644 index 000000000..e3c2cd6b2 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/starmetal_axe.png differ diff --git a/src/main/java/assets/hbm/textures/items/starmetal_hoe.png b/src/main/java/assets/hbm/textures/items/starmetal_hoe.png new file mode 100644 index 000000000..50305668a Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/starmetal_hoe.png differ diff --git a/src/main/java/assets/hbm/textures/items/starmetal_pickaxe.png b/src/main/java/assets/hbm/textures/items/starmetal_pickaxe.png new file mode 100644 index 000000000..f812b6d57 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/starmetal_pickaxe.png differ diff --git a/src/main/java/assets/hbm/textures/items/starmetal_shovel.png b/src/main/java/assets/hbm/textures/items/starmetal_shovel.png new file mode 100644 index 000000000..db4b98d3c Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/starmetal_shovel.png differ diff --git a/src/main/java/assets/hbm/textures/items/starmetal_sword.png b/src/main/java/assets/hbm/textures/items/starmetal_sword.png new file mode 100644 index 000000000..ad9839d9f Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/starmetal_sword.png differ diff --git a/src/main/java/assets/hbm/textures/models/turrets/base_friendly.png b/src/main/java/assets/hbm/textures/models/turrets/base_friendly.png new file mode 100644 index 000000000..46cbe4167 Binary files /dev/null and b/src/main/java/assets/hbm/textures/models/turrets/base_friendly.png differ diff --git a/src/main/java/assets/hbm/textures/models/turrets/carriage_friendly.png b/src/main/java/assets/hbm/textures/models/turrets/carriage_friendly.png new file mode 100644 index 000000000..aee244d0c Binary files /dev/null and b/src/main/java/assets/hbm/textures/models/turrets/carriage_friendly.png differ diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index d2461305e..c2d25da8d 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -796,6 +796,8 @@ public class ModBlocks { public static Block turret_chekhov; public static final int guiID_chekhov = 104; + public static Block turret_friendly; + public static final int guiID_friendly = 107; public static Block turret_jeremy; public static final int guiID_jeremy = 105; public static Block turret_tauon; @@ -1473,9 +1475,10 @@ public class ModBlocks { turret_cwis = new TurretCIWS(Material.iron).setBlockName("turret_cwis").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_cwis"); turret_cheapo = new TurretCheapo(Material.iron).setBlockName("turret_cheapo").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_cheapo"); - turret_chekhov = new TurretChekhov(Material.iron).setBlockName("turret_chekhov").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_chekhov"); - turret_jeremy = new TurretJeremy(Material.iron).setBlockName("turret_jeremy").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_jeremy"); - turret_tauon = new TurretTauon(Material.iron).setBlockName("turret_tauon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_tauon"); + turret_chekhov = new TurretChekhov(Material.iron).setBlockName("turret_chekhov").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_chekhov"); + turret_friendly = new TurretFriendly(Material.iron).setBlockName("turret_friendly").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_friendly"); + turret_jeremy = new TurretJeremy(Material.iron).setBlockName("turret_jeremy").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_jeremy"); + turret_tauon = new TurretTauon(Material.iron).setBlockName("turret_tauon").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_tauon"); book_guide = new Guide(Material.iron).setBlockName("book_guide").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.nukeTab); @@ -1971,6 +1974,7 @@ public class ModBlocks { GameRegistry.registerBlock(turret_cwis, ItemBlockLore.class, turret_cwis.getUnlocalizedName()); GameRegistry.registerBlock(turret_cheapo, turret_cheapo.getUnlocalizedName()); GameRegistry.registerBlock(turret_chekhov, turret_chekhov.getUnlocalizedName()); + GameRegistry.registerBlock(turret_friendly, turret_friendly.getUnlocalizedName()); GameRegistry.registerBlock(turret_jeremy, turret_jeremy.getUnlocalizedName()); GameRegistry.registerBlock(turret_tauon, turret_tauon.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/BlockOutgas.java b/src/main/java/com/hbm/blocks/generic/BlockOutgas.java index 1d4fe9cd6..a5e043d13 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockOutgas.java +++ b/src/main/java/com/hbm/blocks/generic/BlockOutgas.java @@ -120,7 +120,7 @@ public class BlockOutgas extends BlockOre { for(int iy = -2; iy <= 2; iy++) { for(int iz = -2; iz <= 2; iz++) { - if(Math.abs(ix + iy + iz) < 5 && world.getBlock(x + ix, y + iy, z + iz) == Blocks.air) { + if(Math.abs(ix + iy + iz) < 5 && Math.abs(ix + iy + iz) > 0 && world.getBlock(x + ix, y + iy, z + iz) == Blocks.air) { world.setBlock(x + ix, y + iy, z + iz, this.getGas()); } } diff --git a/src/main/java/com/hbm/blocks/turret/TurretChekhov.java b/src/main/java/com/hbm/blocks/turret/TurretChekhov.java index 431864ad4..d4b80e9b6 100644 --- a/src/main/java/com/hbm/blocks/turret/TurretChekhov.java +++ b/src/main/java/com/hbm/blocks/turret/TurretChekhov.java @@ -4,7 +4,6 @@ import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; import com.hbm.main.MainRegistry; import com.hbm.tileentity.TileEntityProxyCombo; -import com.hbm.tileentity.machine.TileEntityMachineCyclotron; import com.hbm.tileentity.turret.TileEntityTurretChekhov; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; diff --git a/src/main/java/com/hbm/blocks/turret/TurretFriendly.java b/src/main/java/com/hbm/blocks/turret/TurretFriendly.java new file mode 100644 index 000000000..6a50de4fe --- /dev/null +++ b/src/main/java/com/hbm/blocks/turret/TurretFriendly.java @@ -0,0 +1,68 @@ +package com.hbm.blocks.turret; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ModBlocks; +import com.hbm.main.MainRegistry; +import com.hbm.tileentity.TileEntityProxyCombo; +import com.hbm.tileentity.turret.TileEntityTurretFriendly; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class TurretFriendly extends BlockDummyable { + + public TurretFriendly(Material mat) { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + + if(meta >= 12) + return new TileEntityTurretFriendly(); + return new TileEntityProxyCombo(true, true, false); + } + + @Override + public int[] getDimensions() { + return new int[] { 0, 0, 1, 0, 1, 0 }; + } + + @Override + public int getOffset() { + return 0; + } + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); + } + + @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()) { + int[] pos = this.findCore(world, x, y, z); + + if(pos == null) + return false; + + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_friendly, world, pos[0], pos[1], pos[2]); + return true; + } else { + return false; + } + } +} diff --git a/src/main/java/com/hbm/blocks/turret/TurretJeremy.java b/src/main/java/com/hbm/blocks/turret/TurretJeremy.java index 88734cb1c..94a5f5a69 100644 --- a/src/main/java/com/hbm/blocks/turret/TurretJeremy.java +++ b/src/main/java/com/hbm/blocks/turret/TurretJeremy.java @@ -1,10 +1,14 @@ package com.hbm.blocks.turret; import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ModBlocks; +import com.hbm.main.MainRegistry; import com.hbm.tileentity.TileEntityProxyCombo; import com.hbm.tileentity.turret.TileEntityTurretJeremy; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; @@ -44,4 +48,21 @@ public class TurretJeremy extends BlockDummyable { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); } + + @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()) { + int[] pos = this.findCore(world, x, y, z); + + if(pos == null) + return false; + + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_jeremy, world, pos[0], pos[1], pos[2]); + return true; + } else { + return false; + } + } } diff --git a/src/main/java/com/hbm/blocks/turret/TurretTauon.java b/src/main/java/com/hbm/blocks/turret/TurretTauon.java index e9e7a17e4..d8925201f 100644 --- a/src/main/java/com/hbm/blocks/turret/TurretTauon.java +++ b/src/main/java/com/hbm/blocks/turret/TurretTauon.java @@ -1,10 +1,14 @@ package com.hbm.blocks.turret; import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ModBlocks; +import com.hbm.main.MainRegistry; import com.hbm.tileentity.TileEntityProxyCombo; import com.hbm.tileentity.turret.TileEntityTurretTauon; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; @@ -44,4 +48,21 @@ public class TurretTauon extends BlockDummyable { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); } + + @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()) { + int[] pos = this.findCore(world, x, y, z); + + if(pos == null) + return false; + + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_tauon, world, pos[0], pos[1], pos[2]); + return true; + } else { + return false; + } + } } diff --git a/src/main/java/com/hbm/crafting/ToolRecipes.java b/src/main/java/com/hbm/crafting/ToolRecipes.java index 360f8230b..ddf2098a2 100644 --- a/src/main/java/com/hbm/crafting/ToolRecipes.java +++ b/src/main/java/com/hbm/crafting/ToolRecipes.java @@ -58,9 +58,20 @@ public class ToolRecipes { GameRegistry.addRecipe(new ItemStack(ModItems.desh_shovel, 1), new Object[] { "I", "S", "S", 'I', ModItems.ingot_desh, 'S', Items.stick }); GameRegistry.addRecipe(new ItemStack(ModItems.desh_hoe, 1), new Object[] { "II", " S", " S", 'I', ModItems.ingot_desh, 'S', Items.stick }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.meteorite_sword, 1), new Object[] { " B", "GB ", "SG ", 'B', ModItems.blade_meteorite, 'G', "plateGold", 'S', Items.stick })); + + GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_decorated_sword, 1), new Object[] { " I ", " I ", "SBS", 'I', ModItems.ingot_cobalt, 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_sword }); + GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_decorated_pickaxe, 1), new Object[] { "III", " B ", " S ", 'I', ModItems.ingot_cobalt, 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_pickaxe }); + GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_decorated_axe, 1), new Object[] { "II", "IB", " S", 'I', ModItems.ingot_cobalt, 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_axe }); + GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_decorated_shovel, 1), new Object[] { "I", "B", "S", 'I', ModItems.ingot_cobalt, 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_shovel }); + GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_decorated_hoe, 1), new Object[] { "II", " B", " S", 'I', ModItems.ingot_cobalt, 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_hoe }); + GameRegistry.addRecipe(new ItemStack(ModItems.starmetal_sword, 1), new Object[] { " I ", " I ", "SBS", 'I', ModItems.ingot_starmetal, 'S', ModItems.ingot_cobalt, 'B', ModItems.cobalt_decorated_sword }); + GameRegistry.addRecipe(new ItemStack(ModItems.starmetal_pickaxe, 1), new Object[] { "III", " B ", " S ", 'I', ModItems.ingot_starmetal, 'S', ModItems.ingot_cobalt, 'B', ModItems.cobalt_decorated_pickaxe }); + GameRegistry.addRecipe(new ItemStack(ModItems.starmetal_axe, 1), new Object[] { "II", "IB", " S", 'I', ModItems.ingot_starmetal, 'S', ModItems.ingot_cobalt, 'B', ModItems.cobalt_decorated_axe }); + GameRegistry.addRecipe(new ItemStack(ModItems.starmetal_shovel, 1), new Object[] { "I", "B", "S", 'I', ModItems.ingot_starmetal, 'S', ModItems.ingot_cobalt, 'B', ModItems.cobalt_decorated_shovel }); + GameRegistry.addRecipe(new ItemStack(ModItems.starmetal_hoe, 1), new Object[] { "II", " B", " S", 'I', ModItems.ingot_starmetal, 'S', ModItems.ingot_cobalt, 'B', ModItems.cobalt_decorated_hoe }); //Drax - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.drax, 1), new Object[] { "BCF", "DDM", "BCC", 'B', ModItems.blades_advanced_alloy, 'C', "ingotCobalt", 'F', ModItems.fusion_core, 'D', "ingotDesh", 'M', ModItems.motor })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.drax, 1), new Object[] { "BDS", "CDC", "FMF", 'B', ModItems.starmetal_pickaxe, 'S', ModItems.starmetal_shovel, 'C', "ingotCobalt", 'F', ModItems.fusion_core, 'D', "ingotDesh", 'M', ModItems.motor_desh })); GameRegistry.addRecipe(new ItemStack(ModItems.drax_mk2, 1), new Object[] { "SCS", "IDI", "FEF", 'S', ModItems.ingot_starmetal, 'C', ModItems.crystal_trixite, 'I', ModItems.ingot_saturnite, 'D', ModItems.drax, 'F', ModItems.fusion_core, 'E', ModItems.circuit_targeting_tier5 }); GameRegistry.addRecipe(new ItemStack(ModItems.drax_mk3, 1), new Object[] { "ECE", "CDC", "SBS", 'E', ModBlocks.block_euphemium_cluster, 'C', ModItems.crystal_schrabidium, 'D', ModItems.drax_mk2, 'S', ModItems.circuit_targeting_tier6, 'B', ItemBattery.getFullBattery(ModItems.battery_spark) }); diff --git a/src/main/java/com/hbm/crafting/WeaponRecipes.java b/src/main/java/com/hbm/crafting/WeaponRecipes.java index 6482f4f18..a7fe05b4b 100644 --- a/src/main/java/com/hbm/crafting/WeaponRecipes.java +++ b/src/main/java/com/hbm/crafting/WeaponRecipes.java @@ -310,6 +310,17 @@ public class WeaponRecipes { GameRegistry.addRecipe(new ItemStack(ModItems.ammo_grenade_nuclear, 2), new Object[] { " P ", "GIG", " P ", 'G', ModItems.ammo_grenade, 'I', ModItems.neutron_reflector, 'P', ModItems.nugget_pu239 }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_grenade_finned, 1), new Object[] { "G", "R", 'G', Items.feather, 'R', ModItems.ammo_grenade }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_grenade_kampf, 2), new Object[] { "G", "R", 'G', ModItems.ammo_rocket, 'R', ModItems.ammo_grenade }); + + //240mm Shells + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', "ingotCopper" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', "ingotCopper" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell_explosive, 4), new Object[] { " T ", "GHG", "CCC", 'T', ModItems.ingot_semtex, 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', "ingotCopper" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell_explosive, 4), new Object[] { " T ", "GHG", "CCC", 'T', ModItems.ingot_semtex, 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', "ingotCopper" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell_apfsds_t, 4), new Object[] { " I ", "GIG", "CCC", 'I', "ingotTungsten", 'G', Items.gunpowder, 'C', "ingotCopper" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell_apfsds_t, 4), new Object[] { " I ", "GIG", "CCC", 'I', "ingotTungsten", 'G', ModItems.cordite, 'C', "ingotCopper" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell_apfsds_du, 4), new Object[] { " I ", "GIG", "CCC", 'I', "ingotUranium238", 'G', Items.gunpowder, 'C', "ingotCopper" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell_apfsds_du, 4), new Object[] { " I ", "GIG", "CCC", 'I', "ingotUranium238", 'G', ModItems.cordite, 'C', "ingotCopper" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_shell_w9, 1), new Object[] { " P ", "NSN", " P ", 'P', "nuggetPlutonium239", 'N', "plateDenseLead", 'S', ModItems.ammo_shell_explosive })); //Mini Nuke GameRegistry.addRecipe(new ItemStack(ModItems.ammo_nuke, 1), new Object[] { "P", "S", "P", 'P', ModItems.nugget_pu239, 'S', ModItems.assembly_nuke }); @@ -389,6 +400,7 @@ public class WeaponRecipes { GameRegistry.addRecipe(new ItemStack(ModItems.grenade_burst, 1), new Object[] { "GGG", "GCG", "GGG", 'G', ModItems.grenade_breach, 'C', ModItems.grenade_generic }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.grenade_cloud), new Object[] { "SPS", "CAC", "SPS", 'S', "dustSulfur", 'P', ModItems.powder_poison, 'C', "dustCopper", 'A', new ItemStack(ModItems.fluid_tank_full, 1, FluidType.ACID.getID()) })); GameRegistry.addRecipe(new ItemStack(ModItems.grenade_pink_cloud), new Object[] { " S ", "ECE", " E ", 'S', ModItems.powder_spark_mix, 'E', ModItems.powder_magic, 'C', ModItems.grenade_cloud }); + GameRegistry.addRecipe(new ItemStack(ModItems.nuclear_waste_pearl), new Object[] { "WWW", "WFW", "WWW", 'W', ModItems.nuclear_waste_tiny, 'F', ModBlocks.block_fallout }); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.grenade_nuke), new Object[] { "CGC", "CGC", "PAP", 'C', ModBlocks.det_charge, 'G', ModItems.grenade_mk2, 'P', "plateAdvanced", 'A', Blocks.anvil })); //IF Grenades diff --git a/src/main/java/com/hbm/entity/grenade/EntityWastePearl.java b/src/main/java/com/hbm/entity/grenade/EntityWastePearl.java new file mode 100644 index 000000000..080d9463e --- /dev/null +++ b/src/main/java/com/hbm/entity/grenade/EntityWastePearl.java @@ -0,0 +1,51 @@ +package com.hbm.entity.grenade; + +import com.hbm.blocks.ModBlocks; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class EntityWastePearl extends EntityGrenadeBase { + + public EntityWastePearl(World p_i1773_1_) { + super(p_i1773_1_); + } + + public EntityWastePearl(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } + + public EntityWastePearl(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } + + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + this.setDead(); + + int x = (int)Math.floor(posX); + int y = (int)Math.floor(posY); + int z = (int)Math.floor(posZ); + + for(int ix = x - 3; ix <= x + 3; ix++) { + for(int iy = y - 3; iy <= y + 3; iy++) { + for(int iz = z - 3; iz <= z + 3; iz++) { + + if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock(ix, iy, iz).isReplaceable(worldObj, ix, iy, iz) && ModBlocks.fallout.canPlaceBlockAt(worldObj, ix, iy, iz)) { + worldObj.setBlock(ix, iy, iz, ModBlocks.fallout); + } else if(worldObj.getBlock(ix, iy, iz) == Blocks.air) { + + if(rand.nextBoolean()) + worldObj.setBlock(ix, iy, iz, ModBlocks.gas_radon); + else + worldObj.setBlock(ix, iy, iz, ModBlocks.gas_radon_dense); + } + } + } + } + } + } +} diff --git a/src/main/java/com/hbm/entity/mob/EntityMaskMan.java b/src/main/java/com/hbm/entity/mob/EntityMaskMan.java index 6d3683030..d9dab2d9b 100644 --- a/src/main/java/com/hbm/entity/mob/EntityMaskMan.java +++ b/src/main/java/com/hbm/entity/mob/EntityMaskMan.java @@ -62,8 +62,10 @@ public class EntityMaskMan extends EntityMob implements IBossDisplayData, IRadia amount *= 0.25F; if(source.isExplosion()) amount *= 0.5F; - if(amount > 50) - amount = 50; + + if(amount > 50) { + amount = 50 + (amount - 50) * 0.25F; + } return super.attackEntityFrom(source, amount); } diff --git a/src/main/java/com/hbm/handler/BobmazonOfferFactory.java b/src/main/java/com/hbm/handler/BobmazonOfferFactory.java index 640536574..57ebce044 100644 --- a/src/main/java/com/hbm/handler/BobmazonOfferFactory.java +++ b/src/main/java/com/hbm/handler/BobmazonOfferFactory.java @@ -158,49 +158,48 @@ public class BobmazonOfferFactory { tools.add(new Offer(new ItemStack(ModItems.hazmat_red_kit), Requirement.CHEMICS, 100 * inflation)); tools.add(new Offer(new ItemStack(ModItems.hazmat_grey_kit), Requirement.OIL, 160 * inflation)); - special.add(new Offer(new ItemStack(ModItems.nuke_starter_kit), Requirement.HIDDEN, 20)); - special.add(new Offer(new ItemStack(ModItems.nuke_advanced_kit), Requirement.HIDDEN, 30)); - special.add(new Offer(new ItemStack(ModItems.boy_kit), Requirement.HIDDEN, 35)); - special.add(new Offer(new ItemStack(ModItems.missile_kit), Requirement.HIDDEN, 60)); - special.add(new Offer(new ItemStack(ModItems.grenade_kit), Requirement.HIDDEN, 20)); - special.add(new Offer(new ItemStack(ModItems.jetpack_vector), Requirement.HIDDEN, 10)); - special.add(new Offer(new ItemStack(ModItems.jetpack_tank), Requirement.HIDDEN, 3)); - special.add(new Offer(new ItemStack(ModItems.gun_lever_action), Requirement.HIDDEN, 5)); - special.add(new Offer(new ItemStack(ModItems.ammo_20gauge, 24), Requirement.HIDDEN, 5)); - special.add(new Offer(new ItemStack(ModItems.ammo_20gauge_incendiary, 24), Requirement.HIDDEN, 7)); - special.add(new Offer(new ItemStack(ModItems.gun_uzi_silencer, 1), Requirement.HIDDEN, 5)); - special.add(new Offer(new ItemStack(ModItems.ammo_22lr, 64), Requirement.HIDDEN, 3)); - special.add(new Offer(new ItemStack(ModItems.ammo_22lr_ap, 64), Requirement.HIDDEN, 4)); - special.add(new Offer(new ItemStack(ModItems.gun_hk69, 24), Requirement.HIDDEN, 8)); - special.add(new Offer(new ItemStack(ModItems.ammo_grenade, 6), Requirement.HIDDEN, 4)); - special.add(new Offer(new ItemStack(ModItems.ammo_grenade_sleek, 6), Requirement.HIDDEN, 6)); - special.add(new Offer(new ItemStack(ModItems.gun_kit_1, 10), Requirement.HIDDEN, 1)); - special.add(new Offer(new ItemStack(ModItems.gun_kit_2, 5), Requirement.HIDDEN, 3)); - special.add(new Offer(new ItemStack(ModBlocks.machine_epress, 2), Requirement.HIDDEN, 5)); - special.add(new Offer(new ItemStack(ModBlocks.machine_assembler, 1), Requirement.HIDDEN, 5)); - special.add(new Offer(new ItemStack(ModBlocks.machine_chemplant, 1), Requirement.HIDDEN, 5)); - special.add(new Offer(new ItemStack(ModBlocks.machine_boiler_off, 1), Requirement.HIDDEN, 5)); - special.add(new Offer(new ItemStack(ModBlocks.machine_well, 1), Requirement.HIDDEN, 5)); - special.add(new Offer(new ItemStack(ModBlocks.machine_refinery, 1), Requirement.HIDDEN, 8)); - special.add(new Offer(new ItemStack(ModBlocks.machine_fluidtank, 4), Requirement.HIDDEN, 3)); - special.add(new Offer(new ItemStack(ModBlocks.barrel_antimatter, 4), Requirement.HIDDEN, 3)); - special.add(new Offer(new ItemStack(ModItems.ingot_steel, 64), Requirement.HIDDEN, 2)); - special.add(new Offer(new ItemStack(ModItems.ingot_copper, 64), Requirement.HIDDEN, 2)); - special.add(new Offer(new ItemStack(ModItems.ingot_red_copper, 64), Requirement.HIDDEN, 2)); - special.add(new Offer(new ItemStack(ModItems.ingot_titanium, 64), Requirement.HIDDEN, 2)); - special.add(new Offer(new ItemStack(ModItems.ingot_tungsten, 64), Requirement.HIDDEN, 2)); - special.add(new Offer(new ItemStack(ModBlocks.struct_launcher_core, 1), Requirement.HIDDEN, 3)); - special.add(new Offer(new ItemStack(ModBlocks.struct_launcher_core_large, 1), Requirement.HIDDEN, 3)); - special.add(new Offer(new ItemStack(ModBlocks.struct_launcher, 40), Requirement.HIDDEN, 7)); - special.add(new Offer(new ItemStack(ModBlocks.struct_scaffold, 11), Requirement.HIDDEN, 7)); - special.add(new Offer(new ItemStack(ModItems.loot_10, 1), Requirement.HIDDEN, 2)); - special.add(new Offer(new ItemStack(ModItems.loot_15, 1), Requirement.HIDDEN, 2)); - special.add(new Offer(new ItemStack(ModItems.loot_misc, 1), Requirement.HIDDEN, 2)); - special.add(new Offer(new ItemStack(ModBlocks.crate_can, 1), Requirement.HIDDEN, 1)); - special.add(new Offer(new ItemStack(ModBlocks.crate_ammo, 1), Requirement.HIDDEN, 15)); - special.add(new Offer(new ItemStack(ModItems.book_of_, 1), Requirement.HIDDEN, 100)); - special.add(new Offer(new ItemStack(ModItems.mysteryshovel, 1), Requirement.HIDDEN, 100)); - special.add(new Offer(new ItemStack(ModBlocks.ntm_dirt, 1), Requirement.HIDDEN, 2240)); + special.add(new Offer(new ItemStack(ModItems.ingot_steel, 64), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ingot_copper, 64), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ingot_red_copper, 64), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ingot_titanium, 64), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ingot_tungsten, 64), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ingot_cobalt, 64), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ingot_schrabidium, 16), Requirement.STEEL, 5)); + special.add(new Offer(new ItemStack(ModItems.ingot_euphemium, 8), Requirement.STEEL, 16)); + special.add(new Offer(new ItemStack(ModItems.ingot_dineutronium, 1), Requirement.STEEL, 16)); + special.add(new Offer(new ItemStack(ModItems.ingot_starmetal, 16), Requirement.STEEL, 8)); + special.add(new Offer(new ItemStack(ModItems.ingot_semtex, 16), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ingot_u235, 16), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ingot_pu239, 16), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.ammo_container, 16), Requirement.STEEL, 5)); + special.add(new Offer(new ItemStack(ModItems.nuke_starter_kit), Requirement.STEEL, 5)); + special.add(new Offer(new ItemStack(ModItems.nuke_advanced_kit), Requirement.STEEL, 5)); + special.add(new Offer(new ItemStack(ModItems.boy_kit), Requirement.STEEL, 5)); + special.add(new Offer(new ItemStack(ModItems.prototype_kit), Requirement.STEEL, 10)); + special.add(new Offer(new ItemStack(ModItems.missile_kit), Requirement.STEEL, 5)); + special.add(new Offer(new ItemStack(ModItems.grenade_kit), Requirement.STEEL, 5)); + special.add(new Offer(new ItemStack(ModItems.jetpack_vector), Requirement.STEEL, 2)); + special.add(new Offer(new ItemStack(ModItems.jetpack_tank), Requirement.STEEL, 2)); + special.add(new Offer(new ItemStack(ModItems.gun_kit_1, 10), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.gun_kit_2, 5), Requirement.STEEL, 3)); + special.add(new Offer(new ItemStack(ModBlocks.struct_launcher_core, 1), Requirement.STEEL, 3)); + special.add(new Offer(new ItemStack(ModBlocks.struct_launcher_core_large, 1), Requirement.STEEL, 3)); + special.add(new Offer(new ItemStack(ModBlocks.struct_launcher, 40), Requirement.STEEL, 7)); + special.add(new Offer(new ItemStack(ModBlocks.struct_scaffold, 11), Requirement.STEEL, 7)); + special.add(new Offer(new ItemStack(ModItems.loot_10, 1), Requirement.STEEL, 2)); + special.add(new Offer(new ItemStack(ModItems.loot_15, 1), Requirement.STEEL, 2)); + special.add(new Offer(new ItemStack(ModItems.loot_misc, 1), Requirement.STEEL, 2)); + special.add(new Offer(new ItemStack(ModBlocks.crate_can, 1), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModBlocks.crate_ammo, 1), Requirement.STEEL, 2)); + special.add(new Offer(new ItemStack(ModItems.crucible, 1, 3), Requirement.STEEL, 10)); + special.add(new Offer(new ItemStack(ModItems.sat_laser, 1), Requirement.HIDDEN, 8)); + special.add(new Offer(new ItemStack(ModItems.sat_gerald, 1), Requirement.HIDDEN, 32)); + special.add(new Offer(new ItemStack(ModItems.billet_yharonite, 4), Requirement.HIDDEN, 16)); + special.add(new Offer(new ItemStack(ModItems.ingot_electronium, 1), Requirement.HIDDEN, 16)); + special.add(new Offer(new ItemStack(ModItems.book_of_, 1), Requirement.HIDDEN, 16)); + special.add(new Offer(new ItemStack(ModItems.mysteryshovel, 1), Requirement.HIDDEN, 16)); + special.add(new Offer(new ItemStack(ModBlocks.ntm_dirt, 1), Requirement.HIDDEN, 16)); + special.add(new Offer(new ItemStack(ModItems.euphemium_kit, 1), Requirement.HIDDEN, 64)); } public static List getOffers(ItemStack stack) { diff --git a/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java b/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java index 942f809e8..77c7be913 100644 --- a/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java +++ b/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java @@ -7,11 +7,11 @@ import com.hbm.handler.guncfg.*; import com.hbm.items.ModItems; public class BulletConfigSyncingUtil { - + private static HashMap configSet = new HashMap(); - + static int i = 0; - + /// duplicate ids will cause wrong configs to be loaded /// public static int TEST_CONFIG = i++; public static int IRON_REVOLVER = i++; @@ -179,6 +179,12 @@ public class BulletConfigSyncingUtil { public static int ROCKET_TOXIC_LASER = i++; public static int ROCKET_PHOSPHORUS_LASER = i++; + public static int SHELL_NORMAL = i++; + public static int SHELL_EXPLOSIVE = i++; + public static int SHELL_AP = i++; + public static int SHELL_DU = i++; + public static int SHELL_W9 = i++; + public static int NUKE_NORMAL = i++; public static int NUKE_LOW = i++; public static int NUKE_HIGH = i++; @@ -196,9 +202,9 @@ public class BulletConfigSyncingUtil { public static int NUKE_MIRV_HIGH = i++; public static int NUKE_MIRV_SAFE = i++; public static int NUKE_MIRV_SPECIAL = i++; - + public static int NUKE_AMAT = i++; - + public static int ZOMG_BOLT = i++; public static int CHL_LR22 = i++; @@ -221,11 +227,11 @@ public class BulletConfigSyncingUtil { public static int WORM_BOLT = i++; public static int WORM_LASER = i++; - + public static void loadConfigsForSync() { - + configSet.put(TEST_CONFIG, BulletConfigFactory.getTestConfig()); - + configSet.put(IRON_REVOLVER, Gun357MagnumFactory.getRevIronConfig()); configSet.put(STEEL_REVOLVER, Gun357MagnumFactory.getRevSteelConfig()); configSet.put(LEAD_REVOLVER, Gun357MagnumFactory.getRevLeadConfig()); @@ -236,7 +242,7 @@ public class BulletConfigSyncingUtil { configSet.put(NIGHT2_REVOLVER, Gun357MagnumFactory.getRevNightmare2Config()); configSet.put(SATURNITE_REVOLVER, Gun357MagnumFactory.getRevSteelConfig().setToFire(3)); configSet.put(DESH_REVOLVER, Gun357MagnumFactory.getRevDeshConfig()); - + configSet.put(G20_NORMAL, Gun20GaugeFactory.get20GaugeConfig()); configSet.put(G20_SLUG, Gun20GaugeFactory.get20GaugeSlugConfig()); configSet.put(G20_FLECHETTE, Gun20GaugeFactory.get20GaugeFlechetteConfig()); @@ -247,7 +253,7 @@ public class BulletConfigSyncingUtil { 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()); configSet.put(ROCKET_INCENDIARY, GunRocketFactory.getRocketIncendiaryConfig()); @@ -260,7 +266,7 @@ public class BulletConfigSyncingUtil { configSet.put(ROCKET_CHAINSAW, GunRocketFactory.getRocketRPCConfig()); configSet.put(ROCKET_TOXIC, GunRocketFactory.getRocketChlorineConfig()); configSet.put(ROCKET_CANISTER, GunRocketFactory.getRocketCanisterConfig()); - + configSet.put(GRENADE_NORMAL, GunGrenadeFactory.getGrenadeConfig()); configSet.put(GRENADE_HE, GunGrenadeFactory.getGrenadeHEConfig()); configSet.put(GRENADE_INCENDIARY, GunGrenadeFactory.getGrenadeIncendirayConfig()); @@ -272,19 +278,19 @@ public class BulletConfigSyncingUtil { configSet.put(GRENADE_NUCLEAR, GunGrenadeFactory.getGrenadeNuclearConfig()); configSet.put(GRENADE_TRACER, GunGrenadeFactory.getGrenadeTracerConfig()); configSet.put(GRENADE_KAMPF, GunGrenadeFactory.getGrenadeKampfConfig()); - + configSet.put(G12_NORMAL, Gun12GaugeFactory.get12GaugeConfig()); configSet.put(G12_INCENDIARY, Gun12GaugeFactory.get12GaugeFireConfig()); 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()); configSet.put(LR22_NORMAL_FIRE, Gun22LRFactory.get22LRConfig().setToFire(3)); configSet.put(LR22_AP_FIRE, Gun22LRFactory.get22LRAPConfig().setToFire(3)); - + configSet.put(M44_NORMAL, Gun44MagnumFactory.getNoPipConfig()); configSet.put(M44_AP, Gun44MagnumFactory.getNoPipAPConfig()); configSet.put(M44_DU, Gun44MagnumFactory.getNoPipDUConfig()); @@ -294,12 +300,12 @@ public class BulletConfigSyncingUtil { configSet.put(M44_BJ, Gun44MagnumFactory.getBJConfig()); configSet.put(M44_SILVER, Gun44MagnumFactory.getSilverStormConfig()); configSet.put(M44_ROCKET, Gun44MagnumFactory.getRocketConfig()); - + configSet.put(P9_NORMAL, Gun9mmFactory.get9mmConfig()); configSet.put(P9_AP, Gun9mmFactory.get9mmAPConfig()); configSet.put(P9_DU, Gun9mmFactory.get9mmDUConfig()); configSet.put(P9_ROCKET, Gun9mmFactory.get9mmRocketConfig()); - + configSet.put(BMG50_NORMAL, Gun50BMGFactory.get50BMGConfig()); configSet.put(BMG50_INCENDIARY, Gun50BMGFactory.get50BMGFireConfig()); configSet.put(BMG50_PHOSPHORUS, Gun50BMGFactory.get50BMGPhosphorusConfig()); @@ -308,7 +314,7 @@ public class BulletConfigSyncingUtil { configSet.put(BMG50_DU, Gun50BMGFactory.get50BMGDUConfig()); configSet.put(BMG50_STAR, Gun50BMGFactory.get50BMGStarConfig()); configSet.put(BMG50_SLEEK, Gun50BMGFactory.get50BMGSleekConfig()); - + configSet.put(R5_NORMAL, Gun5mmFactory.get5mmConfig()); configSet.put(R5_EXPLOSIVE, Gun5mmFactory.get5mmExplosiveConfig()); configSet.put(R5_DU, Gun5mmFactory.get5mmDUConfig()); @@ -317,12 +323,12 @@ public class BulletConfigSyncingUtil { configSet.put(R5_EXPLOSIVE_BOLT, Gun5mmFactory.get5mmExplosiveConfig().setToBolt(BulletConfiguration.BOLT_LACUNAE)); configSet.put(R5_DU_BOLT, Gun5mmFactory.get5mmDUConfig().setToBolt(BulletConfiguration.BOLT_LACUNAE)); configSet.put(R5_STAR_BOLT, Gun5mmFactory.get5mmStarConfig().setToBolt(BulletConfiguration.BOLT_LACUNAE)); - + configSet.put(AE50_NORMAL, Gun50AEFactory.get50AEConfig()); configSet.put(AE50_AP, Gun50AEFactory.get50APConfig()); configSet.put(AE50_DU, Gun50AEFactory.get50DUConfig()); configSet.put(AE50_STAR, Gun50AEFactory.get50StarConfig()); - + configSet.put(G4_NORMAL, Gun4GaugeFactory.get4GaugeConfig()); configSet.put(G4_SLUG, Gun4GaugeFactory.get4GaugeSlugConfig()); configSet.put(G4_FLECHETTE, Gun4GaugeFactory.get4GaugeFlechetteConfig()); @@ -336,7 +342,7 @@ public class BulletConfigSyncingUtil { configSet.put(G4_VAMPIRE, Gun4GaugeFactory.get4GaugeVampireConfig()); configSet.put(G4_VOID, Gun4GaugeFactory.get4GaugeVoidConfig()); configSet.put(G4_SLEEK, Gun4GaugeFactory.get4GaugeSleekConfig()); - + configSet.put(SPECIAL_OSIPR, GunOSIPRFactory.getPulseConfig()); configSet.put(SPECIAL_OSIPR_CHARGED, GunOSIPRFactory.getPulseChargedConfig()); configSet.put(SPECIAL_GAUSS, GunGaussFactory.getGaussConfig()); @@ -363,13 +369,13 @@ public class BulletConfigSyncingUtil { configSet.put(R556_FLECHETTE_DU, Gun556mmFactory.get556FlechetteDUConfig()); configSet.put(R556_FLECHETTE_SLEEK, Gun556mmFactory.get556FlechetteSleekConfig()); configSet.put(R556_K, Gun556mmFactory.get556KConfig()); - + configSet.put(B75_NORMAL, Gun75BoltFactory.get75BoltConfig()); configSet.put(B75_INCENDIARY, Gun75BoltFactory.get75BoltIncConfig()); configSet.put(B75_HE, Gun75BoltFactory.get75BoltHEConfig()); - + configSet.put(NEEDLE_GPS, GunDartFactory.getGPSConfig()); - + configSet.put(G20_NORMAL_FIRE, Gun20GaugeFactory.get20GaugeConfig().setToFire(3)); configSet.put(G20_SHRAPNEL_FIRE, Gun20GaugeFactory.get20GaugeShrapnelConfig().setToFire(3)); configSet.put(G20_SLUG_FIRE, Gun20GaugeFactory.get20GaugeSlugConfig().setToFire(3)); @@ -378,7 +384,7 @@ public class BulletConfigSyncingUtil { configSet.put(G20_CAUSTIC_FIRE, Gun20GaugeFactory.get20GaugeCausticConfig().setToFire(3)); configSet.put(G20_SHOCK_FIRE, Gun20GaugeFactory.get20GaugeShockConfig().setToFire(3)); configSet.put(G20_WITHER_FIRE, Gun20GaugeFactory.get20GaugeWitherConfig().setToFire(3)); - + configSet.put(ROCKET_NORMAL_LASER, GunRocketFactory.getRocketConfig().setToGuided()); configSet.put(ROCKET_HE_LASER, GunRocketFactory.getRocketHEConfig().setToGuided()); configSet.put(ROCKET_INCENDIARY_LASER, GunRocketFactory.getRocketIncendiaryConfig().setToGuided()); @@ -391,6 +397,12 @@ public class BulletConfigSyncingUtil { configSet.put(ROCKET_CHAINSAW_LASER, GunRocketFactory.getRocketRPCConfig().setToGuided()); configSet.put(ROCKET_TOXIC_LASER, GunRocketFactory.getRocketChlorineConfig().setToGuided()); + configSet.put(SHELL_NORMAL, GunCannonFactory.getShellConfig()); + configSet.put(SHELL_EXPLOSIVE, GunCannonFactory.getShellExplosiveConfig()); + configSet.put(SHELL_AP, GunCannonFactory.getShellAPConfig()); + configSet.put(SHELL_DU, GunCannonFactory.getShellDUConfig()); + configSet.put(SHELL_W9, GunCannonFactory.getShellW9Config()); + configSet.put(NUKE_NORMAL, GunFatmanFactory.getNukeConfig()); configSet.put(NUKE_LOW, GunFatmanFactory.getNukeLowConfig()); configSet.put(NUKE_HIGH, GunFatmanFactory.getNukeHighConfig()); @@ -408,9 +420,9 @@ public class BulletConfigSyncingUtil { configSet.put(NUKE_MIRV_HIGH, GunFatmanFactory.getMirvHighConfig()); configSet.put(NUKE_MIRV_SAFE, GunFatmanFactory.getMirvSafeConfig()); configSet.put(NUKE_MIRV_SPECIAL, GunFatmanFactory.getMirvSpecialConfig()); - + configSet.put(NUKE_AMAT, GunFatmanFactory.getBalefireConfig()); - + configSet.put(ZOMG_BOLT, GunEnergyFactory.getZOMGBoltConfig()); configSet.put(CHL_LR22, Gun22LRFactory.get22LRConfig().setToHoming(ModItems.ammo_22lr_chlorophyte)); @@ -433,20 +445,20 @@ public class BulletConfigSyncingUtil { configSet.put(WORM_BOLT, GunNPCFactory.getWormBolt()); configSet.put(WORM_LASER, GunNPCFactory.getWormHeadBolt()); } - + public static BulletConfiguration pullConfig(int key) { - + return configSet.get(key); } - + public static int getKey(BulletConfiguration config) { - + for(Entry e : configSet.entrySet()) { - + if(e.getValue() == config) return e.getKey(); } - + return -1; } diff --git a/src/main/java/com/hbm/handler/BulletConfiguration.java b/src/main/java/com/hbm/handler/BulletConfiguration.java index 2a58375bc..fee5d14cf 100644 --- a/src/main/java/com/hbm/handler/BulletConfiguration.java +++ b/src/main/java/com/hbm/handler/BulletConfiguration.java @@ -88,18 +88,20 @@ public class BulletConfiguration { public static final int STYLE_NONE = -1; public static final int STYLE_NORMAL = 0; - public static final int STYLE_FLECHETTE = 1; - public static final int STYLE_PELLET = 2; - public static final int STYLE_BOLT = 3; - public static final int STYLE_FOLLY = 4; - public static final int STYLE_ROCKET = 5; - public static final int STYLE_STINGER = 6; - public static final int STYLE_NUKE = 7; - public static final int STYLE_MIRV = 8; - public static final int STYLE_GRENADE = 9; - public static final int STYLE_BF = 10; - public static final int STYLE_ORB = 11; - public static final int STYLE_METEOR = 12; + public static final int STYLE_PISTOL = 1; + public static final int STYLE_FLECHETTE = 2; + public static final int STYLE_PELLET = 3; + public static final int STYLE_BOLT = 4; + public static final int STYLE_FOLLY = 5; + public static final int STYLE_ROCKET = 6; + public static final int STYLE_STINGER = 7; + public static final int STYLE_NUKE = 8; + public static final int STYLE_MIRV = 9; + public static final int STYLE_GRENADE = 10; + public static final int STYLE_BF = 11; + public static final int STYLE_ORB = 12; + public static final int STYLE_METEOR = 13; + public static final int STYLE_APDS = 14; public static final int PLINK_NONE = 0; public static final int PLINK_BULLET = 1; diff --git a/src/main/java/com/hbm/handler/GUIHandler.java b/src/main/java/com/hbm/handler/GUIHandler.java index 97aae535d..2d6cb4abd 100644 --- a/src/main/java/com/hbm/handler/GUIHandler.java +++ b/src/main/java/com/hbm/handler/GUIHandler.java @@ -9,6 +9,9 @@ import com.hbm.items.ModItems; import com.hbm.tileentity.bomb.*; import com.hbm.tileentity.machine.*; import com.hbm.tileentity.turret.TileEntityTurretChekhov; +import com.hbm.tileentity.turret.TileEntityTurretFriendly; +import com.hbm.tileentity.turret.TileEntityTurretJeremy; +import com.hbm.tileentity.turret.TileEntityTurretTauon; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; @@ -731,7 +734,28 @@ public class GUIHandler implements IGuiHandler { case ModBlocks.guiID_chekhov: { if(entity instanceof TileEntityTurretChekhov) { - return new ContainerTurretChekhov(player.inventory, (TileEntityTurretChekhov) entity); + return new ContainerTurretBase(player.inventory, (TileEntityTurretChekhov) entity); + } + return null; + } + + case ModBlocks.guiID_friendly: { + if(entity instanceof TileEntityTurretFriendly) { + return new ContainerTurretBase(player.inventory, (TileEntityTurretFriendly) entity); + } + return null; + } + + case ModBlocks.guiID_jeremy: { + if(entity instanceof TileEntityTurretJeremy) { + return new ContainerTurretBase(player.inventory, (TileEntityTurretJeremy) entity); + } + return null; + } + + case ModBlocks.guiID_tauon: { + if(entity instanceof TileEntityTurretTauon) { + return new ContainerTurretBase(player.inventory, (TileEntityTurretTauon) entity); } return null; } @@ -1458,6 +1482,27 @@ public class GUIHandler implements IGuiHandler { } return null; } + + case ModBlocks.guiID_friendly: { + if(entity instanceof TileEntityTurretFriendly) { + return new GUITurretFriendly(player.inventory, (TileEntityTurretFriendly) entity); + } + return null; + } + + case ModBlocks.guiID_jeremy: { + if(entity instanceof TileEntityTurretJeremy) { + return new GUITurretJeremy(player.inventory, (TileEntityTurretJeremy) entity); + } + return null; + } + + case ModBlocks.guiID_tauon: { + if(entity instanceof TileEntityTurretTauon) { + return new GUITurretTauon(player.inventory, (TileEntityTurretTauon) entity); + } + return null; + } } // ITEM GUIS diff --git a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java index f11bfe000..26e6e3429 100644 --- a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java @@ -221,6 +221,31 @@ public class BulletConfigFactory { return bullet; } + public static BulletConfiguration standardShellConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 3.0F; + bullet.spread = 0.005F; + bullet.wear = 10; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0.005D; + bullet.maxAge = 300; + bullet.doesRicochet = true; + bullet.ricochetAngle = 10; + bullet.HBRC = 2; + bullet.LBRC = 100; + bullet.bounceMod = 0.8; + bullet.doesPenetrate = false; + bullet.doesBreakGlass = false; + bullet.style = BulletConfiguration.STYLE_GRENADE; + bullet.plink = BulletConfiguration.PLINK_GRENADE; + bullet.vPFX = "smoke"; + + return bullet; + } + public static BulletConfiguration standardNukeConfig() { BulletConfiguration bullet = new BulletConfiguration(); diff --git a/src/main/java/com/hbm/handler/guncfg/GunCannonFactory.java b/src/main/java/com/hbm/handler/guncfg/GunCannonFactory.java new file mode 100644 index 000000000..743d9a22e --- /dev/null +++ b/src/main/java/com/hbm/handler/guncfg/GunCannonFactory.java @@ -0,0 +1,81 @@ +package com.hbm.handler.guncfg; + +import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.handler.BulletConfiguration; +import com.hbm.interfaces.IBulletImpactBehavior; +import com.hbm.items.ModItems; + +public class GunCannonFactory { + + public static BulletConfiguration getShellConfig() { + + BulletConfiguration bullet = BulletConfigFactory.standardShellConfig(); + + bullet.ammo = ModItems.ammo_shell; + bullet.dmgMin = 25; + bullet.dmgMax = 35; + bullet.explosive = 4F; + bullet.blockDamage = false; + + return bullet; + } + + public static BulletConfiguration getShellExplosiveConfig() { + + BulletConfiguration bullet = BulletConfigFactory.standardShellConfig(); + + bullet.ammo = ModItems.ammo_shell_explosive; + bullet.dmgMin = 35; + bullet.dmgMax = 45; + bullet.explosive = 4F; + bullet.blockDamage = true; + + return bullet; + } + + public static BulletConfiguration getShellAPConfig() { + + BulletConfiguration bullet = BulletConfigFactory.standardShellConfig(); + + bullet.ammo = ModItems.ammo_shell_apfsds_t; + bullet.dmgMin = 50; + bullet.dmgMax = 55; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_APDS; + + return bullet; + } + + public static BulletConfiguration getShellDUConfig() { + + BulletConfiguration bullet = BulletConfigFactory.standardShellConfig(); + + bullet.ammo = ModItems.ammo_shell_apfsds_du; + bullet.dmgMin = 70; + bullet.dmgMax = 80; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_APDS; + + return bullet; + } + + public static BulletConfiguration getShellW9Config() { + + BulletConfiguration bullet = BulletConfigFactory.standardShellConfig(); + + bullet.ammo = ModItems.ammo_shell_w9; + bullet.dmgMin = 100; + bullet.dmgMax = 150; + + bullet.bImpact = new IBulletImpactBehavior() { + + @Override + public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) { + BulletConfigFactory.nuclearExplosion(bullet, x, y, z, 1); + } + }; + + return bullet; + } + +} diff --git a/src/main/java/com/hbm/inventory/AssemblerRecipes.java b/src/main/java/com/hbm/inventory/AssemblerRecipes.java index e923904ca..1265832e8 100644 --- a/src/main/java/com/hbm/inventory/AssemblerRecipes.java +++ b/src/main/java/com/hbm/inventory/AssemblerRecipes.java @@ -257,8 +257,6 @@ public class AssemblerRecipes { makeRecipe(new ComparableStack(ModBlocks.cmb_brick_reinforced, 8), new AStack[] {new ComparableStack(ModBlocks.block_magnetized_tungsten, 4), new ComparableStack(ModBlocks.brick_concrete, 4), new ComparableStack(ModBlocks.cmb_brick, 1), new OreDictStack("plateSteel", 4), },200); makeRecipe(new ComparableStack(ModBlocks.seal_frame, 1), new AStack[] {new OreDictStack("ingotSteel", 3), new ComparableStack(ModItems.wire_aluminium, 4), new ComparableStack(Items.redstone, 2), new ComparableStack(ModBlocks.steel_roof, 5), },50); makeRecipe(new ComparableStack(ModBlocks.seal_controller, 1), new AStack[] {new OreDictStack("ingotSteel", 3), new ComparableStack(ModItems.ingot_polymer, 4), new OreDictStack("ingotRedCopperAlloy", 1), new ComparableStack(Items.redstone, 4), new ComparableStack(ModBlocks.steel_roof, 5), },100); - makeRecipe(new ComparableStack(ModBlocks.vault_door, 1), new AStack[] {new OreDictStack("ingotSteel", 128), new OreDictStack("ingotTungsten", 32), new OreDictStack("plateLead", 48), new ComparableStack(ModItems.plate_advanced_alloy, 8), new ComparableStack(ModItems.plate_polymer, 16), new ComparableStack(ModItems.bolt_tungsten, 18), new ComparableStack(ModItems.bolt_dura_steel, 27), new ComparableStack(ModItems.motor, 5), },200); - makeRecipe(new ComparableStack(ModBlocks.blast_door, 1), new AStack[] {new OreDictStack("ingotSteel", 16), new OreDictStack("ingotTungsten", 8), new OreDictStack("plateLead", 12), new ComparableStack(ModItems.plate_advanced_alloy, 3), new ComparableStack(ModItems.plate_polymer, 3), new ComparableStack(ModItems.bolt_tungsten, 3), new ComparableStack(ModItems.bolt_dura_steel, 3), new ComparableStack(ModItems.motor, 1), },300); makeRecipe(new ComparableStack(ModBlocks.machine_centrifuge, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_tower, 1), new OreDictStack("ingotSteel", 4), new OreDictStack("ingotIron", 4), new OreDictStack("plateSteel", 2), new OreDictStack("plateCopper", 2), new ComparableStack(ModItems.wire_red_copper, 8), },250); makeRecipe(new ComparableStack(ModBlocks.machine_gascent, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_tower, 1), new OreDictStack("ingotSteel", 4), new ComparableStack(ModItems.ingot_polymer, 4), new OreDictStack("ingotDesh", 2), new OreDictStack("plateSteel", 6), new ComparableStack(ModItems.plate_advanced_alloy, 4), new ComparableStack(ModItems.wire_red_copper, 8), new ComparableStack(ModItems.wire_gold, 4), },300); makeRecipe(new ComparableStack(ModBlocks.machine_reactor, 1), new AStack[] {new ComparableStack(ModItems.reactor_core, 1), new OreDictStack("ingotSteel", 12), new OreDictStack("plateLead", 16), new ComparableStack(ModBlocks.reinforced_glass, 4), new ComparableStack(ModItems.ingot_asbestos, 4)},150); @@ -588,6 +586,71 @@ public class AssemblerRecipes { new ComparableStack(ModItems.coin_maskman, 1), new ComparableStack(ModItems.coin_worm, 1), }, 1200); + + makeRecipe(new ComparableStack(ModBlocks.vault_door, 1), new AStack[] { + new OreDictStack("ingotSteel", 32), + new OreDictStack("ingotTungsten", 32), + new OreDictStack("plateLead", 16), + new ComparableStack(ModItems.plate_advanced_alloy, 4), + new ComparableStack(ModItems.plate_polymer, 4), + new ComparableStack(ModItems.bolt_tungsten, 8), + new ComparableStack(ModItems.bolt_dura_steel, 8), + new ComparableStack(ModItems.motor, 3), + }, 200); + + makeRecipe(new ComparableStack(ModBlocks.blast_door, 1), new AStack[] { + new OreDictStack("ingotSteel", 8), + new OreDictStack("ingotTungsten", 8), + new OreDictStack("plateLead", 6), + new ComparableStack(ModItems.plate_advanced_alloy, 3), + new ComparableStack(ModItems.plate_polymer, 3), + new ComparableStack(ModItems.bolt_tungsten, 3), + new ComparableStack(ModItems.bolt_dura_steel, 3), + new ComparableStack(ModItems.motor, 1), + }, 300); + + makeRecipe(new ComparableStack(ModBlocks.turret_chekhov, 1), new AStack[] { + new ComparableStack(ModBlocks.machine_battery, 1), + new OreDictStack("ingotSteel", 16), + new ComparableStack(ModItems.ingot_dura_steel, 4), + new ComparableStack(ModItems.motor, 3), + new ComparableStack(ModItems.circuit_targeting_tier3, 1), + new ComparableStack(ModItems.pipes_steel, 1), + new ComparableStack(ModItems.mechanism_rifle_2, 1), + new ComparableStack(ModBlocks.crate_iron, 1) + }, 200); + makeRecipe(new ComparableStack(ModBlocks.turret_friendly, 1), new AStack[] { + new ComparableStack(ModBlocks.machine_battery, 1), + new OreDictStack("ingotSteel", 16), + new ComparableStack(ModItems.ingot_dura_steel, 4), + new ComparableStack(ModItems.motor, 3), + new ComparableStack(ModItems.circuit_targeting_tier2, 1), + new ComparableStack(ModItems.pipes_steel, 1), + new ComparableStack(ModItems.mechanism_rifle_1, 1), + new ComparableStack(ModBlocks.crate_iron, 1) + }, 200); + makeRecipe(new ComparableStack(ModBlocks.turret_jeremy, 1), new AStack[] { + new ComparableStack(ModBlocks.machine_battery, 1), + new OreDictStack("ingotSteel", 16), + new ComparableStack(ModItems.ingot_dura_steel, 4), + new ComparableStack(ModItems.motor, 2), + new ComparableStack(ModItems.circuit_targeting_tier4, 1), + new ComparableStack(ModItems.motor_desh, 1), + new ComparableStack(ModItems.hull_small_steel, 3), + new ComparableStack(ModItems.mechanism_launcher_2, 1), + new ComparableStack(ModBlocks.crate_steel, 1) + }, 200); + makeRecipe(new ComparableStack(ModBlocks.turret_tauon, 1), new AStack[] { + new ComparableStack(ModBlocks.machine_lithium_battery, 1), + new OreDictStack("ingotSteel", 16), + new ComparableStack(ModItems.ingot_polymer, 4), + new ComparableStack(ModItems.motor, 2), + new ComparableStack(ModItems.circuit_targeting_tier4, 1), + new ComparableStack(ModItems.motor_desh, 1), + new OreDictStack("ingotCopper", 32), + new ComparableStack(ModItems.mechanism_special, 1), + new ComparableStack(ModItems.battery_lithium, 1) + }, 200); makeRecipe(new ComparableStack(ModBlocks.block_cap_nuka, 1), new AStack[] { new ComparableStack(ModItems.cap_nuka, 128) }, 10); makeRecipe(new ComparableStack(ModBlocks.block_cap_quantum, 1), new AStack[] { new ComparableStack(ModItems.cap_quantum, 128) }, 10); @@ -772,7 +835,7 @@ public class AssemblerRecipes { return null; } - //if index 3 exists, eval it as a stacksize + //if index 2 exists, eval it as a stacksize if(array.size() > 2 && array.get(2).isJsonPrimitive()) { if(array.get(2).getAsJsonPrimitive().isNumber()) { diff --git a/src/main/java/com/hbm/inventory/container/ContainerTurretChekhov.java b/src/main/java/com/hbm/inventory/container/ContainerTurretBase.java similarity index 77% rename from src/main/java/com/hbm/inventory/container/ContainerTurretChekhov.java rename to src/main/java/com/hbm/inventory/container/ContainerTurretBase.java index 227f1e6e7..bcf16824c 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerTurretChekhov.java +++ b/src/main/java/com/hbm/inventory/container/ContainerTurretBase.java @@ -1,6 +1,7 @@ package com.hbm.inventory.container; -import com.hbm.tileentity.turret.TileEntityTurretChekhov; +import com.hbm.items.ModItems; +import com.hbm.tileentity.turret.TileEntityTurretBaseNT; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -8,11 +9,11 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class ContainerTurretChekhov extends Container { +public class ContainerTurretBase extends Container { - private TileEntityTurretChekhov turret; + private TileEntityTurretBaseNT turret; - public ContainerTurretChekhov(InventoryPlayer invPlayer, TileEntityTurretChekhov te) { + public ContainerTurretBase(InventoryPlayer invPlayer, TileEntityTurretBaseNT te) { turret = te; this.addSlotToContainer(new Slot(te, 0, 98, 27)); @@ -52,7 +53,12 @@ public class ContainerTurretChekhov extends Container { if(!this.mergeItemStack(var5, turret.getSizeInventory(), this.inventorySlots.size(), true)) { return null; } - } else if(!this.mergeItemStack(var5, 0, turret.getSizeInventory(), false)) { + } else if(var5.getItem() == ModItems.turret_chip) { + + if(!this.mergeItemStack(var5, 0, 1, false)) + return null; + + } else if(!this.mergeItemStack(var5, 1, turret.getSizeInventory(), false)) { return null; } diff --git a/src/main/java/com/hbm/inventory/gui/GUITurretBase.java b/src/main/java/com/hbm/inventory/gui/GUITurretBase.java new file mode 100644 index 000000000..7dccdd194 --- /dev/null +++ b/src/main/java/com/hbm/inventory/gui/GUITurretBase.java @@ -0,0 +1,266 @@ +package com.hbm.inventory.gui; + +import java.util.List; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.container.ContainerTurretBase; +import com.hbm.lib.RefStrings; +import com.hbm.packet.AuxButtonPacket; +import com.hbm.packet.NBTControlPacket; +import com.hbm.packet.PacketDispatcher; +import com.hbm.tileentity.turret.TileEntityTurretBaseNT; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +public abstract class GUITurretBase extends GuiInfoContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/gui_turret_base.png"); + private TileEntityTurretBaseNT turret; + private GuiTextField field; + int index; + + public GUITurretBase(InventoryPlayer invPlayer, TileEntityTurretBaseNT tedf) { + super(new ContainerTurretBase(invPlayer, tedf)); + turret = tedf; + + this.xSize = 176; + this.ySize = 222; + } + + public void initGui() { + + super.initGui(); + + Keyboard.enableRepeatEvents(true); + this.field = new GuiTextField(this.fontRendererObj, guiLeft + 10, guiTop + 65, 50, 14); + this.field.setTextColor(-1); + this.field.setDisabledTextColour(-1); + this.field.setEnableBackgroundDrawing(false); + this.field.setMaxStringLength(25); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 45, 16, 52, turret.power, turret.getMaxPower()); + } + + protected void mouseClicked(int x, int y, int i) { + super.mouseClicked(x, y, i); + + boolean flag = x >= this.field.xPosition && x < this.field.xPosition + this.field.width && y >= this.field.yPosition && y < this.field.yPosition + this.field.height; + this.field.setFocused(flag); + + if(guiLeft + 115 <= x && guiLeft + 115 + 18 > x && guiTop + 26 < y && guiTop + 26 + 18 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 0)); + return; + } + + if(guiLeft + 8 <= x && guiLeft + 8 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 1)); + return; + } + + if(guiLeft + 22 <= x && guiLeft + 22 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 2)); + return; + } + + if(guiLeft + 36 <= x && guiLeft + 36 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 3)); + return; + } + + if(guiLeft + 50 <= x && guiLeft + 50 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 4)); + return; + } + + int count = getCount(); + + if(count > 0) { + + if(guiLeft + 7 <= x && guiLeft + 7 + 18 > x && guiTop + 80 < y && guiTop + 80 + 18 >= y) { + + index--; + if(index < 0) + index = count - 1; + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + return; + } + + if(guiLeft + 43 <= x && guiLeft + 43 + 18 > x && guiTop + 80 < y && guiTop + 80 + 18 >= y) { + + index++; + index %= count; + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + return; + } + } + + if(guiLeft + 7 <= x && guiLeft + 7 + 18 > x && guiTop + 98 < y && guiTop + 98 + 18 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + + if(this.field.getText().isEmpty()) + return; + + NBTTagCompound data = new NBTTagCompound(); + data.setString("name", this.field.getText()); + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, turret.xCoord, turret.yCoord, turret.zCoord)); + + this.field.setText(""); + return; + } + + if(guiLeft + 43 <= x && guiLeft + 43 + 18 > x && guiTop + 98 < y && guiTop + 98 + 18 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + + NBTTagCompound data = new NBTTagCompound(); + data.setInteger("del", this.index); + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, turret.xCoord, turret.yCoord, turret.zCoord)); + return; + } + } + + @Override + protected void drawGuiContainerForegroundLayer(int i, int j) { + String name = this.turret.hasCustomInventoryName() ? this.turret.getInventoryName() : I18n.format(this.turret.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); + + List names = turret.getWhitelist(); + + String n = EnumChatFormatting.ITALIC + "None"; + + while(this.index >= this.getCount()) + this.index--; + + if(index < 0) + index = 0; + + if(names != null) { + n = names.get(index); + } + + String t = this.field.getText(); + + String cursor = System.currentTimeMillis() % 1000 < 500 ? " " : "||"; + + if(this.field.isFocused()) + t = t.substring(0, this.field.getCursorPosition()) + cursor + t.substring(this.field.getCursorPosition(), t.length()); + + double scale = 2; + + GL11.glScaled(1D / scale, 1D / scale, 1); + this.fontRendererObj.drawString(n, (int)(12 * scale), (int)(51 * scale), 0x00ff00); + this.fontRendererObj.drawString(t, (int)(12 * scale), (int)(69 * scale), 0x00ff00); + GL11.glScaled(scale, scale, 1); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int mX, int mY) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(this.getTexture()); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + if(guiLeft + 7 <= mX && guiLeft + 7 + 18 > mX && guiTop + 80 < mY && guiTop + 80 + 18 >=mY) { + drawTexturedModalRect(guiLeft + 7, guiTop + 80, 176, 58, 18, 18); + } + if(guiLeft + 43 <= mX && guiLeft + 43 + 18 > mX && guiTop + 80 < mY && guiTop + 80 + 18 >=mY) { + drawTexturedModalRect(guiLeft + 43, guiTop + 80, 194, 58, 18, 18); + } + if(guiLeft + 7 <= mX && guiLeft + 7 + 18 > mX && guiTop + 98 < mY && guiTop + 98 + 18 >=mY) { + drawTexturedModalRect(guiLeft + 7, guiTop + 98, 176, 76, 18, 18); + } + if(guiLeft + 43 <= mX && guiLeft + 43 + 18 > mX && guiTop + 98 < mY && guiTop + 98 + 18 >=mY) { + drawTexturedModalRect(guiLeft + 43, guiTop + 98, 194, 76, 18, 18); + } + + int i = turret.getPowerScaled(53); + drawTexturedModalRect(guiLeft + 152, guiTop + 97 - i, 194, 52 - i, 16, i); + + if(turret.isOn) + drawTexturedModalRect(guiLeft + 115, guiTop + 26, 176, 40, 18, 18); + + if(turret.targetPlayers) + drawTexturedModalRect(guiLeft + 8, guiTop + 30, 176, 0, 10, 10); + + if(turret.targetAnimals) + drawTexturedModalRect(guiLeft + 22, guiTop + 30, 176, 10, 10, 10); + + if(turret.targetMobs) + drawTexturedModalRect(guiLeft + 36, guiTop + 30, 176, 20, 10, 10); + + if(turret.targetMachines) + drawTexturedModalRect(guiLeft + 50, guiTop + 30, 176, 30, 10, 10); + + int tallies = turret.stattrak; + + if(tallies >= 36) { + + drawTexturedModalRect(guiLeft + 77, guiTop + 50, 176, 120, 63, 6); + + } else { + + int steps = (int)Math.ceil(tallies / 5D); + + for(int s = 0; s < steps; s++) { + + int m = tallies % 5; + + if(s < steps - 1 || m == 0) { + drawTexturedModalRect(guiLeft + 77 + 9 * s, guiTop + 50, 194, 94, 9, 6); + } else { + + drawTexturedModalRect(guiLeft + 77 + 9 * s, guiTop + 50, 176, 94, m * 2, 6); + } + } + } + } + + protected ResourceLocation getTexture() { + return texture; + } + + private int getCount() { + + List names = turret.getWhitelist(); + + if(names == null) + return 0; + + return names.size(); + } + + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + + if(this.field.textboxKeyTyped(p_73869_1_, p_73869_2_)) { + + } else { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } +} diff --git a/src/main/java/com/hbm/inventory/gui/GUITurretChekhov.java b/src/main/java/com/hbm/inventory/gui/GUITurretChekhov.java index d9f3e0db6..144877efd 100644 --- a/src/main/java/com/hbm/inventory/gui/GUITurretChekhov.java +++ b/src/main/java/com/hbm/inventory/gui/GUITurretChekhov.java @@ -1,262 +1,11 @@ package com.hbm.inventory.gui; -import java.util.List; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import com.hbm.inventory.container.ContainerTurretChekhov; -import com.hbm.lib.RefStrings; -import com.hbm.packet.AuxButtonPacket; -import com.hbm.packet.NBTControlPacket; -import com.hbm.packet.PacketDispatcher; -import com.hbm.tileentity.turret.TileEntityTurretChekhov; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.resources.I18n; +import com.hbm.tileentity.turret.TileEntityTurretBaseNT; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; -public class GUITurretChekhov extends GuiInfoContainer { +public class GUITurretChekhov extends GUITurretBase { - private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/gui_turret_base.png"); - private TileEntityTurretChekhov turret; - private GuiTextField field; - int index; - - public GUITurretChekhov(InventoryPlayer invPlayer, TileEntityTurretChekhov tedf) { - super(new ContainerTurretChekhov(invPlayer, tedf)); - turret = tedf; - - this.xSize = 176; - this.ySize = 222; - } - - public void initGui() { - - super.initGui(); - - Keyboard.enableRepeatEvents(true); - this.field = new GuiTextField(this.fontRendererObj, guiLeft + 10, guiTop + 65, 50, 14); - this.field.setTextColor(-1); - this.field.setDisabledTextColour(-1); - this.field.setEnableBackgroundDrawing(false); - this.field.setMaxStringLength(25); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float f) { - super.drawScreen(mouseX, mouseY, f); - - this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 45, 16, 52, turret.power, turret.getMaxPower()); - } - - protected void mouseClicked(int x, int y, int i) { - super.mouseClicked(x, y, i); - - boolean flag = x >= this.field.xPosition && x < this.field.xPosition + this.field.width && y >= this.field.yPosition && y < this.field.yPosition + this.field.height; - this.field.setFocused(flag); - - if(guiLeft + 115 <= x && guiLeft + 115 + 18 > x && guiTop + 26 < y && guiTop + 26 + 18 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 0)); - return; - } - - if(guiLeft + 8 <= x && guiLeft + 8 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 1)); - return; - } - - if(guiLeft + 22 <= x && guiLeft + 22 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 2)); - return; - } - - if(guiLeft + 36 <= x && guiLeft + 36 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 3)); - return; - } - - if(guiLeft + 50 <= x && guiLeft + 50 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(turret.xCoord, turret.yCoord, turret.zCoord, 0, 4)); - return; - } - - int count = getCount(); - - if(count > 0) { - - if(guiLeft + 7 <= x && guiLeft + 7 + 18 > x && guiTop + 80 < y && guiTop + 80 + 18 >= y) { - - index--; - if(index < 0) - index = count - 1; - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - return; - } - - if(guiLeft + 43 <= x && guiLeft + 43 + 18 > x && guiTop + 80 < y && guiTop + 80 + 18 >= y) { - - index++; - index %= count; - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - return; - } - } - - if(guiLeft + 7 <= x && guiLeft + 7 + 18 > x && guiTop + 98 < y && guiTop + 98 + 18 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - - if(this.field.getText().isEmpty()) - return; - - NBTTagCompound data = new NBTTagCompound(); - data.setString("name", this.field.getText()); - PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, turret.xCoord, turret.yCoord, turret.zCoord)); - - this.field.setText(""); - return; - } - - if(guiLeft + 43 <= x && guiLeft + 43 + 18 > x && guiTop + 98 < y && guiTop + 98 + 18 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - - NBTTagCompound data = new NBTTagCompound(); - data.setInteger("del", this.index); - PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, turret.xCoord, turret.yCoord, turret.zCoord)); - return; - } - } - - @Override - protected void drawGuiContainerForegroundLayer(int i, int j) { - String name = this.turret.hasCustomInventoryName() ? this.turret.getInventoryName() : I18n.format(this.turret.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); - - List names = turret.getWhitelist(); - - String n = EnumChatFormatting.ITALIC + "None"; - - while(this.index >= this.getCount()) - this.index--; - - if(index < 0) - index = 0; - - if(names != null) { - n = names.get(index); - } - - String t = this.field.getText(); - - String cursor = System.currentTimeMillis() % 1000 < 500 ? " " : "||"; - - if(this.field.isFocused()) - t = t.substring(0, this.field.getCursorPosition()) + cursor + t.substring(this.field.getCursorPosition(), t.length()); - - double scale = 2; - - GL11.glScaled(1D / scale, 1D / scale, 1); - this.fontRendererObj.drawString(n, (int)(12 * scale), (int)(51 * scale), 0x00ff00); - this.fontRendererObj.drawString(t, (int)(12 * scale), (int)(69 * scale), 0x00ff00); - GL11.glScaled(scale, scale, 1); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int mX, int mY) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - - if(guiLeft + 7 <= mX && guiLeft + 7 + 18 > mX && guiTop + 80 < mY && guiTop + 80 + 18 >=mY) { - drawTexturedModalRect(guiLeft + 7, guiTop + 80, 176, 58, 18, 18); - } - if(guiLeft + 43 <= mX && guiLeft + 43 + 18 > mX && guiTop + 80 < mY && guiTop + 80 + 18 >=mY) { - drawTexturedModalRect(guiLeft + 43, guiTop + 80, 194, 58, 18, 18); - } - if(guiLeft + 7 <= mX && guiLeft + 7 + 18 > mX && guiTop + 98 < mY && guiTop + 98 + 18 >=mY) { - drawTexturedModalRect(guiLeft + 7, guiTop + 98, 176, 76, 18, 18); - } - if(guiLeft + 43 <= mX && guiLeft + 43 + 18 > mX && guiTop + 98 < mY && guiTop + 98 + 18 >=mY) { - drawTexturedModalRect(guiLeft + 43, guiTop + 98, 194, 76, 18, 18); - } - - int i = turret.getPowerScaled(53); - drawTexturedModalRect(guiLeft + 152, guiTop + 97 - i, 194, 52 - i, 16, i); - - if(turret.isOn) - drawTexturedModalRect(guiLeft + 115, guiTop + 26, 176, 40, 18, 18); - - if(turret.targetPlayers) - drawTexturedModalRect(guiLeft + 8, guiTop + 30, 176, 0, 10, 10); - - if(turret.targetAnimals) - drawTexturedModalRect(guiLeft + 22, guiTop + 30, 176, 10, 10, 10); - - if(turret.targetMobs) - drawTexturedModalRect(guiLeft + 36, guiTop + 30, 176, 20, 10, 10); - - if(turret.targetMachines) - drawTexturedModalRect(guiLeft + 50, guiTop + 30, 176, 30, 10, 10); - - int tallies = turret.stattrak; - - if(tallies >= 36) { - - drawTexturedModalRect(guiLeft + 77, guiTop + 50, 176, 120, 63, 6); - - } else { - - int steps = (int)Math.ceil(tallies / 5D); - - for(int s = 0; s < steps; s++) { - - int m = tallies % 5; - - if(s < steps - 1 || m == 0) { - drawTexturedModalRect(guiLeft + 77 + 9 * s, guiTop + 50, 194, 94, 9, 6); - } else { - - drawTexturedModalRect(guiLeft + 77 + 9 * s, guiTop + 50, 176, 94, m * 2, 6); - } - } - } - } - - private int getCount() { - - List names = turret.getWhitelist(); - - if(names == null) - return 0; - - return names.size(); - } - - protected void keyTyped(char p_73869_1_, int p_73869_2_) { - - if(this.field.textboxKeyTyped(p_73869_1_, p_73869_2_)) { - - } else { - super.keyTyped(p_73869_1_, p_73869_2_); - } + public GUITurretChekhov(InventoryPlayer invPlayer, TileEntityTurretBaseNT tedf) { + super(invPlayer, tedf); } } diff --git a/src/main/java/com/hbm/inventory/gui/GUITurretFriendly.java b/src/main/java/com/hbm/inventory/gui/GUITurretFriendly.java new file mode 100644 index 000000000..4e71fa48b --- /dev/null +++ b/src/main/java/com/hbm/inventory/gui/GUITurretFriendly.java @@ -0,0 +1,20 @@ +package com.hbm.inventory.gui; + +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.turret.TileEntityTurretBaseNT; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUITurretFriendly extends GUITurretBase { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/gui_turret_friendly.png"); + + public GUITurretFriendly(InventoryPlayer invPlayer, TileEntityTurretBaseNT tedf) { + super(invPlayer, tedf); + } + + protected ResourceLocation getTexture() { + return texture; + } +} diff --git a/src/main/java/com/hbm/inventory/gui/GUITurretJeremy.java b/src/main/java/com/hbm/inventory/gui/GUITurretJeremy.java new file mode 100644 index 000000000..12a0f920c --- /dev/null +++ b/src/main/java/com/hbm/inventory/gui/GUITurretJeremy.java @@ -0,0 +1,20 @@ +package com.hbm.inventory.gui; + +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.turret.TileEntityTurretBaseNT; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUITurretJeremy extends GUITurretBase { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/gui_turret_cannon.png"); + + public GUITurretJeremy(InventoryPlayer invPlayer, TileEntityTurretBaseNT tedf) { + super(invPlayer, tedf); + } + + protected ResourceLocation getTexture() { + return texture; + } +} diff --git a/src/main/java/com/hbm/inventory/gui/GUITurretTauon.java b/src/main/java/com/hbm/inventory/gui/GUITurretTauon.java new file mode 100644 index 000000000..fadf9bd51 --- /dev/null +++ b/src/main/java/com/hbm/inventory/gui/GUITurretTauon.java @@ -0,0 +1,20 @@ +package com.hbm.inventory.gui; + +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.turret.TileEntityTurretBaseNT; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUITurretTauon extends GUITurretBase { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/gui_turret_tau.png"); + + public GUITurretTauon(InventoryPlayer invPlayer, TileEntityTurretBaseNT tedf) { + super(invPlayer, tedf); + } + + protected ResourceLocation getTexture() { + return texture; + } +} diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index acd2cdef2..97b2391d0 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -1289,6 +1289,11 @@ public class ModItems { public static Item ammo_grenade_nuclear; public static Item ammo_grenade_tracer; public static Item ammo_grenade_kampf; + public static Item ammo_shell; + public static Item ammo_shell_explosive; + public static Item ammo_shell_apfsds_t; + public static Item ammo_shell_apfsds_du; + public static Item ammo_shell_w9; public static Item ammo_nuke; public static Item ammo_nuke_low; public static Item ammo_nuke_high; @@ -1467,6 +1472,8 @@ public class ModItems { public static Item grenade_mirv; public static Item grenade_breach; public static Item grenade_burst; + + public static Item nuclear_waste_pearl; public static Item weaponized_starblaster_cell; @@ -1772,6 +1779,16 @@ public class ModItems { public static Item cobalt_axe; public static Item cobalt_shovel; public static Item cobalt_hoe; + public static Item cobalt_decorated_sword; + public static Item cobalt_decorated_pickaxe; + public static Item cobalt_decorated_axe; + public static Item cobalt_decorated_shovel; + public static Item cobalt_decorated_hoe; + public static Item starmetal_sword; + public static Item starmetal_pickaxe; + public static Item starmetal_axe; + public static Item starmetal_shovel; + public static Item starmetal_hoe; public static Item smashing_hammer; public static Item centri_stick; public static Item drax; @@ -2152,6 +2169,7 @@ public class ModItems { public static Item digamma_see; public static Item digamma_feel; public static Item digamma_know; + public static Item digamma_kauai_moho; public static final int guiID_item_folder = 1099; public static final int guiID_item_designator = 10100; @@ -3385,6 +3403,11 @@ public class ModItems { ammo_grenade_nuclear = new ItemAmmo().setUnlocalizedName("ammo_grenade_nuclear").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_grenade_nuclear"); ammo_grenade_tracer = new ItemAmmo().setUnlocalizedName("ammo_grenade_tracer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_grenade_tracer"); ammo_grenade_kampf = new ItemAmmo().setUnlocalizedName("ammo_grenade_kampf").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_grenade_kampf"); + ammo_shell = new ItemAmmo().setUnlocalizedName("ammo_shell").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_shell"); + ammo_shell_explosive = new ItemAmmo().setUnlocalizedName("ammo_shell_explosive").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_shell_explosive"); + ammo_shell_apfsds_t = new ItemAmmo().setUnlocalizedName("ammo_shell_apfsds_t").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_shell_apfsds-t"); + ammo_shell_apfsds_du = new ItemAmmo().setUnlocalizedName("ammo_shell_apfsds_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_shell_apfsds-du"); + ammo_shell_w9 = new ItemAmmo().setUnlocalizedName("ammo_shell_w9").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_shell_w9"); ammo_nuke = new ItemAmmo().setUnlocalizedName("ammo_nuke").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_nuke"); ammo_nuke_low = new ItemAmmo().setUnlocalizedName("ammo_nuke_low").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_nuke_low"); ammo_nuke_high = new ItemAmmo().setUnlocalizedName("ammo_nuke_high").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_nuke_high"); @@ -3564,6 +3587,7 @@ public class ModItems { grenade_mirv = new ItemGrenade(1).setUnlocalizedName("grenade_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mirv"); grenade_breach = new ItemGrenade(-1).setUnlocalizedName("grenade_breach").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_breach"); grenade_burst = new ItemGrenade(1).setUnlocalizedName("grenade_burst").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_burst"); + nuclear_waste_pearl = new ItemGrenade(-1).setUnlocalizedName("nuclear_waste_pearl").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":nuclear_waste_pearl"); weaponized_starblaster_cell = new WeaponizedCell().setUnlocalizedName("weaponized_starblaster_cell").setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b92_ammo_weaponized"); @@ -3951,7 +3975,7 @@ public class ModItems { ArmorMaterial aMatDNT = EnumHelper.addArmorMaterial("HBM_DNT_LOLOLOL", 3, new int[] { 1, 1, 1, 1 }, 0); aMatDNT.customCraftingMaterial = ModItems.ingot_dineutronium; dnt_helmet = new ArmorFSB(aMatDNT, 7, 0, RefStrings.MODID + ":textures/armor/dnt_1.png") - .setMod(1.1F).setUnlocalizedName("dnt_helmet").setTextureName(RefStrings.MODID + ":dnt_helmet"); + .setMod(5F).setUnlocalizedName("dnt_helmet").setTextureName(RefStrings.MODID + ":dnt_helmet"); dnt_plate = new ArmorFSB(aMatDNT, 7, 1, RefStrings.MODID + ":textures/armor/dnt_1.png").cloneStats((ArmorFSB) dnt_helmet).setUnlocalizedName("dnt_plate").setTextureName(RefStrings.MODID + ":dnt_plate"); dnt_legs = new ArmorFSB(aMatDNT, 7, 2, RefStrings.MODID + ":textures/armor/dnt_2.png").cloneStats((ArmorFSB) dnt_helmet).setUnlocalizedName("dnt_legs").setTextureName(RefStrings.MODID + ":dnt_legs"); dnt_boots = new ArmorFSB(aMatDNT, 7, 3, RefStrings.MODID + ":textures/armor/dnt_1.png").cloneStats((ArmorFSB) dnt_helmet).setUnlocalizedName("dnt_boots").setTextureName(RefStrings.MODID + ":dnt_boots"); @@ -4217,24 +4241,65 @@ public class ModItems { desh_hoe = new ModHoe(MainRegistry.tMatDesh).setUnlocalizedName("desh_hoe").setTextureName(RefStrings.MODID + ":desh_hoe"); cobalt_sword = new ItemSwordAbility(12F, 0, MainRegistry.tMatCobalt).setUnlocalizedName("cobalt_sword").setTextureName(RefStrings.MODID + ":cobalt_sword"); - cobalt_pickaxe = new ItemToolAbility(4F, 0, MainRegistry.tMatCobalt, EnumToolType.PICKAXE) .addBreakAbility(new ToolAbility.RecursionAbility(4)) .addBreakAbility(new ToolAbility.SilkAbility()) .addBreakAbility(new LuckAbility(1)).setUnlocalizedName("cobalt_pickaxe").setTextureName(RefStrings.MODID + ":cobalt_pickaxe"); - cobalt_axe = new ItemToolAbility(6F, 0, MainRegistry.tMatCobalt, EnumToolType.AXE) .addBreakAbility(new ToolAbility.RecursionAbility(4)) .addBreakAbility(new ToolAbility.SilkAbility()) .addBreakAbility(new LuckAbility(1)) .addHitAbility(new WeaponAbility.BeheaderAbility()).setUnlocalizedName("cobalt_axe").setTextureName(RefStrings.MODID + ":cobalt_axe"); - cobalt_shovel = new ItemToolAbility(3.5F, 0, MainRegistry.tMatCobalt, EnumToolType.SHOVEL) .addBreakAbility(new ToolAbility.RecursionAbility(4)) .addBreakAbility(new ToolAbility.SilkAbility()) .addBreakAbility(new LuckAbility(1)).setUnlocalizedName("cobalt_shovel").setTextureName(RefStrings.MODID + ":cobalt_shovel"); - cobalt_hoe = new ModHoe(MainRegistry.tMatCobalt).setUnlocalizedName("cobalt_hoe").setTextureName(RefStrings.MODID + ":cobalt_hoe"); + + ToolMaterial matDecCobalt = EnumHelper.addToolMaterial("HBM_COBALT2", 3, 1000, 15.0F, 2.5F, 25).setRepairItem(new ItemStack(ModItems.ingot_cobalt)); + cobalt_decorated_sword = new ItemSwordAbility(15F, 0, matDecCobalt).setUnlocalizedName("cobalt_decorated_sword").setTextureName(RefStrings.MODID + ":cobalt_decorated_sword"); + cobalt_decorated_pickaxe = new ItemToolAbility(6F, 0, matDecCobalt, EnumToolType.PICKAXE) + .addBreakAbility(new ToolAbility.RecursionAbility(4)) + .addBreakAbility(new ToolAbility.HammerAbility(1)) + .addBreakAbility(new ToolAbility.SilkAbility()) + .addBreakAbility(new LuckAbility(3)).setUnlocalizedName("cobalt_decorated_pickaxe").setTextureName(RefStrings.MODID + ":cobalt_decorated_pickaxe"); + cobalt_decorated_axe = new ItemToolAbility(8F, 0, matDecCobalt, EnumToolType.AXE) + .addBreakAbility(new ToolAbility.RecursionAbility(4)) + .addBreakAbility(new ToolAbility.HammerAbility(1)) + .addBreakAbility(new ToolAbility.SilkAbility()) + .addBreakAbility(new LuckAbility(3)) + .addHitAbility(new WeaponAbility.BeheaderAbility()).setUnlocalizedName("cobalt_decorated_axe").setTextureName(RefStrings.MODID + ":cobalt_decorated_axe"); + cobalt_decorated_shovel = new ItemToolAbility(5F, 0, matDecCobalt, EnumToolType.SHOVEL) + .addBreakAbility(new ToolAbility.RecursionAbility(4)) + .addBreakAbility(new ToolAbility.HammerAbility(1)) + .addBreakAbility(new ToolAbility.SilkAbility()) + .addBreakAbility(new LuckAbility(3)).setUnlocalizedName("cobalt_decorated_shovel").setTextureName(RefStrings.MODID + ":cobalt_decorated_shovel"); + cobalt_decorated_hoe = new ModHoe(matDecCobalt).setUnlocalizedName("cobalt_decorated_hoe").setTextureName(RefStrings.MODID + ":cobalt_decorated_hoe"); + + ToolMaterial matStarmetal = EnumHelper.addToolMaterial("HBM_STARMETAL", 3, 1000, 20.0F, 2.5F, 30).setRepairItem(new ItemStack(ModItems.ingot_starmetal)); + starmetal_sword = new ItemSwordAbility(25F, 0, matStarmetal) + .addHitAbility(new WeaponAbility.BeheaderAbility()) + .addHitAbility(new WeaponAbility.StunAbility(3)).setUnlocalizedName("starmetal_sword").setTextureName(RefStrings.MODID + ":starmetal_sword"); + starmetal_pickaxe = new ItemToolAbility(8F, 0, matStarmetal, EnumToolType.PICKAXE) + .addBreakAbility(new ToolAbility.RecursionAbility(6)) + .addBreakAbility(new ToolAbility.HammerAbility(2)) + .addBreakAbility(new ToolAbility.SilkAbility()) + .addBreakAbility(new LuckAbility(1)) + .addHitAbility(new WeaponAbility.StunAbility(3)).setUnlocalizedName("starmetal_pickaxe").setTextureName(RefStrings.MODID + ":starmetal_pickaxe"); + starmetal_axe = new ItemToolAbility(12F, 0, matStarmetal, EnumToolType.AXE) + .addBreakAbility(new ToolAbility.RecursionAbility(6)) + .addBreakAbility(new ToolAbility.HammerAbility(2)) + .addBreakAbility(new ToolAbility.SilkAbility()) + .addBreakAbility(new LuckAbility(1)) + .addHitAbility(new WeaponAbility.BeheaderAbility()) + .addHitAbility(new WeaponAbility.StunAbility(3)).setUnlocalizedName("starmetal_axe").setTextureName(RefStrings.MODID + ":starmetal_axe"); + starmetal_shovel = new ItemToolAbility(7F, 0, matStarmetal, EnumToolType.SHOVEL) + .addBreakAbility(new ToolAbility.RecursionAbility(6)) + .addBreakAbility(new ToolAbility.HammerAbility(2)) + .addBreakAbility(new ToolAbility.SilkAbility()) + .addBreakAbility(new LuckAbility(1)) + .addHitAbility(new WeaponAbility.StunAbility(3)).setUnlocalizedName("starmetal_shovel").setTextureName(RefStrings.MODID + ":starmetal_shovel"); + starmetal_hoe = new ModHoe(matStarmetal).setUnlocalizedName("starmetal_hoe").setTextureName(RefStrings.MODID + ":starmetal_hoe"); centri_stick = new ItemToolAbility(3F, 0, MainRegistry.tMatElec, EnumToolType.MINER) .addBreakAbility(new ToolAbility.CentrifugeAbility()).setMaxDamage(50).setUnlocalizedName("centri_stick").setTextureName(RefStrings.MODID + ":centri_stick"); @@ -4407,6 +4472,11 @@ public class ModItems { book_secret = new ItemCustomLore().setUnlocalizedName("book_secret").setCreativeTab(MainRegistry.polaroidID == 11 ? MainRegistry.consumableTab : null).setTextureName(RefStrings.MODID + ":book_secret"); book_of_ = new ItemBook().setUnlocalizedName("book_of_").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":book_of_"); burnt_bark = new ItemCustomLore().setUnlocalizedName("burnt_bark").setCreativeTab(null).setTextureName(RefStrings.MODID + ":burnt_bark"); + + initializeItem2(); + } + + public static void initializeItem2() { smoke1 = new Item().setUnlocalizedName("smoke1").setTextureName(RefStrings.MODID + ":smoke1"); smoke2 = new Item().setUnlocalizedName("smoke2").setTextureName(RefStrings.MODID + ":smoke2"); @@ -4522,6 +4592,7 @@ public class ModItems { digamma_see = new Item().setUnlocalizedName("digamma_see").setTextureName(RefStrings.MODID + ":digamma_see"); digamma_feel = new Item().setUnlocalizedName("digamma_feel").setTextureName(RefStrings.MODID + ":digamma_feel"); digamma_know = new Item().setUnlocalizedName("digamma_know").setTextureName(RefStrings.MODID + ":digamma_know"); + digamma_kauai_moho = new Item().setUnlocalizedName("digamma_kauai_moho").setTextureName(RefStrings.MODID + ":digamma_kauai_moho"); mysteryshovel = new ItemMS().setUnlocalizedName("mysteryshovel").setFull3D().setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cursed_shovel"); memory = new ItemBattery(Long.MAX_VALUE / 100L, 100000000000000L, 100000000000000L).setUnlocalizedName("memory").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":mo8_anim"); @@ -5985,6 +6056,11 @@ public class ModItems { GameRegistry.registerItem(ammo_grenade_nuclear, ammo_grenade_nuclear.getUnlocalizedName()); GameRegistry.registerItem(ammo_grenade_tracer, ammo_grenade_tracer.getUnlocalizedName()); GameRegistry.registerItem(ammo_grenade_kampf, ammo_grenade_kampf.getUnlocalizedName()); + GameRegistry.registerItem(ammo_shell, ammo_shell.getUnlocalizedName()); + GameRegistry.registerItem(ammo_shell_explosive, ammo_shell_explosive.getUnlocalizedName()); + GameRegistry.registerItem(ammo_shell_apfsds_t, ammo_shell_apfsds_t.getUnlocalizedName()); + GameRegistry.registerItem(ammo_shell_apfsds_du, ammo_shell_apfsds_du.getUnlocalizedName()); + GameRegistry.registerItem(ammo_shell_w9, ammo_shell_w9.getUnlocalizedName()); GameRegistry.registerItem(ammo_nuke, ammo_nuke.getUnlocalizedName()); GameRegistry.registerItem(ammo_nuke_low, ammo_nuke_low.getUnlocalizedName()); GameRegistry.registerItem(ammo_nuke_high, ammo_nuke_high.getUnlocalizedName()); @@ -6088,6 +6164,7 @@ public class ModItems { GameRegistry.registerItem(grenade_if_spark, grenade_if_spark.getUnlocalizedName()); GameRegistry.registerItem(grenade_if_hopwire, grenade_if_hopwire.getUnlocalizedName()); GameRegistry.registerItem(grenade_if_null, grenade_if_null.getUnlocalizedName()); + GameRegistry.registerItem(nuclear_waste_pearl, nuclear_waste_pearl.getUnlocalizedName()); GameRegistry.registerItem(ullapool_caber, ullapool_caber.getUnlocalizedName()); GameRegistry.registerItem(weaponized_starblaster_cell, weaponized_starblaster_cell.getUnlocalizedName()); @@ -6126,6 +6203,16 @@ public class ModItems { GameRegistry.registerItem(cobalt_axe, cobalt_axe.getUnlocalizedName()); GameRegistry.registerItem(cobalt_shovel, cobalt_shovel.getUnlocalizedName()); GameRegistry.registerItem(cobalt_hoe, cobalt_hoe.getUnlocalizedName()); + GameRegistry.registerItem(cobalt_decorated_sword, cobalt_decorated_sword.getUnlocalizedName()); + GameRegistry.registerItem(cobalt_decorated_pickaxe, cobalt_decorated_pickaxe.getUnlocalizedName()); + GameRegistry.registerItem(cobalt_decorated_axe, cobalt_decorated_axe.getUnlocalizedName()); + GameRegistry.registerItem(cobalt_decorated_shovel, cobalt_decorated_shovel.getUnlocalizedName()); + GameRegistry.registerItem(cobalt_decorated_hoe, cobalt_decorated_hoe.getUnlocalizedName()); + GameRegistry.registerItem(starmetal_sword, starmetal_sword.getUnlocalizedName()); + GameRegistry.registerItem(starmetal_pickaxe, starmetal_pickaxe.getUnlocalizedName()); + GameRegistry.registerItem(starmetal_axe, starmetal_axe.getUnlocalizedName()); + GameRegistry.registerItem(starmetal_shovel, starmetal_shovel.getUnlocalizedName()); + GameRegistry.registerItem(starmetal_hoe, starmetal_hoe.getUnlocalizedName()); GameRegistry.registerItem(alloy_sword, alloy_sword.getUnlocalizedName()); GameRegistry.registerItem(alloy_pickaxe, alloy_pickaxe.getUnlocalizedName()); GameRegistry.registerItem(alloy_axe, alloy_axe.getUnlocalizedName()); @@ -6723,6 +6810,7 @@ public class ModItems { GameRegistry.registerItem(digamma_see, digamma_see.getUnlocalizedName()); GameRegistry.registerItem(digamma_feel, digamma_feel.getUnlocalizedName()); GameRegistry.registerItem(digamma_know, digamma_know.getUnlocalizedName()); + GameRegistry.registerItem(digamma_kauai_moho, digamma_kauai_moho.getUnlocalizedName()); GameRegistry.registerItem(mysteryshovel, mysteryshovel.getUnlocalizedName()); GameRegistry.registerItem(memory, memory.getUnlocalizedName()); } diff --git a/src/main/java/com/hbm/items/tool/ItemTurretControl.java b/src/main/java/com/hbm/items/tool/ItemTurretControl.java index aef1458b7..e027121d9 100644 --- a/src/main/java/com/hbm/items/tool/ItemTurretControl.java +++ b/src/main/java/com/hbm/items/tool/ItemTurretControl.java @@ -2,8 +2,11 @@ package com.hbm.items.tool; import java.util.List; +import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.turret.TurretBase; +import com.hbm.lib.Library; import com.hbm.tileentity.turret.TileEntityTurretBase; +import com.hbm.tileentity.turret.TileEntityTurretBaseNT; import com.hbm.tileentity.turret.TileEntityTurretCheapo; import net.minecraft.entity.Entity; @@ -14,6 +17,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.ArrowLooseEvent; @@ -23,29 +29,32 @@ public class ItemTurretControl extends Item { @Override public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean bool) { + if(entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)entity; + EntityPlayer player = (EntityPlayer) entity; + if(player.getHeldItem() != null && stack != null && player.getHeldItem().equals(stack)) { + if(stack.hasTagCompound()) { int x = stack.getTagCompound().getInteger("xCoord"); int y = stack.getTagCompound().getInteger("yCoord"); int z = stack.getTagCompound().getInteger("zCoord"); - + TileEntity te = world.getTileEntity(x, y, z); - + if(te != null && te instanceof TileEntityTurretBase) { - TileEntityTurretBase turret = (TileEntityTurretBase)te; + TileEntityTurretBase turret = (TileEntityTurretBase) te; if(!turret.isAI) { turret.rotationYaw = player.rotationYaw; turret.rotationPitch = player.rotationPitch; - + if(turret.rotationPitch < -60) turret.rotationPitch = -60; if(turret.rotationPitch > 30) turret.rotationPitch = 30; - + if(turret instanceof TileEntityTurretCheapo) { if(turret.rotationPitch < -30) turret.rotationPitch = -30; @@ -54,16 +63,56 @@ public class ItemTurretControl extends Item { } } } + + if(te != null && te instanceof TileEntityTurretBaseNT) { + TileEntityTurretBaseNT turret = (TileEntityTurretBaseNT) te; + + MovingObjectPosition pos = Library.rayTrace(player, 200, 1, true, true, false); + + if(pos == null) + pos = Library.rayTrace(player, 200, 1); + + if(pos != null) { + + Vec3 vecOrigin = Vec3.createVectorHelper(player.posX, player.posY + player.eyeHeight - player.getYOffset(), player.posZ); + Vec3 vecDestination = Vec3.createVectorHelper(pos.blockX, pos.blockY, pos.blockZ); + + //List list = world.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.addCoord(pos.blockX, pos.blockY, pos.blockZ).expand(1.0, 1.0, 1.0)); + List list = world.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.expand(200, 200, 200)); + + for(Entity e : list) { + + if (e.canBeCollidedWith() && e != player) { + + MovingObjectPosition mop = e.boundingBox.expand(0.2, 0.2, 0.2).calculateIntercept(vecOrigin, vecDestination); + + if(mop != null) { + + System.out.println(e.getCommandSenderName()); + pos = mop; + pos.typeOfHit = MovingObjectType.ENTITY; + pos.entityHit = e; + } + } + } + + if(pos.typeOfHit == MovingObjectType.ENTITY) { + turret.target = pos.entityHit; + turret.turnTowards(turret.getEntityPos(pos.entityHit)); + + } else { + turret.turnTowards(Vec3.createVectorHelper(pos.blockX + 0.5, pos.blockY + 0.5, pos.blockZ + 0.5)); + } + } + } } } } } - + @Override - public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) - { - if(itemstack.stackTagCompound != null) - { + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { + if(itemstack.stackTagCompound != null) { list.add("Linked to:"); list.add("X: " + String.valueOf(itemstack.stackTagCompound.getInteger("xCoord"))); list.add("Y: " + String.valueOf(itemstack.stackTagCompound.getInteger("yCoord"))); @@ -72,35 +121,61 @@ public class ItemTurretControl extends Item { list.add("Please select a turret."); } } - + @Override - public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) - { - if((p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) instanceof TurretBase)) - { - if(p_77648_1_.stackTagCompound != null) - { - p_77648_1_.stackTagCompound.setInteger("xCoord", p_77648_4_); - p_77648_1_.stackTagCompound.setInteger("yCoord", p_77648_5_); - p_77648_1_.stackTagCompound.setInteger("zCoord", p_77648_6_); - } else { - p_77648_1_.stackTagCompound = new NBTTagCompound(); - p_77648_1_.stackTagCompound.setInteger("xCoord", p_77648_4_); - p_77648_1_.stackTagCompound.setInteger("yCoord", p_77648_5_); - p_77648_1_.stackTagCompound.setInteger("zCoord", p_77648_6_); + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int fx, float fy, float fz, float f0) { + + if(world.getBlock(x, y, z) instanceof TurretBase) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); } - if(p_77648_3_.isRemote) - { - p_77648_2_.addChatMessage(new ChatComponentText("Turret Linked!")); + + stack.stackTagCompound.setInteger("xCoord", x); + stack.stackTagCompound.setInteger("yCoord", y); + stack.stackTagCompound.setInteger("zCoord", z); + + if(!world.isRemote) { + player.addChatMessage(new ChatComponentText("Turret Linked!")); } - p_77648_3_.playSoundAtEntity(p_77648_2_, "hbm:item.techBleep", 1.0F, 1.0F); - - return true; + world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F); + return true; } - - return false; - } + + if(world.getBlock(x, y, z) instanceof BlockDummyable) { + + int[] pos = ((BlockDummyable)world.getBlock(x, y, z)).findCore(world, x, y, z); + + if(pos == null) + return false; + + int ix = pos[0]; + int iy = pos[1]; + int iz = pos[2]; + + TileEntity te = world.getTileEntity(ix, iy, iz); + + if(te instanceof TileEntityTurretBaseNT) { + + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + + stack.stackTagCompound.setInteger("xCoord", ix); + stack.stackTagCompound.setInteger("yCoord", iy); + stack.stackTagCompound.setInteger("zCoord", iz); + + if(!world.isRemote) { + player.addChatMessage(new ChatComponentText("Turret Linked!")); + } + + world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F); + return true; + } + } + + return false; + } @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { @@ -113,23 +188,23 @@ public class ItemTurretControl extends Item { int j = this.getMaxItemUseDuration(stack) - i; ArrowLooseEvent event = new ArrowLooseEvent(player, stack, j); MinecraftForge.EVENT_BUS.post(event); - - j = event.charge; - + + j = event.charge; + if(stack.hasTagCompound()) { int x = stack.getTagCompound().getInteger("xCoord"); int y = stack.getTagCompound().getInteger("yCoord"); int z = stack.getTagCompound().getInteger("zCoord"); - + if(world.getBlock(x, y, z) instanceof TurretBase) { TileEntity te = world.getTileEntity(x, y, z); - + if(te != null && te instanceof TileEntityTurretBase) { - TileEntityTurretBase turret = (TileEntityTurretBase)te; + TileEntityTurretBase turret = (TileEntityTurretBase) te; if(!turret.isAI) { - ((TurretBase)world.getBlock(x, y, z)).executeReleaseAction(world, j, player.rotationYaw, player.rotationPitch, x, y, z); + ((TurretBase) world.getBlock(x, y, z)).executeReleaseAction(world, j, player.rotationYaw, player.rotationPitch, x, y, z); } } } @@ -153,28 +228,37 @@ public class ItemTurretControl extends Item { } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) - { + public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { World world = player.worldObj; - + if(stack.hasTagCompound()) { + int x = stack.getTagCompound().getInteger("xCoord"); int y = stack.getTagCompound().getInteger("yCoord"); int z = stack.getTagCompound().getInteger("zCoord"); - + if(world.getBlock(x, y, z) instanceof TurretBase) { TileEntity te = world.getTileEntity(x, y, z); - + if(te != null && te instanceof TileEntityTurretBase) { - TileEntityTurretBase turret = (TileEntityTurretBase)te; + TileEntityTurretBase turret = (TileEntityTurretBase) te; if(!turret.isAI && turret.ammo > 0) { - if(((TurretBase)world.getBlock(x, y, z)).executeHoldAction(world, stack.getMaxItemUseDuration() - count, player.rotationYaw, player.rotationPitch, x, y, z)) + if(((TurretBase) world.getBlock(x, y, z)).executeHoldAction(world, stack.getMaxItemUseDuration() - count, player.rotationYaw, player.rotationPitch, x, y, z)) turret.ammo--; } } } + + if(world.getTileEntity(x, y, z) instanceof TileEntityTurretBaseNT) { + + TileEntityTurretBaseNT turret = (TileEntityTurretBaseNT) world.getTileEntity(x, y, z); + + turret.manualSetup(); + if(!world.isRemote) + turret.updateFiringTick(); + } } } } diff --git a/src/main/java/com/hbm/items/weapon/ItemGrenade.java b/src/main/java/com/hbm/items/weapon/ItemGrenade.java index dc77cc385..5fe51a622 100644 --- a/src/main/java/com/hbm/items/weapon/ItemGrenade.java +++ b/src/main/java/com/hbm/items/weapon/ItemGrenade.java @@ -43,6 +43,7 @@ import com.hbm.entity.grenade.EntityGrenadeSmart; import com.hbm.entity.grenade.EntityGrenadeStrong; import com.hbm.entity.grenade.EntityGrenadeTau; import com.hbm.entity.grenade.EntityGrenadeZOMG; +import com.hbm.entity.grenade.EntityWastePearl; import com.hbm.items.ModItems; import net.minecraft.entity.player.EntityPlayer; @@ -198,6 +199,9 @@ public class ItemGrenade extends Item { if (this == ModItems.grenade_if_null) { p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFNull(p_77659_2_, p_77659_3_)); } + if (this == ModItems.nuclear_waste_pearl) { + p_77659_2_.spawnEntityInWorld(new EntityWastePearl(p_77659_2_, p_77659_3_)); + } } return p_77659_1_; diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 6d5e6b6bf..421ea4e89 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (3781)"; + public static final String VERSION = "1.0.27 BETA (3801)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 8d48ef492..1ef69b4ef 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -124,6 +124,7 @@ public class ClientProxy extends ServerProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretCIWS.class, new RenderCIWSTurret()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretCheapo.class, new RenderCheapoTurret()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretChekhov.class, new RenderTurretChekhov()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretFriendly.class, new RenderTurretFriendly()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretJeremy.class, new RenderTurretJeremy()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretTauon.class, new RenderTurretTauon()); //mines @@ -426,6 +427,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFSpark.class, new RenderSnowball(ModItems.grenade_if_spark)); RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFHopwire.class, new RenderSnowball(ModItems.grenade_if_hopwire)); RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFNull.class, new RenderSnowball(ModItems.grenade_if_null)); + RenderingRegistry.registerEntityRenderingHandler(EntityWastePearl.class, new RenderSnowball(ModItems.nuclear_waste_pearl)); //missiles RenderingRegistry.registerEntityRenderingHandler(EntityTestMissile.class, new RenderTestMissile()); RenderingRegistry.registerEntityRenderingHandler(EntityMissileCustom.class, new RenderMissileCustom()); @@ -873,14 +875,19 @@ public class ClientProxy extends ServerProxy { } if("largeexplode".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityLargeExplodeFX(man, world, x, y, z, 1.5F, 0.0F, 0.0F); + + + fx = new net.minecraft.client.particle.EntityLargeExplodeFX(man, world, x, y, z, data.getFloat("size"), 0.0F, 0.0F); float r = 1.0F - rand.nextFloat() * 0.2F; fx.setRBGColorF(1F * r, 0.9F * r, 0.5F * r); - net.minecraft.client.particle.EntityExplodeFX sec = new net.minecraft.client.particle.EntityExplodeFX(world, x, y, z, 0.0F, 0.0F, 0.0F); - float r2 = 1.0F - rand.nextFloat() * 0.5F; - sec.setRBGColorF(0.5F * r2, 0.5F * r2, 0.5F * r2); - Minecraft.getMinecraft().effectRenderer.addEffect(sec); + for(int i = 0; i < data.getByte("count"); i++) { + net.minecraft.client.particle.EntityExplodeFX sec = new net.minecraft.client.particle.EntityExplodeFX(world, x, y, z, 0.0F, 0.0F, 0.0F); + float r2 = 1.0F - rand.nextFloat() * 0.5F; + sec.setRBGColorF(0.5F * r2, 0.5F * r2, 0.5F * r2); + sec.multipleParticleScaleBy(i + 1); + Minecraft.getMinecraft().effectRenderer.addEffect(sec); + } } if(fx != null) @@ -1199,6 +1206,13 @@ public class ClientProxy extends ServerProxy { } } } + + if("tau".equals(type)) { + + for(int i = 0; i < data.getByte("count"); i++) + Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleSpark(world, x, y, z, rand.nextGaussian() * 0.05, 0.05, rand.nextGaussian() * 0.05)); + Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleHadron(man, world, x, y, z)); + } } @Override diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index ebf0cfb18..5a7053e7e 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -193,6 +193,7 @@ public class MainRegistry { public static Achievement digammaSee; public static Achievement digammaFeel; public static Achievement digammaKnow; + public static Achievement digammaKauaiMoho; public static int generalOverride = 0; public static int polaroidID = 1; @@ -453,6 +454,7 @@ public class MainRegistry { GameRegistry.registerTileEntity(TileEntityTurretChekhov.class, "tileentity_turret_chekhov"); GameRegistry.registerTileEntity(TileEntityTurretJeremy.class, "tileentity_turret_jeremy"); GameRegistry.registerTileEntity(TileEntityTurretTauon.class, "tileentity_turret_tauon"); + GameRegistry.registerTileEntity(TileEntityTurretFriendly.class, "tileentity_turret_friendly"); EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true); @@ -601,6 +603,7 @@ public class MainRegistry { EntityRegistry.registerModEntity(EntityCloudTom.class, "entity_moonstone_blast", 147, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityBeamVortex.class, "entity_vortex_beam", 148, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityFireworks.class, "entity_firework_ball", 149, this, 1000, 1, true); + EntityRegistry.registerModEntity(EntityWastePearl.class, "entity_waste_pearl", 150, this, 1000, 1, true); EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00); EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd); @@ -877,6 +880,12 @@ public class MainRegistry { return new EntityGrenadeIFNull(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); } }); + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.nuclear_waste_pearl, new BehaviorProjectileDispense() { + + protected IProjectile getProjectileEntity(World world, IPosition position) { + return new EntityWastePearl(world, position.getX(), position.getY(), position.getZ()); + } + }); } @EventHandler @@ -921,6 +930,7 @@ public class MainRegistry { digammaSee = new Achievement("achievement.digammaSee", "digammaSee", -2, 8, ModItems.digamma_see, null).initIndependentStat().registerStat(); digammaFeel = new Achievement("achievement.digammaFeel", "digammaFeel", 0, 8, ModItems.digamma_feel, digammaSee).initIndependentStat().registerStat(); digammaKnow = new Achievement("achievement.digammaKnow", "digammaKnow", 2, 8, ModItems.digamma_know, digammaFeel).initIndependentStat().registerStat().setSpecial(); + digammaKauaiMoho = new Achievement("achievement.digammaKauaiMoho", "digammaKauaiMoho", 4, 8, ModItems.digamma_kauai_moho, digammaKnow).initIndependentStat().registerStat().setSpecial(); AchievementPage.registerAchievementPage(new AchievementPage("Nuclear Tech", new Achievement[] { achSacrifice, @@ -956,7 +966,8 @@ public class MainRegistry { bossWorm, digammaSee, digammaFeel, - digammaKnow + digammaKnow, + digammaKauaiMoho })); // MUST be initialized AFTER achievements!! diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 4868fb4bd..e35c9de50 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -768,7 +768,7 @@ public class ModEventHandler } } - private static final String hash = "a4e6e2d37cc6bae3b19a925569c008d8f98b867e62ecb72398ee6fd5d7ee535a"; + private static final String hash = "41eb77f138ce350932e33b6b26b233df9aad0c0c80c6a49cb9a54ddd8fae3f83"; @SubscribeEvent public void onClickSign(PlayerInteractEvent event) { @@ -787,9 +787,9 @@ public class ModEventHandler if(result.equals(hash)) { world.func_147480_a(x, y, z, false); - EntityItem entityitem = new EntityItem(world, x, y, z, new ItemStack(ModItems.bobmazon_hidden)); - entityitem.delayBeforeCanPickup = 10; - world.spawnEntityInWorld(entityitem); + EntityItem entityitem = new EntityItem(world, x, y, z, new ItemStack(ModItems.bobmazon_hidden)); + entityitem.delayBeforeCanPickup = 10; + world.spawnEntityInWorld(entityitem); } } diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index f42016f47..e3858992b 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -264,7 +264,9 @@ public class ResourceManager { public static final ResourceLocation turret_cheapo_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_cheapo_gun.png"); public static final ResourceLocation turret_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/base.png"); + public static final ResourceLocation turret_base_friendly_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/base_friendly.png"); public static final ResourceLocation turret_carriage_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/carriage.png"); + public static final ResourceLocation turret_carriage_friendly_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/carriage_friendly.png"); public static final ResourceLocation turret_connector_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/connector.png"); public static final ResourceLocation turret_chekhov_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/chekhov.png"); public static final ResourceLocation turret_chekhov_barrels_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/chekhov_barrels.png"); diff --git a/src/main/java/com/hbm/particle/ParticleSpark.java b/src/main/java/com/hbm/particle/ParticleSpark.java new file mode 100644 index 000000000..386bd3678 --- /dev/null +++ b/src/main/java/com/hbm/particle/ParticleSpark.java @@ -0,0 +1,89 @@ +package com.hbm.particle; + +import java.util.ArrayList; +import java.util.List; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class ParticleSpark extends EntityFX { + + List steps = new ArrayList(); + int thresh; + + public ParticleSpark(World world, double x, double y, double z, double mX, double mY, double mZ) { + super(world, x, y, z, mX, mY, mZ); + thresh = 4 + rand.nextInt(3); + steps.add(new double[] { motionX, motionY, motionZ }); + this.particleMaxAge = 20 + rand.nextInt(10); + this.particleGravity = 0.5F; + } + + public int getFXLayer() { + return 3; + } + + public void onUpdate() { + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if(this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + steps.add(new double[] { motionX, motionY, motionZ }); + + while(steps.size() > thresh) + steps.remove(0); + + this.motionY -= 0.04D * (double) this.particleGravity; + double lastY = this.motionY; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if(this.onGround) { + this.onGround = false; + motionY = -lastY * 0.8D; + } + } + + public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) { + + if(steps.size() < 2) + return; + + GL11.glPushMatrix(); + + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glLineWidth(3F); + + float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX); + float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY); + float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ); + + tess.startDrawing(3); + tess.setBrightness(240); + tess.setColorOpaque_I(0xffffff); + + double[] prev = new double[] { pX, pY, pZ }; + + for(int i = 1; i < steps.size(); i++) { + + double[] curr = new double[] { prev[0] + steps.get(i)[0], prev[1] + steps.get(i)[1], prev[2] + steps.get(i)[2] }; + + tess.addVertex(prev[0], prev[1], prev[2]); + + prev = curr; + } + tess.draw(); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java b/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java index 9e60ea99c..db8b51aeb 100644 --- a/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java +++ b/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java @@ -8,12 +8,7 @@ import com.hbm.handler.BulletConfiguration; import com.hbm.lib.RefStrings; import com.hbm.main.ResourceManager; import com.hbm.render.model.ModelBaleflare; -import com.hbm.render.model.ModelBuckshot; import com.hbm.render.model.ModelBullet; -import com.hbm.render.model.ModelGrenade; -import com.hbm.render.model.ModelMIRV; -import com.hbm.render.model.ModelMiniNuke; -import com.hbm.render.model.ModelRocket; import com.hbm.render.util.RenderSparks; import net.minecraft.client.renderer.Tessellator; @@ -24,20 +19,10 @@ import net.minecraft.util.ResourceLocation; public class RenderBullet extends Render { private ModelBullet bullet; - private ModelBuckshot buckshot; - private ModelRocket rocket; - private ModelGrenade grenade; - private ModelMiniNuke nuke; - private ModelMIRV mirv; private ModelBaleflare bf; public RenderBullet() { bullet = new ModelBullet(); - buckshot = new ModelBuckshot(); - rocket = new ModelRocket(); - grenade = new ModelGrenade(); - nuke = new ModelMiniNuke(); - mirv = new ModelMIRV(); bf = new ModelBaleflare(); } @@ -62,6 +47,7 @@ public class RenderBullet extends Render { switch(style) { case BulletConfiguration.STYLE_NONE: break; case BulletConfiguration.STYLE_NORMAL: renderBullet(trail); break; + case BulletConfiguration.STYLE_PISTOL: renderPistol(trail); break; case BulletConfiguration.STYLE_BOLT: renderDart(trail, bullet.getEntityId()); break; case BulletConfiguration.STYLE_FLECHETTE: renderFlechette(); break; case BulletConfiguration.STYLE_FOLLY: renderBullet(trail); break; @@ -73,6 +59,7 @@ public class RenderBullet extends Render { case BulletConfiguration.STYLE_BF: renderNuke(2); break; case BulletConfiguration.STYLE_ORB: renderOrb(trail); break; case BulletConfiguration.STYLE_METEOR: renderMeteor(trail); break; + case BulletConfiguration.STYLE_APDS: renderAPDS(); break; default: renderBullet(trail); break; } @@ -102,6 +89,19 @@ public class RenderBullet extends Render { } + private void renderPistol(int type) { + + GL11.glScaled(0.5, 0.5, 0.5); + GL11.glRotated(90, 0, 0, 1); + GL11.glRotated(90, 0, 1, 0); + + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.bullet_pistol_tex); + ResourceManager.projectiles.renderPart("BulletPistol"); + GL11.glShadeModel(GL11.GL_FLAT); + + } + private void renderBuckshot() { GL11.glScaled(0.5, 0.5, 0.5); @@ -280,6 +280,18 @@ public class RenderBullet extends Render { GL11.glShadeModel(GL11.GL_FLAT); } + private void renderAPDS() { + + GL11.glScaled(2, 2, 2); + GL11.glRotated(90, 0, 0, 1); + GL11.glRotated(90, 0, 1, 0); + + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.flechette_tex); + ResourceManager.projectiles.renderPart("Flechette"); + GL11.glShadeModel(GL11.GL_FLAT); + } + private void renderDart(int style, int eID) { float red = 1F; diff --git a/src/main/java/com/hbm/render/item/ItemRenderLibrary.java b/src/main/java/com/hbm/render/item/ItemRenderLibrary.java index 332497ef6..12cee4552 100644 --- a/src/main/java/com/hbm/render/item/ItemRenderLibrary.java +++ b/src/main/java/com/hbm/render/item/ItemRenderLibrary.java @@ -815,6 +815,64 @@ public class ItemRenderLibrary { GL11.glTranslated(0, -1, 0); ResourceManager.solar_mirror.renderPart("Mirror"); }}); + + renderers.put(Item.getItemFromBlock(ModBlocks.turret_chekhov), new ItemRenderBase() { + public void renderInventory() { + GL11.glTranslated(0, -3, 0); + GL11.glScaled(4, 4, 4); + } + public void renderCommon() { + GL11.glTranslated(-0.75, 0, 0); + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.turret_base_tex); ResourceManager.turret_chekhov.renderPart("Base"); + bindTexture(ResourceManager.turret_carriage_tex); ResourceManager.turret_chekhov.renderPart("Carriage"); + bindTexture(ResourceManager.turret_chekhov_tex); ResourceManager.turret_chekhov.renderPart("Body"); + bindTexture(ResourceManager.turret_chekhov_barrels_tex); ResourceManager.turret_chekhov.renderPart("Barrels"); + GL11.glShadeModel(GL11.GL_FLAT); + }}); + + renderers.put(Item.getItemFromBlock(ModBlocks.turret_friendly), new ItemRenderBase() { + public void renderInventory() { + GL11.glTranslated(0, -3, 0); + GL11.glScaled(4, 4, 4); + } + public void renderCommon() { + GL11.glTranslated(-0.75, 0, 0); + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.turret_base_friendly_tex); ResourceManager.turret_chekhov.renderPart("Base"); + bindTexture(ResourceManager.turret_carriage_friendly_tex); ResourceManager.turret_chekhov.renderPart("Carriage"); + bindTexture(ResourceManager.turret_chekhov_tex); ResourceManager.turret_chekhov.renderPart("Body"); + bindTexture(ResourceManager.turret_chekhov_barrels_tex); ResourceManager.turret_chekhov.renderPart("Barrels"); + GL11.glShadeModel(GL11.GL_FLAT); + }}); + + renderers.put(Item.getItemFromBlock(ModBlocks.turret_jeremy), new ItemRenderBase() { + public void renderInventory() { + GL11.glTranslated(0, -2, 0); + GL11.glScaled(2.5, 2.5, 2.5); + } + public void renderCommon() { + GL11.glTranslated(-0.5, 0, 0); + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.turret_base_tex); ResourceManager.turret_chekhov.renderPart("Base"); + bindTexture(ResourceManager.turret_carriage_tex); ResourceManager.turret_chekhov.renderPart("Carriage"); + bindTexture(ResourceManager.turret_jeremy_tex); ResourceManager.turret_jeremy.renderPart("Gun"); + GL11.glShadeModel(GL11.GL_FLAT); + }}); + + renderers.put(Item.getItemFromBlock(ModBlocks.turret_tauon), new ItemRenderBase() { + public void renderInventory() { + GL11.glTranslated(0, -2, 0); + GL11.glScaled(5, 5, 5); + } + public void renderCommon() { + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.turret_base_tex); ResourceManager.turret_chekhov.renderPart("Base"); + bindTexture(ResourceManager.turret_carriage_tex); ResourceManager.turret_chekhov.renderPart("Carriage"); + bindTexture(ResourceManager.turret_tauon_tex); ResourceManager.turret_tauon.renderPart("Cannon"); + ResourceManager.turret_tauon.renderPart("Rotor"); + GL11.glShadeModel(GL11.GL_FLAT); + }}); } private static void bindTexture(ResourceLocation res) { diff --git a/src/main/java/com/hbm/render/tileentity/RenderTurretFriendly.java b/src/main/java/com/hbm/render/tileentity/RenderTurretFriendly.java new file mode 100644 index 000000000..37b200fe3 --- /dev/null +++ b/src/main/java/com/hbm/render/tileentity/RenderTurretFriendly.java @@ -0,0 +1,54 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.main.ResourceManager; +import com.hbm.tileentity.turret.TileEntityTurretChekhov; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Vec3; + +public class RenderTurretFriendly extends RenderTurretBase { + + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) { + + TileEntityTurretChekhov turret = (TileEntityTurretChekhov)te; + Vec3 pos = turret.getHorizontalOffset(); + + GL11.glPushMatrix(); + GL11.glTranslated(x + pos.xCoord, y, z + pos.zCoord); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glShadeModel(GL11.GL_SMOOTH); + + this.renderConnectors(turret, true, false, FluidType.NONE); + + bindTexture(ResourceManager.turret_base_friendly_tex); + ResourceManager.turret_chekhov.renderPart("Base"); + double yaw = -Math.toDegrees(turret.lastRotationYaw + (turret.rotationYaw - turret.lastRotationYaw) * interp) - 90D; + double pitch = Math.toDegrees(turret.lastRotationPitch + (turret.rotationPitch - turret.lastRotationPitch) * interp); + + GL11.glRotated(yaw, 0, 1, 0); + bindTexture(ResourceManager.turret_carriage_friendly_tex); + ResourceManager.turret_chekhov.renderPart("Carriage"); + + GL11.glTranslated(0, 1.5, 0); + GL11.glRotated(pitch, 0, 0, 1); + GL11.glTranslated(0, -1.5, 0); + bindTexture(ResourceManager.turret_chekhov_tex); + ResourceManager.turret_chekhov.renderPart("Body"); + + float rot = turret.lastSpin + (turret.spin - turret.lastSpin) * interp; + + GL11.glTranslated(0, 1.5, 0); + GL11.glRotated(rot, -1, 0, 0); + GL11.glTranslated(0, -1.5, 0); + bindTexture(ResourceManager.turret_chekhov_barrels_tex); + ResourceManager.turret_chekhov.renderPart("Barrels"); + + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/hbm/render/tileentity/RenderTurretTauon.java b/src/main/java/com/hbm/render/tileentity/RenderTurretTauon.java index 7cf0e84e4..12b3f205e 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderTurretTauon.java +++ b/src/main/java/com/hbm/render/tileentity/RenderTurretTauon.java @@ -44,18 +44,16 @@ public class RenderTurretTauon extends RenderTurretBase { bindTexture(ResourceManager.turret_tauon_tex); ResourceManager.turret_tauon.renderPart("Cannon"); - if(turret.target != null && turret.aligned && System.currentTimeMillis() % 500 < 200) { + if(turret.beam > 0) { GL11.glPushMatrix(); GL11.glTranslated(0, 1.5D, 0); - Vec3 pos = turret.getTurretPos(); - Vec3 ent = turret.getEntityPos(turret.target); - double length = Vec3.createVectorHelper(ent.xCoord - pos.xCoord, ent.yCoord - pos.yCoord, ent.zCoord - pos.zCoord).lengthVector(); - BeamPronter.prontBeam(Vec3.createVectorHelper(length, 0, 0), EnumWaveType.RANDOM, EnumBeamType.LINE, 0xffa200, 0xffd000, (int)te.getWorldObj().getTotalWorldTime() / 5 % 360, (int)length + 1, 0.1F, 0, 0); + BeamPronter.prontBeam(Vec3.createVectorHelper(turret.lastDist, 0, 0), EnumWaveType.RANDOM, EnumBeamType.LINE, 0xffa200, 0xffd000, (int)te.getWorldObj().getTotalWorldTime() / 5 % 360, (int)turret.lastDist + 1, 0.1F, 0, 0); GL11.glPopMatrix(); } + float rot = turret.lastSpin + (turret.spin - turret.lastSpin) * interp; GL11.glTranslated(0, 1.375, 0); - GL11.glRotated((te.getWorldObj().getTotalWorldTime() + interp) * 40, -1, 0, 0); + GL11.glRotated(rot, -1, 0, 0); GL11.glTranslated(0, -1.375, 0); ResourceManager.turret_tauon.renderPart("Rotor"); diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java index fc69b4e99..f80ba2e31 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java @@ -123,6 +123,8 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple nbt.setInteger("stattrak", this.stattrak); } + public void manualSetup() { } + @Override public void updateEntity() { @@ -393,13 +395,19 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple * Assumes that the target is not null */ protected void alignTurret() { + this.turnTowards(this.getEntityPos(target)); + } + + /** + * Turns the turret towards the specified position + */ + public void turnTowards(Vec3 ent) { double turnYaw = Math.toRadians(this.getTurretYawSpeed()); double turnPitch = Math.toRadians(this.getTurretPitchSpeed()); double pi2 = Math.PI * 2; Vec3 pos = this.getTurretPos(); - Vec3 ent = this.getEntityPos(target); Vec3 delta = Vec3.createVectorHelper(ent.xCoord - pos.xCoord, ent.yCoord - pos.yCoord, ent.zCoord - pos.zCoord); double targetPitch = Math.asin(delta.yCoord / delta.lengthVector()); @@ -463,8 +471,9 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple Vec3 pos = this.getTurretPos(); Vec3 ent = this.getEntityPos(e); Vec3 delta = Vec3.createVectorHelper(ent.xCoord - pos.xCoord, ent.yCoord - pos.yCoord, ent.zCoord - pos.zCoord); + double length = delta.lengthVector(); - if(delta.lengthVector() < this.getDecetorGrace()) + if(length < this.getDecetorGrace()) return false; delta = delta.normalize(); @@ -475,8 +484,19 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple if(pitchDeg < -this.getTurretDepression() || pitchDeg > this.getTurretElevation()) return false; - //TODO: figure out why this shit apparently doesn't work - return !Library.isObstructed(worldObj, pos.xCoord, pos.yCoord, pos.zCoord, ent.xCoord, ent.yCoord, ent.zCoord); + /*for(double i = 0; i < length; i += 0.25D) { + + double x = pos.xCoord + delta.xCoord * i; + double y = pos.yCoord + delta.yCoord * i; + double z = pos.zCoord + delta.zCoord * i; + + worldObj.spawnParticle("reddust", x, y, z, 0, 0, 0); + } + + worldObj.spawnParticle("cloud", pos.xCoord, pos.yCoord, pos.zCoord, 0, 0.1, 0); + worldObj.spawnParticle("flame", ent.xCoord, ent.yCoord, ent.zCoord, 0, 0.1, 0);*/ + + return !Library.isObstructed(worldObj, ent.xCoord, ent.yCoord, ent.zCoord, pos.xCoord, pos.yCoord, pos.zCoord); } /** diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretChekhov.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretChekhov.java index 9bf911235..1cfc73152 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretChekhov.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretChekhov.java @@ -55,6 +55,11 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT { public double getBarrelLength() { return 3.5D; } + + @Override + public double getAcceptableInaccuracy() { + return 15; + } int timer; @@ -63,7 +68,7 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT { timer++; - if(timer > 20 && timer % 2 == 0) { + if(timer > 20 && timer % getDelay() == 0) { BulletConfiguration conf = this.getFirstConfigLoaded(); @@ -80,14 +85,21 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT { NBTTagCompound data = new NBTTagCompound(); data.setString("type", "vanillaExt"); data.setString("mode", "largeexplode"); + data.setFloat("size", 1.5F); + data.setByte("count", (byte)1); PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); } } } + public int getDelay() { + return 2; + } + public float spin; public float lastSpin; private float accel; + private boolean manual; @Override public void updateEntity() { @@ -95,12 +107,14 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT { if(worldObj.isRemote) { - if(this.target != null) { + if(this.target != null || manual) { this.accel = Math.min(45F, this.accel += 2); } else { this.accel = Math.max(0F, this.accel -= 2); } + manual = false; + this.lastSpin = this.spin; this.spin += this.accel; @@ -110,7 +124,7 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT { } } else { - if(this.target == null) { + if(this.target == null && !manual) { this.timer--; @@ -122,4 +136,10 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT { } } } + + @Override + public void manualSetup() { + + manual = true; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFriendly.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFriendly.java new file mode 100644 index 000000000..cadfc4c94 --- /dev/null +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFriendly.java @@ -0,0 +1,34 @@ +package com.hbm.tileentity.turret; + +import java.util.ArrayList; +import java.util.List; + +import com.hbm.handler.BulletConfigSyncingUtil; + +public class TileEntityTurretFriendly extends TileEntityTurretChekhov { + + static List configs = new ArrayList(); + + static { + configs.add(BulletConfigSyncingUtil.R5_NORMAL); + configs.add(BulletConfigSyncingUtil.R5_EXPLOSIVE); + configs.add(BulletConfigSyncingUtil.R5_DU); + configs.add(BulletConfigSyncingUtil.R5_STAR); + configs.add(BulletConfigSyncingUtil.CHL_R5); + } + + @Override + protected List getAmmoList() { + return configs; + } + + @Override + public String getName() { + return "container.turretFriendly"; + } + + @Override + public int getDelay() { + return 5; + } +} diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretJeremy.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretJeremy.java index f2240e904..feddb8f2c 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretJeremy.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretJeremy.java @@ -1,27 +1,47 @@ package com.hbm.tileentity.turret; +import java.util.ArrayList; import java.util.List; +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.BulletConfiguration; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Vec3; + public class TileEntityTurretJeremy extends TileEntityTurretBaseNT { + static List configs = new ArrayList(); + + static { + configs.add(BulletConfigSyncingUtil.SHELL_NORMAL); + configs.add(BulletConfigSyncingUtil.SHELL_EXPLOSIVE); + configs.add(BulletConfigSyncingUtil.SHELL_AP); + configs.add(BulletConfigSyncingUtil.SHELL_DU); + configs.add(BulletConfigSyncingUtil.SHELL_W9); + } + @Override protected List getAmmoList() { - return null; + return configs; } @Override public String getName() { - return null; + return "container.turretJeremy"; } @Override public double getDecetorGrace() { - return 10D; + return 16D; } @Override public double getTurretDepression() { - return 35D; + return 45D; } @Override @@ -29,8 +49,58 @@ public class TileEntityTurretJeremy extends TileEntityTurretBaseNT { return 10000; } + @Override + public double getBarrelLength() { + return 4.25D; + } + + @Override + public double getDecetorRange() { + return 80D; + } + + int timer; + int reload; + + @Override + public void updateEntity() { + + if(reload > 0) + reload--; + + if(reload == 1) + this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.jeremy_reload", 2.0F, 1.0F); + + super.updateEntity(); + } + @Override public void updateFiringTick() { + timer++; + + if(timer % 40 == 0) { + + BulletConfiguration conf = this.getFirstConfigLoaded(); + + if(conf != null) { + this.spawnBullet(conf); + this.conusmeAmmo(conf.ammo); + this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.jeremy_fire", 4.0F, 1.0F); + Vec3 pos = this.getTurretPos(); + Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0); + vec.rotateAroundZ((float) -this.rotationPitch); + vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5)); + + reload = 20; + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "vanillaExt"); + data.setString("mode", "largeexplode"); + data.setFloat("size", 0F); + data.setByte("count", (byte)5); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); + } + } } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java index 571ac1575..c10dd3b8b 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java @@ -1,22 +1,39 @@ package com.hbm.tileentity.turret; +import java.util.ArrayList; import java.util.List; +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.BulletConfiguration; +import com.hbm.lib.ModDamageSource; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Vec3; + public class TileEntityTurretTauon extends TileEntityTurretBaseNT { + static List configs = new ArrayList(); + + static { + configs.add(BulletConfigSyncingUtil.SPECIAL_GAUSS); + } + @Override protected List getAmmoList() { - return null; + return configs; } @Override public String getName() { - return null; + return "container.turretTauon"; } @Override public double getDecetorGrace() { - return 7D; + return 3D; } @Override @@ -39,13 +56,98 @@ public class TileEntityTurretTauon extends TileEntityTurretBaseNT { return 35D; } + @Override + public double getDecetorRange() { + return 128D; + } + + @Override + public double getBarrelLength() { + return 2.0D - 0.0625D; + } + @Override public long getMaxPower() { - return 10000; + return 100000; + } + + @Override + public long getConsumption() { + return 1000; + } + + int timer; + public int beam; + public float spin; + public float lastSpin; + public double lastDist; + + @Override + public void updateEntity() { + + if(worldObj.isRemote) { + + if(this.target != null) { + Vec3 pos = this.getTurretPos(); + Vec3 ent = this.getEntityPos(this.target); + double length = Vec3.createVectorHelper(ent.xCoord - pos.xCoord, ent.yCoord - pos.yCoord, ent.zCoord - pos.zCoord).lengthVector(); + this.lastDist = length; + } + + if(beam > 0) + beam--; + + this.lastSpin = this.spin; + + if(this.target != null) { + this.spin += 45; + } + + if(this.spin >= 360F) { + this.spin -= 360F; + this.lastSpin -= 360F; + } + } + + super.updateEntity(); } @Override public void updateFiringTick() { + timer++; + + if(timer % 5 == 0) { + + BulletConfiguration conf = this.getFirstConfigLoaded(); + + if(conf != null && this.target != null) { + this.target.attackEntityFrom(ModDamageSource.electricity, 30F + worldObj.rand.nextInt(11)); + this.conusmeAmmo(conf.ammo); + this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:weapon.tauShoot", 4.0F, 0.9F + worldObj.rand.nextFloat() * 0.3F); + + NBTTagCompound data = new NBTTagCompound(); + data.setBoolean("shot", true); + this.networkPack(data, 250);Vec3 pos = this.getTurretPos(); + + Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0); + vec.rotateAroundZ((float) -this.rotationPitch); + vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5)); + + NBTTagCompound dPart = new NBTTagCompound(); + dPart.setString("type", "tau"); + dPart.setByte("count", (byte)5); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(dPart, pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); + } + } + } + + @Override + public void networkUnpack(NBTTagCompound nbt) { + + if(nbt.hasKey("shot")) + beam = 3; + else + super.networkUnpack(nbt); } } diff --git a/src/main/java/com/hbm/world/dungeon/AncientTomb.java b/src/main/java/com/hbm/world/dungeon/AncientTomb.java index 2d90117e8..c319fa4b2 100644 --- a/src/main/java/com/hbm/world/dungeon/AncientTomb.java +++ b/src/main/java/com/hbm/world/dungeon/AncientTomb.java @@ -127,11 +127,6 @@ public class AncientTomb { sVec.rotateAroundY(sRot); } - /// PRINT ACCESS /// - DungeonToolbox.generateBox(world, x + 4, y - 2, z - 1, 5, 1, 3, concrete); - DungeonToolbox.generateBox(world, x + 4, y - 1, z - 1, 5, 3, 3, ModBlocks.gas_radon_tomb); - DungeonToolbox.generateBox(world, x + 4, y + 2, z - 1, 5, 1, 3, concrete); - for(int dx = x + 4; dx < x + 8; dx++) { for(int dy = y - 1; dy < y + 4; dy++) { for(int dz = z - 2; dz < z + 3; dz++) { @@ -174,6 +169,9 @@ public class AncientTomb { DungeonToolbox.generateBox(world, x - core, y - core, z - core, dimCore, dimCore, dimCore, ModBlocks.ancient_scrap); - world.setBlock(x + size, y, z, ModBlocks.brick_concrete_marked); + /// PRINT ACCESS /// + DungeonToolbox.generateBox(world, x + 6, y - 2, z - 1, 2, 1, 3, concrete); + DungeonToolbox.generateBox(world, x + 4, y - 1, z - 1, 5, 3, 3, ModBlocks.gas_radon_tomb); + DungeonToolbox.generateBox(world, x + 6, y + 2, z - 1, 2, 1, 3, concrete); } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 6ce332ca6..fc6ce7ac1 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "hbm", "name": "Hbm's Nuclear Tech", "description": "A mod that adds weapons, nuclear themed stuff and machines", - "version":"1.0.27-3781", + "version":"1.0.27-3801", "mcversion": "1.7.10", "url": "", "updateUrl": "",