greasy joe, horse leg and 🅱️untsman

This commit is contained in:
Bob 2024-10-06 22:37:16 +02:00
parent fef2074a09
commit cdec9d074d
63 changed files with 10134 additions and 13728 deletions

View File

@ -16,4 +16,5 @@
* The conveyor grabber should no longer skip over items when used in long lines
* Fixed a potential crash regarding crucibles
* 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 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

View File

@ -37,6 +37,8 @@ public class WeaponRecipes {
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() });
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() });
//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

@ -133,7 +133,7 @@ public class Mats {
public static final NTMMaterial MAT_OSMIRIDIUM = makeSmeltable(7699, OSMIRIDIUM, 0xDBE3EF, 0x7891BE, 0xACBDD9).setShapes(NUGGET, INGOT, CASTPLATE, WELDEDPLATE).m();
//Alloys
public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0xAFAFAF, 0x0F0F0F, 0x4A4A4A).setShapes(DUSTTINY, BOLT, WIRE, INGOT, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT, LIGHTBARREL, LIGHTRECEIVER).m();
public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0xAFAFAF, 0x0F0F0F, 0x4A4A4A).setShapes(DUSTTINY, BOLT, WIRE, INGOT, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT, LIGHTBARREL, LIGHTRECEIVER, GRIP).m();
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0xFFBA7D, 0xAF1700, 0xE44C0F).setShapes(WIRE, INGOT, DUST, BLOCK).m();
public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0xFF8330, 0x700000, 0xFF7318).setShapes(WIRE, INGOT, DUST, DENSEWIRE, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0x183039, 0x030B0B, 0x376373).setShapes(BOLT, INGOT, DUST, PIPE, BLOCK).m();

View File

@ -1627,6 +1627,10 @@ public class ModItems {
public static Item gun_atlas;
public static Item gun_henry;
public static Item gun_greasegun;
public static Item gun_maresleg;
public static Item gun_flaregun;
public static Item gun_heavy_revolver;
public static Item gun_carbine;
public static Item ammo_standard;
@ -7038,6 +7042,10 @@ public class ModItems {
GameRegistry.registerItem(gun_atlas, gun_atlas.getUnlocalizedName());
GameRegistry.registerItem(gun_henry, gun_henry.getUnlocalizedName());
GameRegistry.registerItem(gun_greasegun, gun_greasegun.getUnlocalizedName());
GameRegistry.registerItem(gun_maresleg, gun_maresleg.getUnlocalizedName());
GameRegistry.registerItem(gun_flaregun, gun_flaregun.getUnlocalizedName());
GameRegistry.registerItem(gun_heavy_revolver, gun_heavy_revolver.getUnlocalizedName());
GameRegistry.registerItem(gun_carbine, gun_carbine.getUnlocalizedName());
GameRegistry.registerItem(ammo_standard, ammo_standard.getUnlocalizedName());

View File

@ -26,8 +26,8 @@ public class GunConfig {
public static final String I_INSPECTDURATION = "I_INSPECTDURATION";
public static final String I_JAMDURATION = "I_JAMDURATION";
public static final String O_CROSSHAIR = "O_CROSSHAIR";
public static final String B_DOESSMOKE = "B_DOESSMOKE";
public static final String B_RELOADANIMATIONSEQUENTIAL = "B_RELOADANIMATIONSEQUENTIAL";
public static final String CON_SMOKE = "CON_SMOKE";
public static final String CON_ORCHESTRA = "CON_ORCHESTRA";
public static final String CON_ONPRESSPRIMARY = "CON_ONPRESSPRIMARY";
public static final String CON_ONPRESSSECONDARY = "CON_ONPRESSSECONDARY";
@ -50,8 +50,9 @@ public class GunConfig {
protected int inspectDuration_DNA = 0;
protected int jamDuration_DNA = 0;
protected Crosshair crosshair_DNA;
protected boolean doesSmoke_DNA;
protected boolean reloadAnimationsSequential_DNA;
/** Handles smoke clientside */
protected BiConsumer<ItemStack, LambdaContext> smokeHandler_DNA;
/** This piece only triggers during reloads, playing sounds depending on the reload's progress making reload sounds easier and synced to animations */
protected BiConsumer<ItemStack, LambdaContext> orchestra_DNA;
/** Lambda functions for clicking shit */
@ -72,15 +73,15 @@ public class GunConfig {
/* GETTERS */
public Receiver[] getReceivers(ItemStack stack) { return WeaponUpgradeManager.eval(receivers_DNA, stack, O_RECEIVERS, this); }
public float getDurability(ItemStack stack) { return WeaponUpgradeManager.eval(durability_DNA, stack, F_DURABILITY, this); }
public int getDrawDuration(ItemStack stack) { return WeaponUpgradeManager.eval(drawDuration_DNA, stack, I_DRAWDURATION, this); }
public int getInspectDuration(ItemStack stack) { return WeaponUpgradeManager.eval(inspectDuration_DNA, stack, I_INSPECTDURATION, this); }
public int getJamDuration(ItemStack stack) { return WeaponUpgradeManager.eval(jamDuration_DNA, stack, I_JAMDURATION, this); }
public Crosshair getCrosshair(ItemStack stack) { return WeaponUpgradeManager.eval(crosshair_DNA, stack, O_CROSSHAIR, this); }
public boolean getDoesSmoke(ItemStack stack) { return WeaponUpgradeManager.eval(doesSmoke_DNA, stack, B_DOESSMOKE, this); }
public boolean getReloadAnimSequential(ItemStack stack) { return WeaponUpgradeManager.eval(reloadAnimationsSequential_DNA, stack, B_RELOADANIMATIONSEQUENTIAL, this); }
public BiConsumer<ItemStack, LambdaContext> getOrchestra(ItemStack stack) { return WeaponUpgradeManager.eval(this.orchestra_DNA, stack, CON_ORCHESTRA, this); }
public Receiver[] getReceivers(ItemStack stack) { return WeaponUpgradeManager.eval(receivers_DNA, stack, O_RECEIVERS, this); }
public float getDurability(ItemStack stack) { return WeaponUpgradeManager.eval(durability_DNA, stack, F_DURABILITY, this); }
public int getDrawDuration(ItemStack stack) { return WeaponUpgradeManager.eval(drawDuration_DNA, stack, I_DRAWDURATION, this); }
public int getInspectDuration(ItemStack stack) { return WeaponUpgradeManager.eval(inspectDuration_DNA, stack, I_INSPECTDURATION, this); }
public int getJamDuration(ItemStack stack) { return WeaponUpgradeManager.eval(jamDuration_DNA, stack, I_JAMDURATION, this); }
public Crosshair getCrosshair(ItemStack stack) { return WeaponUpgradeManager.eval(crosshair_DNA, stack, O_CROSSHAIR, this); }
public boolean getReloadAnimSequential(ItemStack stack) { return WeaponUpgradeManager.eval(reloadAnimationsSequential_DNA, stack, B_RELOADANIMATIONSEQUENTIAL, this); }
public BiConsumer<ItemStack, LambdaContext> getSmokeHandler(ItemStack stack) { return WeaponUpgradeManager.eval(smokeHandler_DNA, stack, CON_SMOKE, this); }
public BiConsumer<ItemStack, LambdaContext> getOrchestra(ItemStack stack) { return WeaponUpgradeManager.eval(this.orchestra_DNA, stack, CON_ORCHESTRA, this); }
public BiConsumer<ItemStack, LambdaContext> getPressPrimary(ItemStack stack) { return WeaponUpgradeManager.eval(this.onPressPrimary_DNA, stack, CON_ONPRESSPRIMARY, this); }
public BiConsumer<ItemStack, LambdaContext> getPressSecondary(ItemStack stack) { return WeaponUpgradeManager.eval(this.onPressSecondary_DNA, stack, CON_ONPRESSSECONDARY, this); }
@ -105,9 +106,9 @@ public class GunConfig {
public GunConfig inspect(int inspect) { this.inspectDuration_DNA = inspect; return this; }
public GunConfig jam(int jam) { this.jamDuration_DNA = jam; return this; }
public GunConfig crosshair(Crosshair crosshair) { this.crosshair_DNA = crosshair; return this; }
public GunConfig smoke(boolean doesSmoke) { this.doesSmoke_DNA = doesSmoke; return this; }
public GunConfig reloadSequential(boolean flag) { this.reloadAnimationsSequential_DNA = flag; return this; }
public GunConfig smoke(BiConsumer<ItemStack, LambdaContext> smoke) { this.smokeHandler_DNA = smoke; return this; }
public GunConfig orchestra(BiConsumer<ItemStack, LambdaContext> orchestra) { this.orchestra_DNA = orchestra; return this; }
//press

View File

@ -29,7 +29,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
@ -124,8 +123,9 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isHeld) {
if(!(entity instanceof EntityPlayer)) return;
EntityPlayer player = (EntityPlayer) entity;
EntityPlayer player = entity instanceof EntityPlayer ? (EntityPlayer) entity : null;
GunConfig config = this.getConfig(stack);
LambdaContext ctx = new LambdaContext(config, player);
if(world.isRemote) {
@ -146,32 +146,8 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
aimingProgress = MathHelper.clamp_float(aimingProgress, 0F, 1F);
/// SMOKE NODES ///
if(config.getDoesSmoke(stack)) {
boolean smoking = lastShot + 2000 > System.currentTimeMillis();
if(!smoking && !smokeNodes.isEmpty()) smokeNodes.clear();
if(smoking) {
Vec3 prev = Vec3.createVectorHelper(-entity.motionX, -entity.motionY, -entity.motionZ);
prev.rotateAroundY((float) (entity.rotationYaw * Math.PI / 180D));
double accel = 15D;
double side = (entity.rotationYaw - player.prevRotationYawHead) * 0.1D;
double waggle = 0.025D;
for(SmokeNode node : smokeNodes) {
node.forward += -prev.zCoord * accel + world.rand.nextGaussian() * waggle;
node.lift += prev.yCoord + 1.5D;
node.side += prev.xCoord * accel + world.rand.nextGaussian() * waggle + side;
if(node.alpha > 0) node.alpha -= 0.025D;
node.width *= 1.15;
}
double alpha = (System.currentTimeMillis() - lastShot) / 2000D;
alpha = (1 - alpha) * 0.5D;
if(this.getState(stack) == GunState.RELOADING || smokeNodes.size() == 0) alpha = 0;
smokeNodes.add(new SmokeNode(alpha));
}
if(config.getSmokeHandler(stack) != null) {
config.getSmokeHandler(stack).accept(stack, ctx);
}
}
return;
@ -188,8 +164,6 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
return;
}
LambdaContext ctx = new LambdaContext(config, player);
BiConsumer<ItemStack, LambdaContext> orchestra = config.getOrchestra(stack);
if(orchestra != null) orchestra.accept(stack, ctx);

View File

@ -20,6 +20,7 @@ public class Receiver {
public static final String F_BASEDAMAGE = "F_BASEDAMAGE";
public static final String I_DELAYAFTERFIRE = "I_DELAYAFTERFIRE";
public static final String I_DELAYAFTERDRYFIRE = "I_DELAYAFTERDRYFIRE";
public static final String I_ROUNDSPERCYCLE = "I_ROUNDSPERCYCLE";
public static final String F_SPREADMOD = "F_SPREADMOD";
public static final String B_REFIREONHOLD = "B_REFIREONHOLD";
@ -29,6 +30,7 @@ public class Receiver {
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 I_RELOADCOCKONEMPTY = "I_RELOADCOCKONEMPTY";
public static final String S_FIRESOUND = "S_FIRESOUND";
public static final String F_FIREVOLUME = "F_FIREVOLUME";
public static final String F_FIREPITCH = "F_FIREPITCH";
@ -45,6 +47,7 @@ public class Receiver {
protected int index;
protected float baseDamage_DNA;
protected int delayAfterFire_DNA;
protected int delayAfterDryFire_DNA;
protected int roundsPerCycle_DNA = 1;
protected float spreadModExtra_DNA = 0F;
protected boolean refireOnHold_DNA = false;
@ -54,6 +57,7 @@ public class Receiver {
protected int reloadBeginDuration_DNA;
protected int reloadCycleDuration_DNA;
protected int reloadEndDuration_DNA;
protected int reloadCockOnEmpty_DNA;
protected String fireSound_DNA;
protected float fireVolume_DNA = 1.0F;
protected float firePitch_DNA = 1.0F;
@ -66,6 +70,7 @@ public class Receiver {
/* GETTERS */
public float getBaseDamage(ItemStack stack) { return WeaponUpgradeManager.eval(this.baseDamage_DNA, stack, F_BASEDAMAGE, this); }
public int getDelayAfterFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.delayAfterFire_DNA, stack, I_DELAYAFTERFIRE, this); }
public int getDelayAfterDryFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.delayAfterDryFire_DNA, stack, I_DELAYAFTERDRYFIRE, this); }
public int getRoundsPerCycle(ItemStack stack) { return WeaponUpgradeManager.eval(this.roundsPerCycle_DNA, stack, I_ROUNDSPERCYCLE, this); }
public float getGunSpread(ItemStack stack) { return WeaponUpgradeManager.eval(this.spreadModExtra_DNA, stack, F_SPREADMOD, this); }
public boolean getRefireOnHold(ItemStack stack) { return WeaponUpgradeManager.eval(this.refireOnHold_DNA, stack, B_REFIREONHOLD, this); }
@ -75,6 +80,7 @@ public class Receiver {
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 int getReloadCockOnEmpty(ItemStack stack) { return WeaponUpgradeManager.eval(this.reloadCockOnEmpty_DNA, stack, I_RELOADCOCKONEMPTY, 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); }
@ -87,7 +93,8 @@ public class Receiver {
/* SETTERS */
public Receiver dmg(float dmg) { this.baseDamage_DNA = dmg; return this; }
public Receiver delay(int delay) { this.delayAfterFire_DNA = delay; return this; }
public Receiver delay(int delay) { this.delayAfterFire_DNA = this.delayAfterDryFire_DNA = delay; return this; }
public Receiver dry(int delay) { this.delayAfterDryFire_DNA = delay; return this; }
public Receiver rounds(int rounds) { this.roundsPerCycle_DNA = rounds; return this; }
public Receiver spread(float spread) { this.spreadModExtra_DNA = spread; return this; }
public Receiver auto(boolean auto) { this.refireOnHold_DNA = auto; return this; }
@ -98,12 +105,13 @@ public class Receiver {
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);
return reload(delay, delay, 0, 0);
}
public Receiver reload(int a, int b, int c) {
this.reloadBeginDuration_DNA = a;
this.reloadCycleDuration_DNA = b;
this.reloadEndDuration_DNA = c;
public Receiver reload(int begin, int cycle, int end, int cock) {
this.reloadBeginDuration_DNA = begin;
this.reloadCycleDuration_DNA = cycle;
this.reloadEndDuration_DNA = end;
this.reloadCockOnEmpty_DNA = cock;
return this;
}

View File

@ -18,8 +18,10 @@ public class WeaponUpgradeManager {
}
/** Scrapes all upgrades, iterates over them and evaluates the given value. The parent (i.e. holder of the base value)
* is passed for context (so upgrades can differentiate primary and secondary receivers for example) */
* is passed for context (so upgrades can differentiate primary and secondary receivers for example). Passing a null
* stack causes the base value to be returned. */
public static <T> T eval(T base, ItemStack stack, String key, Object parent) {
if(stack == null) return base;
ItemStack[] upgrades = getUpgrades(stack);
if(upgrades != null) for(ItemStack upgradeStack : upgrades) {

View File

@ -35,7 +35,7 @@ public class GunFactory {
/// GUNS ///
ModItems.gun_debug = new ItemGunBaseNT(new GunConfig()
.dura(600F).draw(15).jam(23).inspect(23).crosshair(Crosshair.L_CLASSIC).smoke(true).orchestra(Orchestras.DEBUG_ORCHESTRA)
.dura(600F).draw(15).jam(23).inspect(23).crosshair(Crosshair.L_CLASSIC).smoke(Lego.LAMBDA_STANDARD_SMOKE).orchestra(Orchestras.DEBUG_ORCHESTRA)
.rec(new Receiver(0)
.dmg(10F).delay(14).reload(46).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 12).addConfigs(ammo_debug, ammo_debug_buckshot))
@ -51,6 +51,9 @@ public class GunFactory {
XFactory357.init();
XFactory44.init();
XFactory9mm.init();
XFactory12ga.init();
XFactory40mm.init();
XFactory762mm.init();
/// PROXY BULLSHIT ///
MainRegistry.proxy.registerGunCfg();
@ -61,5 +64,8 @@ public class GunFactory {
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,
G12_BP, G12_BP_MAGNUM, G12_BP_SLUG, G12,
R762_SP, R762_FMJ, R762_JHP, R762_AP, R762_DU,
G40_FLARE, G40,
}
}

View File

@ -1,8 +1,11 @@
package com.hbm.items.weapon.sedna.factory;
import static com.hbm.items.weapon.sedna.factory.GunFactory.*;
import static com.hbm.items.weapon.sedna.factory.XFactory12ga.*;
import static com.hbm.items.weapon.sedna.factory.XFactory357.*;
import static com.hbm.items.weapon.sedna.factory.XFactory40mm.*;
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;
@ -12,13 +15,14 @@ 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.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;
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 {
@ -30,29 +34,47 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_atlas, new ItemRenderAtlas());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_henry, new ItemRenderHenry());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_greasegun, new ItemRenderGreasegun());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_maresleg, new ItemRenderMaresleg());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flaregun, new ItemRenderFlaregun());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_heavy_revolver, new ItemRenderHeavyRevolver());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_carbine, new ItemRenderCarbine());
//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_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_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_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);
//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);
((ItemGunBaseNT) ModItems.gun_maresleg).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_flaregun).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_heavy_revolver).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_carbine).config_DNA.hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
}
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_STANDARD_BULLET = (bullet, interp) -> {
@ -61,12 +83,24 @@ public class GunFactoryClient {
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;
@ -115,4 +149,57 @@ public class GunFactoryClient {
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();
};
}

View File

@ -6,6 +6,7 @@ import java.util.function.BooleanSupplier;
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.mags.IMagazine;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.render.anim.HbmAnimations.AnimType;
@ -56,11 +57,12 @@ public class GunStateDecider {
EntityPlayer player = ctx.player;
GunConfig cfg = ctx.config;
Receiver rec = cfg.getReceivers(stack)[recIndex];
IMagazine mag = rec.getMagazine(stack);
rec.getMagazine(stack).reloadAction(stack, player);
mag.reloadAction(stack, player);
//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)) {
if(mag.canReload(stack, player)) {
ItemGunBaseNT.setState(stack, GunState.RELOADING);
ItemGunBaseNT.setTimer(stack, rec.getReloadCycleDuration(stack));
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_CYCLE);
@ -73,7 +75,8 @@ public class GunStateDecider {
ItemGunBaseNT.playAnimation(player, stack, AnimType.JAMMED);
} else {
ItemGunBaseNT.setState(stack, GunState.DRAWING);
ItemGunBaseNT.setTimer(stack, rec.getReloadEndDuration(stack));
int duration = rec.getReloadEndDuration(stack) + (mag.getAmountBeforeReload(stack) <= 0 ? rec.getReloadCockOnEmpty(stack) : 0);
ItemGunBaseNT.setTimer(stack, duration);
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_END);
}
}
@ -108,6 +111,10 @@ public class GunStateDecider {
int remaining = rec.getRoundsPerCycle(stack) - 1;
for(int i = 0; i < remaining; i++) if(rec.getCanFire(stack).apply(stack, ctx)) rec.getOnFire(stack).accept(stack, ctx);
//if not, revert to idle
} else if(rec.getDoesDryFire(stack)) {
ItemGunBaseNT.setState(stack, GunState.DRAWING);
ItemGunBaseNT.setTimer(stack, rec.getDelayAfterDryFire(stack));
ItemGunBaseNT.playAnimation(player, stack, AnimType.CYCLE_DRY);
} else {
ItemGunBaseNT.setState(stack, GunState.IDLE);
ItemGunBaseNT.setTimer(stack, 0);

View File

@ -1,5 +1,6 @@
package com.hbm.items.weapon.sedna.factory;
import java.util.List;
import java.util.Random;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
@ -10,6 +11,7 @@ import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.SmokeNode;
import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.render.anim.BusAnimation;
@ -43,9 +45,10 @@ public class Lego {
IMagazine mag = rec.getMagazine(stack);
if(mag.canReload(stack, ctx.player)) {
mag.setAmountBeforeReload(stack, mag.getAmount(stack));
ItemGunBaseNT.setState(stack, GunState.RELOADING);
ItemGunBaseNT.setTimer(stack, rec.getReloadBeginDuration(stack));
ItemGunBaseNT.playAnimation(player, stack, mag.getAmount(stack) == 0 ? AnimType.RELOAD_EMPTY : AnimType.RELOAD);
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD);
} else {
ItemGunBaseNT.playAnimation(player, stack, AnimType.INSPECT);
}
@ -73,11 +76,11 @@ public class Lego {
ItemGunBaseNT.setState(stack, GunState.COOLDOWN);
ItemGunBaseNT.setTimer(stack, rec.getDelayAfterFire(stack));
} else {
ItemGunBaseNT.playAnimation(player, stack, AnimType.CYCLE_DRY);
if(rec.getDoesDryFire(stack)) {
ItemGunBaseNT.setState(stack, GunState.COOLDOWN);
ItemGunBaseNT.setTimer(stack, rec.getDelayAfterFire(stack));
ItemGunBaseNT.playAnimation(player, stack, AnimType.CYCLE_DRY);
ItemGunBaseNT.setState(stack, GunState.DRAWING);
ItemGunBaseNT.setTimer(stack, rec.getDelayAfterDryFire(stack));
}
}
}
@ -89,6 +92,42 @@ public class Lego {
//ItemGunBaseNT.recoilHorizontal += ctx.player.getRNG().nextGaussian() * 1.5;
};
/** Default smoke. */
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_SMOKE = (stack, ctx) -> {
handleStandardSmoke(ctx.player, stack, 2000, 0.025D, 1.15D);
};
public static void handleStandardSmoke(EntityPlayer player, ItemStack stack, int smokeDuration, double alphaDecay, double widthGrowth) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
long lastShot = gun.lastShot;
List<SmokeNode> smokeNodes = gun.smokeNodes;
boolean smoking = lastShot + smokeDuration > System.currentTimeMillis();
if(!smoking && !smokeNodes.isEmpty()) smokeNodes.clear();
if(smoking) {
Vec3 prev = Vec3.createVectorHelper(-player.motionX, -player.motionY, -player.motionZ);
prev.rotateAroundY((float) (player.rotationYaw * Math.PI / 180D));
double accel = 15D;
double side = (player.rotationYaw - player.prevRotationYawHead) * 0.1D;
double waggle = 0.025D;
for(SmokeNode node : smokeNodes) {
node.forward += -prev.zCoord * accel + player.worldObj.rand.nextGaussian() * waggle;
node.lift += prev.yCoord + 1.5D;
node.side += prev.xCoord * accel + player.worldObj.rand.nextGaussian() * waggle + side;
if(node.alpha > 0) node.alpha -= alphaDecay;
node.width *= widthGrowth;
}
double alpha = (System.currentTimeMillis() - lastShot) / (double) smokeDuration;
alpha = (1 - alpha) * 0.5D;
if(gun.getState(stack) == GunState.RELOADING || smokeNodes.size() == 0) alpha = 0;
smokeNodes.add(new SmokeNode(alpha));
}
}
/** Toggles isAiming. Used by keybinds. */
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TOGGLE_AIM = (stack, ctx) -> { ItemGunBaseNT.setIsAiming(stack, !ItemGunBaseNT.getIsAiming(stack)); };
@ -116,6 +155,10 @@ public class Lego {
double heightOffset = offset.yCoord;
double sideOffset = ItemGunBaseNT.getIsAiming(stack) ? 0 : offset.zCoord;
/*forwardOffset = 0.75;
heightOffset = -0.0625;
sideOffset = -0.1875D;*/
int projectiles = config.projectilesMin;
if(config.projectilesMax > config.projectilesMin) projectiles += player.getRNG().nextInt(config.projectilesMax - config.projectilesMin + 1);

View File

@ -119,7 +119,7 @@ public class Orchestras {
}
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(timer == 12 && ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmountBeforeReload(stack) <= 0) 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);
@ -146,5 +146,161 @@ public class Orchestras {
AnimType type = ItemGunBaseNT.getLastAnim(stack);
int timer = ItemGunBaseNT.getAnimTimer(stack);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.EQUIP) {
if(timer == 5) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.openLatch", 1F, 1F);
}
if(type == AnimType.CYCLE) {
if(timer == 2) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.55, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 0.8F);
if(timer == 11) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 0.8F);
}
if(type == AnimType.RELOAD) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 24) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 36) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 0.8F);
}
if(type == AnimType.INSPECT) {
if(timer == 5) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.8F);
if(timer == 26) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallInsert", 1F, 1.25F);
}
if(type == AnimType.JAMMED) {
if(timer == 11) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 0.8F);
if(timer == 26) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 0.8F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_MARESLEG = (stack, ctx) -> {
EntityPlayer player = ctx.player;
AnimType type = ItemGunBaseNT.getLastAnim(stack);
int timer = ItemGunBaseNT.getAnimTimer(stack);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.RELOAD) {
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.8F);
if(timer == 16) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.shotgunReload", 1F, 1F);
}
if(type == AnimType.RELOAD_CYCLE) {
if(timer == 0) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.shotgunReload", 1F, 1F);
}
if(type == AnimType.RELOAD_END) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.7F);
}
if(type == AnimType.JAMMED) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.7F);
if(timer == 17) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
if(timer == 29) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
}
if(type == AnimType.CYCLE) {
if(timer == 14) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
casing.setupSmoke(1F, 0.5D, 60, 20);
CasingCreator.composeEffect(player.worldObj, player, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, 0.18, -0.12, casing.getName());
}
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_FLAREGUN = (stack, ctx) -> {
EntityPlayer player = ctx.player;
AnimType type = ItemGunBaseNT.getLastAnim(stack);
int timer = ItemGunBaseNT.getAnimTimer(stack);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.RELOAD) {
if(timer == 0) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 0.8F);
if(timer == 4) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
casing.setupSmoke(1F, 0.5D, 60, 20);
CasingCreator.composeEffect(player.worldObj, player, 0.625, -0.125, aiming ? -0.125 : -0.375D, -0.12, 0.18, 0, casing.getName());
}
if(timer == 16) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.insertCanister", 1F, 1F);
if(timer == 24) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
}
if(type == AnimType.JAMMED) {
if(timer == 10) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 0.8F);
if(timer == 29) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
}
if(type == AnimType.CYCLE) {
if(timer == 12) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 1F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 12) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_NOPIP = (stack, ctx) -> {
EntityPlayer player = ctx.player;
AnimType type = ItemGunBaseNT.getLastAnim(stack);
int timer = ItemGunBaseNT.getAnimTimer(stack);
if(type == AnimType.RELOAD) {
if(timer == 3) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 1F);
if(timer == 10) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 34) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
if(timer == 40) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 16) {
Receiver rec = ctx.config.getReceivers(stack)[0];
IMagazine mag = rec.getMagazine(stack);
SpentCasing casing = mag.getCasing(stack);
for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(player.worldObj, player, 0.25, -0.125, -0.125, player.getRNG().nextGaussian() * 0.01 - 0.05, player.getRNG().nextGaussian() * 0.01, player.getRNG().nextGaussian() * 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE) {
if(timer == 11) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 1F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 11) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 1F);
}
if(type == AnimType.INSPECT) {
if(timer == 3) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 1F);
if(timer == 16) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_CARBIBE = (stack, ctx) -> {
EntityPlayer player = ctx.player;
AnimType type = ItemGunBaseNT.getLastAnim(stack);
int timer = ItemGunBaseNT.getAnimTimer(stack);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.CYCLE) {
if(timer == 2) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.06, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 0.8F);
}
if(type == AnimType.RELOAD) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 26) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magInsert", 1F, 1F);
}
if(type == AnimType.RELOAD_END) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 0.8F);
}
if(type == AnimType.JAMMED) {
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 0.8F);
if(timer == 31) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 0.8F);
}
if(type == AnimType.INSPECT) {
if(timer == 6) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 30) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
}
};
}

View File

@ -0,0 +1,90 @@
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.MagazineSingleReload;
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.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.item.ItemStack;
public class XFactory12ga {
public static BulletConfig g12_bp;
public static BulletConfig g12_bp_magnum;
public static BulletConfig g12_bp_slug;
public static BulletConfig g12;
public static void init() {
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setProjectiles(8, 8).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_BRASS).setScale(1.5F).register("12GA_BP"));
g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setProjectiles(4, 4).setSpread(0.05F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_BRASS).setScale(1.5F).register("12GA_BP_MAGNUM"));
g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_BRASS).setScale(1.5F).register("12GA_BP_SLUG"));
g12 = new BulletConfig().setItem(EnumAmmo.G12).setProjectiles(8, 8).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
ModItems.gun_maresleg = new ItemGunBaseNT(new GunConfig()
.dura(300).draw(20).inspect(39).jam(45).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE).orchestra(Orchestras.ORCHESTRA_MARESLEG)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(22, 10, 13, 0).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(g12_bp, g12_bp_magnum, g12_bp_slug, g12))
.offset(0.75, -0.0625, -0.1875D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardConfiguration().anim(LAMBDA_MARESLEG_ANIMS)
).setUnlocalizedName("gun_maresleg").setTextureName(RefStrings.MODID + ":gun_darter");
}
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MARESLEG_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 500, 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(-85, 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()
.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:
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack).getReceivers(stack)[0].getMagazine(stack).getAmount(stack) <= 0;
return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(30, 0, 0, 400, IType.SIN_FULL))
.addBus("LEVER", new BusAnimationSequence().addPos(0, 0, 0, 400).addPos(-85, 0, 0, 200))
.addBus("SHELL", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(0, 0.25, -3, 0).addPos(0, empty ? 0.25 : 0.125, -1.5, 150, IType.SIN_UP).addPos(0, empty ? 0.25 : -0.25, 0, 150, IType.SIN_DOWN))
.addBus("FLAG", new BusAnimationSequence().addPos(0, 0, 0, empty ? 900 : 0).addPos(1, 1, 1, 0));
case RELOAD_CYCLE: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(30, 0, 0, 0))
.addBus("LEVER", new BusAnimationSequence().addPos(-85, 0, 0, 0))
.addBus("SHELL", new BusAnimationSequence().addPos(0, 0.25, -3, 0).addPos(0, 0.125, -1.5, 150, IType.SIN_UP).addPos(0, -0.125, 0, 150, IType.SIN_DOWN))
.addBus("FLAG", new BusAnimationSequence().addPos(1, 1, 1, 0));
case RELOAD_END: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(30, 0, 0, 0).addPos(30, 0, 0, 250).addPos(0, 0, 0, 400, IType.SIN_FULL))
.addBus("LEVER", new BusAnimationSequence().addPos(-85, 0, 0, 0).addPos(0, 0, 0, 200))
.addBus("FLAG", new BusAnimationSequence().addPos(1, 1, 1, 0));
case JAMMED: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(30, 0, 0, 0).addPos(30, 0, 0, 250).addPos(0, 0, 0, 400, IType.SIN_FULL))
.addBus("LEVER", new BusAnimationSequence().addPos(-85, 0, 0, 0).addPos(-15, 0, 0, 200).addPos(-15, 0, 0, 650).addPos(-85, 0, 0, 200).addPos(-15, 0, 0, 200).addPos(-15, 0, 0, 200).addPos(-85, 0, 0, 200).addPos(0, 0, 0, 200))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 850).addPos(0, 0, 45, 200, IType.SIN_DOWN).addPos(0, 0, 45, 800).addPos(0, 0, 0, 200, IType.SIN_UP))
.addBus("FLAG", new BusAnimationSequence().addPos(1, 1, 1, 0));
case INSPECT: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(-35, 0, 0, 300, IType.SIN_FULL).addPos(-35, 0, 0, 1150).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 450).addPos(0, 0, -90, 500, IType.SIN_FULL).addPos(0, 0, -90, 500).addPos(0, 0, 0, 500, IType.SIN_FULL));
}
return null;
};
}

View File

@ -30,11 +30,11 @@ public class XFactory357 {
m357_sp = new BulletConfig().setItem(EnumAmmo.M357_SP);
m357_fmj = new BulletConfig().setItem(EnumAmmo.M357_FMJ).setDamage(0.8F).setArmorPiercing(0.1F);
m357_jhp = new BulletConfig().setItem(EnumAmmo.M357_JHP).setDamage(1.5F).setArmorPiercing(-0.25F);
m357_ap = new BulletConfig().setItem(EnumAmmo.M357_AP).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F);
m357_ap = new BulletConfig().setItem(EnumAmmo.M357_AP).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setArmorPiercing(0.15F);
m357_express = new BulletConfig().setItem(EnumAmmo.M357_EXPRESS).setDoesPenetrate(true).setDamage(1.5F).setArmorPiercing(0.1F).setWear(1.5F);
ModItems.gun_atlas = new ItemGunBaseNT(new GunConfig()
.dura(300).draw(4).inspect(23).jam(45).crosshair(Crosshair.CIRCLE).smoke(true).orchestra(Orchestras.ORCHESTRA_ATLAS)
.dura(300).draw(4).inspect(23).jam(45).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE).orchestra(Orchestras.ORCHESTRA_ATLAS)
.rec(new Receiver(0)
.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))
@ -47,14 +47,14 @@ public class XFactory357 {
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_ATLAS_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("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 350, 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, 550).addPos(0, 0, 0, 200))
.addBus("DRUM", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(0, 0, 1, 200));
.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, 550).addPos(0, 0, 0, 200))
.addBus("DRUM", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(0, 0, 1, 200));
case CYCLE_DRY: return new BusAnimation()
.addBus("HAMMER", new BusAnimationSequence().addPos(0, 0, 1, 50).addPos(0, 0, 1, 550).addPos(0, 0, 0, 200))
.addBus("DRUM", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(0, 0, 1, 200));
.addBus("HAMMER", new BusAnimationSequence().addPos(0, 0, 1, 50).addPos(0, 0, 1, 550).addPos(0, 0, 0, 200))
.addBus("DRUM", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(0, 0, 1, 200));
case RELOAD: return new BusAnimation()
.addBus("LATCH", new BusAnimationSequence().addPos(0, 0, 90, 300).addPos(0, 0, 90, 2000).addPos(0, 0, 0, 150))
.addBus("FRONT", new BusAnimationSequence().addPos(0, 0, 0, 200).addPos(0, 0, 45, 150).addPos(0, 0, 45, 2000).addPos(0, 0, 0, 75))

View File

@ -0,0 +1,72 @@
package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer;
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.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
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.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.item.ItemStack;
public class XFactory40mm {
public static BulletConfig g40_flare;
public static BulletConfig g40;
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(2F).register("G40"));
ModItems.gun_flaregun = new ItemGunBaseNT(new GunConfig()
.dura(100).draw(7).inspect(39).jam(33).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE).orchestra(Orchestras.ORCHESTRA_FLAREGUN)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(28).sound("hbm:weapon.fire.blackPowder", 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))
.setupStandardConfiguration().anim(LAMBDA_FLAREGUN_ANIMS)
).setUnlocalizedName("gun_flaregun").setTextureName(RefStrings.MODID + ":gun_darter");
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
Lego.handleStandardSmoke(ctx.player, stack, 1500, 0.025D, 1.05D);
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_FLAREGUN_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 350, 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(15, 0, 0, 50).addPos(15, 0, 0, 550).addPos(0, 0, 0, 100));
case CYCLE_DRY: return new BusAnimation()
.addBus("HAMMER", new BusAnimationSequence().addPos(15, 0, 0, 50).addPos(15, 0, 0, 550).addPos(0, 0, 0, 100));
case RELOAD: return new BusAnimation()
.addBus("OPEN", new BusAnimationSequence().addPos(45, 0, 0, 200, IType.SIN_FULL).addPos(45, 0, 0, 750).addPos(0, 0, 0, 200, IType.SIN_UP))
.addBus("SHELL", new BusAnimationSequence().addPos(4, -8, -4, 0).addPos(4, -8, -4, 200).addPos(0, 0, -5, 500, IType.SIN_DOWN).addPos(0, 0, 0, 200, IType.SIN_UP))
.addBus("FLIP", new BusAnimationSequence().addPos(0, 0, 0, 200).addPos(25, 0, 0, 200, IType.SIN_DOWN).addPos(25, 0, 0, 800).addPos(0, 0, 0, 200, IType.SIN_DOWN));
case JAMMED: return new BusAnimation()
.addBus("OPEN", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(45, 0, 0, 200, IType.SIN_FULL).addPos(45, 0, 0, 500).addPos(0, 0, 0, 200, IType.SIN_UP))
.addBus("FLIP", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, 0, 200).addPos(25, 0, 0, 200, IType.SIN_DOWN).addPos(25, 0, 0, 550).addPos(0, 0, 0, 200, IType.SIN_DOWN));
case INSPECT: return new BusAnimation()
.addBus("FLIP", new BusAnimationSequence().addPos(-360 * 3, 0, 0, 1500, IType.SIN_FULL));
}
return null;
};
}

View File

@ -2,6 +2,7 @@ package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiFunction;
import com.hbm.handler.CasingEjector;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.Crosshair;
@ -9,6 +10,7 @@ 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.items.weapon.sedna.mags.MagazineSingleReload;
import com.hbm.lib.RefStrings;
import com.hbm.particle.SpentCasing;
@ -36,20 +38,33 @@ public class XFactory44 {
.setCasing(casing44.clone().register("m44fmj"));
m44_jhp = new BulletConfig().setItem(EnumAmmo.M44_JHP).setDamage(1.5F).setArmorPiercing(-0.25F)
.setCasing(casing44.clone().register("m44jhp"));
m44_ap = new BulletConfig().setItem(EnumAmmo.M44_AP).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F)
m44_ap = new BulletConfig().setItem(EnumAmmo.M44_AP).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setArmorPiercing(0.15F)
.setCasing(casing44.clone().setColor(SpentCasing.COLOR_CASE_44).register("m44ap"));
m44_express = new BulletConfig().setItem(EnumAmmo.M44_EXPRESS).setDoesPenetrate(true).setDamage(1.5F).setArmorPiercing(0.1F).setWear(1.5F)
.setCasing(casing44.clone().register("m44express"));
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)
.dura(300).draw(15).inspect(23).jam(45).reloadSequential(true).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE).orchestra(Orchestras.ORCHESTRA_HENRY)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(25, 11, 18).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(12F).delay(20).reload(25, 11, 14, 8).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)
.offset(0.75, -0.0625, -0.1875D)
.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");
ModItems.gun_heavy_revolver = new ItemGunBaseNT(new GunConfig()
.dura(600F).draw(10).jam(23).inspect(23).crosshair(Crosshair.L_CLASSIC).smoke(Lego.LAMBDA_STANDARD_SMOKE).orchestra(Orchestras.ORCHESTRA_NOPIP)
.rec(new Receiver(0)
.dmg(10F).delay(14).reload(46).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 6).addConfigs(m44_sp, m44_fmj, m44_jhp, m44_ap, m44_express))
.ejector(new CasingEjector().setMotion(0, -0.1, 0).setAngleRange(0.01F, 0.025F))
.offset(0.75, -0.0625, -0.3125D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY) .pr(Lego.LAMBDA_STANDARD_RELOAD) .pt(Lego.LAMBDA_TOGGLE_AIM)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_NOPIP_ANIMS)
).setUnlocalizedName("gun_heavy_revolver").setTextureName(RefStrings.MODID + ":gun_darter");
}
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_HENRY_ANIMS = (stack, type) -> {
@ -75,11 +90,13 @@ public class XFactory44 {
.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()
case RELOAD_END:
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack).getReceivers(stack)[0].getMagazine(stack).getAmountBeforeReload(stack) <= 0;
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));
.addBus("LEVER", new BusAnimationSequence().addPos(0, 0, 0, 700).addPos(empty ? -90 : 0, 0, 0, 200).addPos(0, 0, 0, 200))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 700).addPos(0, 0, empty ? 45 : 0, 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))
@ -90,6 +107,31 @@ public class XFactory44 {
.addBus("ROLL", new BusAnimationSequence().addPos(0, 0, 360, 400));
}
return null;
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_NOPIP_ANIMS = (stack, type) -> {
switch(type) {
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, 400).addPos(0, 0, 0, 200))
.addBus("DRUM", new BusAnimationSequence().addPos(0, 0, 0, 450).addPos(0, 0, 1, 200));
case CYCLE_DRY: return new BusAnimation()
.addBus("HAMMER", new BusAnimationSequence().addPos(0, 0, 1, 50).addPos(0, 0, 1, 300 + 100).addPos(0, 0, 0, 200))
.addBus("DRUM", new BusAnimationSequence().addPos(0, 0, 0, 450).addPos(0, 0, 1, 200));
case EQUIP: return new BusAnimation().addBus("ROTATE", new BusAnimationSequence().addPos(90, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
case RELOAD: return new BusAnimation()
.addBus("RELAOD_TILT", new BusAnimationSequence().addPos(-15, 0, 0, 100).addPos(65, 0, 0, 100).addPos(45, 0, 0, 50).addPos(0, 0, 0, 200).addPos(0, 0, 0, 1450).addPos(-80, 0, 0, 100).addPos(-80, 0, 0, 100).addPos(0, 0, 0, 200))
.addBus("RELOAD_CYLINDER", new BusAnimationSequence().addPos(0, 0, 0, 200).addPos(90, 0, 0, 100).addPos(90, 0, 0, 1700).addPos(0, 0, 0, 70))
.addBus("RELOAD_LIFT", new BusAnimationSequence().addPos(0, 0, 0, 350).addPos(-45, 0, 0, 250).addPos(-45, 0, 0, 350).addPos(-15, 0, 0, 200).addPos(-15, 0, 0, 1050).addPos(0, 0, 0, 100))
.addBus("RELOAD_JOLT", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(2, 0, 0, 50).addPos(0, 0, 0, 100))
.addBus("RELOAD_BULLETS", new BusAnimationSequence().addPos(0, 0, 0, 650).addPos(10, 0, 0, 300).addPos(10, 0, 0, 200).addPos(0, 0, 0, 700))
.addBus("RELOAD_BULLETS_CON", new BusAnimationSequence().addPos(1, 0, 0, 0).addPos(1, 0, 0, 950).addPos(0, 0, 0, 1 ) );
case INSPECT:
case JAMMED: return new BusAnimation()
.addBus("RELAOD_TILT", new BusAnimationSequence().addPos(-15, 0, 0, 100).addPos(65, 0, 0, 100).addPos(45, 0, 0, 50).addPos(0, 0, 0, 200).addPos(0, 0, 0, 200).addPos(-80, 0, 0, 100).addPos(-80, 0, 0, 100).addPos(0, 0, 0, 200))
.addBus("RELOAD_CYLINDER", new BusAnimationSequence().addPos(0, 0, 0, 200).addPos(90, 0, 0, 100).addPos(90, 0, 0, 450).addPos(0, 0, 0, 70));
}
return null;
};
}

View File

@ -0,0 +1,92 @@
package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer;
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.ItemGunBaseNT.LambdaContext;
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.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.item.ItemStack;
public class XFactory762mm {
public static BulletConfig r762_sp;
public static BulletConfig r762_fmj;
public static BulletConfig r762_jhp;
public static BulletConfig r762_ap;
public static BulletConfig r762_du;
public static void init() {
SpentCasing casing9 = new SpentCasing(CasingType.BOTTLENECK).setColor(SpentCasing.COLOR_CASE_BRASS);
r762_sp = new BulletConfig().setItem(EnumAmmo.R762_SP)
.setCasing(casing9.clone().register("r762"));
r762_fmj = new BulletConfig().setItem(EnumAmmo.R762_FMJ).setDamage(0.8F).setArmorPiercing(0.1F)
.setCasing(casing9.clone().register("r762fmj"));
r762_jhp = new BulletConfig().setItem(EnumAmmo.R762_JHP).setDamage(1.5F).setArmorPiercing(-0.25F)
.setCasing(casing9.clone().register("r762jhp"));
r762_ap = new BulletConfig().setItem(EnumAmmo.R762_AP).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setArmorPiercing(0.15F)
.setCasing(casing9.clone().setColor(SpentCasing.COLOR_CASE_44).register("r762ap"));
r762_du = new BulletConfig().setItem(EnumAmmo.R762_DU).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(2.5F).setArmorPiercing(0.25F)
.setCasing(casing9.clone().setColor(SpentCasing.COLOR_CASE_44).register("r762du"));
ModItems.gun_carbine = new ItemGunBaseNT(new GunConfig()
.dura(3_000).draw(10).inspect(31).jam(60).reloadSequential(true).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE).orchestra(Orchestras.ORCHESTRA_CARBIBE)
.rec(new Receiver(0)
.dmg(5F).delay(5).dry(15).spread(0.0F).reload(30, 0, 15, 0).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 14).addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du))
.offset(1, -0.0625 * 2.5, -0.25D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardConfiguration().anim(LAMBDA_CARBINE_ANIMS)
).setUnlocalizedName("gun_carbine").setTextureName(RefStrings.MODID + ":gun_darter");
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
Lego.handleStandardSmoke(ctx.player, stack, 1500, 0.075D, 1.1D);
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_CARBINE_ANIMS = (stack, type) -> {
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack).getReceivers(stack)[0].getMagazine(stack).getAmount(stack) <= 0;
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.25 : -0.5, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, -1, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus(empty ? "NULL" : "REL", new BusAnimationSequence().addPos(0, 0, 0.25, 50).addPos(0, 0.125, 1.25, 100, IType.SIN_UP));
case CYCLE_DRY: return new BusAnimation()
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, -1, 100, IType.SIN_DOWN).addPos(0, 0, -1, 50).addPos(0, 0, 0, 100, IType.SIN_UP));
case RELOAD: return new BusAnimation()
.addBus("MAG", new BusAnimationSequence().addPos(0, -4, 0, 250, IType.SIN_UP).addPos(0, -4, 0, 750).addPos(0, 0, 0, 500, IType.SIN_DOWN))
.addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 1000))
.addBus("BULLET", new BusAnimationSequence().addPos(empty ? 1 : 0, 0, 0, 0).addPos(0, 0, 0, 1000));
case RELOAD_END: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(-25, 0, 0, 0).addPos(-25, 0, 0, 750).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -1, 100, IType.SIN_DOWN).addPos(0, 0, -1, 50).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus("REL", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, 0.25, 150).addPos(0, 0.125, 1.25, 100, IType.SIN_UP));
case JAMMED: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(-25, 0, 0, 0).addPos(-25, 0, 0, 750).addPos(0, 0, 0, 500, IType.SIN_FULL).addPos(0, 0, 0, 250).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 750).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -1, 100, IType.SIN_DOWN).addPos(0, 0, -1, 50).addPos(0, 0, -0.25, 100, IType.SIN_UP).addPos(0, 0, -0.25, 1250).addPos(0, 0, -1, 100, IType.SIN_DOWN).addPos(0, 0, -1, 50).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus("REL", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, 0.25, 150).addPos(0, 0.125, 1, 100, IType.SIN_UP).addPos(0, 0.125, 1, 1250).addPos(0, 0.125, 0.25, 100, IType.SIN_DOWN).addPos(0, 0.125, 1, 100, IType.SIN_UP));
case INSPECT: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 1500).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, -0.75, 150, IType.SIN_DOWN).addPos(0, 0, -0.75, 1000).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus(empty ? "NULL" : "REL", new BusAnimationSequence().addPos(0, 0.125, 1.25, 0).addPos(0, 0.125, 1.25, 500).addPos(0, 0.125, 0.5, 150, IType.SIN_DOWN).addPos(0, 0.125, 0.5, 1000).addPos(0, 0.125, 1.25, 100, IType.SIN_UP));
}
return null;
};
}

View File

@ -1,5 +1,6 @@
package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import com.hbm.items.ModItems;
@ -8,12 +9,15 @@ import com.hbm.items.weapon.sedna.Crosshair;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.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.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.item.ItemStack;
@ -33,30 +37,51 @@ public class XFactory9mm {
.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)
p9_ap = new BulletConfig().setItem(EnumAmmo.P9_AP).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setArmorPiercing(0.15F)
.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)
.dura(3_000).draw(15).inspect(31).jam(55).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE).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)
.dmg(5F).delay(4).dry(40).auto(true).spread(0.015F).reload(60).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)
.offset(1, -0.0625 * 2.5, -0.25D)
.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");
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
Lego.handleStandardSmoke(ctx.player, stack, 2000, 0.05D, 1.1D);
};
@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();
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(80, 0, 0, 0).addPos(80, 0, 0, 500).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("STOCK", new BusAnimationSequence().addPos(0, 0, -4, 0).addPos(0, 0, -4, 200).addPos(0, 0, 0, 300, IType.SIN_FULL));
case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.25 : -0.5, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("FLAP", new BusAnimationSequence().addPos(0, 0, 15, 100, IType.SIN_DOWN).addPos(0, 0, -5, 100, IType.SIN_FULL).addPos(0, 0, 0, 50, IType.SIN_FULL));
case CYCLE_DRY: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 750).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, -45, 250, IType.SIN_FULL).addPos(0, 0, -45, 750).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("HANDLE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, 0, 250).addPos(-90, 0, 0, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL));
case RELOAD:
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack).getReceivers(stack)[0].getMagazine(stack).getAmountBeforeReload(stack) <= 0;
return new BusAnimation()
.addBus("MAG", new BusAnimationSequence().addPos(0, -8, 0, 250, IType.SIN_UP).addPos(0, -8, 0, 750).addPos(0, 0, 0, 500, IType.SIN_DOWN))
.addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 1750).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 1750).addPos(0, 0, -45, 250, IType.SIN_FULL).addPos(0, 0, -45, 500).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("HANDLE", new BusAnimationSequence().addPos(0, 0, 0, 2000).addPos(-90, 0, 0, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("BULLET", new BusAnimationSequence().addPos(empty ? 1 : 0, 0, 0, 0).addPos(0, 0, 0, 1000));
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, 1500).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, -45, 250, IType.SIN_FULL).addPos(0, 0, -45, 1500).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("HANDLE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, 0, 250).addPos(-90, 0, 0, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL).addPos(0, 0, 0, 250).addPos(-90, 0, 0, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL));
case INSPECT: return new BusAnimation()
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, -45, 150).addPos(0, 0, 45, 150).addPos(0, 0, 45, 50).addPos(0, 0, 0, 250).addPos(0, 0, 0, 500).addPos(0, 0, 45, 150).addPos(0, 0, -45, 150).addPos(0, 0, 0, 150))
.addBus("FLAP", new BusAnimationSequence().addPos(0, 0, 0, 300).addPos(0, 0, 180, 150).addPos(0, 0, 180, 850).addPos(0, 0, 0, 150));
}
return null;

View File

@ -28,7 +28,7 @@ public class XFactoryBlackPowder {
BulletConfig shot = new BulletConfig().setItem(EnumAmmo.STONE_SHOT).setSpread(0.1F).setRicochetAngle(45).setProjectiles(6, 6).setDamage(0.5F);
ModItems.gun_pepperbox = new ItemGunBaseNT(new GunConfig()
.dura(300).draw(4).inspect(23).jam(58).crosshair(Crosshair.CIRCLE).smoke(true).orchestra(Orchestras.ORCHESTRA_PEPPERBOX)
.dura(300).draw(4).inspect(23).jam(58).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE).orchestra(Orchestras.ORCHESTRA_PEPPERBOX)
.rec(new Receiver(0)
.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))

View File

@ -33,4 +33,9 @@ public interface IMagazine<T> {
public String reportAmmoStateForHUD(ItemStack stack);
/** Casing config to use then ejecting */
public SpentCasing getCasing(ItemStack stack);
/** When reloading, remember the amount before reload is initiated */
public void setAmountBeforeReload(ItemStack stack, int amount);
/** Amount of rouns before reload has started. Do note that the NBT stack sync likely arrives
* after the animation packets, so for RELOAD type anims, use the live ammo count instead! */
public int getAmountBeforeReload(ItemStack stack);
}

View File

@ -14,6 +14,7 @@ public abstract class MagazineSingleTypeBase implements IMagazine<BulletConfig>
public static final String KEY_MAG_COUNT = "magcount";
public static final String KEY_MAG_TYPE = "magtype";
public static final String KEY_MAG_PREV = "magprev";
protected List<BulletConfig> acceptedBullets = new ArrayList();
@ -66,6 +67,9 @@ public abstract class MagazineSingleTypeBase implements IMagazine<BulletConfig>
@Override public int getCapacity(ItemStack stack) { return capacity; }
@Override public int getAmount(ItemStack stack) { return getMagCount(stack, index); }
@Override public void setAmount(ItemStack stack, int amount) { setMagCount(stack, index, amount); }
@Override public void setAmountBeforeReload(ItemStack stack, int amount) { ItemGunBaseNT.setValueInt(stack, KEY_MAG_PREV + index, amount); }
@Override public int getAmountBeforeReload(ItemStack stack) { return ItemGunBaseNT.getValueInt(stack, KEY_MAG_PREV + index); }
// MAG TYPE //
public static int getMagType(ItemStack stack, int index) { return ItemGunBaseNT.getValueInt(stack, KEY_MAG_TYPE + index); } //TODO: replace with named tags to avoid ID shifting

View File

@ -854,6 +854,9 @@ public class ResourceManager {
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 IModelCustom maresleg = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/maresleg.obj")).asVBO();
public static final IModelCustom flaregun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flaregun.obj")).asVBO();
public static final IModelCustom carbine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/carbine.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"));
@ -968,6 +971,10 @@ public class ResourceManager {
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 maresleg_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/maresleg.png");
public static final ResourceLocation flaregun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flaregun.png");
public static final ResourceLocation heavy_revolver_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/heavy_revolver.png");
public static final ResourceLocation carbine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/huntsman.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -19,7 +19,7 @@ public class HbmAnimations {
public static enum AnimType {
RELOAD, //either a full reload or start of a reload
RELOAD_EMPTY, //same as reload, but the mag is completely empty
@Deprecated RELOAD_EMPTY, //same as reload, but the mag is completely empty
RELOAD_CYCLE, //animation that plays for every individual round (for shotguns and similar single round loading weapons)
RELOAD_END, //animation for transitioning from our RELOAD_CYCLE to idle
CYCLE, //animation for every firing cycle

View File

@ -0,0 +1,114 @@
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 ItemRenderCarbine 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.5F * offset, -1.5F * offset, 0.875F * offset,
0, -6.25 / 8D, 0.25);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.carbine_tex);
double scale = 0.5D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] slide = HbmAnimations.getRelevantTransformation("SLIDE");
double[] mag = HbmAnimations.getRelevantTransformation("MAG");
double[] lift = HbmAnimations.getRelevantTransformation("LIFT");
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET");
double[] rel = HbmAnimations.getRelevantTransformation("REL");
GL11.glTranslated(0, -1, -2);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 1, 2);
GL11.glTranslated(0, 0, -2);
GL11.glRotated(lift[0], 1, 0, 0);
GL11.glTranslated(0, 0, 2);
GL11.glTranslated(0, 0, recoil[2]);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.carbine.renderPart("Gun");
GL11.glPushMatrix();
GL11.glTranslated(0, 0, slide[2]);
ResourceManager.carbine.renderPart("Slide");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(mag[0], mag[1], mag[2]);
ResourceManager.carbine.renderPart("Magazine");
GL11.glTranslated(rel[0], rel[1], rel[2]);
if(bullet[0] != 1) ResourceManager.carbine.renderPart("Bullet");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 1, 8);
GL11.glRotated(90, 0, 1, 0);
this.renderSmokeNodes(gun.smokeNodes, 0.25D);
GL11.glPopMatrix();
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);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderMuzzleFlash(gun.lastShot, 75, 7.5);
GL11.glPopMatrix();
}
@Override
protected void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
double scale = 1.375D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, 2);
}
@Override
protected void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 1.375D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
GL11.glTranslated(-0.5, 0, 0);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.carbine_tex);
ResourceManager.carbine.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -0,0 +1,111 @@
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 ItemRenderFlaregun extends ItemRenderWeaponBase {
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
@Override
protected void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 0.875);
float offset = 0.8F;
standardAimingTransform(stack,
-1.25F * offset, -1.5F * offset, 2F * offset,
0, -5.5 / 8D, 1);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.flaregun_tex);
double scale = 0.125D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER");
double[] open = HbmAnimations.getRelevantTransformation("OPEN");
double[] shell = HbmAnimations.getRelevantTransformation("SHELL");
double[] flip = HbmAnimations.getRelevantTransformation("FLIP");
GL11.glTranslated(recoil[0], recoil[1], recoil[2]);
GL11.glRotated(recoil[2] * 10, 1, 0, 0);
GL11.glRotated(flip[0], 1, 0, 0);
GL11.glTranslated(0, 0, -8);
GL11.glRotated(equip[0], -1, 0, 0);
GL11.glTranslated(0, 0, 8);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.flaregun.renderPart("Gun");
GL11.glPushMatrix();
GL11.glTranslated(0, 1.8125, -4);
GL11.glRotated(hammer[0] - 15, 1, 0, 0);
GL11.glTranslated(0, -1.8125, 4);
ResourceManager.flaregun.renderPart("Hammer");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 2.156, 1.78);
GL11.glRotated(open[0], 1, 0, 0);
GL11.glTranslated(0, -2.156, -1.78);
ResourceManager.flaregun.renderPart("Barrel");
GL11.glTranslated(shell[0], shell[1], shell[2]);
ResourceManager.flaregun.renderPart("Flare");
GL11.glPopMatrix();
double smokeScale = 0.5;
GL11.glPushMatrix();
GL11.glTranslated(0, 4, 9);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(smokeScale, smokeScale, smokeScale);
this.renderSmokeNodes(gun.smokeNodes, 2.5D);
GL11.glTranslated(0, 0, 0.1);
this.renderSmokeNodes(gun.smokeNodes, 2D);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
protected void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
double scale = 0.5D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0.25, 3);
}
@Override
protected void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 1D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
GL11.glTranslated(-0.5, 0, 0);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.flaregun_tex);
ResourceManager.flaregun.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -20,7 +20,7 @@ public class ItemRenderGreasegun extends ItemRenderWeaponBase {
float offset = 0.8F;
standardAimingTransform(stack,
-1.25F * offset, -1F * offset, 1.75F * offset,
-1.5F * offset, -1F * offset, 1.75F * offset,
0, -2.625 / 8D, 1.125);
}
@ -33,10 +33,73 @@ public class ItemRenderGreasegun extends ItemRenderWeaponBase {
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] stock = HbmAnimations.getRelevantTransformation("STOCK");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] flap = HbmAnimations.getRelevantTransformation("FLAP");
double[] lift = HbmAnimations.getRelevantTransformation("LIFT");
double[] handle = HbmAnimations.getRelevantTransformation("HANDLE");
double[] mag = HbmAnimations.getRelevantTransformation("MAG");
double[] turn = HbmAnimations.getRelevantTransformation("TURN");
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET");
GL11.glTranslated(0, -3, -3);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 3, 3);
GL11.glTranslated(0, -3, -3);
GL11.glRotated(lift[0], 1, 0, 0);
GL11.glTranslated(0, 3, 3);
GL11.glRotated(turn[2], 0, 0, 1);
GL11.glTranslated(0, 0, recoil[2]);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.greasegun.renderAll();
ResourceManager.greasegun.renderPart("Gun");
GL11.glPushMatrix();
GL11.glTranslated(0, 0, -4 - stock[2]);
ResourceManager.greasegun.renderPart("Stock");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(mag[0], mag[1], mag[2]);
ResourceManager.greasegun.renderPart("Magazine");
if(bullet[0] != 1) ResourceManager.greasegun.renderPart("Bullet");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, -1.4375, -0.125);
GL11.glRotated(handle[0], 1, 0, 0);
GL11.glTranslated(0, 1.4375, 0.125);
ResourceManager.greasegun.renderPart("Handle");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0.53125, 0);
GL11.glRotated(flap[2], 0, 0, 1);
GL11.glTranslated(0, -0.5125, 0);
ResourceManager.greasegun.renderPart("Flap");
GL11.glPopMatrix();
double smokeScale = 0.25;
GL11.glPushMatrix();
GL11.glTranslated(-0.25, 0, 1.5);
GL11.glRotated(turn[2], 0, 0, -1);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(smokeScale, smokeScale, smokeScale);
this.renderSmokeNodes(gun.smokeNodes, 1D);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, 8);
GL11.glRotated(turn[2], 0, 0, -1);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(smokeScale, smokeScale, smokeScale);
this.renderSmokeNodes(gun.smokeNodes, 1D);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
@ -44,7 +107,7 @@ public class ItemRenderGreasegun extends ItemRenderWeaponBase {
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);
this.renderMuzzleFlash(gun.lastShot, 75, 7.5);
GL11.glPopMatrix();
}

View File

@ -0,0 +1,135 @@
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 ItemRenderHeavyRevolver extends ItemRenderWeaponBase {
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
@Override
protected void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 1);
float offset = 0.8F;
standardAimingTransform(stack,
-1.0F * offset, -0.75F * offset, 1F * offset,
0, -3.875 / 8D, 0);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
double scale = 0.125D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(90, 0, 1, 0);
double[] equipSpin = HbmAnimations.getRelevantTransformation("ROTATE");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] reloadLift = HbmAnimations.getRelevantTransformation("RELOAD_LIFT");
double[] reloadJolt = HbmAnimations.getRelevantTransformation("RELOAD_JOLT");
double[] reloadTilt = HbmAnimations.getRelevantTransformation("RELAOD_TILT");
double[] cylinderFlip = HbmAnimations.getRelevantTransformation("RELOAD_CYLINDER");
double[] reloadBullets = HbmAnimations.getRelevantTransformation("RELOAD_BULLETS");
GL11.glTranslated(6, -3, 0);
GL11.glRotated(equipSpin[0], 0, 0, 1);
GL11.glTranslated(-6, 3, 0);
standardAimingTransform(stack, 0, 0, recoil[2], -recoil[2], 0, 0);
GL11.glRotated(recoil[2] * 10, 0, 0, 1);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glPushMatrix();
GL11.glTranslated(-9, 2.5, 0);
GL11.glRotated(recoil[2] * -10, 0, 0, 1);
this.renderSmokeNodes(gun.smokeNodes, 0.5D);
GL11.glPopMatrix();
GL11.glRotated(reloadLift[0], 0, 0, 1);
GL11.glTranslated(reloadJolt[0], 0, 0);
GL11.glRotated(reloadTilt[0], 1, 0, 0);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.heavy_revolver_tex);
ResourceManager.lilmac.renderPart("Gun");
GL11.glPushMatrix();
GL11.glRotated(cylinderFlip[0], 1, 0, 0);
ResourceManager.lilmac.renderPart("Pivot");
GL11.glTranslated(0, 1.75, 0);
GL11.glRotated(HbmAnimations.getRelevantTransformation("DRUM")[2] * -60, 1, 0, 0);
GL11.glTranslated(0, -1.75, 0);
ResourceManager.lilmac.renderPart("Cylinder");
GL11.glTranslated(reloadBullets[0], reloadBullets[1], reloadBullets[2]);
if(HbmAnimations.getRelevantTransformation("RELOAD_BULLETS_CON")[0] != 1)
ResourceManager.lilmac.renderPart("Bullets");
ResourceManager.lilmac.renderPart("Casings");
GL11.glPopMatrix();
GL11.glPushMatrix(); /// HAMMER ///
GL11.glTranslated(4, 1.25, 0);
GL11.glRotated(-30 + 30 * HbmAnimations.getRelevantTransformation("HAMMER")[2], 0, 0, 1);
GL11.glTranslated(-4, -1.25, 0);
ResourceManager.lilmac.renderPart("Hammer");
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glTranslated(0.125, 2.5, 0);
this.renderGapFlash(gun.lastShot);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(-9.5, 2.5, 0);
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
//this.renderMuzzleFlash(gun.lastShot);
GL11.glPopMatrix();
}
@Override
protected void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
GL11.glScaled(0.75, 0.75, 0.75);
GL11.glTranslated(0, 1, 3);
}
@Override
protected void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 1.25D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glRotated(90, 0, 1, 0);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.heavy_revolver_tex);
ResourceManager.lilmac.renderPart("Gun");
ResourceManager.lilmac.renderPart("Cylinder");
ResourceManager.lilmac.renderPart("Bullets");
ResourceManager.lilmac.renderPart("Casings");
ResourceManager.lilmac.renderPart("Pivot");
ResourceManager.lilmac.renderPart("Hammer");
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -0,0 +1,128 @@
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 ItemRenderMaresleg 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, 2F * offset,
0, -3.875 / 8D, 1);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.maresleg_tex);
double scale = 0.375D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] lever = HbmAnimations.getRelevantTransformation("LEVER");
double[] turn = HbmAnimations.getRelevantTransformation("TURN");
double[] lift = HbmAnimations.getRelevantTransformation("LIFT");
double[] shell = HbmAnimations.getRelevantTransformation("SHELL");
double[] flag = HbmAnimations.getRelevantTransformation("FLAG");
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, 0, -4);
GL11.glRotated(lift[0], 1, 0, 0);
GL11.glTranslated(0, 0, 4);
GL11.glTranslated(0, 0, -4);
GL11.glRotated(equip[0], -1, 0, 0);
GL11.glTranslated(0, 0, 4);
GL11.glPushMatrix();
GL11.glTranslated(0, 1, 8);
GL11.glRotated(turn[2], 0, 0, -1);
GL11.glRotated(90, 0, 1, 0);
this.renderSmokeNodes(gun.smokeNodes, 0.25D);
GL11.glPopMatrix();
ResourceManager.maresleg.renderPart("Gun");
ResourceManager.maresleg.renderPart("Stock");
ResourceManager.maresleg.renderPart("Barrel");
GL11.glPushMatrix();
GL11.glTranslated(0, 0.125, -2.875);
GL11.glRotated(lever[0], 1, 0, 0);
GL11.glTranslated(0, -0.125, 2.875);
ResourceManager.maresleg.renderPart("Lever");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(shell[0], shell[1] - 0.75, shell[2]);
ResourceManager.maresleg.renderPart("Shell");
GL11.glPopMatrix();
if(flag[0] != 0) {
GL11.glPushMatrix();
GL11.glTranslated(0, -0.5, 0);
ResourceManager.maresleg.renderPart("Shell");
GL11.glPopMatrix();
}
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);
double scale = 1.75D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0.25, 3);
}
@Override
protected void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 1.4375D;
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.maresleg_tex);
ResourceManager.maresleg.renderPart("Gun");
ResourceManager.maresleg.renderPart("Stock");
ResourceManager.maresleg.renderPart("Barrel");
ResourceManager.maresleg.renderPart("Lever");
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -149,7 +149,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
connections = connectionsDouble / 2;
connectionsControlled = connectionsControlledDouble / 2;
this.coreHeatCapacity = this.coreHeatCapacityBase + this.heatsinkCount * this.coreHeatCapacityBase / 20;
this.coreHeatCapacity = this.coreHeatCapacityBase + this.heatsinkCount / 20 * this.coreHeatCapacityBase;
}
@Override

View File

@ -11,6 +11,8 @@ import api.hbm.fluid.IPipeNet;
import api.hbm.fluid.PipeNet;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.tileentity.IFluidCopiable;
import com.hbm.util.Compat;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
@ -74,7 +76,7 @@ public class TileEntityPipeBaseNT extends TileEntity implements IFluidConductor,
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
TileEntity te = Compat.getTileStandard(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
if(te instanceof IFluidConductor) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -1,18 +0,0 @@
{
"pack" : {
"pack_format" : 1,
"description" : "NTM language pack"
},
"language" : {
"te_ST" : {
"name" : "This is a testing language",
"region" : "ST",
"bidirectional" : false
},
"en_NT" : {
"name" : "Advanced English",
"region" : "Minecraftia",
"bidirectional" : false
}
}
}