the horngus of a dongfish

This commit is contained in:
Bob 2024-10-02 22:02:19 +02:00
parent ea895daa85
commit 59254c7179
17 changed files with 1464 additions and 1162 deletions

View File

@ -34,7 +34,7 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
this(entity.worldObj);
this.thrower = entity;
this.config = config;
this.setBulletConfig(config);
this.damage = baseDamage * this.config.damageMult;
@ -64,6 +64,7 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
}
public void setBulletConfig(BulletConfig config) {
this.config = config;
this.dataWatcher.updateObject(3, config.id);
}

View File

@ -1625,6 +1625,7 @@ public class ModItems {
public static Item gun_pepperbox;
public static Item gun_atlas;
public static Item gun_henry;
public static Item ammo_standard;
@ -7034,6 +7035,8 @@ public class ModItems {
GameRegistry.registerItem(gun_pepperbox, gun_pepperbox.getUnlocalizedName());
GameRegistry.registerItem(gun_atlas, gun_atlas.getUnlocalizedName());
GameRegistry.registerItem(gun_henry, gun_henry.getUnlocalizedName());
GameRegistry.registerItem(ammo_standard, ammo_standard.getUnlocalizedName());
//Ammo

View File

@ -4,6 +4,8 @@ import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.factory.GunStateDecider;
import com.hbm.items.weapon.sedna.factory.Lego;
import com.hbm.items.weapon.sedna.hud.IHUDComponent;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.HbmAnimations.AnimType;
@ -125,4 +127,14 @@ public class GunConfig {
//client
public GunConfig anim(BiFunction<ItemStack, AnimType, BusAnimation> lambda) { this.animations_DNA = lambda; return this; }
public GunConfig hud(IHUDComponent... components) { this.hudComponents_DNA = components; return this; }
/** Standard package for keybind handling and decider using LEGO prefabs: Primary fire on LMB,
* reload on R, aiming on MMB and the standard decider which includes jamming and auto fire handling*/
public GunConfig setupStandardConfiguration() {
this.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY);
this.pr(Lego.LAMBDA_STANDARD_RELOAD);
this.pt(Lego.LAMBDA_TOGGLE_AIM);
this.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER);
return this;
}
}

View File

@ -287,7 +287,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
IHUDComponent[] components = gun.getConfig(stack).getHUDComponents(stack);
for(IHUDComponent component : components) {
if(components != null) for(IHUDComponent component : components) {
int bottomOffset = 0;
component.renderHUDComponent(event, type, player, stack, bottomOffset);
bottomOffset += component.getComponentHeight(player, stack);

View File

@ -48,6 +48,7 @@ public class GunFactory {
XFactoryBlackPowder.init();
XFactory357.init();
XFactory44.init();
/// PROXY BULLSHIT ///
MainRegistry.proxy.registerGunCfg();

View File

@ -1,6 +1,8 @@
package com.hbm.items.weapon.sedna.factory;
import static com.hbm.items.weapon.sedna.factory.GunFactory.*;
import static com.hbm.items.weapon.sedna.factory.XFactory357.*;
import static com.hbm.items.weapon.sedna.factory.XFactory44.*;
import java.util.function.BiConsumer;
@ -11,6 +13,7 @@ import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.render.item.weapon.sedna.ItemRenderAtlas;
import com.hbm.render.item.weapon.sedna.ItemRenderDebug;
import com.hbm.render.item.weapon.sedna.ItemRenderHenry;
import com.hbm.render.item.weapon.sedna.ItemRenderPepperbox;
import net.minecraft.client.renderer.Tessellator;
@ -23,27 +26,43 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_debug, new ItemRenderDebug());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_pepperbox, new ItemRenderPepperbox());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_atlas, new ItemRenderAtlas());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_henry, new ItemRenderHenry());
//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_STANDARD_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_STANDARD_BULLET);
m44_express.setRenderer(RENDER_EXPRESS_BULLET);
//HUDS
((ItemGunBaseNT) ModItems.gun_debug).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_pepperbox).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_atlas).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_henry).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
}
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_STANDARD_BULLET = (bullet, interp) -> {
Tessellator tess = Tessellator.instance;
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
if(length <= 0) return;
renderBulletStandard(tess, 0xFFBF00, 0xFFFFFF, length, false);
renderBulletStandard(Tessellator.instance, 0xFFBF00, 0xFFFFFF, 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_TRACER_BULLET = (bullet, interp) -> {
Tessellator tess = Tessellator.instance;
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;
if(length <= 0) return;
renderBulletStandard(tess, 0x9E082E, 0xFF8A79, length, true);
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); }

View File

@ -83,8 +83,8 @@ public class Lego {
/** Toggles isAiming. Used by keybinds. */
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_RECOIL = (stack, ctx) -> {
ItemGunBaseNT.recoilVertical += 10;
ItemGunBaseNT.recoilHorizontal += ctx.player.getRNG().nextGaussian() * 1.5;
//ItemGunBaseNT.recoilVertical += 10;
//ItemGunBaseNT.recoilHorizontal += ctx.player.getRNG().nextGaussian() * 1.5;
};
/** Toggles isAiming. Used by keybinds. */

View File

@ -98,4 +98,31 @@ public class Orchestras {
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);
int timer = ItemGunBaseNT.getAnimTimer(stack);
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 == 12) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 1F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 14) 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);
}
};
}

View File

@ -39,9 +39,7 @@ public class XFactory357 {
.dmg(10F).delay(16).reload(55).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))
.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) .pt(Lego.LAMBDA_TOGGLE_AIM)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_ATLAS_ANIMS)
.setupStandardConfiguration().anim(LAMBDA_ATLAS_ANIMS)
).setUnlocalizedName("gun_atlas").setTextureName(RefStrings.MODID + ":gun_darter");
}

View File

@ -0,0 +1,65 @@
package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiFunction;
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.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.lib.RefStrings;
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.item.ItemStack;
public class XFactory44 {
public static BulletConfig m44_sp;
public static BulletConfig m44_fmj;
public static BulletConfig m44_jhp;
public static BulletConfig m44_ap;
public static BulletConfig m44_express;
public static void init() {
m44_sp = new BulletConfig().setItem(EnumAmmo.M357_SP);
m44_fmj = new BulletConfig().setItem(EnumAmmo.M357_FMJ).setDamage(0.8F).setArmorPiercing(0.1F);
m44_jhp = new BulletConfig().setItem(EnumAmmo.M357_JHP).setDamage(1.5F).setArmorPiercing(-0.25F);
m44_ap = new BulletConfig().setItem(EnumAmmo.M357_AP).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F);
m44_express = new BulletConfig().setItem(EnumAmmo.M357_EXPRESS).setDoesPenetrate(true).setDamage(1.5F).setArmorPiercing(0.1F).setWear(1.5F);
ModItems.gun_henry = new ItemGunBaseNT(new GunConfig()
.dura(300).draw(15).inspect(23).jam(45).crosshair(Crosshair.CIRCLE).smoke(true).orchestra(Orchestras.ORCHESTRA_HENRY)
.rec(new Receiver(0)
.dmg(12F).delay(16).reload(55).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 6).addConfigs(m44_sp, m44_fmj, m44_jhp, m44_ap, m44_express))
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardConfiguration().anim(LAMBDA_HENRY_ANIMS)
).setUnlocalizedName("gun_henry").setTextureName(RefStrings.MODID + ":gun_darter");
}
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_HENRY_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, -3, 350, IType.SIN_DOWN))
.addBus("SIGHT", new BusAnimationSequence().addPos(80, 0, 0, 0).addPos(80, 0, 0, 500).addPos(0, 0, -3, 250, IType.SIN_DOWN));
case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, -1, 50).addPos(0, 0, 0, 250))
.addBus("SIGHT", new BusAnimationSequence().addPos(35, 0, 0, 100, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("LEVER", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(-90, 0, 0, 200).addPos(0, 0, 0, 200))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(0, 0, 45, 200, IType.SIN_DOWN).addPos(0, 0, 0, 200, IType.SIN_UP))
.addBus("HAMMER", new BusAnimationSequence().addPos(30, 0, 0, 50).addPos(30, 0, 0, 550).addPos(0, 0, 0, 200));
case CYCLE_DRY: return new BusAnimation();
case RELOAD: return new BusAnimation();
case INSPECT: return new BusAnimation();
case JAMMED: return new BusAnimation();
}
return null;
};
}

View File

@ -33,9 +33,7 @@ public class XFactoryBlackPowder {
.dmg(5F).delay(27).reload(67).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 6).addConfigs(stone, flint, iron, shot))
.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) .pt(Lego.LAMBDA_TOGGLE_AIM)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_PEPPERBOX_ANIMS)
.setupStandardConfiguration().anim(LAMBDA_PEPPERBOX_ANIMS)
).setUnlocalizedName("gun_pepperbox").setTextureName(RefStrings.MODID + ":gun_darter");
}

View File

@ -838,7 +838,6 @@ public class ResourceManager {
public static final IModelCustom spas_12 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/spas-12.obj"));
public static final IModelCustom nightmare_dark = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/nightmare_dark.obj"));
public static final IModelCustom glass_cannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/glass_cannon.obj"));
public static final IModelCustom bio_revolver = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/bio_revolver.obj"));
public static final IModelCustom chemthrower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/chemthrower.obj")).asVBO();
public static final IModelCustom novac = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/novac.obj"));
public static final IModelCustom m2 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/m2_browning.obj")).asVBO(); //large fella should be a display list
@ -852,6 +851,8 @@ public class ResourceManager {
public static final IModelCustom lilmac = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lilmac.obj")).asVBO();
public static final IModelCustom pepperbox = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/pepperbox.obj")).asVBO();
public static final IModelCustom bio_revolver = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/bio_revolver.obj")).asVBO();
public static final IModelCustom henry = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/henry.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"));
@ -943,7 +944,6 @@ public class ResourceManager {
public static final ResourceLocation remington_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/remington.png");
public static final ResourceLocation spas_12_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/spas-12.png");
public static final ResourceLocation glass_cannon_panel_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/glass_cannon_panel.png");
public static final ResourceLocation bio_revolver_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/bio_revolver.png");
public static final ResourceLocation chemthrower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/chemthrower.png");
public static final ResourceLocation novac_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/novac.png");
public static final ResourceLocation novac_scope_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/novac_scope.png");
@ -964,6 +964,8 @@ public class ResourceManager {
public static final ResourceLocation debug_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/debug_gun.png");
public static final ResourceLocation pepperbox_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/pepperbox.png");
public static final ResourceLocation bio_revolver_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/bio_revolver.png");
public static final ResourceLocation henry_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/henry.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -90,7 +90,7 @@ public class ItemRenderAtlas extends ItemRenderWeaponBase {
GL11.glPushMatrix();
GL11.glTranslated(0, 1.5, 9.25);
GL11.glRotated(90, 0, 1, 0);
this.renderGapFlash(gun.lastShot);
this.renderMuzzleFlash(gun.lastShot, 75, 7.5);
GL11.glPopMatrix();
}

View File

@ -0,0 +1,118 @@
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 ItemRenderHenry extends ItemRenderWeaponBase {
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.5F; }
@Override
protected void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 0.875);
float offset = 0.8F;
standardAimingTransform(stack,
-1.25F * offset, -1F * offset, 1.75F * offset,
0, -5 / 8D, 1);
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
double r = -2.5 * aimingProgress;
GL11.glRotated(r, 1, 0, 0);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.henry_tex);
double scale = 0.375D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] sight = HbmAnimations.getRelevantTransformation("SIGHT");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER");
double[] lever = HbmAnimations.getRelevantTransformation("LEVER");
double[] turn = HbmAnimations.getRelevantTransformation("TURN");
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glTranslated(recoil[0] * 2, recoil[1], recoil[2]);
GL11.glRotated(recoil[2] * 5, 1, 0, 0);
GL11.glRotated(turn[2], 0, 0, 1);
GL11.glTranslated(0, 2, -4);
GL11.glRotated(equip[0], -1, 0, 0);
GL11.glTranslated(0, -2, 4);
ResourceManager.henry.renderPart("Gun");
GL11.glPushMatrix();
GL11.glTranslated(0, 1.25, -0.1875);
GL11.glRotated(sight[0], 1, 0, 0);
GL11.glTranslated(0, -1.25, 0.1875);
ResourceManager.henry.renderPart("Sight");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0.625, -3);
GL11.glRotated(-30 + hammer[0], 1, 0, 0);
GL11.glTranslated(0, -0.625, 3);
ResourceManager.henry.renderPart("Hammer");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0.25, -2.3125);
GL11.glRotated(lever[0], 1, 0, 0);
GL11.glTranslated(0, -0.25, 2.3125);
ResourceManager.henry.renderPart("Lever");
GL11.glPopMatrix();
ResourceManager.henry.renderPart("Front");
ResourceManager.henry.renderPart("Bullet");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glTranslated(0, 1, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
this.renderMuzzleFlash(gun.lastShot, 75, 5);
GL11.glPopMatrix();
}
@Override
protected void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
GL11.glTranslated(0, 1, 3);
}
@Override
protected void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 1.5D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
GL11.glTranslated(-0.5, 0.5, 0);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.henry_tex);
ResourceManager.henry.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -282,9 +282,13 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
}
public static void renderMuzzleFlash(long lastShot) {
renderMuzzleFlash(lastShot, 75, 15);
}
public static void renderMuzzleFlash(long lastShot, int duration, double l) {
Tessellator tess = Tessellator.instance;
int flash = 75;
int flash = duration;
if(System.currentTimeMillis() - lastShot < flash) {
GL11.glEnable(GL11.GL_BLEND);
@ -294,7 +298,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
double fire = (System.currentTimeMillis() - lastShot) / (double) flash;
double width = 6 * fire;
double length = 15 * fire;
double length = l * fire;
double inset = 2;
Minecraft.getMinecraft().renderEngine.bindTexture(flash_plume);
tess.startDrawingQuads();

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB