mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
grenade tweaks
This commit is contained in:
parent
6d924cbdc5
commit
19cfc54dee
@ -19,4 +19,7 @@
|
||||
* Fixed compatibility with EndlessIDs, biome changes should no longer crash the game
|
||||
* Fixed GL state leak caused by fluid tanks, causing some tile entities to be rendered without face culling
|
||||
* Fixed a bug where using too many PWR heatsinks would cause an overflow, making the heat capacity negative
|
||||
* Fixed landmines generating into the floor on superflat worlds
|
||||
* Fixed landmines generating into the floor on superflat worlds
|
||||
* All NTM type explosions are no longer affected by difficulty setting, preventing them from dealing damage in peaceful mode
|
||||
* There are a few instances of vanilla explosions still being used, those will be phased out in the future
|
||||
* Fixed tutorial presentations triggering when hitting F1 not just in the inventory but also when looking at the block in question
|
||||
@ -39,10 +39,12 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_henry, 1), new Object[] { "BRP", "BMS", 'B', STEEL.lightBarrel(), 'R', GUNMETAL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'S', WOOD.stock(), 'P', GUNMETAL.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_greasegun, 1), new Object[] { "BRS", "SMG", 'B', STEEL.lightBarrel(), 'R', STEEL.lightReceiver(), 'S', STEEL.bolt(), 'M', GUNMETAL.mechanism(), 'G', STEEL.grip() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_maresleg, 1), new Object[] { "BRM", "BGS", 'B', STEEL.lightBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', STEEL.bolt(), 'S', WOOD.stock() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flaregun, 1), new Object[] { "BRM", " G", 'B', STEEL.heavyBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'B', STEEL.grip() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flaregun, 1), new Object[] { "BRM", " G", 'B', STEEL.heavyBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', STEEL.grip() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_heavy_revolver, 1), new Object[] { "BRM", " G", 'B', DURA.lightBarrel(), 'R', DURA.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_carbine, 1), new Object[] { "BRM", "G S", 'B', DURA.lightBarrel(), 'R', DURA.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip(), 'S', WOOD.stock() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_am180, 1), new Object[] { "BBR", "GMS", 'B', DURA.lightBarrel(), 'R', DURA.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip(), 'S', WOOD.stock() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_liberator, 1), new Object[] { "BB ", "BBM", "G G", 'B', DURA.lightBarrel(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_congolake, 1), new Object[] { "BM ", "BRS", "G ", 'B', DURA.heavyBarrel(), 'M', GUNMETAL.mechanism(), 'R', DURA.lightReceiver(), 'S', WOOD.stock(), 'G', WOOD.grip() });
|
||||
|
||||
//SEDNA Ammo
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.STONE, 6), new Object[] { "C", "P", "G", 'C', KEY_COBBLESTONE, 'P', Items.paper, 'G', Items.gunpowder });
|
||||
@ -98,7 +100,6 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_karl, 1), new Object[] { "SSW", " MW", 'S', STEEL.shell(), 'W', ALLOY.plate(), 'M', ModItems.mechanism_launcher_2 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_quadro, 1), new Object[] { "SSS", "SSS", "CM ", 'S', STEEL.pipe(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'M', ModItems.mechanism_launcher_2 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_hk69, 1), new Object[] { "SSI", " MB", 'S', STEEL.shell(), 'I', IRON.ingot(), 'M', ModItems.mechanism_launcher_1, 'B', STEEL.bolt() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_congolake, 1), new Object[] { "HHR", "WLW", 'H', AL.shell(), 'R', ModItems.mechanism_rifle_1, 'W', KEY_LOG, 'L', ModItems.mechanism_launcher_1 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stinger, 1), new Object[] { "SSW", "CMW", 'S', STEEL.plate(), 'W', TI.plate(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', ModItems.mechanism_launcher_2 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver, 1), new Object[] { "SSM", " RW", 'S', STEEL.plate(), 'W', KEY_PLANKS, 'R', AL.wireFine(), 'M', ModItems.mechanism_revolver_1 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_saturnite, 1), new Object[] { "SSM", " RW", 'S', BIGMT.plate(), 'W', KEY_PLANKS, 'R', W.wireFine(), 'M', ModItems.mechanism_revolver_2 });
|
||||
|
||||
@ -110,6 +110,8 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote && this.ticksExisted > config.expires) this.setDead();
|
||||
|
||||
if(this.config.onUpdate != null) this.config.onUpdate.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -124,6 +126,10 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
|
||||
protected void onImpact(MovingObjectPosition mop) {
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(this.config.onImpact != null) this.config.onImpact.accept(this, mop);
|
||||
|
||||
if(this.isDead) return;
|
||||
|
||||
if(mop.typeOfHit == mop.typeOfHit.BLOCK) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(mop.sideHit);
|
||||
|
||||
@ -21,6 +21,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
@ -156,7 +157,7 @@ public class ExplosionNT extends Explosion {
|
||||
currentZ /= d9;
|
||||
double d10 = (double) this.worldObj.getBlockDensity(vec3, entity.boundingBox);
|
||||
double d11 = (1.0D - d4) * d10;
|
||||
entity.attackEntityFrom(DamageSource.setExplosionSource(this), (float) ((int) ((d11 * d11 + d11) / 2.0D * 8.0D * (double) this.explosionSize + 1.0D)));
|
||||
entity.attackEntityFrom(setExplosionSource(this), (float) ((int) ((d11 * d11 + d11) / 2.0D * 8.0D * (double) this.explosionSize + 1.0D)));
|
||||
double d8 = EnchantmentProtection.func_92092_a(entity, d11);
|
||||
entity.motionX += currentX * d8;
|
||||
entity.motionY += currentY * d8;
|
||||
@ -173,6 +174,12 @@ public class ExplosionNT extends Explosion {
|
||||
}
|
||||
}
|
||||
|
||||
public static DamageSource setExplosionSource(Explosion explosion) {
|
||||
return explosion != null && explosion.getExplosivePlacedBy() != null ?
|
||||
(new EntityDamageSource("explosion.player", explosion.getExplosivePlacedBy())).setExplosion() :
|
||||
(new DamageSource("explosion")).setExplosion();
|
||||
}
|
||||
|
||||
public void doExplosionB(boolean p_77279_1_) {
|
||||
|
||||
if(!has(ExAttrib.NOSOUND))
|
||||
|
||||
@ -13,7 +13,9 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
@ -86,8 +88,8 @@ public class EntityProcessorCross implements IEntityProcessor {
|
||||
}
|
||||
|
||||
double knockback = (1.0D - distanceScaled) * density;
|
||||
|
||||
entity.attackEntityFrom(DamageSource.setExplosionSource(explosion.compat), (float) ((int) ((knockback * knockback + knockback) / 2.0D * 8.0D * size + 1.0D)));
|
||||
|
||||
entity.attackEntityFrom(setExplosionSource(explosion.compat), calculateDamage(distanceScaled, density, knockback, size));
|
||||
double enchKnockback = EnchantmentProtection.func_92092_a(entity, knockback);
|
||||
|
||||
entity.motionX += deltaX * enchKnockback;
|
||||
@ -108,6 +110,16 @@ public class EntityProcessorCross implements IEntityProcessor {
|
||||
return affectedPlayers;
|
||||
}
|
||||
|
||||
public float calculateDamage(double distanceScaled, double density, double knockback, float size) {
|
||||
return (float) ((int) ((knockback * knockback + knockback) / 2.0D * 8.0D * size + 1.0D));
|
||||
}
|
||||
|
||||
public static DamageSource setExplosionSource(Explosion explosion) {
|
||||
return explosion != null && explosion.getExplosivePlacedBy() != null ?
|
||||
(new EntityDamageSource("explosion.player", explosion.getExplosivePlacedBy())).setExplosion() :
|
||||
(new DamageSource("explosion")).setExplosion();
|
||||
}
|
||||
|
||||
public EntityProcessorCross withRangeMod(float mod) {
|
||||
range = new IEntityRangeMutator() {
|
||||
@Override
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package com.hbm.explosion.vanillant.standard;
|
||||
|
||||
public class EntityProcessorCrossSmooth extends EntityProcessorCross {
|
||||
|
||||
protected float fixedDamage;
|
||||
|
||||
public EntityProcessorCrossSmooth(double nodeDist, float fixedDamage) {
|
||||
super(nodeDist);
|
||||
this.fixedDamage = fixedDamage;
|
||||
}
|
||||
|
||||
public float calculateDamage(double distanceScaled, double density, double knockback, float size) {
|
||||
return (float) (fixedDamage * (1 - distanceScaled));
|
||||
}
|
||||
}
|
||||
@ -13,7 +13,9 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
@ -67,7 +69,7 @@ public class EntityProcessorStandard implements IEntityProcessor {
|
||||
double density = world.getBlockDensity(vec3, entity.boundingBox);
|
||||
double knockback = (1.0D - distanceScaled) * density;
|
||||
|
||||
entity.attackEntityFrom(DamageSource.setExplosionSource(explosion.compat), (float) ((int) ((knockback * knockback + knockback) / 2.0D * 8.0D * size + 1.0D)));
|
||||
entity.attackEntityFrom(setExplosionSource(explosion.compat), calculateDamage(distanceScaled, density, knockback, size));
|
||||
double enchKnockback = EnchantmentProtection.func_92092_a(entity, knockback);
|
||||
|
||||
entity.motionX += deltaX * enchKnockback;
|
||||
@ -88,6 +90,16 @@ public class EntityProcessorStandard implements IEntityProcessor {
|
||||
return affectedPlayers;
|
||||
}
|
||||
|
||||
public float calculateDamage(double distanceScaled, double density, double knockback, float size) {
|
||||
return (float) ((int) ((knockback * knockback + knockback) / 2.0D * 8.0D * size + 1.0D));
|
||||
}
|
||||
|
||||
public static DamageSource setExplosionSource(Explosion explosion) {
|
||||
return explosion != null && explosion.getExplosivePlacedBy() != null ?
|
||||
(new EntityDamageSource("explosion.player", explosion.getExplosivePlacedBy())).setExplosion() :
|
||||
(new DamageSource("explosion")).setExplosion();
|
||||
}
|
||||
|
||||
public EntityProcessorStandard withRangeMod(float mod) {
|
||||
range = new IEntityRangeMutator() {
|
||||
@Override
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.items.weapon.sedna;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
@ -15,6 +16,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSourceIndirect;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
||||
public class BulletConfig {
|
||||
|
||||
@ -45,6 +47,9 @@ public class BulletConfig {
|
||||
public int maxRicochetCount = 2;
|
||||
/** Whether damage dealt to an entity is subtracted from the projectile's damage on penetration */
|
||||
public boolean damageFalloffByPen = true;
|
||||
|
||||
public Consumer<EntityBulletBaseMK4> onUpdate;
|
||||
public BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> onImpact;
|
||||
|
||||
public double gravity = 0;
|
||||
public int expires = 30;
|
||||
@ -88,6 +93,9 @@ public class BulletConfig {
|
||||
public BulletConfig setCasing(SpentCasing casing) { this.casing = casing; return this; }
|
||||
public BulletConfig setRenderer(BiConsumer<EntityBulletBaseMK4, Float> renderer) { this.renderer = renderer; return this; }
|
||||
|
||||
public BulletConfig setOnUpdate(Consumer<EntityBulletBaseMK4> lambda) { this.onUpdate = lambda; return this; }
|
||||
public BulletConfig setOnImpact(BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> lambda) { this.onImpact = lambda; return this; }
|
||||
|
||||
public DamageSource getDamage(EntityBulletBaseMK4 bullet, EntityLivingBase shooter, boolean bypass) {
|
||||
|
||||
DamageSource dmg;
|
||||
|
||||
@ -9,21 +9,10 @@ import static com.hbm.items.weapon.sedna.factory.XFactory44.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory762mm.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory9mm.*;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.item.weapon.sedna.*;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public class GunFactoryClient {
|
||||
@ -44,36 +33,37 @@ public class GunFactoryClient {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_liberator, new ItemRenderLiberator());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_congolake, new ItemRenderCongoLake());
|
||||
//PROJECTILES
|
||||
ammo_debug.setRenderer(RENDER_STANDARD_BULLET);
|
||||
ammo_debug_buckshot.setRenderer(RENDER_STANDARD_BULLET);
|
||||
m357_sp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
m357_fmj.setRenderer(RENDER_STANDARD_BULLET);
|
||||
m357_jhp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
m357_ap.setRenderer(RENDER_AP_BULLET);
|
||||
m357_express.setRenderer(RENDER_EXPRESS_BULLET);
|
||||
m44_sp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
m44_fmj.setRenderer(RENDER_STANDARD_BULLET);
|
||||
m44_jhp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
m44_ap.setRenderer(RENDER_AP_BULLET);
|
||||
m44_express.setRenderer(RENDER_EXPRESS_BULLET);
|
||||
p9_sp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
p9_fmj.setRenderer(RENDER_STANDARD_BULLET);
|
||||
p9_jhp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
p9_ap.setRenderer(RENDER_AP_BULLET);
|
||||
g12_bp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
g12_bp_magnum.setRenderer(RENDER_STANDARD_BULLET);
|
||||
g12_bp_slug.setRenderer(RENDER_STANDARD_BULLET);
|
||||
g12.setRenderer(RENDER_STANDARD_BULLET);
|
||||
g40_flare.setRenderer(RENDER_FLARE);
|
||||
r762_sp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
r762_fmj.setRenderer(RENDER_STANDARD_BULLET);
|
||||
r762_jhp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
r762_ap.setRenderer(RENDER_AP_BULLET);
|
||||
r762_du.setRenderer(RENDER_DU_BULLET);
|
||||
p22_sp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
p22_fmj.setRenderer(RENDER_STANDARD_BULLET);
|
||||
p22_jhp.setRenderer(RENDER_STANDARD_BULLET);
|
||||
p22_ap.setRenderer(RENDER_AP_BULLET);
|
||||
ammo_debug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
ammo_debug_buckshot.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
m357_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
m357_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
m357_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
m357_ap.setRenderer(LegoClient.RENDER_AP_BULLET);
|
||||
m357_express.setRenderer(LegoClient.RENDER_EXPRESS_BULLET);
|
||||
m44_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
m44_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
m44_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
m44_ap.setRenderer(LegoClient.RENDER_AP_BULLET);
|
||||
m44_express.setRenderer(LegoClient.RENDER_EXPRESS_BULLET);
|
||||
p9_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
p9_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
p9_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
p9_ap.setRenderer(LegoClient.RENDER_AP_BULLET);
|
||||
g12_bp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
g12_bp_magnum.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
g12_bp_slug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
g12.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
r762_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
r762_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
r762_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
r762_ap.setRenderer(LegoClient.RENDER_AP_BULLET);
|
||||
r762_du.setRenderer(LegoClient.RENDER_DU_BULLET);
|
||||
p22_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
p22_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
p22_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
p22_ap.setRenderer(LegoClient.RENDER_AP_BULLET);
|
||||
g40_flare.setRenderer(LegoClient.RENDER_FLARE);
|
||||
g40.setRenderer(LegoClient.RENDER_GRENADE);
|
||||
//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);
|
||||
@ -90,130 +80,4 @@ public class GunFactoryClient {
|
||||
((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);
|
||||
}
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_STANDARD_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0xFFBF00, 0xFFFFFF, length, false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_AP_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0xFF6A00, 0xFFE28D, length, false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_EXPRESS_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0x9E082E, 0xFF8A79, length, false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_DU_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0x5CCD41, 0xE9FF8D, length, false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_TRACER_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0x9E082E, 0xFF8A79, length, true);
|
||||
};
|
||||
|
||||
public static void renderBulletStandard(Tessellator tess, int dark, int light, double length, boolean fullbright) { renderBulletStandard(tess, dark, light, length, 0.03125D, 0.03125D * 0.25D, fullbright); }
|
||||
|
||||
public static void renderBulletStandard(Tessellator tess, int dark, int light, double length, double widthF, double widthB, boolean fullbright) {
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
tess.startDrawingQuads();
|
||||
if(fullbright) tess.setBrightness(240);
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, widthB, -widthB); tess.addVertex(length, widthB, widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, widthF, widthF); tess.addVertex(0, widthF, -widthF);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, -widthB, -widthB); tess.addVertex(length, -widthB, widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, -widthF, widthF); tess.addVertex(0, -widthF, -widthF);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, -widthB, widthB); tess.addVertex(length, widthB, widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, widthF, widthF); tess.addVertex(0, -widthF, widthF);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, -widthB, -widthB); tess.addVertex(length, widthB, -widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, widthF, -widthF); tess.addVertex(0, -widthF, -widthF);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, widthB, widthB); tess.addVertex(length, widthB, -widthB);
|
||||
tess.addVertex(length, -widthB, -widthB); tess.addVertex(length, -widthB, widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, widthF, widthF); tess.addVertex(0, widthF, -widthF);
|
||||
tess.addVertex(0, -widthF, -widthF); tess.addVertex(0, -widthF, widthF);
|
||||
tess.draw();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
private static final ResourceLocation flare = new ResourceLocation(RefStrings.MODID + ":textures/particle/flare.png");
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_FLARE = (bullet, interp) -> {
|
||||
|
||||
if(bullet.ticksExisted < 2) return;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(flare);
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
|
||||
float f1 = ActiveRenderInfo.rotationX;
|
||||
float f2 = ActiveRenderInfo.rotationZ;
|
||||
float f3 = ActiveRenderInfo.rotationYZ;
|
||||
float f4 = ActiveRenderInfo.rotationXY;
|
||||
float f5 = ActiveRenderInfo.rotationXZ;
|
||||
|
||||
double posX = 0;
|
||||
double posY = 0;
|
||||
double posZ = 0;
|
||||
double scale = Math.min(5, (bullet.ticksExisted + interp - 2) * 0.5) * (0.8 + bullet.worldObj.rand.nextDouble() * 0.4);
|
||||
|
||||
tess.setColorRGBA_F(1F, 0.5F, 0.5F, 0.5F);
|
||||
tess.addVertexWithUV((double) (posX - f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ - f2 * scale - f4 * scale), 1, 1);
|
||||
tess.addVertexWithUV((double) (posX - f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ - f2 * scale + f4 * scale), 1, 0);
|
||||
tess.addVertexWithUV((double) (posX + f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ + f2 * scale + f4 * scale), 0, 0);
|
||||
tess.addVertexWithUV((double) (posX + f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ + f2 * scale - f4 * scale), 0, 1);
|
||||
|
||||
scale *= 0.5D;
|
||||
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 0.75F);
|
||||
tess.addVertexWithUV((double) (posX - f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ - f2 * scale - f4 * scale), 1, 1);
|
||||
tess.addVertexWithUV((double) (posX - f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ - f2 * scale + f4 * scale), 1, 0);
|
||||
tess.addVertexWithUV((double) (posX + f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ + f2 * scale + f4 * scale), 0, 0);
|
||||
tess.addVertexWithUV((double) (posX + f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ + f2 * scale - f4 * scale), 0, 1);
|
||||
|
||||
tess.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
};
|
||||
}
|
||||
|
||||
@ -6,6 +6,10 @@ import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
|
||||
import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.items.weapon.sedna.GunConfig;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
@ -20,6 +24,7 @@ import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
/**
|
||||
@ -187,6 +192,14 @@ public class Lego {
|
||||
return 1F - (percent - 0.75F) * 2F;
|
||||
}
|
||||
|
||||
public static void standardExplode(EntityBulletBaseMK4 bullet, MovingObjectPosition mop, float range) {
|
||||
ExplosionVNT vnt = new ExplosionVNT(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, range);
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, bullet.damage));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectStandard());
|
||||
vnt.explode();
|
||||
}
|
||||
|
||||
/** anims for the DEBUG revolver, mostly a copy of the li'lpip but with some fixes regarding the cylinder movement */
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_DEBUG_ANIMS = (stack, type) -> {
|
||||
switch(type) {
|
||||
|
||||
@ -1,7 +1,20 @@
|
||||
package com.hbm.items.weapon.sedna.factory;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.items.weapon.sedna.hud.HUDComponentAmmoCounter;
|
||||
import com.hbm.items.weapon.sedna.hud.HUDComponentDurabilityBar;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class LegoClient {
|
||||
|
||||
@ -9,4 +22,141 @@ public class LegoClient {
|
||||
public static HUDComponentDurabilityBar HUD_COMPONENT_DURABILITY_MIRROR = new HUDComponentDurabilityBar(true);
|
||||
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO = new HUDComponentAmmoCounter(0);
|
||||
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO_MIRROR = new HUDComponentAmmoCounter(0, true);
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_STANDARD_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0xFFBF00, 0xFFFFFF, length, false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_AP_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0xFF6A00, 0xFFE28D, length, false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_EXPRESS_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0x9E082E, 0xFF8A79, length, false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_DU_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0x5CCD41, 0xE9FF8D, length, false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_TRACER_BULLET = (bullet, interp) -> {
|
||||
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
|
||||
if(length <= 0) return;
|
||||
renderBulletStandard(Tessellator.instance, 0x9E082E, 0xFF8A79, length, true);
|
||||
};
|
||||
|
||||
public static void renderBulletStandard(Tessellator tess, int dark, int light, double length, boolean fullbright) { renderBulletStandard(tess, dark, light, length, 0.03125D, 0.03125D * 0.25D, fullbright); }
|
||||
|
||||
public static void renderBulletStandard(Tessellator tess, int dark, int light, double length, double widthF, double widthB, boolean fullbright) {
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
tess.startDrawingQuads();
|
||||
if(fullbright) tess.setBrightness(240);
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, widthB, -widthB); tess.addVertex(length, widthB, widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, widthF, widthF); tess.addVertex(0, widthF, -widthF);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, -widthB, -widthB); tess.addVertex(length, -widthB, widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, -widthF, widthF); tess.addVertex(0, -widthF, -widthF);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, -widthB, widthB); tess.addVertex(length, widthB, widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, widthF, widthF); tess.addVertex(0, -widthF, widthF);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, -widthB, -widthB); tess.addVertex(length, widthB, -widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, widthF, -widthF); tess.addVertex(0, -widthF, -widthF);
|
||||
tess.setColorOpaque_I(dark);
|
||||
tess.addVertex(length, widthB, widthB); tess.addVertex(length, widthB, -widthB);
|
||||
tess.addVertex(length, -widthB, -widthB); tess.addVertex(length, -widthB, widthB);
|
||||
tess.setColorOpaque_I(light);
|
||||
tess.addVertex(0, widthF, widthF); tess.addVertex(0, widthF, -widthF);
|
||||
tess.addVertex(0, -widthF, -widthF); tess.addVertex(0, -widthF, widthF);
|
||||
tess.draw();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
private static final ResourceLocation flare = new ResourceLocation(RefStrings.MODID + ":textures/particle/flare.png");
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_FLARE = (bullet, interp) -> {
|
||||
|
||||
if(bullet.ticksExisted < 2) return;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(flare);
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
|
||||
float f1 = ActiveRenderInfo.rotationX;
|
||||
float f2 = ActiveRenderInfo.rotationZ;
|
||||
float f3 = ActiveRenderInfo.rotationYZ;
|
||||
float f4 = ActiveRenderInfo.rotationXY;
|
||||
float f5 = ActiveRenderInfo.rotationXZ;
|
||||
|
||||
double posX = 0;
|
||||
double posY = 0;
|
||||
double posZ = 0;
|
||||
double scale = Math.min(5, (bullet.ticksExisted + interp - 2) * 0.5) * (0.8 + bullet.worldObj.rand.nextDouble() * 0.4);
|
||||
|
||||
tess.setColorRGBA_F(1F, 0.5F, 0.5F, 0.5F);
|
||||
tess.addVertexWithUV((double) (posX - f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ - f2 * scale - f4 * scale), 1, 1);
|
||||
tess.addVertexWithUV((double) (posX - f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ - f2 * scale + f4 * scale), 1, 0);
|
||||
tess.addVertexWithUV((double) (posX + f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ + f2 * scale + f4 * scale), 0, 0);
|
||||
tess.addVertexWithUV((double) (posX + f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ + f2 * scale - f4 * scale), 0, 1);
|
||||
|
||||
scale *= 0.5D;
|
||||
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 0.75F);
|
||||
tess.addVertexWithUV((double) (posX - f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ - f2 * scale - f4 * scale), 1, 1);
|
||||
tess.addVertexWithUV((double) (posX - f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ - f2 * scale + f4 * scale), 1, 0);
|
||||
tess.addVertexWithUV((double) (posX + f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ + f2 * scale + f4 * scale), 0, 0);
|
||||
tess.addVertexWithUV((double) (posX + f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ + f2 * scale - f4 * scale), 0, 1);
|
||||
|
||||
tess.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_GRENADE = (bullet, interp) -> {
|
||||
|
||||
GL11.glScalef(0.25F, 0.25F, 0.25F);
|
||||
GL11.glRotated(90, 0, 0, 1);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.grenade_tex);
|
||||
ResourceManager.projectiles.renderPart("Grenade");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
};
|
||||
}
|
||||
|
||||
@ -101,6 +101,33 @@ public class Orchestras {
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_DANI = (stack, ctx) -> {
|
||||
EntityPlayer player = ctx.player;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
|
||||
if(type == AnimType.RELOAD) {
|
||||
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
|
||||
if(timer == 36) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
|
||||
if(timer == 44) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
}
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 9) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
|
||||
if(timer == 9) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
|
||||
}
|
||||
if(type == AnimType.INSPECT) {
|
||||
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
|
||||
if(timer == 24) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
}
|
||||
if(type == AnimType.JAMMED) {
|
||||
if(timer == 12) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
|
||||
if(timer == 34) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_HENRY = (stack, ctx) -> {
|
||||
EntityPlayer player = ctx.player;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
|
||||
@ -47,22 +47,22 @@ public class XFactory357 {
|
||||
ModItems.gun_light_revolver_dani = new ItemGunBaseNT(
|
||||
new GunConfig().dura(30_000).draw(20).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(10F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(0, 6).addConfigs(m357_sp, m357_fmj, m357_jhp, m357_ap, m357_express))
|
||||
.offset(0.75, -0.0625, 0.3125D)
|
||||
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
|
||||
.anim(LAMBDA_DANI_ANIMS).orchestra(Orchestras.ORCHESTRA_ATLAS),
|
||||
.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(16).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.dmg(10F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(1, 6).addConfigs(m357_sp, m357_fmj, m357_jhp, m357_ap, m357_express))
|
||||
.offset(0.75, -0.0625, -0.3125D)
|
||||
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
|
||||
.anim(LAMBDA_DANI_ANIMS).orchestra(Orchestras.ORCHESTRA_ATLAS)
|
||||
.anim(LAMBDA_DANI_ANIMS).orchestra(Orchestras.ORCHESTRA_DANI)
|
||||
).setUnlocalizedName("gun_light_revolver_dani").setTextureName(RefStrings.MODID + ":gun_darter");
|
||||
}
|
||||
|
||||
@ -101,6 +101,13 @@ public class XFactory357 {
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_DANI_ANIMS = (stack, type) -> {
|
||||
switch(type) {
|
||||
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(360 * 3, 0, 0, 1000, IType.SIN_DOWN));
|
||||
case CYCLE: return new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, -3, 50).addPos(0, 0, 0, 250))
|
||||
.addBus("HAMMER", new BusAnimationSequence().addPos(0, 0, 1, 50).addPos(0, 0, 1, 300).addPos(0, 0, 0, 200))
|
||||
.addBus("DRUM", new BusAnimationSequence().addPos(0, 0, 0, 350).addPos(0, 0, 1, 200));
|
||||
case CYCLE_DRY: return new BusAnimation()
|
||||
.addBus("HAMMER", new BusAnimationSequence().addPos(0, 0, 1, 50).addPos(0, 0, 1, 200).addPos(0, 0, 0, 200))
|
||||
.addBus("DRUM", new BusAnimationSequence().addPos(0, 0, 0, 350).addPos(0, 0, 1, 200));
|
||||
}
|
||||
|
||||
return LAMBDA_ATLAS_ANIMS.apply(stack, type);
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.items.weapon.sedna.factory;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
@ -22,21 +23,26 @@ import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
||||
public class XFactory40mm {
|
||||
|
||||
public static BulletConfig g40_flare;
|
||||
public static BulletConfig g40;
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_STANDARD_EXPLODE = (bullet, mop) -> {
|
||||
Lego.standardExplode(bullet, mop, 5F); bullet.setDead();
|
||||
};
|
||||
|
||||
public static void init() {
|
||||
|
||||
g40_flare = new BulletConfig().setItem(EnumAmmo.G40_FLARE).setVel(2F).setGrav(0.035D).setRenderRotations(false).setCasing(new SpentCasing(CasingType.STRAIGHT).setColor(0x9E1616).setScale(2F).register("G40Flare"));
|
||||
g40 = new BulletConfig().setItem(EnumAmmo.G40).setVel(2F).setGrav(0.035D).setCasing(new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_40MM).setScale(2, 2F, 1.5F).register("G40"));
|
||||
g40_flare = new BulletConfig().setItem(EnumAmmo.G40_FLARE).setLife(100).setVel(2F).setGrav(0.035D).setRenderRotations(false).setCasing(new SpentCasing(CasingType.STRAIGHT).setColor(0x9E1616).setScale(2F).register("G40Flare"));
|
||||
g40 = new BulletConfig().setItem(EnumAmmo.G40).setLife(200).setOnImpact(LAMBDA_STANDARD_EXPLODE).setVel(2F).setGrav(0.035D).setCasing(new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_40MM).setScale(2, 2F, 1.5F).register("G40"));
|
||||
|
||||
ModItems.gun_flaregun = new ItemGunBaseNT(new GunConfig()
|
||||
.dura(100).draw(7).inspect(39).crosshair(Crosshair.L_CIRCUMFLEX).smoke(LAMBDA_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(20).reload(28).jam(33).sound("hbm:weapon.hkShoot", 1.0F, 1.0F)
|
||||
.dmg(15F).delay(20).reload(28).jam(33).sound("hbm:weapon.hkShoot", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 1).addConfigs(g40_flare))
|
||||
.offset(0.75, -0.0625, -0.1875D)
|
||||
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
@ -47,8 +53,8 @@ public class XFactory40mm {
|
||||
ModItems.gun_congolake = new ItemGunBaseNT(new GunConfig()
|
||||
.dura(400).draw(7).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCUMFLEX).smoke(LAMBDA_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(24).reload(16, 16, 16, 0).jam(0).sound("hbm:weapon.glShoot", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 4).addConfigs(g40_flare))
|
||||
.dmg(30F).delay(24).reload(16, 16, 16, 0).jam(0).sound("hbm:weapon.glShoot", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 4).addConfigs(g40, g40_flare))
|
||||
.offset(0.75, -0.0625, -0.1875D)
|
||||
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.setupStandardConfiguration()
|
||||
|
||||
@ -909,7 +909,7 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_F1)) {
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_F1) && Minecraft.getMinecraft().currentScreen != null) {
|
||||
|
||||
ComparableStack comp = canneryTimestamp > System.currentTimeMillis() - 100 ? lastCannery : null;
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@ -135,6 +136,8 @@ public class ModEventHandlerRenderer {
|
||||
ModelBiped biped = renderer.modelBipedMain;
|
||||
biped.bipedLeftArm.rotateAngleY = 0.1F + biped.bipedHead.rotateAngleY;
|
||||
if(!isManly) {
|
||||
AbstractClientPlayer acp = (AbstractClientPlayer) player;
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(acp.getLocationSkin());
|
||||
biped.bipedLeftArm.isHidden = false;
|
||||
biped.bipedLeftArm.render(0.0625F);
|
||||
}
|
||||
|
||||
@ -178,21 +178,6 @@ public class RenderBullet extends Render {
|
||||
GL11.glScalef(0.25F, 0.25F, 0.25F);
|
||||
GL11.glRotated(90, 0, 0, 1);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
|
||||
switch(type) {
|
||||
case 0:
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenade.png")); break;
|
||||
case 1:
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeHE.png")); break;
|
||||
case 2:
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeIncendiary.png")); break;
|
||||
case 3:
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeToxic.png")); break;
|
||||
case 4:
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeSleek.png")); break;
|
||||
case 5:
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/entity/ModelGrenadeTraining.png")); break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.grenade_tex);
|
||||
|
||||
@ -132,7 +132,9 @@ public class ItemRenderCongoLake extends ItemRenderWeaponBase {
|
||||
@Override
|
||||
public void setupThirdPerson(ItemStack stack) {
|
||||
super.setupThirdPerson(stack);
|
||||
GL11.glTranslated(0, 1, 3);
|
||||
GL11.glTranslated(0, -2.5, 4);
|
||||
double scale = 2.5D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.3 KiB |
Loading…
x
Reference in New Issue
Block a user