lasers now turn entities into confetti

This commit is contained in:
Boblet 2024-12-03 16:40:56 +01:00
parent 3b0fe9c14b
commit 663f08be56
25 changed files with 221 additions and 64 deletions

View File

@ -10,6 +10,7 @@ import com.hbm.entity.projectile.EntityBulletBeamBase;
import com.hbm.interfaces.NotableComments;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
import com.hbm.particle.SpentCasing;
@ -236,6 +237,7 @@ public class BulletConfig implements Cloneable {
EntityLivingBase living = (EntityLivingBase) entity;
EntityDamageUtil.attackEntityFromNT(living, source, bullet.damage, true, false, bullet.config.knockbackMult, bullet.config.armorThresholdNegation, bullet.config.armorPiercingPercent);
if(!living.isEntityAlive()) ConfettiUtil.decideConfetti(living, source);
}
};

View File

@ -0,0 +1,21 @@
package com.hbm.items.weapon.sedna.factory;
import com.hbm.particle.helper.AshesCreator;
import com.hbm.util.DamageResistanceHandler.DamageClass;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
public class ConfettiUtil {
public static void decideConfetti(EntityLivingBase entity, DamageSource source) {
if(source.damageType.equals(DamageClass.LASER.name())) pulverize(entity);
}
public static void pulverize(EntityLivingBase entity) {
if(entity.isEntityAlive()) return;
int amount = MathHelper.clamp_int((int) (entity.width * entity.height * entity.width * 25), 5, 50);
AshesCreator.composeEffect(entity.worldObj, entity, amount, 0.125F);
}
}

View File

@ -22,7 +22,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.SmokeNode;
import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.particle.helper.BlackPowderHelper;
import com.hbm.particle.helper.BlackPowderCreator;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
@ -227,12 +227,12 @@ public class Lego {
if(config.pType == ProjectileType.BULLET) {
EntityBulletBaseMK4 mk4 = new EntityBulletBaseMK4(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
if(ItemGunBaseNT.getIsLockedOn(stack)) mk4.lockonTarget = entity.worldObj.getEntityByID(ItemGunBaseNT.getLockonTarget(stack));
if(i == 0 && config.blackPowder) BlackPowderHelper.composeEffect(entity.worldObj, mk4.posX, mk4.posY, mk4.posZ, mk4.motionX, mk4.motionY, mk4.motionZ, 10, 0.25F, 0.5F, 10, 0.25F);
if(i == 0 && config.blackPowder) BlackPowderCreator.composeEffect(entity.worldObj, mk4.posX, mk4.posY, mk4.posZ, mk4.motionX, mk4.motionY, mk4.motionZ, 10, 0.25F, 0.5F, 10, 0.25F);
entity.worldObj.spawnEntityInWorld(mk4);
} else if(config.pType == ProjectileType.BULLET_CHUNKLOADING) {
EntityBulletBaseMK4CL mk4 = new EntityBulletBaseMK4CL(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
if(ItemGunBaseNT.getIsLockedOn(stack)) mk4.lockonTarget = entity.worldObj.getEntityByID(ItemGunBaseNT.getLockonTarget(stack));
if(i == 0 && config.blackPowder) BlackPowderHelper.composeEffect(entity.worldObj, mk4.posX, mk4.posY, mk4.posZ, mk4.motionX, mk4.motionY, mk4.motionZ, 10, 0.25F, 0.5F, 10, 0.25F);
if(i == 0 && config.blackPowder) BlackPowderCreator.composeEffect(entity.worldObj, mk4.posX, mk4.posY, mk4.posZ, mk4.motionX, mk4.motionY, mk4.motionZ, 10, 0.25F, 0.5F, 10, 0.25F);
entity.worldObj.spawnEntityInWorld(mk4);
} else if(config.pType == ProjectileType.BEAM) {
EntityBulletBeamBase mk4 = new EntityBulletBeamBase(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);

View File

@ -51,16 +51,16 @@ public class XFactory12ga {
public static void init() {
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setBlackPowder(true).setProjectiles(8).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP"));
g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setBlackPowder(true).setProjectiles(4).setSpread(0.05F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_MAGNUM"));
g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setBlackPowder(true).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_SLUG"));
g12 = new BulletConfig().setItem(EnumAmmo.G12).setProjectiles(8).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setBlackPowder(true).setProjectiles(8).setDamage(0.5F/8F).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP"));
g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setBlackPowder(true).setProjectiles(4).setDamage(0.5F/4F).setSpread(0.05F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_MAGNUM"));
g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setBlackPowder(true).setDamage(0.5F).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_SLUG"));
g12 = new BulletConfig().setItem(EnumAmmo.G12).setProjectiles(8).setDamage(1F/8F).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
g12_slug = new BulletConfig().setItem(EnumAmmo.G12_SLUG).setSpread(0.0F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x393939, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_SLUG"));
g12_flechette = new BulletConfig().setItem(EnumAmmo.G12_FLECHETTE).setProjectiles(8).setSpread(0.025F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x3C80F0, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_FLECHETTE"));
g12_magnum = new BulletConfig().setItem(EnumAmmo.G12_MAGNUM).setProjectiles(4).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x278400, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_MAGNUM"));
g12_explosive = new BulletConfig().setItem(EnumAmmo.G12_EXPLOSIVE).setOnImpact(LAMBDA_STANDARD_EXPLODE).setSpread(0F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xDA4127, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_EXPLOSIVE"));
g12_phosphorus = new BulletConfig().setItem(EnumAmmo.G12_PHOSPHORUS).setProjectiles(8).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x910001, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_PHOSPHORUS"));
g12_anthrax = new BulletConfig().setItem(EnumAmmo.G12_ANTHRAX).setProjectiles(8).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x749300, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_ANTHRAX"));
g12_flechette = new BulletConfig().setItem(EnumAmmo.G12_FLECHETTE).setProjectiles(8).setDamage(1F/8F).setSpread(0.025F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x3C80F0, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_FLECHETTE"));
g12_magnum = new BulletConfig().setItem(EnumAmmo.G12_MAGNUM).setProjectiles(4).setDamage(2F/4F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x278400, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_MAGNUM"));
g12_explosive = new BulletConfig().setItem(EnumAmmo.G12_EXPLOSIVE).setDamage(5F).setOnImpact(LAMBDA_STANDARD_EXPLODE).setSpread(0F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xDA4127, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_EXPLOSIVE"));
g12_phosphorus = new BulletConfig().setItem(EnumAmmo.G12_PHOSPHORUS).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x910001, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_PHOSPHORUS"));
g12_anthrax = new BulletConfig().setItem(EnumAmmo.G12_ANTHRAX).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x749300, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_ANTHRAX"));
g12_equestrian = new BulletConfig().setItem(EnumAmmoSecret.G12_EQUESTRIAN).setDamage(0F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_EQUESTRIAN, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12gaEquestrian"));
BulletConfig[] all = new BulletConfig[] {g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus, g12_anthrax};
@ -68,7 +68,7 @@ public class XFactory12ga {
ModItems.gun_maresleg = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(600).draw(10).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(16F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -78,7 +78,7 @@ public class XFactory12ga {
ModItems.gun_maresleg_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE,
new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(16F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
.offset(0.75, -0.0625, 0.1875D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -98,7 +98,7 @@ public class XFactory12ga {
ModItems.gun_maresleg_broken = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(0).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(32F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_NOWEAR_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -109,7 +109,7 @@ public class XFactory12ga {
ModItems.gun_liberator = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(200).draw(20).inspect(21).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).rounds(4).reload(25, 15, 7, 0).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(8F).delay(20).rounds(4).reload(25, 15, 7, 0).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 4).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -120,7 +120,7 @@ public class XFactory12ga {
ModItems.gun_spas12 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
.dmg(32F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 8).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -131,7 +131,7 @@ public class XFactory12ga {
ModItems.gun_autoshotgun = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(2_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(15F).delay(10).auto(true).autoAfterDry(true).dryfireAfterAuto(true).reload(44).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(48F).delay(10).auto(true).autoAfterDry(true).dryfireAfterAuto(true).reload(44).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 20).addConfigs(all))
.offset(0.75, -0.125, -0.25)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -141,7 +141,7 @@ public class XFactory12ga {
ModItems.gun_autoshotgun_sexy = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(5_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(15F).delay(1).auto(true).dryfireAfterAuto(true).reload(44).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(64F).delay(1).auto(true).dryfireAfterAuto(true).reload(44).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 100).addConfigs(g12_equestrian, g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus, g12_anthrax))
.offset(0.75, -0.125, -0.25)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -38,7 +38,7 @@ public class XFactory357 {
ModItems.gun_light_revolver = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(300).draw(4).inspect(23).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(10F).delay(16).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(7.5F).delay(16).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 6).addConfigs(m357_bp, m357_sp, m357_fmj, m357_jhp, m357_ap, m357_express))
.offset(0.75, -0.0625, -0.3125D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -49,7 +49,7 @@ public class XFactory357 {
ModItems.gun_light_revolver_dani = new ItemGunBaseNT(WeaponQuality.LEGENDARY,
new GunConfig().dura(30_000).draw(20).inspect(23).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(10F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(15F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 6).addConfigs(m357_bp, m357_sp, m357_fmj, m357_jhp, m357_ap, m357_express))
.offset(0.75, -0.0625, 0.3125D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -58,7 +58,7 @@ public class XFactory357 {
.anim(LAMBDA_DANI_ANIMS).orchestra(Orchestras.ORCHESTRA_DANI),
new GunConfig().dura(30_000).draw(20).inspect(23).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(10F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(15F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(1, 6).addConfigs(m357_bp, m357_sp, m357_fmj, m357_jhp, m357_ap, m357_express))
.offset(0.75, -0.0625, -0.3125D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -148,7 +148,7 @@ public class XFactory40mm {
ModItems.gun_congolake = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(400).draw(7).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCUMFLEX).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(30F).delay(24).reload(16, 16, 16, 0).jam(0).sound("hbm:weapon.glShoot", 1.0F, 1.0F)
.dmg(20F).delay(24).reload(16, 16, 16, 0).jam(0).sound("hbm:weapon.glShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 4).addConfigs(g40_he, g40_heat, g40_demo, g40_inc))
.offset(0.75, -0.0625, -0.1875D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -59,7 +59,7 @@ public class XFactory44 {
ModItems.gun_henry = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(300).draw(15).inspect(23).reloadSequential(true).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(25, 11, 14, 8).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(10F).delay(20).reload(25, 11, 14, 8).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 14).addConfigs(m44_bp, m44_sp, m44_fmj, m44_jhp, m44_ap, m44_express))
.offset(0.75, -0.0625, -0.1875D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -70,7 +70,7 @@ public class XFactory44 {
ModItems.gun_heavy_revolver = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(600).draw(10).inspect(23).crosshair(Crosshair.L_CLASSIC).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(10F).delay(14).reload(46).jam(23).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.dmg(15F).delay(14).reload(46).jam(23).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 6).addConfigs(m44_bp, m44_sp, m44_fmj, m44_jhp, m44_ap, m44_express))
.offset(0.75, -0.0625, -0.3125D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -80,7 +80,7 @@ public class XFactory44 {
ModItems.gun_heavy_revolver_lilmac = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(31_000).draw(10).inspect(23).crosshair(Crosshair.L_CLASSIC).scopeTexture(scope_lilmac).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(10F).delay(14).reload(46).jam(23).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.dmg(30F).delay(14).reload(46).jam(23).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 6).addConfigs(m44_equestrian, m44_bp, m44_sp, m44_fmj, m44_jhp, m44_ap, m44_express))
.offset(0.75, -0.0625, -0.3125D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -91,7 +91,7 @@ public class XFactory44 {
ModItems.gun_hangman = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(600).draw(10).inspect(31).inspectCancel(false).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(10F).delay(10).reload(46).jam(23).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.dmg(25F).delay(10).reload(46).jam(23).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 8).addConfigs(m44_bp, m44_sp, m44_fmj, m44_jhp, m44_ap, m44_express))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -46,7 +46,7 @@ public class XFactory50 {
ModItems.gun_m2 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(10).inspect(31).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(5F).delay(2).dry(10).auto(true).spread(0.005F).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(7.5F).delay(2).dry(10).auto(true).spread(0.005F).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineBelt().addConfigs(bmg50_sp, bmg50_fmj, bmg50_jhp, bmg50_ap, bmg50_du))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -47,7 +47,7 @@ public class XFactory556mm {
ModItems.gun_g3 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(10).inspect(33).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(15F).delay(2).auto(true).dry(15).spread(0.0F).reload(50).jam(47).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(5F).delay(2).auto(true).dry(15).spread(0.0F).reload(50).jam(47).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(r556_sp, r556_fmj, r556_jhp, r556_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -58,7 +58,7 @@ public class XFactory556mm {
ModItems.gun_stg77 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(10).inspect(125).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(15F).delay(2).dry(15).auto(true).spread(0.0F).reload(46).jam(0).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(10F).delay(2).dry(15).auto(true).spread(0.0F).reload(46).jam(0).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(r556_sp, r556_fmj, r556_jhp, r556_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -40,7 +40,7 @@ public class XFactory75Bolt {
ModItems.gun_bolter = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(20).inspect(31).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(5F).delay(2).auto(true).spread(0.005F).reload(40).jam(55).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(15F).delay(2).auto(true).spread(0.005F).reload(40).jam(55).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(b75, b75_inc, b75_exp))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -55,7 +55,7 @@ public class XFactory762mm {
ModItems.gun_carbine = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(10).inspect(31).reloadSequential(true).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(5F).delay(5).dry(15).spread(0.0F).reload(30, 0, 15, 0).jam(60).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(15F).delay(5).dry(15).spread(0.0F).reload(30, 0, 15, 0).jam(60).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 14).addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -66,7 +66,7 @@ public class XFactory762mm {
ModItems.gun_minigun = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(50_000).draw(20).inspect(20).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(10F).delay(1).auto(true).dry(15).spread(0.01F).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(6F).delay(1).auto(true).dry(15).spread(0.01F).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineBelt().addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -76,7 +76,7 @@ public class XFactory762mm {
ModItems.gun_minigun_lacunae = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(50_000).draw(20).inspect(20).crosshair(Crosshair.L_CIRCLE)
.rec(new Receiver(0)
.dmg(10F).delay(1).auto(true).dry(15).reload(15).spread(0.01F).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(12F).delay(1).auto(true).dry(15).reload(15).spread(0.01F).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 200).addConfigs(energy_lacunae, energy_lacunae_overcharge))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -45,7 +45,7 @@ public class XFactory9mm {
ModItems.gun_greasegun = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(20).inspect(31).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(5F).delay(4).dry(40).auto(true).spread(0.015F).reload(60).jam(55).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(3F).delay(4).dry(40).auto(true).spread(0.015F).reload(60).jam(55).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -56,7 +56,7 @@ public class XFactory9mm {
ModItems.gun_lag = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(1_700).draw(15).inspect(31).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(15F).delay(4).dry(40).spread(0.005F).reload(60).jam(55).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(25F).delay(4).dry(40).spread(0.005F).reload(60).jam(55).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 17).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -67,7 +67,7 @@ public class XFactory9mm {
ModItems.gun_uzi = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(15).inspect(31).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(7.5F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(3F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -77,7 +77,7 @@ public class XFactory9mm {
ModItems.gun_uzi_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE,
new GunConfig().dura(3_000).draw(15).inspect(31).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(7.5F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(3F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
.offset(1, -0.0625 * 2.5, 0.375D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -95,7 +95,7 @@ public class XFactoryAccelerator {
ModItems.gun_tau = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(6_400).draw(10).inspect(10).crosshair(Crosshair.CIRCLE)
.rec(new Receiver(0)
.dmg(10F).delay(4).auto(true).spread(0F)
.dmg(25F).delay(4).auto(true).spread(0F)
.mag(new MagazineBelt().addConfigs(tau_uranium))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -111,7 +111,7 @@ public class XFactoryAccelerator {
ModItems.gun_coilgun = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(400).draw(5).inspect(39).crosshair(Crosshair.L_CIRCUMFLEX)
.rec(new Receiver(0)
.dmg(15F).delay(5).reload(20).jam(33).sound("hbm:weapon.coilgunShoot", 1.0F, 1.0F)
.dmg(35F).delay(5).reload(20).jam(33).sound("hbm:weapon.coilgunShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 1).addConfigs(coil_tungsten, coil_ferrouranium))
.offset(0.75, -0.0625, -0.1875D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -139,7 +139,7 @@ public class XFactoryCatapult {
ModItems.gun_fatman = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(300).draw(20).inspect(30).crosshair(Crosshair.L_CIRCUMFLEX).hideCrosshair(false)
.rec(new Receiver(0)
.dmg(25F).delay(10).reload(57).jam(40).sound("hbm:weapon.fire.fatman", 1.0F, 1.0F)
.dmg(100F).delay(10).reload(57).jam(40).sound("hbm:weapon.fire.fatman", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 1).addConfigs(nuke_standard, nuke_demo, nuke_high, nuke_tots, nuke_hive))
.offset(1, -0.0625 * 1.5, -0.1875D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -98,7 +98,7 @@ public class XFactoryEnergy {
ModItems.gun_tesla_cannon = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(2_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.CIRCLE)
.rec(new Receiver(0)
.dmg(15F).delay(20).reload(44).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(35F).delay(20).reload(44).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineBelt().addConfigs(energy_tesla, energy_tesla_overcharge))
.offset(0.75, 0, -0.375)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -109,7 +109,7 @@ public class XFactoryEnergy {
ModItems.gun_lasrifle = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(2_000).draw(10).inspect(26).reloadSequential(true).crosshair(Crosshair.CIRCLE).scopeTexture(scope_luna)
.rec(new Receiver(0)
.dmg(15F).delay(8).reload(44).jam(36).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(50F).delay(8).reload(44).jam(36).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 24).addConfigs(energy_las, energy_las_overcharge))
.offset(0.75, -0.0625 * 1.5, -0.1875)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -134,7 +134,7 @@ public class XFactoryFlamer {
ModItems.gun_flamer = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(20_000).draw(10).inspect(17).crosshair(Crosshair.L_CIRCLE)
.rec(new Receiver(0)
.dmg(10F).delay(1).auto(true).reload(90).jam(17)
.dmg(1F).delay(1).auto(true).reload(90).jam(17)
.mag(new MagazineFullReload(0, 300).addConfigs(flame_diesel, flame_gas, flame_napalm, flame_balefire))
.offset(0.75, -0.0625, -0.25D)
.setupStandardFire())
@ -144,7 +144,7 @@ public class XFactoryFlamer {
ModItems.gun_flamer_topaz = new ItemGunBaseNT(WeaponQuality.B_SIDE, new GunConfig()
.dura(20_000).draw(10).inspect(17).crosshair(Crosshair.L_CIRCLE)
.rec(new Receiver(0)
.dmg(10F).delay(1).auto(true).reload(90).jam(17)
.dmg(1.5F).delay(1).auto(true).reload(90).jam(17)
.mag(new MagazineFullReload(0, 500).addConfigs(flame_topaz_diesel, flame_topaz_gas, flame_topaz_napalm, flame_topaz_balefire))
.offset(0.75, -0.0625, -0.25D)
.setupStandardFire())
@ -154,7 +154,7 @@ public class XFactoryFlamer {
ModItems.gun_flamer_daybreaker = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(20_000).draw(10).inspect(17).crosshair(Crosshair.L_CIRCLE)
.rec(new Receiver(0)
.dmg(10F).delay(10).auto(true).reload(90).jam(17).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(25F).delay(10).auto(true).reload(90).jam(17).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 50).addConfigs(flame_daybreaker_diesel, flame_daybreaker_gas, flame_daybreaker_napalm, flame_daybreaker_balefire))
.offset(0.75, -0.0625, -0.25D)
.setupStandardFire())

View File

@ -102,7 +102,7 @@ public class XFactoryFolly {
ModItems.gun_folly = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(0).draw(40).crosshair(Crosshair.NONE)
.rec(new Receiver(0)
.dmg(15F).delay(26).dryfire(false).reload(160).jam(0).sound("hbm:weapon.fire.loudestNoiseOnEarth", 100.0F, 1.0F)
.dmg(1_000F).delay(26).dryfire(false).reload(160).jam(0).sound("hbm:weapon.fire.loudestNoiseOnEarth", 100.0F, 1.0F)
.mag(new MagazineSingleReload(0, 1).addConfigs(folly_sm, folly_nuke))
.offset(0.75, -0.0625, -0.1875D)
.canFire(LAMBDA_CAN_FIRE).fire(LAMBDA_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -160,7 +160,7 @@ public class XFactoryRocket {
ModItems.gun_stinger = new ItemGunStinger(WeaponQuality.A_SIDE, new GunConfig()
.dura(300).draw(7).inspect(40).crosshair(Crosshair.L_BOX_OUTLINE)
.rec(new Receiver(0)
.dmg(25F).delay(5).reload(50).jam(40).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
.dmg(35F).delay(5).reload(50).jam(40).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 1).addConfigs(rocket_rpzb))
.offset(1, -0.0625 * 1.5, -0.1875D)
.setupLockonFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -171,7 +171,7 @@ public class XFactoryRocket {
ModItems.gun_quadro = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(400).draw(7).inspect(40).crosshair(Crosshair.L_CIRCUMFLEX).hideCrosshair(false)
.rec(new Receiver(0)
.dmg(25F).delay(10).reload(55).jam(40).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
.dmg(40F).delay(10).reload(55).jam(40).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 4).addConfigs(rocket_qd))
.offset(1, -0.0625 * 1.5, -0.1875D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -182,7 +182,7 @@ public class XFactoryRocket {
ModItems.gun_missile_launcher = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(500).draw(20).inspect(40).crosshair(Crosshair.L_CIRCUMFLEX).hideCrosshair(false)
.rec(new Receiver(0)
.dmg(25F).delay(5).reload(48).jam(33).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
.dmg(50F).delay(5).reload(48).jam(33).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 1).addConfigs(rocket_ml))
.offset(1, -0.0625 * 1.5, -0.1875D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))

View File

@ -2037,21 +2037,14 @@ public class ClientProxy extends ServerProxy {
}
}
private HashMap<Integer, Long> vanished = new HashMap();
public void vanish(int ent) {
vanished.put(ent, System.currentTimeMillis() + 2000);
}
private static HashMap<Integer, Long> vanished = new HashMap();
public static void vanish(int ent) { vanished.put(ent, System.currentTimeMillis() + 2000); }
public static void vanish(int ent, int duration) { vanished.put(ent, System.currentTimeMillis() + duration); }
@Override
public boolean isVanished(Entity e) {
if(e == null)
return false;
if(!this.vanished.containsKey(e.getEntityId()))
return false;
if(e == null) return false;
if(!this.vanished.containsKey(e.getEntityId())) return false;
return this.vanished.get(e.getEntityId()) > System.currentTimeMillis();
}

View File

@ -1313,6 +1313,7 @@ public class ModEventHandlerClient {
public static IIcon particleBase;
public static IIcon particleLeaf;
public static IIcon particleSplash;
public static IIcon particleAshes;
@SubscribeEvent
public void onTextureStitch(TextureStitchEvent.Pre event) {
@ -1321,6 +1322,7 @@ public class ModEventHandlerClient {
particleBase = event.map.registerIcon(RefStrings.MODID + ":particle/particle_base");
particleLeaf = event.map.registerIcon(RefStrings.MODID + ":particle/dead_leaf");
particleSplash = event.map.registerIcon(RefStrings.MODID + ":particle/particle_splash");
particleAshes = event.map.registerIcon(RefStrings.MODID + ":particle/particle_ashes");
}
}

View File

@ -0,0 +1,87 @@
package com.hbm.particle;
import com.hbm.main.ModEventHandlerClient;
import com.hbm.util.Vec3NT;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class ParticleAshes extends EntityFXRotating {
public ParticleAshes(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
particleIcon = ModEventHandlerClient.particleBase;
this.particleMaxAge = 200 + rand.nextInt(15);
this.particleScale = scale * 0.9F + rand.nextFloat() * 0.2F;
this.particleGravity = 0.01F;
this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.1F + 0.1F;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.particleAge++;
if(this.particleAge >= this.particleMaxAge) {
this.setDead();
}
this.motionY -= particleGravity;
this.prevRotationPitch = this.rotationPitch;
if(!this.onGround) this.rotationPitch += 2 * ((this.getEntityId() % 2) - 0.5);
this.motionX *= 0.95D;
this.motionY *= 0.99D;
this.motionZ *= 0.95D;
boolean wasOnGround = this.onGround;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if(!wasOnGround && this.onGround) this.rotationPitch = rand.nextFloat() * 360F;
if(this.getEntityId() % 5 == 0 && this.onGround && rand.nextInt(15) == 0) {
worldObj.spawnParticle("smoke", posX, posY + 0.125, posZ, 0, 0.05, 0);
}
}
@Override
public void renderParticle(Tessellator tess, float interp, float sX, float sY, float sZ, float dX, float dZ) {
float timeLeft = this.particleMaxAge - (this.particleAge + interp);
if(timeLeft < 40) {
this.particleAlpha = timeLeft / 40F;
} else {
this.particleAlpha = 1F;
}
tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
tess.setNormal(0.0F, 1.0F, 0.0F);
if(this.onGround) {
float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX);
float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY);
float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ);
Vec3NT vec = new Vec3NT(particleScale, 0, particleScale).rotateAroundYDeg(this.rotationPitch);
tess.addVertexWithUV(pX + vec.xCoord, pY + 0.05, pZ + vec.zCoord, particleIcon.getMaxU(), particleIcon.getMaxV());
vec.rotateAroundYDeg(-90);
tess.addVertexWithUV(pX + vec.xCoord, pY + 0.05, pZ + vec.zCoord, particleIcon.getMaxU(), particleIcon.getMinV());
vec.rotateAroundYDeg(-90);
tess.addVertexWithUV(pX + vec.xCoord, pY + 0.05, pZ + vec.zCoord, particleIcon.getMinU(), particleIcon.getMinV());
vec.rotateAroundYDeg(-90);
tess.addVertexWithUV(pX + vec.xCoord, pY + 0.05, pZ + vec.zCoord, particleIcon.getMinU(), particleIcon.getMaxV());
} else {
renderParticleRotated(tess, interp, sX, sY, sZ, dX, dZ, this.particleScale);
}
}
}

View File

@ -0,0 +1,51 @@
package com.hbm.particle.helper;
import java.util.Random;
import com.hbm.main.ClientProxy;
import com.hbm.particle.ParticleAshes;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFlameFX;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class AshesCreator implements IParticleCreator {
public static void composeEffect(World world, Entity toPulverize, int ashesCount, float ashesScale) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "ashes");
data.setInteger("entityID", toPulverize.getEntityId());
data.setInteger("ashesCount", ashesCount);
data.setFloat("ashesScale", ashesScale);
IParticleCreator.sendPacket(world, toPulverize.posX, toPulverize.posY, toPulverize.posZ, 100, data);
}
@Override
public void makeParticle(World world, EntityPlayer player, TextureManager texman, Random rand, double x, double y, double z, NBTTagCompound data) {
int entityID = data.getInteger("entityID");
Entity entity = world.getEntityByID(entityID);
if(entity == null) return;
ClientProxy.vanish(entityID);
int amount = data.getInteger("ashesCount");
float scale = data.getFloat("ashesScale");
for(int i = 0; i < amount; i++) {
ParticleAshes particle = new ParticleAshes(world,
entity.posX + (entity.width + scale * 2) * (rand.nextDouble() - 0.5),
entity.posY + entity.height * rand.nextDouble(),
entity.posZ + (entity.width + scale * 2) * (rand.nextDouble() - 0.5),
scale);
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
EntityFlameFX flame = new EntityFlameFX(world, particle.posX, particle.posY, particle.posZ, 0.0, 0.0, 0.0);
Minecraft.getMinecraft().effectRenderer.addEffect(flame);
}
}
}

View File

@ -14,7 +14,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class BlackPowderHelper implements IParticleCreator {
public class BlackPowderCreator implements IParticleCreator {
public static void composeEffect(World world, double x, double y, double z, double headingX, double headingY, double headingZ, int cloudCount, float cloudScale, float cloudSpeedMult, int sparkCount, float sparkSpeedMult) {

View File

@ -11,6 +11,7 @@ public class ParticleCreators {
particleCreators.put("casingNT", new CasingCreator());
particleCreators.put("flamethrower", new FlameCreator());
particleCreators.put("explosionSmall", new ExplosionSmallCreator());
particleCreators.put("blackPowder", new BlackPowderHelper());
particleCreators.put("blackPowder", new BlackPowderCreator());
particleCreators.put("ashes", new AshesCreator());
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B