mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
.44 but better
This commit is contained in:
parent
aad9fadda3
commit
59c5efd49b
@ -47,14 +47,14 @@ public class Gun44MagnumFactory {
|
|||||||
config.roundsPerCycle = 1;
|
config.roundsPerCycle = 1;
|
||||||
config.gunMode = GunConfiguration.MODE_NORMAL;
|
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||||
config.firingMode = GunConfiguration.FIRE_MANUAL;
|
config.firingMode = GunConfiguration.FIRE_MANUAL;
|
||||||
config.reloadDuration = 10;
|
config.reloadDuration = 50;
|
||||||
config.firingDuration = 0;
|
config.firingDuration = 0;
|
||||||
config.ammoCap = 6;
|
config.ammoCap = 6;
|
||||||
config.reloadType = GunConfiguration.RELOAD_FULL;
|
config.reloadType = GunConfiguration.RELOAD_FULL;
|
||||||
config.allowsInfinity = true;
|
config.allowsInfinity = true;
|
||||||
config.crosshair = Crosshair.L_CLASSIC;
|
config.crosshair = Crosshair.L_CLASSIC;
|
||||||
config.reloadSound = GunConfiguration.RSOUND_REVOLVER;
|
config.reloadSound = GunConfiguration.RSOUND_REVOLVER;
|
||||||
config.firingSound = "hbm:weapon.revolverShootAlt";
|
config.firingSound = "hbm:weapon.44Shoot";
|
||||||
config.reloadSoundEnd = false;
|
config.reloadSoundEnd = false;
|
||||||
|
|
||||||
config.config.addAll(HbmCollection.m44Normal);
|
config.config.addAll(HbmCollection.m44Normal);
|
||||||
|
|||||||
@ -4161,7 +4161,7 @@ public class ModItems {
|
|||||||
gun_revolver_cursed = new ItemGunBase(Gun357MagnumFactory.getRevolverCursedConfig()).setUnlocalizedName("gun_revolver_cursed").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_cursed");
|
gun_revolver_cursed = new ItemGunBase(Gun357MagnumFactory.getRevolverCursedConfig()).setUnlocalizedName("gun_revolver_cursed").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_cursed");
|
||||||
gun_revolver_nightmare = new ItemGunBase(Gun357MagnumFactory.getRevolverNightmareConfig()).setUnlocalizedName("gun_revolver_nightmare").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare");
|
gun_revolver_nightmare = new ItemGunBase(Gun357MagnumFactory.getRevolverNightmareConfig()).setUnlocalizedName("gun_revolver_nightmare").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare");
|
||||||
gun_revolver_nightmare2 = new ItemGunBase(Gun357MagnumFactory.getRevolverNightmare2Config()).setUnlocalizedName("gun_revolver_nightmare2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare2");
|
gun_revolver_nightmare2 = new ItemGunBase(Gun357MagnumFactory.getRevolverNightmare2Config()).setUnlocalizedName("gun_revolver_nightmare2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare2");
|
||||||
gun_revolver_pip = new ItemGunBase(Gun44MagnumFactory.getMacintoshConfig()).setUnlocalizedName("gun_revolver_pip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_pip");
|
gun_revolver_pip = new ItemGunPip(Gun44MagnumFactory.getMacintoshConfig()).setUnlocalizedName("gun_revolver_pip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_pip");
|
||||||
gun_revolver_nopip = new ItemGunBase(Gun44MagnumFactory.getNovacConfig()).setUnlocalizedName("gun_revolver_nopip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nopip");
|
gun_revolver_nopip = new ItemGunBase(Gun44MagnumFactory.getNovacConfig()).setUnlocalizedName("gun_revolver_nopip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nopip");
|
||||||
gun_revolver_blackjack = new ItemGunBase(Gun44MagnumFactory.getBlackjackConfig()).setUnlocalizedName("gun_revolver_blackjack").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_blackjack");
|
gun_revolver_blackjack = new ItemGunBase(Gun44MagnumFactory.getBlackjackConfig()).setUnlocalizedName("gun_revolver_blackjack").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_blackjack");
|
||||||
gun_revolver_silver = new ItemGunBase(Gun44MagnumFactory.getSilverConfig()).setUnlocalizedName("gun_revolver_silver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_silver");
|
gun_revolver_silver = new ItemGunBase(Gun44MagnumFactory.getSilverConfig()).setUnlocalizedName("gun_revolver_silver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_silver");
|
||||||
|
|||||||
@ -790,6 +790,8 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
|||||||
if(!mainConfig.equipSound.isEmpty() && !player.worldObj.isRemote) {
|
if(!mainConfig.equipSound.isEmpty() && !player.worldObj.isRemote) {
|
||||||
player.worldObj.playSoundAtEntity(player, mainConfig.equipSound, 1, 1);
|
player.worldObj.playSoundAtEntity(player, mainConfig.equipSound, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(player instanceof EntityPlayerMP) PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.EQUIP.ordinal()), (EntityPlayerMP) player);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void queueCasing(Entity entity, CasingEjector ejector, BulletConfiguration bullet, ItemStack stack) {
|
protected static void queueCasing(Entity entity, CasingEjector ejector, BulletConfiguration bullet, ItemStack stack) {
|
||||||
|
|||||||
@ -22,7 +22,6 @@ public class ItemGunBio extends ItemGunBase {
|
|||||||
super(config);
|
super(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* just a test */
|
|
||||||
public static long lastShot;
|
public static long lastShot;
|
||||||
public static List<double[]> smokeNodes = new ArrayList();
|
public static List<double[]> smokeNodes = new ArrayList();
|
||||||
|
|
||||||
@ -66,8 +65,6 @@ public class ItemGunBio extends ItemGunBase {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public BusAnimation getAnimation(ItemStack stack, AnimType type) {
|
public BusAnimation getAnimation(ItemStack stack, AnimType type) {
|
||||||
//GunConfiguration config = ((ItemGunBase) stack.getItem()).mainConfig;
|
|
||||||
//return config.animations.get(type);
|
|
||||||
|
|
||||||
if(type == AnimType.CYCLE) {
|
if(type == AnimType.CYCLE) {
|
||||||
lastShot = System.currentTimeMillis();
|
lastShot = System.currentTimeMillis();
|
||||||
|
|||||||
137
src/main/java/com/hbm/items/weapon/ItemGunPip.java
Normal file
137
src/main/java/com/hbm/items/weapon/ItemGunPip.java
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
package com.hbm.items.weapon;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.handler.GunConfiguration;
|
||||||
|
import com.hbm.render.anim.BusAnimation;
|
||||||
|
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||||
|
import com.hbm.render.anim.BusAnimationSequence;
|
||||||
|
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.item.ItemStack;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ItemGunPip extends ItemGunBase {
|
||||||
|
|
||||||
|
public static long lastShot;
|
||||||
|
public static List<double[]> smokeNodes = new ArrayList();
|
||||||
|
|
||||||
|
public ItemGunPip(GunConfiguration config) {
|
||||||
|
super(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
protected void updateClient(ItemStack stack, World world, EntityPlayer entity, int slot, boolean isCurrentItem) {
|
||||||
|
super.updateClient(stack, world, entity, slot, isCurrentItem);
|
||||||
|
|
||||||
|
boolean smoking = lastShot + 2000 > System.currentTimeMillis();
|
||||||
|
|
||||||
|
if(!smoking && !smokeNodes.isEmpty()) {
|
||||||
|
smokeNodes.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(smoking) {
|
||||||
|
Vec3 prev = Vec3.createVectorHelper(-entity.motionX, -entity.motionY, -entity.motionZ);
|
||||||
|
prev.rotateAroundY((float) (entity.rotationYaw * Math.PI / 180D));
|
||||||
|
double accel = 15D;
|
||||||
|
double side = (entity.rotationYaw - entity.prevRotationYawHead) * 0.1D;
|
||||||
|
double waggle = 0.025D;
|
||||||
|
|
||||||
|
for(double[] node : smokeNodes) {
|
||||||
|
node[0] += -prev.zCoord * accel + world.rand.nextGaussian() * waggle;
|
||||||
|
node[1] += prev.yCoord + 1.5D;
|
||||||
|
node[2] += prev.xCoord * accel + world.rand.nextGaussian() * waggle + side;
|
||||||
|
}
|
||||||
|
|
||||||
|
double alpha = (System.currentTimeMillis() - lastShot) / 2000D;
|
||||||
|
alpha = (1 - alpha) * 0.5D;
|
||||||
|
|
||||||
|
if(this.getIsReloading(stack)) alpha = 0;
|
||||||
|
|
||||||
|
smokeNodes.add(new double[] {0, 0, 0, alpha});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public BusAnimation getAnimation(ItemStack stack, AnimType type) {
|
||||||
|
|
||||||
|
if(type == AnimType.EQUIP) {
|
||||||
|
return new BusAnimation()
|
||||||
|
.addBus("ROTATE", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-360, 0, 0, 350))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == AnimType.CYCLE) {
|
||||||
|
lastShot = System.currentTimeMillis();
|
||||||
|
return new BusAnimation()
|
||||||
|
.addBus("RECOIL", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 50))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, -3, 50))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 250))
|
||||||
|
)
|
||||||
|
.addBus("HAMMER", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 50))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 300))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||||
|
)
|
||||||
|
.addBus("DRUM", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 50))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == AnimType.RELOAD) {
|
||||||
|
int s = 1;
|
||||||
|
return new BusAnimation()
|
||||||
|
.addBus("RELAOD_TILT", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-15, 0, 0, 100 * s))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(65, 0, 0, 100 * s)) //200
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(45, 0, 0, 50 * s)) //250
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200 * s)) //450
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 1450 * s)) //1900
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-80, 0, 0, 100 * s)) //2000
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-80, 0, 0, 100 * s)) //2100
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200 * s)) //2300
|
||||||
|
)
|
||||||
|
.addBus("RELOAD_CYLINDER", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200 * s))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(90, 0, 0, 100 * s)) //300
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(90, 0, 0, 1700 * s)) //2000
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 70 * s)) //2100
|
||||||
|
)
|
||||||
|
.addBus("RELOAD_LIFT", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 350 * s))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-45, 0, 0, 250 * s)) //600
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-45, 0, 0, 350 * s)) //950
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-15, 0, 0, 200 * s)) //1150
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-15, 0, 0, 1050 * s)) //2200
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 100 * s)) //2300
|
||||||
|
)
|
||||||
|
.addBus("RELOAD_JOLT", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 600 * s))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(2, 0, 0, 50 * s)) //650
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 100 * s)) //750
|
||||||
|
)
|
||||||
|
.addBus("RELOAD_BULLETS", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 650 * s))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(10, 0, 0, 300 * s)) //950
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(10, 0, 0, 200 * s)) //1150
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 700 * s)) //1850
|
||||||
|
)
|
||||||
|
.addBus("RELOAD_BULLETS_CON", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 0 * s))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 950 * s))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 1 * s))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -536,7 +536,7 @@ public class ClientProxy extends ServerProxy {
|
|||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_chemthrower, new ItemRenderWeaponChemthrower());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_chemthrower, new ItemRenderWeaponChemthrower());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_m2, new ItemRenderM2());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_m2, new ItemRenderM2());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_nopip, new ItemRenderWeaponNovac());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_nopip, new ItemRenderWeaponNovac());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_pip, new ItemRenderWeaponNovac());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_pip, new ItemRenderWeaponLilMac());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_blackjack, new ItemRenderWeaponNovac());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_blackjack, new ItemRenderWeaponNovac());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_silver, new ItemRenderWeaponNovac());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_silver, new ItemRenderWeaponNovac());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_red, new ItemRenderWeaponNovac());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_red, new ItemRenderWeaponNovac());
|
||||||
|
|||||||
@ -828,6 +828,7 @@ public class ResourceManager {
|
|||||||
public static final IModelCustom cryocannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/cryo_cannon.obj")).asDisplayList();
|
public static final IModelCustom cryocannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/cryo_cannon.obj")).asDisplayList();
|
||||||
public static final IModelCustom uac_pistol = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/UAC pistol.obj")).asDisplayList();
|
public static final IModelCustom uac_pistol = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/UAC pistol.obj")).asDisplayList();
|
||||||
public static final IModelCustom congolake = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/congolake.obj")).asDisplayList();
|
public static final IModelCustom congolake = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/congolake.obj")).asDisplayList();
|
||||||
|
public static final IModelCustom lilmac = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lilmac.obj")).asDisplayList();
|
||||||
|
|
||||||
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
|
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
|
||||||
|
|
||||||
@ -925,6 +926,8 @@ public class ResourceManager {
|
|||||||
public static final ResourceLocation cryocannon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/cryo_cannon.png");
|
public static final ResourceLocation cryocannon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/cryo_cannon.png");
|
||||||
public static final ResourceLocation uac_pistol_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/pistol_texture.png");
|
public static final ResourceLocation uac_pistol_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/pistol_texture.png");
|
||||||
public static final ResourceLocation congolake_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/congolake.png");
|
public static final ResourceLocation congolake_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/congolake.png");
|
||||||
|
public static final ResourceLocation lilmac_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lilmac.png");
|
||||||
|
public static final ResourceLocation lilmac_scope_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lilmac_scope.png");
|
||||||
|
|
||||||
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");
|
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,8 @@ public class HbmAnimations {
|
|||||||
CYCLE, //animation for every firing cycle
|
CYCLE, //animation for every firing cycle
|
||||||
ALT_CYCLE, //animation for alt fire cycles
|
ALT_CYCLE, //animation for alt fire cycles
|
||||||
SPINUP, //animation for actionstart
|
SPINUP, //animation for actionstart
|
||||||
SPINDOWN //animation for actionend
|
SPINDOWN, //animation for actionend
|
||||||
|
EQUIP //animation for drawing the weapon
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Animation {
|
public static class Animation {
|
||||||
|
|||||||
@ -0,0 +1,253 @@
|
|||||||
|
package com.hbm.render.item.weapon;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.weapon.ItemGunPip;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.main.ResourceManager;
|
||||||
|
import com.hbm.render.anim.HbmAnimations;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
|
|
||||||
|
public class ItemRenderWeaponLilMac implements IItemRenderer {
|
||||||
|
|
||||||
|
public static final ResourceLocation lilmac_plume = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lilmac_plume.png");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||||
|
switch(type) {
|
||||||
|
case EQUIPPED:
|
||||||
|
case EQUIPPED_FIRST_PERSON:
|
||||||
|
case ENTITY:
|
||||||
|
case INVENTORY:
|
||||||
|
return true;
|
||||||
|
default: return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||||
|
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||||
|
|
||||||
|
//prevent rendering when using scope
|
||||||
|
if(item.getItem() == ModItems.gun_revolver_pip && type == ItemRenderType.EQUIPPED_FIRST_PERSON && MainRegistry.proxy.me().isSneaking()) return;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
|
switch(type) {
|
||||||
|
|
||||||
|
case EQUIPPED_FIRST_PERSON:
|
||||||
|
|
||||||
|
double s0 = 0.1D;
|
||||||
|
GL11.glRotated(25, 0, 0, 1);
|
||||||
|
GL11.glTranslated(1.0, 0.25, -0.25);
|
||||||
|
GL11.glRotated(170, 0, 1, 0);
|
||||||
|
GL11.glScaled(s0, s0, s0);
|
||||||
|
double width = 0.5D;
|
||||||
|
|
||||||
|
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
|
||||||
|
double[] reloadLift = HbmAnimations.getRelevantTransformation("RELOAD_LIFT");
|
||||||
|
double[] reloadJolt = HbmAnimations.getRelevantTransformation("RELOAD_JOLT");
|
||||||
|
double[] equipSpin = HbmAnimations.getRelevantTransformation("ROTATE");
|
||||||
|
GL11.glTranslated(2, 0, 0);
|
||||||
|
GL11.glRotated(equipSpin[0], 0, 0, 1);
|
||||||
|
GL11.glTranslated(-2, 0, 0);
|
||||||
|
|
||||||
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
Tessellator tess = Tessellator.instance;
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
|
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
|
||||||
|
GL11.glTranslated(-10, 2.25, 0);
|
||||||
|
GL11.glTranslated(-recoil[2] * 3, -recoil[2] * 2, 0);
|
||||||
|
|
||||||
|
if(ItemGunPip.smokeNodes.size() > 1 && equipSpin[0] == 0) {
|
||||||
|
|
||||||
|
tess.startDrawingQuads();
|
||||||
|
tess.setNormal(0F, 1F, 0F);
|
||||||
|
|
||||||
|
for(int i = 0; i < ItemGunPip.smokeNodes.size() - 1; i++) {
|
||||||
|
double[] node = ItemGunPip.smokeNodes.get(i);
|
||||||
|
double[] past = ItemGunPip.smokeNodes.get(i + 1);
|
||||||
|
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, (float) node[3]);
|
||||||
|
tess.addVertex(node[0], node[1], node[2]);
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, 0F);
|
||||||
|
tess.addVertex(node[0], node[1], node[2] + width);
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, 0F);
|
||||||
|
tess.addVertex(past[0], past[1], past[2] + width);
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, (float) past[3]);
|
||||||
|
tess.addVertex(past[0], past[1], past[2]);
|
||||||
|
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, (float) node[3]);
|
||||||
|
tess.addVertex(node[0], node[1], node[2]);
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, 0F);
|
||||||
|
tess.addVertex(node[0], node[1], node[2] - width);
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, 0F);
|
||||||
|
tess.addVertex(past[0], past[1], past[2] - width);
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, (float) past[3]);
|
||||||
|
tess.addVertex(past[0], past[1], past[2]);
|
||||||
|
}
|
||||||
|
tess.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1F);
|
||||||
|
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
GL11.glTranslated(0, reloadLift[0] / -22D, 0);
|
||||||
|
|
||||||
|
GL11.glTranslated(recoil[0], recoil[1], recoil[2]);
|
||||||
|
GL11.glRotated(recoil[2] * 10, 0, 0, 1);
|
||||||
|
GL11.glRotated(reloadLift[0], 0, 0, 1);
|
||||||
|
GL11.glTranslated(reloadJolt[0], 0, 0);
|
||||||
|
|
||||||
|
double[] reloadTilt = HbmAnimations.getRelevantTransformation("RELAOD_TILT");
|
||||||
|
GL11.glRotated(reloadTilt[0], 1, 0, 0);
|
||||||
|
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.lilmac_scope_tex);
|
||||||
|
ResourceManager.lilmac.renderPart("Scope");
|
||||||
|
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.lilmac_tex);
|
||||||
|
ResourceManager.lilmac.renderPart("Gun");
|
||||||
|
|
||||||
|
double[] cylinderFlip = HbmAnimations.getRelevantTransformation("RELOAD_CYLINDER");
|
||||||
|
GL11.glPushMatrix(); /// DRUM PUSH ///
|
||||||
|
GL11.glRotated(cylinderFlip[0], 1, 0, 0);
|
||||||
|
GL11.glTranslated(0, 1.75, 0);
|
||||||
|
GL11.glRotated(HbmAnimations.getRelevantTransformation("DRUM")[2] * -60, 1, 0, 0);
|
||||||
|
GL11.glTranslated(0, -1.75, 0);
|
||||||
|
ResourceManager.lilmac.renderPart("Cylinder");
|
||||||
|
double[] reloadBullets = HbmAnimations.getRelevantTransformation("RELOAD_BULLETS");
|
||||||
|
GL11.glTranslated(reloadBullets[0], reloadBullets[1], reloadBullets[2]);
|
||||||
|
if(HbmAnimations.getRelevantTransformation("RELOAD_BULLETS_CON")[0] != 1)
|
||||||
|
ResourceManager.lilmac.renderPart("Bullets");
|
||||||
|
ResourceManager.lilmac.renderPart("Casings");
|
||||||
|
GL11.glPopMatrix(); /// DRUM POP ///
|
||||||
|
|
||||||
|
GL11.glPushMatrix(); /// HAMMER ///
|
||||||
|
GL11.glTranslated(4, 1.25, 0);
|
||||||
|
GL11.glRotated(-30 + 30 * HbmAnimations.getRelevantTransformation("HAMMER")[2], 0, 0, 1);
|
||||||
|
GL11.glTranslated(-4, -1.25, 0);
|
||||||
|
ResourceManager.lilmac.renderPart("Hammer");
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
|
||||||
|
int flash = 75;
|
||||||
|
if(System.currentTimeMillis() - ItemGunPip.lastShot < flash) {
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslated(0.125, 2.25, 0);
|
||||||
|
|
||||||
|
double fire = (System.currentTimeMillis() - ItemGunPip.lastShot) / (double) flash;
|
||||||
|
|
||||||
|
double height = 4 * fire;
|
||||||
|
double length = 15 * fire;
|
||||||
|
double lift = 3 * fire;
|
||||||
|
double offset = 1 * fire;
|
||||||
|
double lengthOffset = 0.125;
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(lilmac_plume);
|
||||||
|
tess.startDrawingQuads();
|
||||||
|
tess.setNormal(0F, 1F, 0F);
|
||||||
|
tess.setColorRGBA_F(1F, 1F, 1F, 1F);
|
||||||
|
|
||||||
|
tess.addVertexWithUV(0, -height, -offset, 1, 1);
|
||||||
|
tess.addVertexWithUV(0, height, -offset, 0, 1);
|
||||||
|
tess.addVertexWithUV(0, height + lift, length - offset, 0 ,0);
|
||||||
|
tess.addVertexWithUV(0, -height + lift, length - offset, 1, 0);
|
||||||
|
|
||||||
|
tess.addVertexWithUV(0, height, offset, 0, 1);
|
||||||
|
tess.addVertexWithUV(0, -height, offset, 1, 1);
|
||||||
|
tess.addVertexWithUV(0, -height + lift, -length + offset, 1, 0);
|
||||||
|
tess.addVertexWithUV(0, height + lift, -length + offset, 0 ,0);
|
||||||
|
|
||||||
|
tess.addVertexWithUV(0, -height, -offset, 1, 1);
|
||||||
|
tess.addVertexWithUV(0, height, -offset, 0, 1);
|
||||||
|
tess.addVertexWithUV(lengthOffset, height, length - offset, 0 ,0);
|
||||||
|
tess.addVertexWithUV(lengthOffset, -height, length - offset, 1, 0);
|
||||||
|
|
||||||
|
tess.addVertexWithUV(0, height, offset, 0, 1);
|
||||||
|
tess.addVertexWithUV(0, -height, offset, 1, 1);
|
||||||
|
tess.addVertexWithUV(lengthOffset, -height, -length + offset, 1, 0);
|
||||||
|
tess.addVertexWithUV(lengthOffset, height, -length + offset, 0 ,0);
|
||||||
|
|
||||||
|
GL11.glDepthMask(true);
|
||||||
|
tess.draw();
|
||||||
|
GL11.glDepthMask(false);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EQUIPPED:
|
||||||
|
|
||||||
|
double scale = 0.1D;
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
GL11.glRotatef(15F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glRotatef(100, 0.0F, 1.0F, 0.0F);
|
||||||
|
GL11.glRotatef(15F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glTranslatef(-3F, 1F, 4F);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ENTITY:
|
||||||
|
|
||||||
|
double s1 = 0.075D;
|
||||||
|
GL11.glScaled(s1, s1, s1);
|
||||||
|
GL11.glRotatef(90, 0.0F, 1.0F, 0.0F);
|
||||||
|
GL11.glTranslatef(0F, 1F, 0F);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVENTORY:
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
|
||||||
|
double s = 0.8D;
|
||||||
|
GL11.glTranslated(8, 8, 0);
|
||||||
|
GL11.glRotated(180, 0, 1, 0);
|
||||||
|
GL11.glRotated(135, 0, 0, 1);
|
||||||
|
GL11.glScaled(s, s, -s);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type != ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||||
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.lilmac_scope_tex);
|
||||||
|
ResourceManager.lilmac.renderPart("Scope");
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.lilmac_tex);
|
||||||
|
ResourceManager.lilmac.renderPart("Gun");
|
||||||
|
ResourceManager.lilmac.renderPart("Cylinder");
|
||||||
|
ResourceManager.lilmac.renderPart("Bullets");
|
||||||
|
ResourceManager.lilmac.renderPart("Casings");
|
||||||
|
ResourceManager.lilmac.renderPart("Pivot");
|
||||||
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
8226
src/main/resources/assets/hbm/models/weapons/lilmac.obj
Normal file
8226
src/main/resources/assets/hbm/models/weapons/lilmac.obj
Normal file
File diff suppressed because it is too large
Load Diff
@ -201,6 +201,7 @@
|
|||||||
"weapon.coilgunShoot": {"category": "player", "sounds": [{"name": "weapon/coilgunShoot", "stream": false}]},
|
"weapon.coilgunShoot": {"category": "player", "sounds": [{"name": "weapon/coilgunShoot", "stream": false}]},
|
||||||
"weapon.glReload": {"category": "player", "sounds": [{"name": "weapon/glReload", "stream": false}]},
|
"weapon.glReload": {"category": "player", "sounds": [{"name": "weapon/glReload", "stream": false}]},
|
||||||
"weapon.glShoot": {"category": "player", "sounds": [{"name": "weapon/glShoot", "stream": false}]},
|
"weapon.glShoot": {"category": "player", "sounds": [{"name": "weapon/glShoot", "stream": false}]},
|
||||||
|
"weapon.44Shoot": {"category": "player", "sounds": [{"name": "weapon/44Shoot", "stream": false}]},
|
||||||
|
|
||||||
"weapon.dFlash": {"category": "player", "sounds": [{"name": "weapon/dFlash", "stream": false}]},
|
"weapon.dFlash": {"category": "player", "sounds": [{"name": "weapon/dFlash", "stream": false}]},
|
||||||
|
|
||||||
|
|||||||
BIN
src/main/resources/assets/hbm/sounds/weapon/44Shoot.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/weapon/44Shoot.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/textures/models/weapons/lilmac.png
Normal file
BIN
src/main/resources/assets/hbm/textures/models/weapons/lilmac.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 934 B |
Loading…
x
Reference in New Issue
Block a user