diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index ccdb06584..50031cc17 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -1383,6 +1383,12 @@ item.ammo_rocket_incendiary.name=84mm Rakete (Brand) item.ammo_rocket_shrapnel.name=84mm Rakete (Schrapnell) item.ammo_rocket_emp.name=84mm Rakete (Impuls) item.ammo_rocket_glare.name=84mm Rakete (Roter Schein) +item.ammo_rocket_sleek.name=84mm Rakete (IF-R&D) +item.ammo_grenade.name=40mm Granate +item.ammo_grenade_he.name=40mm Granate (HE) +item.ammo_grenade_incendiary.name=40mm Granate (Brand) +item.ammo_grenade_toxic.name=40mm Granate (Chemisch) +item.ammo_grenade_sleek.name=40mm Granate (IF-F&E) item.folly_shell.name=Silberne Kanonenhülse item.folly_bullet.name=12,8cm Sternenmetall-Hochenergiegeschoss diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 65434cbc8..208c2cd4f 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -1383,6 +1383,12 @@ item.ammo_rocket_incendiary.name=84mm Rocket (Incendiary) item.ammo_rocket_shrapnel.name=84mm Rocket (Shrapnel) item.ammo_rocket_emp.name=84mm Rocket (Pulse) item.ammo_rocket_glare.name=84mm Rocket (Red Glare) +item.ammo_rocket_sleek.name=84mm Rocket (IF-R&D) +item.ammo_grenade.name=40mm Grenade +item.ammo_grenade_he.name=40mm Grenade (HE) +item.ammo_grenade_incendiary.name=40mm Grenade (Incendiary) +item.ammo_grenade_toxic.name=40mm Grenade (Chemical) +item.ammo_grenade_sleek.name=40mm Grenade (IF-R&D) item.folly_shell.name=Silver Bullet Casing item.folly_bullet.name=12.8cm Starmetal High-Energy Shell diff --git a/assets/hbm/textures/blocks/chlorine_gas.png b/assets/hbm/textures/blocks/chlorine_gas.png new file mode 100644 index 000000000..ee75f37c8 Binary files /dev/null and b/assets/hbm/textures/blocks/chlorine_gas.png differ diff --git a/assets/hbm/textures/blocks/vent_chlorine_seal_side.png b/assets/hbm/textures/blocks/vent_chlorine_seal_side.png new file mode 100644 index 000000000..58aca274a Binary files /dev/null and b/assets/hbm/textures/blocks/vent_chlorine_seal_side.png differ diff --git a/assets/hbm/textures/blocks/vent_chlorine_seal_top.png b/assets/hbm/textures/blocks/vent_chlorine_seal_top.png new file mode 100644 index 000000000..f853a0a42 Binary files /dev/null and b/assets/hbm/textures/blocks/vent_chlorine_seal_top.png differ diff --git a/assets/hbm/textures/entity/ModelGrenade.png b/assets/hbm/textures/entity/ModelGrenade.png new file mode 100644 index 000000000..519dd733d Binary files /dev/null and b/assets/hbm/textures/entity/ModelGrenade.png differ diff --git a/assets/hbm/textures/entity/ModelGrenadeHE.png b/assets/hbm/textures/entity/ModelGrenadeHE.png new file mode 100644 index 000000000..870b02d13 Binary files /dev/null and b/assets/hbm/textures/entity/ModelGrenadeHE.png differ diff --git a/assets/hbm/textures/entity/ModelGrenadeIncendiary.png b/assets/hbm/textures/entity/ModelGrenadeIncendiary.png new file mode 100644 index 000000000..3d175b379 Binary files /dev/null and b/assets/hbm/textures/entity/ModelGrenadeIncendiary.png differ diff --git a/assets/hbm/textures/entity/ModelGrenadeSleek.png b/assets/hbm/textures/entity/ModelGrenadeSleek.png new file mode 100644 index 000000000..581649526 Binary files /dev/null and b/assets/hbm/textures/entity/ModelGrenadeSleek.png differ diff --git a/assets/hbm/textures/entity/ModelGrenadeToxic.png b/assets/hbm/textures/entity/ModelGrenadeToxic.png new file mode 100644 index 000000000..cd1064afc Binary files /dev/null and b/assets/hbm/textures/entity/ModelGrenadeToxic.png differ diff --git a/assets/hbm/textures/models/ModelRocket.png b/assets/hbm/textures/entity/ModelRocket.png similarity index 100% rename from assets/hbm/textures/models/ModelRocket.png rename to assets/hbm/textures/entity/ModelRocket.png diff --git a/assets/hbm/textures/models/ModelRocketEMP.png b/assets/hbm/textures/entity/ModelRocketEMP.png similarity index 100% rename from assets/hbm/textures/models/ModelRocketEMP.png rename to assets/hbm/textures/entity/ModelRocketEMP.png diff --git a/assets/hbm/textures/models/ModelRocketGlare.png b/assets/hbm/textures/entity/ModelRocketGlare.png similarity index 100% rename from assets/hbm/textures/models/ModelRocketGlare.png rename to assets/hbm/textures/entity/ModelRocketGlare.png diff --git a/assets/hbm/textures/models/ModelRocketHE.png b/assets/hbm/textures/entity/ModelRocketHE.png similarity index 100% rename from assets/hbm/textures/models/ModelRocketHE.png rename to assets/hbm/textures/entity/ModelRocketHE.png diff --git a/assets/hbm/textures/models/ModelRocketIncendiary.png b/assets/hbm/textures/entity/ModelRocketIncendiary.png similarity index 100% rename from assets/hbm/textures/models/ModelRocketIncendiary.png rename to assets/hbm/textures/entity/ModelRocketIncendiary.png diff --git a/assets/hbm/textures/models/ModelRocketShrapnel.png b/assets/hbm/textures/entity/ModelRocketShrapnel.png similarity index 100% rename from assets/hbm/textures/models/ModelRocketShrapnel.png rename to assets/hbm/textures/entity/ModelRocketShrapnel.png diff --git a/assets/hbm/textures/models/ModelRocketSleek.png b/assets/hbm/textures/entity/ModelRocketSleek.png similarity index 100% rename from assets/hbm/textures/models/ModelRocketSleek.png rename to assets/hbm/textures/entity/ModelRocketSleek.png diff --git a/assets/hbm/textures/entity/buckshot.png b/assets/hbm/textures/entity/buckshot.png new file mode 100644 index 000000000..4fd134e2c Binary files /dev/null and b/assets/hbm/textures/entity/buckshot.png differ diff --git a/assets/hbm/textures/entity/bullet.png b/assets/hbm/textures/entity/bullet.png new file mode 100644 index 000000000..2c6c09f0d Binary files /dev/null and b/assets/hbm/textures/entity/bullet.png differ diff --git a/assets/hbm/textures/gui/centrifuge.png b/assets/hbm/textures/gui/centrifuge.png index 36d371254..f369d74b9 100644 Binary files a/assets/hbm/textures/gui/centrifuge.png and b/assets/hbm/textures/gui/centrifuge.png differ diff --git a/assets/hbm/textures/items/ammo_grenade.png b/assets/hbm/textures/items/ammo_grenade.png new file mode 100644 index 000000000..6329ca5d8 Binary files /dev/null and b/assets/hbm/textures/items/ammo_grenade.png differ diff --git a/assets/hbm/textures/items/ammo_grenade_FG.png b/assets/hbm/textures/items/ammo_grenade_FG.png new file mode 100644 index 000000000..78f0f9ed9 Binary files /dev/null and b/assets/hbm/textures/items/ammo_grenade_FG.png differ diff --git a/assets/hbm/textures/items/ammo_grenade_he.png b/assets/hbm/textures/items/ammo_grenade_he.png new file mode 100644 index 000000000..3bad60f64 Binary files /dev/null and b/assets/hbm/textures/items/ammo_grenade_he.png differ diff --git a/assets/hbm/textures/items/ammo_grenade_incendiary.png b/assets/hbm/textures/items/ammo_grenade_incendiary.png new file mode 100644 index 000000000..273d30508 Binary files /dev/null and b/assets/hbm/textures/items/ammo_grenade_incendiary.png differ diff --git a/assets/hbm/textures/items/ammo_grenade_sleek.png b/assets/hbm/textures/items/ammo_grenade_sleek.png new file mode 100644 index 000000000..405e4b007 Binary files /dev/null and b/assets/hbm/textures/items/ammo_grenade_sleek.png differ diff --git a/assets/hbm/textures/items/ammo_grenade_toxic.png b/assets/hbm/textures/items/ammo_grenade_toxic.png new file mode 100644 index 000000000..cf1e8c551 Binary files /dev/null and b/assets/hbm/textures/items/ammo_grenade_toxic.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_sleek.png b/assets/hbm/textures/items/ammo_rocket_sleek.png new file mode 100644 index 000000000..748fb0a4f Binary files /dev/null and b/assets/hbm/textures/items/ammo_rocket_sleek.png differ diff --git a/assets/hbm/textures/items/assembly_lacunae.png b/assets/hbm/textures/items/assembly_lacunae.png index fdd2299c6..df7b519ba 100644 Binary files a/assets/hbm/textures/items/assembly_lacunae.png and b/assets/hbm/textures/items/assembly_lacunae.png differ diff --git a/assets/hbm/textures/items/assembly_smg.png b/assets/hbm/textures/items/assembly_smg.png index aea5e8e32..9580c6732 100644 Binary files a/assets/hbm/textures/items/assembly_smg.png and b/assets/hbm/textures/items/assembly_smg.png differ diff --git a/com/hbm/entity/grenade/EntityGrenadeIFMystery.java b/com/hbm/entity/grenade/EntityGrenadeIFMystery.java index 18370d4af..a672752a2 100644 --- a/com/hbm/entity/grenade/EntityGrenadeIFMystery.java +++ b/com/hbm/entity/grenade/EntityGrenadeIFMystery.java @@ -1,5 +1,6 @@ package com.hbm.entity.grenade; +import com.hbm.explosion.ExplosionChaos; import com.hbm.items.ModItems; import com.hbm.items.weapon.ItemGrenade; @@ -31,6 +32,8 @@ public class EntityGrenadeIFMystery extends EntityGrenadeBouncyBase { this.setDead(); worldObj.newExplosion(this, posX, posY, posZ, 10, false, false); + + ExplosionChaos.spawnVolley(worldObj, posX, posY, posZ, 100, 1.0D); } } diff --git a/com/hbm/entity/projectile/EntityBulletBase.java b/com/hbm/entity/projectile/EntityBulletBase.java index 1ca20c09c..4a3728e2d 100644 --- a/com/hbm/entity/projectile/EntityBulletBase.java +++ b/com/hbm/entity/projectile/EntityBulletBase.java @@ -226,10 +226,13 @@ public class EntityBulletBase extends Entity implements IProjectile { //handle block collision } else { - if(!config.isSpectral && !config.doesRicochet) + boolean hRic = rand.nextInt(100) < config.HBRC; + boolean doesRic = config.doesRicochet || hRic; + + if(!config.isSpectral && !doesRic) this.setDead(); - if(config.doesRicochet) { + if(doesRic) { Vec3 face = null; @@ -252,10 +255,11 @@ public class EntityBulletBase extends Entity implements IProjectile { Vec3 vel = Vec3.createVectorHelper(motionX, motionY, motionZ); vel.normalize(); - + + boolean lRic = rand.nextInt(100) < config.LBRC; double angle = Math.abs(VectorUtil.getCrossAngle(vel, face) - 90); - if(angle <= 10000) { + if(hRic || (angle <= config.ricochetAngle && lRic)) { switch(movement.sideHit) { case 0: case 1: @@ -281,9 +285,9 @@ public class EntityBulletBase extends Entity implements IProjectile { this.posY += (movement.hitVec.yCoord - this.posY) * 0.6; this.posZ += (movement.hitVec.zCoord - this.posZ) * 0.6; - this.motionX *= 0.8; - this.motionY *= 0.8; - this.motionZ *= 0.8; + this.motionX *= config.bounceMod; + this.motionY *= config.bounceMod; + this.motionZ *= config.bounceMod; didBounce = true; } diff --git a/com/hbm/explosion/ExplosionChaos.java b/com/hbm/explosion/ExplosionChaos.java index f94c79db0..f7e7a840f 100644 --- a/com/hbm/explosion/ExplosionChaos.java +++ b/com/hbm/explosion/ExplosionChaos.java @@ -379,6 +379,21 @@ public class ExplosionChaos { } } + public static void spawnVolley(World world, double x, double y, double z, int count, double speed) { + + for(int i = 0; i < count; i++) { + + EntityModFX fx = new EntityOrangeFX(world, x, y, z, 0.0, 0.0, 0.0); + + fx.motionX = rand.nextGaussian() * speed; + fx.motionZ = rand.nextGaussian() * speed; + + fx.motionY = rand.nextDouble() * speed * 7.5D; + + world.spawnEntityInWorld(fx); + } + } + public static void destruction(World world, int x, int y, int z) { if (world.getBlock(x, y, z) == Blocks.bedrock || world.getBlock(x, y, z) == ModBlocks.reinforced_brick diff --git a/com/hbm/handler/BulletConfigFactory.java b/com/hbm/handler/BulletConfigFactory.java index 0bd0d4cbb..84d11830a 100644 --- a/com/hbm/handler/BulletConfigFactory.java +++ b/com/hbm/handler/BulletConfigFactory.java @@ -24,6 +24,9 @@ public class BulletConfigFactory { bullet.maxAge = 100; bullet.doesRicochet = true; bullet.ricochetAngle = 10; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 0.8; bullet.doesPenetrate = true; bullet.doesBreakGlass = true; bullet.incendiary = 0; @@ -52,6 +55,9 @@ public class BulletConfigFactory { bullet.maxAge = 100; bullet.doesRicochet = true; bullet.ricochetAngle = 5; + bullet.HBRC = 2; + bullet.LBRC = 95; + bullet.bounceMod = 0.8; bullet.doesPenetrate = true; bullet.doesBreakGlass = true; bullet.incendiary = 0; @@ -61,8 +67,8 @@ public class BulletConfigFactory { bullet.boxcar = false; bullet.boat = false; bullet.destroysBlocks = false; - bullet.style = 0; - bullet.plink = 1; + bullet.style = BulletConfiguration.STYLE_NORMAL; + bullet.plink = BulletConfiguration.PLINK_BULLET; bullet.instakill = false; return bullet; @@ -77,7 +83,10 @@ public class BulletConfigFactory { bullet.gravity = 0D; bullet.maxAge = 100; bullet.doesRicochet = true; - bullet.ricochetAngle = 3; + bullet.ricochetAngle = 5; + bullet.HBRC = 10; + bullet.LBRC = 95; + bullet.bounceMod = 0.8; bullet.doesPenetrate = false; bullet.doesBreakGlass = true; bullet.incendiary = 0; @@ -87,8 +96,8 @@ public class BulletConfigFactory { bullet.boxcar = false; bullet.boat = false; bullet.destroysBlocks = false; - bullet.style = 0; - bullet.plink = 1; + bullet.style = BulletConfiguration.STYLE_PELLET; + bullet.plink = BulletConfiguration.PLINK_BULLET; bullet.instakill = false; return bullet; diff --git a/com/hbm/handler/BulletConfiguration.java b/com/hbm/handler/BulletConfiguration.java index b5ac40d19..8ba73b2f0 100644 --- a/com/hbm/handler/BulletConfiguration.java +++ b/com/hbm/handler/BulletConfiguration.java @@ -29,6 +29,12 @@ public class BulletConfiguration { public boolean doesRicochet; //the maximum angle at which the projectile should bounce public double ricochetAngle; + //lower bound ricochet chance (below R angle) + public int LBRC; + //higher bound ricochet chance (above R angle) + public int HBRC; + //how much of the initial velocity is kept after bouncing + public double bounceMod; //whether or not the bullet should penetrate mobs public boolean doesPenetrate; @@ -65,6 +71,7 @@ public class BulletConfiguration { 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 PLINK_NONE = 0; public static final int PLINK_BULLET = 1; diff --git a/com/hbm/handler/GunConfiguration.java b/com/hbm/handler/GunConfiguration.java index 0e7d27e5a..fec75b1d2 100644 --- a/com/hbm/handler/GunConfiguration.java +++ b/com/hbm/handler/GunConfiguration.java @@ -12,6 +12,8 @@ public class GunConfiguration { * restrictions must be applied in gun's logic, mechanism may be dysfunctional if these rules are ignored */ + //TODO: bind RoF and spread to ammo + //amount of ticks between each bullet public int rateOfFire; //greatest amount of pellets created each shot diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 9b1418c66..89fca295f 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -842,6 +842,12 @@ public class ModItems { public static Item ammo_rocket_shrapnel; public static Item ammo_rocket_emp; public static Item ammo_rocket_glare; + public static Item ammo_rocket_sleek; + public static Item ammo_grenade; + public static Item ammo_grenade_he; + public static Item ammo_grenade_incendiary; + public static Item ammo_grenade_toxic; + public static Item ammo_grenade_sleek; public static Item gun_rpg; public static Item gun_rpg_ammo; @@ -2280,6 +2286,12 @@ public class ModItems { ammo_rocket_shrapnel = new Item().setUnlocalizedName("ammo_rocket_shrapnel").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_rocket_shrapnel"); ammo_rocket_emp = new Item().setUnlocalizedName("ammo_rocket_emp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_rocket_emp"); ammo_rocket_glare = new Item().setUnlocalizedName("ammo_rocket_glare").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_rocket_glare"); + ammo_rocket_sleek = new Item().setUnlocalizedName("ammo_rocket_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_rocket_sleek"); + ammo_grenade = new Item().setUnlocalizedName("ammo_grenade").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_grenade"); + ammo_grenade_he = new Item().setUnlocalizedName("ammo_grenade_he").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_grenade_he"); + ammo_grenade_incendiary = new Item().setUnlocalizedName("ammo_grenade_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_grenade_incendiary"); + ammo_grenade_toxic = new Item().setUnlocalizedName("ammo_grenade_toxic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_grenade_toxic"); + ammo_grenade_sleek = new Item().setUnlocalizedName("ammo_grenade_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_grenade_sleek"); gun_rpg = new GunRpg().setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg_new"); gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_alt"); @@ -4005,6 +4017,12 @@ public class ModItems { GameRegistry.registerItem(ammo_rocket_shrapnel, ammo_rocket_shrapnel.getUnlocalizedName()); GameRegistry.registerItem(ammo_rocket_emp, ammo_rocket_emp.getUnlocalizedName()); GameRegistry.registerItem(ammo_rocket_glare, ammo_rocket_glare.getUnlocalizedName()); + GameRegistry.registerItem(ammo_rocket_sleek, ammo_rocket_sleek.getUnlocalizedName()); + GameRegistry.registerItem(ammo_grenade, ammo_grenade.getUnlocalizedName()); + GameRegistry.registerItem(ammo_grenade_he, ammo_grenade_he.getUnlocalizedName()); + GameRegistry.registerItem(ammo_grenade_incendiary, ammo_grenade_incendiary.getUnlocalizedName()); + GameRegistry.registerItem(ammo_grenade_toxic, ammo_grenade_toxic.getUnlocalizedName()); + GameRegistry.registerItem(ammo_grenade_sleek, ammo_grenade_sleek.getUnlocalizedName()); GameRegistry.registerItem(ammo_folly, ammo_folly.getUnlocalizedName()); GameRegistry.registerItem(ammo_folly_nuclear, ammo_folly_nuclear.getUnlocalizedName()); GameRegistry.registerItem(ammo_folly_du, ammo_folly_du.getUnlocalizedName()); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index cb6dc1bde..c404928a6 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -750,8 +750,8 @@ public class CraftingManager { public static void reg2() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_rpg, 1), new Object[] { "SSW", " MW", 'S', "plateSteel", 'W', "plateIron", 'M', ModItems.mechanism_launcher_1 })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_rpg_ammo, 8), new Object[] { "SI ", "ITI", " I ", 'S', "plateSteel", 'T', Item.getItemFromBlock(Blocks.tnt), 'I', "plateIron", 'M', ModItems.mechanism_launcher_2 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_rpg, 1), new Object[] { "SSW", " MW", 'S', ModItems.hull_small_steel, 'W', "plateIron", 'M', ModItems.mechanism_launcher_1 })); + //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_rpg_ammo, 8), new Object[] { "SI ", "ITI", " I ", 'S', "plateSteel", 'T', Item.getItemFromBlock(Blocks.tnt), 'I', "plateIron", 'M', ModItems.mechanism_launcher_2 })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_stinger, 1), new Object[] { "SSW", "CMW", 'S', "plateSteel", 'W', "plateTitanium", 'C', ModItems.circuit_red_copper, 'M', ModItems.mechanism_launcher_2 })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_stinger_ammo, 4), new Object[] { "SS ", "STI", " IR", 'S', "plateSteel", 'T', Item.getItemFromBlock(Blocks.tnt), 'I', "plateAluminum", 'R', "dustRedstone" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver, 1), new Object[] { "SSM", " RW", 'S', "plateSteel", 'W', "plankWood", 'R', ModItems.wire_aluminium, 'M', ModItems.mechanism_revolver_1 })); @@ -892,6 +892,11 @@ public class CraftingManager { GameRegistry.addRecipe(new ItemStack(ModItems.ammo_rocket_shrapnel, 1), new Object[] { "G", "R", 'G', ModItems.pellet_buckshot, 'R', ModItems.ammo_rocket }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_rocket_glare, 1), new Object[] { "GGG", "GRG", "GGG", 'G', Items.redstone, 'R', ModItems.ammo_rocket }); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", " P ", 'T', Items.gunpowder, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', "plateIron" })); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_grenade_he, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', Blocks.tnt }); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_grenade_incendiary, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ModItems.powder_fire }); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_grenade_toxic, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ModItems.powder_poison }); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_357, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_357 })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_44, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_44 })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_9, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_9 })); diff --git a/com/hbm/render/entity/RenderBullet.java b/com/hbm/render/entity/RenderBullet.java index 8fd3703dd..620566b62 100644 --- a/com/hbm/render/entity/RenderBullet.java +++ b/com/hbm/render/entity/RenderBullet.java @@ -5,8 +5,11 @@ import java.util.Random; import org.lwjgl.opengl.GL11; import com.hbm.entity.projectile.EntityBullet; +import com.hbm.handler.BulletConfiguration; import com.hbm.lib.RefStrings; +import com.hbm.render.model.ModelBuckshot; import com.hbm.render.model.ModelBullet; +import com.hbm.render.model.ModelGrenade; import com.hbm.render.model.ModelRocket; import net.minecraft.client.renderer.Tessellator; @@ -17,11 +20,15 @@ import net.minecraft.util.ResourceLocation; public class RenderBullet extends Render { private ModelBullet bullet; + private ModelBuckshot buckshot; private ModelRocket rocket; + private ModelGrenade grenade; public RenderBullet() { bullet = new ModelBullet(); + buckshot = new ModelBuckshot(); rocket = new ModelRocket(); + grenade = new ModelGrenade(); } @Override @@ -36,8 +43,21 @@ public class RenderBullet extends Render { GL11.glScalef(1.5F, 1.5F, 1.5F); GL11.glRotatef(new Random(bullet.getEntityId()).nextInt(360), 1.0F, 0.0F, 0.0F); + + int style = bullet.getDataWatcher().getWatchableObjectByte(16); + int trail = bullet.getDataWatcher().getWatchableObjectByte(17); + + switch(style) { + case BulletConfiguration.STYLE_NORMAL: renderBullet(trail); break; + case BulletConfiguration.STYLE_BOLT: renderDart(0.25F, 0.0F, 0.75F); break; + case BulletConfiguration.STYLE_FLECHETTE: renderFlechette(); break; + case BulletConfiguration.STYLE_FOLLY: renderBullet(trail); break; + case BulletConfiguration.STYLE_PELLET: renderBuckshot(); break; + case BulletConfiguration.STYLE_ROCKET: renderRocket(trail); break; + case BulletConfiguration.STYLE_GRENADE: renderGrenade(trail); break; + default: renderBullet(trail); break; + } - renderDart(0.75F, 0.0F, 1.0F); GL11.glPopMatrix(); } @@ -55,28 +75,55 @@ public class RenderBullet extends Render { bullet.renderAll(0.0625F); } + private void renderBuckshot() { + + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/buckshot.png")); + + buckshot.renderAll(0.0625F); + } + private void renderRocket(int type) { switch(type) { case 0: - bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/ModelRocket.png")); break; + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelRocket.png")); break; case 1: - bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/ModelRocketHE.png")); break; + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelRocketHE.png")); break; case 2: - bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/ModelRocketIncendiary.png")); break; + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelRocketIncendiary.png")); break; case 3: - bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/ModelRocketShrapnel.png")); break; + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelRocketShrapnel.png")); break; case 4: - bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/ModelRocketEMP.png")); break; + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelRocketEMP.png")); break; case 5: - bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/ModelRocketGlare.png")); break; + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelRocketGlare.png")); break; case 6: - bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/ModelRocketSleek.png")); break; + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelRocketSleek.png")); break; } rocket.renderAll(0.0625F); } + private void renderGrenade(int type) { + + GL11.glScalef(0.25F, 0.25F, 0.25F); + + switch(type) { + case 0: + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenade.png")); break; + case 1: + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeHE.png")); break; + case 2: + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeIncendiary.png")); break; + case 3: + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeToxic.png")); break; + case 4: + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeSleek.png")); break; + } + + grenade.renderAll(0.0625F); + } + private void renderFlechette() { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); diff --git a/com/hbm/render/model/ModelBuckshot.java b/com/hbm/render/model/ModelBuckshot.java new file mode 100644 index 000000000..2ddadaf54 --- /dev/null +++ b/com/hbm/render/model/ModelBuckshot.java @@ -0,0 +1,45 @@ +package com.hbm.render.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelBuckshot extends ModelBase { + + ModelRenderer bullet; + + public ModelBuckshot() { + textureWidth = 4; + textureHeight = 4; + + bullet = new ModelRenderer(this, 0, 0); + bullet.addBox(0F, 0F, 0F, 1, 1, 1); + bullet.setRotationPoint(1F, -0.5F, -0.5F); + bullet.setTextureSize(4, 4); + bullet.mirror = true; + setRotation(bullet, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + bullet.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + @Override + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + + public void renderAll(float f5) { + bullet.render(f5); + } + +} \ No newline at end of file diff --git a/com/hbm/render/model/ModelGrenade.java b/com/hbm/render/model/ModelGrenade.java new file mode 100644 index 000000000..88ee4dddb --- /dev/null +++ b/com/hbm/render/model/ModelGrenade.java @@ -0,0 +1,67 @@ +// Date: 23.01.2019 10:30:04 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package com.hbm.render.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelGrenade extends ModelBase { + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + + public ModelGrenade() { + textureWidth = 32; + textureHeight = 32; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(0F, 0F, 0F, 8, 8, 8); + Shape1.setRotationPoint(-4F, -4F, -4F); + Shape1.setTextureSize(32, 32); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 16); + Shape2.addBox(0F, 0F, 0F, 4, 6, 6); + Shape2.setRotationPoint(-8F, -3F, -3F); + Shape2.setTextureSize(32, 32); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 20, 16); + Shape3.addBox(0F, 0F, 0F, 1, 4, 4); + Shape3.setRotationPoint(-9F, -2F, -2F); + Shape3.setTextureSize(32, 32); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + } + + public void renderAll(float f5) { + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + +} diff --git a/com/hbm/render/model/ModelGustav.java b/com/hbm/render/model/ModelGustav.java index 956b794dc..43fcd28bc 100644 --- a/com/hbm/render/model/ModelGustav.java +++ b/com/hbm/render/model/ModelGustav.java @@ -6,6 +6,8 @@ package com.hbm.render.model; +import org.lwjgl.opengl.GL11; + import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; @@ -260,6 +262,7 @@ public class ModelGustav extends ModelBase { public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glDisable(GL11.GL_CULL_FACE); Shape1.render(f5); Shape2.render(f5); Shape3.render(f5); @@ -294,6 +297,7 @@ public class ModelGustav extends ModelBase { Shape32.render(f5); Shape33.render(f5); Shape34.render(f5); + GL11.glEnable(GL11.GL_CULL_FACE); } private void setRotation(ModelRenderer model, float x, float y, float z) {