Gordon doesn't need to hear all this

This commit is contained in:
Pheonix 2022-03-11 17:30:21 +00:00
parent 8f8590bf99
commit 68c075edfc
12 changed files with 2688 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import com.hbm.items.ModItems;
import com.hbm.items.weapon.GunB92Cell;
import com.hbm.main.CraftingManager;
import gnu.trove.impl.unmodifiable.TUnmodifiableByteByteMap;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
@ -148,6 +149,7 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_mymy, 1), new Object[] { "PP ", " WP", 'P', ModItems.plate_polymer, 'W', ModItems.wire_aluminium });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_darter, 1), new Object[] { "SST", " P", 'S', STEEL.plate(), 'T', ModItems.gas_empty, 'P', ANY_PLASTIC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fireext, 1), new Object[] { "HB", " T", 'H', ModItems.hull_small_steel, 'B', ModItems.bolt_tungsten, 'T', ModItems.tank_steel });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "TPS", "HHR", " L", 'T', ModItems.bolt_tungsten, 'P', STEEL.plate(), 'S', STEEL.ingot(), 'H', ModItems.hull_small_steel, 'R', ModItems.mechanism_rifle_1, 'L', ANY_PLASTIC.ingot()});
//Legacy ammo recycling
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_44, 1), new Object[] { ModItems.gun_revolver_nopip_ammo });

View File

@ -21,6 +21,82 @@ import net.minecraft.potion.PotionEffect;
public class Gun12GaugeFactory {
public static GunConfiguration getSpas12Config() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 25;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_MANUAL;
config.reloadDuration = 10;
config.firingDuration = 5;
config.ammoCap = 8;
config.durability = 2500;
config.reloadType = GunConfiguration.RELOAD_SINGLE;
config.allowsInfinity = true;
config.crosshair = Crosshair.CIRCLE;
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
config.firingSound = "hbm:weapon.shotgunPump";
config.name = "Franchi SPAS-12";
config.manufacturer = "Black Mesa Armory";
config.comment.add("\"Here, I have a more suitable gun for you. You'll need it — Catch!\"");
config.comment.add("Alt-fire with Mouse 2 (Right-click) to fire 2 shells at once");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G12_DU);
config.config.add(BulletConfigSyncingUtil.G12_AM);
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
config.animations.put(AnimType.CYCLE, new BusAnimation()
.addBus("SPAS_RECOIL_TRANSLATE", new BusAnimationSequence()
.addKeyframe(new BusAnimationKeyframe(0, 0, -2, 100))
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
)
.addBus("SPAS_RECOIL_ROT", new BusAnimationSequence()
.addKeyframe(new BusAnimationKeyframe(-1, 0, 1, 100))
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
)
.addBus("SPAS_PUMP", new BusAnimationSequence()
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 450))
.addKeyframe(new BusAnimationKeyframe(0, 0, -1.8, 200))
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
)
);
return config;
}
public static GunConfiguration getSpas12AltConfig() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 35;
config.roundsPerCycle = 2;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_MANUAL;
config.firingDuration = 10;
config.ammoCap = 8;
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
config.firingSound = "hbm:weapon.shotgunPump";
config.reloadType = GunConfiguration.RELOAD_SINGLE;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G12_DU);
config.config.add(BulletConfigSyncingUtil.G12_AM);
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
return config;
}
public static GunConfiguration getUboinikConfig() {
GunConfiguration config = new GunConfiguration();

View File

@ -1636,6 +1636,7 @@ public class ModItems {
public static Item gun_uzi_ammo;
public static Item gun_uboinik;
public static Item gun_uboinik_ammo;
public static Item gun_spas12;
public static Item gun_supershotgun;
public static Item gun_ks23;
public static Item gun_sauer;
@ -4302,6 +4303,7 @@ public class ModItems {
gun_uzi_saturnite_silencer = new ItemGunBase(Gun22LRFactory.getSaturniteConfig().silenced()).setUnlocalizedName("gun_uzi_saturnite_silencer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_saturnite_silencer");
gun_uboinik_ammo = new Item().setUnlocalizedName("gun_uboinik_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_uboinik_ammo");
gun_uboinik = new ItemGunBase(Gun12GaugeFactory.getUboinikConfig()).setUnlocalizedName("gun_uboinik").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
gun_spas12 = new ItemGunBase(Gun12GaugeFactory.getSpas12Config(), Gun12GaugeFactory.getSpas12AltConfig()).setUnlocalizedName("gun_spas12").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_spas12");
gun_supershotgun = new ItemGunShotty(Gun12GaugeFactory.getShottyConfig()).setUnlocalizedName("gun_supershotgun").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
gun_ks23 = new ItemGunBase(Gun4GaugeFactory.getKS23Config()).setUnlocalizedName("gun_ks23").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
gun_sauer = new ItemGunBase(Gun4GaugeFactory.getSauerConfig()).setUnlocalizedName("gun_sauer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
@ -7036,6 +7038,7 @@ public class ModItems {
GameRegistry.registerItem(gun_uzi_saturnite, gun_uzi_saturnite.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi_saturnite_silencer,gun_uzi_saturnite_silencer.getUnlocalizedName());
GameRegistry.registerItem(gun_uboinik, gun_uboinik.getUnlocalizedName());
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
GameRegistry.registerItem(gun_supershotgun, gun_supershotgun.getUnlocalizedName());
GameRegistry.registerItem(gun_ks23, gun_ks23.getUnlocalizedName());
GameRegistry.registerItem(gun_sauer, gun_sauer.getUnlocalizedName());

View File

@ -160,11 +160,16 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
public boolean hasAmmo(ItemStack stack, EntityPlayer player, boolean main) {
if(mainConfig.reloadType == mainConfig.RELOAD_NONE || !main) {
GunConfiguration config = mainConfig;
if(!main)
config = altConfig;
if(mainConfig.reloadType == mainConfig.RELOAD_NONE) {
return getBeltSize(player, getBeltType(player, stack, main)) > 0;
} else {
return getMag(stack) > 0;
return getMag(stack) >= 0 + config.roundsPerCycle;
}
}

View File

@ -422,6 +422,7 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_fireext, new ItemRenderFireExt());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_ar15, new ItemRenderWeaponAR15());
MinecraftForgeClient.registerItemRenderer(ModItems.detonator_laser, new ItemRenderDetonatorLaser());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderWeaponSpas12());
//multitool
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool());

View File

@ -627,6 +627,7 @@ public class ResourceManager {
public static final IModelCustom rem700 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/rem700.obj"));
public static final IModelCustom cursed_revolver = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/cursed.obj"));
public static final IModelCustom detonator_laser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/detonator_laser.obj"));
public static final IModelCustom spas_12 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/spas-12.obj"));
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
@ -696,6 +697,7 @@ public class ResourceManager {
public static final ResourceLocation mg42_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/mg42.png");
public static final ResourceLocation rem700_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/rem700.png");
public static final ResourceLocation detonator_laser_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/detonator_laser.png");
public static final ResourceLocation spas_12_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/spas-12.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -0,0 +1,116 @@
package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
public class ItemRenderWeaponSpas12 implements IItemRenderer {
public ItemRenderWeaponSpas12() { }
@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);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.spas_12_tex);
switch(type) {
case EQUIPPED_FIRST_PERSON:
double[] recoilT = HbmAnimations.getRelevantTransformation("SPAS_RECOIL_TRANSLATE");
double[] recoilR = HbmAnimations.getRelevantTransformation("SPAS_RECOIL_ROT");
double[] pump = HbmAnimations.getRelevantTransformation("SPAS_PUMP");
double s0 = 0.5D;
GL11.glRotated(25, 0, 0, 1);
GL11.glTranslated(0, -0.8, 0.1);
GL11.glRotated(80, 0, 1, 0);
GL11.glScaled(s0, s0, s0);
int m = 2;
GL11.glTranslated(recoilT[0]*m, recoilT[1]*m, recoilT[2]*m);
GL11.glRotated(2, recoilR[0]*m, recoilR[1]*m, recoilR[2]*m);
ResourceManager.spas_12.renderPart("MainBody");
GL11.glTranslated(pump[0], pump[1], pump[2]);
ResourceManager.spas_12.renderPart("PumpGrip");
break;
case EQUIPPED:
double scale = 0.25D;
GL11.glScaled(scale, scale, scale);
GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(10, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(15F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(2F, -1F, -2F);
ResourceManager.spas_12.renderAll();
break;
case ENTITY:
double s1 = 0.25D;
GL11.glScaled(s1, s1, s1);
GL11.glTranslated(0, 0, -4);
ResourceManager.spas_12.renderAll();
break;
case INVENTORY:
GL11.glEnable(GL11.GL_LIGHTING);
double s = 1.6D;
GL11.glTranslated(12, 13.5, 0);
GL11.glRotated(-90, 0, 1, 0);
GL11.glRotated(-135, 1, 0, 0);
GL11.glScaled(s, s, -s);
ResourceManager.spas_12.renderAll();
break;
default: break;
}
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -1751,6 +1751,7 @@ item.gun_sauer.name=Stan Sauer's Shotgun
item.gun_skystinger.name=The One Sky Stinger
item.gun_spark.name=Spark Plug
item.gun_spark_ammo.name=Electromagnetic Cartridge
item.gun_spas12.name=SPAS-12 Shotgun
item.gun_stinger.name=FIM-92 Stinger
item.gun_stinger_ammo.name=Stinger Rocket (LEGACY)
item.gun_super_shotgun.name=Super Shotgun

File diff suppressed because it is too large Load Diff

View File

@ -150,6 +150,7 @@
"weapon.cSwing": {"category": "player", "sounds": [{"name": "weapon/cSwing", "stream": false}]},
"weapon.extinguisher": {"category": "player", "sounds": [{"name": "weapon/extinguisher", "stream": false}]},
"weapon.robin_explosion": {"category": "player", "sounds": [{"name": "weapon/robin_explosion", "stream": false}]},
"weapon.shotgunPump": {"category": "player", "sounds": [{"name": "weapon/shotgunShootPump", "stream": false}]},
"weapon.dFlash": {"category": "player", "sounds": [{"name": "weapon/dFlash", "stream": false}]},

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB