mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-03-12 04:35:36 +00:00
generic animation enum selection, still item specific but now a lot easier to refactor to non-item animations
This commit is contained in:
parent
ada1b5245d
commit
a79125b94d
@ -7,8 +7,8 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import com.hbm.items.weapon.sedna.Crosshair;
|
import com.hbm.items.weapon.sedna.Crosshair;
|
||||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ public class GunConfiguration implements Cloneable {
|
|||||||
public int durability;
|
public int durability;
|
||||||
|
|
||||||
//animations!
|
//animations!
|
||||||
public HashMap<AnimType, BusAnimation> animations = new HashMap<AnimType, BusAnimation>();
|
public HashMap<GunAnimation, BusAnimation> animations = new HashMap<GunAnimation, BusAnimation>();
|
||||||
//lazy-ish loading for animations, required for loading animations from ResourceManager, since that occurs after we've initialised the guns
|
//lazy-ish loading for animations, required for loading animations from ResourceManager, since that occurs after we've initialised the guns
|
||||||
public Consumer<Void> loadAnimations;
|
public Consumer<Void> loadAnimations;
|
||||||
public boolean animationsLoaded = false;
|
public boolean animationsLoaded = false;
|
||||||
|
|||||||
@ -1,30 +1,25 @@
|
|||||||
package com.hbm.items;
|
package com.hbm.items;
|
||||||
|
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
import com.hbm.packet.toclient.GunAnimationPacket;
|
import com.hbm.packet.toclient.HbmAnimationPacket;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public interface IAnimatedItem {
|
public interface IAnimatedItem<T extends Enum<?>> {
|
||||||
|
|
||||||
// Fetch the animation for a given type
|
// Fetch the animation for a given type
|
||||||
public BusAnimation getAnimation(AnimType type, ItemStack stack);
|
public BusAnimation getAnimation(T type, ItemStack stack);
|
||||||
|
|
||||||
// Run the swing animation
|
// Runtime erasure means we have to explicitly give the class a second time :(
|
||||||
public default void playAnimation(EntityPlayer player) {
|
public Class<T> getEnum();
|
||||||
playAnimation(player, AnimType.CYCLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run a specified animation
|
// Run a specified animation
|
||||||
public default void playAnimation(EntityPlayer player, AnimType type) {
|
public default void playAnimation(EntityPlayer player, T type) {
|
||||||
if(player instanceof EntityPlayerMP) {
|
if(player instanceof EntityPlayerMP) {
|
||||||
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(type.ordinal(), 0, 0), (EntityPlayerMP) player);
|
PacketDispatcher.wrapper.sendTo(new HbmAnimationPacket(type.ordinal(), 0, 0), (EntityPlayerMP) player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,16 +7,14 @@ import com.hbm.items.ModItems;
|
|||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.ToolAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
|
|
||||||
import api.hbm.block.IToolable;
|
import api.hbm.block.IToolable;
|
||||||
import api.hbm.block.IToolable.ToolType;
|
import api.hbm.block.IToolable.ToolType;
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -27,7 +25,7 @@ import net.minecraft.util.DamageSource;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class ItemBoltgun extends Item implements IAnimatedItem {
|
public class ItemBoltgun extends Item implements IAnimatedItem<ToolAnimation> {
|
||||||
|
|
||||||
public ItemBoltgun() {
|
public ItemBoltgun() {
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
@ -74,7 +72,7 @@ public class ItemBoltgun extends Item implements IAnimatedItem {
|
|||||||
data.setByte("count", (byte)1);
|
data.setByte("count", (byte)1);
|
||||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, entity.posX, entity.posY + entity.height / 2 - entity.yOffset, entity.posZ), new TargetPoint(world.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 50));
|
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, entity.posX, entity.posY + entity.height / 2 - entity.yOffset, entity.posZ), new TargetPoint(world.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 50));
|
||||||
|
|
||||||
playAnimation(player);
|
playAnimation(player, ToolAnimation.SWING);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -107,7 +105,7 @@ public class ItemBoltgun extends Item implements IAnimatedItem {
|
|||||||
data.setByte("count", (byte)1);
|
data.setByte("count", (byte)1);
|
||||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, x + fX + dir.offsetX * off, y + fY + dir.offsetY * off, z + fZ + dir.offsetZ * off), new TargetPoint(world.provider.dimensionId, x, y, z, 50));
|
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, x + fX + dir.offsetX * off, y + fY + dir.offsetY * off, z + fZ + dir.offsetZ * off), new TargetPoint(world.provider.dimensionId, x, y, z, 50));
|
||||||
|
|
||||||
playAnimation(player);
|
playAnimation(player, ToolAnimation.SWING);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -117,11 +115,16 @@ public class ItemBoltgun extends Item implements IAnimatedItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public Class<ToolAnimation> getEnum() {
|
||||||
public BusAnimation getAnimation(AnimType type, ItemStack stack) {
|
return ToolAnimation.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusAnimation getAnimation(ToolAnimation type, ItemStack stack) {
|
||||||
return new BusAnimation()
|
return new BusAnimation()
|
||||||
.addBus("RECOIL", new BusAnimationSequence()
|
.addBus("RECOIL", new BusAnimationSequence()
|
||||||
.addPos(1, 0, 1, 50)
|
.addPos(1, 0, 1, 50)
|
||||||
.addPos(0, 0, 1, 100));
|
.addPos(0, 0, 1, 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,17 +3,17 @@ package com.hbm.items.tool;
|
|||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.items.IAnimatedItem;
|
import com.hbm.items.IAnimatedItem;
|
||||||
import com.hbm.items.IHeldSoundProvider;
|
import com.hbm.items.IHeldSoundProvider;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.ToolAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.HbmAnimations;
|
import com.hbm.render.anim.HbmAnimations;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class ItemChainsaw extends ItemToolAbilityFueled implements IHeldSoundProvider, IAnimatedItem {
|
public class ItemChainsaw extends ItemToolAbilityFueled implements IHeldSoundProvider, IAnimatedItem<ToolAnimation> {
|
||||||
|
|
||||||
public ItemChainsaw(float damage, double movement, ToolMaterial material, EnumToolType type, int maxFuel, int consumption, int fillRate, FluidType... acceptedFuels) {
|
public ItemChainsaw(float damage, double movement, ToolMaterial material, EnumToolType type, int maxFuel, int consumption, int fillRate, FluidType... acceptedFuels) {
|
||||||
super(damage, movement, material, type, maxFuel, consumption, fillRate, acceptedFuels);
|
super(damage, movement, material, type, maxFuel, consumption, fillRate, acceptedFuels);
|
||||||
@ -28,13 +28,13 @@ public class ItemChainsaw extends ItemToolAbilityFueled implements IHeldSoundPro
|
|||||||
if(stack.getItemDamage() >= stack.getMaxDamage())
|
if(stack.getItemDamage() >= stack.getMaxDamage())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
playAnimation((EntityPlayer) entityLiving);
|
playAnimation((EntityPlayer) entityLiving, ToolAnimation.SWING);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BusAnimation getAnimation(AnimType type, ItemStack stack) {
|
public BusAnimation getAnimation(ToolAnimation type, ItemStack stack) {
|
||||||
int forward = 150;
|
int forward = 150;
|
||||||
int sideways = 100;
|
int sideways = 100;
|
||||||
int retire = 200;
|
int retire = 200;
|
||||||
@ -70,4 +70,9 @@ public class ItemChainsaw extends ItemToolAbilityFueled implements IHeldSoundPro
|
|||||||
.addPos(0, 0, 0, retire));
|
.addPos(0, 0, 0, retire));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<ToolAnimation> getEnum() {
|
||||||
|
return ToolAnimation.class;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,14 +8,12 @@ import com.google.common.collect.Multimap;
|
|||||||
import com.hbm.handler.threading.PacketThreading;
|
import com.hbm.handler.threading.PacketThreading;
|
||||||
import com.hbm.items.IAnimatedItem;
|
import com.hbm.items.IAnimatedItem;
|
||||||
import com.hbm.items.IEquipReceiver;
|
import com.hbm.items.IEquipReceiver;
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
import com.hbm.items.tool.ItemSwordAbility;
|
import com.hbm.items.tool.ItemSwordAbility;
|
||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.ToolAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.HbmAnimations;
|
import com.hbm.render.anim.HbmAnimations;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.render.anim.HbmAnimations.Animation;
|
|
||||||
import com.hbm.util.ShadyUtil;
|
import com.hbm.util.ShadyUtil;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
@ -38,7 +36,7 @@ import net.minecraft.util.EnumChatFormatting;
|
|||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver, IAnimatedItem {
|
public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver, IAnimatedItem<ToolAnimation> {
|
||||||
|
|
||||||
public ItemCrucible(float damage, double movement, ToolMaterial material) {
|
public ItemCrucible(float damage, double movement, ToolMaterial material) {
|
||||||
super(damage, movement, material);
|
super(damage, movement, material);
|
||||||
@ -55,7 +53,7 @@ public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver, IA
|
|||||||
World world = player.worldObj;
|
World world = player.worldObj;
|
||||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.cDeploy", 1.0F, 1.0F);
|
world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.cDeploy", 1.0F, 1.0F);
|
||||||
|
|
||||||
playAnimation(player, AnimType.EQUIP);
|
playAnimation(player, ToolAnimation.EQUIP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +70,7 @@ public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver, IA
|
|||||||
if(stack.getItemDamage() >= stack.getMaxDamage())
|
if(stack.getItemDamage() >= stack.getMaxDamage())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
playAnimation((EntityPlayerMP)entityLiving, AnimType.CYCLE);
|
playAnimation((EntityPlayerMP)entityLiving, ToolAnimation.SWING);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -139,9 +137,9 @@ public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver, IA
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BusAnimation getAnimation(AnimType type, ItemStack stack) {
|
public BusAnimation getAnimation(ToolAnimation type, ItemStack stack) {
|
||||||
/* crucible deploy */
|
/* crucible deploy */
|
||||||
if(type == AnimType.EQUIP) {
|
if(type == ToolAnimation.EQUIP) {
|
||||||
|
|
||||||
return new BusAnimation()
|
return new BusAnimation()
|
||||||
.addBus("GUARD_ROT", new BusAnimationSequence()
|
.addBus("GUARD_ROT", new BusAnimationSequence()
|
||||||
@ -151,7 +149,7 @@ public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver, IA
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* crucible swing */
|
/* crucible swing */
|
||||||
if(type == AnimType.CYCLE) {
|
if(type == ToolAnimation.SWING) {
|
||||||
|
|
||||||
if(HbmAnimations.getRelevantTransformation("SWING_ROT")[0] == 0) {
|
if(HbmAnimations.getRelevantTransformation("SWING_ROT")[0] == 0) {
|
||||||
|
|
||||||
@ -182,4 +180,10 @@ public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver, IA
|
|||||||
private void playSwing(float pitchProbablyIDontFuckingCare) {
|
private void playSwing(float pitchProbablyIDontFuckingCare) {
|
||||||
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:weapon.cSwing"), pitchProbablyIDontFuckingCare));
|
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:weapon.cSwing"), pitchProbablyIDontFuckingCare));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<ToolAnimation> getEnum() {
|
||||||
|
return ToolAnimation.class;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,8 +11,8 @@ import com.hbm.items.weapon.sedna.factory.GunStateDecider;
|
|||||||
import com.hbm.items.weapon.sedna.factory.Lego;
|
import com.hbm.items.weapon.sedna.factory.Lego;
|
||||||
import com.hbm.items.weapon.sedna.hud.IHUDComponent;
|
import com.hbm.items.weapon.sedna.hud.IHUDComponent;
|
||||||
import com.hbm.items.weapon.sedna.mods.WeaponModManager;
|
import com.hbm.items.weapon.sedna.mods.WeaponModManager;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
@ -25,7 +25,7 @@ import net.minecraft.util.ResourceLocation;
|
|||||||
* */
|
* */
|
||||||
public class GunConfig {
|
public class GunConfig {
|
||||||
|
|
||||||
public List<SmokeNode> smokeNodes = new ArrayList();
|
public List<SmokeNode> smokeNodes = new ArrayList<>();
|
||||||
|
|
||||||
public static final String O_RECEIVERS = "O_RECEIVERS";
|
public static final String O_RECEIVERS = "O_RECEIVERS";
|
||||||
public static final String F_DURABILITY = "F_DURABILITY";
|
public static final String F_DURABILITY = "F_DURABILITY";
|
||||||
@ -84,7 +84,7 @@ public class GunConfig {
|
|||||||
/** The engine for the state machine that determines the gun's overall behavior */
|
/** The engine for the state machine that determines the gun's overall behavior */
|
||||||
protected BiConsumer<ItemStack, LambdaContext> decider_DNA;
|
protected BiConsumer<ItemStack, LambdaContext> decider_DNA;
|
||||||
/** Lambda that returns the relevant animation for the given params */
|
/** Lambda that returns the relevant animation for the given params */
|
||||||
protected BiFunction<ItemStack, AnimType, BusAnimation> animations_DNA;
|
protected BiFunction<ItemStack, GunAnimation, BusAnimation> animations_DNA;
|
||||||
protected IHUDComponent[] hudComponents_DNA;
|
protected IHUDComponent[] hudComponents_DNA;
|
||||||
|
|
||||||
/* GETTERS */
|
/* GETTERS */
|
||||||
@ -115,7 +115,7 @@ public class GunConfig {
|
|||||||
|
|
||||||
public BiConsumer<ItemStack, LambdaContext> getDecider(ItemStack stack) { return WeaponModManager.eval(this.decider_DNA, stack, CON_DECIDER, this, this.index); }
|
public BiConsumer<ItemStack, LambdaContext> getDecider(ItemStack stack) { return WeaponModManager.eval(this.decider_DNA, stack, CON_DECIDER, this, this.index); }
|
||||||
|
|
||||||
public BiFunction<ItemStack, AnimType, BusAnimation> getAnims(ItemStack stack) { return WeaponModManager.eval(this.animations_DNA, stack, FUN_ANIMNATIONS, this, this.index); }
|
public BiFunction<ItemStack, GunAnimation, BusAnimation> getAnims(ItemStack stack) { return WeaponModManager.eval(this.animations_DNA, stack, FUN_ANIMNATIONS, this, this.index); }
|
||||||
public IHUDComponent[] getHUDComponents(ItemStack stack) { return WeaponModManager.eval(this.hudComponents_DNA, stack, O_HUDCOMPONENTS, this, this.index); }
|
public IHUDComponent[] getHUDComponents(ItemStack stack) { return WeaponModManager.eval(this.hudComponents_DNA, stack, O_HUDCOMPONENTS, this, this.index); }
|
||||||
|
|
||||||
/* SETTERS */
|
/* SETTERS */
|
||||||
@ -151,7 +151,7 @@ public class GunConfig {
|
|||||||
public GunConfig decider(BiConsumer<ItemStack, LambdaContext> lambda) { this.decider_DNA = lambda; return this; }
|
public GunConfig decider(BiConsumer<ItemStack, LambdaContext> lambda) { this.decider_DNA = lambda; return this; }
|
||||||
|
|
||||||
//client
|
//client
|
||||||
public GunConfig anim(BiFunction<ItemStack, AnimType, BusAnimation> lambda) { this.animations_DNA = lambda; return this; }
|
public GunConfig anim(BiFunction<ItemStack, GunAnimation, BusAnimation> lambda) { this.animations_DNA = lambda; return this; }
|
||||||
public GunConfig hud(IHUDComponent... components) { this.hudComponents_DNA = components; return this; }
|
public GunConfig hud(IHUDComponent... components) { this.hudComponents_DNA = components; return this; }
|
||||||
|
|
||||||
/** Standard package for keybind handling and decider using LEGO prefabs: Primary fire on LMB,
|
/** Standard package for keybind handling and decider using LEGO prefabs: Primary fire on LMB,
|
||||||
|
|||||||
@ -24,8 +24,8 @@ import com.hbm.items.weapon.sedna.mods.WeaponModManager;
|
|||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
import com.hbm.packet.toclient.GunAnimationPacket;
|
import com.hbm.packet.toclient.HbmAnimationPacket;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.util.RenderScreenOverlay;
|
import com.hbm.render.util.RenderScreenOverlay;
|
||||||
import com.hbm.sound.AudioWrapper;
|
import com.hbm.sound.AudioWrapper;
|
||||||
import com.hbm.util.BobMathUtil;
|
import com.hbm.util.BobMathUtil;
|
||||||
@ -247,8 +247,8 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
|
|||||||
@Override
|
@Override
|
||||||
public void onEquip(EntityPlayer player, ItemStack stack) {
|
public void onEquip(EntityPlayer player, ItemStack stack) {
|
||||||
for(int i = 0; i < this.configs_DNA.length; i++) {
|
for(int i = 0; i < this.configs_DNA.length; i++) {
|
||||||
if(this.getLastAnim(stack, i) == AnimType.EQUIP && this.getAnimTimer(stack, i) < 5) continue;
|
if(this.getLastAnim(stack, i) == GunAnimation.EQUIP && this.getAnimTimer(stack, i) < 5) continue;
|
||||||
playAnimation(player, stack, AnimType.EQUIP, i);
|
playAnimation(player, stack, GunAnimation.EQUIP, i);
|
||||||
this.setPrimary(stack, i, false);
|
this.setPrimary(stack, i, false);
|
||||||
this.setSecondary(stack, i, false);
|
this.setSecondary(stack, i, false);
|
||||||
this.setTertiary(stack, i, false);
|
this.setTertiary(stack, i, false);
|
||||||
@ -256,9 +256,9 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void playAnimation(EntityPlayer player, ItemStack stack, AnimType type, int index) {
|
public static void playAnimation(EntityPlayer player, ItemStack stack, GunAnimation type, int index) {
|
||||||
if(player instanceof EntityPlayerMP) {
|
if(player instanceof EntityPlayerMP) {
|
||||||
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(type.ordinal(), 0, index), (EntityPlayerMP) player);
|
PacketDispatcher.wrapper.sendTo(new HbmAnimationPacket(type.ordinal(), 0, index), (EntityPlayerMP) player);
|
||||||
setLastAnim(stack, index, type);
|
setLastAnim(stack, index, type);
|
||||||
setAnimTimer(stack, index, 0);
|
setAnimTimer(stack, index, 0);
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
|
|||||||
this.setState(stack, i, GunState.DRAWING);
|
this.setState(stack, i, GunState.DRAWING);
|
||||||
this.setTimer(stack, i, configs[i].getDrawDuration(stack));
|
this.setTimer(stack, i, configs[i].getDrawDuration(stack));
|
||||||
}
|
}
|
||||||
this.setLastAnim(stack, i, AnimType.CYCLE); //prevents new guns from initializing with DRAWING, 0
|
this.setLastAnim(stack, i, GunAnimation.CYCLE); //prevents new guns from initializing with DRAWING, 0
|
||||||
}
|
}
|
||||||
this.setIsAiming(stack, false);
|
this.setIsAiming(stack, false);
|
||||||
this.setReloadCancel(stack, false);
|
this.setReloadCancel(stack, false);
|
||||||
@ -371,8 +371,8 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
|
|||||||
public static boolean getIsLockedOn(ItemStack stack) { return getValueBool(stack, KEY_LOCKEDON); }
|
public static boolean getIsLockedOn(ItemStack stack) { return getValueBool(stack, KEY_LOCKEDON); }
|
||||||
public static void setIsLockedOn(ItemStack stack, boolean value) { setValueBool(stack, KEY_LOCKEDON, value); }
|
public static void setIsLockedOn(ItemStack stack, boolean value) { setValueBool(stack, KEY_LOCKEDON, value); }
|
||||||
// ANIM TRACKING //
|
// ANIM TRACKING //
|
||||||
public static AnimType getLastAnim(ItemStack stack, int index) { return EnumUtil.grabEnumSafely(AnimType.class, getValueInt(stack, KEY_LASTANIM + index)); }
|
public static GunAnimation getLastAnim(ItemStack stack, int index) { return EnumUtil.grabEnumSafely(GunAnimation.class, getValueInt(stack, KEY_LASTANIM + index)); }
|
||||||
public static void setLastAnim(ItemStack stack, int index, AnimType value) { setValueInt(stack, KEY_LASTANIM + index, value.ordinal()); }
|
public static void setLastAnim(ItemStack stack, int index, GunAnimation value) { setValueInt(stack, KEY_LASTANIM + index, value.ordinal()); }
|
||||||
public static int getAnimTimer(ItemStack stack, int index) { return getValueInt(stack, KEY_ANIMTIMER + index); }
|
public static int getAnimTimer(ItemStack stack, int index) { return getValueInt(stack, KEY_ANIMTIMER + index); }
|
||||||
public static void setAnimTimer(ItemStack stack, int index, int value) { setValueInt(stack, KEY_ANIMTIMER + index, value); }
|
public static void setAnimTimer(ItemStack stack, int index, int value) { setValueInt(stack, KEY_ANIMTIMER + index, value); }
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,9 @@ import com.hbm.items.weapon.sedna.GunConfig;
|
|||||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||||
import com.hbm.items.weapon.sedna.Receiver;
|
import com.hbm.items.weapon.sedna.Receiver;
|
||||||
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
|
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
|
||||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -69,19 +69,19 @@ public class GunStateDecider {
|
|||||||
if(!cancel && mag.canReload(stack, ctx.inventory)) {
|
if(!cancel && mag.canReload(stack, ctx.inventory)) {
|
||||||
ItemGunBaseNT.setState(stack, gunIndex, GunState.RELOADING);
|
ItemGunBaseNT.setState(stack, gunIndex, GunState.RELOADING);
|
||||||
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getReloadCycleDuration(stack));
|
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getReloadCycleDuration(stack));
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_CYCLE, gunIndex);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.RELOAD_CYCLE, gunIndex);
|
||||||
//if no more reloading can be done, go idle
|
//if no more reloading can be done, go idle
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(getStandardJamChance(stack, cfg, gunIndex) > entity.getRNG().nextFloat()) {
|
if(getStandardJamChance(stack, cfg, gunIndex) > entity.getRNG().nextFloat()) {
|
||||||
ItemGunBaseNT.setState(stack, gunIndex, GunState.JAMMED);
|
ItemGunBaseNT.setState(stack, gunIndex, GunState.JAMMED);
|
||||||
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getJamDuration(stack));
|
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getJamDuration(stack));
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.JAMMED, gunIndex);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.JAMMED, gunIndex);
|
||||||
} else {
|
} else {
|
||||||
ItemGunBaseNT.setState(stack, gunIndex, GunState.DRAWING);
|
ItemGunBaseNT.setState(stack, gunIndex, GunState.DRAWING);
|
||||||
int duration = rec.getReloadEndDuration(stack) + (mag.getAmountBeforeReload(stack) <= 0 ? rec.getReloadCockOnEmptyPost(stack) : 0);
|
int duration = rec.getReloadEndDuration(stack) + (mag.getAmountBeforeReload(stack) <= 0 ? rec.getReloadCockOnEmptyPost(stack) : 0);
|
||||||
ItemGunBaseNT.setTimer(stack, gunIndex, duration);
|
ItemGunBaseNT.setTimer(stack, gunIndex, duration);
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_END, gunIndex);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.RELOAD_END, gunIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemGunBaseNT.setReloadCancel(stack, false);
|
ItemGunBaseNT.setReloadCancel(stack, false);
|
||||||
@ -124,7 +124,7 @@ public class GunStateDecider {
|
|||||||
//if refire after dry is allowed, switch to COOLDOWN which will trigger a refire, otherwise switch to DRAWING
|
//if refire after dry is allowed, switch to COOLDOWN which will trigger a refire, otherwise switch to DRAWING
|
||||||
ItemGunBaseNT.setState(stack, gunIndex, rec.getRefireAfterDry(stack) ? GunState.COOLDOWN : GunState.DRAWING);
|
ItemGunBaseNT.setState(stack, gunIndex, rec.getRefireAfterDry(stack) ? GunState.COOLDOWN : GunState.DRAWING);
|
||||||
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getDelayAfterDryFire(stack));
|
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getDelayAfterDryFire(stack));
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.CYCLE_DRY, gunIndex);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.CYCLE_DRY, gunIndex);
|
||||||
//if not, revert to idle
|
//if not, revert to idle
|
||||||
} else {
|
} else {
|
||||||
ItemGunBaseNT.setState(stack, gunIndex, GunState.IDLE);
|
ItemGunBaseNT.setState(stack, gunIndex, GunState.IDLE);
|
||||||
@ -143,7 +143,7 @@ public class GunStateDecider {
|
|||||||
mag.setAmountBeforeReload(stack, loaded);
|
mag.setAmountBeforeReload(stack, loaded);
|
||||||
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.RELOADING);
|
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.RELOADING);
|
||||||
ItemGunBaseNT.setTimer(stack, ctx.configIndex, rec.getReloadBeginDuration(stack) + (loaded <= 0 ? rec.getReloadCockOnEmptyPre(stack) : 0));
|
ItemGunBaseNT.setTimer(stack, ctx.configIndex, rec.getReloadBeginDuration(stack) + (loaded <= 0 ? rec.getReloadCockOnEmptyPre(stack) : 0));
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD, ctx.configIndex);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.RELOAD, ctx.configIndex);
|
||||||
} else {
|
} else {
|
||||||
ItemGunBaseNT.setState(stack, gunIndex, GunState.IDLE);
|
ItemGunBaseNT.setState(stack, gunIndex, GunState.IDLE);
|
||||||
ItemGunBaseNT.setTimer(stack, gunIndex, 0);
|
ItemGunBaseNT.setTimer(stack, gunIndex, 0);
|
||||||
|
|||||||
@ -25,9 +25,9 @@ import com.hbm.items.weapon.sedna.Receiver;
|
|||||||
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.particle.helper.BlackPowderCreator;
|
import com.hbm.particle.helper.BlackPowderCreator;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -66,10 +66,10 @@ public class Lego {
|
|||||||
mag.setAmountBeforeReload(stack, loaded);
|
mag.setAmountBeforeReload(stack, loaded);
|
||||||
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.RELOADING);
|
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.RELOADING);
|
||||||
ItemGunBaseNT.setTimer(stack, ctx.configIndex, rec.getReloadBeginDuration(stack) + (loaded <= 0 ? rec.getReloadCockOnEmptyPre(stack) : 0));
|
ItemGunBaseNT.setTimer(stack, ctx.configIndex, rec.getReloadBeginDuration(stack) + (loaded <= 0 ? rec.getReloadCockOnEmptyPre(stack) : 0));
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD, ctx.configIndex);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.RELOAD, ctx.configIndex);
|
||||||
if(ctx.config.getReloadChangesType(stack)) mag.initNewType(stack, ctx.inventory);
|
if(ctx.config.getReloadChangesType(stack)) mag.initNewType(stack, ctx.inventory);
|
||||||
} else {
|
} else {
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.INSPECT, ctx.configIndex);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.INSPECT, ctx.configIndex);
|
||||||
if(!ctx.config.getInspectCancel(stack)) {
|
if(!ctx.config.getInspectCancel(stack)) {
|
||||||
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.DRAWING);
|
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.DRAWING);
|
||||||
ItemGunBaseNT.setTimer(stack, ctx.configIndex, ctx.config.getInspectDuration(stack));
|
ItemGunBaseNT.setTimer(stack, ctx.configIndex, ctx.config.getInspectDuration(stack));
|
||||||
@ -105,7 +105,7 @@ public class Lego {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(rec.getDoesDryFire(stack)) {
|
if(rec.getDoesDryFire(stack)) {
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.CYCLE_DRY, index);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.CYCLE_DRY, index);
|
||||||
ItemGunBaseNT.setState(stack, index, rec.getRefireAfterDry(stack) ? GunState.COOLDOWN : GunState.DRAWING);
|
ItemGunBaseNT.setState(stack, index, rec.getRefireAfterDry(stack) ? GunState.COOLDOWN : GunState.DRAWING);
|
||||||
ItemGunBaseNT.setTimer(stack, index, rec.getDelayAfterDryFire(stack));
|
ItemGunBaseNT.setTimer(stack, index, rec.getDelayAfterDryFire(stack));
|
||||||
}
|
}
|
||||||
@ -187,19 +187,19 @@ public class Lego {
|
|||||||
|
|
||||||
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg */
|
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg */
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_FIRE = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_FIRE = (stack, ctx) -> {
|
||||||
doStandardFire(stack, ctx, AnimType.CYCLE, true);
|
doStandardFire(stack, ctx, GunAnimation.CYCLE, true);
|
||||||
};
|
};
|
||||||
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg, ignores wear */
|
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg, ignores wear */
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_NOWEAR_FIRE = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_NOWEAR_FIRE = (stack, ctx) -> {
|
||||||
doStandardFire(stack, ctx, AnimType.CYCLE, false);
|
doStandardFire(stack, ctx, GunAnimation.CYCLE, false);
|
||||||
};
|
};
|
||||||
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg, then resets lockon progress */
|
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg, then resets lockon progress */
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_LOCKON_FIRE = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_LOCKON_FIRE = (stack, ctx) -> {
|
||||||
doStandardFire(stack, ctx, AnimType.CYCLE, true);
|
doStandardFire(stack, ctx, GunAnimation.CYCLE, true);
|
||||||
ItemGunBaseNT.setIsLockedOn(stack, false);
|
ItemGunBaseNT.setIsLockedOn(stack, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void doStandardFire(ItemStack stack, LambdaContext ctx, AnimType anim, boolean calcWear) {
|
public static void doStandardFire(ItemStack stack, LambdaContext ctx, GunAnimation anim, boolean calcWear) {
|
||||||
EntityLivingBase entity = ctx.entity;
|
EntityLivingBase entity = ctx.entity;
|
||||||
EntityPlayer player = ctx.getPlayer();
|
EntityPlayer player = ctx.getPlayer();
|
||||||
int index = ctx.configIndex;
|
int index = ctx.configIndex;
|
||||||
@ -303,7 +303,7 @@ public class Lego {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** anims for the DEBUG revolver, mostly a copy of the li'lpip but with some fixes regarding the cylinder movement */
|
/** anims for the DEBUG revolver, mostly a copy of the li'lpip but with some fixes regarding the cylinder movement */
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_DEBUG_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_DEBUG_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case CYCLE: return new BusAnimation()
|
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("RECOIL", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, -3, 50).addPos(0, 0, 0, 250))
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -17,10 +17,10 @@ import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
|||||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
@ -84,7 +84,7 @@ public class XFactory10ga {
|
|||||||
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_DOUBLE_BARREL_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_DOUBLE_BARREL_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 500, IType.SIN_DOWN));
|
||||||
|
|||||||
@ -32,10 +32,10 @@ import com.hbm.packet.PacketDispatcher;
|
|||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.BobMathUtil;
|
import com.hbm.util.BobMathUtil;
|
||||||
import com.hbm.util.TrackerUtil;
|
import com.hbm.util.TrackerUtil;
|
||||||
import com.hbm.util.Vec3NT;
|
import com.hbm.util.Vec3NT;
|
||||||
@ -429,7 +429,7 @@ public class XFactory12ga {
|
|||||||
ItemGunBaseNT.setTimer(stack, index, 20);
|
ItemGunBaseNT.setTimer(stack, index, 20);
|
||||||
} else {
|
} else {
|
||||||
if(rec.getDoesDryFire(stack)) {
|
if(rec.getDoesDryFire(stack)) {
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.CYCLE_DRY, index);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.CYCLE_DRY, index);
|
||||||
ItemGunBaseNT.setState(stack, index, GunState.DRAWING);
|
ItemGunBaseNT.setState(stack, index, GunState.DRAWING);
|
||||||
ItemGunBaseNT.setTimer(stack, index, rec.getDelayAfterDryFire(stack));
|
ItemGunBaseNT.setTimer(stack, index, rec.getDelayAfterDryFire(stack));
|
||||||
}
|
}
|
||||||
@ -440,7 +440,7 @@ public class XFactory12ga {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MARESLEG_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_MARESLEG_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 500, IType.SIN_DOWN));
|
||||||
@ -483,7 +483,7 @@ public class XFactory12ga {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MARESLEG_SHORT_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_MARESLEG_SHORT_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 250, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 250, IType.SIN_DOWN));
|
||||||
@ -509,7 +509,7 @@ public class XFactory12ga {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** This fucking sucks */
|
/** This fucking sucks */
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_LIBERATOR_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_LIBERATOR_ANIMS = (stack, type) -> {
|
||||||
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
@ -606,7 +606,7 @@ public class XFactory12ga {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_SPAS_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_SPAS_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 500, IType.SIN_DOWN));
|
||||||
@ -625,7 +625,7 @@ public class XFactory12ga {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_SHREDDER_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_SHREDDER_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||||
@ -651,7 +651,7 @@ public class XFactory12ga {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_SEXY_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_SEXY_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_DOWN));
|
||||||
|
|||||||
@ -20,10 +20,10 @@ import com.hbm.items.weapon.sedna.mods.WeaponModManager;
|
|||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ public class XFactory22lr {
|
|||||||
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25));
|
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_AM180_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_AM180_ANIMS = (stack, type) -> {
|
||||||
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
|
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
|
|||||||
@ -14,10 +14,10 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
|||||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
|
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
|
||||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ public class XFactory357 {
|
|||||||
ItemGunBaseNT.setupRecoil(5, (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.75));
|
ItemGunBaseNT.setupRecoil(5, (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.75));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_ATLAS_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_ATLAS_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 350, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 350, IType.SIN_DOWN));
|
||||||
@ -120,7 +120,7 @@ public class XFactory357 {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_DANI_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_DANI_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(360 * 3, 0, 0, 1000, IType.SIN_DOWN));
|
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(360 * 3, 0, 0, 1000, IType.SIN_DOWN));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,10 +18,10 @@ import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
|
|||||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
@ -93,7 +93,7 @@ public class XFactory35800 {
|
|||||||
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_ABERRATOR = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_ABERRATOR = (stack, type) -> {
|
||||||
boolean aim = ItemGunBaseNT.getIsAiming(stack);
|
boolean aim = ItemGunBaseNT.getIsAiming(stack);
|
||||||
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, null);
|
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, null);
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
|||||||
@ -30,10 +30,10 @@ import com.hbm.main.MainRegistry;
|
|||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
import com.hbm.util.TrackerUtil;
|
import com.hbm.util.TrackerUtil;
|
||||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||||
@ -184,7 +184,7 @@ public class XFactory40mm {
|
|||||||
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_FLAREGUN_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_FLAREGUN_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 350, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 350, IType.SIN_DOWN));
|
||||||
@ -207,7 +207,7 @@ public class XFactory40mm {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_CONGOLAKE_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_CONGOLAKE_ANIMS = (stack, type) -> {
|
||||||
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return ResourceManager.congolake_anim.get("Equip");
|
case EQUIP: return ResourceManager.congolake_anim.get("Equip");
|
||||||
|
|||||||
@ -25,10 +25,10 @@ import com.hbm.items.weapon.sedna.mods.WeaponModManager;
|
|||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
@ -156,11 +156,11 @@ public class XFactory44 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> SMACK_A_FUCKER = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> SMACK_A_FUCKER = (stack, ctx) -> {
|
||||||
if(ItemGunBaseNT.getState(stack, ctx.configIndex) == GunState.IDLE || ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) == AnimType.CYCLE) {
|
if(ItemGunBaseNT.getState(stack, ctx.configIndex) == GunState.IDLE || ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) == GunAnimation.CYCLE) {
|
||||||
ItemGunBaseNT.setIsAiming(stack, false);
|
ItemGunBaseNT.setIsAiming(stack, false);
|
||||||
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.DRAWING);
|
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.DRAWING);
|
||||||
ItemGunBaseNT.setTimer(stack, ctx.configIndex, ctx.config.getInspectDuration(stack));
|
ItemGunBaseNT.setTimer(stack, ctx.configIndex, ctx.config.getInspectDuration(stack));
|
||||||
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.INSPECT, ctx.configIndex);
|
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, GunAnimation.INSPECT, ctx.configIndex);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ public class XFactory44 {
|
|||||||
ItemGunBaseNT.setupRecoil(5, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1));
|
ItemGunBaseNT.setupRecoil(5, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_HENRY_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_HENRY_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
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, -3, 350, IType.SIN_DOWN))
|
||||||
@ -219,7 +219,7 @@ public class XFactory44 {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_NOPIP_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_NOPIP_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case CYCLE: return new BusAnimation()
|
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("RECOIL", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, -3, 50).addPos(0, 0, 0, 250))
|
||||||
@ -244,7 +244,7 @@ public class XFactory44 {
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_LILMAC_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_LILMAC_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation().addBus("SPIN", new BusAnimationSequence().addPos(-360, 0, 0, 350));
|
case EQUIP: return new BusAnimation().addBus("SPIN", new BusAnimationSequence().addPos(-360, 0, 0, 350));
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ public class XFactory44 {
|
|||||||
return LAMBDA_NOPIP_ANIMS.apply(stack, type);
|
return LAMBDA_NOPIP_ANIMS.apply(stack, type);
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_HANGMAN_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_HANGMAN_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||||
case CYCLE: return new BusAnimation()
|
case CYCLE: return new BusAnimation()
|
||||||
|
|||||||
@ -21,10 +21,10 @@ import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
|||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
@ -135,7 +135,7 @@ public class XFactory50 {
|
|||||||
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5));
|
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_AMAT_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_AMAT_ANIMS = (stack, type) -> {
|
||||||
double turn = -60;
|
double turn = -60;
|
||||||
double pullAmount = -2.5;
|
double pullAmount = -2.5;
|
||||||
double side = 4;
|
double side = 4;
|
||||||
@ -173,7 +173,7 @@ public class XFactory50 {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_M2_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_M2_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(80, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(80, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
||||||
|
|||||||
@ -25,10 +25,10 @@ import com.hbm.main.MainRegistry;
|
|||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -139,7 +139,7 @@ public class XFactory556mm {
|
|||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_STG = (stack, ctx) -> { };
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_STG = (stack, ctx) -> { };
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_G3_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_G3_ANIMS = (stack, type) -> {
|
||||||
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory) <= 0;
|
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory) <= 0;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
@ -210,7 +210,7 @@ public class XFactory556mm {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_STG77_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_STG77_ANIMS = (stack, type) -> {
|
||||||
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
|
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
|
|||||||
@ -17,9 +17,9 @@ import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
|||||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -75,7 +75,7 @@ public class XFactory75Bolt {
|
|||||||
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5), (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5), (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_BOLTER_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_BOLTER_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case CYCLE: return new BusAnimation()
|
case CYCLE: return new BusAnimation()
|
||||||
.addBus("RECOIL", new BusAnimationSequence().addPos(1, 0, 0, 25).addPos(0, 0, 0, 75));
|
.addBus("RECOIL", new BusAnimationSequence().addPos(1, 0, 0, 25).addPos(0, 0, 0, 75));
|
||||||
|
|||||||
@ -20,10 +20,10 @@ import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
|||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -155,7 +155,7 @@ public class XFactory762mm {
|
|||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_LACUNAE = (stack, ctx) -> { };
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_LACUNAE = (stack, ctx) -> { };
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_CARBINE_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_CARBINE_ANIMS = (stack, type) -> {
|
||||||
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
@ -187,7 +187,7 @@ public class XFactory762mm {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MINIGUN_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_MINIGUN_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_FULL));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_FULL));
|
||||||
@ -207,7 +207,7 @@ public class XFactory762mm {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MAS36_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_MAS36_ANIMS = (stack, type) -> {
|
||||||
int mag = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
int mag = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
||||||
double turn = -90;
|
double turn = -90;
|
||||||
double pullAmount = ItemGunBaseNT.getIsAiming(stack) ? -1F : -1.5D;
|
double pullAmount = ItemGunBaseNT.getIsAiming(stack) ? -1F : -1.5D;
|
||||||
|
|||||||
@ -22,10 +22,10 @@ import com.hbm.main.MainRegistry;
|
|||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.SpentCasing.CasingType;
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||||
|
|
||||||
@ -138,10 +138,10 @@ public class XFactory9mm {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_FIRE_LAG = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_FIRE_LAG = (stack, ctx) -> {
|
||||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||||
EntityPlayer player = ctx.getPlayer();
|
EntityPlayer player = ctx.getPlayer();
|
||||||
if(player != null && type == AnimType.INSPECT && timer > 20 && timer < 60) {
|
if(player != null && type == GunAnimation.INSPECT && timer > 20 && timer < 60) {
|
||||||
int index = ctx.configIndex;
|
int index = ctx.configIndex;
|
||||||
Receiver primary = ctx.config.getReceivers(stack)[0];
|
Receiver primary = ctx.config.getReceivers(stack)[0];
|
||||||
IMagazine mag = primary.getMagazine(stack);
|
IMagazine mag = primary.getMagazine(stack);
|
||||||
@ -154,7 +154,7 @@ public class XFactory9mm {
|
|||||||
ItemGunBaseNT.setTimer(stack, index, primary.getDelayAfterFire(stack));
|
ItemGunBaseNT.setTimer(stack, index, primary.getDelayAfterFire(stack));
|
||||||
EntityDamageUtil.attackEntityFromNT(player, BulletConfig.getDamage(player, player, DamageClass.PHYSICAL), 1_000F, true, false, 1D, 5F, 0F);
|
EntityDamageUtil.attackEntityFromNT(player, BulletConfig.getDamage(player, player, DamageClass.PHYSICAL), 1_000F, true, false, 1D, 5F, 0F);
|
||||||
} else {
|
} else {
|
||||||
Lego.doStandardFire(stack, ctx, AnimType.CYCLE, true);
|
Lego.doStandardFire(stack, ctx, GunAnimation.CYCLE, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ public class XFactory9mm {
|
|||||||
Lego.handleStandardSmoke(ctx.entity, stack, 2000, 0.05D, 1.1D, ctx.configIndex);
|
Lego.handleStandardSmoke(ctx.entity, stack, 2000, 0.05D, 1.1D, ctx.configIndex);
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_GREASEGUN_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_GREASEGUN_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: 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("EQUIP", new BusAnimationSequence().addPos(80, 0, 0, 0).addPos(80, 0, 0, 500).addPos(0, 0, 0, 500, IType.SIN_FULL))
|
||||||
@ -194,7 +194,7 @@ public class XFactory9mm {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_LAG_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_LAG_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 350, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 350, IType.SIN_DOWN));
|
||||||
@ -211,7 +211,7 @@ public class XFactory9mm {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_UZI_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_UZI_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: 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("EQUIP", new BusAnimationSequence().addPos(80, 0, 0, 0).addPos(80, 0, 0, 500).addPos(0, 0, 0, 500, IType.SIN_FULL))
|
||||||
|
|||||||
@ -20,10 +20,10 @@ import com.hbm.items.weapon.sedna.mags.MagazineBelt;
|
|||||||
import com.hbm.items.weapon.sedna.mags.MagazineInfinite;
|
import com.hbm.items.weapon.sedna.mags.MagazineInfinite;
|
||||||
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||||
import com.hbm.util.Vec3NT;
|
import com.hbm.util.Vec3NT;
|
||||||
|
|
||||||
@ -143,14 +143,14 @@ public class XFactoryAccelerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_PRIMARY_RELEASE = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_PRIMARY_RELEASE = (stack, ctx) -> {
|
||||||
if(ctx.getPlayer() == null || ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) != AnimType.CYCLE) return;
|
if(ctx.getPlayer() == null || ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) != GunAnimation.CYCLE) return;
|
||||||
ctx.getPlayer().worldObj.playSoundEffect(ctx.getPlayer().posX, ctx.getPlayer().posY, ctx.getPlayer().posZ, "hbm:weapon.fire.tauRelease", 1F, 1F);
|
ctx.getPlayer().worldObj.playSoundEffect(ctx.getPlayer().posX, ctx.getPlayer().posY, ctx.getPlayer().posZ, "hbm:weapon.fire.tauRelease", 1F, 1F);
|
||||||
};
|
};
|
||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_SECONDARY_PRESS = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_SECONDARY_PRESS = (stack, ctx) -> {
|
||||||
if(ctx.getPlayer() == null) return;
|
if(ctx.getPlayer() == null) return;
|
||||||
if(ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmount(stack, ctx.inventory) <= 0) return;
|
if(ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmount(stack, ctx.inventory) <= 0) return;
|
||||||
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.SPINUP, ctx.configIndex);
|
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, GunAnimation.SPINUP, ctx.configIndex);
|
||||||
tauChargeMag.getMagType(stack); //caches the last loaded ammo
|
tauChargeMag.getMagType(stack); //caches the last loaded ammo
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -158,8 +158,8 @@ public class XFactoryAccelerator {
|
|||||||
if(ctx.getPlayer() == null) return;
|
if(ctx.getPlayer() == null) return;
|
||||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||||
|
|
||||||
if(timer >= 10 && ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) == AnimType.SPINUP) {
|
if(timer >= 10 && ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) == GunAnimation.SPINUP) {
|
||||||
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.ALT_CYCLE, ctx.configIndex);
|
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, GunAnimation.ALT_CYCLE, ctx.configIndex);
|
||||||
int unitsUsed = 1 + Math.min(12, timer / 10);
|
int unitsUsed = 1 + Math.min(12, timer / 10);
|
||||||
|
|
||||||
EntityLivingBase entity = ctx.entity;
|
EntityLivingBase entity = ctx.entity;
|
||||||
@ -181,7 +181,7 @@ public class XFactoryAccelerator {
|
|||||||
ItemGunBaseNT.setWear(stack, index, Math.min(ItemGunBaseNT.getWear(stack, index) + config.wear * unitsUsed, ctx.config.getDurability(stack)));
|
ItemGunBaseNT.setWear(stack, index, Math.min(ItemGunBaseNT.getWear(stack, index) + config.wear * unitsUsed, ctx.config.getDurability(stack)));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.CYCLE_DRY, ctx.configIndex);
|
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, GunAnimation.CYCLE_DRY, ctx.configIndex);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ public class XFactoryAccelerator {
|
|||||||
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_TAU_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_TAU_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
||||||
@ -233,14 +233,14 @@ public class XFactoryAccelerator {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_COILGUN_ANIMS = (stack, type) -> {
|
public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_COILGUN_ANIMS = (stack, type) -> {
|
||||||
if(type == AnimType.EQUIP) return new BusAnimation().addBus("RELOAD", new BusAnimationSequence().addPos(1, 0, 0, 0).addPos(0, 0, 0, 250));
|
if(type == GunAnimation.EQUIP) return new BusAnimation().addBus("RELOAD", new BusAnimationSequence().addPos(1, 0, 0, 0).addPos(0, 0, 0, 250));
|
||||||
if(type == AnimType.CYCLE) return new BusAnimation().addBus("RECOIL", new BusAnimationSequence().addPos(ItemGunBaseNT.getIsAiming(stack) ? 0.5 : 1, 0, 0, 100).addPos(0, 0, 0, 200));
|
if(type == GunAnimation.CYCLE) return new BusAnimation().addBus("RECOIL", new BusAnimationSequence().addPos(ItemGunBaseNT.getIsAiming(stack) ? 0.5 : 1, 0, 0, 100).addPos(0, 0, 0, 200));
|
||||||
if(type == AnimType.RELOAD) return new BusAnimation().addBus("RELOAD", new BusAnimationSequence().addPos(1, 0, 0, 250).addPos(1, 0, 0, 500).addPos(0, 0, 0, 250));
|
if(type == GunAnimation.RELOAD) return new BusAnimation().addBus("RELOAD", new BusAnimationSequence().addPos(1, 0, 0, 250).addPos(1, 0, 0, 500).addPos(0, 0, 0, 250));
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_NI4NI_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_NI4NI_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-360 * 2, 0, 0, 500));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-360 * 2, 0, 0, 500));
|
||||||
|
|||||||
@ -13,10 +13,10 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
|||||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
|
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
|
||||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ public class XFactoryBlackPowder {
|
|||||||
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_PEPPERBOX_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_PEPPERBOX_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case CYCLE: return new BusAnimation()
|
case CYCLE: return new BusAnimation()
|
||||||
.addBus("ROTATE", new BusAnimationSequence().addPos(0, 0, 0, 1025).addPos(60, 0, 0, 250))
|
.addBus("ROTATE", new BusAnimationSequence().addPos(0, 0, 0, 1025).addPos(60, 0, 0, 250))
|
||||||
|
|||||||
@ -28,10 +28,10 @@ import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
|||||||
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -176,7 +176,7 @@ public class XFactoryCatapult {
|
|||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_FATMAN = (stack, ctx) -> { };
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_FATMAN = (stack, ctx) -> { };
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_FATMAN_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_FATMAN_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_DOWN));
|
||||||
|
|||||||
@ -26,10 +26,10 @@ import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
|||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
@ -226,7 +226,7 @@ public class XFactoryEnergy {
|
|||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_ENERGY = (stack, ctx) -> { };
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_ENERGY = (stack, ctx) -> { };
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_TESLA_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_TESLA_ANIMS = (stack, type) -> {
|
||||||
int amount = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
int amount = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
@ -245,7 +245,7 @@ public class XFactoryEnergy {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_LASER_PISTOL = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_LASER_PISTOL = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||||
@ -266,7 +266,7 @@ public class XFactoryEnergy {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_LASRIFLE = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_LASRIFLE = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||||
|
|||||||
@ -22,10 +22,10 @@ import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
|||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
import com.hbm.particle.helper.FlameCreator;
|
import com.hbm.particle.helper.FlameCreator;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@ -180,7 +180,7 @@ public class XFactoryFlamer {
|
|||||||
).setUnlocalizedName("gun_chemthrower");
|
).setUnlocalizedName("gun_chemthrower");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_FLAMER_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_FLAMER_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||||
@ -193,7 +193,7 @@ public class XFactoryFlamer {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_CHEMTHROWER_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_CHEMTHROWER_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||||
|
|||||||
@ -22,10 +22,10 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
|
|||||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
|
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
|
||||||
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.ContaminationUtil;
|
import com.hbm.util.ContaminationUtil;
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
import com.hbm.util.Vec3NT;
|
import com.hbm.util.Vec3NT;
|
||||||
@ -119,17 +119,17 @@ public class XFactoryFolly {
|
|||||||
if(ItemGunBaseNT.getState(stack, ctx.configIndex) == GunState.IDLE) {
|
if(ItemGunBaseNT.getState(stack, ctx.configIndex) == GunState.IDLE) {
|
||||||
boolean wasAiming = ItemGunBaseNT.getIsAiming(stack);
|
boolean wasAiming = ItemGunBaseNT.getIsAiming(stack);
|
||||||
ItemGunBaseNT.setIsAiming(stack, !wasAiming);
|
ItemGunBaseNT.setIsAiming(stack, !wasAiming);
|
||||||
if(!wasAiming) ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.SPINUP, ctx.configIndex);
|
if(!wasAiming) ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, GunAnimation.SPINUP, ctx.configIndex);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_FIRE = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_FIRE = (stack, ctx) -> {
|
||||||
Lego.doStandardFire(stack, ctx, AnimType.CYCLE, false);
|
Lego.doStandardFire(stack, ctx, GunAnimation.CYCLE, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
public static BiFunction<ItemStack, LambdaContext, Boolean> LAMBDA_CAN_FIRE = (stack, ctx) -> {
|
public static BiFunction<ItemStack, LambdaContext, Boolean> LAMBDA_CAN_FIRE = (stack, ctx) -> {
|
||||||
if(!ItemGunBaseNT.getIsAiming(stack)) return false;
|
if(!ItemGunBaseNT.getIsAiming(stack)) return false;
|
||||||
if(ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) != AnimType.SPINUP) return false;
|
if(ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) != GunAnimation.SPINUP) return false;
|
||||||
if(ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex) < 100) return false;
|
if(ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex) < 100) return false;
|
||||||
return ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmount(stack, ctx.inventory) > 0;
|
return ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmount(stack, ctx.inventory) > 0;
|
||||||
};
|
};
|
||||||
@ -138,7 +138,7 @@ public class XFactoryFolly {
|
|||||||
ItemGunBaseNT.setupRecoil(25, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
ItemGunBaseNT.setupRecoil(25, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_FOLLY_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_FOLLY_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(5, 0, 0, 1500, IType.SIN_DOWN).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(5, 0, 0, 1500, IType.SIN_DOWN).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
||||||
|
|||||||
@ -26,10 +26,10 @@ import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
|||||||
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ public class XFactoryRocket {
|
|||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_ROCKET = (stack, ctx) -> { };
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_ROCKET = (stack, ctx) -> { };
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_PANZERSCHRECK_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_PANZERSCHRECK_ANIMS = (stack, type) -> {
|
||||||
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory) <= 0;
|
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory) <= 0;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
@ -242,7 +242,7 @@ public class XFactoryRocket {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_QUADRO_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_QUADRO_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||||
@ -258,7 +258,7 @@ public class XFactoryRocket {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MISSILE_LAUNCHER_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_MISSILE_LAUNCHER_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_DOWN));
|
||||||
|
|||||||
@ -28,10 +28,10 @@ import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
|||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.particle.helper.ExplosionCreator;
|
import com.hbm.particle.helper.ExplosionCreator;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.tileentity.IRepairable;
|
import com.hbm.tileentity.IRepairable;
|
||||||
import com.hbm.tileentity.IRepairable.EnumExtinguishType;
|
import com.hbm.tileentity.IRepairable.EnumExtinguishType;
|
||||||
import com.hbm.util.CompatExternal;
|
import com.hbm.util.CompatExternal;
|
||||||
@ -281,7 +281,7 @@ public class XFactoryTool {
|
|||||||
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_CT_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_CT_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation()
|
case EQUIP: return new BusAnimation()
|
||||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
.addBus("EQUIP", new BusAnimationSequence().addPos(-45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
|||||||
import com.hbm.items.weapon.sedna.Receiver;
|
import com.hbm.items.weapon.sedna.Receiver;
|
||||||
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
||||||
import com.hbm.items.weapon.sedna.mags.MagazineFluid;
|
import com.hbm.items.weapon.sedna.mags.MagazineFluid;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
|
|
||||||
import api.hbm.fluidmk2.IFillableItem;
|
import api.hbm.fluidmk2.IFillableItem;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
@ -81,7 +81,7 @@ public class ItemGunChemthrower extends ItemGunBaseNT implements IFillableItem {
|
|||||||
EntityLivingBase entity = ctx.entity;
|
EntityLivingBase entity = ctx.entity;
|
||||||
EntityPlayer player = ctx.getPlayer();
|
EntityPlayer player = ctx.getPlayer();
|
||||||
int index = ctx.configIndex;
|
int index = ctx.configIndex;
|
||||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.CYCLE, ctx.configIndex);
|
ItemGunBaseNT.playAnimation(player, stack, GunAnimation.CYCLE, ctx.configIndex);
|
||||||
|
|
||||||
Receiver primary = ctx.config.getReceivers(stack)[0];
|
Receiver primary = ctx.config.getReceivers(stack)[0];
|
||||||
IMagazine mag = primary.getMagazine(stack);
|
IMagazine mag = primary.getMagazine(stack);
|
||||||
|
|||||||
@ -4,10 +4,10 @@ import java.util.function.BiFunction;
|
|||||||
|
|
||||||
import com.hbm.items.weapon.sedna.GunConfig;
|
import com.hbm.items.weapon.sedna.GunConfig;
|
||||||
import com.hbm.items.weapon.sedna.factory.XFactory556mm;
|
import com.hbm.items.weapon.sedna.factory.XFactory556mm;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ public class WeapnModG3SawedOff extends WeaponModBase {
|
|||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_G3_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_G3_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 250, IType.SIN_FULL));
|
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 250, IType.SIN_FULL));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,10 +9,10 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
|||||||
import com.hbm.items.weapon.sedna.factory.Orchestras;
|
import com.hbm.items.weapon.sedna.factory.Orchestras;
|
||||||
import com.hbm.items.weapon.sedna.factory.XFactory44;
|
import com.hbm.items.weapon.sedna.factory.XFactory44;
|
||||||
import com.hbm.items.weapon.sedna.factory.XFactory762mm;
|
import com.hbm.items.weapon.sedna.factory.XFactory762mm;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@ -40,10 +40,10 @@ public class WeaponModCarbineBayonet extends WeaponModBase {
|
|||||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_CARBINE = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_CARBINE = (stack, ctx) -> {
|
||||||
EntityLivingBase entity = ctx.entity;
|
EntityLivingBase entity = ctx.entity;
|
||||||
if(entity.worldObj.isRemote) return;
|
if(entity.worldObj.isRemote) return;
|
||||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||||
|
|
||||||
if(type == AnimType.INSPECT) {
|
if(type == GunAnimation.INSPECT) {
|
||||||
|
|
||||||
if(timer == 15 && ctx.getPlayer() != null) {
|
if(timer == 15 && ctx.getPlayer() != null) {
|
||||||
MovingObjectPosition mop = EntityDamageUtil.getMouseOver(ctx.getPlayer(), 3.0D);
|
MovingObjectPosition mop = EntityDamageUtil.getMouseOver(ctx.getPlayer(), 3.0D);
|
||||||
@ -67,7 +67,7 @@ public class WeaponModCarbineBayonet extends WeaponModBase {
|
|||||||
Orchestras.ORCHESTRA_CARBINE.accept(stack, ctx);
|
Orchestras.ORCHESTRA_CARBINE.accept(stack, ctx);
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_CARBINE_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_CARBINE_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case INSPECT: return new BusAnimation()
|
case INSPECT: return new BusAnimation()
|
||||||
.addBus("STAB", new BusAnimationSequence().addPos(0, 1, -2, 250, IType.SIN_DOWN).hold(250).addPos(0, 1, 5, 250, IType.SIN_UP).hold(250).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
.addBus("STAB", new BusAnimationSequence().addPos(0, 1, -2, 250, IType.SIN_DOWN).hold(250).addPos(0, 1, 5, 250, IType.SIN_UP).hold(250).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
|||||||
import com.hbm.items.weapon.sedna.factory.Orchestras;
|
import com.hbm.items.weapon.sedna.factory.Orchestras;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.particle.helper.CasingCreator;
|
import com.hbm.particle.helper.CasingCreator;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -34,11 +34,11 @@ public class WeaponModGreasegun extends WeaponModBase {
|
|||||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_GREASEGUN = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_GREASEGUN = (stack, ctx) -> {
|
||||||
EntityLivingBase entity = ctx.entity;
|
EntityLivingBase entity = ctx.entity;
|
||||||
if(entity.worldObj.isRemote) return;
|
if(entity.worldObj.isRemote) return;
|
||||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||||
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
|
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
|
||||||
|
|
||||||
if(type == AnimType.CYCLE) {
|
if(type == GunAnimation.CYCLE) {
|
||||||
if(timer == 1) {
|
if(timer == 1) {
|
||||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.55, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -7.5F + (float)entity.getRNG().nextGaussian() * 5F, 12F + (float)entity.getRNG().nextGaussian() * 5F, casing.getName());
|
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.55, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -7.5F + (float)entity.getRNG().nextGaussian() * 5F, 12F + (float)entity.getRNG().nextGaussian() * 5F, casing.getName());
|
||||||
|
|||||||
@ -8,10 +8,10 @@ import com.hbm.items.weapon.sedna.factory.XFactory12ga;
|
|||||||
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
||||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||||
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public class WeaponModLiberatorSpeedloader extends WeaponModBase {
|
|||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_LIBERATOR_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_LIBERATOR_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case RELOAD: return new BusAnimation()
|
case RELOAD: return new BusAnimation()
|
||||||
.addBus("LATCH", new BusAnimationSequence().addPos(15, 0, 0, 100))
|
.addBus("LATCH", new BusAnimationSequence().addPos(15, 0, 0, 100))
|
||||||
|
|||||||
@ -9,10 +9,10 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
|||||||
import com.hbm.items.weapon.sedna.factory.Orchestras;
|
import com.hbm.items.weapon.sedna.factory.Orchestras;
|
||||||
import com.hbm.items.weapon.sedna.factory.XFactory44;
|
import com.hbm.items.weapon.sedna.factory.XFactory44;
|
||||||
import com.hbm.items.weapon.sedna.factory.XFactory762mm;
|
import com.hbm.items.weapon.sedna.factory.XFactory762mm;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@ -40,10 +40,10 @@ public class WeaponModMASBayonet extends WeaponModBase {
|
|||||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_MAS36 = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_MAS36 = (stack, ctx) -> {
|
||||||
EntityLivingBase entity = ctx.entity;
|
EntityLivingBase entity = ctx.entity;
|
||||||
if(entity.worldObj.isRemote) return;
|
if(entity.worldObj.isRemote) return;
|
||||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||||
|
|
||||||
if(type == AnimType.INSPECT) {
|
if(type == GunAnimation.INSPECT) {
|
||||||
|
|
||||||
if(timer == 15 && ctx.getPlayer() != null) {
|
if(timer == 15 && ctx.getPlayer() != null) {
|
||||||
MovingObjectPosition mop = EntityDamageUtil.getMouseOver(ctx.getPlayer(), 3.0D);
|
MovingObjectPosition mop = EntityDamageUtil.getMouseOver(ctx.getPlayer(), 3.0D);
|
||||||
@ -67,7 +67,7 @@ public class WeaponModMASBayonet extends WeaponModBase {
|
|||||||
Orchestras.ORCHESTRA_MAS36.accept(stack, ctx);
|
Orchestras.ORCHESTRA_MAS36.accept(stack, ctx);
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MAS36_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_MAS36_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case INSPECT: return new BusAnimation()
|
case INSPECT: return new BusAnimation()
|
||||||
.addBus("STAB", new BusAnimationSequence().addPos(0, 1, -2, 250, IType.SIN_DOWN).hold(250).addPos(0, 1, 5, 250, IType.SIN_UP).hold(250).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
.addBus("STAB", new BusAnimationSequence().addPos(0, 1, -2, 250, IType.SIN_DOWN).hold(250).addPos(0, 1, 5, 250, IType.SIN_UP).hold(250).addPos(0, 0, 0, 500, IType.SIN_FULL));
|
||||||
|
|||||||
@ -10,10 +10,10 @@ import com.hbm.items.weapon.sedna.Receiver;
|
|||||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
||||||
import com.hbm.items.weapon.sedna.factory.Lego;
|
import com.hbm.items.weapon.sedna.factory.Lego;
|
||||||
import com.hbm.items.weapon.sedna.factory.XFactoryRocket;
|
import com.hbm.items.weapon.sedna.factory.XFactoryRocket;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.BusAnimationSequence;
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class WeaponModPanzerschreckSawedOff extends WeaponModBase {
|
|||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_PANZERSCHRECK_ANIMS = (stack, type) -> {
|
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_PANZERSCHRECK_ANIMS = (stack, type) -> {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 250, IType.SIN_DOWN));
|
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 250, IType.SIN_DOWN));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public class PacketDispatcher {
|
|||||||
//Signals server to do coord based satellite stuff
|
//Signals server to do coord based satellite stuff
|
||||||
wrapper.registerMessage(SatCoordPacket.Handler.class, SatCoordPacket.class, i++, Side.SERVER);
|
wrapper.registerMessage(SatCoordPacket.Handler.class, SatCoordPacket.class, i++, Side.SERVER);
|
||||||
//Triggers gun animations of the client
|
//Triggers gun animations of the client
|
||||||
wrapper.registerMessage(GunAnimationPacket.Handler.class, GunAnimationPacket.class, i++, Side.CLIENT);
|
wrapper.registerMessage(HbmAnimationPacket.Handler.class, HbmAnimationPacket.class, i++, Side.CLIENT);
|
||||||
//Sends a funi text to display like a music disc announcement
|
//Sends a funi text to display like a music disc announcement
|
||||||
wrapper.registerMessage(PlayerInformPacket.Handler.class, PlayerInformPacket.class, i++, Side.CLIENT);
|
wrapper.registerMessage(PlayerInformPacket.Handler.class, PlayerInformPacket.class, i++, Side.CLIENT);
|
||||||
//Universal keybind packet
|
//Universal keybind packet
|
||||||
|
|||||||
@ -9,10 +9,11 @@ import com.hbm.items.weapon.sedna.GunConfig;
|
|||||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||||
import com.hbm.items.weapon.sedna.Receiver;
|
import com.hbm.items.weapon.sedna.Receiver;
|
||||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.BusAnimation;
|
import com.hbm.render.anim.BusAnimation;
|
||||||
import com.hbm.render.anim.HbmAnimations;
|
import com.hbm.render.anim.HbmAnimations;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
import com.hbm.render.anim.HbmAnimations.Animation;
|
import com.hbm.render.anim.HbmAnimations.Animation;
|
||||||
|
import com.hbm.util.EnumUtil;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
@ -24,51 +25,51 @@ import net.minecraft.client.Minecraft;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class GunAnimationPacket implements IMessage {
|
public class HbmAnimationPacket implements IMessage {
|
||||||
|
|
||||||
public short type;
|
public short type;
|
||||||
public int receiverIndex;
|
public int receiverIndex;
|
||||||
public int gunIndex;
|
public int itemIndex;
|
||||||
|
|
||||||
public GunAnimationPacket() { }
|
public HbmAnimationPacket() { }
|
||||||
|
|
||||||
public GunAnimationPacket(int type) {
|
public HbmAnimationPacket(int type) {
|
||||||
this.type = (short) type;
|
this.type = (short) type;
|
||||||
this.receiverIndex = 0;
|
this.receiverIndex = 0;
|
||||||
this.gunIndex = 0;
|
this.itemIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GunAnimationPacket(int type, int rec) {
|
public HbmAnimationPacket(int type, int rec) {
|
||||||
this.type = (short) type;
|
this.type = (short) type;
|
||||||
this.receiverIndex = rec;
|
this.receiverIndex = rec;
|
||||||
this.gunIndex = 0;
|
this.itemIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GunAnimationPacket(int type, int rec, int gun) {
|
public HbmAnimationPacket(int type, int rec, int gun) {
|
||||||
this.type = (short) type;
|
this.type = (short) type;
|
||||||
this.receiverIndex = rec;
|
this.receiverIndex = rec;
|
||||||
this.gunIndex = gun;
|
this.itemIndex = gun;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fromBytes(ByteBuf buf) {
|
public void fromBytes(ByteBuf buf) {
|
||||||
type = buf.readShort();
|
type = buf.readShort();
|
||||||
receiverIndex = buf.readInt();
|
receiverIndex = buf.readInt();
|
||||||
gunIndex = buf.readInt();
|
itemIndex = buf.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toBytes(ByteBuf buf) {
|
public void toBytes(ByteBuf buf) {
|
||||||
buf.writeShort(type);
|
buf.writeShort(type);
|
||||||
buf.writeInt(receiverIndex);
|
buf.writeInt(receiverIndex);
|
||||||
buf.writeInt(gunIndex);
|
buf.writeInt(itemIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Handler implements IMessageHandler<GunAnimationPacket, IMessage> {
|
public static class Handler implements IMessageHandler<HbmAnimationPacket, IMessage> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IMessage onMessage(GunAnimationPacket m, MessageContext ctx) {
|
public IMessage onMessage(HbmAnimationPacket m, MessageContext ctx) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@ -79,9 +80,9 @@ public class GunAnimationPacket implements IMessage {
|
|||||||
if(stack == null) return null;
|
if(stack == null) return null;
|
||||||
|
|
||||||
if(stack.getItem() instanceof ItemGunBaseNT) {
|
if(stack.getItem() instanceof ItemGunBaseNT) {
|
||||||
handleSedna(player, stack, slot, AnimType.values()[m.type], m.receiverIndex, m.gunIndex);
|
handleSedna(player, stack, slot, GunAnimation.values()[m.type], m.receiverIndex, m.itemIndex);
|
||||||
} else if(stack.getItem() instanceof IAnimatedItem) {
|
} else if(stack.getItem() instanceof IAnimatedItem) {
|
||||||
handleItem(player, stack, slot, AnimType.values()[m.type], m.receiverIndex, m.gunIndex);
|
handleItem(player, stack, slot, m.type, m.receiverIndex, m.itemIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch(Exception x) { }
|
} catch(Exception x) { }
|
||||||
@ -89,11 +90,11 @@ public class GunAnimationPacket implements IMessage {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void handleSedna(EntityPlayer player, ItemStack stack, int slot, AnimType type, int receiverIndex, int gunIndex) {
|
public static void handleSedna(EntityPlayer player, ItemStack stack, int slot, GunAnimation type, int receiverIndex, int gunIndex) {
|
||||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||||
GunConfig config = gun.getConfig(stack, gunIndex);
|
GunConfig config = gun.getConfig(stack, gunIndex);
|
||||||
|
|
||||||
if(type == AnimType.CYCLE) {
|
if(type == GunAnimation.CYCLE) {
|
||||||
if(gunIndex < gun.lastShot.length) gun.lastShot[gunIndex] = System.currentTimeMillis();
|
if(gunIndex < gun.lastShot.length) gun.lastShot[gunIndex] = System.currentTimeMillis();
|
||||||
gun.shotRand = player.worldObj.rand.nextDouble();
|
gun.shotRand = player.worldObj.rand.nextDouble();
|
||||||
|
|
||||||
@ -105,25 +106,26 @@ public class GunAnimationPacket implements IMessage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BiFunction<ItemStack, AnimType, BusAnimation> anims = config.getAnims(stack);
|
BiFunction<ItemStack, GunAnimation, BusAnimation> anims = config.getAnims(stack);
|
||||||
BusAnimation animation = anims.apply(stack, type);
|
BusAnimation animation = anims.apply(stack, type);
|
||||||
|
|
||||||
if(animation == null && (type == AnimType.ALT_CYCLE || type == AnimType.CYCLE_EMPTY)) {
|
if(animation == null && (type == GunAnimation.ALT_CYCLE || type == GunAnimation.CYCLE_EMPTY)) {
|
||||||
animation = anims.apply(stack, AnimType.CYCLE);
|
animation = anims.apply(stack, GunAnimation.CYCLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(animation != null) {
|
if(animation != null) {
|
||||||
Minecraft.getMinecraft().entityRenderer.itemRenderer.resetEquippedProgress();
|
Minecraft.getMinecraft().entityRenderer.itemRenderer.resetEquippedProgress();
|
||||||
Minecraft.getMinecraft().entityRenderer.itemRenderer.itemToRender = stack;
|
Minecraft.getMinecraft().entityRenderer.itemRenderer.itemToRender = stack;
|
||||||
boolean isReloadAnimation = type == AnimType.RELOAD || type == AnimType.RELOAD_CYCLE;
|
boolean isReloadAnimation = type == GunAnimation.RELOAD || type == GunAnimation.RELOAD_CYCLE;
|
||||||
if(isReloadAnimation && ArmorTrenchmaster.isTrenchMaster(player)) animation.setTimeMult(0.5D);
|
if(isReloadAnimation && ArmorTrenchmaster.isTrenchMaster(player)) animation.setTimeMult(0.5D);
|
||||||
HbmAnimations.hotbar[slot][gunIndex] = new Animation(stack.getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, isReloadAnimation && config.getReloadAnimSequential(stack));
|
HbmAnimations.hotbar[slot][gunIndex] = new Animation(stack.getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, isReloadAnimation && config.getReloadAnimSequential(stack));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void handleItem(EntityPlayer player, ItemStack stack, int slot, AnimType type, int receiverIndex, int itemIndex) {
|
public static void handleItem(EntityPlayer player, ItemStack stack, int slot, short type, int receiverIndex, int itemIndex) {
|
||||||
IAnimatedItem item = (IAnimatedItem) stack.getItem();
|
IAnimatedItem<?> item = (IAnimatedItem<?>) stack.getItem();
|
||||||
BusAnimation animation = item.getAnimation(type, stack);
|
Class<? extends Enum<?>> animClass = item.getEnum();
|
||||||
|
BusAnimation animation = item.getAnimation(EnumUtil.grabEnumSafely(animClass, type), stack);
|
||||||
|
|
||||||
if(animation != null) {
|
if(animation != null) {
|
||||||
HbmAnimations.hotbar[slot][itemIndex] = new Animation(stack.getItem().getUnlocalizedName(), System.currentTimeMillis(), animation);
|
HbmAnimations.hotbar[slot][itemIndex] = new Animation(stack.getItem().getUnlocalizedName(), System.currentTimeMillis(), animation);
|
||||||
27
src/main/java/com/hbm/render/anim/AnimationEnums.java
Normal file
27
src/main/java/com/hbm/render/anim/AnimationEnums.java
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package com.hbm.render.anim;
|
||||||
|
|
||||||
|
public class AnimationEnums {
|
||||||
|
|
||||||
|
// A NOTE ON SHOTGUN STYLE RELOADS
|
||||||
|
// Make sure the RELOAD adds shells, not just RELOAD_CYCLE, they all proc once for each loaded shell
|
||||||
|
public static enum GunAnimation {
|
||||||
|
RELOAD, //either a full reload or start of a reload
|
||||||
|
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
|
||||||
|
CYCLE_EMPTY, //animation for the final shot in the magazine
|
||||||
|
CYCLE_DRY, //animation for trying to fire, but no round is available
|
||||||
|
ALT_CYCLE, //animation for alt fire cycles
|
||||||
|
SPINUP, //animation for actionstart
|
||||||
|
SPINDOWN, //animation for actionend
|
||||||
|
EQUIP, //animation for drawing the weapon
|
||||||
|
INSPECT, //animation for inspecting the weapon
|
||||||
|
JAMMED, //animation for jammed weapons
|
||||||
|
}
|
||||||
|
|
||||||
|
public static enum ToolAnimation {
|
||||||
|
SWING,
|
||||||
|
EQUIP,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -18,24 +18,6 @@ public class HbmAnimations {
|
|||||||
//animation is playing, though this will cancel the animation entirely.
|
//animation is playing, though this will cancel the animation entirely.
|
||||||
public static final Animation[][] hotbar = new Animation[9][8]; //now with 8 parallel rails per slot! time to get railed!
|
public static final Animation[][] hotbar = new Animation[9][8]; //now with 8 parallel rails per slot! time to get railed!
|
||||||
|
|
||||||
public static enum AnimType {
|
|
||||||
RELOAD, //either a full reload or start of a reload
|
|
||||||
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 / weapon swing
|
|
||||||
CYCLE_EMPTY, //animation for the final shot in the magazine
|
|
||||||
CYCLE_DRY, //animation for trying to fire, but no round is available
|
|
||||||
ALT_CYCLE, //animation for alt fire cycles
|
|
||||||
SPINUP, //animation for actionstart
|
|
||||||
SPINDOWN, //animation for actionend
|
|
||||||
EQUIP, //animation for drawing the weapon
|
|
||||||
INSPECT, //animation for inspecting the weapon
|
|
||||||
JAMMED, //animation for jammed weapons
|
|
||||||
}
|
|
||||||
|
|
||||||
// A NOTE ON SHOTGUN STYLE RELOADS
|
|
||||||
// Make sure the RELOAD adds shells, not just RELOAD_CYCLE, they all proc once for each loaded shell
|
|
||||||
|
|
||||||
public static class Animation {
|
public static class Animation {
|
||||||
|
|
||||||
//the "name" of the animation slot. if the item has a different key than
|
//the "name" of the animation slot. if the item has a different key than
|
||||||
@ -55,9 +37,7 @@ public class HbmAnimations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Animation(String key, long startMillis, BusAnimation animation, boolean holdLastFrame) {
|
public Animation(String key, long startMillis, BusAnimation animation, boolean holdLastFrame) {
|
||||||
this.key = key;
|
this(key, startMillis, animation);
|
||||||
this.startMillis = startMillis;
|
|
||||||
this.animation = animation;
|
|
||||||
this.holdLastFrame = holdLastFrame;
|
this.holdLastFrame = holdLastFrame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,8 +9,8 @@ import com.hbm.items.weapon.sedna.mags.IMagazine;
|
|||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
|
import com.hbm.render.anim.AnimationEnums.GunAnimation;
|
||||||
import com.hbm.render.anim.HbmAnimations;
|
import com.hbm.render.anim.HbmAnimations;
|
||||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -94,7 +94,7 @@ public class ItemRenderCongoLake extends ItemRenderWeaponBase {
|
|||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
{
|
{
|
||||||
IMagazine mag = gun.getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack);
|
IMagazine mag = gun.getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack);
|
||||||
if(gun.getLastAnim(stack, 0) != AnimType.INSPECT || mag.getAmount(stack, MainRegistry.proxy.me().inventory) > 0) { //omit when inspecting and no shell is loaded
|
if(gun.getLastAnim(stack, 0) != GunAnimation.INSPECT || mag.getAmount(stack, MainRegistry.proxy.me().inventory) > 0) { //omit when inspecting and no shell is loaded
|
||||||
|
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.casings_tex);
|
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.casings_tex);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user