mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
SHREDDER
This commit is contained in:
parent
8f2471986b
commit
867a6d38de
@ -1614,6 +1614,7 @@ public class ModItems {
|
||||
public static Item gun_stinger;
|
||||
public static Item gun_chemthrower;
|
||||
public static Item gun_m2;
|
||||
public static Item gun_autoshotgun;
|
||||
|
||||
public static Item ammo_standard;
|
||||
|
||||
@ -6957,6 +6958,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_chemthrower, gun_chemthrower.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_m2, gun_m2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_autoshotgun, gun_autoshotgun.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(ammo_standard, ammo_standard.getUnlocalizedName());
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ public class GunFactoryClient {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_stinger, new ItemRenderStinger());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_chemthrower, new ItemRenderChemthrower());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_m2, new ItemRenderM2());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_autoshotgun, new ItemRenderShredder());
|
||||
//PROJECTILES
|
||||
ammo_debug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
ammo_debug_buckshot.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
@ -110,6 +111,7 @@ public class GunFactoryClient {
|
||||
((ItemGunBaseNT) ModItems.gun_stinger) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_chemthrower) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_m2) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_autoshotgun) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
|
||||
((ItemGunBaseNT) ModItems.gun_light_revolver_dani).getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_light_revolver_dani).getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
|
||||
@ -735,4 +735,11 @@ public class Orchestras {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_SHREDDER = (stack, ctx) -> {
|
||||
EntityPlayer player = ctx.player;
|
||||
if(player.worldObj.isRemote) return;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
};
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.items.weapon.sedna.Receiver;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
@ -39,11 +40,13 @@ public class XFactory12ga {
|
||||
g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_BRASS).setScale(1.5F).register("12GA_BP_SLUG"));
|
||||
g12 = new BulletConfig().setItem(EnumAmmo.G12).setProjectiles(8, 8).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
|
||||
|
||||
BulletConfig[] all = new BulletConfig[] {g12_bp, g12_bp_magnum, g12_bp_slug, g12};
|
||||
|
||||
ModItems.gun_maresleg = new ItemGunBaseNT(new GunConfig()
|
||||
.dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 6).addConfigs(g12_bp, g12_bp_magnum, g12_bp_slug, g12))
|
||||
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
|
||||
.offset(0.75, -0.0625, -0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.setupStandardConfiguration()
|
||||
@ -53,7 +56,7 @@ public class XFactory12ga {
|
||||
new GunConfig().dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 6).addConfigs(g12_bp, g12_bp_magnum, g12_bp_slug, g12))
|
||||
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
|
||||
.offset(0.75, -0.0625, 0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
@ -62,7 +65,7 @@ public class XFactory12ga {
|
||||
new GunConfig().dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(1, 6).addConfigs(g12_bp, g12_bp_magnum, g12_bp_slug, g12))
|
||||
.mag(new MagazineSingleReload(1, 6).addConfigs(all))
|
||||
.offset(0.75, -0.0625, -0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
@ -74,7 +77,7 @@ public class XFactory12ga {
|
||||
.dura(200).draw(20).inspect(21).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(20).rounds(4).reload(25, 15, 7, 0).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 4).addConfigs(g12_bp, g12_bp_magnum, g12_bp_slug, g12))
|
||||
.mag(new MagazineSingleReload(0, 4).addConfigs(all))
|
||||
.offset(0.75, -0.0625, -0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.setupStandardConfiguration()
|
||||
@ -85,12 +88,23 @@ public class XFactory12ga {
|
||||
.dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(20).reload(5, 10, 10, 10, 0).jam(24).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 8).addConfigs(g12_bp, g12_bp_magnum, g12_bp_slug, g12))
|
||||
.mag(new MagazineSingleReload(0, 8).addConfigs(all))
|
||||
.offset(0.75, -0.0625, -0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.setupStandardConfiguration().ps(LAMBDA_SPAS_SECONDARY).pt(null)
|
||||
.anim(LAMBDA_SPAS_ANIMS).orchestra(Orchestras.ORCHESTRA_SPAS)
|
||||
).setUnlocalizedName("gun_spas12").setTextureName(RefStrings.MODID + ":gun_darter");
|
||||
|
||||
ModItems.gun_autoshotgun = new ItemGunBaseNT(new GunConfig()
|
||||
.dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(15F).delay(10).auto(true).reload(20).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(0, 20).addConfigs(all))
|
||||
.offset(0.75, -0.0625, -0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.setupStandardConfiguration()
|
||||
.anim(LAMBDA_SHREDDER_ANIMS).orchestra(Orchestras.ORCHESTRA_SHREDDER)
|
||||
).setUnlocalizedName("gun_autoshotgun").setTextureName(RefStrings.MODID + ":gun_darter");
|
||||
}
|
||||
//TODO: make generic code for this crap
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SPAS_SECONDARY = (stack, ctx) -> {
|
||||
@ -303,4 +317,13 @@ public class XFactory12ga {
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_SHREDDER_ANIMS = (stack, 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));
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
@ -253,9 +253,6 @@ public class ResourceManager {
|
||||
//Forcefield
|
||||
public static final IModelCustom forcefield_top = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/forcefield_top.obj"));
|
||||
|
||||
//Shredder
|
||||
public static final IModelCustom shredder = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/shredder.obj"));
|
||||
|
||||
//Bombs
|
||||
public static final IModelCustom bomb_gadget = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/bombs/gadget.obj")).asVBO();
|
||||
public static final IModelCustom bomb_boy = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/LilBoy1.obj"));
|
||||
@ -680,9 +677,6 @@ public class ResourceManager {
|
||||
public static final ResourceLocation forcefield_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/forcefield_base.png");
|
||||
public static final ResourceLocation forcefield_top_tex = new ResourceLocation(RefStrings.MODID, "textures/models/forcefield_top.png");
|
||||
|
||||
//Shredder
|
||||
public static final ResourceLocation shredder_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/shredder.png");
|
||||
|
||||
//Bombs
|
||||
public static final ResourceLocation bomb_gadget_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/gadget.png");
|
||||
public static final ResourceLocation bomb_boy_tex = new ResourceLocation(RefStrings.MODID, "textures/models/lilboy.png");
|
||||
@ -863,6 +857,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom uzi = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/uzi.obj")).asVBO();
|
||||
public static final IModelCustom panzerschreck = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/panzerschreck.obj")).asVBO();
|
||||
public static final IModelCustom g3 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/g3.obj")).asVBO();
|
||||
public static final IModelCustom shredder = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/shredder.obj")).asVBO();
|
||||
|
||||
public static final HashMap<String, BusAnimation> python_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/python.json"));
|
||||
public static final HashMap<String, BusAnimation> cursed_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/cursed.json"));
|
||||
@ -991,6 +986,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation uzi_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi.png");
|
||||
public static final ResourceLocation panzerschreck_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/panzerschreck.png");
|
||||
public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.png");
|
||||
public static final ResourceLocation shredder_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/shredder.png");
|
||||
|
||||
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");
|
||||
|
||||
|
||||
@ -0,0 +1,141 @@
|
||||
package com.hbm.render.item.weapon.sedna;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemRenderShredder extends ItemRenderWeaponBase {
|
||||
|
||||
@Override
|
||||
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
|
||||
|
||||
@Override
|
||||
public void setupFirstPerson(ItemStack stack) {
|
||||
GL11.glTranslated(0, 0, 0.875);
|
||||
|
||||
float offset = 0.8F;
|
||||
standardAimingTransform(stack,
|
||||
-1.5F * offset, -1.25F * offset, 1.5F * offset,
|
||||
0, -6.25 / 8D, 0.5);
|
||||
}
|
||||
|
||||
protected static String label = "[> <]";
|
||||
|
||||
@Override
|
||||
public void renderFirstPerson(ItemStack stack) {
|
||||
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
double scale = 0.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
|
||||
double[] lift = HbmAnimations.getRelevantTransformation("LIFT");
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
|
||||
|
||||
GL11.glTranslated(0, -2, -6);
|
||||
GL11.glRotated(equip[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 2, 6);
|
||||
|
||||
GL11.glTranslated(0, 0, -4);
|
||||
GL11.glRotated(lift[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 0, 4);
|
||||
|
||||
GL11.glTranslated(0, 0, recoil[2]);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
if(gun.prevAimingProgress >= 1F && gun.aimingProgress >= 1F) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
float f3 = 0.04F;
|
||||
GL11.glTranslatef((font.getStringWidth(label) / 2) * f3, 3.25F, -1);
|
||||
GL11.glScalef(f3, -f3, f3);
|
||||
GL11.glRotated(180D, 0, 1, 0);
|
||||
GL11.glNormal3f(0.0F, 0.0F, -1.0F * f3);
|
||||
float variance = 0.7F + player.getRNG().nextFloat() * 0.3F;
|
||||
font.drawString(label, 0, 0, new Color(0F, variance, 0F).getRGB());
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
int brightness = player.worldObj.getLightBrightnessForSkyBlocks(MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), 0);
|
||||
int j = brightness % 65536;
|
||||
int k = brightness / 65536;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.shredder_tex);
|
||||
|
||||
ResourceManager.shredder.renderPart("Gun");
|
||||
ResourceManager.shredder.renderPart("Magazine");
|
||||
ResourceManager.shredder.renderPart("Shells");
|
||||
|
||||
double smokeScale = 0.75;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, 13);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glScaled(smokeScale, smokeScale, smokeScale);
|
||||
this.renderSmokeNodes(gun.getConfig(stack, 0).smokeNodes, 0.5D);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, 12);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glRotated(-25 + gun.shotRand * 10, 1, 0, 0);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
this.renderMuzzleFlash(gun.lastShot[0], 75, 10);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupThirdPerson(ItemStack stack) {
|
||||
super.setupThirdPerson(stack);
|
||||
double scale = 1.5D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glTranslated(0, 0.5, 4);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupInv(ItemStack stack) {
|
||||
super.setupInv(stack);
|
||||
double scale = 1.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glRotated(45, 0, 1, 0);
|
||||
GL11.glTranslated(-1.5, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderOther(ItemStack stack, ItemRenderType type) {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.shredder_tex);
|
||||
ResourceManager.shredder.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 7.5 KiB |
Loading…
x
Reference in New Issue
Block a user