Merge remote-tracking branch 'upstream/master' into Optimization

# Conflicts:
#	src/main/java/com/hbm/main/ResourceManager.java
This commit is contained in:
BallOfEnergy 2024-11-09 17:09:17 -06:00
commit 9409fba056
39 changed files with 6048 additions and 5223 deletions

View File

@ -51,6 +51,7 @@
* Existing oily coal can be mined risk-free
* Reeds rendering into water can now be toggled with the RENDER_REEDS client config
* This option is usually enabled by default, unless Angelica is installed
* Microwave explosions no longer destroy blocks, only the microwave and nearby players
## Fixed
* The conveyor grabber should no longer skip over items when used in long lines

View File

@ -9,6 +9,7 @@ import com.hbm.inventory.material.Mats;
import static com.hbm.inventory.OreDictManager.*;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ItemEnums.EnumCasingType;
import com.hbm.items.food.ItemConserve.EnumFoodType;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import com.hbm.items.ModItems;
@ -32,6 +33,10 @@ public class WeaponRecipes {
//SEDNA Parts
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_stock, 1, Mats.MAT_WOOD.id), new Object[] { "WWW", " W", 'W', KEY_PLANKS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_WOOD.id), new Object[] { "W ", " W", " W", 'W', KEY_PLANKS });
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.casing, EnumCasingType.SHOTSHELL, 2), new Object[] { "P", "C", 'P', GUNMETAL.plate(), 'C', DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE) });
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.casing, EnumCasingType.BUCKSHOT, 2), new Object[] { "P", "C", 'P', ANY_PLASTIC.ingot(), 'C', DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE) });
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.casing, EnumCasingType.BUCKSHOT_ADVANCED, 2), new Object[] { "P", "C", 'P', ANY_PLASTIC.ingot(), 'C', DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE_STEEL) });
//SEDNA Guns
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_pepperbox, 1), new Object[] { "IIW", " C", 'I', IRON.ingot(), 'W', KEY_PLANKS, 'C', CU.ingot() });

View File

@ -20,7 +20,7 @@ import net.minecraft.world.World;
public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpawnData {
protected EntityLivingBase thrower;
public EntityLivingBase thrower;
public BulletConfig config;
public float damage;
public double headingX;

View File

@ -13,6 +13,7 @@ import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.container.ContainerMachineAmmoPress;
import com.hbm.inventory.recipes.AmmoPressRecipes;
import com.hbm.inventory.recipes.AmmoPressRecipes.AmmoPressRecipe;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toserver.NBTControlPacket;
@ -254,7 +255,7 @@ public class GUIMachineAmmoPress extends GuiInfoContainer {
if(stack == null) continue;
if(press.slots[i] != null) continue;
List<ItemStack> inputs = stack.extractForNEI();
ItemStack input = inputs.get((int) (Math.abs(System.currentTimeMillis() / 1000) % inputs.size()));
ItemStack input = inputs.size() <= 0 ? new ItemStack(ModItems.nothing) : inputs.get((int) (Math.abs(System.currentTimeMillis() / 1000) % inputs.size()));
RenderHelper.enableGUIStandardItemLighting();
GL11.glDisable(GL11.GL_LIGHTING);

View File

@ -102,7 +102,7 @@ public class Mats {
public static final NTMMaterial MAT_COPPER = makeSmeltable(2900, CU, 0xFDCA88, 0x601E0D, 0xC18336).setAutogen(FRAGMENT, WIRE, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_TUNGSTEN = makeSmeltable(7400, W, 0x868686, 0x000000, 0x977474).setAutogen(FRAGMENT, WIRE, BOLT, DUST, DENSEWIRE, CASTPLATE, WELDEDPLATE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_ALUMINIUM = makeSmeltable(1300, AL, 0xFFFFFF, 0x344550, 0xD0B8EB).setAutogen(FRAGMENT, WIRE, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_LEAD = makeSmeltable(8200, PB, 0xA6A6B2, 0x03030F, 0x646470).setAutogen(FRAGMENT, NUGGET, WIRE, DUST, PLATE, CASTPLATE, PIPE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_LEAD = makeSmeltable(8200, PB, 0xA6A6B2, 0x03030F, 0x646470).setAutogen(FRAGMENT, NUGGET, WIRE, BOLT, DUST, PLATE, CASTPLATE, PIPE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_BISMUTH = makeSmeltable(8300, BI, 0xB200FF, 0xB200FF, 0xB200FF).setAutogen(FRAGMENT, NUGGET, BILLET, DUST, BLOCK).m();
public static final NTMMaterial MAT_ARSENIC = makeSmeltable(3300, AS, 0x6CBABA, 0x242525, 0x558080).setAutogen(NUGGET).m();
public static final NTMMaterial MAT_TANTALIUM = makeSmeltable(7300, TA, 0xFFFFFF, 0x1D1D36, 0xA89B74).setAutogen(NUGGET, DUST, BLOCK).m();

View File

@ -29,12 +29,16 @@ public class AmmoPressRecipes extends SerializableRecipe {
public void registerDefaults() {
OreDictStack lead = new OreDictStack(PB.ingot());
OreDictStack nugget = new OreDictStack(PB.nugget());
OreDictStack flechette = new OreDictStack(PB.bolt());
OreDictStack steel = new OreDictStack(STEEL.ingot());
OreDictStack wSteel = new OreDictStack(WEAPONSTEEL.ingot());
OreDictStack copper = new OreDictStack(CU.ingot());
OreDictStack plastic = new OreDictStack(ANY_PLASTIC.ingot());
OreDictStack uranium = new OreDictStack(U238.ingot());
OreDictStack smokeless = new OreDictStack(ANY_SMOKELESS.dust());
OreDictStack he = new OreDictStack(ANY_HIGHEXPLOSIVE.ingot());
OreDictStack wp = new OreDictStack(P_WHITE.ingot());
ComparableStack cSmall = new ComparableStack(ModItems.casing, 1, EnumCasingType.SMALL);
ComparableStack cBig = new ComparableStack(ModItems.casing, 1, EnumCasingType.LARGE);
ComparableStack sSmall = new ComparableStack(ModItems.casing, 1, EnumCasingType.SMALL_STEEL);
@ -177,6 +181,44 @@ public class AmmoPressRecipes extends SerializableRecipe {
null, uranium.copy(2), null,
null, smokeless.copy(6), null,
null, sBig, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_BP, 6),
null, nugget.copy(6), null,
null, smokeless, null,
null, bpShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_BP_MAGNUM, 6),
null, nugget.copy(8), null,
null, smokeless, null,
null, bpShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_BP_SLUG, 6),
null, lead, null,
null, smokeless, null,
null, bpShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12, 6),
null, nugget.copy(6), null,
null, smokeless, null,
null, pShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_SLUG, 6),
null, lead, null,
null, smokeless, null,
null, pShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_FLECHETTE, 6),
null, flechette.copy(12), null,
null, smokeless, null,
null, pShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_MAGNUM, 6),
null, nugget.copy(8), null,
null, smokeless, null,
null, sShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_EXPLOSIVE, 6),
null, he, null,
null, smokeless, null,
null, sShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_PHOSPHORUS, 6),
null, wp, null,
null, smokeless, null,
null, sShell, null));
}
@Override

View File

@ -1624,6 +1624,7 @@ public class ModItems {
public static Item gun_missile_launcher;
public static Item gun_tesla_cannon;
public static Item gun_stg77;
public static Item gun_tau;
public static Item ammo_standard;
@ -6985,6 +6986,7 @@ public class ModItems {
GameRegistry.registerItem(gun_missile_launcher, gun_missile_launcher.getUnlocalizedName());
GameRegistry.registerItem(gun_tesla_cannon, gun_tesla_cannon.getUnlocalizedName());
GameRegistry.registerItem(gun_stg77, gun_stg77.getUnlocalizedName());
GameRegistry.registerItem(gun_tau, gun_tau.getUnlocalizedName());
GameRegistry.registerItem(ammo_standard, ammo_standard.getUnlocalizedName());

View File

@ -72,6 +72,7 @@ public class BulletConfig implements Cloneable {
public boolean isSpectral = false;
public int selfDamageDelay = 2;
public boolean blackPowder = false;
public boolean renderRotations = true;
public SpentCasing casing;
public BiConsumer<EntityBulletBaseMK4, Float> renderer;
@ -111,6 +112,7 @@ public class BulletConfig implements Cloneable {
public BulletConfig setDoesPenetrate(boolean pen) { this.doesPenetrate = pen; return this; }
public BulletConfig setSpectral(boolean spectral) { this.isSpectral = spectral; return this; }
public BulletConfig setSelfDamageDelay(int delay) { this.selfDamageDelay = delay; return this; }
public BulletConfig setBlackPowder(boolean bp) { this.blackPowder = bp; return this; }
public BulletConfig setRenderRotations(boolean rot) { this.renderRotations = rot; return this; }
public BulletConfig setCasing(SpentCasing casing) { this.casing = casing; return this; }
@ -209,6 +211,31 @@ public class BulletConfig implements Cloneable {
}
};
public static BiConsumer<EntityBulletBeamBase, MovingObjectPosition> LAMBDA_BEAM_HIT = (beam, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
Entity entity = mop.entityHit;
if(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0) return;
DamageSource damageCalc = beam.config.getDamage(beam, beam.thrower, false);
if(!(entity instanceof EntityLivingBase)) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, damageCalc, beam.damage);
return;
}
EntityLivingBase living = (EntityLivingBase) entity;
if(beam.config.armorPiercingPercent == 0) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, damageCalc, beam.damage);
} else {
DamageSource damagePiercing = beam.config.getDamage(beam, beam.thrower, true);
EntityDamageUtil.attackArmorPiercing(living, damageCalc, damagePiercing, beam.damage, beam.config.armorPiercingPercent);
}
}
};
@Override
public BulletConfig clone() {
try {

View File

@ -137,21 +137,7 @@ public class Receiver {
return this;
}
public Receiver setupStandardFire() {
return this
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE)
.fire(Lego.LAMBDA_STANDARD_FIRE);
}
public Receiver setupBeamFire() {
return this
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE)
.fire(Lego.LAMBDA_BEAM_FIRE);
}
public Receiver setupLockonFire() {
return this
.canFire(Lego.LAMBDA_LOCKON_CAN_FIRE)
.fire(Lego.LAMBDA_STANDARD_FIRE);
}
public Receiver setupStandardFire() { return this.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE) .fire(Lego.LAMBDA_STANDARD_FIRE); }
public Receiver setupBeamFire() { return this.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE) .fire(Lego.LAMBDA_BEAM_FIRE); }
public Receiver setupLockonFire() { return this.canFire(Lego.LAMBDA_LOCKON_CAN_FIRE) .fire(Lego.LAMBDA_STANDARD_FIRE); }
}

View File

@ -59,6 +59,7 @@ public class GunFactory {
XFactory556mm.init();
XFactory50.init();
XFactoryEnergy.init();
XFactoryAccelerator.init();
/// PROXY BULLSHIT ///
MainRegistry.proxy.registerGunCfg();
@ -79,6 +80,7 @@ public class GunFactory {
ROCKET_HE, ROCKET_HEAT, ROCKET_DEMO, ROCKET_INC, ROCKET_PHOSPHORUS,
FLAME_DIESEL, FLAME_GAS, FLAME_NAPALM, FLAME_BALEFIRE,
CAPACITOR, CAPACITOR_OVERCHARGE, CAPACITOR_BLACKLIGHTNING,
TAU_URANIUM,
M44_EQUESTRIAN, G12_EQUESTRIAN, BMG50_EQUESTRIAN
}
}

View File

@ -10,6 +10,7 @@ import static com.hbm.items.weapon.sedna.factory.XFactory50.*;
import static com.hbm.items.weapon.sedna.factory.XFactory556mm.*;
import static com.hbm.items.weapon.sedna.factory.XFactory762mm.*;
import static com.hbm.items.weapon.sedna.factory.XFactory9mm.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryAccelerator.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryBlackPowder.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryEnergy.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryRocket.*;
@ -62,6 +63,7 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_missile_launcher, new ItemRenderMissileLauncher());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_tesla_cannon, new ItemRenderTeslaCannon());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_stg77, new ItemRenderSTG77());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_tau, new ItemRenderTau());
//PROJECTILES
ammo_debug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
ammo_debug_buckshot.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
@ -134,6 +136,8 @@ public class GunFactoryClient {
setRendererBulk(LegoClient.RENDER_ML, rocket_ml);
setRendererBulkBeam(LegoClient.RENDER_LIGHTNING, energy_tesla, energy_tesla_overcharge);
setRendererBulkBeam(LegoClient.RENDER_TAU, tau_uranium);
setRendererBulkBeam(LegoClient.RENDER_TAU_CHARGE, tau_uranium_charge);
//HUDS
((ItemGunBaseNT) ModItems.gun_debug) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_pepperbox) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
@ -165,6 +169,7 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_missile_launcher) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_tesla_cannon) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_stg77) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_tau) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_light_revolver_dani) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_light_revolver_dani) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);

View File

@ -20,6 +20,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.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
@ -221,6 +222,7 @@ public class Lego {
float spread = calcSpread(ctx, stack, primary, calcWear, index, aim);
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);
entity.worldObj.spawnEntityInWorld(mk4);
}

View File

@ -246,4 +246,52 @@ public class LegoClient {
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorOuter, colorOuter, bullet.ticksExisted / 2, (int)(bullet.beamLength / 2 + 1), (float)scale * 7F, 2, 0.0625F);
GL11.glPopMatrix();
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_TAU = (bullet, interp) -> {
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
GL11.glPushMatrix();
GL11.glRotatef(180 - bullet.rotationYaw, 0, 1F, 0);
GL11.glRotatef(-bullet.rotationPitch - 90, 1F, 0, 0);
GL11.glPushMatrix();
Vec3 delta = Vec3.createVectorHelper(0, bullet.beamLength, 0);
GL11.glScaled(age / 2 + 0.5, 1, age / 2 + 0.5);
double scale = 0.075D;
int colorInner = ((int)(0x30 * age) << 16) | ((int)(0x25 * age) << 8) | (int) (0x10 * age);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorInner, colorInner, (bullet.ticksExisted + bullet.getEntityId()) / 2, (int)(bullet.beamLength / 2 + 1), (float)scale * 4F, 2, 0.0625F);
GL11.glPopMatrix();
GL11.glScaled(age * 2, 1, age * 2);
GL11.glTranslated(0, bullet.beamLength, 0);
GL11.glRotatef(-90, 0, 0, 1);
renderBulletStandard(Tessellator.instance, 0xFFBF00, 0xFFFFFF, bullet.beamLength, true);
GL11.glPopMatrix();
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_TAU_CHARGE = (bullet, interp) -> {
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
GL11.glPushMatrix();
GL11.glRotatef(180 - bullet.rotationYaw, 0, 1F, 0);
GL11.glRotatef(-bullet.rotationPitch - 90, 1F, 0, 0);
GL11.glPushMatrix();
Vec3 delta = Vec3.createVectorHelper(0, bullet.beamLength, 0);
GL11.glScaled(age / 2 + 0.5, 1, age / 2 + 0.5);
double scale = 0.075D;
int colorInner = ((int)(0x60 * age) << 16) | ((int)(0x50 * age) << 8) | (int) (0x30 * age);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorInner, colorInner, (bullet.ticksExisted + bullet.getEntityId()) / 2, (int)(bullet.beamLength / 2 + 1), (float)scale * 4F, 2, 0.0625F);
GL11.glPopMatrix();
GL11.glScaled(age * 2, 1, age * 2);
GL11.glTranslated(0, bullet.beamLength, 0);
GL11.glRotatef(-90, 0, 0, 1);
renderBulletStandard(Tessellator.instance, 0xFFF0A0, 0xFFFFFF, bullet.beamLength, true);
GL11.glPopMatrix();
};
}

View File

@ -8,14 +8,19 @@ import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.impl.ItemGunStinger;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.AuxParticlePacketNT;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.helper.CasingCreator;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.sound.AudioWrapper;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
/** Orchestras are server-side components that run along client-side animations.
* The orchestra only knows what animation is or was playing and how long it started, but not if it is still active.
@ -898,4 +903,80 @@ public class Orchestras {
if(timer == 124) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_TAU = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.SPINUP && entity.worldObj.isRemote) {
AudioWrapper runningAudio = ItemGunBaseNT.loopedSounds.get(entity);
if(timer < 300) {
if(runningAudio == null || !runningAudio.isPlaying()) {
AudioWrapper audio = MainRegistry.proxy.getLoopedSound("hbm:weapon.fire.tauLoop", (float) entity.posX, (float) entity.posY, (float) entity.posZ, 1F, 15F, 0.75F, 10);
audio.updatePitch(0.75F);
ItemGunBaseNT.loopedSounds.put(entity, audio);
audio.startSound();
}
if(runningAudio != null && runningAudio.isPlaying()) {
runningAudio.keepAlive();
runningAudio.updatePosition((float) entity.posX, (float) entity.posY, (float) entity.posZ);
runningAudio.updatePitch(0.75F + timer * 0.01F);
}
} else {
if(runningAudio != null && runningAudio.isPlaying()) runningAudio.stopSound();
}
}
//stop sound due to state change
if(type != AnimType.SPINUP && entity.worldObj.isRemote) {
AudioWrapper runningAudio = ItemGunBaseNT.loopedSounds.get(entity);
if(runningAudio != null && runningAudio.isPlaying()) runningAudio.stopSound();
}
if(entity.worldObj.isRemote) return;
if(type == AnimType.CYCLE) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.fire.tau", 0.5F, 0.9F + entity.getRNG().nextFloat() * 0.2F);
}
if(type == AnimType.ALT_CYCLE) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.fire.tau", 0.5F, 0.7F + entity.getRNG().nextFloat() * 0.2F);
}
if(type == AnimType.SPINUP) {
if(timer % 10 == 0 && timer < 130) {
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
if(mag.getAmount(stack, ctx.inventory) <= 0) {
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.CYCLE_DRY, ctx.configIndex);
return;
}
mag.useUpAmmo(stack, ctx.inventory, 1);
}
if(timer > 200) {
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.CYCLE_DRY, ctx.configIndex);
entity.attackEntityFrom(ModDamageSource.tauBlast, 1_000F);
ItemGunBaseNT.setWear(stack, ctx.configIndex, Math.min(ItemGunBaseNT.getWear(stack, ctx.configIndex) + 10_000F, ctx.config.getDurability(stack)));
entity.worldObj.playSoundEffect(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ, "hbm:entity.ufoBlast", 5.0F, 0.9F);
entity.worldObj.playSoundEffect(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ, "fireworks.blast", 5.0F, 0.5F);
float yaw = entity.worldObj.rand.nextFloat() * 180F;
for(int i = 0; i < 3; i++) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "plasmablast");
data.setFloat("r", 1.0F);
data.setFloat("g", 0.8F);
data.setFloat("b", 0.5F);
data.setFloat("pitch", -60F + 60F * i);
data.setFloat("yaw", yaw);
data.setFloat("scale", 2F);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ),
new TargetPoint(entity.dimension, entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ, 100));
}
}
}
};
}

View File

@ -50,9 +50,9 @@ public class XFactory12ga {
public static void init() {
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).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).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).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_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_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"));

View File

@ -0,0 +1,122 @@
package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import com.hbm.entity.projectile.EntityBulletBeamBase;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.Crosshair;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.mags.MagazineBelt;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
public class XFactoryAccelerator {
public static MagazineBelt tauChargeMag = new MagazineBelt();
public static BulletConfig tau_uranium;
public static BulletConfig tau_uranium_charge;
public static void init() {
tau_uranium = new BulletConfig().setItem(EnumAmmo.TAU_URANIUM).setLife(5).setRenderRotations(false).setDoesPenetrate(true).setDamageFalloutByPen(false)
.setOnBeamImpact(BulletConfig.LAMBDA_BEAM_HIT);
tau_uranium_charge = new BulletConfig().setItem(EnumAmmo.TAU_URANIUM).setLife(5).setRenderRotations(false).setDoesPenetrate(true).setDamageFalloutByPen(false).setSpectral(true)
.setOnBeamImpact(BulletConfig.LAMBDA_BEAM_HIT);
tauChargeMag.addConfigs(tau_uranium_charge);
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)
.mag(new MagazineBelt().addConfigs(tau_uranium))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupBeamFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY)
.rp(LAMBDA_TAU_PRIMARY_RELEASE)
.ps(LAMBDA_TAU_SECONDARY_PRESS)
.rs(LAMBDA_TAU_SECONDARY_RELEASE)
.pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_TAU_ANIMS).orchestra(Orchestras.ORCHESTRA_TAU)
).setUnlocalizedName("gun_tau");
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_PRIMARY_RELEASE = (stack, ctx) -> {
if(ctx.getPlayer() == null) return;
ctx.getPlayer().worldObj.playSoundEffect(ctx.getPlayer().posX, ctx.getPlayer().posY, ctx.getPlayer().posZ, "hbm:weapon.fire.tauRelease", 1F, 1F);
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_SECONDARY_PRESS = (stack, ctx) -> {
if(ctx.getPlayer() == null) return;
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.SPINUP, ctx.configIndex);
tauChargeMag.getMagType(stack); //caches the last loaded ammo
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_SECONDARY_RELEASE = (stack, ctx) -> {
if(ctx.getPlayer() == null) return;
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(timer >= 10) {
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.ALT_CYCLE, ctx.configIndex);
int unitsUsed = 1 + Math.min(12, timer / 10);
EntityLivingBase entity = ctx.entity;
int index = ctx.configIndex;
float aim = ItemGunBaseNT.getIsAiming(stack) ? 0.25F : 1F;
Receiver primary = ctx.config.getReceivers(stack)[0];
BulletConfig config = tauChargeMag.getFirstConfig(stack, ctx.inventory);
Vec3 offset = primary.getProjectileOffset(stack);
double forwardOffset = offset.xCoord;
double heightOffset = offset.yCoord;
double sideOffset = offset.zCoord;
float damage = Lego.getStandardWearDamage(stack, ctx.config, index) * unitsUsed * 5;
float spread = Lego.calcSpread(ctx, stack, primary, true, index, aim);
EntityBulletBeamBase mk4 = new EntityBulletBeamBase(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
entity.worldObj.spawnEntityInWorld(mk4);
ItemGunBaseNT.setWear(stack, index, Math.min(ItemGunBaseNT.getWear(stack, index) + config.wear * unitsUsed, ctx.config.getDurability(stack)));
} else {
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.CYCLE_DRY, ctx.configIndex);
}
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_TAU_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, -0.5, 50).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("ROTATE", new BusAnimationSequence().addPos(0, 0, -5, 50, IType.SIN_DOWN).addPos(0, 0, 5, 100, IType.SIN_FULL).addPos(0, 0, 0, 50, IType.SIN_UP));
case ALT_CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, -3, 100, IType.SIN_DOWN).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("ROTATE", new BusAnimationSequence().addPos(0, 0, -5, 50, IType.SIN_DOWN).addPos(0, 0, 5, 100, IType.SIN_FULL).addPos(0, 0, 0, 50, IType.SIN_UP));
case CYCLE_DRY: return new BusAnimation();
case INSPECT: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(2, 0, 0, 150, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("ROTATE", new BusAnimationSequence().addPos(0, 0, -360, 500, IType.SIN_DOWN));
case SPINUP: return new BusAnimation()
.addBus("ROTATE", new BusAnimationSequence().addPos(0, 0, 360 * 6, 3000, IType.SIN_UP).addPos(0, 0, 0, 0).addPos(0, 0, 360 * 40, 500 * 20));
}
return null;
};
}

View File

@ -20,10 +20,10 @@ import net.minecraft.item.ItemStack;
public class XFactoryBlackPowder {
public static BulletConfig stone = new BulletConfig().setItem(EnumAmmo.STONE).setSpread(0.025F).setRicochetAngle(15);
public static BulletConfig flint = new BulletConfig().setItem(EnumAmmo.STONE_AP).setSpread(0.01F).setRicochetAngle(5).setDoesPenetrate(true).setDamage(1.75F);
public static BulletConfig iron = new BulletConfig().setItem(EnumAmmo.STONE_IRON).setSpread(0F).setRicochetAngle(90).setRicochetCount(5).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(2F);
public static BulletConfig shot = new BulletConfig().setItem(EnumAmmo.STONE_SHOT).setSpread(0.1F).setRicochetAngle(45).setProjectiles(6, 6).setDamage(0.5F);
public static BulletConfig stone = new BulletConfig().setItem(EnumAmmo.STONE).setBlackPowder(true).setSpread(0.025F).setRicochetAngle(15);
public static BulletConfig flint = new BulletConfig().setItem(EnumAmmo.STONE_AP).setBlackPowder(true).setSpread(0.01F).setRicochetAngle(5).setDoesPenetrate(true).setDamage(1.75F);
public static BulletConfig iron = new BulletConfig().setItem(EnumAmmo.STONE_IRON).setBlackPowder(true).setSpread(0F).setRicochetAngle(90).setRicochetCount(5).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(2F);
public static BulletConfig shot = new BulletConfig().setItem(EnumAmmo.STONE_SHOT).setBlackPowder(true).setSpread(0.1F).setRicochetAngle(45).setProjectiles(6, 6).setDamage(0.5F);
public static void init() {

View File

@ -25,8 +25,11 @@ import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.util.ForgeDirection;
@ -65,6 +68,13 @@ public class XFactoryEnergy {
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord),
new TargetPoint(beam.worldObj.provider.dimensionId, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 100));
}
if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
if(mop.entityHit instanceof EntityLivingBase) {
((EntityLivingBase) mop.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60, 9));
((EntityLivingBase) mop.entityHit).addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 60, 9));
}
}
};
public static void init() {

View File

@ -96,9 +96,6 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.hazmat_cloth_red, 1), new Object[] { "C", "R", "C", 'C', ModItems.hazmat_cloth, 'R', REDSTONE.dust() });
addRecipeAuto(new ItemStack(ModItems.hazmat_cloth_grey, 1), new Object[] { " P ", "ICI", " L ", 'C', ModItems.hazmat_cloth_red, 'P', IRON.plate(), 'L', PB.plate(), 'I', ANY_RUBBER.ingot() });
addRecipeAuto(new ItemStack(ModItems.asbestos_cloth, 8), new Object[] { "SCS", "CPC", "SCS", 'S', Items.string, 'P', BR.dust(), 'C', Blocks.wool });
addRecipeAuto(Mats.MAT_TUNGSTEN.make(ModItems.bolt, 16), new Object[] { "D", "D", 'D', W.ingot()});
addRecipeAuto(Mats.MAT_STEEL.make(ModItems.bolt, 16), new Object[] { "D", "D", 'D', STEEL.ingot()});
addRecipeAuto(Mats.MAT_DURA.make(ModItems.bolt, 16), new Object[] { "D", "D", 'D', DURA.ingot()});
addRecipeAuto(new ItemStack(ModItems.bolt_spike, 2), new Object[] { "BB", "B ", "B ", 'B', STEEL.bolt()});
addRecipeAuto(new ItemStack(ModItems.pipes_steel, 1), new Object[] { "B", "B", "B", 'B', STEEL.block() });
addRecipeAuto(new ItemStack(ModItems.plate_polymer, 8), new Object[] { "DD", 'D', ANY_PLASTIC.ingot() });
@ -1063,6 +1060,10 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.book_of_), new Object[] { "BGB", "GAG", "BGB", 'B', ModItems.egg_balefire_shard, 'G', GOLD.ingot(), 'A', Items.book });
}
for(NTMMaterial mat : Mats.orderedList) {
if(mat.autogen.contains(MaterialShapes.BOLT)) for(String name : mat.names) addRecipeAuto(new ItemStack(ModItems.bolt, 16, mat.id), new Object[] { "#", "#", '#', MaterialShapes.INGOT.prefixes[0] + name });
}
if(!GeneralConfig.enable528) {
addRecipeAuto(new ItemStack(ModBlocks.machine_spp_bottom), new Object[] { "MDM", "LCL", "LWL", 'M', MAGTUNG.ingot(), 'D', ModItems.plate_desh, 'L', PB.plate(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'W', ModItems.coil_magnetized_tungsten });

View File

@ -829,7 +829,6 @@ public class ResourceManager {
public static final IModelCustom glass_cannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/glass_cannon.obj"));
public static final IModelCustom novac = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/novac.obj"));
public static final IModelCustom lunatic_sniper = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lunatic_sniper.obj")).asVBO();
public static final IModelCustom tau = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/tau.obj"));
public static final IModelCustom benelli = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/benelli_new.obj")).asVBO();
public static final IModelCustom coilgun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/coilgun.obj")).asVBO();
public static final IModelCustom cryocannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/cryo_cannon.obj")).asVBO();
@ -861,6 +860,7 @@ public class ResourceManager {
public static final IModelCustom missile_launcher = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/missile_launcher.obj")).asVBO();
public static final IModelCustom tesla_cannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/tesla_cannon.obj")).asVBO();
public static final IModelCustom stg77 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/stg77.obj")).asVBO();
public static final IModelCustom tau = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/tau.obj")).asVBO();
public static final HashMap<String, BusAnimation> python_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/python.json"));
public static final HashMap<String, BusAnimation> cursed_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/cursed.json"));
@ -958,7 +958,6 @@ public class ResourceManager {
public static final ResourceLocation red_key_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/red_key.png");
public static final ResourceLocation m2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/m2_browning.png");
public static final ResourceLocation lunatic_sniper_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lunatic_sniper.png");
public static final ResourceLocation tau_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/tau.png");
public static final ResourceLocation benelli_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/benelli_tex.png");
public static final ResourceLocation coilgun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/coilgun.png");
public static final ResourceLocation cryocannon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/cryo_cannon.png");
@ -994,6 +993,7 @@ public class ResourceManager {
public static final ResourceLocation missile_launcher_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/missile_launcher.png");
public static final ResourceLocation tesla_cannon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/tesla_cannon.png");
public static final ResourceLocation stg77_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/stg77.png");
public static final ResourceLocation tau_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/tau.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -0,0 +1,78 @@
package com.hbm.particle;
import java.awt.Color;
import com.hbm.main.ModEventHandlerClient;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class ParticleBlackPowderSmoke extends EntityFXRotating {
public float hue;
public ParticleBlackPowderSmoke(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
particleIcon = ModEventHandlerClient.particleBase;
this.particleMaxAge = 30 + rand.nextInt(15);
this.particleScale = scale * 0.9F + rand.nextFloat() * 0.2F;
this.particleGravity = 0F;
this.hue = 20F + rand.nextFloat() * 20F;
Color color = Color.getHSBColor(hue / 255F, 1F, 1F);
this.particleRed = color.getRed() / 255F;
this.particleGreen = color.getGreen() / 255F;
this.particleBlue = color.getBlue() / 255F;
this.noClip = true;
}
@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;
float ageScaled = (float) this.particleAge / (float) this.particleMaxAge;
this.rotationPitch += (1 - ageScaled) * 2 * ((this.getEntityId() % 2) - 0.5);
this.motionX *= 0.65D;
this.motionY *= 0.65D;
this.motionZ *= 0.65D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
}
@Override
public void renderParticle(Tessellator tess, float interp, float sX, float sY, float sZ, float dX, float dZ) {
double ageScaled = (double) (this.particleAge + interp) / (double) this.particleMaxAge;
Color color = Color.getHSBColor(hue / 255F, Math.max(1F - (float) ageScaled * 2F, 0), MathHelper.clamp_float(1.25F - (float) ageScaled * 2F, 0.7F, 1F));
this.particleRed = color.getRed() / 255F;
this.particleGreen = color.getGreen() / 255F;
this.particleBlue = color.getBlue() / 255F;
this.particleAlpha = (float) Math.pow(1 - Math.min(ageScaled, 1), 0.25);
tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha * 0.25F);
tess.setNormal(0.0F, 1.0F, 0.0F);
double scale = (0.25 + ageScaled + (this.particleAge + interp) * 0.025) * this.particleScale;
renderParticleRotated(tess, interp, sX, sY, sZ, dX, dZ, scale);
}
}

View File

@ -0,0 +1,51 @@
package com.hbm.particle;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class ParticleBlackPowderSpark extends EntityFX {
public ParticleBlackPowderSpark(World world, double x, double y, double z, double mX, double mY, double mZ) {
super(world, x, y, z, mX, mY, mZ);
this.motionX = mX;
this.motionY = mY;
this.motionZ = mZ;
float f = this.rand.nextFloat() * 0.1F + 0.2F;
this.particleRed = f + 0.7F;
this.particleGreen = f + 0.5F;
this.particleBlue = f;
this.setParticleTextureIndex(0);
this.setSize(0.02F, 0.02F);
this.particleScale *= this.rand.nextFloat() * 0.6F + 0.5F;
this.particleMaxAge = 15 + this.rand.nextInt(5);
this.particleGravity = 0.01F;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.motionY -= particleGravity;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.95D;
this.motionY *= 0.95D;
this.motionZ *= 0.95D;
if(this.particleMaxAge-- <= 0) {
this.setDead();
}
}
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float interp) {
return 15728880;
}
}

View File

@ -0,0 +1,67 @@
package com.hbm.particle.helper;
import java.util.Random;
import com.hbm.particle.ParticleBlackPowderSmoke;
import com.hbm.particle.ParticleBlackPowderSpark;
import com.hbm.util.Vec3NT;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class BlackPowderHelper 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) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "blackPowder");
data.setInteger("cloudCount", cloudCount);
data.setFloat("cloudScale", cloudScale);
data.setFloat("cloudSpeedMult", cloudSpeedMult);
data.setInteger("sparkCount", sparkCount);
data.setFloat("sparkSpeedMult", sparkSpeedMult);
data.setDouble("hX", headingX);
data.setDouble("hY", headingY);
data.setDouble("hZ", headingZ);
IParticleCreator.sendPacket(world, x, y, z, 200, data);
}
@Override
@SideOnly(Side.CLIENT)
public void makeParticle(World world, EntityPlayer player, TextureManager texman, Random rand, double x, double y, double z, NBTTagCompound data) {
double headingX = data.getDouble("hX");
double headingY = data.getDouble("hY");
double headingZ = data.getDouble("hZ");
int cloudCount = data.getInteger("cloudCount");
float cloudScale = data.getFloat("cloudScale");
float cloudSpeedMult = data.getFloat("cloudSpeedMult");
int sparkCount = data.getInteger("sparkCount");
float sparkSpeedMult = data.getFloat("sparkSpeedMult");
Vec3NT heading = new Vec3NT(headingX, headingY, headingZ).normalizeSelf();
for(int i = 0; i < cloudCount; i++) {
ParticleBlackPowderSmoke particle = new ParticleBlackPowderSmoke(world, x, y, z, cloudScale);
double speedMult = 0.85 + rand.nextDouble() * 0.3;
particle.motionX = heading.xCoord * cloudSpeedMult * speedMult + rand.nextGaussian() * 0.05;
particle.motionY = heading.yCoord * cloudSpeedMult * speedMult + rand.nextGaussian() * 0.05;
particle.motionZ = heading.zCoord * cloudSpeedMult * speedMult + rand.nextGaussian() * 0.05;
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
}
for(int i = 0; i < sparkCount; i++) {
double speedMult = 0.85 + rand.nextDouble() * 0.3;
ParticleBlackPowderSpark particle = new ParticleBlackPowderSpark(world, x, y, z,
heading.xCoord * sparkSpeedMult * speedMult + rand.nextGaussian() * 0.02,
heading.yCoord * sparkSpeedMult * speedMult + rand.nextGaussian() * 0.02,
heading.zCoord * sparkSpeedMult * speedMult + rand.nextGaussian() * 0.02);
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
}
}
}

View File

@ -13,6 +13,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
/**
* Does two cool things:
* <br>- requires no more additions to ClientProxy which is already bloated, full of other stuff and cumbersome to work with
* <br>- being a separate class, we can get as messy as we want without affecting other particles, so effects can overall have more logic behind them without turning into a big ugly clump
* @author hbm
*
*/
public interface IParticleCreator {
@SideOnly(Side.CLIENT)

View File

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

View File

@ -0,0 +1,94 @@
package com.hbm.render.item.weapon.sedna;
import org.lwjgl.opengl.GL11;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
public class ItemRenderTau extends ItemRenderWeaponBase {
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.5F; }
@Override
public void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 0.875);
float offset = 0.8F;
standardAimingTransform(stack,
-1.75F * offset, -1.75F * offset, 3.5F * offset,
-1.75F * offset, -1.75F * offset, 3.5F * offset);
}
@Override
public void renderFirstPerson(ItemStack stack) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.tau_tex);
double scale = 0.75D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] rotate = HbmAnimations.getRelevantTransformation("ROTATE");
GL11.glTranslated(0, -1, -4);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 1, 4);
GL11.glTranslated(0, 0, recoil[2]);
GL11.glTranslated(0, 0, -2);
GL11.glRotated(recoil[2] * 5, 1, 0, 0);
GL11.glTranslated(0, 0, 2);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_CULL_FACE);
ResourceManager.tau.renderPart("Body");
GL11.glPushMatrix();
GL11.glTranslated(0, -0.25, 0);
GL11.glRotated(rotate[2], 0, 0, 1);
GL11.glTranslated(0, 0.25, 0);
ResourceManager.tau.renderPart("Rotor");
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
double scale = 2.5D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 1, 2);
}
@Override
public void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 2D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
GL11.glTranslated(-0.25, 0.5, 0);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_CULL_FACE);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.tau_tex);
ResourceManager.tau.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -1,5 +1,9 @@
package com.hbm.tileentity.machine;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon;
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
import com.hbm.handler.CompatHandler;
import com.hbm.interfaces.ICopiable;
import com.hbm.inventory.container.ContainerMicrowave;
@ -62,7 +66,11 @@ public class TileEntityMicrowave extends TileEntityMachineBase implements IEnerg
if(speed >= maxSpeed) {
worldObj.func_147480_a(xCoord, yCoord, zCoord, false);
worldObj.newExplosion(null, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 7.5F, true, true);
ExplosionVNT vnt = new ExplosionVNT(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 5);
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 50));
vnt.setPlayerProcessor(new PlayerProcessorStandard());
vnt.setSFX(new ExplosionEffectWeapon(10, 2.5F, 1F));
vnt.explode();
return;
}

View File

@ -1171,7 +1171,9 @@ item.ammo_standard.g12_flechette.name=Kaliber 12 Flechett
item.ammo_standard.g12_magnum.name=Kaliber 12 Magnum
item.ammo_standard.g12_phosphorus.name=Kaliber 12 Phosphor
item.ammo_standard.g12_slug.name=Kaliber 12 Laufgeschoss
item.ammo_standard.g26_flare.name=Signalpatrone
item.ammo_standard.g26_flare.name=26mm Signalpatrone
item.ammo_standard.g26_flare_supply.name=26mm Signalpatrone (Luftpost: Nachschub)
item.ammo_standard.g26_flare_weapon.name=26mm Signalpatrone (Luftpost: Waffen)
item.ammo_standard.g40_demo.name=40mm Abrissgranate
item.ammo_standard.g40_he.name=40mm Sprenggranate
item.ammo_standard.g40_heat.name=40mm Hohlladungsgranate
@ -2245,10 +2247,12 @@ item.gun_skystinger.name=The One Sky Stinger
item.gun_spark.name=Die Zündkerze
item.gun_spark_ammo.name=Elektromagnetische Katusche
item.gun_spas12.name=SPAS-12
item.gun_stg77.name=StG 77
item.gun_stinger.name=FIM-92 Stinger
item.gun_stinger_ammo.name=Stinger-Rakete (LEGACY)
item.gun_super_shotgun.name=Super Shotgun
item.gun_supershotgun.name=Super Shotgun
item.gun_tesla_cannon.name=Teslakanone
item.gun_thompson.name=Thompson Maschinenpistole
item.gun_uac_pistol.name=UAC .45 Pistole
item.gun_uboinik.name=Ubojnik

View File

@ -1894,7 +1894,9 @@ item.ammo_standard.g12_flechette.name=12 Gauge Flechette Shell
item.ammo_standard.g12_magnum.name=12 Gauge Magnum Shell
item.ammo_standard.g12_phosphorus.name=12 Gauge Phosphorus Shell
item.ammo_standard.g12_slug.name=12 Gauge Slug
item.ammo_standard.g26_flare.name=Signal Flare
item.ammo_standard.g26_flare.name=26mm Signal Flare
item.ammo_standard.g26_flare_supply.name=26mm Signal Flare (Supply Airdrop)
item.ammo_standard.g26_flare_weapon.name=26mm Signal Flare (Weapon Airdrop)
item.ammo_standard.g40_demo.name=40mm Grenade, Demolition
item.ammo_standard.g40_he.name=40mm Grenade, High-Explosive
item.ammo_standard.g40_heat.name=40mm Grenade, Shaped Charge
@ -3054,11 +3056,13 @@ item.gun_skystinger.name=The One Sky Stinger
item.gun_spark.name=Spark Plug
item.gun_spark_ammo.name=Electromagnetic Cartridge
item.gun_spas12.name=SPAS-12
item.gun_stg77.name=StG 77
item.gun_stinger.name=FIM-92 Stinger
item.gun_stinger_ammo.name=Stinger Rocket (LEGACY)
item.gun_super_shotgun.name=Super Shotgun
item.gun_super_shotgun.desc=It's super broken!
item.gun_supershotgun.name=Super Shotgun
item.gun_tesla_cannon.name=Tesla Cannon
item.gun_thompson.name=Thompson Submachine Gun
item.gun_uac_pistol.name=UAC .45 Pistol
item.gun_uboinik.name=Uboinik

File diff suppressed because it is too large Load Diff

View File

@ -228,6 +228,9 @@
"weapon.fire.flameLoop": {"category": "player", "sounds": [{"name": "weapon/fire/flameLoop", "stream": false}]},
"weapon.fire.lockon": {"category": "player", "sounds": [{"name": "weapon/fire/lockon", "stream": false}]},
"weapon.fire.shredderCycle": {"category": "player", "sounds": [{"name": "weapon/fire/shredderCycle", "stream": false}]},
"weapon.fire.tau": {"category": "player", "sounds": [{"name": "weapon/fire/tau", "stream": false}]},
"weapon.fire.tauLoop": {"category": "player", "sounds": [{"name": "weapon/fire/tauLoop", "stream": false}]},
"weapon.fire.tauRelease": {"category": "player", "sounds": ["weapon/fire/tauRelease1", "weapon/fire/tauRelease2", "weapon/fire/tauRelease3"]},
"weapon.reload.boltClose": {"category": "player", "sounds": ["weapon/reload/boltClose"]},
"weapon.reload.boltOpen": {"category": "player", "sounds": ["weapon/reload/boltOpen"]},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B