diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderAnaBullet.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderAnaBullet.java index ad5f8cb2..40aacc27 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderAnaBullet.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderAnaBullet.java @@ -7,6 +7,7 @@ import twopiradians.minewatch.client.model.ModelAnaBullet; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityAnaBullet; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderAnaBullet extends Render { @@ -23,6 +24,9 @@ protected ResourceLocation getEntityTexture(EntityAnaBullet entity) { @Override public void doRender(EntityAnaBullet entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.scale(0.1F, 0.1F, 0.1F); diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderBastionBullet.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderBastionBullet.java index d594555b..539aeabf 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderBastionBullet.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderBastionBullet.java @@ -7,6 +7,7 @@ import twopiradians.minewatch.client.model.ModelSoldier76Bullet; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityBastionBullet; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderBastionBullet extends Render { @@ -23,6 +24,9 @@ protected ResourceLocation getEntityTexture(EntityBastionBullet entity) { @Override public void doRender(EntityBastionBullet entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.scale(0.1F, 0.1F, 0.1F); diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderGenjiShuriken.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderGenjiShuriken.java index 21ea3c35..4cd0402d 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderGenjiShuriken.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderGenjiShuriken.java @@ -10,6 +10,7 @@ import net.minecraft.util.ResourceLocation; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityGenjiShuriken; +import twopiradians.minewatch.common.entity.ModEntities; import twopiradians.minewatch.common.item.ModItems; public class RenderGenjiShuriken extends Render @@ -31,6 +32,9 @@ protected ResourceLocation getEntityTexture(EntityGenjiShuriken entity) { @Override public void doRender(EntityGenjiShuriken entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y+.05f, (float)z); GlStateManager.enableRescaleNormal(); diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderInvisible.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderInvisible.java index b7b21ac2..7e1e6c84 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderInvisible.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderInvisible.java @@ -5,6 +5,7 @@ import net.minecraft.util.ResourceLocation; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityMWThrowable; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderInvisible extends Render { @@ -18,5 +19,8 @@ protected ResourceLocation getEntityTexture(EntityMWThrowable entity) { } @Override - public void doRender(EntityMWThrowable entity, double x, double y, double z, float entityYaw, float partialTicks) {} + public void doRender(EntityMWThrowable entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + } } diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderMcCreeBullet.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderMcCreeBullet.java index 25b9367e..06df25da 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderMcCreeBullet.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderMcCreeBullet.java @@ -7,6 +7,7 @@ import twopiradians.minewatch.client.model.ModelMcCreeBullet; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityMcCreeBullet; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderMcCreeBullet extends Render { @@ -23,6 +24,9 @@ protected ResourceLocation getEntityTexture(EntityMcCreeBullet entity) { @Override public void doRender(EntityMcCreeBullet entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.scale(0.1F, 0.1F, 0.1F); diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderMeiIcicle.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderMeiIcicle.java index b2d5ca98..780a0826 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderMeiIcicle.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderMeiIcicle.java @@ -5,6 +5,7 @@ import net.minecraft.util.ResourceLocation; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityMeiIcicle; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderMeiIcicle extends RenderOBJModel { @@ -24,6 +25,9 @@ protected ResourceLocation getEntityModel() { @Override protected void preRender(EntityMeiIcicle entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.translate(0, 0.06d, 0.5d); GlStateManager.scale(2, 2, 2); } diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderReaperBullet.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderReaperBullet.java index cd97e54c..b034ec3e 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderReaperBullet.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderReaperBullet.java @@ -7,6 +7,7 @@ import twopiradians.minewatch.client.model.ModelReaperBullet; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityReaperBullet; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderReaperBullet extends Render { @@ -23,6 +24,9 @@ protected ResourceLocation getEntityTexture(EntityReaperBullet entity) { @Override public void doRender(EntityReaperBullet entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.scale(0.1F, 0.1F, 0.1F); diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderSoldier76Bullet.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderSoldier76Bullet.java index b9436649..ea5ac4a1 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderSoldier76Bullet.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderSoldier76Bullet.java @@ -7,6 +7,7 @@ import twopiradians.minewatch.client.model.ModelSoldier76Bullet; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntitySoldier76Bullet; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderSoldier76Bullet extends Render { @@ -23,6 +24,9 @@ protected ResourceLocation getEntityTexture(EntitySoldier76Bullet entity) { @Override public void doRender(EntitySoldier76Bullet entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.scale(0.1F, 0.1F, 0.1F); diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderSoldier76HelixRocket.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderSoldier76HelixRocket.java index c4ccb41b..23ae3cc4 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderSoldier76HelixRocket.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderSoldier76HelixRocket.java @@ -7,6 +7,7 @@ import twopiradians.minewatch.client.model.ModelSoldier76Bullet; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntitySoldier76HelixRocket; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderSoldier76HelixRocket extends Render { @@ -23,6 +24,9 @@ protected ResourceLocation getEntityTexture(EntitySoldier76HelixRocket entity) { @Override public void doRender(EntitySoldier76HelixRocket entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.scale(0.1F, 0.1F, 0.1F); diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderTracerBullet.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderTracerBullet.java index 7a484eed..eaf7f719 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderTracerBullet.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderTracerBullet.java @@ -7,6 +7,7 @@ import twopiradians.minewatch.client.model.ModelTracerBullet; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityTracerBullet; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderTracerBullet extends Render { @@ -23,6 +24,9 @@ protected ResourceLocation getEntityTexture(EntityTracerBullet entity) { @Override public void doRender(EntityTracerBullet entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.scale(0.1F, 0.1F, 0.1F); diff --git a/src/main/java/twopiradians/minewatch/client/render/entity/RenderWidowmakerBullet.java b/src/main/java/twopiradians/minewatch/client/render/entity/RenderWidowmakerBullet.java index 19abad22..ab8900f0 100644 --- a/src/main/java/twopiradians/minewatch/client/render/entity/RenderWidowmakerBullet.java +++ b/src/main/java/twopiradians/minewatch/client/render/entity/RenderWidowmakerBullet.java @@ -7,6 +7,7 @@ import twopiradians.minewatch.client.model.ModelAnaBullet; import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityWidowmakerBullet; +import twopiradians.minewatch.common.entity.ModEntities; public class RenderWidowmakerBullet extends Render { @@ -23,6 +24,9 @@ protected ResourceLocation getEntityTexture(EntityWidowmakerBullet entity) { @Override public void doRender(EntityWidowmakerBullet entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (entity.ticksExisted == 0 && entity.getPersistentID().equals(ModEntities.spawningEntityUUID)) + entity.updateFromPacket(); + GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.scale(0.1F, 0.1F, 0.1F); diff --git a/src/main/java/twopiradians/minewatch/common/config/Config.java b/src/main/java/twopiradians/minewatch/common/config/Config.java index 303010b3..e0766cb0 100644 --- a/src/main/java/twopiradians/minewatch/common/config/Config.java +++ b/src/main/java/twopiradians/minewatch/common/config/Config.java @@ -14,12 +14,16 @@ public class Config { public static final String CATEGORY_HERO_TEXTURES = "config.heroTextures"; + private static final String[] DURABILITY_OPTIONS = new String[] {"Normally", "When not wearing full set", "Never"}; + public static Configuration config; public static boolean useObjModels; public static int tokenDropRate; public static boolean allowGunWarnings; public static boolean customCrosshairs; public static double guiScale; + public static int durabilityOptionArmors; + public static int durabilityOptionWeapons; public static void preInit(final File file) { config = new Configuration(file); @@ -33,22 +37,34 @@ public static void syncConfig() { Property use3DModelsprop = config.get(Configuration.CATEGORY_GENERAL, "Use 3D Item Models", true, "Should the Minewatch weapons use 3D models?"); use3DModelsprop.setRequiresMcRestart(true); useObjModels = use3DModelsprop.getBoolean(); - + Property allowGunWarningsProp = config.get(Configuration.CATEGORY_GENERAL, "Restrict weapon usage", true, "Should weapons only work like in Overwatch: only in the mainhand (with offhand weapons in the offhand). This also prevents weapons from different heroes from being mixed and matched."); allowGunWarnings = allowGunWarningsProp.getBoolean(); - + Property customCrosshairsProp = config.get(Configuration.CATEGORY_GENERAL, "Custom Crosshairs", true, "Should weapons change your crosshair."); customCrosshairs = customCrosshairsProp.getBoolean(); Property tokenDropRateProp = config.get(Configuration.CATEGORY_GENERAL, "Token Drop Rate", 100, "Average number of mobs to kill for one token.", 1, 10000); tokenDropRate = tokenDropRateProp.getInt(); - + Property damageScaleProp = config.get(Configuration.CATEGORY_GENERAL, "Damage Scale", 1d, "1 is the recommended scale for vanilla. A higher scale means weapons do more damage and a lower scale means they do less.", 0, 100); ItemMWWeapon.damageScale = (float) (0.1d * damageScaleProp.getDouble()); - + Property guiScaleProp = config.get(Configuration.CATEGORY_GENERAL, "Gui Scale", 1d, "Scale for the hero and weapon GUI/overlays.", 0, 2); Config.guiScale = guiScaleProp.getDouble(); + Property durabilityArmorsProp = config.get(Configuration.CATEGORY_GENERAL, "Armors use durability", DURABILITY_OPTIONS[0], "Choose when armors should use durability.", DURABILITY_OPTIONS); + for (int i=0; i onItemRightClick(World world, EntityPlayer player player.world.playSound(null, player.posX, player.posY, player.posZ, ModSoundEvents.genjiShoot, SoundCategory.PLAYERS, 1.0f, player.world.rand.nextFloat()/2+0.75f); this.subtractFromCurrentAmmo(player, 3, hand); - if (world.rand.nextInt(25) == 0 && !(ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) == hero)) - player.getHeldItemMainhand().damageItem(1, player); + if (world.rand.nextInt(8) == 0) + player.getHeldItem(hand).damageItem(1, player); if (!player.getCooldownTracker().hasCooldown(this)) player.getCooldownTracker().setCooldown(this, 15); } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMWWeapon.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMWWeapon.java index 274776f6..b1e988a1 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMWWeapon.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMWWeapon.java @@ -25,6 +25,7 @@ import twopiradians.minewatch.common.config.Config; import twopiradians.minewatch.common.hero.Ability; import twopiradians.minewatch.common.hero.EnumHero; +import twopiradians.minewatch.common.item.armor.ItemMWArmor.SetManager; import twopiradians.minewatch.common.potion.ModPotions; import twopiradians.minewatch.packet.SPacketSyncAmmo; @@ -186,6 +187,14 @@ else if (this.getCurrentAmmo((EntityPlayer) entity) > 0 && Minewatch.keys.reload ability.toggled.containsKey(entity.getPersistentID()) && ability.toggled.get(entity.getPersistentID())) ability.toggled.put(entity.getPersistentID(), false); + + // set damage to full if option set to never use durability + if (Config.durabilityOptionWeapons == 2 && stack.getItemDamage() != 0) + stack.setItemDamage(0); + // set damage to full if wearing full set and option set to not use durability while wearing full set + else if (Config.durabilityOptionWeapons == 1 && stack.getItemDamage() != 0 && + SetManager.playersWearingSets.get(entity.getPersistentID()) == hero) + stack.setItemDamage(0); } @Override diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMcCreeGun.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMcCreeGun.java index f9bcb5b2..9d22807d 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMcCreeGun.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMcCreeGun.java @@ -12,7 +12,6 @@ import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityMWThrowable; import twopiradians.minewatch.common.entity.EntityMcCreeBullet; -import twopiradians.minewatch.common.item.armor.ItemMWArmor; import twopiradians.minewatch.common.sound.ModSoundEvents; public class ItemMcCreeGun extends ItemMWWeapon { @@ -40,7 +39,7 @@ public void onItemLeftClick(ItemStack stack, World world, EntityPlayer player, E this.subtractFromCurrentAmmo(player, 1, hand); if (!player.getCooldownTracker().hasCooldown(this)) player.getCooldownTracker().setCooldown(this, 10); - if (world.rand.nextInt(25) == 0 && ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) != hero) + if (world.rand.nextInt(6) == 0) player.getHeldItem(hand).damageItem(1, player); } else { @@ -59,22 +58,26 @@ public ActionResult onItemRightClick(World worldIn, EntityPlayer play @Override public void onUsingTick(ItemStack stack, EntityLivingBase entity, int count) { if (entity instanceof EntityPlayer && count % 2 == 0 && this.canUse((EntityPlayer) entity, true)) { - if (!entity.world.isRemote) { + EnumHand hand = null; + for (EnumHand hand2 : EnumHand.values()) + if (((EntityPlayer)entity).getHeldItem(hand2) == stack) + hand = hand2; + if (!entity.world.isRemote && hand != null) { EntityMcCreeBullet bullet = new EntityMcCreeBullet(entity.world, entity); - bullet.setAim((EntityPlayer) entity, entity.rotationPitch, entity.rotationYaw, 5.0F, 1.5F, 1F, EnumHand.MAIN_HAND, true); + bullet.setAim((EntityPlayer) entity, entity.rotationPitch, entity.rotationYaw, 5.0F, 1.5F, 1F, hand, true); entity.world.spawnEntity(bullet); entity.world.playSound(null, entity.posX, entity.posY, entity.posZ, ModSoundEvents.mccreeShoot, SoundCategory.PLAYERS, entity.world.rand.nextFloat()+0.5F, entity.world.rand.nextFloat()/20+0.95f); if (count == this.getMaxItemUseDuration(stack)) - this.subtractFromCurrentAmmo((EntityPlayer) entity, 1, EnumHand.MAIN_HAND); + this.subtractFromCurrentAmmo((EntityPlayer) entity, 1, hand); else this.subtractFromCurrentAmmo((EntityPlayer) entity, 1); - if (entity.world.rand.nextInt(25) == 0 && ItemMWArmor.SetManager.playersWearingSets.get(entity.getPersistentID()) != hero) - entity.getHeldItemMainhand().damageItem(1, entity); + if (entity.world.rand.nextInt(25) == 0) + entity.getHeldItem(hand).damageItem(1, entity); } - else { + else if (hand != null) { entity.rotationPitch--; - Vec3d vec = EntityMWThrowable.getShootingPos(entity, entity.rotationPitch, entity.rotationYaw, EnumHand.MAIN_HAND); + Vec3d vec = EntityMWThrowable.getShootingPos(entity, entity.rotationPitch, entity.rotationYaw, hand); Minewatch.proxy.spawnParticlesSpark(entity.world, vec.xCoord, vec.yCoord, vec.zCoord, 0xFFEF89, 0x5A575A, 5, 1); } } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMeiBlaster.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMeiBlaster.java index 9d3de7e6..b22be57b 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMeiBlaster.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemMeiBlaster.java @@ -12,7 +12,6 @@ import twopiradians.minewatch.common.entity.EntityMWThrowable; import twopiradians.minewatch.common.entity.EntityMeiBlast; import twopiradians.minewatch.common.entity.EntityMeiIcicle; -import twopiradians.minewatch.common.item.armor.ItemMWArmor; import twopiradians.minewatch.common.sound.ModSoundEvents; public class ItemMeiBlaster extends ItemMWWeapon { @@ -32,7 +31,7 @@ public void onItemLeftClick(ItemStack stack, World world, EntityPlayer player, E world.rand.nextFloat()/2+0.75f); this.subtractFromCurrentAmmo(player, 1); - if (world.rand.nextInt(25) == 0 && ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) != hero) + if (world.rand.nextInt(200) == 0) player.getHeldItem(hand).damageItem(1, player); } } @@ -49,12 +48,12 @@ public ActionResult onItemRightClick(World world, EntityPlayer player player.getCooldownTracker().setCooldown(this, 24); world.playSound(null, player.posX, player.posY, player.posZ, ModSoundEvents.meiIcicleShoot, SoundCategory.PLAYERS, world.rand.nextFloat()+0.5F, world.rand.nextFloat()/20+0.95f); - if (!(ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) == hero)) + if (world.rand.nextInt(8) == 0) player.getHeldItem(hand).damageItem(1, player); this.subtractFromCurrentAmmo(player, 25, hand); } else { - Vec3d vec = EntityMWThrowable.getShootingPos(player, player.rotationPitch, player.rotationYaw, EnumHand.MAIN_HAND); + Vec3d vec = EntityMWThrowable.getShootingPos(player, player.rotationPitch, player.rotationYaw, hand); Minewatch.proxy.spawnParticlesSpark(world, vec.xCoord, vec.yCoord, vec.zCoord, 0x2B9191, 0x2B9191, 3, 3); } } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReaperShotgun.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReaperShotgun.java index 8af6d272..756a32f7 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReaperShotgun.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReaperShotgun.java @@ -78,7 +78,7 @@ public void onItemLeftClick(ItemStack stack, World world, EntityPlayer player, E this.subtractFromCurrentAmmo(player, 1, hand); if (!player.getCooldownTracker().hasCooldown(this)) player.getCooldownTracker().setCooldown(this, 11); - if (world.rand.nextInt(25) == 0 && ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) != hero) + if (world.rand.nextInt(8) == 0) player.getHeldItem(hand).damageItem(1, player); } } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemSoldier76Gun.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemSoldier76Gun.java index 4f4b5d48..6062fc02 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemSoldier76Gun.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemSoldier76Gun.java @@ -66,7 +66,7 @@ public ActionResult onItemRightClick(World world, EntityPlayer player player.getHeldItem(hand).damageItem(1, player); } else { - Vec3d vec = EntityMWThrowable.getShootingPos(player, player.rotationPitch, player.rotationYaw, EnumHand.MAIN_HAND); + Vec3d vec = EntityMWThrowable.getShootingPos(player, player.rotationPitch, player.rotationYaw, hand); Minewatch.proxy.spawnParticlesSpark(world, vec.xCoord, vec.yCoord, vec.zCoord, 0x2B9191, 0x2B9191, 8, 3); } } @@ -129,7 +129,7 @@ public void onItemLeftClick(ItemStack stack, World world, EntityPlayer player, E world.playSound(null, player.posX, player.posY, player.posZ, ModSoundEvents.soldier76Shoot, SoundCategory.PLAYERS, world.rand.nextFloat()+0.5F, world.rand.nextFloat()/20+0.95f); this.subtractFromCurrentAmmo(player, 1); - if (world.rand.nextInt(25) == 0 && !(ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) == hero)) + if (world.rand.nextInt(25) == 0) player.getHeldItem(hand).damageItem(1, player); } else { diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemTracerPistol.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemTracerPistol.java index 2e4375ec..4800cccb 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemTracerPistol.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemTracerPistol.java @@ -13,7 +13,6 @@ import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityMWThrowable; import twopiradians.minewatch.common.entity.EntityTracerBullet; -import twopiradians.minewatch.common.item.armor.ItemMWArmor; import twopiradians.minewatch.common.sound.ModSoundEvents; import twopiradians.minewatch.packet.SPacketSpawnParticle; import twopiradians.minewatch.packet.SPacketTriggerAbility; @@ -38,7 +37,7 @@ public void onItemLeftClick(ItemStack stack, World world, EntityPlayer player, E new TargetPoint(world.provider.getDimension(), player.posX, player.posY, player.posZ, 128)); player.world.playSound(null, player.posX, player.posY, player.posZ, ModSoundEvents.tracerShoot, SoundCategory.PLAYERS, 1.0f, player.world.rand.nextFloat()/20+0.95f); this.subtractFromCurrentAmmo(player, 1); - if (world.rand.nextInt(25) == 0 && ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) != hero) + if (world.rand.nextInt(40) == 0) player.getHeldItem(hand).damageItem(1, player); } } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemWidowmakerRifle.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemWidowmakerRifle.java index 2faa20bf..356ef773 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemWidowmakerRifle.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemWidowmakerRifle.java @@ -27,7 +27,6 @@ import twopiradians.minewatch.common.Minewatch; import twopiradians.minewatch.common.entity.EntityMWThrowable; import twopiradians.minewatch.common.entity.EntityWidowmakerBullet; -import twopiradians.minewatch.common.item.armor.ItemMWArmor; import twopiradians.minewatch.common.sound.ModSoundEvents; public class ItemWidowmakerRifle extends ItemMWWeapon { @@ -107,12 +106,12 @@ public void onItemLeftClick(ItemStack stack, World world, EntityPlayer player, E if (!player.getCooldownTracker().hasCooldown(this)) player.getCooldownTracker().setCooldown(this, 10); this.subtractFromCurrentAmmo(player, 3); - if (player.world.rand.nextInt(25) == 0 && !(ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) == hero)) + if (player.world.rand.nextInt(10) == 0) stack.damageItem(1, player); player.stopActiveHand(); } else { - Vec3d vec = EntityMWThrowable.getShootingPos(player, player.rotationPitch, player.rotationYaw, EnumHand.MAIN_HAND); + Vec3d vec = EntityMWThrowable.getShootingPos(player, player.rotationPitch, player.rotationYaw, hand); Minewatch.proxy.spawnParticlesSpark(player.world, vec.xCoord, vec.yCoord, vec.zCoord, 0xF9394F, 0x5A575A, 5, 1); player.stopActiveHand(); } @@ -125,7 +124,7 @@ else if (!Minewatch.keys.rmb(player) && player.ticksExisted % 2 == 0) { world.spawnEntity(bullet); world.playSound(null, player.posX, player.posY, player.posZ, ModSoundEvents.widowmakerUnscopedShoot, SoundCategory.PLAYERS, world.rand.nextFloat()/2f+0.2f, world.rand.nextFloat()/2+0.75f); this.subtractFromCurrentAmmo(player, 1); - if (world.rand.nextInt(25) == 0 && !(ItemMWArmor.SetManager.playersWearingSets.get(player.getPersistentID()) == hero)) + if (world.rand.nextInt(30) == 0) player.getHeldItem(hand).damageItem(1, player); } else {