This commit is contained in:
Bob 2021-12-06 19:06:58 +01:00
parent efe0ad736a
commit 779796d4df
7 changed files with 14786 additions and 10 deletions

View File

@ -1653,6 +1653,7 @@ public class ModItems {
public static Item gun_bf_ammo;
public static Item gun_mp40;
public static Item gun_mp40_ammo;
public static Item gun_mg42;
public static Item gun_thompson;
public static Item gun_uzi;
public static Item gun_uzi_silencer;
@ -4315,6 +4316,7 @@ public class ModItems {
gun_bf = new ItemGunBase(GunFatmanFactory.getBELConfig()).setUnlocalizedName("gun_bf").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_bf");
gun_mp40_ammo = new Item().setUnlocalizedName("gun_mp40_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_mp40_ammo");
gun_mp40 = new ItemGunBase(Gun9mmFactory.getMP40Config()).setUnlocalizedName("gun_mp40").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mp40");
gun_mg42 = new ItemGunBase(Gun9mmFactory.getMP40Config()).setUnlocalizedName("gun_mg42").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mg42");
gun_thompson = new ItemGunBase(Gun9mmFactory.getThompsonConfig()).setUnlocalizedName("gun_thompson").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_thompson");
gun_uzi_ammo = new Item().setUnlocalizedName("gun_uzi_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_uzi_ammo");
gun_uzi = new ItemGunBase(Gun22LRFactory.getUziConfig()).setUnlocalizedName("gun_uzi").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi");
@ -7076,6 +7078,7 @@ public class ModItems {
GameRegistry.registerItem(gun_mirv, gun_mirv.getUnlocalizedName());
GameRegistry.registerItem(gun_bf, gun_bf.getUnlocalizedName());
GameRegistry.registerItem(gun_mp40, gun_mp40.getUnlocalizedName());
GameRegistry.registerItem(gun_mg42, gun_mg42.getUnlocalizedName());
GameRegistry.registerItem(gun_thompson, gun_thompson.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi, gun_uzi.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi_silencer,gun_uzi_silencer.getUnlocalizedName());

View File

@ -414,6 +414,7 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bolter_digamma, new ItemRenderWeaponBolter());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_fireext, new ItemRenderFireExt());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_ar15, new ItemRenderWeaponAR15());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_mg42, new ItemRenderWeaponFFMG42());
//multitool
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool());

View File

@ -597,6 +597,7 @@ public class ResourceManager {
public static final IModelCustom ff_nightmare = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/nightmare.obj"));
public static final IModelCustom fireext = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/fireext.obj"));
public static final IModelCustom ar15 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/ar15.obj"));
public static final IModelCustom mg42 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/mg42.obj"));
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
@ -660,6 +661,7 @@ public class ResourceManager {
public static final ResourceLocation fireext_foam_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_foam.png");
public static final ResourceLocation fireext_sand_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_sand.png");
public static final ResourceLocation ar15_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/carbine.png");
public static final ResourceLocation mg42_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/mg42.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -0,0 +1,95 @@
package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemRenderWeaponFFMG42 implements IItemRenderer {
public ItemRenderWeaponFFMG42() { }
@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) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.mg42_tex);
switch(type) {
case EQUIPPED_FIRST_PERSON:
double s0 = 0.65D;
GL11.glRotated(170, 0, 1, 0);
GL11.glRotated(-25, 0, 0, 1);
GL11.glTranslated(-0.125, 0, 0);
GL11.glScaled(s0, s0, s0);
break;
case EQUIPPED:
double scale = 0.35D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(100, 0, 1, 0);
GL11.glRotated(-10, 1, 0, 0);
GL11.glRotated(10, 0, 0, 1);
GL11.glTranslated(-0.5, 0.75, 1.25);
break;
case ENTITY:
double s1 = 0.3D;
GL11.glScaled(s1, s1, s1);
break;
case INVENTORY:
GL11.glEnable(GL11.GL_LIGHTING);
double s = 1.75D;
GL11.glTranslated(10, 9.5, 0);
GL11.glRotated(180, 1, 0, 0);
GL11.glRotated(-45, 0, 0, 1);
GL11.glScaled(s, s, -s);
break;
default: break;
}
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.mg42.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -1,10 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B