diff --git a/src/main/java/com/hbm/calc/EasyLocation.java b/src/main/java/com/hbm/calc/EasyLocation.java index c22e6b484..6f0d31d38 100644 --- a/src/main/java/com/hbm/calc/EasyLocation.java +++ b/src/main/java/com/hbm/calc/EasyLocation.java @@ -6,18 +6,21 @@ import java.util.Optional; import javax.annotation.CheckForNull; +import com.hbm.interfaces.IByteSerializable; import com.hbm.interfaces.ILocationProvider; +import com.hbm.interfaces.INBTSerializable; import com.hbm.main.DeserializationException; import api.hbm.serialization.ISerializable; import api.hbm.serialization.SerializationRegistry; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Vec3; import net.minecraft.world.World; -public class EasyLocation implements Cloneable, Comparable, ISerializable, ILocationProvider +public class EasyLocation implements Cloneable, Comparable, ISerializable, IByteSerializable, INBTSerializable, ILocationProvider { /** * @@ -31,13 +34,26 @@ public class EasyLocation implements Cloneable, Comparable, ISeria { SerializationRegistry.register(EasyLocation.class, EasyLocation::new); } + + /** + * Returns a new {@code EasyLocation} object with all coordinates set to 0. + * @return A unique {@code EasyLocation} object at position (0, 0, 0). + */ + public static EasyLocation getZeroLocation() + { + return ZERO_LOCATION.clone(); + } + public EasyLocation(ILocationProvider locationProvider) { posX = locationProvider.posX(); posY = locationProvider.posY(); posZ = locationProvider.posZ(); if (locationProvider.hasWorld()) + { world = Optional.of(locationProvider.getWorld()); + dimID = locationProvider.getWorld().provider.dimensionId; + } } public EasyLocation(double x, double y, double z) { @@ -272,7 +288,7 @@ public class EasyLocation implements Cloneable, Comparable, ISeria final double myDist = ILocationProvider.distance(this, ZERO_LOCATION); if (testDist == myDist) return 0; - return myDist < testDist ? 1 : -1; + return myDist > testDist ? 1 : -1; } @Override @@ -310,4 +326,44 @@ public class EasyLocation implements Cloneable, Comparable, ISeria { return world.get(); } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + nbt.setDouble("posX", posX); + nbt.setDouble("posY", posY); + nbt.setDouble("posZ", posZ); + nbt.setInteger("dimID", dimID); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + posX = nbt.getDouble("posX"); + posY = nbt.getDouble("posY"); + posZ = nbt.getDouble("posZ"); + dimID = nbt.getInteger("dimID"); + } + + @Override + public void writeToBytes(ByteBuf buf) + { + buf.writeBytes(serialize()); + } + + @Override + public void readFromBytes(byte[] bytes) throws DeserializationException + { + try + { + final ByteBuf buf = allocCopy.apply(bytes); + posX = buf.readDouble(); + posY = buf.readDouble(); + posZ = buf.readDouble(); + dimID = buf.readInt(); + } catch (Exception e) + { + throw new DeserializationException(e); + } + } } \ No newline at end of file diff --git a/src/main/java/com/hbm/config/WeaponConfig.java b/src/main/java/com/hbm/config/WeaponConfig.java index 88c3dbdae..cf992059c 100644 --- a/src/main/java/com/hbm/config/WeaponConfig.java +++ b/src/main/java/com/hbm/config/WeaponConfig.java @@ -16,6 +16,8 @@ public class WeaponConfig { public static boolean dropCrys = true; public static boolean dropDead = true; + public static boolean spawnCasings = true; + public static void loadFromConfig(Configuration config) { final String CATEGORY_MISSILE = CommonConfig.CATEGORY_MISSILE; @@ -38,5 +40,7 @@ public class WeaponConfig { dropStar = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.02_dropStar", "Whether rigged star blaster cells should explode when dropped", true); dropCrys = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.04_dropCrys", "Whether xen crystals should move blocks when dropped", true); dropDead = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.05_dropDead", "Whether dead man's explosives should explode when dropped", true); + + spawnCasings = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.06_spawnCasings", "Should applicable guns spawn spent shell casings? (Disable if performance heavy)", true); } } diff --git a/src/main/java/com/hbm/crafting/WeaponRecipes.java b/src/main/java/com/hbm/crafting/WeaponRecipes.java index 08f268db2..c43fdb11f 100644 --- a/src/main/java/com/hbm/crafting/WeaponRecipes.java +++ b/src/main/java/com/hbm/crafting/WeaponRecipes.java @@ -72,7 +72,6 @@ public class WeaponRecipes { CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_quadro, 1), new Object[] { "SSS", "SSS", "CM ", 'S', ModItems.hull_small_steel, 'C', ModItems.circuit_targeting_tier3, 'M', ModItems.mechanism_launcher_2 }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_hk69, 1), new Object[] { "SSI", " MB", 'S', ModItems.hull_small_steel, 'I', FE.ingot(), 'M', ModItems.mechanism_launcher_1, 'B', ModItems.bolt_tungsten }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stinger, 1), new Object[] { "SSW", "CMW", 'S', STEEL.plate(), 'W', TI.plate(), 'C', ModItems.circuit_red_copper, 'M', ModItems.mechanism_launcher_2 }); - CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket, 4), new Object[] { "SS ", "STI", " IR", 'S', STEEL.plate(), 'T', Item.getItemFromBlock(Blocks.tnt), 'I', AL.plate(), 'R', REDSTONE.dust() }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver, 1), new Object[] { "SSM", " RW", 'S', STEEL.plate(), 'W', KEY_PLANKS, 'R', ModItems.wire_aluminium, 'M', ModItems.mechanism_revolver_1 }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_saturnite, 1), new Object[] { "SSM", " RW", 'S', BIGMT.plate(), 'W', KEY_PLANKS, 'R', ModItems.wire_tungsten, 'M', ModItems.mechanism_revolver_2 }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_iron, 1), new Object[] { "SSM", " RW", 'S', FE.plate(), 'W', KEY_PLANKS, 'R', ModItems.wire_aluminium, 'M', ModItems.mechanism_revolver_1 }); @@ -215,8 +214,8 @@ public class WeaponRecipes { CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_folly_du, 1), new Object[] { " B ", "EEE", " S ", 'B', ModItems.folly_bullet_du, 'E', ModBlocks.det_charge, 'S', ModItems.folly_shell }); //Rockets - CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 1), new Object[] { " T ", "GCG", " P ", 'T', Blocks.tnt, 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });// I got tired of changing *all* of them, the stock one is always the first one anyway - CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 2), new Object[] { " T ", "GCG", " P ", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 }); + CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 1), new Object[] { " T ", "GCG", " P ", 'T', ModItems.ball_dynamite, 'G', ModItems.rocket_fuel, 'C', ModItems.hull_small_aluminium, 'P', ModItems.primer_50 });// I got tired of changing *all* of them, the stock one is always the first one anyway + CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 2), new Object[] { " T ", "GCG", " P ", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.rocket_fuel, 'C', ModItems.hull_small_aluminium, 'P', ModItems.primer_50 }); CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.HE), new Object[] { "G", "R", 'G', ANY_PLASTICEXPLOSIVE.ingot(), 'R', ModItems.ammo_rocket }); CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.INCENDIARY), new Object[] { "G", "R", 'G', P_RED.dust(), 'R', ModItems.ammo_rocket }); CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.PHOSPHORUS), new Object[] { "G", "R", 'G', P_WHITE.ingot(), 'R', ModItems.ammo_rocket }); diff --git a/src/main/java/com/hbm/entity/mob/EntityFBI.java b/src/main/java/com/hbm/entity/mob/EntityFBI.java index fbbd5e6e6..7696f0097 100644 --- a/src/main/java/com/hbm/entity/mob/EntityFBI.java +++ b/src/main/java/com/hbm/entity/mob/EntityFBI.java @@ -9,7 +9,9 @@ import com.hbm.config.MobConfig; import com.hbm.entity.mob.ai.EntityAIBreaking; import com.hbm.entity.mob.ai.EntityAI_MLPF; import com.hbm.entity.projectile.EntityBullet; +import com.hbm.handler.guncfg.Gun4GaugeFactory; import com.hbm.items.ModItems; +import com.hbm.main.MainRegistry; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -32,6 +34,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; @@ -145,6 +148,18 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob { this.worldObj.spawnEntityInWorld(bullet); } this.playSound("hbm:weapon.shotgunShoot", 1.0F, 1.0F); + + // Casing stuff, not doing it in a method or anything because I'm gonna do that with the SNPC class. + final NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "casing"); + data.setDouble("posX", posX); + data.setDouble("posY", posY + getEyeHeight()); + data.setDouble("posZ", posZ); + data.setFloat("pitch", (float) Math.toRadians(rotationPitch)); + data.setFloat("yaw", (float) Math.toRadians(rotationYaw)); + data.setBoolean("crouched", isSneaking()); + data.setString("name", "4g"); + MainRegistry.proxy.effectNT(data); } } } diff --git a/src/main/java/com/hbm/entity/projectile/EntityCombineBallNT.java b/src/main/java/com/hbm/entity/projectile/EntityCombineBallNT.java index aa85c6fa6..cebd81411 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityCombineBallNT.java +++ b/src/main/java/com/hbm/entity/projectile/EntityCombineBallNT.java @@ -11,7 +11,7 @@ public class EntityCombineBallNT extends EntityBulletBase super(world, config, shooter); overrideDamage = 1000; } - + @Override public void setDead() { diff --git a/src/main/java/com/hbm/handler/BulletConfiguration.java b/src/main/java/com/hbm/handler/BulletConfiguration.java index 72037b14f..7acc16ac6 100644 --- a/src/main/java/com/hbm/handler/BulletConfiguration.java +++ b/src/main/java/com/hbm/handler/BulletConfiguration.java @@ -88,7 +88,7 @@ public class BulletConfiguration implements Cloneable { /**The function that handles lost penetration over distance**/ @Nonnull public Optional modFunction = Optional.of(DEFAULT_FUNCTION); - + //whether or not the bullet should penetrate mobs public boolean doesPenetrate; //whether or not the bullet should phase through blocks diff --git a/src/main/java/com/hbm/handler/GunConfiguration.java b/src/main/java/com/hbm/handler/GunConfiguration.java index 2b52f2015..e41d7a1fe 100644 --- a/src/main/java/com/hbm/handler/GunConfiguration.java +++ b/src/main/java/com/hbm/handler/GunConfiguration.java @@ -1,11 +1,16 @@ package com.hbm.handler; import java.util.ArrayList; -import java.util.HashMap; +import java.util.EnumMap; import java.util.List; +import java.util.Map; +import java.util.Optional; + +import javax.annotation.Nonnull; import com.hbm.lib.HbmCollection.EnumGunManufacturer; import com.hbm.main.MainRegistry; +import com.hbm.particle.SpentCasingConfig; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.HbmAnimations.AnimType; import com.hbm.render.util.RenderScreenOverlay.Crosshair; @@ -32,7 +37,7 @@ public class GunConfiguration implements Cloneable { public int durability; //animations! - public HashMap animations = new HashMap(); + public final Map animations = new EnumMap<>(AnimType.class); //whether ot not to disable crosshais when sneaking public boolean hasSights; @@ -89,7 +94,11 @@ public class GunConfiguration implements Cloneable { //crosshair public Crosshair crosshair; - + + /**Controller for spent casings. If {@code Optional.empty()} it will not eject casings.**/ + @Nonnull + public Optional casingConfig = Optional.empty(); + public static final int MODE_NORMAL = 0; public static final int MODE_RELEASE = 1; public static final int MODE_BOTH = 1; diff --git a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java index 0a8c4c274..3496811b5 100644 --- a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java @@ -67,6 +67,8 @@ public class BulletConfigFactory { } + public static final float defaultSpread = 0.005f; + /// STANDARD CONFIGS /// //do not include damage or ammo public static BulletConfiguration standardBulletConfig() { diff --git a/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java index 8a4e8424a..a9ee91341 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java @@ -1,11 +1,17 @@ package com.hbm.handler.guncfg; +import java.util.Optional; + +import com.hbm.calc.EasyLocation; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.particle.SpentCasingConfigBuilder; import com.hbm.potion.HbmPotion; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.BusAnimationKeyframe; @@ -15,9 +21,38 @@ import com.hbm.render.util.RenderScreenOverlay.Crosshair; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.Vec3; public class Gun12GaugeFactory { + static final SpentCasingConfig CASING_SPAS, CASING_SPAS_ALT, CASING_BENELLI, CASING_UBOINIK, CASING_SSG; + + static + { + final SpentCasingConfigBuilder CASING_12G_BUILDER = new SpentCasingConfigBuilder("", CasingType.SHOTGUN, false) + .setScaleX(1.5f).setScaleY(1.5f).setScaleZ(1.5f); + CASING_SPAS = CASING_12G_BUILDER.setRegistryName("spas12").setInitialMotion(Vec3.createVectorHelper(-0.4, 0.1, 0)) + .setPosOffset(new EasyLocation(-0.35, 0, 0.5)).setPitchFactor(0.03f).setYawFactor(0.01f) + .setSmokeChance(0).setDelay(10) + .build(); + + CASING_SPAS_ALT = CASING_12G_BUILDER.setRegistryName("spas12alt").setCasingAmount(2) + .build(); + + CASING_BENELLI = CASING_12G_BUILDER.setRegistryName("benelli").setCasingAmount(1).setDelay(0) + .setInitialMotion(Vec3.createVectorHelper(-0.3, 1, 0)) + .build(); + + CASING_UBOINIK = CASING_12G_BUILDER.setRegistryName("uboinik").setOverrideColor(true) + .setBlueOverride(255).setPosOffset(new EasyLocation(-0.35, -0.3, 0.5)) + .build(); + + CASING_SSG = CASING_12G_BUILDER.setRegistryName("ssg").setBlueOverride(0).setRedOverride(255).setCasingAmount(2) + .setPosOffset(new EasyLocation(0.8, 0, 0)).setInitialMotion(Vec3.createVectorHelper(0.2, 0, -0.2)) + .setPitchFactor(0.05f).setYawFactor(0.02f) + .build(); + } + public static GunConfiguration getSpas12Config() { GunConfiguration config = new GunConfiguration(); @@ -59,6 +94,8 @@ public class Gun12GaugeFactory { ) ); + config.casingConfig = Optional.of(CASING_SPAS); + return config; } @@ -78,6 +115,8 @@ public class Gun12GaugeFactory { config.config = HbmCollection.twelveGauge; + + config.casingConfig = Optional.of(CASING_SPAS_ALT); return config; } @@ -105,6 +144,8 @@ public class Gun12GaugeFactory { config.config = HbmCollection.twelveGauge; + config.casingConfig = Optional.of(CASING_UBOINIK); + return config; } @@ -156,6 +197,8 @@ public class Gun12GaugeFactory { config.config = HbmCollection.twelveGauge; + config.casingConfig = Optional.of(CASING_SSG); + return config; } @@ -230,6 +273,8 @@ public class Gun12GaugeFactory { config.advFuncLore.add("user to quickly exchange the various assembly groups (barrel, buttstock, forend, etc.) without the use"); config.advFuncLore.add("of additional tools."); + config.casingConfig = Optional.of(CASING_BENELLI); + return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun20GaugeFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun20GaugeFactory.java index 719c35a09..d809071e8 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun20GaugeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun20GaugeFactory.java @@ -1,14 +1,18 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; -import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.calc.EasyLocation; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.particle.SpentCasingConfigBuilder; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.BusAnimationKeyframe; import com.hbm.render.anim.BusAnimationSequence; @@ -17,9 +21,18 @@ import com.hbm.render.util.RenderScreenOverlay.Crosshair; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.Vec3; public class Gun20GaugeFactory { + private static final SpentCasingConfigBuilder CASING_20G_BUILDER = new SpentCasingConfigBuilder("20g_lever", CasingType.SHOTGUN, false); + static final SpentCasingConfig + CASING_20G_LEVER = CASING_20G_BUILDER + .setPosOffset(new EasyLocation(-0.55, 0, 0.5)) + .setInitialMotion(Vec3.createVectorHelper(-0.4, 0.95, 0)).setPitchFactor(0.05f).setYawFactor(0.01f) + .setSmokeChance(0) + .build(); + public static GunConfiguration getShotgunConfig() { GunConfiguration config = new GunConfiguration(); @@ -53,6 +66,8 @@ public class Gun20GaugeFactory { config.config = HbmCollection.twentyGauge; + config.casingConfig = Optional.of(CASING_20G_LEVER); + return config; } @@ -69,6 +84,8 @@ public class Gun20GaugeFactory { config.manufacturer = EnumGunManufacturer.WINCHESTER; config.config = HbmCollection.twentyGauge; + + config.casingConfig = Optional.of(CASING_20G_LEVER); return config; } @@ -86,6 +103,8 @@ public class Gun20GaugeFactory { config.manufacturer = EnumGunManufacturer.WINCHESTER; config.config = HbmCollection.twentyGauge; + + config.casingConfig = Optional.of(CASING_20G_LEVER); return config; } @@ -121,6 +140,8 @@ public class Gun20GaugeFactory { ); config.config = HbmCollection.twentyGauge; + + config.casingConfig = Optional.of(CASING_20G_LEVER); return config; } @@ -157,6 +178,8 @@ public class Gun20GaugeFactory { config.config = HbmCollection.twentyGauge; + + config.casingConfig = Optional.of(CASING_20G_LEVER); return config; } @@ -191,17 +214,20 @@ public class Gun20GaugeFactory { ) ); - config.config = new ArrayList(); - config.config.add(BulletConfigSyncingUtil.G20_SLUG_FIRE); - config.config.add(BulletConfigSyncingUtil.G20_NORMAL_FIRE); - config.config.add(BulletConfigSyncingUtil.G20_FLECHETTE_FIRE); - config.config.add(BulletConfigSyncingUtil.G20_FIRE); - config.config.add(BulletConfigSyncingUtil.G20_SHRAPNEL); - config.config.add(BulletConfigSyncingUtil.G20_EXPLOSIVE_FIRE); - config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC_FIRE); - config.config.add(BulletConfigSyncingUtil.G20_SHOCK_FIRE); - config.config.add(BulletConfigSyncingUtil.G20_WITHER_FIRE); - config.config.add(BulletConfigSyncingUtil.G20_SLEEK); +// config.config = new ArrayList(); +// config.config.add(BulletConfigSyncingUtil.G20_SLUG_FIRE); +// config.config.add(BulletConfigSyncingUtil.G20_NORMAL_FIRE); +// config.config.add(BulletConfigSyncingUtil.G20_FLECHETTE_FIRE); +// config.config.add(BulletConfigSyncingUtil.G20_FIRE); +// config.config.add(BulletConfigSyncingUtil.G20_SHRAPNEL); +// config.config.add(BulletConfigSyncingUtil.G20_EXPLOSIVE_FIRE); +// config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC_FIRE); +// config.config.add(BulletConfigSyncingUtil.G20_SHOCK_FIRE); +// config.config.add(BulletConfigSyncingUtil.G20_WITHER_FIRE); +// config.config.add(BulletConfigSyncingUtil.G20_SLEEK); + config.config = HbmCollection.twentyGauge; + + config.casingConfig = Optional.of(CASING_20G_LEVER); return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun22LRFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun22LRFactory.java index 83f7e660a..e5ecf60e4 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun22LRFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun22LRFactory.java @@ -1,17 +1,30 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; +import com.hbm.calc.EasyLocation; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.particle.SpentCasingConfigBuilder; import com.hbm.render.util.RenderScreenOverlay.Crosshair; +import net.minecraft.util.Vec3; + public class Gun22LRFactory { + static final SpentCasingConfig CASING_22LR = new SpentCasingConfigBuilder("22lr", CasingType.BRASS_STRAIGHT_WALL, false) + .setSmokeChance(20).setScaleX(0.4f).setScaleY(0.4f).setScaleZ(0.4f) + .setInitialMotion(Vec3.createVectorHelper(-0.4, 0.1, 0)).setPitchFactor(0.03f).setYawFactor(0.01f) + .setPosOffset(new EasyLocation(-0.35, -0.2, 0.35)) + .build(); + public static GunConfiguration getUziConfig() { GunConfiguration config = new GunConfiguration(); @@ -54,6 +67,8 @@ public class Gun22LRFactory { config.advFuncLore.add("to be moved far back into the receiver and the magazine to be housed in the pistol grip, allowing for a heavier,"); config.advFuncLore.add("slower-firing bolt in a shorter, better-balanced weapon."); + config.casingConfig = Optional.of(CASING_22LR); + return config; } @@ -70,6 +85,8 @@ public class Gun22LRFactory { config.config.add(BulletConfigSyncingUtil.LR22_NORMAL_FIRE); config.config.add(BulletConfigSyncingUtil.LR22_AP_FIRE); config.config.add(BulletConfigSyncingUtil.CHL_LR22_FIRE); + + config.casingConfig = Optional.of(CASING_22LR); return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun357MagnumFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun357MagnumFactory.java index 3817e3ee1..cd6db534d 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun357MagnumFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun357MagnumFactory.java @@ -1,7 +1,9 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; +import com.hbm.calc.EasyLocation; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; @@ -9,6 +11,9 @@ import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection.EnumGunManufacturer; import com.hbm.lib.ModDamageSource; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfigBuilder; +import com.hbm.particle.SpentCasingConfig.CasingType; import com.hbm.potion.HbmPotion; import com.hbm.render.util.RenderScreenOverlay.Crosshair; @@ -16,6 +21,16 @@ import net.minecraft.potion.PotionEffect; public class Gun357MagnumFactory { + private static final SpentCasingConfigBuilder CASING_357_BUILDER = new SpentCasingConfigBuilder("357", CasingType.BRASS_STRAIGHT_WALL, false) + .setCasingAmount(6).setYawFactor(0.05f).setPosOffset(new EasyLocation(0, -0.15, 0)).setSmokeChance(6).setAfterReload(true) + .setBounceSound("weapon.smallCasingBouncePB3"); + static final SpentCasingConfig + CASING_357 = CASING_357_BUILDER.build(), + + CASING_357_SA = CASING_357_BUILDER.setRegistryName("357Schrabidium").setSmokeChance(0).setOverrideColor(true) + .setRedOverride(2).setGreenOverride(207).setBlueOverride(207) + .build(); + public static GunConfiguration getBaseConfig() { GunConfiguration config = new GunConfiguration(); @@ -34,6 +49,8 @@ public class Gun357MagnumFactory { config.firingSound = "hbm:weapon.revolverShoot"; config.reloadSoundEnd = false; + config.casingConfig = Optional.of(CASING_357); + return config; } @@ -149,6 +166,8 @@ public class Gun357MagnumFactory { config.config = new ArrayList(); config.config.add(BulletConfigSyncingUtil.SCHRABIDIUM_REVOLVER); config.config.add(BulletConfigSyncingUtil.DESH_REVOLVER); + + config.casingConfig = Optional.of(CASING_357_SA); return config; } @@ -184,6 +203,8 @@ public class Gun357MagnumFactory { config.config = new ArrayList(); config.config.add(BulletConfigSyncingUtil.NIGHT2_REVOLVER); + config.casingConfig = Optional.of(Gun20GaugeFactory.CASING_20G_LEVER); + return config; } @@ -210,7 +231,7 @@ public class Gun357MagnumFactory { public static GunConfiguration getColtPythonConfig() { - GunConfiguration config = getBaseConfig().clone(); + GunConfiguration config = getBaseConfig(); config.durability = 8000; config.name = "cPython"; diff --git a/src/main/java/com/hbm/handler/guncfg/Gun44MagnumFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun44MagnumFactory.java index 796f3f011..ac287c724 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun44MagnumFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun44MagnumFactory.java @@ -1,7 +1,9 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; +import com.hbm.calc.EasyLocation; import com.hbm.entity.particle.EntityBSmokeFX; import com.hbm.entity.projectile.EntityBoxcar; import com.hbm.entity.projectile.EntityBuilding; @@ -15,6 +17,9 @@ import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfigBuilder; +import com.hbm.particle.SpentCasingConfig.CasingType; import com.hbm.potion.HbmPotion; import com.hbm.render.util.RenderScreenOverlay.Crosshair; @@ -24,6 +29,10 @@ import net.minecraft.potion.PotionEffect; public class Gun44MagnumFactory { + static final SpentCasingConfig CASING_44 = new SpentCasingConfigBuilder("44Magnum", CasingType.BRASS_STRAIGHT_WALL, false) + .setCasingAmount(6).setYawFactor(0.05f).setPosOffset(new EasyLocation(0, -0.15, 0)).setSmokeChance(6) + .setAfterReload(true).setScaleX(1.25f).setBounceSound("weapon.smallCasingBouncePB3").build(); + public static GunConfiguration getBaseConfig() { GunConfiguration config = new GunConfiguration(); @@ -44,6 +53,8 @@ public class Gun44MagnumFactory { config.config.addAll(HbmCollection.fourtyFourMagBasic); + config.casingConfig = Optional.of(CASING_44); + return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun45ACPFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun45ACPFactory.java index 71e657cf4..5bede6b0a 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun45ACPFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun45ACPFactory.java @@ -1,22 +1,39 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; +import com.hbm.calc.EasyLocation; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.particle.SpentCasingConfigBuilder; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.BusAnimationKeyframe; import com.hbm.render.anim.BusAnimationSequence; import com.hbm.render.anim.HbmAnimations.AnimType; import com.hbm.render.util.RenderScreenOverlay.Crosshair; +import net.minecraft.util.Vec3; + public class Gun45ACPFactory { + private static final SpentCasingConfigBuilder CASING_45_BUILDER = new SpentCasingConfigBuilder("45acp", CasingType.BRASS_STRAIGHT_WALL, false) + .setSmokeChance(8).setInitialMotion(Vec3.createVectorHelper(0.3, 0.75, 0)).setPitchFactor(0.03f).setYawFactor(0.01f) + .setPosOffset(new EasyLocation(-0.3, -0.25, 0.6)).setScaleZ(0.75f).setBounceSound("weapon.smallCasingBouncePB3"); + static final SpentCasingConfig + CASING_45 = CASING_45_BUILDER.build(), + + CASING_45_UAC = CASING_45_BUILDER.setRegistryName("45acp_UAC_Pistol") + .setInitialMotion(Vec3.createVectorHelper(0.3, 0.9, 0)) + .build(); + public static GunConfiguration getThompsonConfig() { GunConfiguration config = new GunConfiguration(); @@ -48,6 +65,8 @@ public class Gun45ACPFactory config.advLore.add("Thompson in 1918. It was originally designed to break the stalemate of trench warfare of World"); config.advLore.add("War I, but was not finished until after the war ended."); + config.casingConfig = Optional.of(CASING_45); + return config; } @@ -85,6 +104,8 @@ public class Gun45ACPFactory .addKeyframe(new BusAnimationKeyframe(15, 0, 0, 10)) .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 40)))); + config.casingConfig = Optional.of(CASING_45_UAC); + return config; } @@ -114,6 +135,8 @@ public class Gun45ACPFactory config.config.addAll(HbmCollection.fourtyFiveACP); + config.casingConfig = Optional.of(CASING_45); + return config; } public static BulletConfiguration get45AutoConfig() diff --git a/src/main/java/com/hbm/handler/guncfg/Gun4GaugeFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun4GaugeFactory.java index ba7568da4..9c88012e9 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun4GaugeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun4GaugeFactory.java @@ -2,7 +2,9 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; import java.util.List; +import java.util.Optional; +import com.hbm.calc.EasyLocation; import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionNT; @@ -18,6 +20,9 @@ import com.hbm.lib.HbmCollection.EnumGunManufacturer; import com.hbm.lib.ModDamageSource; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.particle.SpentCasingConfigBuilder; import com.hbm.potion.HbmPotion; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.BusAnimationKeyframe; @@ -31,10 +36,16 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.Vec3; import net.minecraftforge.common.IExtendedEntityProperties; public class Gun4GaugeFactory { + static final SpentCasingConfig CASING_4G = new SpentCasingConfigBuilder("4g", CasingType.SHOTGUN, false) + .setSmokeChance(0).setPosOffset(new EasyLocation(-0.5, 0, 0.5)) + .setInitialMotion(Vec3.createVectorHelper(-0.4, 0.4, 0)).setPitchFactor(0.03f).setYawFactor(0.01f) + .setScaleX(2.5f).setScaleY(2.5f).setScaleZ(2.5f).build(); + private static GunConfiguration getShotgunConfig() { GunConfiguration config = new GunConfiguration(); @@ -52,6 +63,8 @@ public class Gun4GaugeFactory { config.crosshair = Crosshair.L_CIRCLE; config.reloadSound = GunConfiguration.RSOUND_SHOTGUN; + config.casingConfig = Optional.of(CASING_4G); + return config; } @@ -123,7 +136,6 @@ public class Gun4GaugeFactory { return config; } static byte i = 0; - static final BulletConfiguration stock = get4GaugeConfig(); public static BulletConfiguration get4GaugeConfig() { BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig(); @@ -339,7 +351,7 @@ public class Gun4GaugeFactory { public static BulletConfiguration get4GaugeClawConfig() { - BulletConfiguration bullet = stock.clone(); + BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig(); bullet.ammo = new ComparableStack(ModItems.ammo_4gauge, 1, i++); bullet.dmgMin = 6; @@ -373,7 +385,7 @@ public class Gun4GaugeFactory { public static BulletConfiguration get4GaugeVampireConfig() { - BulletConfiguration bullet = stock.clone(); + BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig(); bullet.ammo = new ComparableStack(ModItems.ammo_4gauge, 1, i++); bullet.dmgMin = 5; @@ -407,7 +419,7 @@ public class Gun4GaugeFactory { public static BulletConfiguration get4GaugeVoidConfig() { - BulletConfiguration bullet = stock.clone(); + BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig(); bullet.ammo = new ComparableStack(ModItems.ammo_4gauge, 1, i++); bullet.dmgMin = 6; diff --git a/src/main/java/com/hbm/handler/guncfg/Gun50AEFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun50AEFactory.java index 4f5783430..da4785ef4 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun50AEFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun50AEFactory.java @@ -1,15 +1,27 @@ package com.hbm.handler.guncfg; +import java.util.Optional; + +import com.hbm.calc.EasyLocation; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.particle.SpentCasingConfigBuilder; import com.hbm.render.util.RenderScreenOverlay.Crosshair; +import net.minecraft.util.Vec3; + public class Gun50AEFactory { + static final SpentCasingConfig CASING_50AE = new SpentCasingConfigBuilder("50ae", CasingType.BRASS_STRAIGHT_WALL, false) + .setSmokeChance(4).setInitialMotion(Vec3.createVectorHelper(-0.3, 0.7, 0)).setPitchFactor(0.03f).setYawFactor(0.01f) + .setPosOffset(new EasyLocation(-0.5, 0, 0.5)).setScaleZ(1.5f).setBounceSound("weapon.smallCasingBouncePB3").build(); + public static GunConfiguration getBaseConfig() { GunConfiguration config = new GunConfiguration(); @@ -28,6 +40,8 @@ public class Gun50AEFactory { config.firingSound = "hbm:weapon.deagleShoot"; config.reloadSoundEnd = false; + config.casingConfig = Optional.of(CASING_50AE); + return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun50BMGFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun50BMGFactory.java index 9d0ac4458..7737f4030 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun50BMGFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun50BMGFactory.java @@ -1,7 +1,9 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; +import com.hbm.calc.EasyLocation; import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; @@ -12,6 +14,9 @@ import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.particle.SpentCasingConfigBuilder; import com.hbm.potion.HbmPotion; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.BusAnimationKeyframe; @@ -26,9 +31,22 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.Vec3; public class Gun50BMGFactory { + public static final SpentCasingConfig + CONFIG_50BMG = new SpentCasingConfigBuilder("50bmg", CasingType.BRASS_BOTTLENECK, false) + .setSmokeChance(0).setInitialMotion(Vec3.createVectorHelper(-0.35, 0.9, 0)).setScaleX(3).setScaleY(3).setScaleZ(3) + .setPosOffset(new EasyLocation(-0.45, -0.2, 0.35)).setPitchFactor(0.05f).setYawFactor(0.01f) + .build(), + + CONFIG_LUNA = new SpentCasingConfigBuilder("luna", CasingType.BRASS_BOTTLENECK, true) + .setScaleX(4).setScaleY(4).setScaleZ(4).setSmokeChance(0).setInitialMotion(Vec3.createVectorHelper(-2, 0.15, 0)) + .setPosOffset(new EasyLocation(-0.45, -0.2, 0.35)).setRedOverride(11).setGreenOverride(97).setBlueOverride(109) + .setYawFactor(0.02f) + .build(); + public static GunConfiguration getCalamityConfig() { GunConfiguration config = new GunConfiguration(); @@ -67,6 +85,8 @@ public class Gun50BMGFactory { config.config = HbmCollection.fiftyBMG; + config.casingConfig = Optional.of(CONFIG_50BMG); + return config; } @@ -93,6 +113,8 @@ public class Gun50BMGFactory { config.config = HbmCollection.fiftyBMG; + config.casingConfig = Optional.of(CONFIG_50BMG); + return config; } @@ -141,6 +163,8 @@ public class Gun50BMGFactory { // .addKeyframe(new BusAnimationKeyframe(-20, -2, 0.75, 400))//Just plop that thing in there // .addKeyframe(new BusAnimationKeyframe(20, -2, 0.75, 75))));//Wait for the slide to close + config.casingConfig = Optional.of(CONFIG_LUNA); + return config; } @@ -155,6 +179,7 @@ public class Gun50BMGFactory { bullet.dmgMin = 450F; bullet.penetration = 10000; bullet.penetrationModifier = 1; + bullet.headshotMult = 2.5f; bullet.wear = 2000; bullet.velocity = 100; bullet.doesPenetrate = true; @@ -216,15 +241,17 @@ public class Gun50BMGFactory { config.manufacturer = EnumGunManufacturer.ARMALITE; config.config = new ArrayList(); - config.config.addAll(HbmCollection.fiftyBMG); config.config.addAll(HbmCollection.fiftyBMGFlechette); + config.config.addAll(HbmCollection.fiftyBMG); + + config.casingConfig = Optional.of(CONFIG_50BMG); return config; } public static GunConfiguration getM2Config() { - GunConfiguration config = getAR15Config().clone(); + GunConfiguration config = getAR15Config(); config.rateOfFire = 2; config.durability *= 10; @@ -257,17 +284,22 @@ public class Gun50BMGFactory { config.advFuncLore.add("gun on aircraft before and during World War II, as on the early versions of the Curtiss P-40 fighter."); config.advFuncLore.add("The M2 is a scaled-up version of John Browning's M1917 .30 caliber machine gun. "); + config.casingConfig = Optional.of(CONFIG_50BMG); + + config.config.clear(); + config.config.addAll(HbmCollection.fiftyBMG); + config.config.addAll(HbmCollection.fiftyBMGFlechette); + return config; } - static final float inaccuracy = 0.0005F; - static byte i = 0; + static final float inaccuracy = 0.0005F, standardSpread = BulletConfigFactory.defaultSpread * inaccuracy; public static BulletConfiguration get50BMGConfig() { BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, 0); + bullet.spread = standardSpread; bullet.dmgMin = 50; bullet.dmgMax = 56; bullet.penetration = 120; @@ -277,10 +309,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGFireConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 1; bullet.dmgMin = 50; bullet.dmgMax = 56; bullet.penetration = 120; @@ -292,10 +323,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGPhosphorusConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 2; bullet.dmgMin = 50; bullet.dmgMax = 56; bullet.penetration = 75; @@ -325,10 +355,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGExplosiveConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 3; bullet.dmgMin = 90; bullet.dmgMax = 94; bullet.penetration = 100; @@ -340,10 +369,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGAPConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 4; bullet.dmgMin = 82; bullet.dmgMax = 88; bullet.penetration = 150; @@ -355,10 +383,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGDUConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 5; bullet.dmgMin = 90; bullet.dmgMax = 96; bullet.penetration = 200; @@ -370,10 +397,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGStarConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 6; bullet.dmgMin = 108; bullet.dmgMax = 112; bullet.penetration = 250; @@ -385,10 +411,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGSleekConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 8; bullet.dmgMin = 60; bullet.dmgMax = 80; bullet.penetration = 120; @@ -428,10 +453,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGFlechetteConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 9; bullet.dmgMin = 60; bullet.dmgMax = 64; bullet.penetration = 130; @@ -442,10 +466,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGFlechetteAMConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); - bullet.spread *= inaccuracy; + bullet.ammo.meta = 10; bullet.dmgMin = 70; bullet.dmgMax = 74; bullet.penetration = 140; @@ -466,9 +489,9 @@ public class Gun50BMGFactory { public static BulletConfiguration get50BMGFlechettePOConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get50BMGConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_50bmg, 1, i++); + bullet.ammo.meta = 11; bullet.spread *= inaccuracy; bullet.dmgMin = 70; bullet.dmgMax = 74; diff --git a/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java index 94ac53b32..43b6f13c8 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java @@ -1,8 +1,9 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Optional; +import com.hbm.calc.EasyLocation; import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; @@ -11,8 +12,12 @@ import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.lib.Library; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.particle.SpentCasingConfigBuilder; import com.hbm.potion.HbmPotion; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.BusAnimationKeyframe; @@ -23,9 +28,15 @@ import com.hbm.render.util.RenderScreenOverlay.Crosshair; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.Vec3; public class Gun556mmFactory { + static final SpentCasingConfig CONFIG_556 = new SpentCasingConfigBuilder("556", CasingType.BRASS_BOTTLENECK, false) + .setSmokeChance(4).setInitialMotion(Vec3.createVectorHelper(-0.35, 0.6, 0)).setPitchFactor(0.03f).setYawFactor(0.01f) + .setPosOffset(new EasyLocation(-0.35, 0, 0.35)).setScaleZ(1.5f) + .build(); + public static GunConfiguration getEuphieConfig() { GunConfiguration config = new GunConfiguration(); @@ -52,16 +63,19 @@ public class Gun556mmFactory { config.comment.add("Why is this gun so sticky?"); config.config = new ArrayList(); - config.config.add(BulletConfigSyncingUtil.R556_NORMAL); - config.config.add(BulletConfigSyncingUtil.R556_GOLD); - config.config.add(BulletConfigSyncingUtil.R556_TRACER); - config.config.add(BulletConfigSyncingUtil.R556_PHOSPHORUS); - config.config.add(BulletConfigSyncingUtil.R556_AP); - config.config.add(BulletConfigSyncingUtil.R556_DU); - config.config.add(BulletConfigSyncingUtil.R556_STAR); - config.config.add(BulletConfigSyncingUtil.CHL_R556); - config.config.add(BulletConfigSyncingUtil.R556_SLEEK); - config.config.add(BulletConfigSyncingUtil.R556_K); + config.config.addAll(HbmCollection.NATO); +// config.config.add(BulletConfigSyncingUtil.R556_NORMAL); +// config.config.add(BulletConfigSyncingUtil.R556_GOLD); +// config.config.add(BulletConfigSyncingUtil.R556_TRACER); +// config.config.add(BulletConfigSyncingUtil.R556_PHOSPHORUS); +// config.config.add(BulletConfigSyncingUtil.R556_AP); +// config.config.add(BulletConfigSyncingUtil.R556_DU); +// config.config.add(BulletConfigSyncingUtil.R556_STAR); +// config.config.add(BulletConfigSyncingUtil.CHL_R556); +// config.config.add(BulletConfigSyncingUtil.R556_SLEEK); +// config.config.add(BulletConfigSyncingUtil.R556_K); + + config.casingConfig = Optional.of(CONFIG_556); return config; } @@ -102,6 +116,8 @@ public class Gun556mmFactory { config.config = new ArrayList(); config.config.addAll(HbmCollection.NATOFlechette); + + config.casingConfig = Optional.of(CONFIG_556); return config; } @@ -128,12 +144,14 @@ public class Gun556mmFactory { config.config = new ArrayList(); config.config.addAll(HbmCollection.grenade); + config.casingConfig = Optional.of(GunGrenadeFactory.CASING_40); + return config; } public static GunConfiguration getMLRConfig() { - GunConfiguration config = new GunConfiguration(); + final GunConfiguration config = new GunConfiguration(); config.rateOfFire = 2; config.roundsPerCycle = 1; @@ -153,21 +171,21 @@ public class Gun556mmFactory { config.manufacturer = EnumGunManufacturer.LUNA; config.comment.add("\"May you never reincarnate again\""); - config.config.addAll(HbmCollection.NATO); - config.config.addAll(HbmCollection.NATOFlechette); + config.config.addAll(Library.mergeWithoutDuplicates(HbmCollection.NATO, HbmCollection.NATOFlechette)); - config.animations = new HashMap<>(); config.animations.put(AnimType.CYCLE, new BusAnimation() .addBus("RECOIL", new BusAnimationSequence() .addKeyframe(new BusAnimationKeyframe(-0.35, 0, 0, 30)) .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 30)))); + config.casingConfig = Optional.of(CONFIG_556); + return config; } public static GunConfiguration getG36Config() { - GunConfiguration config = new GunConfiguration(); + final GunConfiguration config = new GunConfiguration(); config.rateOfFire = 3; config.roundsPerCycle = 1; @@ -188,16 +206,18 @@ public class Gun556mmFactory { config.config.addAll(HbmCollection.NATO); - config.animations = new HashMap<>(); config.animations.put(AnimType.CYCLE, new BusAnimation() .addBus("RECOIL", new BusAnimationSequence() .addKeyframe(new BusAnimationKeyframe(-0.35, 0, 0, 30)) .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 30)))); + config.casingConfig = Optional.of(CONFIG_556); + return config; } static final float inaccuracy = 1.15F; + public static BulletConfiguration get556Config() { BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); @@ -215,11 +235,11 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 1); + bullet.ammo.meta = 1; bullet.dmgMin = 250; bullet.dmgMax = 320; bullet.spread = 0.0F; - + return bullet; } @@ -227,7 +247,7 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 2); + bullet.ammo.meta = 2; bullet.wear = 15; bullet.incendiary = 5; bullet.doesPenetrate = false; @@ -247,7 +267,7 @@ public class Gun556mmFactory { PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, projectile.posX, projectile.posY, projectile.posZ), new TargetPoint(projectile.dimension, projectile.posX, projectile.posY, projectile.posZ, 50)); }; - + return bullet; } @@ -255,13 +275,13 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 3); + bullet.ammo.meta = 3; bullet.dmgMin = 20; bullet.dmgMax = 26; bullet.penetration *= 1.5; bullet.wear = 15; bullet.leadChance = 10; - + return bullet; } @@ -269,13 +289,13 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 4); + bullet.ammo.meta = 4; bullet.dmgMin = 24; bullet.dmgMax = 32; bullet.penetration *= 2; bullet.wear = 25; bullet.leadChance = 50; - + return bullet; } @@ -283,13 +303,13 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 5); + bullet.ammo.meta = 5; bullet.dmgMin = 30; bullet.dmgMax = 36; bullet.penetration *= 2.5; bullet.wear = 25; bullet.leadChance = 100; - + return bullet; } @@ -297,7 +317,7 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 6); + bullet.ammo.meta = 7; bullet.dmgMin = 45; bullet.dmgMax = 50; bullet.wear = 10; @@ -330,7 +350,7 @@ public class Gun556mmFactory { meteor.shooter = projectile.shooter; projectile.worldObj.spawnEntityInWorld(meteor); }; - + return bullet; } @@ -338,7 +358,7 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 7); + bullet.ammo.meta = 8; bullet.vPFX = "reddust"; return bullet; @@ -348,7 +368,7 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 8); + bullet.ammo.meta = 9; bullet.dmgMin = 26; bullet.dmgMax = 32; bullet.penetration = 22; @@ -357,7 +377,7 @@ public class Gun556mmFactory { bullet.wear = 15; bullet.style = BulletConfiguration.STYLE_FLECHETTE; bullet.doesPenetrate = false; - + return bullet; } @@ -365,9 +385,9 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556FlechetteConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 9); + bullet.ammo.meta = 10; bullet.incendiary = 5; - + return bullet; } @@ -375,7 +395,7 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556FlechetteConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 10); + bullet.ammo.meta = 11; bullet.incendiary = 5; PotionEffect eff = new PotionEffect(HbmPotion.phosphorus.id, 20 * 20, 0, true); @@ -393,7 +413,7 @@ public class Gun556mmFactory { PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, projectile.posX, projectile.posY, projectile.posZ), new TargetPoint(projectile.dimension, projectile.posX, projectile.posY, projectile.posZ, 50)); }; - + return bullet; } @@ -401,14 +421,14 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556FlechetteConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 11); + bullet.ammo.meta = 12; bullet.dmgMin = 46; bullet.dmgMax = 52; bullet.penetration *= 2.5; bullet.wear = 25; bullet.leadChance = 50; bullet.doesPenetrate = true; - + return bullet; } @@ -416,7 +436,7 @@ public class Gun556mmFactory { BulletConfiguration bullet = get556FlechetteConfig(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 12); + bullet.ammo.meta = 13; bullet.dmgMin = 45; bullet.dmgMax = 50; bullet.wear = 10; @@ -449,20 +469,21 @@ public class Gun556mmFactory { meteor.shooter = projectile.shooter; projectile.worldObj.spawnEntityInWorld(meteor); }; - + return bullet; } public static BulletConfiguration get556KConfig() { - BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + BulletConfiguration bullet = get556Config(); - bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 13); + bullet.ammo.meta = 14; bullet.dmgMin = 0; bullet.dmgMax = 0; bullet.penetration = 0; bullet.maxAge = 0; - + bullet.wear /= 2; + return bullet; } } \ No newline at end of file diff --git a/src/main/java/com/hbm/handler/guncfg/Gun5mmFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun5mmFactory.java index c5a0b866b..7d162bcd2 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun5mmFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun5mmFactory.java @@ -1,6 +1,7 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; @@ -9,10 +10,14 @@ import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; import com.hbm.render.util.RenderScreenOverlay.Crosshair; public class Gun5mmFactory { + public static final SpentCasingConfig CASING_5MM = Gun22LRFactory.CASING_22LR.toBuilder("5mm").setCasingAmount(5).build(), + CASING_5MM_TURRET = CASING_5MM.toBuilder("5mmTurret").setCasingAmount(1).build(); + public static GunConfiguration getMinigunConfig() { GunConfiguration config = new GunConfiguration(); @@ -32,6 +37,8 @@ public class Gun5mmFactory { config.config = HbmCollection.fiveMM; + config.casingConfig = Optional.of(CASING_5MM); + return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun762mmFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun762mmFactory.java index 50e370d68..6591e9a72 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun762mmFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun762mmFactory.java @@ -1,6 +1,7 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; @@ -8,6 +9,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; import com.hbm.potion.HbmPotion; import com.hbm.render.util.RenderScreenOverlay.Crosshair; @@ -16,6 +18,10 @@ import net.minecraft.potion.PotionEffect; public class Gun762mmFactory { + // TODO Confirm + static final SpentCasingConfig CASING_762_NATO = Gun556mmFactory.CONFIG_556.toBuilder("762NATO").setSmokeChance(2).setScaleX(2) + .setScaleZ(2.5f).build(); + public static GunConfiguration getUACDMRConfig() { final GunConfiguration config = new GunConfiguration(); @@ -42,6 +48,8 @@ public class Gun762mmFactory config.config.addAll(HbmCollection.threeZeroEight); + config.casingConfig = Optional.of(CASING_762_NATO); + return config; } @@ -118,6 +126,8 @@ public class Gun762mmFactory config.advFuncLore.add("extra ammunition, and reloads and spots targets for the gunner. The ammunition bearer carries additional ammunition"); config.advFuncLore.add("and the tripod with associated traversing and elevation mechanism, if issued, and fetches more ammunition as needed"); config.advFuncLore.add("during firing."); + + config.casingConfig = Optional.of(CASING_762_NATO); return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun9mmFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun9mmFactory.java index 0d2c60532..a1bcf8cf8 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun9mmFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun9mmFactory.java @@ -1,7 +1,9 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; +import com.hbm.calc.EasyLocation; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; @@ -9,14 +11,21 @@ import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.BusAnimationKeyframe; import com.hbm.render.anim.BusAnimationSequence; import com.hbm.render.anim.HbmAnimations.AnimType; import com.hbm.render.util.RenderScreenOverlay.Crosshair; +import net.minecraft.util.Vec3; + public class Gun9mmFactory { + static final SpentCasingConfig CASING_9 = Gun45ACPFactory.CASING_45_UAC.toBuilder("9") + .setInitialMotion(Vec3.createVectorHelper(-0.3, 0.6, 0)).setPosOffset(new EasyLocation(-0.35, -0.2, 0.55)) + .setScaleX(1).setScaleY(1).setScaleZ(0.6f).setBounceSound("weapon.smallCasingBouncePB3").build(); + public static GunConfiguration getMP40Config() { GunConfiguration config = new GunConfiguration(); @@ -46,6 +55,8 @@ public class Gun9mmFactory { config.config.add(BulletConfigSyncingUtil.CHL_P9); config.config.add(BulletConfigSyncingUtil.P9_ROCKET); + config.casingConfig = Optional.of(CASING_9); + return config; } @@ -77,6 +88,8 @@ public class Gun9mmFactory { config.config.add(BulletConfigSyncingUtil.P9_DU); config.config.add(BulletConfigSyncingUtil.CHL_P9); config.config.add(BulletConfigSyncingUtil.P9_ROCKET); + + config.casingConfig = Optional.of(CASING_9); return config; } @@ -110,6 +123,8 @@ public class Gun9mmFactory { .addBus("RECOIL", new BusAnimationSequence() .addKeyframe(new BusAnimationKeyframe(0, 0, -0.1, 30)) .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 30)))); + + config.casingConfig = Optional.of(CASING_9); return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/GunCannonFactory.java b/src/main/java/com/hbm/handler/guncfg/GunCannonFactory.java index 0e667779f..ad62fdf50 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunCannonFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunCannonFactory.java @@ -1,13 +1,30 @@ package com.hbm.handler.guncfg; +import com.hbm.calc.EasyLocation; import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.handler.BulletConfiguration; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfigBuilder; +import com.hbm.particle.SpentCasingConfig.CasingType; + +import net.minecraft.util.Vec3; public class GunCannonFactory { + + private static final SpentCasingConfigBuilder CASING_CANNON_BUILDER = new SpentCasingConfigBuilder("240", CasingType.BRASS_BOTTLENECK, false) + .setInitialMotion(Vec3.createVectorHelper(0, 0.2, -1)).setPosOffset(new EasyLocation(0, 1.75, -1.5)).setSmokeChance(0) + .setScaleX(10).setScaleY(10).setScaleZ(10).setPitchFactor(0.15f).setYawFactor(0.015f); + public static final SpentCasingConfig + CASING_240 = CASING_CANNON_BUILDER.build(), + + CASING_16IN = CASING_CANNON_BUILDER.setRegistryName("16inch").setInitialMotion(Vec3.createVectorHelper(0, 2, -1.75)) + .setScaleX(20).setScaleY(20).setScaleZ(25).setCasingType(CasingType.BRASS_STRAIGHT_WALL) + .build(); + static final int stockPen = 10000; static byte i = 0; public static BulletConfiguration getShellConfig() { @@ -17,8 +34,8 @@ public class GunCannonFactory { bullet.ammo = new ComparableStack(ModItems.ammo_shell, 1, i++); bullet.dmgMin = 225; bullet.dmgMax = 235; - bullet.penetration = stockPen; - bullet.explosive = 40F; + bullet.penetration = 40; + bullet.explosive = 20F; bullet.blockDamage = false; return bullet; @@ -31,8 +48,8 @@ public class GunCannonFactory { bullet.ammo = new ComparableStack(ModItems.ammo_shell, 1, i++); bullet.dmgMin = 235; bullet.dmgMax = 245; - bullet.penetration = stockPen; - bullet.explosive = 40F; + bullet.penetration = 50; + bullet.explosive = 25F; bullet.blockDamage = true; return bullet; diff --git a/src/main/java/com/hbm/handler/guncfg/GunDGKFactory.java b/src/main/java/com/hbm/handler/guncfg/GunDGKFactory.java index aa61cff4e..db11ee141 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunDGKFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunDGKFactory.java @@ -1,11 +1,20 @@ package com.hbm.handler.guncfg; +import com.hbm.calc.EasyLocation; import com.hbm.handler.BulletConfiguration; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; +import com.hbm.particle.SpentCasingConfig; + +import net.minecraft.util.Vec3; public class GunDGKFactory { + public static final SpentCasingConfig CASING_DGK = Gun50BMGFactory.CONFIG_LUNA.toBuilder("dgk") + .setInitialMotion(Vec3.createVectorHelper(0.8, 1, 0)).setPosOffset(new EasyLocation(0.15, 1.5, -1.5)) + .setOverrideColor(false).setPitchFactor(0.1f).setYawFactor(0.08f) + .build(); + public static BulletConfiguration getDGKConfig() { BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); diff --git a/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java b/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java index e8bd2a05c..2f52fadef 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java @@ -1,6 +1,7 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Optional; import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityCloudTom; @@ -11,10 +12,17 @@ import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfigBuilder; +import com.hbm.particle.SpentCasingConfig.CasingType; import com.hbm.render.util.RenderScreenOverlay.Crosshair; public class GunGrenadeFactory { + static final SpentCasingConfig CASING_40 = new SpentCasingConfigBuilder("40", CasingType.BRASS_STRAIGHT_WALL, false) + .setSmokeChance(0).setScaleX(4).setScaleY(4).setScaleZ(3).setAfterReload(true).setPitchFactor(0.02f).setYawFactor(0.03f) + .build(); + public static GunConfiguration getHK69Config() { GunConfiguration config = new GunConfiguration(); @@ -40,6 +48,8 @@ public class GunGrenadeFactory { config.config = new ArrayList(); config.config.addAll(HbmCollection.grenade); config.durability = 300; + + config.casingConfig = Optional.of(GunGrenadeFactory.CASING_40); return config; } diff --git a/src/main/java/com/hbm/handler/guncfg/GunOSIPRFactory.java b/src/main/java/com/hbm/handler/guncfg/GunOSIPRFactory.java index e662b397d..0829183a2 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunOSIPRFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunOSIPRFactory.java @@ -1,24 +1,41 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Optional; import com.hbm.blocks.generic.RedBarrel; +import com.hbm.calc.EasyLocation; +import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; +import com.hbm.interfaces.ILocationProvider; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.lib.HbmCollection.EnumGunManufacturer; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.particle.SpentCasingConfigBuilder; +import com.hbm.particle.SpentCasingConfig.CasingType; +import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; import com.hbm.potion.HbmPotion; import com.hbm.render.util.RenderScreenOverlay.Crosshair; import net.minecraft.block.Block; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; public class GunOSIPRFactory { + static final SpentCasingConfig CASING_AR2 = new SpentCasingConfigBuilder("ar2", CasingType.AR2, false) + .setSmokeChance(0).setInitialMotion(Vec3.createVectorHelper(-0.15, 0.2, 0)).setPitchFactor(0.02f) + .setAfterReload(true).setPosOffset(new EasyLocation(-0.4, 0, 0)).build(); + public static GunConfiguration getOSIPRConfig() { GunConfiguration config = new GunConfiguration(); @@ -44,6 +61,8 @@ public class GunOSIPRFactory { config.config = new ArrayList(); config.config.add(BulletConfigSyncingUtil.SPECIAL_OSIPR); + config.casingConfig = Optional.of(CASING_AR2); + return config; } @@ -151,37 +170,41 @@ public class GunOSIPRFactory { return bullet; } -// private static void tryRedirectBall(EntityBulletBase ball, EntityLivingBase lastHit) -// { -// if (!ball.worldObj.isRemote) -// { -// final ILocationProvider ballLoc = ILocationProvider.wrap(ball, false), targetLoc; -// final Vec3 newVector; -// final List entities = ball.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(ball.posX - 10, ball.posY - 10, ball.posZ - 10, ball.posX + 10, ball.posY + 10, ball.posZ + 10)); -// entities.remove(ball); -// entities.remove(ball.shooter); -// entities.remove(lastHit); -// entities.removeIf(e -> Library.isObstructed(ball.worldObj, ballLoc, ILocationProvider.wrap(e, false))); -// if (entities.isEmpty()) -// return; -// -// entities.sort(Comparator.comparing(e -> ILocationProvider.distance(ILocationProvider.wrap(e, false), ballLoc))); -// -// targetLoc = ILocationProvider.wrap(entities.get(0), false); -// newVector = ILocationProvider.makeVector(ballLoc, targetLoc).normalize(); -// -// System.out.println(ballLoc); -// System.out.println(targetLoc); -// System.out.println(newVector); -// System.out.println(Vec3.createVectorHelper(ball.motionX, ball.motionY, ball.motionZ)); -// -// final double total = ball.motionX + ball.motionY + ball.motionZ; -// -// ball.motionX = newVector.xCoord * total; -// ball.motionY = newVector.yCoord * total; -// ball.motionZ = newVector.zCoord * total; -// -// System.out.println(Vec3.createVectorHelper(ball.motionX, ball.motionY, ball.motionZ)); -// } -// } -} \ No newline at end of file + private static void tryRedirectBall(EntityBulletBase ball, EntityLivingBase lastHit) + { + if (!ball.worldObj.isRemote) + { + final ILocationProvider ballLoc = ILocationProvider.wrap(ball, false), targetLoc; + final Vec3 newVector; + final List entities = ball.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(ball.posX - 10, ball.posY - 10, ball.posZ - 10, ball.posX + 10, ball.posY + 10, ball.posZ + 10)); + entities.remove(ball); + entities.remove(ball.shooter); + entities.remove(lastHit); + entities.removeIf(e -> Library.isObstructed(ball.worldObj, ballLoc, ILocationProvider.wrap(e, false))); + if (entities.isEmpty()) + return; + + entities.sort(Comparator.comparing(e -> ILocationProvider.distance(ILocationProvider.wrap(e, false), ballLoc))); + + targetLoc = ILocationProvider.wrap(entities.get(0), false); + + System.out.println(ballLoc); + System.out.println(targetLoc); + System.out.println(Vec3.createVectorHelper(ball.motionX, ball.motionY, ball.motionZ)); + + final double oldMagnitude = Math.sqrt(ball.motionX * ball.motionX + ball.motionY * ball.motionY + ball.motionZ * ball.motionZ), newMagnitude; + newVector = Vec3.createVectorHelper( + targetLoc.posX() - ball.motionX, + targetLoc.posY() - ball.motionY, + targetLoc.posZ() - ball.motionZ + ); + newMagnitude = Math.sqrt(newVector.xCoord * newVector.xCoord + newVector.yCoord * newVector.yCoord + newVector.zCoord * newVector.zCoord); + + ball.motionX = newVector.xCoord * oldMagnitude / newMagnitude; + ball.motionY = newVector.yCoord * oldMagnitude / newMagnitude; + ball.motionZ = newVector.zCoord * oldMagnitude / newMagnitude; + + System.out.println(Vec3.createVectorHelper(ball.motionX, ball.motionY, ball.motionZ)); + } + } +} diff --git a/src/main/java/com/hbm/interfaces/IByteSerializable.java b/src/main/java/com/hbm/interfaces/IByteSerializable.java new file mode 100644 index 000000000..d23d7552b --- /dev/null +++ b/src/main/java/com/hbm/interfaces/IByteSerializable.java @@ -0,0 +1,19 @@ +package com.hbm.interfaces; + +import com.hbm.main.DeserializationException; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + +public interface IByteSerializable +{ + public void writeToBytes(ByteBuf buf); + public void readFromBytes(byte[] bytes) throws DeserializationException; + + public default byte[] writeToBytes() + { + final ByteBuf buf = Unpooled.buffer(); + writeToBytes(buf); + return buf.array(); + } +} diff --git a/src/main/java/com/hbm/interfaces/INBTSerializable.java b/src/main/java/com/hbm/interfaces/INBTSerializable.java new file mode 100644 index 000000000..8dc9b42f7 --- /dev/null +++ b/src/main/java/com/hbm/interfaces/INBTSerializable.java @@ -0,0 +1,16 @@ +package com.hbm.interfaces; + +import net.minecraft.nbt.NBTTagCompound; + +public interface INBTSerializable +{ + public void writeToNBT(NBTTagCompound nbt); + public void readFromNBT(NBTTagCompound nbt); + + public default NBTTagCompound writeToNBT() + { + final NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return nbt; + } +} diff --git a/src/main/java/com/hbm/items/ItemAmmoEnums.java b/src/main/java/com/hbm/items/ItemAmmoEnums.java index 900973025..bffbef5b8 100644 --- a/src/main/java/com/hbm/items/ItemAmmoEnums.java +++ b/src/main/java/com/hbm/items/ItemAmmoEnums.java @@ -560,9 +560,9 @@ public class ItemAmmoEnums STAR(Gun50BMGFactory.get50BMGStarConfig(), HbmCollection.StarmetalType), CHLOROPHYTE(Gun50BMGFactory.get50BMGConfig().getChlorophyte(), HbmCollection.ChlorophyteType), SLEEK(Gun50BMGFactory.get50BMGSleekConfig(), AmmoItemTrait.NEU_MASKMAN_METEORITE), - FLECHETTE(Gun50BMGFactory.get50BMGFlechetteConfig()), - FLECHETTE_AM(Gun50BMGFactory.get50BMGFlechetteAMConfig()), - FLECHETTE_PO(Gun50BMGFactory.get50BMGFlechettePOConfig()); + FLECHETTE(Gun50BMGFactory.get50BMGFlechetteConfig(), AmmoItemTrait.PRO_DAMAGE), + FLECHETTE_AM(Gun50BMGFactory.get50BMGFlechetteAMConfig(), AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_UHH), + FLECHETTE_PO(Gun50BMGFactory.get50BMGFlechettePOConfig(), AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_UHH); private final Set traits; private final BulletConfiguration config; private Ammo50BMG(BulletConfiguration config, AmmoItemTrait...traits) diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 69fdac079..b0b95df35 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -2,26 +2,17 @@ package com.hbm.items.tool; import java.util.List; -import com.hbm.blocks.ModBlocks; -import com.hbm.entity.effect.EntityNukeTorex; -import com.hbm.entity.mob.siege.EntitySiegeTunneler; -import com.hbm.items.ModItems; -import com.hbm.items.special.ItemKitCustom; import com.hbm.lib.Library; import com.hbm.world.feature.OilSpot; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class ItemWandD extends Item { - + @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { diff --git a/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java b/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java index 803b44ed5..463207c36 100644 --- a/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java +++ b/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java @@ -41,17 +41,17 @@ import net.minecraft.util.Vec3; public class ItemAmmoArty extends Item { - public static ArtilleryShell[] itemTypes = new ArtilleryShell[ /* >>> */ 8 /* <<< */ ]; - public static ArtilleryShell[] shellTypes = new ArtilleryShell[ /* >>> */ 8 /* <<< */ ]; + public static final ArtilleryShell[] itemTypes = new ArtilleryShell[ /* >>> */ 8 /* <<< */ ]; + public static final ArtilleryShell[] shellTypes = new ArtilleryShell[ /* >>> */ 8 /* <<< */ ]; /* item types */ - public final int NORMAL = 0; - public final int CLASSIC = 1; - public final int EXPLOSIVE = 2; - public final int MINI_NUKE = 3; - public final int NUKE = 4; - public final int PHOSPHORUS = 5; - public final int MINI_NUKE_MULTI = 6; - public final int PHOSPHORUS_MULTI = 7; + public static final int NORMAL = 0; + public static final int CLASSIC = 1; + public static final int EXPLOSIVE = 2; + public static final int MINI_NUKE = 3; + public static final int NUKE = 4; + public static final int PHOSPHORUS = 5; + public static final int MINI_NUKE_MULTI = 6; + public static final int PHOSPHORUS_MULTI = 7; /* non-item shell types */ public ItemAmmoArty() { @@ -118,11 +118,13 @@ public class ItemAmmoArty extends Item { list.add(r + "(that is the best skull and crossbones"); list.add(r + "minecraft's unicode has to offer)"); break; + default: break; } } private IIcon[] icons = new IIcon[itemTypes.length]; + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister reg) { @@ -204,12 +206,16 @@ public class ItemAmmoArty extends Item { private void init() { /* STANDARD SHELLS */ - this.shellTypes[NORMAL] = this.itemTypes[NORMAL] = new ArtilleryShell("ammo_arty") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); }}; - this.shellTypes[CLASSIC] = this.itemTypes[CLASSIC] = new ArtilleryShell("ammo_arty_classic") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 5F, false); }}; - this.shellTypes[EXPLOSIVE] = this.itemTypes[EXPLOSIVE] = new ArtilleryShell("ammo_arty_he") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 3F, true); }}; + ItemAmmoArty.shellTypes[NORMAL] = ItemAmmoArty.itemTypes[NORMAL] = new ArtilleryShell("ammo_arty") { @Override + public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); }}; + ItemAmmoArty.shellTypes[CLASSIC] = ItemAmmoArty.itemTypes[CLASSIC] = new ArtilleryShell("ammo_arty_classic") { @Override + public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 5F, false); }}; + ItemAmmoArty.shellTypes[EXPLOSIVE] = ItemAmmoArty.itemTypes[EXPLOSIVE] = new ArtilleryShell("ammo_arty_he") { @Override + public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 3F, true); }}; /* MINI NUKE */ - this.shellTypes[MINI_NUKE] = this.itemTypes[MINI_NUKE] = new ArtilleryShell("ammo_arty_mini_nuke") { + ItemAmmoArty.shellTypes[MINI_NUKE] = ItemAmmoArty.itemTypes[MINI_NUKE] = new ArtilleryShell("ammo_arty_mini_nuke") { + @Override public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { shell.killAndClear(); Vec3 vec = Vec3.createVectorHelper(shell.motionX, shell.motionY, shell.motionZ).normalize(); @@ -218,7 +224,8 @@ public class ItemAmmoArty extends Item { }; /* FULL NUKE */ - this.shellTypes[NUKE] = this.itemTypes[NUKE] = new ArtilleryShell("ammo_arty_nuke") { + ItemAmmoArty.shellTypes[NUKE] = ItemAmmoArty.itemTypes[NUKE] = new ArtilleryShell("ammo_arty_nuke") { + @Override public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { shell.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(shell.worldObj, BombConfig.missileRadius, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord)); EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(shell.worldObj, 1000, BombConfig.missileRadius * 0.005F); @@ -231,7 +238,8 @@ public class ItemAmmoArty extends Item { }; /* PHOSPHORUS */ - this.shellTypes[PHOSPHORUS] = this.itemTypes[PHOSPHORUS] = new ArtilleryShell("ammo_arty_phosphorus") { + ItemAmmoArty.shellTypes[PHOSPHORUS] = ItemAmmoArty.itemTypes[PHOSPHORUS] = new ArtilleryShell("ammo_arty_phosphorus") { + @Override public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); shell.worldObj.playSoundEffect(shell.posX, shell.posY, shell.posZ, "hbm:weapon.explosionMedium", 20.0F, 0.9F + shell.worldObj.rand.nextFloat() * 0.2F); @@ -260,12 +268,16 @@ public class ItemAmmoArty extends Item { }; /* CLUSTER SHELLS */ - this.shellTypes[PHOSPHORUS_MULTI] = this.itemTypes[PHOSPHORUS_MULTI] = new ArtilleryShell("ammo_arty_phosphorus_multi") { - public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.this.shellTypes[PHOSPHORUS].onImpact(shell, mop); } + ItemAmmoArty.shellTypes[PHOSPHORUS_MULTI] = ItemAmmoArty.itemTypes[PHOSPHORUS_MULTI] = new ArtilleryShell("ammo_arty_phosphorus_multi") { + @Override + public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.shellTypes[PHOSPHORUS].onImpact(shell, mop); } + @Override public void onUpdate(EntityArtilleryShell shell) { standardCluster(shell, PHOSPHORUS, 10, 300, 5); } }; - this.shellTypes[MINI_NUKE_MULTI] = this.itemTypes[MINI_NUKE_MULTI] = new ArtilleryShell("ammo_arty_mini_nuke_multi") { - public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.this.shellTypes[MINI_NUKE].onImpact(shell, mop); } + ItemAmmoArty.shellTypes[MINI_NUKE_MULTI] = ItemAmmoArty.itemTypes[MINI_NUKE_MULTI] = new ArtilleryShell("ammo_arty_mini_nuke_multi") { + @Override + public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.shellTypes[MINI_NUKE].onImpact(shell, mop); } + @Override public void onUpdate(EntityArtilleryShell shell) { standardCluster(shell, MINI_NUKE, 5, 300, 5); } }; } diff --git a/src/main/java/com/hbm/items/weapon/ItemGunBase.java b/src/main/java/com/hbm/items/weapon/ItemGunBase.java index 58186803b..23d2dee3f 100644 --- a/src/main/java/com/hbm/items/weapon/ItemGunBase.java +++ b/src/main/java/com/hbm/items/weapon/ItemGunBase.java @@ -16,10 +16,12 @@ import com.hbm.interfaces.IItemHUD; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.IEquipReceiver; import com.hbm.lib.HbmCollection; +import com.hbm.main.MainRegistry; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.GunAnimationPacket; import com.hbm.packet.GunButtonPacket; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import com.hbm.render.anim.BusAnimation; import com.hbm.render.anim.HbmAnimations.AnimType; import com.hbm.render.util.RenderScreenOverlay; @@ -208,6 +210,9 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu } world.playSoundAtEntity(player, mainConfig.firingSound, 1.0F, mainConfig.firingPitch); + + if (mainConfig.casingConfig.isPresent() && !mainConfig.casingConfig.get().isAfterReload()) + spawnCasing(player, mainConfig.casingConfig.get(), stack); if(player.getDisplayName().equals("Vic4Games")) { NBTTagCompound nbt = new NBTTagCompound(); @@ -245,6 +250,9 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu } world.playSoundAtEntity(player, altConfig.firingSound, 1.0F, altConfig.firingPitch); + + if (altConfig.casingConfig.isPresent()) + spawnCasing(player, altConfig.casingConfig.get(), stack); } //spawns the actual projectile, can be overridden to change projectile entity @@ -438,6 +446,10 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu if(hasLoaded && mainConfig.reloadSoundEnd) world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F); + + if (mainConfig.casingConfig.isPresent() && mainConfig.casingConfig.get().isAfterReload()) + spawnCasing(player, mainConfig.casingConfig.get(), stack); + InventoryUtil.doesPlayerHaveAStack(player, ammo, true, false); } else { setReloadCycle(stack, getReloadCycle(stack) - 1); @@ -579,6 +591,8 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu list.add("Is Reloading: " + getIsReloading(stack)); list.add("Reload Cycle: " + getReloadCycle(stack)); list.add("RoF Cooldown: " + getDelay(stack)); +// list.add("Casing Spawning: " + stack.stackTagCompound.getBoolean("casingReady")); +// list.add("Casing Cooldown: " + stack.stackTagCompound.getByte("casingDelay")); } if (!mainConfig.advLore.isEmpty() || !mainConfig.advFuncLore.isEmpty()) list.add(""); @@ -844,10 +858,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu event.setCanceled(true); - if(!(gcfg.hasSights && player.isSneaking())) - RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, ((IHoldableWeapon)player.getHeldItem().getItem()).getCrosshair()); - else - RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, Crosshair.NONE); + RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, (gcfg.hasSights && player.isSneaking()) ? Crosshair.NONE : ((IHoldableWeapon)player.getHeldItem().getItem()).getCrosshair()); } } @@ -863,4 +874,19 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu if (!mainConfig.equipSound.isEmpty() && !player.worldObj.isRemote) player.worldObj.playSoundAtEntity(player, mainConfig.equipSound, 1, 1); } + + // TODO Do something to handle delays + protected static void spawnCasing(Entity entity, SpentCasingConfig config, ItemStack stack) + { + final NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "casing"); + data.setDouble("posX", entity.posX); + data.setDouble("posY", entity.posY + entity.getEyeHeight()); + data.setDouble("posZ", entity.posZ); + data.setFloat("pitch", (float) Math.toRadians(entity.rotationPitch)); + data.setFloat("yaw", (float) Math.toRadians(entity.rotationYaw)); + data.setBoolean("crouched", entity.isSneaking()); + data.setString("name", config.getRegistryName()); + MainRegistry.proxy.effectNT(data); + } } diff --git a/src/main/java/com/hbm/lib/Library.java b/src/main/java/com/hbm/lib/Library.java index 3c261c648..01cb315a8 100644 --- a/src/main/java/com/hbm/lib/Library.java +++ b/src/main/java/com/hbm/lib/Library.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.Set; +import java.util.stream.Collectors; import com.google.common.collect.Sets; import com.hbm.blocks.ModBlocks; @@ -106,6 +107,26 @@ public class Library { public static final ForgeDirection POS_Z = ForgeDirection.SOUTH; public static final ForgeDirection NEG_Z = ForgeDirection.NORTH; + public static List mergeWithoutDuplicates(List...lists) + { + final List totalList = new ArrayList(); + for (List list : lists) + totalList.addAll(list); + return listWithoutDuplicates(totalList); + } + + public static List listWithoutDuplicates(List list) + { + return list.stream().distinct().collect(Collectors.toList()); + } + + public static void removeListDuplicates(List list) + { + final List newList = listWithoutDuplicates(list); + list.clear(); + list.addAll(newList); + } + /* * Is putting this into this trash can a good idea? No. Do I have a better idea? Not currently. */ diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index ce92f0c7c..e738d14f5 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -1,5 +1,637 @@ package com.hbm.main; +import java.awt.Color; +import java.awt.Desktop; +import java.net.URI; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; +import com.hbm.blocks.generic.BlockEmitter.TileEntityEmitter; +import com.hbm.blocks.generic.BlockLoot.TileEntityLoot; +import com.hbm.config.WeaponConfig; +import com.hbm.entity.cart.EntityMinecartCrate; +import com.hbm.entity.cart.EntityMinecartNTM; +import com.hbm.entity.effect.EntityBlackHole; +import com.hbm.entity.effect.EntityCloudFleija; +import com.hbm.entity.effect.EntityCloudFleijaRainbow; +import com.hbm.entity.effect.EntityCloudSolinium; +import com.hbm.entity.effect.EntityCloudTom; +import com.hbm.entity.effect.EntityEMPBlast; +import com.hbm.entity.effect.EntityFalloutRain; +import com.hbm.entity.effect.EntityNukeCloudBig; +import com.hbm.entity.effect.EntityNukeCloudNoShroom; +import com.hbm.entity.effect.EntityNukeCloudSmall; +import com.hbm.entity.effect.EntityNukeTorex; +import com.hbm.entity.effect.EntityQuasar; +import com.hbm.entity.effect.EntityRagingVortex; +import com.hbm.entity.effect.EntitySpear; +import com.hbm.entity.effect.EntityVortex; +import com.hbm.entity.grenade.EntityGrenadeASchrab; +import com.hbm.entity.grenade.EntityGrenadeBlackHole; +import com.hbm.entity.grenade.EntityGrenadeBouncyBaseNT; +import com.hbm.entity.grenade.EntityGrenadeBouncyGeneric; +import com.hbm.entity.grenade.EntityGrenadeBreach; +import com.hbm.entity.grenade.EntityGrenadeBurst; +import com.hbm.entity.grenade.EntityGrenadeCloud; +import com.hbm.entity.grenade.EntityGrenadeCluster; +import com.hbm.entity.grenade.EntityGrenadeDynamite; +import com.hbm.entity.grenade.EntityGrenadeElectric; +import com.hbm.entity.grenade.EntityGrenadeFire; +import com.hbm.entity.grenade.EntityGrenadeFlare; +import com.hbm.entity.grenade.EntityGrenadeFrag; +import com.hbm.entity.grenade.EntityGrenadeGas; +import com.hbm.entity.grenade.EntityGrenadeGascan; +import com.hbm.entity.grenade.EntityGrenadeGeneric; +import com.hbm.entity.grenade.EntityGrenadeIFBouncy; +import com.hbm.entity.grenade.EntityGrenadeIFBrimstone; +import com.hbm.entity.grenade.EntityGrenadeIFConcussion; +import com.hbm.entity.grenade.EntityGrenadeIFGeneric; +import com.hbm.entity.grenade.EntityGrenadeIFHE; +import com.hbm.entity.grenade.EntityGrenadeIFHopwire; +import com.hbm.entity.grenade.EntityGrenadeIFImpact; +import com.hbm.entity.grenade.EntityGrenadeIFIncendiary; +import com.hbm.entity.grenade.EntityGrenadeIFMystery; +import com.hbm.entity.grenade.EntityGrenadeIFNull; +import com.hbm.entity.grenade.EntityGrenadeIFSpark; +import com.hbm.entity.grenade.EntityGrenadeIFSticky; +import com.hbm.entity.grenade.EntityGrenadeIFToxic; +import com.hbm.entity.grenade.EntityGrenadeImpactGeneric; +import com.hbm.entity.grenade.EntityGrenadeLemon; +import com.hbm.entity.grenade.EntityGrenadeMIRV; +import com.hbm.entity.grenade.EntityGrenadeMk2; +import com.hbm.entity.grenade.EntityGrenadeNuclear; +import com.hbm.entity.grenade.EntityGrenadeNuke; +import com.hbm.entity.grenade.EntityGrenadePC; +import com.hbm.entity.grenade.EntityGrenadePlasma; +import com.hbm.entity.grenade.EntityGrenadePoison; +import com.hbm.entity.grenade.EntityGrenadePulse; +import com.hbm.entity.grenade.EntityGrenadeSchrabidium; +import com.hbm.entity.grenade.EntityGrenadeShrapnel; +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.entity.item.EntityFireworks; +import com.hbm.entity.item.EntityMagnusCartus; +import com.hbm.entity.item.EntityMinecartTest; +import com.hbm.entity.item.EntityMovingItem; +import com.hbm.entity.item.EntityMovingPackage; +import com.hbm.entity.item.EntityTNTPrimedBase; +import com.hbm.entity.logic.EntityBomber; +import com.hbm.entity.logic.EntityDeathBlast; +import com.hbm.entity.logic.EntityEMP; +import com.hbm.entity.logic.EntityNukeExplosionAdvanced; +import com.hbm.entity.missile.EntityBobmazon; +import com.hbm.entity.missile.EntityBombletSelena; +import com.hbm.entity.missile.EntityBombletTheta; +import com.hbm.entity.missile.EntityBooster; +import com.hbm.entity.missile.EntityCarrier; +import com.hbm.entity.missile.EntityMIRV; +import com.hbm.entity.missile.EntityMinerRocket; +import com.hbm.entity.missile.EntityMissileAntiBallistic; +import com.hbm.entity.missile.EntityMissileBHole; +import com.hbm.entity.missile.EntityMissileBunkerBuster; +import com.hbm.entity.missile.EntityMissileBurst; +import com.hbm.entity.missile.EntityMissileBusterStrong; +import com.hbm.entity.missile.EntityMissileCluster; +import com.hbm.entity.missile.EntityMissileClusterStrong; +import com.hbm.entity.missile.EntityMissileCustom; +import com.hbm.entity.missile.EntityMissileDoomsday; +import com.hbm.entity.missile.EntityMissileDrill; +import com.hbm.entity.missile.EntityMissileEMP; +import com.hbm.entity.missile.EntityMissileEMPStrong; +import com.hbm.entity.missile.EntityMissileEndo; +import com.hbm.entity.missile.EntityMissileExo; +import com.hbm.entity.missile.EntityMissileGeneric; +import com.hbm.entity.missile.EntityMissileIncendiary; +import com.hbm.entity.missile.EntityMissileIncendiaryStrong; +import com.hbm.entity.missile.EntityMissileInferno; +import com.hbm.entity.missile.EntityMissileMicro; +import com.hbm.entity.missile.EntityMissileMirv; +import com.hbm.entity.missile.EntityMissileNuclear; +import com.hbm.entity.missile.EntityMissileRain; +import com.hbm.entity.missile.EntityMissileSchrabidium; +import com.hbm.entity.missile.EntityMissileShuttle; +import com.hbm.entity.missile.EntityMissileStrong; +import com.hbm.entity.missile.EntityMissileTaint; +import com.hbm.entity.missile.EntityMissileVolcano; +import com.hbm.entity.missile.EntitySiegeDropship; +import com.hbm.entity.missile.EntitySoyuz; +import com.hbm.entity.missile.EntitySoyuzCapsule; +import com.hbm.entity.missile.EntityTestMissile; +import com.hbm.entity.mob.EntityBlockSpider; +import com.hbm.entity.mob.EntityCyberCrab; +import com.hbm.entity.mob.EntityDuck; +import com.hbm.entity.mob.EntityFBI; +import com.hbm.entity.mob.EntityGhost; +import com.hbm.entity.mob.EntityHunterChopper; +import com.hbm.entity.mob.EntityMaskMan; +import com.hbm.entity.mob.EntityNuclearCreeper; +import com.hbm.entity.mob.EntityQuackos; +import com.hbm.entity.mob.EntityRADBeast; +import com.hbm.entity.mob.EntityTaintCrab; +import com.hbm.entity.mob.EntityTaintedCreeper; +import com.hbm.entity.mob.EntityTeslaCrab; +import com.hbm.entity.mob.EntityUFO; +import com.hbm.entity.mob.botprime.EntityBOTPrimeBody; +import com.hbm.entity.mob.botprime.EntityBOTPrimeHead; +import com.hbm.entity.mob.siege.EntitySiegeCraft; +import com.hbm.entity.mob.siege.EntitySiegeSkeleton; +import com.hbm.entity.mob.siege.EntitySiegeTunneler; +import com.hbm.entity.mob.siege.EntitySiegeUFO; +import com.hbm.entity.mob.siege.EntitySiegeZombie; +import com.hbm.entity.particle.EntityBSmokeFX; +import com.hbm.entity.particle.EntityChlorineFX; +import com.hbm.entity.particle.EntityDSmokeFX; +import com.hbm.entity.particle.EntityFogFX; +import com.hbm.entity.particle.EntityGasFX; +import com.hbm.entity.particle.EntityOilSpillFX; +import com.hbm.entity.particle.EntityOrangeFX; +import com.hbm.entity.particle.EntityPinkCloudFX; +import com.hbm.entity.particle.EntitySSmokeFX; +import com.hbm.entity.particle.EntitySmokeFX; +import com.hbm.entity.particle.EntityTSmokeFX; +import com.hbm.entity.projectile.EntityAAShell; +import com.hbm.entity.projectile.EntityArtilleryShell; +import com.hbm.entity.projectile.EntityBeamVortex; +import com.hbm.entity.projectile.EntityBombletZeta; +import com.hbm.entity.projectile.EntityBoxcar; +import com.hbm.entity.projectile.EntityBuilding; +import com.hbm.entity.projectile.EntityBullet; +import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.entity.projectile.EntityBurningFOEQ; +import com.hbm.entity.projectile.EntityChemical; +import com.hbm.entity.projectile.EntityChopperMine; +import com.hbm.entity.projectile.EntityCog; +import com.hbm.entity.projectile.EntityCombineBall; +import com.hbm.entity.projectile.EntityDischarge; +import com.hbm.entity.projectile.EntityDuchessGambit; +import com.hbm.entity.projectile.EntityExplosiveBeam; +import com.hbm.entity.projectile.EntityFallingNuke; +import com.hbm.entity.projectile.EntityFire; +import com.hbm.entity.projectile.EntityLN2; +import com.hbm.entity.projectile.EntityLaser; +import com.hbm.entity.projectile.EntityLaserBeam; +import com.hbm.entity.projectile.EntityMeteor; +import com.hbm.entity.projectile.EntityMinerBeam; +import com.hbm.entity.projectile.EntityModBeam; +import com.hbm.entity.projectile.EntityNightmareBlast; +import com.hbm.entity.projectile.EntityOilSpill; +import com.hbm.entity.projectile.EntityPlasmaBeam; +import com.hbm.entity.projectile.EntityRBMKDebris; +import com.hbm.entity.projectile.EntityRainbow; +import com.hbm.entity.projectile.EntityRocket; +import com.hbm.entity.projectile.EntityRocketHoming; +import com.hbm.entity.projectile.EntityRubble; +import com.hbm.entity.projectile.EntitySawblade; +import com.hbm.entity.projectile.EntitySchrab; +import com.hbm.entity.projectile.EntityShrapnel; +import com.hbm.entity.projectile.EntitySiegeLaser; +import com.hbm.entity.projectile.EntitySparkBeam; +import com.hbm.entity.projectile.EntityTom; +import com.hbm.entity.projectile.EntityWaterSplash; +import com.hbm.entity.projectile.EntityZirnoxDebris; +import com.hbm.handler.HbmKeybinds; +import com.hbm.handler.HbmKeybinds.EnumKeybind; +import com.hbm.items.ItemAmmoEnums.AmmoHandGrenade; +import com.hbm.items.ModItems; +import com.hbm.particle.ParticleAmatFlash; +import com.hbm.particle.ParticleContrail; +import com.hbm.particle.ParticleCoolingTower; +import com.hbm.particle.ParticleDeadLeaf; +import com.hbm.particle.ParticleDebug; +import com.hbm.particle.ParticleDigammaSmoke; +import com.hbm.particle.ParticleExSmoke; +import com.hbm.particle.ParticleGasFlame; +import com.hbm.particle.ParticleGiblet; +import com.hbm.particle.ParticleHadron; +import com.hbm.particle.ParticleHaze; +import com.hbm.particle.ParticleLetter; +import com.hbm.particle.ParticleMukeCloud; +import com.hbm.particle.ParticleMukeFlash; +import com.hbm.particle.ParticleMukeWave; +import com.hbm.particle.ParticlePlasmaBlast; +import com.hbm.particle.ParticleRBMKFlame; +import com.hbm.particle.ParticleRBMKMush; +import com.hbm.particle.ParticleRadiationFog; +import com.hbm.particle.ParticleRift; +import com.hbm.particle.ParticleRocketFlame; +import com.hbm.particle.ParticleSmokePlume; +import com.hbm.particle.ParticleSpark; +import com.hbm.particle.ParticleText; +import com.hbm.particle.SpentCasingConfig; +import com.hbm.render.anim.BusAnimation; +import com.hbm.render.anim.BusAnimationKeyframe; +import com.hbm.render.anim.BusAnimationSequence; +import com.hbm.render.anim.HbmAnimations; +import com.hbm.render.anim.HbmAnimations.Animation; +import com.hbm.render.block.RenderAntennaTop; +import com.hbm.render.block.RenderAnvil; +import com.hbm.render.block.RenderBarbedWire; +import com.hbm.render.block.RenderBarrel; +import com.hbm.render.block.RenderBattery; +import com.hbm.render.block.RenderBlockCT; +import com.hbm.render.block.RenderBlockDecoModel; +import com.hbm.render.block.RenderBlockMultipass; +import com.hbm.render.block.RenderBlockRotated; +import com.hbm.render.block.RenderBlockSideRotation; +import com.hbm.render.block.RenderBoxDuct; +import com.hbm.render.block.RenderCable; +import com.hbm.render.block.RenderCableClassic; +import com.hbm.render.block.RenderChain; +import com.hbm.render.block.RenderConserve; +import com.hbm.render.block.RenderConveyor; +import com.hbm.render.block.RenderConveyorChute; +import com.hbm.render.block.RenderConveyorLift; +import com.hbm.render.block.RenderCrystal; +import com.hbm.render.block.RenderDetCord; +import com.hbm.render.block.RenderDiode; +import com.hbm.render.block.RenderFence; +import com.hbm.render.block.RenderFoundryBasin; +import com.hbm.render.block.RenderFoundryChannel; +import com.hbm.render.block.RenderFoundryMold; +import com.hbm.render.block.RenderFoundryOutlet; +import com.hbm.render.block.RenderFoundryTank; +import com.hbm.render.block.RenderGrate; +import com.hbm.render.block.RenderMirror; +import com.hbm.render.block.RenderPipe; +import com.hbm.render.block.RenderPribris; +import com.hbm.render.block.RenderRBMKControl; +import com.hbm.render.block.RenderRBMKReflector; +import com.hbm.render.block.RenderRBMKRod; +import com.hbm.render.block.RenderRTGBlock; +import com.hbm.render.block.RenderScaffoldBlock; +import com.hbm.render.block.RenderSpikeBlock; +import com.hbm.render.block.RenderSteelBeam; +import com.hbm.render.block.RenderTaintBlock; +import com.hbm.render.block.RenderTapeBlock; +import com.hbm.render.block.RenderTestPipe; +import com.hbm.render.entity.RenderEmpty; +import com.hbm.render.entity.effect.ElectricityRenderer; +import com.hbm.render.entity.effect.FogRenderer; +import com.hbm.render.entity.effect.GasRenderer; +import com.hbm.render.entity.effect.MultiCloudRenderer; +import com.hbm.render.entity.effect.RenderBigNuke; +import com.hbm.render.entity.effect.RenderBlackHole; +import com.hbm.render.entity.effect.RenderCasingTest; +import com.hbm.render.entity.effect.RenderCloudFleija; +import com.hbm.render.entity.effect.RenderCloudRainbow; +import com.hbm.render.entity.effect.RenderCloudSolinium; +import com.hbm.render.entity.effect.RenderCloudTom; +import com.hbm.render.entity.effect.RenderDeathBlast; +import com.hbm.render.entity.effect.RenderEMPBlast; +import com.hbm.render.entity.effect.RenderFallout; +import com.hbm.render.entity.effect.RenderFireball; +import com.hbm.render.entity.effect.RenderFlare; +import com.hbm.render.entity.effect.RenderNoCloud; +import com.hbm.render.entity.effect.RenderQuasar; +import com.hbm.render.entity.effect.RenderSmallNukeMK4; +import com.hbm.render.entity.effect.RenderSpear; +import com.hbm.render.entity.effect.RenderTorex; +import com.hbm.render.entity.effect.SSmokeRenderer; +import com.hbm.render.entity.effect.SpillRenderer; +import com.hbm.render.entity.effect.TSmokeRenderer; +import com.hbm.render.entity.item.RenderBomber; +import com.hbm.render.entity.item.RenderMagnusCartus; +import com.hbm.render.entity.item.RenderMinecartTest; +import com.hbm.render.entity.item.RenderMovingItem; +import com.hbm.render.entity.item.RenderMovingPackage; +import com.hbm.render.entity.item.RenderNeoCart; +import com.hbm.render.entity.item.RenderTNTPrimedBase; +import com.hbm.render.entity.mob.RenderBlockSpider; +import com.hbm.render.entity.mob.RenderCyberCrab; +import com.hbm.render.entity.mob.RenderDuck; +import com.hbm.render.entity.mob.RenderFBI; +import com.hbm.render.entity.mob.RenderGhost; +import com.hbm.render.entity.mob.RenderHunterChopper; +import com.hbm.render.entity.mob.RenderMaskMan; +import com.hbm.render.entity.mob.RenderNuclearCreeper; +import com.hbm.render.entity.mob.RenderQuacc; +import com.hbm.render.entity.mob.RenderRADBeast; +import com.hbm.render.entity.mob.RenderSiegeCraft; +import com.hbm.render.entity.mob.RenderSiegeSkeleton; +import com.hbm.render.entity.mob.RenderSiegeTunneler; +import com.hbm.render.entity.mob.RenderSiegeUFO; +import com.hbm.render.entity.mob.RenderSiegeZombie; +import com.hbm.render.entity.mob.RenderTaintCrab; +import com.hbm.render.entity.mob.RenderTaintedCreeper; +import com.hbm.render.entity.mob.RenderTeslaCrab; +import com.hbm.render.entity.mob.RenderUFO; +import com.hbm.render.entity.mob.RenderWormBody; +import com.hbm.render.entity.mob.RenderWormHead; +import com.hbm.render.entity.projectile.RenderArtilleryShell; +import com.hbm.render.entity.projectile.RenderBeam; +import com.hbm.render.entity.projectile.RenderBeam2; +import com.hbm.render.entity.projectile.RenderBeam3; +import com.hbm.render.entity.projectile.RenderBeam4; +import com.hbm.render.entity.projectile.RenderBeam5; +import com.hbm.render.entity.projectile.RenderBeam6; +import com.hbm.render.entity.projectile.RenderBombletSelena; +import com.hbm.render.entity.projectile.RenderBombletTheta; +import com.hbm.render.entity.projectile.RenderBoxcar; +import com.hbm.render.entity.projectile.RenderBullet; +import com.hbm.render.entity.projectile.RenderChemical; +import com.hbm.render.entity.projectile.RenderChopperMine; +import com.hbm.render.entity.projectile.RenderCog; +import com.hbm.render.entity.projectile.RenderFOEQ; +import com.hbm.render.entity.projectile.RenderFallingNuke; +import com.hbm.render.entity.projectile.RenderGenericGrenade; +import com.hbm.render.entity.projectile.RenderGrenade; +import com.hbm.render.entity.projectile.RenderLN2; +import com.hbm.render.entity.projectile.RenderLaser; +import com.hbm.render.entity.projectile.RenderMeteor; +import com.hbm.render.entity.projectile.RenderMirv; +import com.hbm.render.entity.projectile.RenderOminousBullet; +import com.hbm.render.entity.projectile.RenderRBMKDebris; +import com.hbm.render.entity.projectile.RenderRainbow; +import com.hbm.render.entity.projectile.RenderRocket; +import com.hbm.render.entity.projectile.RenderRubble; +import com.hbm.render.entity.projectile.RenderSRocket; +import com.hbm.render.entity.projectile.RenderSawblade; +import com.hbm.render.entity.projectile.RenderShrapnel; +import com.hbm.render.entity.projectile.RenderSiegeLaser; +import com.hbm.render.entity.projectile.RenderTom; +import com.hbm.render.entity.projectile.RenderVortexBeam; +import com.hbm.render.entity.projectile.RenderZirnoxDebris; +import com.hbm.render.entity.rocket.RenderBoosterMissile; +import com.hbm.render.entity.rocket.RenderCarrierMissile; +import com.hbm.render.entity.rocket.RenderMinerRocket; +import com.hbm.render.entity.rocket.RenderMissileCustom; +import com.hbm.render.entity.rocket.RenderMissileDoomsday; +import com.hbm.render.entity.rocket.RenderMissileGeneric; +import com.hbm.render.entity.rocket.RenderMissileHuge; +import com.hbm.render.entity.rocket.RenderMissileMirv; +import com.hbm.render.entity.rocket.RenderMissileNuclear; +import com.hbm.render.entity.rocket.RenderMissileShuttle; +import com.hbm.render.entity.rocket.RenderMissileStrong; +import com.hbm.render.entity.rocket.RenderMissileTaint; +import com.hbm.render.entity.rocket.RenderMissileThermo; +import com.hbm.render.entity.rocket.RenderSoyuz; +import com.hbm.render.entity.rocket.RenderSoyuzCapsule; +import com.hbm.render.item.ItemRenderBase; +import com.hbm.render.item.ItemRenderDetonatorLaser; +import com.hbm.render.item.ItemRenderLibrary; +import com.hbm.render.item.ItemRenderMissile; +import com.hbm.render.item.ItemRenderMissilePart; +import com.hbm.render.item.ItemRenderMultitool; +import com.hbm.render.item.ItemRenderTemplate; +import com.hbm.render.item.ItemRenderTransformer; +import com.hbm.render.item.ItemRendererHot; +import com.hbm.render.item.ItemRendererMeteorSword; +import com.hbm.render.item.block.ItemRenderDecoBlock; +import com.hbm.render.item.block.ItemRenderTestContainer; +import com.hbm.render.item.weapon.ItemRenderBFLauncher; +import com.hbm.render.item.weapon.ItemRenderBenelli; +import com.hbm.render.item.weapon.ItemRenderBigSword; +import com.hbm.render.item.weapon.ItemRenderBioRevolver; +import com.hbm.render.item.weapon.ItemRenderBullshit; +import com.hbm.render.item.weapon.ItemRenderChainsaw; +import com.hbm.render.item.weapon.ItemRenderCrucible; +import com.hbm.render.item.weapon.ItemRenderCryolator; +import com.hbm.render.item.weapon.ItemRenderEMPRay; +import com.hbm.render.item.weapon.ItemRenderFatMan; +import com.hbm.render.item.weapon.ItemRenderFireExt; +import com.hbm.render.item.weapon.ItemRenderG36; +import com.hbm.render.item.weapon.ItemRenderGavel; +import com.hbm.render.item.weapon.ItemRenderGunAnim; +import com.hbm.render.item.weapon.ItemRenderHLR; +import com.hbm.render.item.weapon.ItemRenderImmolator; +import com.hbm.render.item.weapon.ItemRenderLLR; +import com.hbm.render.item.weapon.ItemRenderLunaticSniper; +import com.hbm.render.item.weapon.ItemRenderM2; +import com.hbm.render.item.weapon.ItemRenderMIRVLauncher; +import com.hbm.render.item.weapon.ItemRenderMLR; +import com.hbm.render.item.weapon.ItemRenderMP; +import com.hbm.render.item.weapon.ItemRenderMP40; +import com.hbm.render.item.weapon.ItemRenderOSIPR; +import com.hbm.render.item.weapon.ItemRenderObj; +import com.hbm.render.item.weapon.ItemRenderOverkill; +import com.hbm.render.item.weapon.ItemRenderRedstoneSword; +import com.hbm.render.item.weapon.ItemRenderRevolverInverted; +import com.hbm.render.item.weapon.ItemRenderRpg; +import com.hbm.render.item.weapon.ItemRenderShim; +import com.hbm.render.item.weapon.ItemRenderStinger; +import com.hbm.render.item.weapon.ItemRenderTWR; +import com.hbm.render.item.weapon.ItemRenderTestBombAdvanced; +import com.hbm.render.item.weapon.ItemRenderUACPistol; +import com.hbm.render.item.weapon.ItemRenderUZI; +import com.hbm.render.item.weapon.ItemRenderUboinik; +import com.hbm.render.item.weapon.ItemRenderWeaponAR15; +import com.hbm.render.item.weapon.ItemRenderWeaponBolter; +import com.hbm.render.item.weapon.ItemRenderWeaponChemthrower; +import com.hbm.render.item.weapon.ItemRenderWeaponFFBolt; +import com.hbm.render.item.weapon.ItemRenderWeaponFFColt; +import com.hbm.render.item.weapon.ItemRenderWeaponFFCursed; +import com.hbm.render.item.weapon.ItemRenderWeaponFFMG42; +import com.hbm.render.item.weapon.ItemRenderWeaponFFMaresLeg; +import com.hbm.render.item.weapon.ItemRenderWeaponFFNightmare; +import com.hbm.render.item.weapon.ItemRenderWeaponFFNightmareDark; +import com.hbm.render.item.weapon.ItemRenderWeaponGlass; +import com.hbm.render.item.weapon.ItemRenderWeaponObj; +import com.hbm.render.item.weapon.ItemRenderWeaponQuadro; +import com.hbm.render.item.weapon.ItemRenderWeaponSauer; +import com.hbm.render.item.weapon.ItemRenderWeaponShotty; +import com.hbm.render.item.weapon.ItemRenderWeaponSpas12; +import com.hbm.render.item.weapon.ItemRenderWeaponThompson; +import com.hbm.render.item.weapon.ItemRenderWeaponVortex; +import com.hbm.render.item.weapon.ItemRenderXVL1456; +import com.hbm.render.item.weapon.ItemRenderZOMG; +import com.hbm.render.loader.HmfModelLoader; +import com.hbm.render.tileentity.*; +import com.hbm.render.util.MissilePart; +import com.hbm.render.util.RenderInfoSystem; +import com.hbm.render.util.RenderInfoSystem.InfoEntry; +import com.hbm.sound.AudioWrapper; +import com.hbm.sound.AudioWrapperClient; +import com.hbm.sound.AudioWrapperClientStartStop; +import com.hbm.tileentity.TileEntityDoorGeneric; +import com.hbm.tileentity.bomb.TileEntityBombMulti; +import com.hbm.tileentity.bomb.TileEntityCelPrime; +import com.hbm.tileentity.bomb.TileEntityCelPrimeBattery; +import com.hbm.tileentity.bomb.TileEntityCelPrimePort; +import com.hbm.tileentity.bomb.TileEntityCelPrimeTanks; +import com.hbm.tileentity.bomb.TileEntityCelPrimeTerminal; +import com.hbm.tileentity.bomb.TileEntityCharge; +import com.hbm.tileentity.bomb.TileEntityCompactLauncher; +import com.hbm.tileentity.bomb.TileEntityCrashedBomb; +import com.hbm.tileentity.bomb.TileEntityLandmine; +import com.hbm.tileentity.bomb.TileEntityLaunchPad; +import com.hbm.tileentity.bomb.TileEntityLaunchTable; +import com.hbm.tileentity.bomb.TileEntityNukeBalefire; +import com.hbm.tileentity.bomb.TileEntityNukeBoy; +import com.hbm.tileentity.bomb.TileEntityNukeCustom; +import com.hbm.tileentity.bomb.TileEntityNukeFleija; +import com.hbm.tileentity.bomb.TileEntityNukeGadget; +import com.hbm.tileentity.bomb.TileEntityNukeMan; +import com.hbm.tileentity.bomb.TileEntityNukeMike; +import com.hbm.tileentity.bomb.TileEntityNukeN2; +import com.hbm.tileentity.bomb.TileEntityNukeN45; +import com.hbm.tileentity.bomb.TileEntityNukePrototype; +import com.hbm.tileentity.bomb.TileEntityNukeSolinium; +import com.hbm.tileentity.bomb.TileEntityNukeTsar; +import com.hbm.tileentity.bomb.TileEntityTestBombAdvanced; +import com.hbm.tileentity.conductor.TileEntityFluidDuct; +import com.hbm.tileentity.conductor.TileEntityGasDuct; +import com.hbm.tileentity.conductor.TileEntityOilDuct; +import com.hbm.tileentity.conductor.TileEntityRFDuct; +import com.hbm.tileentity.deco.TileEntityBomber; +import com.hbm.tileentity.deco.TileEntityDecoBlock; +import com.hbm.tileentity.deco.TileEntityDecoBlockAlt; +import com.hbm.tileentity.deco.TileEntityDecoBlockAltF; +import com.hbm.tileentity.deco.TileEntityDecoBlockAltG; +import com.hbm.tileentity.deco.TileEntityDecoBlockAltW; +import com.hbm.tileentity.deco.TileEntityDecoPoleSatelliteReceiver; +import com.hbm.tileentity.deco.TileEntityObjTester; +import com.hbm.tileentity.deco.TileEntityRotationTester; +import com.hbm.tileentity.deco.TileEntityTestRender; +import com.hbm.tileentity.machine.TileEntityAMSBase; +import com.hbm.tileentity.machine.TileEntityAMSEmitter; +import com.hbm.tileentity.machine.TileEntityAMSLimiter; +import com.hbm.tileentity.machine.TileEntityBlastDoor; +import com.hbm.tileentity.machine.TileEntityBroadcaster; +import com.hbm.tileentity.machine.TileEntityCharger; +import com.hbm.tileentity.machine.TileEntityChungus; +import com.hbm.tileentity.machine.TileEntityCore; +import com.hbm.tileentity.machine.TileEntityCoreEmitter; +import com.hbm.tileentity.machine.TileEntityCoreInjector; +import com.hbm.tileentity.machine.TileEntityCoreReceiver; +import com.hbm.tileentity.machine.TileEntityCoreStabilizer; +import com.hbm.tileentity.machine.TileEntityCrucible; +import com.hbm.tileentity.machine.TileEntityDemonLamp; +import com.hbm.tileentity.machine.TileEntityDeuteriumTower; +import com.hbm.tileentity.machine.TileEntityElectrolyser; +import com.hbm.tileentity.machine.TileEntityFEL; +import com.hbm.tileentity.machine.TileEntityFF; +import com.hbm.tileentity.machine.TileEntityForceField; +import com.hbm.tileentity.machine.TileEntityFoundryBasin; +import com.hbm.tileentity.machine.TileEntityFoundryMold; +import com.hbm.tileentity.machine.TileEntityFurnaceIron; +import com.hbm.tileentity.machine.TileEntityFurnaceSteel; +import com.hbm.tileentity.machine.TileEntityGeiger; +import com.hbm.tileentity.machine.TileEntityHeatBoiler; +import com.hbm.tileentity.machine.TileEntityHeaterElectric; +import com.hbm.tileentity.machine.TileEntityHeaterFirebox; +import com.hbm.tileentity.machine.TileEntityHeaterOilburner; +import com.hbm.tileentity.machine.TileEntityITER; +import com.hbm.tileentity.machine.TileEntityITERStruct; +import com.hbm.tileentity.machine.TileEntityMachineAssembler; +import com.hbm.tileentity.machine.TileEntityMachineAssemfac; +import com.hbm.tileentity.machine.TileEntityMachineCentrifuge; +import com.hbm.tileentity.machine.TileEntityMachineChemfac; +import com.hbm.tileentity.machine.TileEntityMachineChemplant; +import com.hbm.tileentity.machine.TileEntityMachineCrystallizer; +import com.hbm.tileentity.machine.TileEntityMachineCyclotron; +import com.hbm.tileentity.machine.TileEntityMachineEPress; +import com.hbm.tileentity.machine.TileEntityMachineGasCent; +import com.hbm.tileentity.machine.TileEntityMachineIGenerator; +import com.hbm.tileentity.machine.TileEntityMachineLargeTurbine; +import com.hbm.tileentity.machine.TileEntityMachineMiniRTG; +import com.hbm.tileentity.machine.TileEntityMachineMiningDrill; +import com.hbm.tileentity.machine.TileEntityMachineMiningLaser; +import com.hbm.tileentity.machine.TileEntityMachineMissileAssembly; +import com.hbm.tileentity.machine.TileEntityMachinePlasmaHeater; +import com.hbm.tileentity.machine.TileEntityMachinePress; +import com.hbm.tileentity.machine.TileEntityMachineRTG; +import com.hbm.tileentity.machine.TileEntityMachineRadGen; +import com.hbm.tileentity.machine.TileEntityMachineRadar; +import com.hbm.tileentity.machine.TileEntityMachineRadiolysis; +import com.hbm.tileentity.machine.TileEntityMachineReactorBreeding; +import com.hbm.tileentity.machine.TileEntityMachineSatDock; +import com.hbm.tileentity.machine.TileEntityMachineSeleniumEngine; +import com.hbm.tileentity.machine.TileEntityMachineShredderLarge; +import com.hbm.tileentity.machine.TileEntityMachineTurbofan; +import com.hbm.tileentity.machine.TileEntityMicrowave; +import com.hbm.tileentity.machine.TileEntityMultiblock; +import com.hbm.tileentity.machine.TileEntityPlasmaStruct; +import com.hbm.tileentity.machine.TileEntityRadioRec; +import com.hbm.tileentity.machine.TileEntityRadiobox; +import com.hbm.tileentity.machine.TileEntityReactorResearch; +import com.hbm.tileentity.machine.TileEntityReactorZirnox; +import com.hbm.tileentity.machine.TileEntitySILEX; +import com.hbm.tileentity.machine.TileEntitySawmill; +import com.hbm.tileentity.machine.TileEntitySolarBoiler; +import com.hbm.tileentity.machine.TileEntitySoyuzLauncher; +import com.hbm.tileentity.machine.TileEntitySoyuzStruct; +import com.hbm.tileentity.machine.TileEntityStirling; +import com.hbm.tileentity.machine.TileEntityStorageDrum; +import com.hbm.tileentity.machine.TileEntityStructureMarker; +import com.hbm.tileentity.machine.TileEntityTesla; +import com.hbm.tileentity.machine.TileEntityTowerLarge; +import com.hbm.tileentity.machine.TileEntityTowerSmall; +import com.hbm.tileentity.machine.TileEntityVaultDoor; +import com.hbm.tileentity.machine.TileEntityWatz; +import com.hbm.tileentity.machine.TileEntityZirnoxDestroyed; +import com.hbm.tileentity.machine.oil.TileEntityMachineCatalyticCracker; +import com.hbm.tileentity.machine.oil.TileEntityMachineFrackingTower; +import com.hbm.tileentity.machine.oil.TileEntityMachineFractionTower; +import com.hbm.tileentity.machine.oil.TileEntityMachineGasFlare; +import com.hbm.tileentity.machine.oil.TileEntityMachineLiquefactor; +import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell; +import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack; +import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery; +import com.hbm.tileentity.machine.oil.TileEntityMachineSolidifier; +import com.hbm.tileentity.machine.oil.TileEntitySpacer; +import com.hbm.tileentity.machine.rbmk.TileEntityCraneConsole; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKAbsorber; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKBlank; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKBoiler; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKControlAuto; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKControlManual; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKCooler; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKHeater; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKModerator; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKOutgasser; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKReflector; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKRod; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKRodReaSim; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKStorage; +import com.hbm.tileentity.machine.storage.TileEntityBarrel; +import com.hbm.tileentity.machine.storage.TileEntityMachineBAT9000; +import com.hbm.tileentity.machine.storage.TileEntityMachineFENSU; +import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank; +import com.hbm.tileentity.machine.storage.TileEntityMachineOrbus; +import com.hbm.tileentity.machine.storage.TileEntityMachinePuF6Tank; +import com.hbm.tileentity.machine.storage.TileEntityMachineUF6Tank; +import com.hbm.tileentity.machine.storage.TileEntitySoyuzCapsule; +import com.hbm.tileentity.network.TileEntityConnector; +import com.hbm.tileentity.network.TileEntityPylon; +import com.hbm.tileentity.network.TileEntityPylonLarge; +import com.hbm.tileentity.network.TileEntitySubstation; +import com.hbm.tileentity.turret.TileEntityTurretArty; +import com.hbm.tileentity.turret.TileEntityTurretBrandon; +import com.hbm.tileentity.turret.TileEntityTurretCIWS; +import com.hbm.tileentity.turret.TileEntityTurretCheapo; +import com.hbm.tileentity.turret.TileEntityTurretChekhov; +import com.hbm.tileentity.turret.TileEntityTurretFlamer; +import com.hbm.tileentity.turret.TileEntityTurretFriendly; +import com.hbm.tileentity.turret.TileEntityTurretFritz; +import com.hbm.tileentity.turret.TileEntityTurretHIMARS; +import com.hbm.tileentity.turret.TileEntityTurretHeavy; +import com.hbm.tileentity.turret.TileEntityTurretHoward; +import com.hbm.tileentity.turret.TileEntityTurretHowardDamaged; +import com.hbm.tileentity.turret.TileEntityTurretJeremy; +import com.hbm.tileentity.turret.TileEntityTurretLight; +import com.hbm.tileentity.turret.TileEntityTurretMaxwell; +import com.hbm.tileentity.turret.TileEntityTurretRichard; +import com.hbm.tileentity.turret.TileEntityTurretRocket; +import com.hbm.tileentity.turret.TileEntityTurretSpitfire; +import com.hbm.tileentity.turret.TileEntityTurretTau; +import com.hbm.tileentity.turret.TileEntityTurretTauon; +import com.hbm.util.BobMathUtil; + +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.ReflectionHelper; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; @@ -23,87 +655,15 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; -import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.common.MinecraftForge; -import java.awt.Color; -import java.awt.Desktop; -import java.net.URI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Random; - -import com.hbm.blocks.ModBlocks; -import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; -import com.hbm.blocks.generic.BlockEmitter.TileEntityEmitter; -import com.hbm.blocks.generic.BlockLoot.TileEntityLoot; -import com.hbm.entity.cart.*; -import com.hbm.entity.effect.*; -import com.hbm.entity.grenade.*; -import com.hbm.entity.item.*; -import com.hbm.entity.logic.*; -import com.hbm.entity.missile.*; -import com.hbm.entity.mob.*; -import com.hbm.entity.mob.botprime.*; -import com.hbm.entity.mob.siege.*; -import com.hbm.entity.particle.*; -import com.hbm.entity.projectile.*; -import com.hbm.handler.HbmKeybinds; -import com.hbm.handler.HbmKeybinds.EnumKeybind; -import com.hbm.items.ModItems; -import com.hbm.items.ItemAmmoEnums.AmmoHandGrenade; -import com.hbm.particle.*; -import com.hbm.render.anim.*; -import com.hbm.render.anim.HbmAnimations.Animation; -import com.hbm.render.block.*; -import com.hbm.render.entity.*; -import com.hbm.render.entity.effect.*; -import com.hbm.render.entity.item.*; -import com.hbm.render.entity.mob.*; -import com.hbm.render.entity.projectile.*; -import com.hbm.render.entity.rocket.*; -import com.hbm.render.item.*; -import com.hbm.render.item.block.*; -import com.hbm.render.item.weapon.*; -import com.hbm.render.loader.HmfModelLoader; -import com.hbm.render.tileentity.*; -import com.hbm.render.util.MissilePart; -import com.hbm.render.util.RenderInfoSystem; -import com.hbm.render.util.RenderInfoSystem.InfoEntry; -import com.hbm.sound.AudioWrapper; -import com.hbm.sound.AudioWrapperClient; -import com.hbm.sound.AudioWrapperClientStartStop; -import com.hbm.sound.nt.ISoundSourceTE; -import com.hbm.sound.nt.SoundWrapper; -import com.hbm.sound.nt.SoundWrapperClient; -import com.hbm.tileentity.TileEntityDoorGeneric; -import com.hbm.tileentity.bomb.*; -import com.hbm.tileentity.conductor.*; -import com.hbm.tileentity.deco.*; -import com.hbm.tileentity.machine.*; -import com.hbm.tileentity.machine.oil.*; -import com.hbm.tileentity.machine.rbmk.*; -import com.hbm.tileentity.machine.storage.*; -import com.hbm.tileentity.network.*; -import com.hbm.tileentity.turret.*; -import com.hbm.util.BobMathUtil; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.ReflectionHelper; - public class ClientProxy extends ServerProxy { - public RenderInfoSystem theInfoSystem = new RenderInfoSystem(); @Override @@ -130,7 +690,7 @@ public class ClientProxy extends ServerProxy { //SoundUtil.addSoundCategory("ntmMachines"); } - private void registerClientEventHandler(Object handler) { + private static void registerClientEventHandler(Object handler) { MinecraftForge.EVENT_BUS.register(handler); FMLCommonHandler.instance().bus().register(handler); } @@ -343,7 +903,7 @@ public class ClientProxy extends ServerProxy { MinecraftForgeClient.registerItemRenderer(entry.getKey(), entry.getValue()); //this bit registers an item renderer for every existing tile entity renderer that implements IItemRendererProvider - Iterator iterator = TileEntityRendererDispatcher.instance.mapSpecialRenderers.values().iterator(); + Iterator iterator = TileEntityRendererDispatcher.instance.mapSpecialRenderers.values().iterator(); while(iterator.hasNext()) { Object renderer = iterator.next(); if(renderer instanceof IItemRendererProvider) { @@ -528,6 +1088,8 @@ public class ClientProxy extends ServerProxy { MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.steel_wall), new ItemRenderDecoBlock()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.steel_corner), new ItemRenderDecoBlock()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.steel_roof), new ItemRenderDecoBlock()); + + MinecraftForgeClient.registerItemRenderer(ModItems.wand_d, new RenderCasingTest()); } @Override @@ -783,10 +1345,10 @@ public class ClientProxy extends ServerProxy { MissilePart.registerAllParts(); - Iterator it = MissilePart.parts.entrySet().iterator(); + Iterator it = MissilePart.parts.entrySet().iterator(); while(it.hasNext()) { - Map.Entry pair = (Map.Entry) it.next(); + Map.Entry pair = (Map.Entry) it.next(); MissilePart part = (MissilePart) pair.getValue(); MinecraftForgeClient.registerItemRenderer(part.part, new ItemRenderMissilePart(part)); } @@ -828,6 +1390,8 @@ public class ClientProxy extends ServerProxy { ParticleRadiationFog fog = new ParticleRadiationFog(man, world, x, y, z); Minecraft.getMinecraft().effectRenderer.addEffect(fog); break; + default: + break; } } @@ -869,6 +1433,7 @@ public class ClientProxy extends ServerProxy { } //mk3, only use this one + @Override public void effectNT(NBTTagCompound data) { World world = Minecraft.getMinecraft().theWorld; @@ -885,861 +1450,869 @@ public class ClientProxy extends ServerProxy { double y = data.getDouble("posY"); double z = data.getDouble("posZ"); - if("smoke".equals(type)) { + switch (type) + { + case "smoke": { - String mode = data.getString("mode"); int count = Math.max(1, data.getInteger("count")); - if("cloud".equals(mode)) { - - for(int i = 0; i < count; i++) { - ParticleExSmoke fx = new ParticleExSmoke(man, world, x, y, z); - fx.motionY = rand.nextGaussian() * (1 + (count / 100)); - fx.motionX = rand.nextGaussian() * (1 + (count / 150)); - fx.motionZ = rand.nextGaussian() * (1 + (count / 150)); - if(rand.nextBoolean()) fx.motionY = Math.abs(fx.motionY); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - } - - if("radial".equals(mode)) { - - for(int i = 0; i < count; i++) { - ParticleExSmoke fx = new ParticleExSmoke(man, world, x, y, z); - fx.motionY = rand.nextGaussian() * (1 + (count / 50)); - fx.motionX = rand.nextGaussian() * (1 + (count / 50)); - fx.motionZ = rand.nextGaussian() * (1 + (count / 50)); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - } - - if("radialDigamma".equals(mode)) { - - Vec3 vec = Vec3.createVectorHelper(2, 0, 0); - vec.rotateAroundY(rand.nextFloat() * (float)Math.PI * 2F); - - for(int i = 0; i < count; i++) { - ParticleDigammaSmoke fx = new ParticleDigammaSmoke(man, world, x, y, z); - fx.motionY = 0; - fx.motionX = vec.xCoord; - fx.motionZ = vec.zCoord; - Minecraft.getMinecraft().effectRenderer.addEffect(fx); + switch (data.getString("mode")) + { + case "cloud": { - vec.rotateAroundY((float)Math.PI * 2F / (float)count); - } - } - - if("shock".equals(mode)) { - - double strength = data.getDouble("strength"); - - Vec3 vec = Vec3.createVectorHelper(strength, 0, 0); - vec.rotateAroundY(rand.nextInt(360)); - - for(int i = 0; i < count; i++) { - ParticleExSmoke fx = new ParticleExSmoke(man, world, x, y, z); - fx.motionY = 0; - fx.motionX = vec.xCoord; - fx.motionZ = vec.zCoord; - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - - vec.rotateAroundY((float)Math.PI * 2F / (float)count); - } - } - - if("shockRand".equals(mode)) { - - double strength = data.getDouble("strength"); - - Vec3 vec = Vec3.createVectorHelper(strength, 0, 0); - vec.rotateAroundY(rand.nextInt(360)); - double r; - - for(int i = 0; i < count; i++) { - r = rand.nextDouble(); - ParticleExSmoke fx = new ParticleExSmoke(man, world, x, y, z); - fx.motionY = 0; - fx.motionX = vec.xCoord * r; - fx.motionZ = vec.zCoord * r; - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - - vec.rotateAroundY(360 / count); - } - } - - if("wave".equals(mode)) { - - double strength = data.getDouble("range"); - - Vec3 vec = Vec3.createVectorHelper(strength, 0, 0); - - for(int i = 0; i < count; i++) { - - vec.rotateAroundY((float) Math.toRadians(rand.nextFloat() * 360F)); - - ParticleExSmoke fx = new ParticleExSmoke(man, world, x + vec.xCoord, y, z + vec.zCoord); - fx.maxAge = 50; - fx.motionY = 0; - fx.motionX = 0; - fx.motionZ = 0; - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - - vec.rotateAroundY(360 / count); - } - } - } - - if("exhaust".equals(type)) { - - String mode = data.getString("mode"); - - if("soyuz".equals(mode)) { - - if(Vec3.createVectorHelper(player.posX - x, player.posY - y, player.posZ - z).lengthVector() > 350) - return; + for(int i = 0; i < count; i++) { + ParticleExSmoke fx = new ParticleExSmoke(man, world, x, y, z); + fx.motionY = rand.nextGaussian() * (1 + (count / 100)); + fx.motionX = rand.nextGaussian() * (1 + (count / 150)); + fx.motionZ = rand.nextGaussian() * (1 + (count / 150)); + if(rand.nextBoolean()) fx.motionY = Math.abs(fx.motionY); + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + break; + } - int count = Math.max(1, data.getInteger("count")); - double width = data.getDouble("width"); - - for(int i = 0; i < count; i++) { - - ParticleRocketFlame fx = new ParticleRocketFlame(man, world, x + rand.nextGaussian() * width, y, z + rand.nextGaussian() * width); - fx.motionY = -0.75 + rand.nextDouble() * 0.5; - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - } - - if("meteor".equals(mode)) { - - if(Vec3.createVectorHelper(player.posX - x, player.posY - y, player.posZ - z).lengthVector() > 350) - return; + case "radial": { - int count = Math.max(1, data.getInteger("count")); - double width = data.getDouble("width"); + for(int i = 0; i < count; i++) { + ParticleExSmoke fx = new ParticleExSmoke(man, world, x, y, z); + fx.motionY = rand.nextGaussian() * (1 + (count / 50)); + fx.motionX = rand.nextGaussian() * (1 + (count / 50)); + fx.motionZ = rand.nextGaussian() * (1 + (count / 50)); + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + break; + } + + case "radialDigamma": { + + Vec3 vec = Vec3.createVectorHelper(2, 0, 0); + vec.rotateAroundY(rand.nextFloat() * (float)Math.PI * 2F); + + for(int i = 0; i < count; i++) { + ParticleDigammaSmoke fx = new ParticleDigammaSmoke(man, world, x, y, z); + fx.motionY = 0; + fx.motionX = vec.xCoord; + fx.motionZ = vec.zCoord; + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + + vec.rotateAroundY((float)Math.PI * 2F / count); + } + break; + } - for(int i = 0; i < count; i++) { + case "shock": { - ParticleRocketFlame fx = new ParticleRocketFlame(man, world, x + rand.nextGaussian() * width, y + rand.nextGaussian() * width, z + rand.nextGaussian() * width); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - } - } + double strength = data.getDouble("strength"); - if("fireworks".equals(type)) { - int color = data.getInteger("color"); - char c = (char)data.getInteger("char"); - - ParticleLetter fx = new ParticleLetter(world, x, y, z, color, c); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - - for(int i = 0; i < 50; i++) { - EntityFireworkSparkFX blast = new EntityFireworkSparkFX(world, x, y, z, - 0.4 * world.rand.nextGaussian(), - 0.4 * world.rand.nextGaussian(), - 0.4 * world.rand.nextGaussian(), Minecraft.getMinecraft().effectRenderer); - blast.setColour(color); - Minecraft.getMinecraft().effectRenderer.addEffect(blast); - } - } + Vec3 vec = Vec3.createVectorHelper(strength, 0, 0); + vec.rotateAroundY(rand.nextInt(360)); + + for(int i = 0; i < count; i++) { + ParticleExSmoke fx = new ParticleExSmoke(man, world, x, y, z); + fx.motionY = 0; + fx.motionX = vec.xCoord; + fx.motionZ = vec.zCoord; + Minecraft.getMinecraft().effectRenderer.addEffect(fx); - if("vanillaburst".equals(type)) { - - double motion = data.getDouble("motion"); - - for(int i = 0; i < data.getInteger("count"); i++) { - - double mX = rand.nextGaussian() * motion; - double mY = rand.nextGaussian() * motion; - double mZ = rand.nextGaussian() * motion; + vec.rotateAroundY((float)Math.PI * 2F / count); + } + break; + } - EntityFX fx = null; - - if("flame".equals(data.getString("mode"))) { - fx = new EntityFlameFX(world, x, y, z, mX, mY, mZ); - } - - if("cloud".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityCloudFX(world, x, y, z, mX, mY, mZ); - } - - if("reddust".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.0F, 0.0F, 0.0F); - fx.motionX = mX; - fx.motionY = mY; - fx.motionZ = mZ; - } - - if("bluedust".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.01F, 1F); - } - - if("greendust".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.5F, 0.1F); - } - - if("blockdust".equals(data.getString("mode"))) { + case "shockRand": { - Block b = Block.getBlockById(data.getInteger("block")); - fx = new net.minecraft.client.particle.EntityBlockDustFX(world, x, y, z, mX, mY + 0.2, mZ, b, 0); - ReflectionHelper.setPrivateValue(EntityFX.class, fx, 50 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + double strength = data.getDouble("strength"); + + Vec3 vec = Vec3.createVectorHelper(strength, 0, 0); + vec.rotateAroundY(rand.nextInt(360)); + double r; + + for(int i = 0; i < count; i++) { + r = rand.nextDouble(); + ParticleExSmoke fx = new ParticleExSmoke(man, world, x, y, z); + fx.motionY = 0; + fx.motionX = vec.xCoord * r; + fx.motionZ = vec.zCoord * r; + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + + vec.rotateAroundY(360 / count); + } + break; + } + + case "wave": { + + double strength = data.getDouble("range"); + + Vec3 vec = Vec3.createVectorHelper(strength, 0, 0); + + for(int i = 0; i < count; i++) { + + vec.rotateAroundY((float) Math.toRadians(rand.nextFloat() * 360F)); + + ParticleExSmoke fx = new ParticleExSmoke(man, world, x + vec.xCoord, y, z + vec.zCoord); + fx.maxAge = 50; + fx.motionY = 0; + fx.motionX = 0; + fx.motionZ = 0; + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + + vec.rotateAroundY(360 / count); + } + break; + } + default: break; + } + break; + } + + case "exhaust": { + + switch (data.getString("mode")) + { + case "soyuz": { + + if(Vec3.createVectorHelper(player.posX - x, player.posY - y, player.posZ - z).lengthVector() > 350) + return; + + int count = Math.max(1, data.getInteger("count")); + double width = data.getDouble("width"); + + for(int i = 0; i < count; i++) { + + ParticleRocketFlame fx = new ParticleRocketFlame(man, world, x + rand.nextGaussian() * width, y, z + rand.nextGaussian() * width); + fx.motionY = -0.75 + rand.nextDouble() * 0.5; + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + break; } - if(fx != null) - Minecraft.getMinecraft().effectRenderer.addEffect(fx); + case "meteor": { + + if(Vec3.createVectorHelper(player.posX - x, player.posY - y, player.posZ - z).lengthVector() > 350) + return; + + int count = Math.max(1, data.getInteger("count")); + double width = data.getDouble("width"); + + for(int i = 0; i < count; i++) { + + ParticleRocketFlame fx = new ParticleRocketFlame(man, world, x + rand.nextGaussian() * width, y + rand.nextGaussian() * width, z + rand.nextGaussian() * width); + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + break; + } + default: break; } } - if("vanillaExt".equals(type)) { - - double mX = data.getDouble("mX"); - double mY = data.getDouble("mY"); - double mZ = data.getDouble("mZ"); - - EntityFX fx = null; - - if("flame".equals(data.getString("mode"))) { - fx = new EntityFlameFX(world, x, y, z, mX, mY, mZ); - } - - if("smoke".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntitySmokeFX(world, x, y, z, mX, mY, mZ); - } - - if("volcano".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntitySmokeFX(world, x, y, z, mX, mY, mZ); - float scale = 100; - ReflectionHelper.setPrivateValue(net.minecraft.client.particle.EntitySmokeFX.class, (net.minecraft.client.particle.EntitySmokeFX)fx, scale, "smokeParticleScale", "field_70587_a"); - ReflectionHelper.setPrivateValue(EntityFX.class, fx, 200 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); - fx.noClip = true; - fx.motionY = 2.5 + rand.nextDouble(); - fx.motionX = rand.nextGaussian() * 0.2; - fx.motionZ = rand.nextGaussian() * 0.2; - } - - if("cloud".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityCloudFX(world, x, y, z, mX, mY, mZ); - - if(data.hasKey("r")) { - float rng = rand.nextFloat() * 0.1F; - fx.setRBGColorF(data.getFloat("r") + rng, data.getFloat("g") + rng, data.getFloat("b") + rng); - ReflectionHelper.setPrivateValue(net.minecraft.client.particle.EntityCloudFX.class, (EntityCloudFX)fx, 7.5F, "field_70569_a"); - fx.motionX = 0; - fx.motionY = 0; - fx.motionZ = 0; - } - } - - if("reddust".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, (float)mX, (float)mY, (float)mZ); - } - - if("bluedust".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.01F, 1F); - } - - if("greendust".equals(data.getString("mode"))) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.5F, 0.1F); - } - - if("largeexplode".equals(data.getString("mode"))) { - - - 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); - - 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("townaura".equals(data.getString("mode"))) { - fx = new EntityAuraFX(world, x, y, z, 0, 0, 0); - float color = 0.5F + rand.nextFloat() * 0.5F; - fx.setRBGColorF(0.8F * color, 0.9F * color, 1.0F * color); - fx.setVelocity(mX, mY, mZ); - } - - if("blockdust".equals(data.getString("mode"))) { - - Block b = Block.getBlockById(data.getInteger("block")); - fx = new net.minecraft.client.particle.EntityBlockDustFX(world, x, y, z, mX, mY + 0.2, mZ, b, 0); - ReflectionHelper.setPrivateValue(EntityFX.class, fx, 10 + rand.nextInt(20), "particleMaxAge", "field_70547_e"); - } - - if("colordust".equals(data.getString("mode"))) { - - Block b = Blocks.wool; - fx = new net.minecraft.client.particle.EntityBlockDustFX(world, x, y, z, mX, mY + 0.2, mZ, b, 0); - fx.setRBGColorF(data.getFloat("r"), data.getFloat("g"), data.getFloat("b")); - ReflectionHelper.setPrivateValue(EntityFX.class, fx, 10 + rand.nextInt(20), "particleMaxAge", "field_70547_e"); - } - - if(fx != null) { - - if(data.getBoolean("noclip")) { - fx.noClip = true; - } - - if(data.getInteger("overrideAge") > 0) { - ReflectionHelper.setPrivateValue(EntityFX.class, fx, data.getInteger("overrideAge"), "particleMaxAge", "field_70547_e"); - } + case "fireworks": { + int color = data.getInteger("color"); + char c = (char)data.getInteger("char"); + ParticleLetter fx = new ParticleLetter(world, x, y, z, color, c); Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - } - - if("vanilla".equals(type)) { - - double mX = data.getDouble("mX"); - double mY = data.getDouble("mY"); - double mZ = data.getDouble("mZ"); - world.spawnParticle(data.getString("mode"), x, y, z, mX, mY, mZ); - } - - if("jetpack".equals(type)) { - - if(particleSetting == 2) - return; - - Entity ent = world.getEntityByID(data.getInteger("player")); - - if(ent instanceof EntityPlayer) { - EntityPlayer p = (EntityPlayer)ent; - - Vec3 vec = Vec3.createVectorHelper(0, 0, -0.25); - Vec3 offset = Vec3.createVectorHelper(0.125, 0, 0); - float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); - - vec.rotateAroundY(angle); - offset.rotateAroundY(angle); - - double ix = p.posX + vec.xCoord; - double iy = p.posY + p.eyeHeight - 1; - double iz = p.posZ + vec.zCoord; - double ox = offset.xCoord; - double oz = offset.zCoord; - - double moX = 0; - double moY = 0; - double moZ = 0; - - int mode = data.getInteger("mode"); - - if(mode == 0) { - moY -= 0.2; - } - - if(mode == 1) { - Vec3 look = p.getLookVec(); - - moX -= look.xCoord * 0.1D; - moY -= look.yCoord * 0.1D; - moZ -= look.zCoord * 0.1D; - } - - if(particleSetting == 0) { - Vec3 pos = Vec3.createVectorHelper(ix, iy, iz); - Vec3 thrust = Vec3.createVectorHelper(moX, moY, moZ); - thrust = thrust.normalize(); - Vec3 target = pos.addVector(thrust.xCoord * 10, thrust.yCoord * 10, thrust.zCoord * 10); - MovingObjectPosition mop = player.worldObj.func_147447_a(pos, target, false, false, true); - - if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK && mop.sideHit == 1) { - - Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); - int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); - - Vec3 delta = Vec3.createVectorHelper(ix - mop.hitVec.xCoord, iy - mop.hitVec.yCoord, iz - mop.hitVec.zCoord); - Vec3 vel = Vec3.createVectorHelper(0.75 - delta.lengthVector() * 0.075, 0, 0); - - for(int i = 0; i < (10 - delta.lengthVector()); i++) { - vel.rotateAroundY(world.rand.nextFloat() * (float)Math.PI * 2F); - Minecraft.getMinecraft().effectRenderer.addEffect(new EntityBlockDustFX(world, mop.hitVec.xCoord, mop.hitVec.yCoord + 0.1, mop.hitVec.zCoord, vel.xCoord, 0.1, vel.zCoord, b, meta)); - } - } - } - - double mX2 = BobMathUtil.safeClamp(p.motionX + moX * 2, -5, 5); - double mY2 = BobMathUtil.safeClamp(p.motionY + moY * 2, -5, 5); - double mZ2 = BobMathUtil.safeClamp(p.motionZ + moZ * 2, -5, 5); - double mX3 = BobMathUtil.safeClamp(p.motionX + moX * 2, -10, 10); - double mY3 = BobMathUtil.safeClamp(p.motionY + moY * 2, -10, 10); - double mZ3 = BobMathUtil.safeClamp(p.motionZ + moZ * 2, -10, 10); - - Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix + ox, iy, iz + oz, mX2, mY2, mZ2)); - Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix - ox, iy, iz - oz, mX2, mY2, mZ2)); - - if(particleSetting == 0) { - Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix + ox, iy, iz + oz, mX3, mY3, mZ3)); - Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix - ox, iy, iz - oz, mX3, mY3, mZ3)); + for(int i = 0; i < 50; i++) { + EntityFireworkSparkFX blast = new EntityFireworkSparkFX(world, x, y, z, + 0.4 * world.rand.nextGaussian(), + 0.4 * world.rand.nextGaussian(), + 0.4 * world.rand.nextGaussian(), Minecraft.getMinecraft().effectRenderer); + blast.setColour(color); + Minecraft.getMinecraft().effectRenderer.addEffect(blast); } + break; } - } - if("bnuuy".equals(type)) { + case "vanillaburst": { - if(particleSetting == 2) - return; - - Entity ent = world.getEntityByID(data.getInteger("player")); - - if(ent instanceof EntityPlayer) { - - EntityPlayer p = (EntityPlayer)ent; - - Vec3 vec = Vec3.createVectorHelper(0, 0, -0.6); - Vec3 offset = Vec3.createVectorHelper(0.275, 0, 0); - float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); - - vec.rotateAroundY(angle); - offset.rotateAroundY(angle); - - double ix = p.posX + vec.xCoord; - double iy = p.posY + p.eyeHeight - 1 + 0.4; - double iz = p.posZ + vec.zCoord; - double ox = offset.xCoord; - double oz = offset.zCoord; - - vec = vec.normalize(); - double mult = 0.025D; - double mX = vec.xCoord * mult; - double mZ = vec.zCoord * mult; - - //Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix + ox, iy, iz + oz, 0, 0, 0)); - //Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix - ox, iy, iz - oz, 0, 0, 0)); - - for(int i = 0; i < 2; i++) { - net.minecraft.client.particle.EntitySmokeFX fx = new net.minecraft.client.particle.EntitySmokeFX(world, ix + ox * (i == 0 ? -1 : 1), iy, iz + oz * (i == 0 ? -1 : 1), mX, 0, mZ); - float scale = 0.5F; - ReflectionHelper.setPrivateValue(net.minecraft.client.particle.EntitySmokeFX.class, (net.minecraft.client.particle.EntitySmokeFX)fx, scale, "smokeParticleScale", "field_70587_a"); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - } - } - - if("jetpack_bj".equals(type)) { - - if(particleSetting == 2) - return; - - Entity ent = world.getEntityByID(data.getInteger("player")); - - if(ent instanceof EntityPlayer) { - - EntityPlayer p = (EntityPlayer)ent; - - Vec3 vec = Vec3.createVectorHelper(0, 0, -0.3125); - Vec3 offset = Vec3.createVectorHelper(0.125, 0, 0); - float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); - - vec.rotateAroundY(angle); - offset.rotateAroundY(angle); - - double ix = p.posX + vec.xCoord; - double iy = p.posY + p.eyeHeight - 0.9375; - double iz = p.posZ + vec.zCoord; - double ox = offset.xCoord; - double oz = offset.zCoord; - - if(particleSetting == 0) { - Vec3 pos = Vec3.createVectorHelper(ix, iy, iz); - Vec3 thrust = Vec3.createVectorHelper(0, -1, 0); - Vec3 target = pos.addVector(thrust.xCoord * 10, thrust.yCoord * 10, thrust.zCoord * 10); - MovingObjectPosition mop = player.worldObj.func_147447_a(pos, target, false, false, true); - - if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK && mop.sideHit == 1) { - - Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); - int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); - - Vec3 delta = Vec3.createVectorHelper(ix - mop.hitVec.xCoord, iy - mop.hitVec.yCoord, iz - mop.hitVec.zCoord); - Vec3 vel = Vec3.createVectorHelper(0.75 - delta.lengthVector() * 0.075, 0, 0); - - for(int i = 0; i < (10 - delta.lengthVector()); i++) { - vel.rotateAroundY(world.rand.nextFloat() * (float)Math.PI * 2F); - Minecraft.getMinecraft().effectRenderer.addEffect(new EntityBlockDustFX(world, mop.hitVec.xCoord, mop.hitVec.yCoord + 0.1, mop.hitVec.zCoord, vel.xCoord, 0.1, vel.zCoord, b, meta)); - } - } - } - - EntityReddustFX dust1 = new EntityReddustFX(world, ix + ox, iy, iz + oz, 0.8F, 0.5F, 1.0F); - EntityReddustFX dust2 = new EntityReddustFX(world, ix - ox, iy, iz - oz, 0.8F, 0.5F, 1.0F); - dust1.setVelocity(p.motionX, p.motionY, p.motionZ); - dust2.setVelocity(p.motionX, p.motionY, p.motionZ); - Minecraft.getMinecraft().effectRenderer.addEffect(dust1); - Minecraft.getMinecraft().effectRenderer.addEffect(dust2); - } - } - - if("jetpack_dns".equals(type)) { - - if(particleSetting == 2) - return; - - Entity ent = world.getEntityByID(data.getInteger("player")); - - if(ent instanceof EntityPlayer) { - - EntityPlayer p = (EntityPlayer)ent; - - Vec3 offset = Vec3.createVectorHelper(0.125, 0, 0); - float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); - - offset.rotateAroundY(angle); - - double ix = p.posX; - double iy = p.posY - p.getYOffset() - 0.5D; - double iz = p.posZ; - double ox = offset.xCoord; - double oz = offset.zCoord; - - if(particleSetting == 0) { - Vec3 pos = Vec3.createVectorHelper(ix, iy, iz); - Vec3 thrust = Vec3.createVectorHelper(0, -1, 0); - Vec3 target = pos.addVector(thrust.xCoord * 10, thrust.yCoord * 10, thrust.zCoord * 10); - MovingObjectPosition mop = player.worldObj.func_147447_a(pos, target, false, false, true); - - if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK && mop.sideHit == 1) { - - Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); - int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); - - Vec3 delta = Vec3.createVectorHelper(ix - mop.hitVec.xCoord, iy - mop.hitVec.yCoord, iz - mop.hitVec.zCoord); - Vec3 vel = Vec3.createVectorHelper(0.75 - delta.lengthVector() * 0.075, 0, 0); - - for(int i = 0; i < (10 - delta.lengthVector()); i++) { - vel.rotateAroundY(world.rand.nextFloat() * (float)Math.PI * 2F); - Minecraft.getMinecraft().effectRenderer.addEffect(new EntityBlockDustFX(world, mop.hitVec.xCoord, mop.hitVec.yCoord + 0.1, mop.hitVec.zCoord, vel.xCoord, 0.1, vel.zCoord, b, meta)); - } - } - } - - EntityReddustFX dust1 = new EntityReddustFX(world, ix + ox, iy, iz + oz, 0.01F, 1.0F, 1.0F); - EntityReddustFX dust2 = new EntityReddustFX(world, ix - ox, iy, iz - oz, 0.01F, 1.0F, 1.0F); - dust1.setVelocity(p.motionX, p.motionY, p.motionZ); - dust2.setVelocity(p.motionX, p.motionY, p.motionZ); - Minecraft.getMinecraft().effectRenderer.addEffect(dust1); - Minecraft.getMinecraft().effectRenderer.addEffect(dust2); - } - } - - if("muke".equals(type)) { - - ParticleMukeWave wave = new ParticleMukeWave(man, world, x, y, z); - ParticleMukeFlash flash = new ParticleMukeFlash(man, world, x, y, z, data.getBoolean("balefire")); - - Minecraft.getMinecraft().effectRenderer.addEffect(wave); - Minecraft.getMinecraft().effectRenderer.addEffect(flash); - - //single swing: HT 15, MHT 15 - //double swing: HT 60, MHT 50 - //vic's immersive swing: HT 100, MHT 50 - - if(player.getDisplayName().equals("Vic4Games")) { - player.hurtTime = 100; - player.maxHurtTime = 50; - } else { - player.hurtTime = 15; - player.maxHurtTime = 15; - } - player.attackedAtYaw = 0F; - } - - if("tinytot".equals(type)) { - - ParticleMukeWave wave = new ParticleMukeWave(man, world, x, y, z); - Minecraft.getMinecraft().effectRenderer.addEffect(wave); - - for(double d = 0.0D; d <= 1.6D; d += 0.1) { - ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y, z, rand.nextGaussian() * 0.05, d + rand.nextGaussian() * 0.02, rand.nextGaussian() * 0.05); - Minecraft.getMinecraft().effectRenderer.addEffect(cloud); - } - for(int i = 0; i < 50; i++) { - ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y + 0.5, z, rand.nextGaussian() * 0.5, rand.nextInt(5) == 0 ? 0.02 : 0, rand.nextGaussian() * 0.5); - Minecraft.getMinecraft().effectRenderer.addEffect(cloud); - } - for(int i = 0; i < 15; i++) { - double ix = rand.nextGaussian() * 0.2; - double iz = rand.nextGaussian() * 0.2; - - if(ix * ix + iz * iz > 0.75) { - ix *= 0.5; - iz *= 0.5; - } - - double iy = 1.6 + (rand.nextDouble() * 2 - 1) * (0.75 - (ix * ix + iz * iz)) * 0.5; - - ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y, z, ix, iy + rand.nextGaussian() * 0.02, iz); - Minecraft.getMinecraft().effectRenderer.addEffect(cloud); - } - if(player.getDisplayName().equals("Vic4Games")) { - player.hurtTime = 100; - player.maxHurtTime = 50; - } else { - player.hurtTime = 15; - player.maxHurtTime = 15; - } - player.attackedAtYaw = 0F; - } - - if("ufo".equals(type)) { - double motion = data.getDouble("motion"); - ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y, z, rand.nextGaussian() * motion, 0, rand.nextGaussian() * motion); - Minecraft.getMinecraft().effectRenderer.addEffect(cloud); - } - - if("haze".equals(type)) { - - ParticleHaze fog = new ParticleHaze(man, world, x, y, z); - Minecraft.getMinecraft().effectRenderer.addEffect(fog); - } - - if("plasmablast".equals(type)) { - - ParticlePlasmaBlast cloud = new ParticlePlasmaBlast(man, world, x, y, z, data.getFloat("r"), data.getFloat("g"), data.getFloat("b"), data.getFloat("pitch"), data.getFloat("yaw")); - cloud.setScale(data.getFloat("scale")); - Minecraft.getMinecraft().effectRenderer.addEffect(cloud); - } - - if("justTilt".equals(type)) { - - player.hurtTime = player.maxHurtTime = data.getInteger("time"); - player.attackedAtYaw = 0F; - } - - if("properJolt".equals(type)) { - - player.hurtTime = data.getInteger("time"); - player.maxHurtTime = data.getInteger("maxTime"); - player.attackedAtYaw = 0F; - } - - if("sweat".equals(type)) { - - Entity e = world.getEntityByID(data.getInteger("entity")); - Block b = Block.getBlockById(data.getInteger("block")); - int meta = data.getInteger("meta"); - - if(e instanceof EntityLivingBase) { + double motion = data.getDouble("motion"); for(int i = 0; i < data.getInteger("count"); i++) { - double ix = e.boundingBox.minX - 0.2 + (e.boundingBox.maxX - e.boundingBox.minX + 0.4) * rand.nextDouble(); - double iy = e.boundingBox.minY + (e.boundingBox.maxY - e.boundingBox.minY + 0.2) * rand.nextDouble(); - double iz = e.boundingBox.minZ - 0.2 + (e.boundingBox.maxZ - e.boundingBox.minZ + 0.4) * rand.nextDouble(); + double mX = rand.nextGaussian() * motion; + double mY = rand.nextGaussian() * motion; + double mZ = rand.nextGaussian() * motion; + EntityFX fx = null; + + switch (data.getString("mode")) + { + case "flame": fx = new EntityFlameFX(world, x, y, z, mX, mY, mZ); break; + case "cloud": fx = new net.minecraft.client.particle.EntityCloudFX(world, x, y, z, mX, mY, mZ); break; + + case "reddust": + fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.0F, 0.0F, 0.0F); + fx.motionX = mX; + fx.motionY = mY; + fx.motionZ = mZ; + break; + case "bluedust": fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.01F, 1F); break; + case "greendust": fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.5F, 0.1F); break; + + case "blockdust": + Block b = Block.getBlockById(data.getInteger("block")); + fx = new net.minecraft.client.particle.EntityBlockDustFX(world, x, y, z, mX, mY + 0.2, mZ, b, 0); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 50 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + break; + default: break; + } - EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, 0, 0, 0, b, meta); - ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + if(fx != null) + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + + } + break; + } + + case "vanillaExt": { + + double mX = data.getDouble("mX"); + double mY = data.getDouble("mY"); + double mZ = data.getDouble("mZ"); + + EntityFX fx = null; + + switch (data.getString("mode")) + { + case "flame": fx = new EntityFlameFX(world, x, y, z, mX, mY, mZ); break; + case "smoke": fx = new net.minecraft.client.particle.EntitySmokeFX(world, x, y, z, mX, mY, mZ); break; + case "volcano": + fx = new net.minecraft.client.particle.EntitySmokeFX(world, x, y, z, mX, mY, mZ); + float scale = 100; + ReflectionHelper.setPrivateValue(net.minecraft.client.particle.EntitySmokeFX.class, (net.minecraft.client.particle.EntitySmokeFX)fx, scale, "smokeParticleScale", "field_70587_a"); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 200 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + fx.noClip = true; + fx.motionY = 2.5 + rand.nextDouble(); + fx.motionX = rand.nextGaussian() * 0.2; + fx.motionZ = rand.nextGaussian() * 0.2; + break; + case "cloud": + fx = new net.minecraft.client.particle.EntityCloudFX(world, x, y, z, mX, mY, mZ); + + if(data.hasKey("r")) { + float rng = rand.nextFloat() * 0.1F; + fx.setRBGColorF(data.getFloat("r") + rng, data.getFloat("g") + rng, data.getFloat("b") + rng); + ReflectionHelper.setPrivateValue(net.minecraft.client.particle.EntityCloudFX.class, (EntityCloudFX)fx, 7.5F, "field_70569_a"); + fx.motionX = 0; + fx.motionY = 0; + fx.motionZ = 0; + } + break; + case "reddust": fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, (float)mX, (float)mY, (float)mZ); break; + case "bluedust": fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.01F, 1F); break; + case "greendust": fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.5F, 0.1F); break; + case "largeexplode": + 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); + + 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); + } + break; + case "townaura": + fx = new EntityAuraFX(world, x, y, z, 0, 0, 0); + float color = 0.5F + rand.nextFloat() * 0.5F; + fx.setRBGColorF(0.8F * color, 0.9F * color, 1.0F * color); + fx.setVelocity(mX, mY, mZ); + break; + case "blockdust": + { + Block b = Block.getBlockById(data.getInteger("block")); + fx = new net.minecraft.client.particle.EntityBlockDustFX(world, x, y, z, mX, mY + 0.2, mZ, b, 0); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 10 + rand.nextInt(20), "particleMaxAge", "field_70547_e"); + break; + } + case "colordust": + { + Block b = Blocks.wool; + fx = new net.minecraft.client.particle.EntityBlockDustFX(world, x, y, z, mX, mY + 0.2, mZ, b, 0); + fx.setRBGColorF(data.getFloat("r"), data.getFloat("g"), data.getFloat("b")); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 10 + rand.nextInt(20), "particleMaxAge", "field_70547_e"); + break; + } + default: + break; + } + + if(fx != null) { + + fx.noClip = data.getBoolean("noclip"); + + if(data.getInteger("overrideAge") > 0) { + ReflectionHelper.setPrivateValue(EntityFX.class, fx, data.getInteger("overrideAge"), "particleMaxAge", "field_70547_e"); + } Minecraft.getMinecraft().effectRenderer.addEffect(fx); } + break; } - } - if("vomit".equals(type)) { - - Entity e = world.getEntityByID(data.getInteger("entity")); - int count = data.getInteger("count") / (particleSetting + 1); - - if(e instanceof EntityLivingBase) { + case "vanilla": { - double ix = e.posX; - double iy = e.posY - e.getYOffset() + e.getEyeHeight() + (e instanceof EntityPlayer ? 1 : 0); - double iz = e.posZ; + double mX = data.getDouble("mX"); + double mY = data.getDouble("mY"); + double mZ = data.getDouble("mZ"); + world.spawnParticle(data.getString("mode"), x, y, z, mX, mY, mZ); + break; + } + + case "jetpack": { + + if(particleSetting == 2) + return; - Vec3 vec = e.getLookVec(); + Entity ent = world.getEntityByID(data.getInteger("player")); - for(int i = 0; i < count; i++) { + if(ent instanceof EntityPlayer) { - if("normal".equals(data.getString("mode"))) { - EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.yCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.zCoord + rand.nextGaussian() * 0.2) * 0.2, Blocks.stained_hardened_clay, (rand.nextBoolean() ? 5 : 13)); - ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); + EntityPlayer p = (EntityPlayer)ent; + + Vec3 vec = Vec3.createVectorHelper(0, 0, -0.25); + Vec3 offset = Vec3.createVectorHelper(0.125, 0, 0); + float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); + + vec.rotateAroundY(angle); + offset.rotateAroundY(angle); + + double ix = p.posX + vec.xCoord; + double iy = p.posY + p.eyeHeight - 1; + double iz = p.posZ + vec.zCoord; + double ox = offset.xCoord; + double oz = offset.zCoord; + + double moX = 0; + double moY = 0; + double moZ = 0; + + int mode = data.getInteger("mode"); + + if(mode == 0) { + moY -= 0.2; } - if("blood".equals(data.getString("mode"))) { - EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.yCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.zCoord + rand.nextGaussian() * 0.2) * 0.2, Blocks.redstone_block, 0); - ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); + if(mode == 1) { + Vec3 look = p.getLookVec(); + + moX -= look.xCoord * 0.1D; + moY -= look.yCoord * 0.1D; + moZ -= look.zCoord * 0.1D; } + + if(particleSetting == 0) { + Vec3 pos = Vec3.createVectorHelper(ix, iy, iz); + Vec3 thrust = Vec3.createVectorHelper(moX, moY, moZ); + thrust = thrust.normalize(); + Vec3 target = pos.addVector(thrust.xCoord * 10, thrust.yCoord * 10, thrust.zCoord * 10); + MovingObjectPosition mop = player.worldObj.func_147447_a(pos, target, false, false, true); + + if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK && mop.sideHit == 1) { + + Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); + + Vec3 delta = Vec3.createVectorHelper(ix - mop.hitVec.xCoord, iy - mop.hitVec.yCoord, iz - mop.hitVec.zCoord); + Vec3 vel = Vec3.createVectorHelper(0.75 - delta.lengthVector() * 0.075, 0, 0); + + for(int i = 0; i < (10 - delta.lengthVector()); i++) { + vel.rotateAroundY(world.rand.nextFloat() * (float)Math.PI * 2F); + Minecraft.getMinecraft().effectRenderer.addEffect(new EntityBlockDustFX(world, mop.hitVec.xCoord, mop.hitVec.yCoord + 0.1, mop.hitVec.zCoord, vel.xCoord, 0.1, vel.zCoord, b, meta)); + } + } + } + + double mX2 = BobMathUtil.safeClamp(p.motionX + moX * 2, -5, 5); + double mY2 = BobMathUtil.safeClamp(p.motionY + moY * 2, -5, 5); + double mZ2 = BobMathUtil.safeClamp(p.motionZ + moZ * 2, -5, 5); + double mX3 = BobMathUtil.safeClamp(p.motionX + moX * 2, -10, 10); + double mY3 = BobMathUtil.safeClamp(p.motionY + moY * 2, -10, 10); + double mZ3 = BobMathUtil.safeClamp(p.motionZ + moZ * 2, -10, 10); + + Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix + ox, iy, iz + oz, mX2, mY2, mZ2)); + Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix - ox, iy, iz - oz, mX2, mY2, mZ2)); - if("smoke".equals(data.getString("mode"))) { - EntityFX fx = new net.minecraft.client.particle.EntitySmokeFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.1) * 0.05, (vec.yCoord + rand.nextGaussian() * 0.1) * 0.05, (vec.zCoord + rand.nextGaussian() * 0.1) * 0.05, 0.2F); - ReflectionHelper.setPrivateValue(EntityFX.class, fx, 10 + rand.nextInt(10), "particleMaxAge", "field_70547_e"); + if(particleSetting == 0) { + Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix + ox, iy, iz + oz, mX3, mY3, mZ3)); + Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix - ox, iy, iz - oz, mX3, mY3, mZ3)); + } + } + break; + } + + case "bnuuy": { + + if(particleSetting == 2) + return; + + Entity ent = world.getEntityByID(data.getInteger("player")); + + if(ent instanceof EntityPlayer) { + + EntityPlayer p = (EntityPlayer)ent; + + Vec3 vec = Vec3.createVectorHelper(0, 0, -0.6); + Vec3 offset = Vec3.createVectorHelper(0.275, 0, 0); + float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); + + vec.rotateAroundY(angle); + offset.rotateAroundY(angle); + + double ix = p.posX + vec.xCoord; + double iy = p.posY + p.eyeHeight - 1 + 0.4; + double iz = p.posZ + vec.zCoord; + double ox = offset.xCoord; + double oz = offset.zCoord; + + vec = vec.normalize(); + double mult = 0.025D; + double mX = vec.xCoord * mult; + double mZ = vec.zCoord * mult; + + //Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix + ox, iy, iz + oz, 0, 0, 0)); + //Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix - ox, iy, iz - oz, 0, 0, 0)); + + for(int i = 0; i < 2; i++) { + net.minecraft.client.particle.EntitySmokeFX fx = new net.minecraft.client.particle.EntitySmokeFX(world, ix + ox * (i == 0 ? -1 : 1), iy, iz + oz * (i == 0 ? -1 : 1), mX, 0, mZ); + float scale = 0.5F; + ReflectionHelper.setPrivateValue(net.minecraft.client.particle.EntitySmokeFX.class, fx, scale, "smokeParticleScale", "field_70587_a"); Minecraft.getMinecraft().effectRenderer.addEffect(fx); } } + break; } - } - if("radiation".equals(type)) { + case "jetpack_bj": { - for(int i = 0; i < data.getInteger("count"); i++) { + if(particleSetting == 2) + return; - EntityAuraFX flash = new EntityAuraFX(world, - player.posX + rand.nextGaussian() * 4, - player.posY + rand.nextGaussian() * 2, - player.posZ + rand.nextGaussian() * 4, - 0, 0, 0); + Entity ent = world.getEntityByID(data.getInteger("player")); - flash.setRBGColorF(0F, 0.75F, 1F); - flash.setVelocity(rand.nextGaussian(), rand.nextGaussian(), rand.nextGaussian()); + if(ent instanceof EntityPlayer) { + + EntityPlayer p = (EntityPlayer)ent; + + Vec3 vec = Vec3.createVectorHelper(0, 0, -0.3125); + Vec3 offset = Vec3.createVectorHelper(0.125, 0, 0); + float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); + + vec.rotateAroundY(angle); + offset.rotateAroundY(angle); + + double ix = p.posX + vec.xCoord; + double iy = p.posY + p.eyeHeight - 0.9375; + double iz = p.posZ + vec.zCoord; + double ox = offset.xCoord; + double oz = offset.zCoord; + + if(particleSetting == 0) { + Vec3 pos = Vec3.createVectorHelper(ix, iy, iz); + Vec3 thrust = Vec3.createVectorHelper(0, -1, 0); + Vec3 target = pos.addVector(thrust.xCoord * 10, thrust.yCoord * 10, thrust.zCoord * 10); + MovingObjectPosition mop = player.worldObj.func_147447_a(pos, target, false, false, true); + + if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK && mop.sideHit == 1) { + + Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); + + Vec3 delta = Vec3.createVectorHelper(ix - mop.hitVec.xCoord, iy - mop.hitVec.yCoord, iz - mop.hitVec.zCoord); + Vec3 vel = Vec3.createVectorHelper(0.75 - delta.lengthVector() * 0.075, 0, 0); + + for(int i = 0; i < (10 - delta.lengthVector()); i++) { + vel.rotateAroundY(world.rand.nextFloat() * (float)Math.PI * 2F); + Minecraft.getMinecraft().effectRenderer.addEffect(new EntityBlockDustFX(world, mop.hitVec.xCoord, mop.hitVec.yCoord + 0.1, mop.hitVec.zCoord, vel.xCoord, 0.1, vel.zCoord, b, meta)); + } + } + } + + EntityReddustFX dust1 = new EntityReddustFX(world, ix + ox, iy, iz + oz, 0.8F, 0.5F, 1.0F); + EntityReddustFX dust2 = new EntityReddustFX(world, ix - ox, iy, iz - oz, 0.8F, 0.5F, 1.0F); + dust1.setVelocity(p.motionX, p.motionY, p.motionZ); + dust2.setVelocity(p.motionX, p.motionY, p.motionZ); + Minecraft.getMinecraft().effectRenderer.addEffect(dust1); + Minecraft.getMinecraft().effectRenderer.addEffect(dust2); + } + break; + } + + case "jetpack_dns": { + + if(particleSetting == 2) + return; + + Entity ent = world.getEntityByID(data.getInteger("player")); + + if(ent instanceof EntityPlayer) { + + EntityPlayer p = (EntityPlayer)ent; + + Vec3 offset = Vec3.createVectorHelper(0.125, 0, 0); + float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); + + offset.rotateAroundY(angle); + + double ix = p.posX; + double iy = p.posY - p.getYOffset() - 0.5D; + double iz = p.posZ; + double ox = offset.xCoord; + double oz = offset.zCoord; + + if(particleSetting == 0) { + Vec3 pos = Vec3.createVectorHelper(ix, iy, iz); + Vec3 thrust = Vec3.createVectorHelper(0, -1, 0); + Vec3 target = pos.addVector(thrust.xCoord * 10, thrust.yCoord * 10, thrust.zCoord * 10); + MovingObjectPosition mop = player.worldObj.func_147447_a(pos, target, false, false, true); + + if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK && mop.sideHit == 1) { + + Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); + + Vec3 delta = Vec3.createVectorHelper(ix - mop.hitVec.xCoord, iy - mop.hitVec.yCoord, iz - mop.hitVec.zCoord); + Vec3 vel = Vec3.createVectorHelper(0.75 - delta.lengthVector() * 0.075, 0, 0); + + for(int i = 0; i < (10 - delta.lengthVector()); i++) { + vel.rotateAroundY(world.rand.nextFloat() * (float)Math.PI * 2F); + Minecraft.getMinecraft().effectRenderer.addEffect(new EntityBlockDustFX(world, mop.hitVec.xCoord, mop.hitVec.yCoord + 0.1, mop.hitVec.zCoord, vel.xCoord, 0.1, vel.zCoord, b, meta)); + } + } + } + + EntityReddustFX dust1 = new EntityReddustFX(world, ix + ox, iy, iz + oz, 0.01F, 1.0F, 1.0F); + EntityReddustFX dust2 = new EntityReddustFX(world, ix - ox, iy, iz - oz, 0.01F, 1.0F, 1.0F); + dust1.setVelocity(p.motionX, p.motionY, p.motionZ); + dust2.setVelocity(p.motionX, p.motionY, p.motionZ); + Minecraft.getMinecraft().effectRenderer.addEffect(dust1); + Minecraft.getMinecraft().effectRenderer.addEffect(dust2); + } + break; + } + + case "muke": { + + ParticleMukeWave wave = new ParticleMukeWave(man, world, x, y, z); + ParticleMukeFlash flash = new ParticleMukeFlash(man, world, x, y, z, data.getBoolean("balefire")); + + Minecraft.getMinecraft().effectRenderer.addEffect(wave); Minecraft.getMinecraft().effectRenderer.addEffect(flash); - } - } - - if("schrabfog".equals(type)) { + + //single swing: HT 15, MHT 15 + //double swing: HT 60, MHT 50 + //vic's immersive swing: HT 100, MHT 50 - EntityAuraFX flash = new EntityAuraFX(world, x, y, z, 0, 0, 0); - flash.setRBGColorF(0F, 1F, 1F); - Minecraft.getMinecraft().effectRenderer.addEffect(flash); - } - - if("hadron".equals(type)) { - - Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleHadron(man, world, x, y, z)); - } - - if("rift".equals(type)) { - - Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleRift(man, world, x, y, z)); - } - - if("rbmkflame".equals(type)) { - int maxAge = data.getInteger("maxAge"); - Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleRBMKFlame(man, world, x, y, z, maxAge)); - } - - if("rbmkmush".equals(type)) { - float scale = data.getFloat("scale"); - Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleRBMKMush(man, world, x, y, z, scale)); - } - - if("tower".equals(type)) { - if(particleSetting == 0 || (particleSetting == 1 && rand.nextBoolean())) { - ParticleCoolingTower fx = new ParticleCoolingTower(man, world, x, y, z); - fx.setLift(data.getFloat("lift")); - fx.setBaseScale(data.getFloat("base")); - fx.setMaxScale(data.getFloat("max")); - fx.setLife(data.getInteger("life") / (particleSetting + 1)); - - if(data.hasKey("color")) { - Color color = new Color(data.getInteger("color")); - fx.setRBGColorF(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F); - } - - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - } - - if("deadleaf".equals(type)) { - if(particleSetting == 0 || (particleSetting == 1 && rand.nextBoolean())) - Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleDeadLeaf(man, world, x, y, z)); - } - - if("anim".equals(type)) { - - /* crucible deploy */ - if("crucible".equals(data.getString("mode")) && player.getHeldItem() != null) { - - BusAnimation animation = new BusAnimation() - .addBus("GUARD_ROT", new BusAnimationSequence() - .addKeyframe(new BusAnimationKeyframe(90, 0, 1, 0)) - .addKeyframe(new BusAnimationKeyframe(90, 0, 1, 800)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 1, 50))); - - HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); - } - - /* crucible swing */ - if("cSwing".equals(data.getString("mode"))) { - - if(HbmAnimations.getRelevantTransformation("SWING_ROT")[0] == 0) { - - int offset = rand.nextInt(80) - 20; - - BusAnimation animation = new BusAnimation() - .addBus("SWING_ROT", new BusAnimationSequence() - .addKeyframe(new BusAnimationKeyframe(90 - offset, 90 - offset, 35, 75)) - .addKeyframe(new BusAnimationKeyframe(90 + offset, 90 - offset, -45, 150)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))) - .addBus("SWING_TRANS", new BusAnimationSequence() - .addKeyframe(new BusAnimationKeyframe(-3, 0, 0, 75)) - .addKeyframe(new BusAnimationKeyframe(8, 0, 0, 150)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))); - - Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:weapon.cSwing"), 0.8F + player.getRNG().nextFloat() * 0.2F)); - - HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); - } - } - - /* chainsaw swing */ - if("sSwing".equals(data.getString("mode")) || "lSwing".equals(data.getString("mode"))) { //temp for lance - - int forward = 150; - int sideways = 100; - int retire = 200; - - if(HbmAnimations.getRelevantAnim() == null) { - - BusAnimation animation = new BusAnimation() - .addBus("SWING_ROT", new BusAnimationSequence() - .addKeyframe(new BusAnimationKeyframe(0, 0, 90, forward)) - .addKeyframe(new BusAnimationKeyframe(45, 0, 90, sideways)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))) - .addBus("SWING_TRANS", new BusAnimationSequence() - .addKeyframe(new BusAnimationKeyframe(0, 0, 3, forward)) - .addKeyframe(new BusAnimationKeyframe(2, 0, 2, sideways)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))); - - - HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); - + if(player.getDisplayName().equals("Vic4Games")) { + player.hurtTime = 100; + player.maxHurtTime = 50; } else { - - double[] rot = HbmAnimations.getRelevantTransformation("SWING_ROT"); - double[] trans = HbmAnimations.getRelevantTransformation("SWING_TRANS"); - - if(System.currentTimeMillis() - HbmAnimations.getRelevantAnim().startMillis < 50) return; - - BusAnimation animation = new BusAnimation() - .addBus("SWING_ROT", new BusAnimationSequence() - .addKeyframe(new BusAnimationKeyframe(rot[0], rot[1], rot[2], 0)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 90, forward)) - .addKeyframe(new BusAnimationKeyframe(45, 0, 90, sideways)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))) - .addBus("SWING_TRANS", new BusAnimationSequence() - .addKeyframe(new BusAnimationKeyframe(trans[0], trans[1], trans[2], 0)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 3, forward)) - .addKeyframe(new BusAnimationKeyframe(2, 0, 2, sideways)) - .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))); - - HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); + player.hurtTime = 15; + player.maxHurtTime = 15; } + player.attackedAtYaw = 0F; + break; } - } - if("tau".equals(type)) { + case "tinytot": { + + ParticleMukeWave wave = new ParticleMukeWave(man, world, x, y, z); + Minecraft.getMinecraft().effectRenderer.addEffect(wave); + + for(double d = 0.0D; d <= 1.6D; d += 0.1) { + ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y, z, rand.nextGaussian() * 0.05, d + rand.nextGaussian() * 0.02, rand.nextGaussian() * 0.05); + Minecraft.getMinecraft().effectRenderer.addEffect(cloud); + } + for(int i = 0; i < 50; i++) { + ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y + 0.5, z, rand.nextGaussian() * 0.5, rand.nextInt(5) == 0 ? 0.02 : 0, rand.nextGaussian() * 0.5); + Minecraft.getMinecraft().effectRenderer.addEffect(cloud); + } + for(int i = 0; i < 15; i++) { + double ix = rand.nextGaussian() * 0.2; + double iz = rand.nextGaussian() * 0.2; + + if(ix * ix + iz * iz > 0.75) { + ix *= 0.5; + iz *= 0.5; + } + + double iy = 1.6 + (rand.nextDouble() * 2 - 1) * (0.75 - (ix * ix + iz * iz)) * 0.5; + + ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y, z, ix, iy + rand.nextGaussian() * 0.02, iz); + Minecraft.getMinecraft().effectRenderer.addEffect(cloud); + } + if(player.getDisplayName().equals("Vic4Games")) { + player.hurtTime = 100; + player.maxHurtTime = 50; + } else { + player.hurtTime = 15; + player.maxHurtTime = 15; + } + player.attackedAtYaw = 0F; + } + + case "ufo": { + double motion = data.getDouble("motion"); + ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y, z, rand.nextGaussian() * motion, 0, rand.nextGaussian() * motion); + Minecraft.getMinecraft().effectRenderer.addEffect(cloud); + break; + } + + case "haze": { + ParticleHaze fog = new ParticleHaze(man, world, x, y, z); + Minecraft.getMinecraft().effectRenderer.addEffect(fog); + break; + } + + case "plasmablast": { - 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)); - } + ParticlePlasmaBlast cloud = new ParticlePlasmaBlast(man, world, x, y, z, data.getFloat("r"), data.getFloat("g"), data.getFloat("b"), data.getFloat("pitch"), data.getFloat("yaw")); + cloud.setScale(data.getFloat("scale")); + Minecraft.getMinecraft().effectRenderer.addEffect(cloud); + break; + } - if("vanish".equals(type)) { - int ent = data.getInteger("ent"); - this.vanish(ent); - } + case "justTilt": { + + player.hurtTime = player.maxHurtTime = data.getInteger("time"); + player.attackedAtYaw = 0F; + break; + } - if("giblets".equals(type)) { + case "properJolt": { + + player.hurtTime = data.getInteger("time"); + player.maxHurtTime = data.getInteger("maxTime"); + player.attackedAtYaw = 0F; + break; + } + + case "sweat": { + + Entity e = world.getEntityByID(data.getInteger("entity")); + Block b = Block.getBlockById(data.getInteger("block")); + int meta = data.getInteger("meta"); + + if(e instanceof EntityLivingBase) { + + for(int i = 0; i < data.getInteger("count"); i++) { + + double ix = e.boundingBox.minX - 0.2 + (e.boundingBox.maxX - e.boundingBox.minX + 0.4) * rand.nextDouble(); + double iy = e.boundingBox.minY + (e.boundingBox.maxY - e.boundingBox.minY + 0.2) * rand.nextDouble(); + double iz = e.boundingBox.minZ - 0.2 + (e.boundingBox.maxZ - e.boundingBox.minZ + 0.4) * rand.nextDouble(); + + + EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, 0, 0, 0, b, meta); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + } + break; + } + + case "vomit": { + + Entity e = world.getEntityByID(data.getInteger("entity")); + int count = data.getInteger("count") / (particleSetting + 1); + + if(e instanceof EntityLivingBase) { + + double ix = e.posX; + double iy = e.posY - e.getYOffset() + e.getEyeHeight() + (e instanceof EntityPlayer ? 1 : 0); + double iz = e.posZ; + + Vec3 vec = e.getLookVec(); + + for(int i = 0; i < count; i++) { + + if("normal".equals(data.getString("mode"))) { + EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.yCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.zCoord + rand.nextGaussian() * 0.2) * 0.2, Blocks.stained_hardened_clay, (rand.nextBoolean() ? 5 : 13)); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + + if("blood".equals(data.getString("mode"))) { + EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.yCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.zCoord + rand.nextGaussian() * 0.2) * 0.2, Blocks.redstone_block, 0); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + + if("smoke".equals(data.getString("mode"))) { + EntityFX fx = new net.minecraft.client.particle.EntitySmokeFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.1) * 0.05, (vec.yCoord + rand.nextGaussian() * 0.1) * 0.05, (vec.zCoord + rand.nextGaussian() * 0.1) * 0.05, 0.2F); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 10 + rand.nextInt(10), "particleMaxAge", "field_70547_e"); + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + } + } + break; + } + + case "radiation": { + + for(int i = 0; i < data.getInteger("count"); i++) { + + EntityAuraFX flash = new EntityAuraFX(world, + player.posX + rand.nextGaussian() * 4, + player.posY + rand.nextGaussian() * 2, + player.posZ + rand.nextGaussian() * 4, + 0, 0, 0); + + flash.setRBGColorF(0F, 0.75F, 1F); + flash.setVelocity(rand.nextGaussian(), rand.nextGaussian(), rand.nextGaussian()); + Minecraft.getMinecraft().effectRenderer.addEffect(flash); + } + break; + } + + case "schrabfog": { + + EntityAuraFX flash = new EntityAuraFX(world, x, y, z, 0, 0, 0); + flash.setRBGColorF(0F, 1F, 1F); + Minecraft.getMinecraft().effectRenderer.addEffect(flash); + break; + } + + case "hadron": Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleHadron(man, world, x, y, z)); break; + case "rift": Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleRift(man, world, x, y, z)); break; + case "rbmkflame": Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleRBMKFlame(man, world, x, y, z, data.getInteger("maxAge"))); break; + case "rbmkmush": Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleRBMKMush(man, world, x, y, z, data.getFloat("scale"))); break; + + case "tower": { + if(particleSetting == 0 || (particleSetting == 1 && rand.nextBoolean())) { + ParticleCoolingTower fx = new ParticleCoolingTower(man, world, x, y, z); + fx.setLift(data.getFloat("lift")); + fx.setBaseScale(data.getFloat("base")); + fx.setMaxScale(data.getFloat("max")); + fx.setLife(data.getInteger("life") / (particleSetting + 1)); + + if(data.hasKey("color")) { + Color color = new Color(data.getInteger("color")); + fx.setRBGColorF(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F); + } + + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + break; + } + + case "deadleaf": { + if(particleSetting == 0 || (particleSetting == 1 && rand.nextBoolean())) + Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleDeadLeaf(man, world, x, y, z)); + break; + } + + case "anim": { + + /* crucible deploy */ + switch (data.getString("mode")) + { + case "crucible": + if(player.getHeldItem() != null) { + + BusAnimation animation = new BusAnimation() + .addBus("GUARD_ROT", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(90, 0, 1, 0)) + .addKeyframe(new BusAnimationKeyframe(90, 0, 1, 800)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 1, 50))); + + HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); + } + break; + /* crucible swing */ + case "cSwing": { + + if(HbmAnimations.getRelevantTransformation("SWING_ROT")[0] == 0) { + + int offset = rand.nextInt(80) - 20; + + BusAnimation animation = new BusAnimation() + .addBus("SWING_ROT", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(90 - offset, 90 - offset, 35, 75)) + .addKeyframe(new BusAnimationKeyframe(90 + offset, 90 - offset, -45, 150)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))) + .addBus("SWING_TRANS", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(-3, 0, 0, 75)) + .addKeyframe(new BusAnimationKeyframe(8, 0, 0, 150)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))); + + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:weapon.cSwing"), 0.8F + player.getRNG().nextFloat() * 0.2F)); + + HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); + } + break; + } + + /* chainsaw swing */ + case "sSwing": + case "lSwing": + { //temp for lance + + int forward = 150; + int sideways = 100; + int retire = 200; + + if(HbmAnimations.getRelevantAnim() == null) { + + BusAnimation animation = new BusAnimation() + .addBus("SWING_ROT", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(0, 0, 90, forward)) + .addKeyframe(new BusAnimationKeyframe(45, 0, 90, sideways)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))) + .addBus("SWING_TRANS", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(0, 0, 3, forward)) + .addKeyframe(new BusAnimationKeyframe(2, 0, 2, sideways)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))); + + + HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); + + } else { + + double[] rot = HbmAnimations.getRelevantTransformation("SWING_ROT"); + double[] trans = HbmAnimations.getRelevantTransformation("SWING_TRANS"); + + if(System.currentTimeMillis() - HbmAnimations.getRelevantAnim().startMillis < 50) return; + + BusAnimation animation = new BusAnimation() + .addBus("SWING_ROT", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(rot[0], rot[1], rot[2], 0)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 90, forward)) + .addKeyframe(new BusAnimationKeyframe(45, 0, 90, sideways)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))) + .addBus("SWING_TRANS", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(trans[0], trans[1], trans[2], 0)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 3, forward)) + .addKeyframe(new BusAnimationKeyframe(2, 0, 2, sideways)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))); + + HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); + } + } + default: + break; + } + break; + } + + case "tau": { + + 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)); + break; + } + + case "vanish": { + int ent = data.getInteger("ent"); + this.vanish(ent); + break; + } + + case "giblets": { int ent = data.getInteger("ent"); this.vanish(ent); Entity e = world.getEntityByID(ent); @@ -1766,48 +2339,58 @@ public class ClientProxy extends ServerProxy { for(int i = 0; i < count; i++) { Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleGiblet(man, world, x, y, z, rand.nextGaussian() * 0.25 * mult, rand.nextDouble() * mult, rand.nextGaussian() * 0.25 * mult)); } + break; } + case "amat": Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleAmatFlash(world, x, y, z, data.getFloat("scale"))); break; - if("amat".equals(type)) { - Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleAmatFlash(world, x, y, z, data.getFloat("scale"))); - } - - if("debug".equals(type)) { - String t = data.getString("text"); - int color = data.getInteger("color"); - float scale = data.getFloat("scale"); - ParticleText text = new ParticleText(world, x, y, z, color, t); - text.multipleParticleScaleBy(scale); - Minecraft.getMinecraft().effectRenderer.addEffect(text); - } - - if("network".equals(type)) { - ParticleDebug debug = null; - double mX = data.getDouble("mX"); - double mY = data.getDouble("mY"); - double mZ = data.getDouble("mZ"); - - if("power".equals(data.getString("mode"))) { - debug = new ParticleDebug(man, world, x, y, z, mX, mY, mZ); - } - if("fluid".equals(data.getString("mode"))) { + case "debug": { + String t = data.getString("text"); int color = data.getInteger("color"); - debug = new ParticleDebug(man, world, x, y, z, mX, mY, mZ, color); + float scale = data.getFloat("scale"); + ParticleText text = new ParticleText(world, x, y, z, color, t); + text.multipleParticleScaleBy(scale); + Minecraft.getMinecraft().effectRenderer.addEffect(text); + break; } - Minecraft.getMinecraft().effectRenderer.addEffect(debug); - } - if("gasfire".equals(type)) { - double mX = data.getDouble("mX"); - double mY = data.getDouble("mY"); - double mZ = data.getDouble("mZ"); - float scale = data.getFloat("scale"); - ParticleGasFlame text = new ParticleGasFlame(world, x, y, z, mX, mY, mZ, scale > 0 ? scale : 6.5F); - Minecraft.getMinecraft().effectRenderer.addEffect(text); + case "network": { + ParticleDebug debug = null; + double mX = data.getDouble("mX"); + double mY = data.getDouble("mY"); + double mZ = data.getDouble("mZ"); + switch (data.getString("mode")) + { + case "power": debug = new ParticleDebug(man, world, x, y, z, mX, mY, mZ); break; + case "fluid": debug = new ParticleDebug(man, world, x, y, z, mX, mY, mZ, data.getInteger("color")); break; + default: break; + } + Minecraft.getMinecraft().effectRenderer.addEffect(debug); + break; + } + + case "gasfire": { + double mX = data.getDouble("mX"); + double mY = data.getDouble("mY"); + double mZ = data.getDouble("mZ"); + float scale = data.getFloat("scale"); + ParticleGasFlame text = new ParticleGasFlame(world, x, y, z, mX, mY, mZ, scale > 0 ? scale : 6.5F); + Minecraft.getMinecraft().effectRenderer.addEffect(text); + break; + } + case "casing": + if (WeaponConfig.spawnCasings) + { + final SpentCasingConfig casingConfig = SpentCasingConfig.get(data.getString("name")); + for (int i = 0; i < casingConfig.getCasingAmount(); i++) + casingConfig.spawnCasing(man, world, x, y, z, data.getFloat("pitch"), data.getFloat("yaw"), data.getBoolean("crouched")); + } + break; + default: + break; } } - private HashMap vanished = new HashMap(); + private final HashMap vanished = new HashMap(); public void vanish(int ent) { vanished.put(ent, System.currentTimeMillis() + 2000); @@ -1840,12 +2423,6 @@ public class ClientProxy extends ServerProxy { return audio; } - @Override - public SoundWrapper getTileSound(String sound, ISoundSourceTE tile) { - SoundWrapperClient wrapper = new SoundWrapperClient(sound, tile); - return wrapper; - } - @Override public void playSound(String sound, Object data) { } @@ -1853,9 +2430,9 @@ public class ClientProxy extends ServerProxy { public void displayTooltip(String msg, int time, int id) { if(id != 0) - this.theInfoSystem.push(new InfoEntry(msg, time), id); + RenderInfoSystem.push(new InfoEntry(msg, time), id); else - this.theInfoSystem.push(new InfoEntry(msg, time)); + RenderInfoSystem.push(new InfoEntry(msg, time)); } @Override @@ -1872,9 +2449,9 @@ public class ClientProxy extends ServerProxy { case CRANE_LEFT: return HbmKeybinds.craneLeftKey.getIsKeyPressed(); case CRANE_RIGHT: return HbmKeybinds.craneRightKey.getIsKeyPressed(); case CRANE_LOAD: return HbmKeybinds.craneLoadKey.getIsKeyPressed(); + default: return false; } - return false; } @Override @@ -1886,13 +2463,15 @@ public class ClientProxy extends ServerProxy { public void openLink(String url) { try { Desktop.getDesktop().browse(new URI(url)); - } catch (Exception e) { } + } catch (Exception e) { + MainRegistry.logger.catching(e); + } } @Override public List getSubItems(ItemStack stack) { - List list = new ArrayList(); + List list = new ArrayList(); stack.getItem().getSubItems(stack.getItem(), stack.getItem().getCreativeTab(), list); for(ItemStack sta : list) { sta.stackSize = stack.stackSize; diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 6edfe9257..faa98d485 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -989,6 +989,9 @@ public class ResourceManager { public static final IModelCustom cart = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vehicles/cart.obj")); public static final IModelCustom cart_destroyer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vehicles/cart_destroyer.obj")); public static final IModelCustom cart_powder = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vehicles/cart_powder.obj")); + + //Casings + public static final IModelCustom casings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/effect/casings.obj")); ////Texture Entities @@ -1261,6 +1264,9 @@ public class ResourceManager { public static final ResourceLocation cart_semtex_side = new ResourceLocation(RefStrings.MODID, "textures/blocks/semtex_side.png"); public static final ResourceLocation cart_semtex_top = new ResourceLocation(RefStrings.MODID, "textures/blocks/semtex_bottom.png"); + //Casings + public static final ResourceLocation casings_tex = new ResourceLocation(RefStrings.MODID, "textures/particle/casing_tex.png"); + //ISBRHs public static final IModelCustom scaffold = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/scaffold.obj")); public static final IModelCustom taperecorder = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/taperecorder.obj")); diff --git a/src/main/java/com/hbm/main/ServerProxy.java b/src/main/java/com/hbm/main/ServerProxy.java index 47aadfd5a..aa28b5f51 100644 --- a/src/main/java/com/hbm/main/ServerProxy.java +++ b/src/main/java/com/hbm/main/ServerProxy.java @@ -4,9 +4,8 @@ import java.util.ArrayList; import java.util.List; import com.hbm.handler.HbmKeybinds.EnumKeybind; +import com.hbm.saveddata.TomSaveData; import com.hbm.sound.AudioWrapper; -import com.hbm.sound.nt.ISoundSourceTE; -import com.hbm.sound.nt.SoundWrapper; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -65,14 +64,22 @@ public class ServerProxy { public void openLink(String url) { } - public SoundWrapper getTileSound(String sound, ISoundSourceTE source) { - return new SoundWrapper(); - } - public List getSubItems(ItemStack stack) { - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(stack); return list; } + + public float getImpactDust(World world) { + return TomSaveData.forWorld(world).dust; + } + + public float getImpactFire(World world) { + return TomSaveData.forWorld(world).fire; + } + + public boolean getImpact(World world) { + return TomSaveData.forWorld(world).impact; + } } \ No newline at end of file diff --git a/src/main/java/com/hbm/particle/ParticleSpentCasing.java b/src/main/java/com/hbm/particle/ParticleSpentCasing.java new file mode 100644 index 000000000..7667d7ef7 --- /dev/null +++ b/src/main/java/com/hbm/particle/ParticleSpentCasing.java @@ -0,0 +1,222 @@ +package com.hbm.particle; + +import java.util.ArrayList; +import java.util.List; + +import org.lwjgl.opengl.GL11; + +import com.hbm.calc.EasyLocation; +import com.hbm.main.ResourceManager; +import com.hbm.util.Tuple.Pair; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class ParticleSpentCasing extends EntityFX +{ + private static final float dScale = 0.05f;//, smokeJitter = 0.025f, smokeAccel = 0.5f; +// private static final byte maxSmokeGen = 60, maxSmokeLife = 120; + + private final List> smokeNodes = new ArrayList>(); + + private final TextureManager textureManager; + + private final SpentCasingConfig config; +// private final boolean smoke; + + private float momentumPitch, momentumYaw; + private boolean onGroundPreviously = false; + private double maxHeight; + public ParticleSpentCasing(TextureManager textureManager, World world, double x, double y, double z, double mx, double my, double mz, float momentumPitch, float momentumYaw, SpentCasingConfig config) + { + super(world, x, y, z, 0, 0, 0); + this.textureManager = textureManager; + this.momentumPitch = momentumPitch; + this.momentumYaw = momentumYaw; + this.config = config; + + particleMaxAge = 240; +// smoke = config.getSmokeChance() == 0 ? true +// : config.getSmokeChance() < 0 ? false +// : rand.nextInt(config.getSmokeChance()) == 0; + + motionX = mx; + motionY = my; + motionZ = mz; + + particleGravity = 8f; + + maxHeight = y; + } + + @Override + public int getFXLayer() + { + return 3; + } + + @Override + public void onUpdate() + { + super.onUpdate(); + + if (motionY > 0 && posY > maxHeight) + maxHeight = posY; + + if (!onGroundPreviously && onGround) + tryPlayBounceSound(); + + // TODO Bounce factor in config + if (!onGroundPreviously && onGround) + { + onGroundPreviously = true; + motionY = Math.log10(maxHeight - posY + 2); + momentumPitch = (float) rand.nextGaussian() * config.getPitchFactor(); + momentumYaw = (float) rand.nextGaussian() * config.getYawFactor(); + + maxHeight = posY; + } else if (onGroundPreviously && !onGround) + onGroundPreviously = false; + +// if (particleAge > maxSmokeLife && !smokeNodes.isEmpty()) +// smokeNodes.clear(); + +// if (smoke && particleAge <= maxSmokeLife) +// { +// final double side = (rotationYaw - prevRotationYaw) * 0.1D; +// final Vec3 prev = Vec3.createVectorHelper(motionX, motionY, motionZ); +// prev.rotateAroundY((float) Math.toRadians(rotationYaw)); +// +// for (Pair pair : smokeNodes) +// { +// final EasyLocation node = pair.getKey(); +// +// node.posX += prev.xCoord * smokeAccel + rand.nextGaussian() * smokeJitter + side; +// node.posY += prev.yCoord + smokeAccel; +// node.posZ += prev.zCoord * smokeAccel + rand.nextGaussian() * smokeJitter; +// } +// +// if (particleAge < maxSmokeGen || inWater) +// { +// final double alpha = (particleAge / 20d); +// smokeNodes.add(new Pair(EasyLocation.getZeroLocation(), alpha)); +// } +// } + + prevRotationPitch = rotationPitch; + prevRotationYaw = rotationYaw; + +// if (motionY > gravity && !onGround) +// motionY += gravity; +// if (motionY < -0.75) +// motionY = -0.75; + + if (onGround) + rotationPitch = 0; + else + { + rotationPitch += momentumPitch; + rotationYaw += momentumYaw; + } + } + + @Override + public void renderParticle( + Tessellator tessellator, float interp, float x, float y, float z, + float tx, float tz + ) + { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glShadeModel(GL11.GL_SMOOTH); + + textureManager.bindTexture(ResourceManager.casings_tex); + + GL11.glTranslated( + prevPosX + (posX - prevPosX) * interp - interpPosX, + prevPosY + (posY - prevPosY) * interp - interpPosY, + prevPosZ + (posZ - prevPosZ) * interp - interpPosZ); + + GL11.glScalef(dScale, dScale, dScale); + + GL11.glRotatef(180 - rotationYaw, 0, 1, 0); + GL11.glRotatef(-rotationPitch, 1, 0, 0); + + GL11.glScalef(config.getScaleX(), config.getScaleY(), config.getScaleZ()); + + if (config.doesOverrideColor()) + GL11.glColor3b((byte) config.getRedOverride(), (byte) config.getGreenOverride(), (byte) config.getBlueOverride()); + + if (!smokeNodes.isEmpty()) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0F, 1F, 0F); + + for (int i = 0; i < smokeNodes.size() - 1; i++) + { + final Pair node = smokeNodes.get(i), past = smokeNodes.get(i + 1); + final EasyLocation nodeLoc = node.getKey(), pastLoc = past.getKey(); + final float nodeAlpha = node.getValue().floatValue(), pastAlpha = past.getValue().floatValue(), scale = config.getScaleX(); + + tessellator.setColorRGBA_F(1F, 1F, 1F, nodeAlpha); + tessellator.addVertex(nodeLoc.posX(), nodeLoc.posY(), nodeLoc.posZ()); + tessellator.setColorRGBA_F(1F, 1F, 1F, 0F); + tessellator.addVertex(nodeLoc.posX() + scale, nodeLoc.posY(), nodeLoc.posZ()); + tessellator.setColorRGBA_F(1F, 1F, 1F, 0F); + tessellator.addVertex(pastLoc.posX() + scale, pastLoc.posY(), pastLoc.posZ()); + tessellator.setColorRGBA_F(1F, 1F, 1F, pastAlpha); + tessellator.addVertex(pastLoc.posX(), pastLoc.posY(), pastLoc.posZ()); + + tessellator.setColorRGBA_F(1F, 1F, 1F, nodeAlpha); + tessellator.addVertex(nodeLoc.posX(), nodeLoc.posY(), nodeLoc.posZ()); + tessellator.setColorRGBA_F(1F, 1F, 1F, 0F); + tessellator.addVertex(nodeLoc.posX() - scale, nodeLoc.posY(), nodeLoc.posZ()); + tessellator.setColorRGBA_F(1F, 1F, 1F, 0F); + tessellator.addVertex(pastLoc.posX() - scale, pastLoc.posY(), pastLoc.posZ()); + tessellator.setColorRGBA_F(1F, 1F, 1F, pastAlpha); + tessellator.addVertex(pastLoc.posX(), pastLoc.posY(), pastLoc.posZ()); + } + + GL11.glAlphaFunc(GL11.GL_GREATER, 0F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1F); + } + + ResourceManager.casings.renderPart(config.getCasingType().objName); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glPopMatrix(); + } + + private void tryPlayBounceSound() + { + if (!config.getBounceSound().isEmpty()) + worldObj.playSoundAtEntity(this, config.getBounceSound(), 2, 1); +// playSound(config.getBounceSound(), 2, 1); + } + +// private static float[] getOffset(float time) +// { +// final float sinVal1 = (float) ((Math.sin(time * 0.15) + Math.sin(time * 0.25 - 10) + Math.sin(time * 0.1 + 10)) / 3f), +// sinVal2 = (float) ((Math.sin(time * 0.1) + Math.sin(time * 0.05 + 20) + Math.sin(time * 0.13 + 20)) / 3f); +// +// return new float[] {BobMathUtil.remap(BobMathUtil.smoothStep(sinVal1, -1, 1), 0, 1, -2, 1.5F), BobMathUtil.remap(sinVal2, -1, 1, -0.03F, 0.05F)}; +// } +// +// private static float[] getJitter(float time) +// { +// final float sinVal1 = (float) ((Math.sin(time * 0.8) + Math.sin(time * 0.6 - 10) + Math.sin(time * 0.9 + 10)) / 3f), +// sinVal2 = (float) ((Math.sin(time * 0.3) + Math.sin(time * 0.2 + 20) + Math.sin(time * 0.1 + 20)) / 3f); +// +// return new float[] {BobMathUtil.remap(sinVal1, -1, 1, -3, 3), BobMathUtil.remap(sinVal2, -1, 1, -1F, 1F)}; +// } +} diff --git a/src/main/java/com/hbm/particle/SpentCasingConfig.java b/src/main/java/com/hbm/particle/SpentCasingConfig.java new file mode 100644 index 000000000..e6b07db31 --- /dev/null +++ b/src/main/java/com/hbm/particle/SpentCasingConfig.java @@ -0,0 +1,329 @@ +package com.hbm.particle; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Random; + +import org.lwjgl.util.vector.Matrix4f; +import org.lwjgl.util.vector.Vector3f; +import org.lwjgl.util.vector.Vector4f; + +import com.google.common.annotations.Beta; +import com.google.common.collect.ImmutableMap; +import com.hbm.interfaces.ILocationProvider; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +@Beta +public class SpentCasingConfig +{ + private static final Map CONFIG_MAP = new HashMap(); + private static final Random RANDOM = new Random(); + public enum CasingType + { + /**The typical handgun ejected type. Most pistol and some cannon rounds will likely use it.**/ + BRASS_STRAIGHT_WALL("Brass_Straight_Casing"), + /**The typical rife ejected type. Most rifle round and sometimes cannon rounds use it. Only use if the bottleneck shape is noticeable.**/ + BRASS_BOTTLENECK("Brass_Bottleneck_Casing.002"), + /**Shotgun shells.**/ + SHOTGUN("Shotgun_Shell_Cylinder.002"), + /**AR2 pulse rifle plugs.**/ + AR2("AR2_Cylinder.001"); + public final String objName; + private CasingType(String objName) + { + this.objName = objName; + } + } + + /**Unique name used for map lookup.**/ + private final String registryName; + /**Change position of the ejecting shell.**/ + private final ILocationProvider posOffset; + /**Set initial motion after ejecting.**/ + private final Vec3 initialMotion; + /**Multipliers for random pitch and yaw.**/ + private final float pitchFactor, yawFactor; + /**Rescale the sprite to match the approximate scale of the rounds.**/ + private final float scaleX, scaleY, scaleZ; + /**Overrides for the sprite colors.**/ + private final int redOverride, greenOverride, blueOverride; + /**Whether or not to override the default sprite color scheme.**/ + private final boolean overrideColor; + /**The type of casing.**/ + private final CasingType casingType; + /**Amount of casings to spawn per event. Default 1.**/ + private final byte casingAmount; + /**If the casing(s) should be spawned after reloading, instead of after firing.**/ + private final boolean afterReload; + /**Sound effect for bouncing. Make empty string to have no sound.**/ + private final String bounceSound; + /**Delay before casings are actually spawned**/ + private final byte delay; + /**Chance for the casing to emit smoke. 0 for 100% chance and -1 for it to never make smoke.**/ + private final byte smokeChance; + // TODO Setting to disregard crouch effect and/or another offset specifically for crouching which can be set to null to use the default one + public SpentCasingConfig( + String registryName, ILocationProvider posOffset, Vec3 initialMotion, float pitchFactor, float yawFactor, + float scaleX, float scaleY, float scaleZ, int redOverride, int greenOverride, int blueOverride, + boolean overrideColor, CasingType casingType, byte casingAmount, boolean afterReload, String bounceSound, + byte delay, byte smokeChance + ) + { + this.registryName = registryName; + this.posOffset = posOffset; + this.initialMotion = initialMotion; + this.pitchFactor = pitchFactor; + this.yawFactor = yawFactor; + this.scaleX = scaleX; + this.scaleY = scaleY; + this.scaleZ = scaleZ; + this.redOverride = redOverride; + this.greenOverride = greenOverride; + this.blueOverride = blueOverride; + this.overrideColor = overrideColor; + this.casingType = casingType; + this.casingAmount = casingAmount; + this.afterReload = afterReload; + this.bounceSound = bounceSound; + this.delay = delay; + this.smokeChance = smokeChance; + + CONFIG_MAP.put(registryName, this); + } + + public void spawnCasing(TextureManager textureManager, World world, double x, double y, double z, float pitch, float yaw, boolean crouched) + { + final Vec3 rotatedMotionVec = rotateVector(getInitialMotion(), + pitch + (float) RANDOM.nextGaussian() * getPitchFactor(), yaw + (float) RANDOM.nextGaussian() * getPitchFactor(), + getPitchFactor(), getPitchFactor()); + + final ParticleSpentCasing casing = new ParticleSpentCasing(textureManager, world, x, + y, z, rotatedMotionVec.xCoord, rotatedMotionVec.yCoord, rotatedMotionVec.zCoord, +// 0, 0, + (float) (getPitchFactor() * RANDOM.nextGaussian()), (float) (getYawFactor() * RANDOM.nextGaussian()), + this); + + offsetCasing(casing, getPosOffset(), pitch, yaw, crouched); + + casing.rotationPitch = (float) Math.toDegrees(pitch); + casing.rotationYaw = (float) Math.toDegrees(yaw); + + if (overrideColor) + casing.setRBGColorF(redOverride / 255f, blueOverride / 255f, greenOverride / 255f); + Minecraft.getMinecraft().effectRenderer.addEffect(casing); + } + + // Rotate a position + private static void offsetCasing(ParticleSpentCasing casing, ILocationProvider offset, float pitch, float yaw, boolean crouched) + { +// // x-axis offset, 0 if crouched to center +// final double oX = crouched ? 0 : offset.posX(); +// // Trigonometric operations, saved for convenience +// final double sinP = Math.sin(pitch), cosP = Math.cos(pitch), sinY = Math.sin(yaw), cosY = Math.cos(yaw); +// // New offsets +// final double newX = oX * cosY - offset.posZ() * sinY, +// newY = offset.posY() * cosP - sinP * (oX * sinY + offset.posZ() * cosY), +// newZ = offset.posZ() * sinP + cosP * (oX * sinY + offset.posZ() * cosY); +// +// // Apply +// casing.setPosition(casing.posX + newX, casing.posY + newY, casing.posZ + newZ); + + // x-axis offset, 0 if crouched to center + final float oX = (float) (crouched ? 0 : offset.posX()); + // Create rotation matrices for pitch and yaw + final Matrix4f pitchMatrix = new Matrix4f(), yawMatrix = new Matrix4f(); + + pitchMatrix.rotate(pitch, new Vector3f(1, 0, 0)); // modify axis of rotation + yawMatrix.rotate(-yaw, new Vector3f(0, 1, 0)); + + // Multiply matrices to get combined rotation matrix + final Matrix4f rotMatrix = Matrix4f.mul(yawMatrix, pitchMatrix, null); + // Create vector representing the offset and apply rotation + final Vector4f offsetVector = new Vector4f(oX, (float) offset.posY(), (float) offset.posZ(), 1); // set fourth coordinate to 1 + Matrix4f.transform(rotMatrix, offsetVector, offsetVector); + final Vector3f result = new Vector3f(); // create result vector + result.set(offsetVector.x, offsetVector.y, offsetVector.z); // set result vector using transformed coordinates + // Apply rotation + casing.setPosition(casing.posX + result.x, casing.posY + result.y, casing.posZ + result.z); + } + +// Rotate a vector + private static Vec3 rotateVector(Vec3 vector, float pitch, float yaw, float pitchFactor, float yawFactor) + { + // Apply randomness to vector + vector.xCoord += RANDOM.nextGaussian() * yawFactor; + vector.yCoord += RANDOM.nextGaussian() * pitchFactor; + vector.zCoord += RANDOM.nextGaussian() * yawFactor; + + final Matrix4f pitchMatrix = new Matrix4f(), yawMatrix = new Matrix4f(); + + pitchMatrix.setIdentity(); + pitchMatrix.rotate(-pitch, new Vector3f(1, 0, 0)); + + yawMatrix.setIdentity(); + yawMatrix.rotate(-yaw, new Vector3f(0, 1, 0)); + + final Vector4f vector4f = new Vector4f((float) vector.xCoord, (float) vector.yCoord, (float) vector.zCoord, 1); + + Matrix4f.transform(pitchMatrix, vector4f, vector4f); + Matrix4f.transform(yawMatrix, vector4f, vector4f); + + return Vec3.createVectorHelper(vector4f.x, vector4f.y, vector4f.z); + } + + public ILocationProvider getPosOffset() + { + return posOffset; + } + public Vec3 getInitialMotion() + { + return Vec3.createVectorHelper(initialMotion.xCoord, initialMotion.yCoord, initialMotion.zCoord); + } + public float getScaleX() + { + return scaleX; + } + public float getScaleY() + { + return scaleY; + } + public float getScaleZ() + { + return scaleZ; + } + public float getPitchFactor() + { + return pitchFactor; + } + public float getYawFactor() + { + return yawFactor; + } + public int getRedOverride() + { + return redOverride; + } + public int getGreenOverride() + { + return greenOverride; + } + public int getBlueOverride() + { + return blueOverride; + } + public boolean doesOverrideColor() + { + return overrideColor; + } + public CasingType getCasingType() + { + return casingType; + } + public byte getCasingAmount() + { + return casingAmount; + } + public boolean isAfterReload() + { + return afterReload; + } + public String getRegistryName() + { + return registryName; + } + public String getBounceSound() + { + return bounceSound; + } + public byte getDelay() + { + return delay; + } + public byte getSmokeChance() + { + return smokeChance; + } + + /** + * Convert to a new builder for modification. + * @param newName The new registry name. + * @return A new builder with all the settings inherited from this config, except for registry name. + */ + public SpentCasingConfigBuilder toBuilder(String newName) + { + final SpentCasingConfigBuilder builder = new SpentCasingConfigBuilder(newName, casingType, overrideColor); + builder.setAfterReload(afterReload).setBlueOverride(blueOverride).setBounceSound(bounceSound).setCasingAmount(casingAmount) + .setDelay(delay).setGreenOverride(greenOverride).setInitialMotion(getInitialMotion()).setPitchFactor(pitchFactor) + .setPosOffset(getPosOffset()).setRedOverride(redOverride).setScaleX(scaleX).setScaleY(scaleY).setScaleZ(scaleZ) + .setSmokeChance(smokeChance).setYawFactor(yawFactor); + return builder; + } + + @Override + public int hashCode() + { + return Objects.hash(afterReload, blueOverride, bounceSound, casingAmount, casingType, delay, greenOverride, + initialMotion.xCoord, initialMotion.yCoord, initialMotion.zCoord, overrideColor, pitchFactor, + posOffset, redOverride, registryName, scaleX, scaleY, scaleZ, smokeChance, yawFactor); + } + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (!(obj instanceof SpentCasingConfig)) + return false; + final SpentCasingConfig other = (SpentCasingConfig) obj; + return afterReload == other.afterReload && blueOverride == other.blueOverride + && Objects.equals(bounceSound, other.bounceSound) && casingAmount == other.casingAmount + && casingType == other.casingType && delay == other.delay && greenOverride == other.greenOverride + && Double.doubleToLongBits(initialMotion.xCoord) == Double.doubleToLongBits(other.initialMotion.xCoord) + && Double.doubleToLongBits(initialMotion.yCoord) == Double.doubleToLongBits(other.initialMotion.yCoord) + && Double.doubleToLongBits(initialMotion.zCoord) == Double.doubleToLongBits(other.initialMotion.zCoord) + && overrideColor == other.overrideColor + && Float.floatToIntBits(pitchFactor) == Float.floatToIntBits(other.pitchFactor) + && Objects.equals(posOffset, other.posOffset) && redOverride == other.redOverride + && Objects.equals(registryName, other.registryName) + && Float.floatToIntBits(scaleX) == Float.floatToIntBits(other.scaleX) + && Float.floatToIntBits(scaleY) == Float.floatToIntBits(other.scaleY) + && Float.floatToIntBits(scaleZ) == Float.floatToIntBits(other.scaleZ) + && smokeChance == other.smokeChance + && Float.floatToIntBits(yawFactor) == Float.floatToIntBits(other.yawFactor); + } + @Override + public String toString() + { + final StringBuilder builder = new StringBuilder(); + builder.append("SpentCasingConfig [registryName=").append(registryName).append(", posOffset=").append(posOffset) + .append(", initialMotion=").append(initialMotion).append(", pitchFactor=").append(pitchFactor) + .append(", yawFactor=").append(yawFactor).append(", scaleX=").append(scaleX).append(", scaleY=") + .append(scaleY).append(", scaleZ=").append(scaleZ).append(", redOverride=").append(redOverride) + .append(", greenOverride=").append(greenOverride).append(", blueOverride=").append(blueOverride) + .append(", overrideColor=").append(overrideColor).append(", casingType=").append(casingType) + .append(", casingAmount=").append(casingAmount).append(", afterReload=").append(afterReload) + .append(", bounceSound=").append(bounceSound).append(", delay=").append(delay).append(", smokeChance=") + .append(smokeChance).append("]"); + return builder.toString(); + } + + public static boolean containsKey(String key) + { + return CONFIG_MAP.containsKey(key); + } + + public static SpentCasingConfig get(String key) + { + return CONFIG_MAP.get(key); + } + + public static Map getConfigMap() + { + return ImmutableMap.copyOf(CONFIG_MAP); + } + +} diff --git a/src/main/java/com/hbm/particle/SpentCasingConfigBuilder.java b/src/main/java/com/hbm/particle/SpentCasingConfigBuilder.java new file mode 100644 index 000000000..9dc24c102 --- /dev/null +++ b/src/main/java/com/hbm/particle/SpentCasingConfigBuilder.java @@ -0,0 +1,423 @@ +package com.hbm.particle; + +import java.util.Objects; + +import com.google.common.annotations.Beta; +import com.hbm.calc.EasyLocation; +import com.hbm.interfaces.ILocationProvider; +import com.hbm.main.MainRegistry; +import com.hbm.particle.SpentCasingConfig.CasingType; + +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +@Beta +public class SpentCasingConfigBuilder implements Cloneable +{ + /**Unique name used for map lookup.**/ + private String registryName; + /**Change position of the ejecting shell.**/ + private ILocationProvider posOffset = EasyLocation.getZeroLocation(); + /**Set initial motion after ejecting.**/ + private Vec3 initialMotion = Vec3.createVectorHelper(0, 0, 0); + /**Multipliers for random pitch and yaw.**/ + private float pitchFactor, yawFactor; + /**Rescale the sprite to match the approximate scale of the rounds.**/ + private float scaleX = 1, scaleY = 1, scaleZ = 1; + /**Overrides for the sprite colors.**/ + private int redOverride, greenOverride, blueOverride; + /**Whether or not to override the default sprite color scheme.**/ + private boolean overrideColor; + /**The type of casing.**/ + private CasingType casingType = CasingType.BRASS_STRAIGHT_WALL; + /**Amount of casings to spawn per event. Default 1.**/ + private byte casingAmount = 1; + /**If the casing(s) should be spawned after reloading, instead of after firing.**/ + private boolean afterReload; + /**Sound effect for bouncing. Make empty string to have no sound.**/ + private String bounceSound = ""; + /**Delay before casings are actually spawned**/ + private byte delay; + /**Chance for the casing to emit smoke. 0 for 100% chance and -1 for it to never make smoke.**/ + private byte smokeChance = -1; + // TODO Setting to disregard crouch effect and/or another offset specifically for crouching which can be set to null to use the default one + /** + * Constructor with fields for the required bare minimum parameters.
+ * All parameters may overridden using setters at any time at your discretion, however. + * @param registryName The unique name for map lookup. Null not permitted, becomes empty string. + * @param casingType Type of casing model to use. Null not permitted, defaults to straight wall type. + * @param overrideColor Whether or not the config will override the model texture's color. + */ + public SpentCasingConfigBuilder(String registryName, CasingType casingType, boolean overrideColor) + { + this.registryName = registryName == null ? "" : registryName; + this.casingType = casingType == null ? CasingType.BRASS_STRAIGHT_WALL : casingType; + this.overrideColor = overrideColor; + } + + public ILocationProvider getPosOffset() + { + return posOffset; + } + + /** + * Set the relative x, y, z coordinate offset on spawn. + * @param posOffset Any ILocationProvider that serves as the offset. Null becomes a zero location. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setPosOffset(ILocationProvider posOffset) + { + this.posOffset = posOffset == null ? EasyLocation.getZeroLocation() : posOffset; + return this; + } + + public Vec3 getInitialMotion() + { + return initialMotion; + } + + /** + * Sets the casing's initial relative x, y, z motion on spawn. + * @param initialMotion Vector representing the initial motion. Null becomes a zero vector. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setInitialMotion(Vec3 initialMotion) + { + this.initialMotion = initialMotion == null ? Vec3.createVectorHelper(0, 0, 0) : initialMotion; + return this; + } + + public double getScaleX() + { + return scaleX; + } + + /** + * Scale of the model on its x-axis. + * @param scaleX The scale/stretch factor of the model on the x-axis. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setScaleX(float scaleX) + { + this.scaleX = scaleX; + return this; + } + + public double getScaleY() + { + return scaleY; + } + + /** + * Scale of the model on its y-axis. + * @param scaleY The scale/stretch factor of the model on the y-axis. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setScaleY(float scaleY) + { + this.scaleY = scaleY; + return this; + } + + public float getScaleZ() + { + return scaleZ; + } + + /** + * Scale of the model on its z-axis. + * @param scaleZ The scale/stretch of the model on the z-axis. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setScaleZ(float scaleZ) + { + this.scaleZ = scaleZ; + return this; + } + + public float getPitchFactor() + { + return pitchFactor; + } + + /** + * Multiplier for random pitch-related motion. Recommended to keep in the thousanths (0.00X), as even with the hundreths (0.0X) the pitch can get crazy at times. + * @param pitchFactor The multiplier. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setPitchFactor(float pitchFactor) + { + this.pitchFactor = pitchFactor; + return this; + } + + public float getYawFactor() + { + return yawFactor; + } + + /** + * Multiplier for random yaw-related motion. Recommended to keep in the thousanths (0.00X), as even with the hundreths (0.0X) the yaw can get crazy at times. + * @param yawFactor The multiplier. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setYawFactor(float yawFactor) + { + this.yawFactor = yawFactor; + return this; + } + + public int getRedOverride() + { + return redOverride; + } + + /** + * Red color override. Clamped between 0-255, but I don't know how it actually works on the receiving end, so feel free to change. + * @param redOverride Red color override. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setRedOverride(int redOverride) + { + this.redOverride = MathHelper.clamp_int(redOverride, 0, 255); + return this; + } + + public int getGreenOverride() + { + return greenOverride; + } + + /** + * Green color override. Clamped between 0-255, but I don't know how it actually works on the receiving end, so feel free to change. + * @param greenOverride Green color override. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setGreenOverride(int greenOverride) + { + this.greenOverride = MathHelper.clamp_int(greenOverride, 0, 255); + return this; + } + + public int getBlueOverride() + { + return blueOverride; + } + + /** + * Blue color override. Clamped between 0-255, but I don't know how it actually works on the receiving end, so feel free to change. + * @param blueOverride Blue color override. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setBlueOverride(int blueOverride) + { + this.blueOverride = MathHelper.clamp_int(blueOverride, 0, 255); + return this; + } + + public boolean doesOverrideColor() + { + return overrideColor; + } + + /** + * Sets whether or not the config will override color. If false, the integer overrides will be ignored. + * @param overrideColor True, to use the integer color overrides, false to ignore them. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setOverrideColor(boolean overrideColor) + { + this.overrideColor = overrideColor; + return this; + } + + public CasingType getCasingType() + { + return casingType; + } + + /** + * Sets the model the casing will use. + * @param casingType One of the 4 casing model types. Null is not permitted, will have no effect. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setCasingType(CasingType casingType) + { + this.casingType = casingType == null ? this.casingType : casingType; + return this; + } + + public byte getCasingAmount() + { + return casingAmount; + } + + /** + * Sets the amount of casings to spawn. Default is 1. + * @param casingAmount Amount of casings to spawn. Clamped to a positive byte (0 - 127). + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setCasingAmount(int casingAmount) + { + this.casingAmount = (byte) MathHelper.clamp_int(casingAmount, 0, 127); + return this; + } + + public boolean isAfterReload() + { + return afterReload; + } + + /** + * Sets whether or not the casing will be spawned after reloading is done or after firing. + * @param afterReload If true, casings will be spawned when reloading, false, they will be spawned after firing. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setAfterReload(boolean afterReload) + { + this.afterReload = afterReload; + return this; + } + + public String getRegistryName() + { + return registryName; + } + + /** + * Resets the unique name for the config used in map lookup.
+ * As the real class is self-registering, make sure to set this in reused builders. + * @param registryName The registry name to use. Null is not permitted, becomes an empty string. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setRegistryName(String registryName) + { + this.registryName = registryName == null ? "" : registryName; + return this; + } + + public String getBounceSound() + { + return bounceSound; + } + + /** + * The sound used when bouncing. If empty, no sound will be made. + * @param bounceSound The sound path. Null is not permitted, becomes an empty string. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setBounceSound(String bounceSound) + { + this.bounceSound = bounceSound == null ? "" : bounceSound; + return this; + } + + public byte getDelay() + { + return delay; + } + + /** + * The delay in ticks before spawning. + * @param delay Tick spawn delay. Must be nonnegative, otherwise 0. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setDelay(int delay) + { + this.delay = (byte) (delay < 0 ? 0 : delay); + return this; + } + + public byte getSmokeChance() + { + return smokeChance; + } + + /** + * Chance for the casing to emit smoke. 0 for 100% chance and -1 for it to never make smoke. + * @param smokeChance Chance to emit smoke. Clamped to a byte. + * @return Itself for chaining. + */ + public SpentCasingConfigBuilder setSmokeChance(int smokeChance) + { + this.smokeChance = (byte) smokeChance; + return this; + } + + /** + * Constructs the true immutable config with all settings loaded from this builder.
+ * This builder may be reused as all non-immutable and primitive fields are copied before being passed to the constructor.
+ * The config's constructor is self-registering. + * @return The finished config with its settings specified by this builder. + */ + public SpentCasingConfig build() + { + return new SpentCasingConfig(registryName, new EasyLocation(posOffset), + Vec3.createVectorHelper(initialMotion.xCoord, initialMotion.yCoord, initialMotion.zCoord), pitchFactor, + yawFactor, scaleX, scaleY, scaleZ, redOverride, greenOverride, blueOverride, overrideColor, casingType, + casingAmount, afterReload, bounceSound, delay, smokeChance); + } + + @Override + public int hashCode() + { + return Objects.hash(afterReload, blueOverride, bounceSound, casingAmount, casingType, delay, greenOverride, + initialMotion.xCoord, initialMotion.yCoord, initialMotion.zCoord, overrideColor, pitchFactor, + posOffset, redOverride, registryName, scaleX, scaleY, scaleZ, smokeChance, yawFactor); + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (!(obj instanceof SpentCasingConfigBuilder)) + return false; + final SpentCasingConfigBuilder other = (SpentCasingConfigBuilder) obj; + return afterReload == other.afterReload && blueOverride == other.blueOverride + && Objects.equals(bounceSound, other.bounceSound) && casingAmount == other.casingAmount + && casingType == other.casingType && delay == other.delay && greenOverride == other.greenOverride + && Double.doubleToLongBits(initialMotion.xCoord) == Double.doubleToLongBits(other.initialMotion.xCoord) + && Double.doubleToLongBits(initialMotion.yCoord) == Double.doubleToLongBits(other.initialMotion.yCoord) + && Double.doubleToLongBits(initialMotion.zCoord) == Double.doubleToLongBits(other.initialMotion.zCoord) + && overrideColor == other.overrideColor + && Float.floatToIntBits(pitchFactor) == Float.floatToIntBits(other.pitchFactor) + && Objects.equals(posOffset, other.posOffset) && redOverride == other.redOverride + && Objects.equals(registryName, other.registryName) + && Float.floatToIntBits(scaleX) == Float.floatToIntBits(other.scaleX) + && Float.floatToIntBits(scaleY) == Float.floatToIntBits(other.scaleY) + && Float.floatToIntBits(scaleZ) == Float.floatToIntBits(other.scaleZ) + && smokeChance == other.smokeChance + && Float.floatToIntBits(yawFactor) == Float.floatToIntBits(other.yawFactor); + } + + @Override + public String toString() + { + final StringBuilder builder = new StringBuilder(); + builder.append("SpentCasingConfigBuilder [registryName=").append(registryName).append(", posOffset=") + .append(posOffset).append(", initialMotion=").append(initialMotion).append(", pitchFactor=") + .append(pitchFactor).append(", yawFactor=").append(yawFactor).append(", scaleX=").append(scaleX) + .append(", scaleY=").append(scaleY).append(", scaleZ=").append(scaleZ).append(", redOverride=") + .append(redOverride).append(", greenOverride=").append(greenOverride).append(", blueOverride=") + .append(blueOverride).append(", overrideColor=").append(overrideColor).append(", casingType=") + .append(casingType).append(", casingAmount=").append(casingAmount).append(", afterReload=") + .append(afterReload).append(", bounceSound=").append(bounceSound).append(", delay=").append(delay) + .append(", smokeChance=").append(smokeChance).append(']'); + return builder.toString(); + } + + @Override + public SpentCasingConfigBuilder clone() + { + try + { + return (SpentCasingConfigBuilder) super.clone(); + } catch (CloneNotSupportedException e) + { + MainRegistry.logger.catching(e); + return new SpentCasingConfigBuilder(registryName, casingType, overrideColor); + } + } + +} diff --git a/src/main/java/com/hbm/render/entity/effect/RenderCasingTest.java b/src/main/java/com/hbm/render/entity/effect/RenderCasingTest.java new file mode 100644 index 000000000..381d1834a --- /dev/null +++ b/src/main/java/com/hbm/render/entity/effect/RenderCasingTest.java @@ -0,0 +1,56 @@ +package com.hbm.render.entity.effect; + +import org.lwjgl.opengl.GL11; + +import com.hbm.main.ResourceManager; +import com.hbm.particle.SpentCasingConfig.CasingType; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.IItemRenderer; + +public class RenderCasingTest implements IItemRenderer +{ + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return false; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + final EntityPlayer player = Minecraft.getMinecraft().thePlayer; + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glShadeModel(GL11.GL_SMOOTH); + + Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.casings_tex); + +// GL11.glTranslated( +// player.prevPosX + (player.posX - player.prevPosX), +// player.prevPosY + (player.posY - player.prevPosY), +// player.prevPosZ + (player.posZ - player.prevPosZ)); + +// GL11.glRotatef(player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw), +// 0.0F, 1.0F, 0.0F); +// GL11.glRotatef(player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch), +// 0.0F, 0.0F, 1.0F); + + GL11.glRotatef(180 - player.rotationYaw, 0, 1, 0); + GL11.glRotatef(-player.rotationPitch, 1, 0, 0); + + ResourceManager.casings.renderPart(CasingType.BRASS_BOTTLENECK.objName); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glPopMatrix(); + } + +} diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderBenelli.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderBenelli.java index 90ba0e4b4..06a0986d9 100644 --- a/src/main/java/com/hbm/render/item/weapon/ItemRenderBenelli.java +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderBenelli.java @@ -39,7 +39,7 @@ public class ItemRenderBenelli implements IItemRenderer static final String frontGrip = "Pump_Cylinder.003"; static final String slide = "Cylinder"; static final String barrelAndTube = "Body_Cube.002"; - static final String shell = "Shell_Cylinder.002"; +// static final String shell = "Shell_Cylinder.002"; @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { @@ -55,7 +55,7 @@ public class ItemRenderBenelli implements IItemRenderer final double scale3 = 0.52D; double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL"); - double[] eject = HbmAnimations.getRelevantTransformation("EJECT"); +// double[] eject = HbmAnimations.getRelevantTransformation("EJECT"); // double[] reload = HbmAnimations.getRelevantTransformation("RELOAD"); double[] feedNew = HbmAnimations.getRelevantTransformation("PUMP"); switch (type) @@ -82,7 +82,7 @@ public class ItemRenderBenelli implements IItemRenderer // GL11.glTranslated(reload[2] / 2, 0, 0); // GL11.glRotated(reload[0], 1, 0, 0); // GL11.glRotated(reload[1], 0, 0, 1); - ResourceManager.benelli.renderAllExcept(shell, slide); + ResourceManager.benelli.renderAll(); // Pump new round if empty if (magSize == 0) GL11.glTranslated(feedNew[0], feedNew[1], feedNew[2]); @@ -90,8 +90,8 @@ public class ItemRenderBenelli implements IItemRenderer GL11.glPopMatrix(); // Eject spent shell GL11.glPushMatrix(); - GL11.glTranslated(eject[0], eject[1], eject[2]); - ResourceManager.benelli.renderPart(shell); +// GL11.glTranslated(eject[0], eject[1], eject[2]); +// ResourceManager.benelli.renderPart(shell); GL11.glPopMatrix(); break; case EQUIPPED:// In hand from other's POV @@ -104,8 +104,8 @@ public class ItemRenderBenelli implements IItemRenderer GL11.glScaled(scale2 - scale2 * 2, scale2, scale2); GL11.glPushMatrix(); - GL11.glTranslated(eject[0], eject[1], eject[2]); - ResourceManager.benelli.renderPart(shell); +// GL11.glTranslated(eject[0], eject[1], eject[2]); +// ResourceManager.benelli.renderPart(shell); GL11.glPopMatrix(); break; case ENTITY:// Dropped entity diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderLunaticSniper.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderLunaticSniper.java index 097bb0cd0..1c788e292 100644 --- a/src/main/java/com/hbm/render/item/weapon/ItemRenderLunaticSniper.java +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderLunaticSniper.java @@ -49,7 +49,7 @@ public class ItemRenderLunaticSniper implements IItemRenderer { GL11.glPushMatrix(); double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL"); - double[] eject = HbmAnimations.getRelevantTransformation("EJECT"); +// double[] eject = HbmAnimations.getRelevantTransformation("EJECT"); double[] tilt = HbmAnimations.getRelevantTransformation("TILT"); // double[] insert = HbmAnimations.getRelevantTransformation("INSERT_ROUND"); Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.lunatic_sniper_tex); @@ -93,7 +93,7 @@ public class ItemRenderLunaticSniper implements IItemRenderer // Eject casing GL11.glPushMatrix(); GL11.glTranslated(0, 2, 0);//FIXME Where on earth is it?! - ResourceManager.lunatic_sniper.renderPart(spentShell); +// ResourceManager.lunatic_sniper.renderPart(spentShell); GL11.glPopMatrix(); break; case EQUIPPED:// In hand from other's POV @@ -103,8 +103,8 @@ public class ItemRenderLunaticSniper implements IItemRenderer GL11.glTranslatef(0F, -0.25F, -0.76F); GL11.glScalef(scale2 - scale2 * 2, scale2, scale2); GL11.glPushMatrix(); - GL11.glTranslated(eject[0] / 2, 0, -5); - ResourceManager.lunatic_sniper.renderPart(spentShell); +// GL11.glTranslated(eject[0] / 2, 0, -5); +// ResourceManager.lunatic_sniper.renderPart(spentShell); GL11.glPopMatrix(); break; case ENTITY:// Dropped item diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretArty.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretArty.java index cfc551c83..1d6dae6b5 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretArty.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretArty.java @@ -5,6 +5,7 @@ import java.util.List; import com.hbm.blocks.BlockDummyable; import com.hbm.entity.projectile.EntityArtilleryShell; +import com.hbm.handler.guncfg.GunCannonFactory; import com.hbm.inventory.container.ContainerTurretBase; import com.hbm.inventory.gui.GUITurretArty; import com.hbm.items.ModItems; @@ -12,6 +13,7 @@ import com.hbm.lib.Library; import com.hbm.main.MainRegistry; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import com.hbm.tileentity.IGUIProvider; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; @@ -45,7 +47,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen if(ammoStacks != null) return ammoStacks; - ammoStacks = new ArrayList(); + ammoStacks = new ArrayList<>(); List list = new ArrayList(); ModItems.ammo_arty.getSubItems(ModItems.ammo_arty, MainRegistry.weaponTab, list); @@ -56,7 +58,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen @Override protected List getAmmoList() { - return new ArrayList(); + return new ArrayList<>(); } @Override @@ -86,12 +88,12 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen @Override public double getDecetorRange() { - return this.mode == this.MODE_CANNON ? 250D : 3000D; + return this.mode == MODE_CANNON ? 250D : 3000D; } @Override public double getDecetorGrace() { - return this.mode == this.MODE_CANNON ? 32D : 250D; + return this.mode == MODE_CANNON ? 32D : 250D; } @Override @@ -121,7 +123,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen @Override public boolean doLOSCheck() { - return this.mode == this.MODE_CANNON; + return this.mode == MODE_CANNON; } @Override @@ -198,12 +200,15 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen proj.setTarget((int) tPos.xCoord, (int) tPos.yCoord, (int) tPos.zCoord); proj.setType(type); - if(this.mode != this.MODE_CANNON) + if(this.mode != MODE_CANNON) proj.setWhistle(true); worldObj.spawnEntityInWorld(proj); + + spawnCasing(); } + @Override protected void updateConnections() { ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset).getOpposite(); ForgeDirection rot = dir.getRotation(ForgeDirection.UP); @@ -239,7 +244,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen } } - if(this.mode == this.MODE_MANUAL) { + if(this.mode == MODE_MANUAL) { if(!this.targetQueue.isEmpty()) { this.tPos = this.targetQueue.get(0); } @@ -264,7 +269,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen } } - if(target != null && this.mode != this.MODE_MANUAL) { + if(target != null && this.mode != MODE_MANUAL) { if(!this.entityInLOS(this.target)) { this.target = null; } @@ -275,7 +280,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen if(target != null) { this.tPos = this.getEntityPos(target); } else { - if(this.mode != this.MODE_MANUAL) { + if(this.mode != MODE_MANUAL) { this.tPos = null; } } @@ -307,7 +312,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen if(searchTimer <= 0) { searchTimer = this.getDecetorInterval(); - if(this.target == null && this.mode != this.MODE_MANUAL) + if(this.target == null && this.mode != MODE_MANUAL) this.seekNewTarget(); } } else { @@ -371,9 +376,10 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen 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, 150)); + } - if(this.mode == this.MODE_MANUAL && !this.targetQueue.isEmpty()) { + if(this.mode == MODE_MANUAL && !this.targetQueue.isEmpty()) { this.targetQueue.remove(0); this.tPos = null; } @@ -436,4 +442,16 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUITurretArty(player.inventory, this); } + + @Override + public boolean usesCasings() + { + return true; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return GunCannonFactory.CASING_16IN; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseArtillery.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseArtillery.java index 35d211872..9b2eeaefb 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseArtillery.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseArtillery.java @@ -8,7 +8,7 @@ import net.minecraft.util.Vec3; public abstract class TileEntityTurretBaseArtillery extends TileEntityTurretBaseNT { - protected List targetQueue = new ArrayList(); + protected List targetQueue = new ArrayList<>(); public void enqueueTarget(double x, double y, double z) { diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java index bff77dba0..6545cbce1 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java @@ -17,6 +17,8 @@ import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemTurretBiometry; import com.hbm.lib.Library; +import com.hbm.main.MainRegistry; +import com.hbm.particle.SpentCasingConfig; import com.hbm.tileentity.TileEntityMachineBase; import api.hbm.energy.IEnergyUser; @@ -90,6 +92,8 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple //tally marks! public int stattrak; + // Not saved because client side only + public byte casingDelay; /** * X @@ -226,6 +230,14 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple else this.lastRotationYaw -= Math.PI * 2; } + + if (usesCasings() && getCasingConfig().getDelay() > 0) + { + if (casingDelay > 0) + casingDelay--; + else + spawnCasing(); + } } } @@ -297,6 +309,8 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple } public abstract void updateFiringTick(); + public abstract boolean usesCasings(); + public abstract SpentCasingConfig getCasingConfig(); public BulletConfiguration getFirstConfigLoaded() { @@ -338,6 +352,14 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple proj.setThrowableHeading(vec.xCoord, vec.yCoord, vec.zCoord, bullet.velocity, bullet.spread); worldObj.spawnEntityInWorld(proj); + + if (usesCasings()) + { + if (getCasingConfig().getDelay() == 0) + spawnCasing(); + else + casingDelay = getCasingConfig().getDelay(); + } } public void conusmeAmmo(ComparableStack ammo) { @@ -821,4 +843,18 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple public void closeInventory() { this.worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:block.closeC", 1.0F, 1.0F); } + + protected void spawnCasing() + { + final NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "casing"); + data.setDouble("posX", xCoord); + data.setDouble("posY", yCoord + 1); + data.setDouble("posZ", zCoord); + data.setFloat("pitch", (float) rotationPitch); + data.setFloat("yaw", (float) rotationYaw); + data.setBoolean("crouched", false); + data.setString("name", getCasingConfig().getRegistryName()); + MainRegistry.proxy.effectNT(data); + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBrandon.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBrandon.java index d0598c8d5..4857d820a 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBrandon.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBrandon.java @@ -2,6 +2,8 @@ package com.hbm.tileentity.turret; import java.util.List; +import com.hbm.particle.SpentCasingConfig; + public class TileEntityTurretBrandon extends TileEntityTurretBaseNT { @Override @@ -28,4 +30,16 @@ public class TileEntityTurretBrandon extends TileEntityTurretBaseNT { return null; } + @Override + public boolean usesCasings() + { + return false; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return null; + } + } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretChekhov.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretChekhov.java index 80f5da180..05e23d4cf 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretChekhov.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretChekhov.java @@ -3,10 +3,12 @@ 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.handler.guncfg.Gun50BMGFactory; +import com.hbm.lib.HbmCollection; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.nbt.NBTTagCompound; @@ -14,21 +16,22 @@ import net.minecraft.util.Vec3; public class TileEntityTurretChekhov extends TileEntityTurretBaseNT { - static List configs = new ArrayList(); + static List configs = new ArrayList<>(); //because cramming it into the ArrayList's constructor with nested curly brackets and all that turned out to be not as pretty //also having a floaty `static` like this looks fun //idk if it's just me though static { - configs.add(BulletConfigSyncingUtil.BMG50_NORMAL); - configs.add(BulletConfigSyncingUtil.BMG50_INCENDIARY); - configs.add(BulletConfigSyncingUtil.BMG50_EXPLOSIVE); - configs.add(BulletConfigSyncingUtil.BMG50_AP); - configs.add(BulletConfigSyncingUtil.BMG50_DU); - configs.add(BulletConfigSyncingUtil.BMG50_STAR); - configs.add(BulletConfigSyncingUtil.BMG50_PHOSPHORUS); - configs.add(BulletConfigSyncingUtil.BMG50_SLEEK); - configs.add(BulletConfigSyncingUtil.CHL_BMG50); +// configs.add(BulletConfigSyncingUtil.BMG50_NORMAL); +// configs.add(BulletConfigSyncingUtil.BMG50_INCENDIARY); +// configs.add(BulletConfigSyncingUtil.BMG50_EXPLOSIVE); +// configs.add(BulletConfigSyncingUtil.BMG50_AP); +// configs.add(BulletConfigSyncingUtil.BMG50_DU); +// configs.add(BulletConfigSyncingUtil.BMG50_STAR); +// configs.add(BulletConfigSyncingUtil.BMG50_PHOSPHORUS); +// configs.add(BulletConfigSyncingUtil.BMG50_SLEEK); +// configs.add(BulletConfigSyncingUtil.CHL_BMG50); + configs.addAll(HbmCollection.fiftyBMG); } @Override @@ -142,4 +145,16 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT { manual = true; } + + @Override + public boolean usesCasings() + { + return true; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return Gun50BMGFactory.CONFIG_50BMG; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFriendly.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFriendly.java index cadfc4c94..081cb1383 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFriendly.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFriendly.java @@ -4,10 +4,12 @@ import java.util.ArrayList; import java.util.List; import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.guncfg.Gun5mmFactory; +import com.hbm.particle.SpentCasingConfig; public class TileEntityTurretFriendly extends TileEntityTurretChekhov { - static List configs = new ArrayList(); + static List configs = new ArrayList<>(); static { configs.add(BulletConfigSyncingUtil.R5_NORMAL); @@ -31,4 +33,10 @@ public class TileEntityTurretFriendly extends TileEntityTurretChekhov { public int getDelay() { return 5; } + + @Override + public SpentCasingConfig getCasingConfig() + { + return Gun5mmFactory.CASING_5MM_TURRET; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFritz.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFritz.java index f571c4c03..cd41c778d 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFritz.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretFritz.java @@ -13,6 +13,7 @@ import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.items.ModItems; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import api.hbm.fluid.IFluidStandardReceiver; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; @@ -212,4 +213,16 @@ public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFl public FluidTank[] getAllTanks() { return new FluidTank[] { tank }; } + + @Override + public boolean usesCasings() + { + return false; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretHIMARS.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretHIMARS.java index 1bb2d49c9..9e052854d 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretHIMARS.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretHIMARS.java @@ -8,6 +8,7 @@ import com.hbm.inventory.gui.GUITurretHIMARS; import com.hbm.items.ModItems; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; +import com.hbm.particle.SpentCasingConfig; import com.hbm.tileentity.IGUIProvider; import cpw.mods.fml.relauncher.Side; @@ -257,4 +258,16 @@ public class TileEntityTurretHIMARS extends TileEntityTurretBaseArtillery implem public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUITurretHIMARS(player.inventory, this); } + + @Override + public boolean usesCasings() + { + return false; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretHoward.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretHoward.java index 94df68742..d9ab5ab64 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretHoward.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretHoward.java @@ -6,9 +6,11 @@ import java.util.List; import com.hbm.config.WeaponConfig; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; +import com.hbm.handler.guncfg.GunDGKFactory; import com.hbm.lib.ModDamageSource; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import com.hbm.util.EntityDamageUtil; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; @@ -17,7 +19,7 @@ import net.minecraft.util.Vec3; public class TileEntityTurretHoward extends TileEntityTurretBaseNT { - static List configs = new ArrayList(); + static List configs = new ArrayList<>(); static { configs.add(BulletConfigSyncingUtil.DGK_NORMAL); @@ -159,6 +161,8 @@ public class TileEntityTurretHoward extends TileEntityTurretBaseNT { data.setByte("count", (byte)1); PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord + vec.xCoord + hOff.xCoord, pos.yCoord + vec.yCoord + hOff.yCoord, pos.zCoord + vec.zCoord + hOff.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); } + + spawnCasing(); } } } @@ -174,4 +178,16 @@ public class TileEntityTurretHoward extends TileEntityTurretBaseNT { super.writeToNBT(nbt); nbt.setInteger("loaded", loaded); } + + @Override + public boolean usesCasings() + { + return true; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return GunDGKFactory.CASING_DGK; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretJeremy.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretJeremy.java index 5e022996d..930e1be42 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretJeremy.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretJeremy.java @@ -4,9 +4,11 @@ import java.util.ArrayList; import java.util.List; import com.hbm.handler.BulletConfiguration; +import com.hbm.handler.guncfg.GunCannonFactory; import com.hbm.lib.HbmCollection; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.nbt.NBTTagCompound; @@ -98,4 +100,16 @@ public class TileEntityTurretJeremy extends TileEntityTurretBaseNT { } } } + + @Override + public boolean usesCasings() + { + return true; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return GunCannonFactory.CASING_240; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretMaxwell.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretMaxwell.java index 413a166ad..8a9175b0a 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretMaxwell.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretMaxwell.java @@ -7,6 +7,7 @@ import com.hbm.items.ModItems; import com.hbm.lib.ModDamageSource; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import com.hbm.potion.HbmPotion; import com.hbm.util.EntityDamageUtil; @@ -39,7 +40,7 @@ public class TileEntityTurretMaxwell extends TileEntityTurretBaseNT { if(ammoStacks != null) return ammoStacks; - ammoStacks = new ArrayList(); + ammoStacks = new ArrayList<>(); ammoStacks.add(new ItemStack(ModItems.upgrade_speed_1)); ammoStacks.add(new ItemStack(ModItems.upgrade_speed_2)); @@ -232,4 +233,16 @@ public class TileEntityTurretMaxwell extends TileEntityTurretBaseNT { else super.networkUnpack(nbt); } + + @Override + public boolean usesCasings() + { + return false; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretRichard.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretRichard.java index 2750202d5..8cae81356 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretRichard.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretRichard.java @@ -7,6 +7,7 @@ import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.items.ItemAmmoEnums.AmmoRocket; +import com.hbm.particle.SpentCasingConfig; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; @@ -163,4 +164,16 @@ public class TileEntityTurretRichard extends TileEntityTurretBaseNT { super.writeToNBT(nbt); nbt.setInteger("loaded", this.loaded); } + + @Override + public boolean usesCasings() + { + return false; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java index d3d8d7f27..798f79653 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java @@ -8,6 +8,7 @@ import com.hbm.handler.BulletConfiguration; import com.hbm.lib.ModDamageSource; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.nbt.NBTTagCompound; @@ -15,7 +16,7 @@ import net.minecraft.util.Vec3; public class TileEntityTurretTauon extends TileEntityTurretBaseNT { - static List configs = new ArrayList(); + static List configs = new ArrayList<>(); static { configs.add(BulletConfigSyncingUtil.SPECIAL_GAUSS); @@ -149,4 +150,16 @@ public class TileEntityTurretTauon extends TileEntityTurretBaseNT { else super.networkUnpack(nbt); } + + @Override + public boolean usesCasings() + { + return false; + } + + @Override + public SpentCasingConfig getCasingConfig() + { + return null; + } } diff --git a/src/main/java/com/hbm/util/BobMathUtil.java b/src/main/java/com/hbm/util/BobMathUtil.java index 065142b57..51325f3b0 100644 --- a/src/main/java/com/hbm/util/BobMathUtil.java +++ b/src/main/java/com/hbm/util/BobMathUtil.java @@ -81,6 +81,12 @@ public class BobMathUtil { return MathHelper.clamp_float((num - min1) / (max1 - min1), 0, 1); } + public static float smoothStep(float f, float lower, float upper) + { + final float t = MathHelper.clamp_float((f - lower) / (upper - lower), 0, 1); + return t * t * (3f - 2f * t); + } + public static ForgeDirection[] getShuffledDirs() { ForgeDirection[] dirs = new ForgeDirection[6]; @@ -94,7 +100,7 @@ public class BobMathUtil { return dirs; } - public static String toPercentage(float amount, float total) { + public static String toPercentage(double amount, double total) { return NumberFormat.getPercentInstance().format(amount / total); } diff --git a/src/main/java/com/hbm/util/ParticleUtil.java b/src/main/java/com/hbm/util/ParticleUtil.java index 0428ec19b..e3d742f2b 100644 --- a/src/main/java/com/hbm/util/ParticleUtil.java +++ b/src/main/java/com/hbm/util/ParticleUtil.java @@ -1,8 +1,10 @@ package com.hbm.util; +import com.hbm.interfaces.ILocationProvider; import com.hbm.main.MainRegistry; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.particle.SpentCasingConfig; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.nbt.NBTTagCompound; @@ -27,4 +29,27 @@ public class ParticleUtil { PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(world.provider.dimensionId, x, y, z, 150)); } } + + /** + * Spawn a spent shell casing. + * @param location Location to spawn from. + * @param config The shell casing configuration to use. + * @param pitch Pitch rotation in radians. + * @param yaw Yaw rotation in radians. + * @param heightAdjustment Height adjustment. + * @param sneaking Assume from a sneaking/crouched entity. + */ + public static void spawnCasing(ILocationProvider location, SpentCasingConfig config, float pitch, float yaw, float heightAdjustment, boolean sneaking) + { + final NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "casing"); + data.setDouble("posX", location.posX()); + data.setDouble("posY", location.posY() + heightAdjustment); + data.setDouble("posZ", location.posZ()); + data.setFloat("pitch", pitch); + data.setFloat("yaw", yaw); + data.setBoolean("crouched", sneaking); + data.setString("name", config.getRegistryName()); + MainRegistry.proxy.effectNT(data); + } } diff --git a/src/main/resources/assets/hbm/models/effect/casings.mtl b/src/main/resources/assets/hbm/models/effect/casings.mtl new file mode 100644 index 000000000..9870c10af --- /dev/null +++ b/src/main/resources/assets/hbm/models/effect/casings.mtl @@ -0,0 +1,13 @@ +# Blender MTL File: 'casings.blend' +# Material Count: 1 + +newmtl None +Ns 500.000001 +Ka 1.000000 1.000000 1.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.800000 0.800000 0.800000 +Ke 0.000000 0.000000 0.000000 +Ni 1.450000 +d 1.000000 +illum 2 +map_Kd /home/justin/eclipse-workspace/Hbm-s-Nuclear-Tech-GIT/src/main/resources/assets/hbm/textures/particle/casing_tex.png diff --git a/src/main/resources/assets/hbm/models/effect/casings.obj b/src/main/resources/assets/hbm/models/effect/casings.obj new file mode 100644 index 000000000..aafd7bc83 --- /dev/null +++ b/src/main/resources/assets/hbm/models/effect/casings.obj @@ -0,0 +1,965 @@ +# Blender v3.0.1 OBJ File: 'casings.blend' +# www.blender.org +mtllib casings.mtl +o AR2_Cylinder.001 +v 0.000000 0.360000 -1.200000 +v 0.000000 0.360000 -0.400000 +v 0.254558 0.254558 -1.200000 +v 0.254558 0.254558 -0.400000 +v 0.360000 0.000000 -1.200000 +v 0.360000 -0.000000 -0.400000 +v 0.254558 -0.254558 -1.200000 +v 0.254558 -0.254558 -0.400000 +v -0.000000 -0.360000 -1.200000 +v -0.000000 -0.360000 -0.400000 +v -0.254558 -0.254558 -1.200000 +v -0.254558 -0.254559 -0.400000 +v -0.360000 0.000000 -1.200000 +v -0.360000 -0.000000 -0.400000 +v -0.254559 0.254558 -1.200000 +v -0.254559 0.254558 -0.400000 +v 0.000000 0.600000 -0.400000 +v 0.000000 0.600000 0.000000 +v 0.424264 0.424264 -0.400000 +v 0.424264 0.424264 0.000000 +v 0.600000 -0.000000 -0.400000 +v 0.600000 -0.000000 0.000000 +v 0.424264 -0.424264 -0.400000 +v 0.424264 -0.424264 0.000000 +v -0.000000 -0.600000 -0.400000 +v -0.000000 -0.600000 0.000000 +v -0.424264 -0.424264 -0.400000 +v -0.424264 -0.424264 0.000000 +v -0.600000 0.000000 -0.400000 +v -0.600000 0.000000 0.000000 +v -0.424264 0.424264 -0.400000 +v -0.424264 0.424264 0.000000 +vt 0.162500 0.566875 +vt 0.146875 0.504375 +vt 0.162500 0.504375 +vt 0.146875 0.566875 +vt 0.131250 0.504375 +vt 0.131250 0.566875 +vt 0.115625 0.504375 +vt 0.115625 0.566875 +vt 0.100000 0.504375 +vt 0.100000 0.566875 +vt 0.084375 0.504375 +vt 0.084375 0.566875 +vt 0.068750 0.504375 +vt 0.101250 0.599125 +vt 0.002250 0.500125 +vt 0.101250 0.401125 +vt 0.068750 0.566875 +vt 0.053125 0.504375 +vt 0.053125 0.566875 +vt 0.037500 0.504375 +vt 0.171253 0.570129 +vt 0.171253 0.430121 +vt 0.031246 0.430122 +vt 0.162500 0.566875 +vt 0.146875 0.504375 +vt 0.162500 0.504375 +vt 0.146875 0.566875 +vt 0.131250 0.504375 +vt 0.131250 0.566875 +vt 0.115625 0.504375 +vt 0.115625 0.566875 +vt 0.100000 0.504375 +vt 0.100000 0.566875 +vt 0.084375 0.504375 +vt 0.084375 0.566875 +vt 0.068750 0.504375 +vt 0.171253 0.430121 +vt 0.200250 0.500125 +vt 0.002250 0.500125 +vt 0.068750 0.566875 +vt 0.053125 0.504375 +vt 0.053125 0.566875 +vt 0.037500 0.504375 +vt 0.171253 0.430121 +vt 0.031246 0.430122 +vt 0.031246 0.570129 +vt 0.200250 0.500125 +vt 0.171253 0.570129 +vt 0.031246 0.570129 +vt 0.031246 0.430122 +vt 0.171253 0.430121 +vt 0.037500 0.566875 +vt 0.031246 0.570129 +vt 0.101250 0.599125 +vt 0.200250 0.500125 +vt 0.101250 0.401125 +vt 0.002250 0.500125 +vt 0.171253 0.570129 +vt 0.101250 0.599125 +vt 0.031246 0.570129 +vt 0.031246 0.430122 +vt 0.101250 0.401125 +vt 0.037500 0.566875 +vt 0.101250 0.599125 +vt 0.171253 0.570129 +vt 0.200250 0.500125 +vt 0.101250 0.401125 +vt 0.002250 0.500125 +vn 0.3827 0.9239 0.0000 +vn 0.9239 0.3827 0.0000 +vn 0.9239 -0.3827 -0.0000 +vn 0.3827 -0.9239 -0.0000 +vn -0.3827 -0.9239 0.0000 +vn -0.9239 -0.3827 -0.0000 +vn 0.0000 -0.0000 1.0000 +vn -0.9239 0.3827 0.0000 +vn -0.3827 0.9239 0.0000 +vn -0.0000 0.0000 -1.0000 +usemtl None +s off +f 2/1/1 3/2/1 1/3/1 +f 4/4/2 5/5/2 3/2/2 +f 6/6/3 7/7/3 5/5/3 +f 8/8/4 9/9/4 7/7/4 +f 10/10/5 11/11/5 9/9/5 +f 12/12/6 13/13/6 11/11/6 +f 2/14/7 14/15/7 10/16/7 +f 14/17/8 15/18/8 13/13/8 +f 16/19/9 1/20/9 15/18/9 +f 3/21/10 7/22/10 11/23/10 +f 18/24/1 19/25/1 17/26/1 +f 20/27/2 21/28/2 19/25/2 +f 22/29/3 23/30/3 21/28/3 +f 24/31/4 25/32/4 23/30/4 +f 26/33/5 27/34/5 25/32/5 +f 28/35/6 29/36/6 27/34/6 +f 24/37/7 22/38/7 30/39/7 +f 30/40/8 31/41/8 29/36/8 +f 32/42/9 17/43/9 31/41/9 +f 23/44/10 27/45/10 31/46/10 +f 2/1/1 4/4/1 3/2/1 +f 4/4/2 6/6/2 5/5/2 +f 6/6/3 8/8/3 7/7/3 +f 8/8/4 10/10/4 9/9/4 +f 10/10/5 12/12/5 11/11/5 +f 12/12/6 14/17/6 13/13/6 +f 6/47/7 4/48/7 2/14/7 +f 2/14/7 16/49/7 14/15/7 +f 14/15/7 12/50/7 10/16/7 +f 10/16/7 8/51/7 6/47/7 +f 6/47/7 2/14/7 10/16/7 +f 14/17/8 16/19/8 15/18/8 +f 16/19/9 2/52/9 1/20/9 +f 15/53/10 1/54/10 3/21/10 +f 3/21/10 5/55/10 7/22/10 +f 7/22/10 9/56/10 11/23/10 +f 11/23/10 13/57/10 15/53/10 +f 15/53/10 3/21/10 11/23/10 +f 18/24/1 20/27/1 19/25/1 +f 20/27/2 22/29/2 21/28/2 +f 22/29/3 24/31/3 23/30/3 +f 24/31/4 26/33/4 25/32/4 +f 26/33/5 28/35/5 27/34/5 +f 28/35/6 30/40/6 29/36/6 +f 22/38/7 20/58/7 18/59/7 +f 18/59/7 32/60/7 22/38/7 +f 32/60/7 30/39/7 22/38/7 +f 30/39/7 28/61/7 26/62/7 +f 26/62/7 24/37/7 30/39/7 +f 30/40/8 32/42/8 31/41/8 +f 32/42/9 18/63/9 17/43/9 +f 31/46/10 17/64/10 19/65/10 +f 19/65/10 21/66/10 23/44/10 +f 23/44/10 25/67/10 27/45/10 +f 27/45/10 29/68/10 31/46/10 +f 31/46/10 19/65/10 23/44/10 +o Shotgun_Shell_Cylinder.002 +v -0.317579 0.317579 1.112764 +v 0.000000 0.449124 -1.223040 +v -0.317579 0.317579 -1.223040 +v 0.449124 -0.000000 1.112764 +v 0.317579 -0.317578 -1.223040 +v 0.449124 -0.000000 -1.223040 +v 0.317579 -0.317578 1.112764 +v 0.000000 -0.449123 -1.223040 +v 0.000000 -0.449124 1.112764 +v -0.317579 -0.317578 -1.223040 +v -0.317579 -0.317578 1.112764 +v -0.449124 -0.000000 -1.223040 +v -0.449124 -0.000000 1.112764 +v 0.000000 0.449124 1.112764 +v 0.317579 0.317579 -1.223040 +v 0.317579 0.317579 1.112764 +v 0.353356 0.353357 1.148335 +v 0.499721 -0.000000 1.148335 +v 0.353356 -0.353356 1.148335 +v 0.000000 -0.499721 1.148335 +v -0.353356 -0.353356 1.148335 +v -0.499721 -0.000000 1.148335 +v -0.353356 0.353357 1.148335 +v 0.000000 0.499721 1.148335 +vt 0.468081 0.764346 +vt 0.489255 0.933910 +vt 0.468081 0.933910 +vt 0.395789 0.764346 +vt 0.416963 0.933910 +vt 0.395789 0.933910 +vt 0.293553 0.764346 +vt 0.323497 0.933910 +vt 0.293553 0.933910 +vt 0.323497 0.764346 +vt 0.344671 0.933910 +vt 0.416963 0.764346 +vt 0.438137 0.933910 +vt 0.416963 0.933910 +vt 0.438137 0.764346 +vt 0.344671 0.764346 +vt 0.365845 0.933910 +vt 0.344671 0.933910 +vt 0.365845 0.764346 +vt 0.175844 0.775274 +vt 0.144213 0.779346 +vt 0.145900 0.775274 +vt 0.120654 0.755786 +vt 0.124726 0.754100 +vt 0.124726 0.724156 +vt 0.120654 0.722469 +vt 0.145900 0.702982 +vt 0.144213 0.698910 +vt 0.177531 0.698910 +vt 0.175844 0.702982 +vt 0.201090 0.722469 +vt 0.197018 0.724155 +vt 0.197018 0.754100 +vt 0.201090 0.755787 +vt 0.177531 0.779346 +vt 0.489255 0.764346 +vt 0.416963 0.764346 +vt 0.344671 0.764346 +vt 0.960365 0.912783 +vt 0.858129 0.955131 +vt 0.815781 0.852895 +vt 0.067942 0.886801 +vt 0.086790 0.867953 +vt 0.113444 0.867953 +vt 0.918017 0.810547 +vt 0.960365 0.852895 +vt 0.918017 0.955131 +vt 0.815781 0.912784 +vt 0.858128 0.810547 +vt 0.132291 0.886801 +vt 0.132291 0.913455 +vt 0.113444 0.932302 +vt 0.086790 0.932302 +vt 0.067942 0.913455 +vn -0.3827 0.9239 0.0000 +vn 0.9239 -0.3827 -0.0000 +vn 0.3827 -0.9239 -0.0000 +vn -0.3827 -0.9239 -0.0000 +vn -0.9239 -0.3827 -0.0000 +vn -0.9239 0.3827 0.0000 +vn 0.3827 0.9239 0.0000 +vn 0.9239 0.3827 0.0000 +vn 0.2317 0.5595 -0.7958 +vn 0.5595 0.2317 -0.7958 +vn 0.5595 -0.2317 -0.7958 +vn 0.2317 -0.5595 -0.7958 +vn -0.2317 -0.5595 -0.7958 +vn -0.5595 -0.2317 -0.7958 +vn -0.5595 0.2317 -0.7958 +vn -0.2317 0.5595 -0.7958 +vn -0.0000 0.0000 -1.0000 +vn 0.0000 0.0000 1.0000 +usemtl None +s 1 +f 33/69/11 34/70/11 35/71/11 +f 36/72/12 37/73/12 38/74/12 +f 39/75/13 40/76/13 37/77/13 +f 41/78/14 42/79/14 40/76/14 +f 43/80/15 44/81/15 42/82/15 +f 45/83/16 35/71/16 44/81/16 +f 46/84/17 47/85/17 34/86/17 +f 48/87/18 38/74/18 47/85/18 +f 46/88/19 49/89/19 48/90/19 +f 48/90/20 50/91/20 36/92/20 +f 39/93/21 50/91/21 51/94/21 +f 41/95/22 51/94/22 52/96/22 +f 41/95/23 53/97/23 43/98/23 +f 43/98/24 54/99/24 45/100/24 +f 33/101/25 54/99/25 55/102/25 +f 46/88/26 55/102/26 56/103/26 +f 33/69/11 46/104/11 34/70/11 +f 36/72/12 39/105/12 37/73/12 +f 39/75/13 41/78/13 40/76/13 +f 41/78/14 43/106/14 42/79/14 +f 43/80/15 45/83/15 44/81/15 +f 45/83/16 33/69/16 35/71/16 +f 46/84/17 48/87/17 47/85/17 +f 48/87/18 36/72/18 38/74/18 +f 34/107/27 38/108/27 40/109/27 +f 46/88/19 56/103/19 49/89/19 +f 48/90/20 49/89/20 50/91/20 +f 39/93/21 36/92/21 50/91/21 +f 41/95/22 39/93/22 51/94/22 +f 41/95/23 52/96/23 53/97/23 +f 43/98/24 53/97/24 54/99/24 +f 33/101/25 45/100/25 54/99/25 +f 46/88/26 33/101/26 55/102/26 +f 53/110/28 52/111/28 51/112/28 +f 44/113/27 35/114/27 34/107/27 +f 34/107/27 47/115/27 38/108/27 +f 38/108/27 37/116/27 40/109/27 +f 40/109/27 42/117/27 44/113/27 +f 44/113/27 34/107/27 40/109/27 +f 51/112/28 50/118/28 49/119/28 +f 49/119/28 56/120/28 51/112/28 +f 56/120/28 55/121/28 51/112/28 +f 55/121/28 54/122/28 51/112/28 +f 54/122/28 53/110/28 51/112/28 +o Brass_Straight_Casing +v 0.300002 -0.000003 0.685047 +v 0.185616 0.185613 0.685047 +v -0.000000 -0.262503 0.735047 +v 0.300002 -0.000001 0.785047 +v -0.212132 -0.212133 0.685047 +v -0.185614 -0.185617 0.685047 +v -0.212132 0.212131 0.685047 +v -0.000000 0.262499 0.685047 +v -0.000000 0.299999 0.685047 +v 0.212132 0.212131 0.685047 +v 0.212132 -0.212133 0.685047 +v 0.185616 -0.185617 0.685047 +v 0.300002 -0.000003 0.735047 +v -0.000000 0.299999 0.735047 +v -0.212132 0.212131 0.735047 +v -0.185614 0.185613 0.735047 +v -0.185614 -0.185617 0.735047 +v 0.185616 -0.185617 0.735047 +v 0.185616 0.185613 0.735047 +v 0.212132 -0.212133 0.785047 +v -0.300000 -0.000001 0.785047 +v -0.212132 0.212131 0.785047 +v -0.212132 -0.212133 0.785047 +v -0.212132 -0.212133 -0.814953 +v 0.300002 -0.000003 -0.814953 +v 0.212132 0.212131 -0.814953 +v -0.000000 0.299999 -0.814953 +v 0.212132 -0.212133 -0.814953 +v -0.000000 -0.300001 -0.814953 +v -0.000000 -0.300001 0.685047 +v -0.300000 -0.000003 -0.814953 +v -0.300000 -0.000003 0.685047 +v -0.212132 0.212131 -0.814953 +v -0.212132 -0.212133 0.735047 +v -0.000000 -0.300001 0.785047 +v 0.212132 -0.212133 0.735047 +v 0.212132 0.212131 0.785047 +v 0.212132 0.212131 0.735047 +v -0.000000 0.299999 0.785047 +v -0.300000 -0.000003 0.735047 +v -0.000000 -0.300001 0.735047 +v -0.000000 -0.262503 0.685047 +v 0.262502 -0.000003 0.735047 +v 0.262502 -0.000003 0.685047 +v -0.000000 0.262499 0.735047 +v -0.185614 0.185613 0.685047 +v -0.262500 -0.000003 0.735047 +v -0.262500 -0.000003 0.685047 +vt 0.555701 0.706657 +vt 0.559782 0.681299 +vt 0.559782 0.704967 +vt 0.374299 0.628133 +vt 0.353483 0.613088 +vt 0.355173 0.609007 +vt 0.621002 0.706657 +vt 0.600185 0.721702 +vt 0.616920 0.704966 +vt 0.601875 0.660482 +vt 0.576517 0.664564 +vt 0.574827 0.660482 +vt 0.555701 0.679609 +vt 0.574827 0.725783 +vt 0.576518 0.721702 +vt 0.616920 0.681299 +vt 0.621002 0.679609 +vt 0.601876 0.725783 +vt 0.600185 0.664564 +vt 0.328125 0.609007 +vt 0.313080 0.629823 +vt 0.308998 0.628133 +vt 0.308998 0.655181 +vt 0.329815 0.670226 +vt 0.328124 0.674308 +vt 0.355173 0.674308 +vt 0.353482 0.670226 +vt 0.370218 0.653491 +vt 0.370218 0.629824 +vt 0.329815 0.613088 +vt 0.313080 0.653491 +vt 0.374299 0.655181 +vt 0.555701 0.614308 +vt 0.378998 0.641356 +vt 0.378998 0.614308 +vt 0.378998 0.725783 +vt 0.555701 0.752832 +vt 0.378998 0.752832 +vt 0.555701 0.725783 +vt 0.378998 0.706657 +vt 0.555701 0.706657 +vt 0.555701 0.660482 +vt 0.378998 0.660482 +vt 0.378998 0.679609 +vt 0.555701 0.660482 +vt 0.555701 0.679609 +vt 0.555701 0.706657 +vt 0.378998 0.706657 +vt 0.555701 0.799007 +vt 0.378998 0.771958 +vt 0.555701 0.771958 +vt 0.834098 0.918854 +vt 0.872350 0.826504 +vt 0.964699 0.864757 +vt 0.555701 0.641356 +vt 0.378998 0.660482 +vt 0.378998 0.799007 +vt 0.964699 0.918854 +vt 0.926447 0.957106 +vt 0.872350 0.957106 +vt 0.834098 0.864757 +vt 0.926448 0.826504 +vt 0.078463 0.847672 +vt 0.152342 0.878274 +vt 0.121740 0.952153 +vt 0.578726 0.628418 +vt 0.559600 0.622528 +vt 0.578726 0.622528 +vt 0.559600 0.622528 +vt 0.578726 0.616637 +vt 0.578726 0.622528 +vt 0.605775 0.628418 +vt 0.586649 0.634308 +vt 0.586649 0.628418 +vt 0.605775 0.616637 +vt 0.578726 0.610747 +vt 0.605775 0.610747 +vt 0.605775 0.628418 +vt 0.605775 0.622528 +vt 0.605775 0.616637 +vt 0.605775 0.622528 +vt 0.559600 0.634308 +vt 0.559600 0.628418 +vt 0.578726 0.616637 +vt 0.559600 0.610747 +vt 0.572436 0.725783 +vt 0.596104 0.731673 +vt 0.572436 0.731673 +vt 0.600003 0.604857 +vt 0.616739 0.610747 +vt 0.600003 0.610747 +vt 0.555701 0.725783 +vt 0.555701 0.731673 +vt 0.583268 0.610747 +vt 0.559600 0.604857 +vt 0.583268 0.604857 +vt 0.600003 0.610747 +vt 0.600003 0.604857 +vt 0.622437 0.634308 +vt 0.646104 0.640198 +vt 0.622437 0.640198 +vt 0.605701 0.634308 +vt 0.605701 0.640198 +vt 0.616739 0.604857 +vt 0.640406 0.610747 +vt 0.559600 0.628418 +vt 0.559600 0.616637 +vt 0.605775 0.634308 +vt 0.559600 0.616637 +vt 0.596104 0.725783 +vt 0.559600 0.610747 +vt 0.646104 0.634308 +vt 0.640406 0.604857 +vt 0.078463 0.952153 +vt 0.047861 0.921551 +vt 0.047861 0.878274 +vt 0.121740 0.847672 +vt 0.152342 0.921551 +vn 0.0000 0.0000 1.0000 +vn 0.0000 0.0000 -1.0000 +vn -0.9239 -0.3827 -0.0000 +vn -0.3827 0.9239 0.0000 +vn -0.9239 0.3827 0.0000 +vn -0.3827 -0.9239 -0.0000 +vn 0.9239 -0.3827 -0.0000 +vn 0.3827 -0.9239 -0.0000 +vn 0.9239 0.3827 0.0000 +vn 0.3827 0.9239 0.0000 +vn 0.5490 -0.5490 0.6303 +vn 0.5490 0.5490 0.6303 +vn -0.5490 0.5490 0.6303 +vn -0.7071 -0.7071 0.0000 +vn -0.0000 -0.7764 0.6303 +vn -0.5490 -0.5490 0.6303 +vn 1.0000 -0.0000 -0.0000 +vn 0.7071 -0.7071 0.0000 +vn 0.0000 1.0000 0.0000 +vn 0.7071 0.7071 -0.0000 +vn 0.0000 0.7764 0.6303 +vn -1.0000 -0.0000 -0.0000 +vn -0.7764 0.0000 0.6303 +vn 0.0000 -1.0000 0.0000 +vn 0.7764 0.0000 0.6303 +vn -0.7071 0.7071 -0.0000 +usemtl None +s off +f 57/123/29 58/124/29 100/125/29 +f 90/126/30 59/127/30 97/128/30 +f 61/129/29 98/130/29 62/131/29 +f 63/132/29 64/133/29 65/134/29 +f 66/135/29 64/133/29 58/124/29 +f 67/136/29 100/125/29 68/137/29 +f 61/129/29 104/138/29 88/139/29 +f 67/136/29 98/130/29 86/140/29 +f 88/139/29 102/141/29 63/132/29 +f 92/142/30 99/143/30 69/144/30 +f 94/145/30 101/146/30 70/147/30 +f 71/148/30 101/146/30 72/149/30 +f 90/126/30 103/150/30 73/151/30 +f 92/142/30 59/127/30 74/152/30 +f 69/144/30 75/153/30 94/145/30 +f 96/154/30 72/149/30 103/150/30 +f 57/123/29 66/135/29 58/124/29 +f 90/126/30 73/151/30 59/127/30 +f 61/129/29 86/140/29 98/130/29 +f 63/132/29 102/141/29 64/133/29 +f 66/135/29 65/134/29 64/133/29 +f 67/136/29 57/123/29 100/125/29 +f 61/129/29 62/131/29 104/138/29 +f 67/136/29 68/137/29 98/130/29 +f 88/139/29 104/138/29 102/141/29 +f 92/142/30 74/152/30 99/143/30 +f 94/145/30 75/153/30 101/146/30 +f 71/148/30 70/147/30 101/146/30 +f 90/126/30 96/154/30 103/150/30 +f 92/142/30 97/128/30 59/127/30 +f 69/144/30 99/143/30 75/153/30 +f 96/154/30 71/148/30 72/149/30 +f 87/155/31 61/156/31 88/157/31 +f 89/158/32 65/159/32 83/160/32 +f 63/161/33 87/162/33 88/163/33 +f 61/156/34 85/164/34 86/165/34 +f 84/166/35 57/167/35 67/168/35 +f 84/166/36 86/169/36 85/170/36 +f 57/171/37 82/172/37 66/173/37 +f 83/160/38 66/173/38 82/172/38 +f 89/174/30 82/175/30 84/176/30 +f 87/155/31 80/177/31 61/156/31 +f 89/158/32 63/161/32 65/159/32 +f 63/161/33 89/158/33 87/162/33 +f 61/156/34 80/177/34 85/164/34 +f 84/166/35 81/178/35 57/167/35 +f 84/166/36 67/168/36 86/169/36 +f 57/171/37 81/179/37 82/172/37 +f 83/160/38 65/159/38 66/173/38 +f 84/176/30 85/180/30 80/181/30 +f 80/181/30 87/182/30 89/174/30 +f 89/174/30 83/183/30 82/175/30 +f 82/175/30 81/184/30 84/176/30 +f 84/176/30 80/181/30 89/174/30 +s 1 +f 76/185/39 93/186/40 78/187/41 +f 90/188/42 91/189/43 79/190/44 +f 69/191/45 76/192/39 92/193/46 +f 70/194/47 93/195/40 94/196/48 +f 70/197/47 78/198/41 95/199/49 +f 96/200/50 79/190/44 77/201/51 +f 92/193/46 91/202/43 97/203/52 +f 94/196/48 60/204/53 69/205/45 +f 71/206/54 77/207/51 78/198/41 +f 74/208/46 98/209/52 68/210/46 +f 59/211/52 62/212/42 98/213/52 +f 99/214/45 68/210/46 100/215/45 +f 75/216/48 100/217/45 58/218/48 +f 101/219/47 58/218/48 64/220/47 +f 72/221/54 64/222/47 102/223/54 +f 103/224/50 102/223/54 104/225/50 +f 73/226/42 104/227/50 62/212/42 +f 90/188/42 97/228/52 91/189/43 +f 69/191/45 60/229/53 76/192/39 +f 70/194/47 95/230/49 93/195/40 +f 70/197/47 71/206/54 78/198/41 +f 96/200/50 90/188/42 79/190/44 +f 92/193/46 76/192/39 91/202/43 +f 94/196/48 93/195/40 60/204/53 +f 71/206/54 96/231/50 77/207/51 +f 74/208/46 59/232/52 98/209/52 +f 59/211/52 73/226/42 62/212/42 +f 99/214/45 74/208/46 68/210/46 +f 75/216/48 99/233/45 100/217/45 +f 101/219/47 75/216/48 58/218/48 +f 72/221/54 101/234/47 64/222/47 +f 103/224/50 72/221/54 102/223/54 +f 73/226/42 103/235/50 104/227/50 +f 78/187/41 77/236/51 79/237/44 +f 79/237/44 91/238/43 76/185/39 +f 76/185/39 60/239/53 93/186/40 +f 93/186/40 95/240/49 78/187/41 +f 78/187/41 79/237/44 76/185/39 +o Brass_Bottleneck_Casing.002 +v 0.300002 -0.000003 0.685047 +v 0.185616 0.185613 0.685047 +v -0.000000 -0.262503 0.735047 +v 0.300002 -0.000001 0.785047 +v -0.212132 -0.212133 0.685047 +v -0.185614 -0.185617 0.685047 +v -0.212132 0.212131 0.685047 +v -0.000000 0.262499 0.685047 +v -0.000000 0.299999 0.685047 +v 0.212132 0.212131 0.685047 +v 0.212132 -0.212133 0.685047 +v 0.185616 -0.185617 0.685047 +v 0.300002 -0.000003 0.735047 +v -0.000000 0.299999 0.735047 +v -0.212132 0.212131 0.735047 +v -0.185614 0.185613 0.735047 +v -0.185614 -0.185617 0.735047 +v 0.185616 -0.185617 0.735047 +v 0.185616 0.185613 0.735047 +v 0.212132 -0.212133 0.785047 +v -0.300000 -0.000001 0.785047 +v -0.212132 0.212131 0.785047 +v -0.212132 -0.212133 0.785047 +v -0.000000 -0.300001 0.685047 +v -0.300000 -0.000003 0.685047 +v -0.212132 -0.212133 0.735047 +v -0.000000 -0.300001 0.785047 +v 0.212132 -0.212133 0.735047 +v 0.212132 0.212131 0.785047 +v 0.212132 0.212131 0.735047 +v -0.000000 0.299999 0.785047 +v -0.300000 -0.000003 0.735047 +v -0.000000 -0.300001 0.735047 +v -0.000000 -0.262503 0.685047 +v 0.262502 -0.000003 0.735047 +v 0.262502 -0.000003 0.685047 +v -0.000000 0.262499 0.735047 +v -0.185614 0.185613 0.685047 +v -0.262500 -0.000003 0.735047 +v -0.262500 -0.000003 0.685047 +v -0.135596 -0.135597 -0.764953 +v -0.212132 -0.212133 -0.414953 +v 0.191762 -0.000003 -0.764953 +v 0.300002 -0.000003 -0.414953 +v 0.212132 0.212131 -0.414953 +v 0.135595 0.135594 -0.764953 +v -0.000000 0.299999 -0.414953 +v -0.000000 0.191760 -0.764953 +v 0.135596 -0.135596 -0.764953 +v 0.212132 -0.212133 -0.414953 +v -0.000000 -0.191762 -0.764953 +v -0.000000 -0.300001 -0.414953 +v -0.191761 -0.000003 -0.764953 +v -0.300000 -0.000003 -0.414953 +v -0.212132 0.212131 -0.414953 +v -0.135595 0.135594 -0.764953 +v -0.000000 -0.191762 -1.014953 +v 0.135596 -0.135596 -1.014953 +v -0.135595 0.135594 -1.014953 +v -0.191761 -0.000003 -1.014953 +v -0.000000 0.191760 -1.014953 +v 0.135595 0.135594 -1.014953 +v -0.135596 -0.135597 -1.014953 +v 0.191762 -0.000003 -1.014953 +vt 0.630972 0.689316 +vt 0.635004 0.664263 +vt 0.635004 0.687646 +vt 0.760004 0.662592 +vt 0.739438 0.647728 +vt 0.741108 0.643696 +vt 0.695488 0.689316 +vt 0.674922 0.704180 +vt 0.691456 0.687645 +vt 0.676592 0.643696 +vt 0.651539 0.647728 +vt 0.649868 0.643696 +vt 0.630972 0.662592 +vt 0.649869 0.708212 +vt 0.651539 0.704180 +vt 0.691456 0.664263 +vt 0.695488 0.662592 +vt 0.676592 0.708212 +vt 0.674922 0.647728 +vt 0.714385 0.643696 +vt 0.699521 0.664262 +vt 0.695488 0.662592 +vt 0.695488 0.689316 +vt 0.716055 0.704180 +vt 0.714385 0.708212 +vt 0.741108 0.708212 +vt 0.739438 0.704180 +vt 0.755972 0.687645 +vt 0.755972 0.664262 +vt 0.716055 0.647728 +vt 0.699521 0.687645 +vt 0.760005 0.689316 +vt 0.565094 0.763968 +vt 0.437169 0.737244 +vt 0.565094 0.737244 +vt 0.395530 0.665471 +vt 0.366932 0.677549 +vt 0.366456 0.665471 +vt 0.436423 0.653832 +vt 0.565094 0.672728 +vt 0.437169 0.672728 +vt 0.436423 0.718348 +vt 0.565094 0.699452 +vt 0.564349 0.718348 +vt 0.436423 0.718348 +vt 0.565094 0.627109 +vt 0.436423 0.608212 +vt 0.564349 0.608212 +vt 0.436423 0.782864 +vt 0.564348 0.782864 +vt 0.437168 0.627109 +vt 0.565094 0.653832 +vt 0.437168 0.653832 +vt 0.396006 0.677549 +vt 0.396006 0.631929 +vt 0.395530 0.619851 +vt 0.396006 0.649011 +vt 0.395530 0.729986 +vt 0.396006 0.742065 +vt 0.437169 0.699452 +vt 0.396006 0.694631 +vt 0.396006 0.759147 +vt 0.437169 0.763968 +vt 0.818608 0.930835 +vt 0.866923 0.814195 +vt 0.983563 0.862509 +vt 0.366456 0.729986 +vt 0.395530 0.706709 +vt 0.366932 0.694631 +vt 0.395530 0.771225 +vt 0.366932 0.759147 +vt 0.366932 0.742065 +vt 0.366932 0.631929 +vt 0.366456 0.619851 +vt 0.564349 0.653832 +vt 0.564349 0.718348 +vt 0.983563 0.930836 +vt 0.935248 0.979150 +vt 0.866923 0.979150 +vt 0.818608 0.862509 +vt 0.935250 0.814194 +vt 0.366456 0.706709 +vt 0.366456 0.771225 +vt 0.366932 0.649011 +vt 0.078761 0.848420 +vt 0.151753 0.878654 +vt 0.121519 0.951645 +vt 0.714385 0.637881 +vt 0.741108 0.643696 +vt 0.714385 0.643696 +vt 0.585352 0.637881 +vt 0.566456 0.642951 +vt 0.566456 0.637136 +vt 0.630972 0.637136 +vt 0.612076 0.643696 +vt 0.612076 0.637881 +vt 0.760099 0.660723 +vt 0.786724 0.666973 +vt 0.760004 0.666537 +vt 0.695488 0.637136 +vt 0.695488 0.642951 +vt 0.760004 0.637136 +vt 0.741108 0.637881 +vt 0.585352 0.643696 +vt 0.786819 0.661159 +vt 0.805630 0.666537 +vt 0.816456 0.643044 +vt 0.799922 0.637881 +vt 0.816456 0.637229 +vt 0.799922 0.643696 +vt 0.776539 0.637881 +vt 0.655571 0.643696 +vt 0.639037 0.637229 +vt 0.655571 0.637881 +vt 0.678954 0.643696 +vt 0.678954 0.637881 +vt 0.695488 0.643044 +vt 0.695488 0.637229 +vt 0.783384 0.660723 +vt 0.760099 0.654527 +vt 0.783479 0.654909 +vt 0.799927 0.660341 +vt 0.800022 0.654527 +vt 0.776539 0.643696 +vt 0.760004 0.637229 +vt 0.630972 0.642951 +vt 0.760004 0.642951 +vt 0.805725 0.660723 +vt 0.639037 0.643044 +vt 0.760004 0.660341 +vt 0.760004 0.643044 +vt 0.078761 0.951645 +vt 0.048527 0.921411 +vt 0.048527 0.878654 +vt 0.121519 0.848420 +vt 0.151753 0.921411 +vn 0.0000 0.0000 1.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.9239 0.3827 0.0000 +vn 0.3827 -0.9239 0.0000 +vn -0.9239 -0.3827 -0.0000 +vn 0.3827 0.9239 0.0000 +vn -0.9239 0.3827 0.0000 +vn 0.9239 -0.3827 -0.0000 +vn -0.3827 0.9239 0.0000 +vn 0.3680 -0.8883 -0.2747 +vn -0.8883 0.3680 -0.2747 +vn -0.3680 0.8883 -0.2747 +vn 0.3680 0.8883 -0.2747 +vn -0.3680 -0.8883 -0.2747 +vn 0.8883 -0.3680 -0.2747 +vn -0.8883 -0.3680 -0.2747 +vn 0.8883 0.3680 -0.2747 +vn -0.3827 -0.9239 -0.0000 +vn 0.5490 -0.5490 0.6303 +vn 0.5490 0.5490 0.6303 +vn -0.5490 0.5490 0.6303 +vn -0.7071 -0.7071 0.0000 +vn -0.0000 -0.7764 0.6303 +vn -0.5490 -0.5490 0.6303 +vn 1.0000 -0.0000 -0.0000 +vn 0.7071 -0.7071 0.0000 +vn 0.0000 1.0000 0.0000 +vn 0.7071 0.7071 -0.0000 +vn 0.0000 0.7764 0.6303 +vn -1.0000 -0.0000 -0.0000 +vn -0.7764 0.0000 0.6303 +vn 0.0000 -1.0000 0.0000 +vn 0.7764 0.0000 0.6303 +vn -0.7071 0.7071 -0.0000 +usemtl None +s off +f 105/241/55 106/242/55 140/243/55 +f 130/244/56 107/245/56 137/246/56 +f 109/247/55 138/248/55 110/249/55 +f 111/250/55 112/251/55 113/252/55 +f 114/253/55 112/251/55 106/242/55 +f 115/254/55 140/243/55 116/255/55 +f 109/247/55 144/256/55 129/257/55 +f 115/254/55 138/248/55 128/258/55 +f 129/257/55 142/259/55 111/250/55 +f 132/260/56 139/261/56 117/262/56 +f 134/263/56 141/264/56 118/265/56 +f 119/266/56 141/264/56 120/267/56 +f 130/244/56 143/268/56 121/269/56 +f 132/260/56 107/245/56 122/270/56 +f 117/262/56 123/271/56 134/263/56 +f 136/272/56 120/267/56 143/268/56 +f 105/273/57 149/274/57 114/275/57 +f 105/241/55 114/253/55 106/242/55 +f 130/244/56 121/269/56 107/245/56 +f 109/247/55 128/258/55 138/248/55 +f 111/250/55 142/259/55 112/251/55 +f 114/253/55 113/252/55 112/251/55 +f 115/254/55 105/241/55 140/243/55 +f 109/247/55 110/249/55 144/256/55 +f 115/254/55 116/255/55 138/248/55 +f 129/257/55 144/256/55 142/259/55 +f 132/260/56 122/270/56 139/261/56 +f 134/263/56 123/271/56 141/264/56 +f 119/266/56 118/265/56 141/264/56 +f 130/244/56 136/272/56 143/268/56 +f 132/260/56 137/246/56 107/245/56 +f 117/262/56 139/261/56 123/271/56 +f 136/272/56 119/266/56 120/267/56 +f 153/276/58 161/277/58 162/278/58 +f 154/279/58 128/280/58 156/281/58 +f 158/282/59 109/283/59 129/284/59 +f 151/285/60 114/275/60 149/274/60 +f 111/286/61 158/287/61 129/288/61 +f 154/289/62 105/273/62 115/290/62 +f 159/291/63 113/292/63 151/293/63 +f 154/279/64 155/294/64 153/276/64 +f 158/287/65 160/295/65 157/296/65 +f 160/295/66 151/293/66 152/297/66 +f 152/298/67 149/274/67 150/299/67 +f 155/294/68 146/300/68 145/301/68 +f 154/289/69 147/302/69 148/303/69 +f 158/282/70 145/301/70 146/300/70 +f 147/302/71 149/274/71 148/303/71 +f 109/283/72 156/281/72 128/280/72 +f 163/304/56 166/305/56 162/306/56 +f 150/299/60 165/307/60 152/298/60 +f 157/308/59 167/309/59 145/301/59 +f 153/310/62 168/311/62 147/302/62 +f 145/301/72 161/277/72 155/294/72 +f 150/299/57 168/311/57 166/312/57 +f 152/297/63 163/313/63 160/295/63 +f 160/295/61 164/314/61 157/296/61 +f 105/273/57 148/303/57 149/274/57 +f 153/276/58 155/294/58 161/277/58 +f 154/279/58 115/315/58 128/280/58 +f 158/282/59 146/300/59 109/283/59 +f 151/285/60 113/316/60 114/275/60 +f 111/286/61 159/291/61 158/287/61 +f 154/289/62 148/303/62 105/273/62 +f 159/291/63 111/286/63 113/292/63 +f 154/279/64 156/281/64 155/294/64 +f 158/287/65 159/291/65 160/295/65 +f 160/295/66 159/291/66 151/293/66 +f 152/298/67 151/285/67 149/274/67 +f 155/294/68 156/281/68 146/300/68 +f 154/289/69 153/310/69 147/302/69 +f 158/282/70 157/308/70 145/301/70 +f 147/302/71 150/299/71 149/274/71 +f 109/283/72 146/300/72 156/281/72 +f 162/306/56 161/317/56 163/304/56 +f 161/317/56 167/318/56 163/304/56 +f 167/318/56 164/319/56 163/304/56 +f 163/304/56 165/320/56 166/305/56 +f 166/305/56 168/321/56 162/306/56 +f 150/299/60 166/312/60 165/307/60 +f 157/308/59 164/322/59 167/309/59 +f 153/310/62 162/323/62 168/311/62 +f 145/301/72 167/309/72 161/277/72 +f 150/299/57 147/302/57 168/311/57 +f 152/297/63 165/324/63 163/313/63 +f 160/295/61 163/313/61 164/314/61 +s 1 +f 124/325/73 133/326/74 126/327/75 +f 130/328/76 131/329/77 127/330/78 +f 117/331/79 124/332/73 132/333/80 +f 118/334/81 133/335/74 134/336/82 +f 118/337/81 126/338/75 135/339/83 +f 136/340/84 127/330/78 125/341/85 +f 132/342/80 131/329/77 137/343/86 +f 134/336/82 108/344/87 117/331/79 +f 119/345/88 125/346/85 126/338/75 +f 122/347/80 138/348/86 116/349/80 +f 107/350/86 110/351/76 138/348/86 +f 139/352/79 116/353/80 140/354/79 +f 123/355/82 140/354/79 106/356/82 +f 141/357/81 106/356/82 112/358/81 +f 120/359/88 112/360/81 142/361/88 +f 143/362/84 142/361/88 144/363/84 +f 121/364/76 144/365/84 110/351/76 +f 130/328/76 137/343/86 131/329/77 +f 117/331/79 108/344/87 124/332/73 +f 118/334/81 135/366/83 133/335/74 +f 118/337/81 119/345/88 126/338/75 +f 136/340/84 130/328/76 127/330/78 +f 132/342/80 124/367/73 131/329/77 +f 134/336/82 133/335/74 108/344/87 +f 119/345/88 136/368/84 125/346/85 +f 122/347/80 107/350/86 138/348/86 +f 107/350/86 121/364/76 110/351/76 +f 139/352/79 122/369/80 116/353/80 +f 123/355/82 139/352/79 140/354/79 +f 141/357/81 123/355/82 106/356/82 +f 120/359/88 141/370/81 112/360/81 +f 143/362/84 120/359/88 142/361/88 +f 121/364/76 143/371/84 144/365/84 +f 126/327/75 125/372/85 127/373/78 +f 127/373/78 131/374/77 124/325/73 +f 124/325/73 108/375/87 133/326/74 +f 133/326/74 135/376/83 126/327/75 +f 126/327/75 127/373/78 124/325/73 diff --git a/src/main/resources/assets/hbm/sounds.json b/src/main/resources/assets/hbm/sounds.json index ac277b9c5..9b3d481fb 100644 --- a/src/main/resources/assets/hbm/sounds.json +++ b/src/main/resources/assets/hbm/sounds.json @@ -188,6 +188,10 @@ "weapon.LMGMagInPB3": {"category": "player", "sounds": [{"name": "weapon/LMGIN", "stream": false}]}, "weapon.LMGCockPB3": {"category": "player", "sounds": [{"name": "weapon/LMGCLK", "stream": false}]}, "weapon.shotgunDrumPB3": {"category": "player", "sounds": ["weapon/ASGDRM1", "weapon/ASGDRM2"]}, + "weapon.shotgunShellBouncePB3": {"category": "player", "sounds": ["weapon/DSSHELL1", "weapon/DSSHELL2", "weapon/DSSHELL3"]}, + "weapon.smallCasingBouncePB3": {"category": "player", "sounds": ["weapon/BRASS_C1", "weapon/BRASS_C2", "weapon/BRASS_C3", "weapon/BRASS_C4", "weapon/BRASS_C5"]}, + "weapon.smallMagBouncePB3": {"category": "player", "sounds": ["weapon/DSAOUNC1", "weapon/DSAOUNC2", "weapon/DSAOUNC3", "weapon/DSAOUNC4"]}, + "weapon.largeMagBouncePB3": {"category": "player", "sounds": ["weapon/DSBOUNC1", "weapon/DSBOUNC2", "weapon/DSBOUNC3", "weapon/DSBOUNC4"]}, "weapon.dFlash": {"category": "player", "sounds": [{"name": "weapon/dFlash", "stream": false}]}, diff --git a/src/main/resources/assets/hbm/sounds/weapon/BRASS_C1.ogg b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C1.ogg new file mode 100644 index 000000000..0398dc877 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C1.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/BRASS_C2.ogg b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C2.ogg new file mode 100644 index 000000000..c16753f77 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C2.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/BRASS_C3.ogg b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C3.ogg new file mode 100644 index 000000000..62d7a52c7 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C3.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/BRASS_C4.ogg b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C4.ogg new file mode 100644 index 000000000..a94b20783 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C4.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/BRASS_C5.ogg b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C5.ogg new file mode 100644 index 000000000..79890e955 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/BRASS_C5.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC1.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC1.ogg new file mode 100644 index 000000000..45eb3c8f3 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC1.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC2.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC2.ogg new file mode 100644 index 000000000..6179b6366 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC2.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC3.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC3.ogg new file mode 100644 index 000000000..6b09798ca Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC3.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC4.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC4.ogg new file mode 100644 index 000000000..bf41335ad Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSAOUNC4.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC1.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC1.ogg new file mode 100644 index 000000000..100fc5dd0 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC1.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC2.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC2.ogg new file mode 100644 index 000000000..236c0e767 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC2.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC3.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC3.ogg new file mode 100644 index 000000000..ca6ed3ed9 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC3.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC4.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC4.ogg new file mode 100644 index 000000000..b13d8dc34 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSBOUNC4.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSSHELL1.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSSHELL1.ogg new file mode 100644 index 000000000..a64fffc51 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSSHELL1.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSSHELL2.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSSHELL2.ogg new file mode 100644 index 000000000..98983bf66 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSSHELL2.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/DSSHELL3.ogg b/src/main/resources/assets/hbm/sounds/weapon/DSSHELL3.ogg new file mode 100644 index 000000000..dc15231c6 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/DSSHELL3.ogg differ diff --git a/src/main/resources/assets/hbm/textures/items/ammo_4gauge.png b/src/main/resources/assets/hbm/textures/items/ammo_4gauge.stock.png similarity index 100% rename from src/main/resources/assets/hbm/textures/items/ammo_4gauge.png rename to src/main/resources/assets/hbm/textures/items/ammo_4gauge.stock.png diff --git a/src/main/resources/assets/hbm/textures/items/gun_pm_ammo.png b/src/main/resources/assets/hbm/textures/items/ammo_556.gold.png similarity index 100% rename from src/main/resources/assets/hbm/textures/items/gun_pm_ammo.png rename to src/main/resources/assets/hbm/textures/items/ammo_556.gold.png diff --git a/src/main/resources/assets/hbm/textures/particle/casing_ar2.png b/src/main/resources/assets/hbm/textures/particle/casing_ar2.png new file mode 100644 index 000000000..6186525b2 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/particle/casing_ar2.png differ diff --git a/src/main/resources/assets/hbm/textures/particle/casing_brass.png b/src/main/resources/assets/hbm/textures/particle/casing_brass.png new file mode 100644 index 000000000..fe691d7f5 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/particle/casing_brass.png differ diff --git a/src/main/resources/assets/hbm/textures/particle/casing_shotgun.png b/src/main/resources/assets/hbm/textures/particle/casing_shotgun.png new file mode 100644 index 000000000..1ed08d5ab Binary files /dev/null and b/src/main/resources/assets/hbm/textures/particle/casing_shotgun.png differ diff --git a/src/main/resources/assets/hbm/textures/particle/casing_tex.png b/src/main/resources/assets/hbm/textures/particle/casing_tex.png new file mode 100644 index 000000000..e9ddbafa5 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/particle/casing_tex.png differ diff --git a/src/main/resources/assets/hbm/textures/particle/casings.png b/src/main/resources/assets/hbm/textures/particle/casings.png new file mode 100644 index 000000000..c6ee91924 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/particle/casings.png differ