Merge pull request #2001 from Vaern/master

G3 Attachments
This commit is contained in:
HbmMods 2025-03-21 07:55:42 +01:00 committed by GitHub
commit fc716379c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 5526 additions and 5535 deletions

View File

@ -740,7 +740,7 @@ public class Orchestras {
if(entity.worldObj.isRemote) return; if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex); AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex); int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack); boolean aiming = ItemGunBaseNT.getIsAiming(stack) && !WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SCOPE);
if(type == AnimType.CYCLE) { if(type == AnimType.CYCLE) {
if(timer == 0) { if(timer == 0) {
@ -766,8 +766,8 @@ public class Orchestras {
if(type == AnimType.JAMMED) { if(type == AnimType.JAMMED) {
if(timer == 16) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F); if(timer == 16) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 20) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F); if(timer == 20) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 24) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F); if(timer == 26) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 28) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F); if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
} }
}; };

View File

@ -98,30 +98,47 @@ public class XFactory556mm {
case EQUIP: return new BusAnimation() case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL)); .addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
case CYCLE: return new BusAnimation() case CYCLE: return new BusAnimation()
.addBus("BOLT", new BusAnimationSequence().addPos(0, 0, 0, 20).addPos(0, 0, -4.5, 40).addPos(0, 0, 0, 40))
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -0.75, 25, IType.SIN_DOWN).addPos(0, 0, 0, 75, IType.SIN_FULL)); .addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -0.75, 25, IType.SIN_DOWN).addPos(0, 0, 0, 75, IType.SIN_FULL));
case CYCLE_DRY: return new BusAnimation() case CYCLE_DRY: return new BusAnimation()
.addBus("BOLT", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -3.25, 150).addPos(0, 0, 0, 100)) .addBus("BOLT", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -0.3125, 100).hold(25).addPos(0, 0, -2.75, 130).hold(50).addPos(0, 0, -2.4375, 50).addPos(0, 0, 0, 85))
.addBus("PLUG", new BusAnimationSequence().addPos(0, 0, 0, 250).hold(125).addPos(0, 0, -2.4375, 130).hold(100).addPos(0, 0, 0, 85))
.addBus("HANDLE", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 90, 0, 100).hold(25).hold(180).addPos(0, 0, 0, 50))
.addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 400).addPos(-1, 0, 0, 100, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL)); .addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 400).addPos(-1, 0, 0, 100, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL));
case RELOAD: case RELOAD:
return new BusAnimation() return new BusAnimation()
.addBus("MAG", new BusAnimationSequence() .addBus("MAG", new BusAnimationSequence()
.addPos(0, -8, 0, 250, IType.SIN_UP) //250 .addPos(0, -8, 0, 250, IType.SIN_UP) //250
.addPos(0, -8, 0, 1000) //1250 .addPos(0, -8, 0, 1050) //1300
.addPos(0, 0, 0, 300)) //1550 .addPos(0, 0, 0, 250)) //1550
.addBus("BOLT", new BusAnimationSequence() .addBus("BOLT", new BusAnimationSequence()
.addPos(0, 0, 0, 250) //250 .addPos(0, 0, 0, 200) //200
.addPos(0, 0, -3.25, 150) //400 .addPos(0, 0, -0.3125, 100) //300
.addPos(0, 0, -3.25, 1250) //1750 .hold(10) //310
.addPos(0, 0, 0, 100)) //1850 .addPos(0, 0, -3.25, 200) //510
.holdUntil(1875) //1875
.addPos(0, 0, -2.9375, 50) //1925
.addPos(0, 0, 0, 100)) //2025
.addBus("PLUG", new BusAnimationSequence()
.addPos(0, 0, 0, 310) //310
.addPos(0, 0, -2.9375, 200) //510
.holdUntil(1925) //1925
.addPos(0, 0, 0, 100)) //2025
.addBus("HANDLE", new BusAnimationSequence() .addBus("HANDLE", new BusAnimationSequence()
.addPos(0, 0, 0, 500) //500 .addPos(0, 0, 0, 200) //200
.addPos(0, 0, 45, 50) //550 .addPos(0, 90, 0, 100) //300
.addPos(0, 0, 45, 1150) //1700 .hold(210) //510
.addPos(0, 0, 0, 50)) //1750 .addPos(0, 90, 45, 75) //685
.holdUntil(1775) //1775
.addPos(0, 90, 0, 100) //1875
.addPos(0, 0, 0, 50)) //1925
.addBus("LIFT", new BusAnimationSequence() .addBus("LIFT", new BusAnimationSequence()
.addPos(0, 0, 0, 750) //750 .addPos(0, 0, 0, 750) //750
.addPos(-25, 0, 0, 500, IType.SIN_FULL) //1250 .addPos(-25, 0, 0, 500, IType.SIN_FULL) //1250
.addPos(-25, 0, 0, 750) //2000 .holdUntil(1550) //1550
.addPos(-26, 0, 0, 100, IType.SIN_DOWN) //1650
.addPos(-25, 0, 0, 100, IType.SIN_FULL) //1750
.holdUntil(2000) //2000
.addPos(0, 0, 0, 500, IType.SIN_FULL)) //3500 .addPos(0, 0, 0, 500, IType.SIN_FULL)) //3500
.addBus("BULLET", new BusAnimationSequence().addPos(empty ? 1 : 0, 0, 0, 0).addPos(0, 0, 0, 1000)); .addBus("BULLET", new BusAnimationSequence().addPos(empty ? 1 : 0, 0, 0, 0).addPos(0, 0, 0, 1000));
case INSPECT: return new BusAnimation() case INSPECT: return new BusAnimation()
@ -139,7 +156,8 @@ public class XFactory556mm {
.addBus("BULLET", new BusAnimationSequence().addPos(empty ? 1 : 0, 0, 0, 0)); .addBus("BULLET", new BusAnimationSequence().addPos(empty ? 1 : 0, 0, 0, 0));
case JAMMED: return new BusAnimation() case JAMMED: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 1250).addPos(0, 0, 0, 350, IType.SIN_FULL)) .addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 1250).addPos(0, 0, 0, 350, IType.SIN_FULL))
.addBus("BOLT", new BusAnimationSequence().addPos(0, 0, 0, 1000).addPos(0, 0, -3.25, 150).addPos(0, 0, 0, 100).addPos(0, 0, 0, 250).addPos(0, 0, -3.25, 150).addPos(0, 0, 0, 100)); .addBus("BOLT", new BusAnimationSequence().addPos(0, 0, 0, 1000).addPos(0, 0, -3.25, 150).addPos(0, 0, 0, 100).addPos(0, 0, 0, 250).addPos(0, 0, -3.25, 150).addPos(0, 0, 0, 100))
.addBus("PLUG", new BusAnimationSequence().addPos(0, 0, 0, 1000).addPos(0, 0, -3.25, 150).addPos(0, 0, 0, 100).addPos(0, 0, 0, 250).addPos(0, 0, -3.25, 150).addPos(0, 0, 0, 100));
} }
return null; return null;

View File

@ -962,6 +962,7 @@ public class ResourceManager {
public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.png"); public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.png");
public static final ResourceLocation g3_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_green.png"); public static final ResourceLocation g3_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_green.png");
public static final ResourceLocation g3_black_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_black.png"); public static final ResourceLocation g3_black_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_black.png");
public static final ResourceLocation g3_attachments = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_attachments.png");
public static final ResourceLocation shredder_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/shredder.png"); public static final ResourceLocation shredder_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/shredder.png");
public static final ResourceLocation shredder_orig_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/shredder_orig.png"); public static final ResourceLocation shredder_orig_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/shredder_orig.png");
public static final ResourceLocation sexy_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/sexy.png"); public static final ResourceLocation sexy_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/sexy.png");

View File

@ -19,22 +19,26 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
@Override @Override
public float getViewFOV(ItemStack stack, float fov) { public float getViewFOV(ItemStack stack, float fov) {
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp; float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
return fov * (1 - aimingProgress * 0.33F); return fov * (1 - aimingProgress * (isScoped(stack) ? 0.66F : 0.33F));
} }
@Override @Override
public void setupFirstPerson(ItemStack stack) { public void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 0.875); GL11.glTranslated(0, 0, 0.875);
boolean isScoped = this.isScoped(stack);
float offset = 0.8F; float offset = 0.8F;
standardAimingTransform(stack, standardAimingTransform(stack,
-1.25F * offset, -1F * offset, 2.75F * offset, -1.25F * offset, -1F * offset, 2.75F * offset,
0, -3.5625 / 8D, 1.75); 0, isScoped ? (-5.53125 / 8D) : (-3.5625 / 8D), isScoped ? 1.46875 : 1.75);
} }
@Override @Override
public void renderFirstPerson(ItemStack stack) { public void renderFirstPerson(ItemStack stack) {
boolean isScoped = this.isScoped(stack);
if(isScoped && ItemGunBaseNT.prevAimingProgress == 1 && ItemGunBaseNT.aimingProgress == 1) return;
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem(); ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(stack)); Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(stack));
double scale = 0.375D; double scale = 0.375D;
@ -46,6 +50,7 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
double[] mag = HbmAnimations.getRelevantTransformation("MAG"); double[] mag = HbmAnimations.getRelevantTransformation("MAG");
double[] speen = HbmAnimations.getRelevantTransformation("SPEEN"); double[] speen = HbmAnimations.getRelevantTransformation("SPEEN");
double[] bolt = HbmAnimations.getRelevantTransformation("BOLT"); double[] bolt = HbmAnimations.getRelevantTransformation("BOLT");
double[] plug = HbmAnimations.getRelevantTransformation("PLUG");
double[] handle = HbmAnimations.getRelevantTransformation("HANDLE"); double[] handle = HbmAnimations.getRelevantTransformation("HANDLE");
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET"); double[] bullet = HbmAnimations.getRelevantTransformation("BULLET");
@ -63,9 +68,11 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
ResourceManager.g3.renderPart("Rifle"); ResourceManager.g3.renderPart("Rifle");
if(hasStock(stack)) ResourceManager.g3.renderPart("Stock"); if(hasStock(stack)) ResourceManager.g3.renderPart("Stock");
ResourceManager.g3.renderPart("Flash_Hider"); boolean silenced = hasSilencer(stack);
ResourceManager.g3.renderPart("Trigger_Rifle.002"); if(!silenced) ResourceManager.g3.renderPart("Flash_Hider");
ResourceManager.g3.renderPart("Trigger");
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(stack));
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(mag[0], mag[1], mag[2]); GL11.glTranslated(mag[0], mag[1], mag[2]);
GL11.glTranslated(0, -1.75, -0.5); GL11.glTranslated(0, -1.75, -0.5);
@ -78,10 +85,20 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(0, 0, bolt[2]); GL11.glTranslated(0, 0, bolt[2]);
ResourceManager.g3.renderPart("Bolt"); ResourceManager.g3.renderPart("Guide_And_Bolt");
GL11.glTranslated(0, 0.625, 0); GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0.625, plug[2]);
GL11.glRotated(handle[2], 0, 0, 1); GL11.glRotated(handle[2], 0, 0, 1);
GL11.glTranslated(0, -0.625, 0); GL11.glTranslated(0, -0.625, 0);
ResourceManager.g3.renderPart("Plug");
GL11.glTranslated(0, 0.625, 5.25);
GL11.glRotated(22.5, 0, 0, 1);
GL11.glRotated(handle[1], 0, 1, 0);
GL11.glRotated(-22.5, 0, 0, 1);
GL11.glTranslated(0, -0.625, -5.25);
ResourceManager.g3.renderPart("Handle"); ResourceManager.g3.renderPart("Handle");
GL11.glPopMatrix(); GL11.glPopMatrix();
@ -89,27 +106,35 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
GL11.glTranslated(0, -0.875, -3.5); GL11.glTranslated(0, -0.875, -3.5);
GL11.glRotated(-30 * (1 - ItemGunBaseNT.getMode(stack, 0)), 1, 0, 0); GL11.glRotated(-30 * (1 - ItemGunBaseNT.getMode(stack, 0)), 1, 0, 0);
GL11.glTranslated(0, 0.875, 3.5); GL11.glTranslated(0, 0.875, 3.5);
ResourceManager.g3.renderPart("Selector_Rifle.001"); ResourceManager.g3.renderPart("Selector");
GL11.glPopMatrix(); GL11.glPopMatrix();
double smokeScale = 0.75; if(silenced || isScoped) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.g3_attachments);
if(silenced) ResourceManager.g3.renderPart("Silencer");
if(isScoped) ResourceManager.g3.renderPart("Scope");
}
GL11.glPushMatrix(); if(!silenced) {
GL11.glTranslated(0, 0, 13); double smokeScale = 0.75;
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(smokeScale, smokeScale, smokeScale);
this.renderSmokeNodes(gun.getConfig(stack, 0).smokeNodes, 0.5D);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT); GL11.glPushMatrix();
GL11.glTranslated(0, 0, 13);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(smokeScale, smokeScale, smokeScale);
this.renderSmokeNodes(gun.getConfig(stack, 0).smokeNodes, 0.5D);
GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glShadeModel(GL11.GL_FLAT);
GL11.glTranslated(0, 0, 12);
GL11.glRotated(90, 0, 1, 0); GL11.glPushMatrix();
GL11.glRotated(-25 + gun.shotRand * 10, 1, 0, 0); GL11.glTranslated(0, 0, 12);
GL11.glScaled(0.75, 0.75, 0.75); GL11.glRotated(90, 0, 1, 0);
this.renderMuzzleFlash(gun.lastShot[0], 75, 10); GL11.glRotated(-25 + gun.shotRand * 10, 1, 0, 0);
GL11.glPopMatrix(); GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(gun.lastShot[0], 75, 10);
GL11.glPopMatrix();
}
} }
@Override @Override
@ -128,13 +153,13 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
double scale = 0.875D; double scale = 0.875D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0); GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0); GL11.glRotated(hasSilencer(stack) ? 50 : 45, 0, 1, 0);
GL11.glTranslated(-0.5, 0.5, 0); GL11.glTranslated(hasSilencer(stack) ? 0.75 : -0.5, 0.5, 0);
} else { } else {
double scale = 1.125D; double scale = 1.125D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0); GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0); GL11.glRotated(hasSilencer(stack) ? 55 : 45, 0, 1, 0); //preserves proportions whilst limiting size
GL11.glTranslated(2.5, 0.5, 0); GL11.glTranslated(2.5, 0.5, 0);
} }
} }
@ -151,22 +176,31 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
public void renderOther(ItemStack stack, ItemRenderType type) { public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
boolean silenced = hasSilencer(stack);
boolean isScoped = this.isScoped(stack);
GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(stack)); Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(stack));
ResourceManager.g3.renderPart("Rifle"); ResourceManager.g3.renderPart("Rifle");
if(hasStock(stack)) ResourceManager.g3.renderPart("Stock"); if(hasStock(stack)) ResourceManager.g3.renderPart("Stock");
ResourceManager.g3.renderPart("Magazine"); ResourceManager.g3.renderPart("Magazine");
ResourceManager.g3.renderPart("Flash_Hider"); if(!silenced)ResourceManager.g3.renderPart("Flash_Hider");
ResourceManager.g3.renderPart("Bolt"); ResourceManager.g3.renderPart("Guide_And_Bolt");
ResourceManager.g3.renderPart("Handle"); ResourceManager.g3.renderPart("Handle");
ResourceManager.g3.renderPart("Trigger_Rifle.002"); ResourceManager.g3.renderPart("Trigger");
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(0, -0.875, -3.5); GL11.glTranslated(0, -0.875, -3.5);
GL11.glRotated(-30, 1, 0, 0); GL11.glRotated(-30, 1, 0, 0);
GL11.glTranslated(0, 0.875, 3.5); GL11.glTranslated(0, 0.875, 3.5);
ResourceManager.g3.renderPart("Selector_Rifle.001"); ResourceManager.g3.renderPart("Selector");
GL11.glPopMatrix(); GL11.glPopMatrix();
if(silenced || isScoped) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.g3_attachments);
if(silenced) ResourceManager.g3.renderPart("Silencer");
if(isScoped) ResourceManager.g3.renderPart("Scope");
}
GL11.glShadeModel(GL11.GL_FLAT); GL11.glShadeModel(GL11.GL_FLAT);
} }
@ -174,6 +208,14 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
return !WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_NO_STOCK); return !WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_NO_STOCK);
} }
public boolean hasSilencer(ItemStack stack) {
return WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SILENCER);
}
public boolean isScoped(ItemStack stack) {
return WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SCOPE);
}
public ResourceLocation getTexture(ItemStack stack) { public ResourceLocation getTexture(ItemStack stack) {
if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_FURNITURE_GREEN)) return ResourceManager.g3_green_tex; if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_FURNITURE_GREEN)) return ResourceManager.g3_green_tex;
if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_FURNITURE_BLACK)) return ResourceManager.g3_black_tex; if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_FURNITURE_BLACK)) return ResourceManager.g3_black_tex;

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB