🅱️enry

This commit is contained in:
Bob 2024-10-03 21:29:20 +02:00
parent c8d40f0d35
commit de238ca0e0
20 changed files with 3352 additions and 3072 deletions

View File

@ -36,6 +36,7 @@ public class WeaponRecipes {
//SEDNA Guns
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_pepperbox, 1), new Object[] { "IIW", " C", 'I', IRON.ingot(), 'W', KEY_PLANKS, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_atlas, 1), new Object[] { "BRM", " G", 'B', STEEL.lightBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip() });
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() });
//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 });

View File

@ -1626,6 +1626,7 @@ public class ModItems {
public static Item gun_pepperbox;
public static Item gun_atlas;
public static Item gun_henry;
public static Item gun_greasegun;
public static Item ammo_standard;
@ -7036,6 +7037,7 @@ 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(gun_greasegun, gun_greasegun.getUnlocalizedName());
GameRegistry.registerItem(ammo_standard, ammo_standard.getUnlocalizedName());

View File

@ -38,7 +38,7 @@ public class ItemBedrockOreBase extends Item {
for(BedrockOreType type : BedrockOreType.values()) {
double amount = this.getOreAmount(stack, type);
String typeName = StatCollector.translateToLocalFormatted("item.bedrock_ore.type." + type.suffix + ".name");
list.add(typeName + ": " + ((int) (amount * 100)) / 100D + " (" + ItemOreDensityScanner.translateDensity(amount) + EnumChatFormatting.RESET + ")");
list.add(typeName + ": " + ((int) (amount * 100)) / 100D + " (" + StatCollector.translateToLocalFormatted(ItemOreDensityScanner.translateDensity(amount)) + EnumChatFormatting.RESET + ")");
}
}

View File

@ -18,23 +18,25 @@ import net.minecraft.util.Vec3;
*/
public class Receiver {
public static final String F_BASEDAMAGE = "F_BASEDAMAGE";
public static final String I_DELAYAFTERFIRE = "I_DELAYAFTERFIRE";
public static final String I_ROUNDSPERCYCLE = "I_ROUNDSPERCYCLE";
public static final String F_SPREADMOD = "F_SPREADMOD";
public static final String B_REFIREONHOLD = "B_REFIREONHOLD";
public static final String B_DOESDRYFIRE = "B_DOESDRYFIRE";
public static final String O_EJECTOR = "O_EJECTOR";
public static final String B_EJECTONFIRE = "B_EJECTONFIRE";
public static final String I_RELOADDURATION = "I_RELOADDURATION";
public static final String S_FIRESOUND = "S_FIRESOUND";
public static final String F_FIREVOLUME = "F_FIREVOLUME";
public static final String F_FIREPITCH = "F_FIREPITCH";
public static final String O_MAGAZINE = "O_MAGAZINE";
public static final String O_PROJECTILEOFFSET = "O_PROJECTILEOFFSET";
public static final String FUN_CANFIRE = "FUN_CANFIRE";
public static final String CON_ONFIRE = "CON_ONFIRE";
public static final String CON_ONRECOIL = "CON_ONRECOIL";
public static final String F_BASEDAMAGE = "F_BASEDAMAGE";
public static final String I_DELAYAFTERFIRE = "I_DELAYAFTERFIRE";
public static final String I_ROUNDSPERCYCLE = "I_ROUNDSPERCYCLE";
public static final String F_SPREADMOD = "F_SPREADMOD";
public static final String B_REFIREONHOLD = "B_REFIREONHOLD";
public static final String B_DOESDRYFIRE = "B_DOESDRYFIRE";
public static final String O_EJECTOR = "O_EJECTOR";
public static final String B_EJECTONFIRE = "B_EJECTONFIRE";
public static final String I_RELOADBEGINDURATION = "I_RELOADBEGINDURATION";
public static final String I_RELOADCYCLEDURATION = "I_RELOADCYCLEDURATION";
public static final String I_RELOADENDDURATION = "I_RELOADENDDURATION";
public static final String S_FIRESOUND = "S_FIRESOUND";
public static final String F_FIREVOLUME = "F_FIREVOLUME";
public static final String F_FIREPITCH = "F_FIREPITCH";
public static final String O_MAGAZINE = "O_MAGAZINE";
public static final String O_PROJECTILEOFFSET = "O_PROJECTILEOFFSET";
public static final String FUN_CANFIRE = "FUN_CANFIRE";
public static final String CON_ONFIRE = "CON_ONFIRE";
public static final String CON_ONRECOIL = "CON_ONRECOIL";
public Receiver(int index) {
this.index = index;
@ -49,7 +51,9 @@ public class Receiver {
protected boolean doesDryFire_DNA = true;
protected CasingEjector ejector_DNA = null;
protected boolean ejectOnFire_DNA = true;
protected int reloadDuration_DNA;
protected int reloadBeginDuration_DNA;
protected int reloadCycleDuration_DNA;
protected int reloadEndDuration_DNA;
protected String fireSound_DNA;
protected float fireVolume_DNA = 1.0F;
protected float firePitch_DNA = 1.0F;
@ -68,7 +72,9 @@ public class Receiver {
public boolean getDoesDryFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.doesDryFire_DNA, stack, B_DOESDRYFIRE, this); }
public CasingEjector getEjector(ItemStack stack) { return WeaponUpgradeManager.eval(this.ejector_DNA, stack, O_EJECTOR, this); }
public boolean getEjectOnFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.ejectOnFire_DNA, stack, B_EJECTONFIRE, this); }
public int getReloadDuration(ItemStack stack) { return WeaponUpgradeManager.eval(this.reloadDuration_DNA, stack, I_RELOADDURATION, this); }
public int getReloadBeginDuration(ItemStack stack) { return WeaponUpgradeManager.eval(this.reloadBeginDuration_DNA, stack, I_RELOADBEGINDURATION, this); }
public int getReloadCycleDuration(ItemStack stack) { return WeaponUpgradeManager.eval(this.reloadCycleDuration_DNA, stack, I_RELOADCYCLEDURATION, this); }
public int getReloadEndDuration(ItemStack stack) { return WeaponUpgradeManager.eval(this.reloadEndDuration_DNA, stack, I_RELOADENDDURATION, this); }
public String getFireSound(ItemStack stack) { return WeaponUpgradeManager.eval(this.fireSound_DNA, stack, S_FIRESOUND, this); }
public float getFireVolume(ItemStack stack) { return WeaponUpgradeManager.eval(this.fireVolume_DNA, stack, F_FIREVOLUME, this); }
public float getFirePitch(ItemStack stack) { return WeaponUpgradeManager.eval(this.firePitch_DNA, stack, F_FIREPITCH, this); }
@ -83,15 +89,24 @@ public class Receiver {
public Receiver dmg(float dmg) { this.baseDamage_DNA = dmg; return this; }
public Receiver delay(int delay) { this.delayAfterFire_DNA = delay; return this; }
public Receiver rounds(int rounds) { this.roundsPerCycle_DNA = rounds; return this; }
public Receiver spread(int spread) { this.spreadModExtra_DNA = spread; return this; }
public Receiver spread(float spread) { this.spreadModExtra_DNA = spread; return this; }
public Receiver auto(boolean auto) { this.refireOnHold_DNA = auto; return this; }
public Receiver dryfire(boolean dryfire) { this.doesDryFire_DNA = dryfire; return this; }
public Receiver ejector(CasingEjector ejector) { this.ejector_DNA = ejector; return this; }
public Receiver ejectOnFire(boolean eject) { this.ejectOnFire_DNA = eject; return this; }
public Receiver reload(int delay) { this.reloadDuration_DNA = delay; return this; }
public Receiver mag(IMagazine magazine) { this.magazine_DNA = magazine; return this; }
public Receiver offset(double f, double u, double s) { this.projectileOffset_DNA = Vec3.createVectorHelper(f, u, s); return this; }
public Receiver reload(int delay) {
return reload(delay, delay, 0);
}
public Receiver reload(int a, int b, int c) {
this.reloadBeginDuration_DNA = a;
this.reloadCycleDuration_DNA = b;
this.reloadEndDuration_DNA = c;
return this;
}
public Receiver canFire(BiFunction<ItemStack, LambdaContext, Boolean> lambda) { this.canFire_DNA = lambda; return this; }
public Receiver fire(BiConsumer<ItemStack, LambdaContext> lambda) { this.onFire_DNA = lambda; return this; }
public Receiver recoil(BiConsumer<ItemStack, LambdaContext> lambda) { this.onRecoil_DNA = lambda; return this; }

View File

@ -50,6 +50,7 @@ public class GunFactory {
XFactoryBlackPowder.init();
XFactory357.init();
XFactory44.init();
XFactory9mm.init();
/// PROXY BULLSHIT ///
MainRegistry.proxy.registerGunCfg();
@ -59,5 +60,6 @@ public class GunFactory {
STONE, STONE_AP, STONE_IRON, STONE_SHOT,
M357_SP, M357_FMJ, M357_JHP, M357_AP, M357_EXPRESS,
M44_SP, M44_FMJ, M44_JHP, M44_AP, M44_EXPRESS,
P9_SP, P9_FMJ, P9_JHP, P9_AP,
}
}

View File

@ -3,6 +3,7 @@ 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 static com.hbm.items.weapon.sedna.factory.XFactory9mm.*;
import java.util.function.BiConsumer;
@ -13,6 +14,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.ItemRenderGreasegun;
import com.hbm.render.item.weapon.sedna.ItemRenderHenry;
import com.hbm.render.item.weapon.sedna.ItemRenderPepperbox;
@ -27,6 +29,7 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_pepperbox, new ItemRenderPepperbox());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_atlas, new ItemRenderAtlas());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_henry, new ItemRenderHenry());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_greasegun, new ItemRenderGreasegun());
//PROJECTILES
ammo_debug.setRenderer(RENDER_STANDARD_BULLET);
ammo_debug_buckshot.setRenderer(RENDER_STANDARD_BULLET);
@ -40,11 +43,16 @@ public class GunFactoryClient {
m44_jhp.setRenderer(RENDER_STANDARD_BULLET);
m44_ap.setRenderer(RENDER_STANDARD_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_STANDARD_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);
((ItemGunBaseNT) ModItems.gun_greasegun).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
}
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_STANDARD_BULLET = (bullet, interp) -> {

View File

@ -62,7 +62,7 @@ public class GunStateDecider {
//if after reloading the gun can still reload, assume a tube mag and resume reloading
if(cfg.getReceivers(stack)[recIndex].getMagazine(stack).canReload(stack, player)) {
ItemGunBaseNT.setState(stack, GunState.RELOADING);
ItemGunBaseNT.setTimer(stack, cfg.getReceivers(stack)[recIndex].getReloadDuration(stack));
ItemGunBaseNT.setTimer(stack, rec.getReloadCycleDuration(stack));
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_CYCLE);
//if no more reloading can be done, go idle
} else {
@ -72,8 +72,8 @@ public class GunStateDecider {
ItemGunBaseNT.setTimer(stack, cfg.getJamDuration(stack));
ItemGunBaseNT.playAnimation(player, stack, AnimType.JAMMED);
} else {
ItemGunBaseNT.setState(stack, GunState.IDLE);
ItemGunBaseNT.setTimer(stack, 0);
ItemGunBaseNT.setState(stack, GunState.DRAWING);
ItemGunBaseNT.setTimer(stack, rec.getReloadEndDuration(stack));
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_END);
}
}

View File

@ -44,7 +44,7 @@ public class Lego {
if(mag.canReload(stack, ctx.player)) {
ItemGunBaseNT.setState(stack, GunState.RELOADING);
ItemGunBaseNT.setTimer(stack, rec.getReloadDuration(stack));
ItemGunBaseNT.setTimer(stack, rec.getReloadBeginDuration(stack));
ItemGunBaseNT.playAnimation(player, stack, mag.getAmount(stack) == 0 ? AnimType.RELOAD_EMPTY : AnimType.RELOAD);
} else {
ItemGunBaseNT.playAnimation(player, stack, AnimType.INSPECT);

View File

@ -111,6 +111,21 @@ public class Orchestras {
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.RELOAD) {
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 16) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
}
if(type == AnimType.RELOAD_CYCLE) {
if(timer == 0) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
}
if(type == AnimType.RELOAD_END) {
if(timer == 0) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 0.9F);
if(timer == 12) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 1F);
}
if(type == AnimType.JAMMED) {
if(timer == 0) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 0.9F);
if(timer == 12) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 1F);
if(timer == 36) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 1F);
if(timer == 44) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 1F);
}
if(type == AnimType.CYCLE) {
if(timer == 14) {
@ -124,9 +139,12 @@ public class Orchestras {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 12) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 1F);
}
if(type == AnimType.INSPECT) {
}
if(type == AnimType.JAMMED) {
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_GREASEGUN = (stack, ctx) -> {
EntityPlayer player = ctx.player;
AnimType type = ItemGunBaseNT.getLastAnim(stack);
int timer = ItemGunBaseNT.getAnimTimer(stack);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
};
}

View File

@ -44,7 +44,7 @@ public class XFactory44 {
ModItems.gun_henry = new ItemGunBaseNT(new GunConfig()
.dura(300).draw(15).inspect(23).jam(45).reloadSequential(true).crosshair(Crosshair.CIRCLE).smoke(true).orchestra(Orchestras.ORCHESTRA_HENRY)
.rec(new Receiver(0)
.dmg(12F).delay(16).reload(10).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(12F).delay(20).reload(25, 11, 18).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 14).addConfigs(m44_sp, m44_fmj, m44_jhp, m44_ap, m44_express))
.offset(0.75, -0.0625, -0.3125D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
@ -67,11 +67,27 @@ public class XFactory44 {
.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 RELOAD: return new BusAnimation();
case RELOAD_CYCLE: return new BusAnimation();
case RELOAD_END: return new BusAnimation();
case INSPECT: return new BusAnimation();
case JAMMED: return new BusAnimation();
case RELOAD: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(-60, 0, 0, 400, IType.SIN_FULL))
.addBus("TWIST", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, -90, 200, IType.SIN_FULL))
.addBus("BULLET", new BusAnimationSequence().addPos(0, 0, 0, 700).addPos(3, 0, -6, 0).addPos(0, 0, 1, 300, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL));
case RELOAD_CYCLE: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(-60, 0, 0, 0))
.addBus("TWIST", new BusAnimationSequence().addPos(0, 0, -90, 0))
.addBus("BULLET", new BusAnimationSequence().addPos(3, 0, -6, 0).addPos(0, 0, 1, 300, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL));
case RELOAD_END: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(-60, 0, 0, 300).addPos(0, 0, 0, 400, IType.SIN_FULL))
.addBus("TWIST", new BusAnimationSequence().addPos(0, 0, -90, 0).addPos(0, 0, 0, 200, IType.SIN_FULL))
.addBus("LEVER", new BusAnimationSequence().addPos(0, 0, 0, 700).addPos(-90, 0, 0, 200).addPos(0, 0, 0, 200))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 700).addPos(0, 0, 45, 200, IType.SIN_DOWN).addPos(0, 0, 0, 200, IType.SIN_UP));
case JAMMED: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(-60, 0, 0, 300).addPos(0, 0, 0, 400, IType.SIN_FULL))
.addBus("TWIST", new BusAnimationSequence().addPos(0, 0, -90, 0).addPos(0, 0, 0, 200, IType.SIN_FULL))
.addBus("LEVER", new BusAnimationSequence().addPos(0, 0, 0, 700).addPos(-90, 0, 0, 200).addPos(0, 0, 0, 200).addPos(0, 0, 0, 500).addPos(-90, 0, 0, 200).addPos(0, 0, 0, 200).addPos(0, 0, 0, 200).addPos(-90, 0, 0, 200).addPos(0, 0, 0, 200))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 700).addPos(0, 0, 45, 200, IType.SIN_DOWN).addPos(0, 0, 0, 200, IType.SIN_UP).addPos(0, 0, 0, 500).addPos(0, 0, 45, 200, IType.SIN_FULL).addPos(0, 0, 45, 600).addPos(0, 0, 0, 200, IType.SIN_FULL));
case INSPECT: return new BusAnimation()
.addBus("YEET", new BusAnimationSequence().addPos(0, 2, 0, 200, IType.SIN_DOWN).addPos(0, 0, 0, 200, IType.SIN_UP))
.addBus("ROLL", new BusAnimationSequence().addPos(0, 0, 360, 400));
}
return null;

View File

@ -0,0 +1,64 @@
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.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.item.ItemStack;
public class XFactory9mm {
public static BulletConfig p9_sp;
public static BulletConfig p9_fmj;
public static BulletConfig p9_jhp;
public static BulletConfig p9_ap;
public static void init() {
SpentCasing casing9 = new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_BRASS);
p9_sp = new BulletConfig().setItem(EnumAmmo.P9_SP)
.setCasing(casing9.clone().register("p9"));
p9_fmj = new BulletConfig().setItem(EnumAmmo.P9_FMJ).setDamage(0.8F).setArmorPiercing(0.1F)
.setCasing(casing9.clone().register("p9fmj"));
p9_jhp = new BulletConfig().setItem(EnumAmmo.P9_JHP).setDamage(1.5F).setArmorPiercing(-0.25F)
.setCasing(casing9.clone().register("p9jhp"));
p9_ap = new BulletConfig().setItem(EnumAmmo.P9_AP).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F)
.setCasing(casing9.clone().setColor(SpentCasing.COLOR_CASE_44).register("p9ap"));
ModItems.gun_greasegun = new ItemGunBaseNT(new GunConfig()
.dura(300).draw(15).inspect(23).jam(45).crosshair(Crosshair.L_CIRCLE).smoke(true).orchestra(Orchestras.ORCHESTRA_GREASEGUN)
.rec(new Receiver(0)
.dmg(5F).delay(5).auto(true).spread(0.015F).reload(25, 11, 18).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
.offset(0.75, -0.0625, -0.3125D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardConfiguration().anim(LAMBDA_GREASEGUN_ANIMS)
).setUnlocalizedName("gun_greasegun").setTextureName(RefStrings.MODID + ":gun_darter");
}
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_GREASEGUN_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation();
case CYCLE: return new BusAnimation();
case CYCLE_DRY: return new BusAnimation();
case RELOAD: return new BusAnimation();
case RELOAD_CYCLE: return new BusAnimation();
case RELOAD_END: return new BusAnimation();
case JAMMED: return new BusAnimation();
case INSPECT: return new BusAnimation();
}
return null;
};
}

View File

@ -853,6 +853,7 @@ public class ResourceManager {
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 IModelCustom greasegun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/greasegun.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"));
@ -966,6 +967,7 @@ public class ResourceManager {
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 greasegun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/greasegun.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -0,0 +1,77 @@
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 ItemRenderGreasegun 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, -2.625 / 8D, 1.125);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.greasegun_tex);
double scale = 0.375D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.greasegun.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glTranslated(0, 0, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderMuzzleFlash(gun.lastShot, 75, 10);
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, 2, 0);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.greasegun_tex);
ResourceManager.greasegun.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -42,12 +42,27 @@ public class ItemRenderHenry extends ItemRenderWeaponBase {
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER");
double[] lever = HbmAnimations.getRelevantTransformation("LEVER");
double[] turn = HbmAnimations.getRelevantTransformation("TURN");
double[] lift = HbmAnimations.getRelevantTransformation("LIFT");
double[] twist = HbmAnimations.getRelevantTransformation("TWIST");
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET");
double[] yeet = HbmAnimations.getRelevantTransformation("YEET");
double[] roll = HbmAnimations.getRelevantTransformation("ROLL");
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(yeet[0], yeet[1], yeet[2]);
GL11.glTranslated(0, 1, 0);
GL11.glRotated(roll[2], 0, 0, 1);
GL11.glTranslated(0, -1, 0);
GL11.glTranslated(0, -4, 4);
GL11.glRotated(lift[0], 1, 0, 0);
GL11.glTranslated(0, 4, -4);
GL11.glTranslated(0, 2, -4);
GL11.glRotated(equip[0], -1, 0, 0);
@ -82,9 +97,18 @@ public class ItemRenderHenry extends ItemRenderWeaponBase {
GL11.glTranslated(0, -0.25, 2.3125);
ResourceManager.henry.renderPart("Lever");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 1, 0);
GL11.glRotated(twist[2], 0, 0, 1);
GL11.glTranslated(0, -1, 0);
ResourceManager.henry.renderPart("Front");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(bullet[0], bullet[1], bullet[2] - 1);
ResourceManager.henry.renderPart("Bullet");
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
@ -99,7 +123,9 @@ public class ItemRenderHenry extends ItemRenderWeaponBase {
@Override
protected void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
GL11.glTranslated(0, 1, 3);
double scale = 1.75D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0.25, 3);
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB