Merge remote-tracking branch 'Bob/master' into bob

This commit is contained in:
CrpBnrz 2026-02-10 17:11:01 +08:00
commit 3728adfe13
16 changed files with 2455 additions and 20 deletions

View File

@ -77,6 +77,7 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_akimbo, 1), new Object[] { "UMU", 'U', ModItems.gun_uzi, 'M', WEAPONSTEEL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "BRM", "BGS", 'B', DESH.lightBarrel(), 'R', DESH.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', ANY_PLASTIC.grip(), 'S', DESH.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_panzerschreck, 1), new Object[] { "BBB", "PGM", 'B', DESH.heavyBarrel(), 'P', STEEL.plateCast(), 'G', DESH.grip(), 'M', GUNMETAL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_star_f, 1), new Object[] { "BRM", " G", 'B', WEAPONSTEEL.lightBarrel(), 'R', WEAPONSTEEL.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_g3, 1), new Object[] { "BRM", "WGS", 'B', WEAPONSTEEL.lightBarrel(), 'R', WEAPONSTEEL.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'W', WOOD.grip(), 'G', RUBBER.grip(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_g3_zebra, 1), new Object[] { " M ", "MPM", " M ", 'M', BIGMT.mechanism(), 'P', ModItems.gun_g3 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stinger, 1), new Object[] { "BBB", "PGM", 'B', WEAPONSTEEL.heavyBarrel(), 'P', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'G', WEAPONSTEEL.grip(), 'M', WEAPONSTEEL.mechanism() });

View File

@ -1406,6 +1406,7 @@ public class ModItems {
public static Item gun_uzi_akimbo;
public static Item gun_spas12;
public static Item gun_panzerschreck;
public static Item gun_star_f;
public static Item gun_g3;
public static Item gun_g3_zebra;
public static Item gun_stinger;
@ -6283,6 +6284,7 @@ public class ModItems {
GameRegistry.registerItem(gun_uzi_akimbo, gun_uzi_akimbo.getUnlocalizedName());
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName());
GameRegistry.registerItem(gun_star_f, gun_star_f.getUnlocalizedName());
GameRegistry.registerItem(gun_g3, gun_g3.getUnlocalizedName());
GameRegistry.registerItem(gun_g3_zebra, gun_g3_zebra.getUnlocalizedName());
GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName());

View File

@ -66,6 +66,7 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_akimbo, new ItemRenderUziAkimbo());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderSPAS12());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_panzerschreck, new ItemRenderPanzerschreck());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_star_f, new ItemRenderStarF());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3, new ItemRenderG3(ResourceManager.g3_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3_zebra, new ItemRenderG3(ResourceManager.g3_zebra_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_stinger, new ItemRenderStinger());
@ -263,6 +264,7 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_uzi) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_spas12) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_panzerschreck) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_star_f) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_g3) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_g3_zebra) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_stinger) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);

View File

@ -765,6 +765,43 @@ public class Orchestras {
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STAR_F = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.1875D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 12.5F + (float)entity.getRNG().nextFloat() * 5F, casing.getName());
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
}
}
if(type == GunAnimation.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.9F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1.1F);
}
if(type == GunAnimation.RELOAD) {
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 22) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
if(type == GunAnimation.JAMMED) {
if(timer == 15) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 19) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
if(timer == 23) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 27) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
if(type == GunAnimation.INSPECT) {
if(timer == 7) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_G3 = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;

View File

@ -17,6 +17,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
import com.hbm.main.MainRegistry;
import com.hbm.main.ResourceManager;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
@ -54,11 +55,23 @@ public class XFactory22lr {
.setupStandardFire().recoil(LAMBDA_RECOIL_AM180))
.setupStandardConfiguration()
.anim(LAMBDA_AM180_ANIMS).orchestra(Orchestras.ORCHESTRA_AM180)
).setDefaultAmmo(EnumAmmo.P22_SP, 35).setNameMutator(LAMBDA_NAME_AM180)
).setDefaultAmmo(EnumAmmo.P22_SP, 35).setNameMutator(LAMBDA_NAME_SILENCED)
.setUnlocalizedName("gun_am180");
ModItems.gun_star_f = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(15 * 25).draw(15).inspect(38).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(12.5F).delay(5).dry(17).spread(0.01F).reload(40).jam(32).sound("hbm:weapon.fire.pistolLight", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 15).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
.offset(1, -0.0625 * 1.5, -0.1875D)
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
.setupStandardConfiguration()
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F)
).setDefaultAmmo(EnumAmmo.P22_SP, 15).setNameMutator(LAMBDA_NAME_SILENCED)
.setUnlocalizedName("gun_star_f");
}
public static Function<ItemStack, String> LAMBDA_NAME_AM180 = (stack) -> {
public static Function<ItemStack, String> LAMBDA_NAME_SILENCED = (stack) -> {
if(XWeaponModManager.hasUpgrade(stack, 0, XWeaponModManager.ID_SILENCER)) return stack.getUnlocalizedName() + "_silenced";
return null;
};
@ -71,6 +84,10 @@ public class XFactory22lr {
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25));
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_STAR_F = (stack, ctx) -> {
ItemGunBaseNT.setupRecoil(2.5F, (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5));
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_AM180_ANIMS = (stack, type) -> {
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
switch(type) {
@ -109,4 +126,42 @@ public class XFactory22lr {
return null;
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_STAR_F_ANIMS = (stack, type) -> {
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.125 : -0.5, 15, IType.SIN_DOWN).addPos(0, 0, 0, 35, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -1, 25, IType.SIN_DOWN).addPos(0, 0, 0, 75, IType.SIN_UP))
.addBus("HAMMER", new BusAnimationSequence().addPos(1, 0, 0, 50, IType.SIN_UP).addPos(0, 0, 0, 50, IType.SIN_DOWN))
.addBus("BULLET", ammo <= 1 ? new BusAnimationSequence().setPos(100, 0, 0) : new BusAnimationSequence().addPos(0, 0, 0, 90).addPos(0, 0.5, 2.25, 50));
case CYCLE_DRY: return new BusAnimation()
.addBus("HAMMER", new BusAnimationSequence().addPos(1, 0, 0, 50, IType.SIN_UP).hold(450).addPos(0, 0, 0, 50, IType.SIN_DOWN))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -1, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 75, IType.SIN_UP))
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(-3, 0, 0, 175, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("BULLET", new BusAnimationSequence().setPos(100, 0, 0));
case RELOAD:
return new BusAnimation()
.addBus("TILT", new BusAnimationSequence().addPos(-30, 0, 0, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -1, 100, IType.SIN_FULL).hold(1125).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus("MAG", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, -7, -1.5, 300, IType.SIN_UP).hold(400).addPos(0, 0, 0, 300, IType.SIN_UP))
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(3, 0, 0, 750, IType.SIN_FULL).addPos(-3, 0, 0, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 200).addPos(0, 0, 15, 300, IType.SIN_FULL).hold(900).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("BULLET", new BusAnimationSequence().setPos(ammo <= 1 ? 100 : 0, 0, 0).hold(750).setPos(0, 0, 0).hold(750).addPos(0, 0.5, 2.25, 50));
case JAMMED: return new BusAnimation()
.addBus("TILT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-30, 0, 0, 150, IType.SIN_FULL).hold(800).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, 25, 150, IType.SIN_FULL).hold(800).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 750).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 100, IType.SIN_UP).hold(100).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus("BULLET", new BusAnimationSequence().setPos(0, 0.5, 2.25).hold(750).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(100).addPos(0, 0.5, 2.25, 100, IType.SIN_UP).hold(100).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(100).addPos(0, 0.5, 2.25, 100, IType.SIN_UP));
case INSPECT: return new BusAnimation()
.addBus("TILT", new BusAnimationSequence().addPos(-30, 0, 0, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 25, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 350).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(1125).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus("BULLET", ammo <= 1 ? new BusAnimationSequence().setPos(100, 0, 0) : new BusAnimationSequence().setPos(0, 0.5, 2.25).hold(350).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(1125).addPos(0, 0.5, 2.25, 100, IType.SIN_UP));
}
return null;
};
}

View File

@ -41,7 +41,7 @@ public class HUDComponentAmmoCounter implements IHUDComponent {
@Override
public int getComponentHeight(EntityPlayer player, ItemStack stack){
return 19;
return 17;
}
@Override

View File

@ -91,6 +91,7 @@ public class XWeaponModManager {
ModItems.gun_spas12,
ModItems.gun_panzerschreck };
Item[] wsteelGuns = new Item[] {
ModItems.gun_star_f,
ModItems.gun_g3, ModItems.gun_g3_zebra,
ModItems.gun_stinger,
ModItems.gun_chemthrower };
@ -130,7 +131,7 @@ public class XWeaponModManager {
new WeaponModDefinition(EnumModGeneric.BRONZE_DURA).addMod(bronzeGuns, new WeaponModGenericDurability(117));
new WeaponModDefinition(EnumModSpecial.SPEEDLOADER).addMod(ModItems.gun_liberator, new WeaponModLiberatorSpeedloader(200));
new WeaponModDefinition(EnumModSpecial.SILENCER).addMod(new Item[] {ModItems.gun_am180, ModItems.gun_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_g3, ModItems.gun_amat}, new WeaponModSilencer(ID_SILENCER));
new WeaponModDefinition(EnumModSpecial.SILENCER).addMod(new Item[] {ModItems.gun_am180, ModItems.gun_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_star_f, ModItems.gun_g3, ModItems.gun_amat}, new WeaponModSilencer(ID_SILENCER));
new WeaponModDefinition(EnumModSpecial.SCOPE).addMod(new Item[] {ModItems.gun_heavy_revolver, ModItems.gun_g3, ModItems.gun_mas36, ModItems.gun_charge_thrower}, new WeaponModScope(ID_SCOPE));
new WeaponModDefinition(EnumModSpecial.SAW)
.addMod(new Item[] {ModItems.gun_maresleg, ModItems.gun_double_barrel}, new WeaponModSawedOff(ID_SAWED_OFF))
@ -176,7 +177,8 @@ public class XWeaponModManager {
BulletConfig[] r762 = new BulletConfig[] {XFactory762mm.r762_sp, XFactory762mm.r762_fmj, XFactory762mm.r762_jhp, XFactory762mm.r762_ap, XFactory762mm.r762_du, XFactory762mm.r762_he};
BulletConfig[] bmg50 = new BulletConfig[] {XFactory50.bmg50_sp, XFactory50.bmg50_fmj, XFactory50.bmg50_jhp, XFactory50.bmg50_ap, XFactory50.bmg50_du, XFactory50.bmg50_he};
new WeaponModDefinition(EnumModCaliber.P9)
.addMod(ModItems.gun_henry, new WeaponModCaliber(300, 28, 10F, p9));
.addMod(ModItems.gun_henry, new WeaponModCaliber(300, 28, 10F, p9))
.addMod(ModItems.gun_star_f, new WeaponModCaliber(301, 12, 15F, p9));
new WeaponModDefinition(EnumModCaliber.P45)
.addMod(ModItems.gun_henry, new WeaponModCaliber(310, 28, 10F, p45))
.addMod(ModItems.gun_greasegun, new WeaponModCaliber(311, 24, 3F, p45))

View File

@ -913,6 +913,7 @@ public class ResourceManager {
public static final IModelCustom uzi = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/uzi.obj")).asVBO();
public static final IModelCustom spas_12 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/spas-12.obj")).asVBO();
public static final IModelCustom panzerschreck = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/panzerschreck.obj")).asVBO();
public static final IModelCustom star_f = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/star_f.obj")).asVBO();
public static final IModelCustom g3 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/g3.obj")).asVBO();
public static final IModelCustom stinger = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/stinger.obj")).asVBO();
public static final IModelCustom chemthrower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/chemthrower.obj")).asVBO();
@ -1037,6 +1038,7 @@ public class ResourceManager {
public static final ResourceLocation uzi_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi.png");
public static final ResourceLocation uzi_saturnite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi_saturnite.png");
public static final ResourceLocation panzerschreck_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/panzerschreck.png");
public static final ResourceLocation star_f_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/star_f.png");
public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.png");
public static final ResourceLocation g3_zebra_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_zebra.png");
public static final ResourceLocation g3_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_green.png");

View File

@ -0,0 +1,209 @@
package com.hbm.render.item.weapon.sedna;
import org.lwjgl.opengl.GL11;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderStarF extends ItemRenderWeaponBase {
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
@Override
public float getViewFOV(ItemStack stack, float fov) {
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
return fov * (1 - aimingProgress * 0.33F);
}
@Override
public void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 0.875);
float offset = 0.8F;
standardAimingTransform(stack,
-1.75F * offset, -1.75F * offset, 2.5F * offset,
0, -7.625 / 8D, 1);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_tex);
double scale = 0.25D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER");
double[] tilt = HbmAnimations.getRelevantTransformation("TILT");
double[] turn = HbmAnimations.getRelevantTransformation("TURN");
double[] mag = HbmAnimations.getRelevantTransformation("MAG");
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET");
double[] slide = HbmAnimations.getRelevantTransformation("SLIDE");
GL11.glTranslated(0, -2, -8);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 2, 8);
GL11.glTranslated(0, 1, -3);
GL11.glRotated(turn[2], 0, 0, 1);
GL11.glRotated(tilt[0], 1, 0, 0);
GL11.glTranslated(0, -1, 3);
GL11.glTranslated(0, 0, recoil[2]);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.star_f.renderPart("Gun");
GL11.glPushMatrix();
GL11.glTranslated(0, 1.75, -4.25);
GL11.glRotated(60 * (hammer[0] - 1), 1, 0, 0);
GL11.glTranslated(0, -1.75, 4.25);
ResourceManager.star_f.renderPart("Hammer");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, slide[2] * 2.3125);
ResourceManager.star_f.renderPart("Slide");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(mag[0], mag[1], mag[2]);
ResourceManager.star_f.renderPart("Mag");
GL11.glTranslated(bullet[0], bullet[1], bullet[2]);
ResourceManager.star_f.renderPart("Bullet");
GL11.glPopMatrix();
if(hasSilencer(stack)) {
GL11.glPushMatrix();
GL11.glTranslated(0, 2.375, -0.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Silencer");
GL11.glPopMatrix();
} else {
double smokeScale = 0.5;
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 6.125);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(smokeScale, smokeScale, smokeScale);
this.renderSmokeNodes(gun.getConfig(stack, 0).smokeNodes, 0.75D);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 6.125);
GL11.glScaled(0.75, 0.75, 0.75);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
this.renderMuzzleFlash(gun.lastShot[0], 75, 7.5);
GL11.glPopMatrix();
}
}
@Override
public void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
GL11.glTranslated(0, -0.25, 1.75);
double scale = 0.75D;
GL11.glScaled(scale, scale, scale);
}
@Override
public void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 1.5D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
GL11.glTranslated(-1, -0.5, 0);
}
@Override
public void setupModTable(ItemStack stack) {
double scale = -6.25D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(90, 0, 1, 0);
GL11.glTranslated(0, -0.25, -5);
}
@Override
public void renderModTable(ItemStack stack, int index) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_tex);
ResourceManager.star_f.renderPart("Gun");
ResourceManager.star_f.renderPart("Slide");
ResourceManager.star_f.renderPart("Mag");
ResourceManager.star_f.renderPart("Hammer");
if(hasSilencer(stack)) {
GL11.glTranslated(0, 2.375, -0.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Silencer");
}
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
boolean silenced = hasSilencer(stack);
if(silenced && type == ItemRenderType.INVENTORY) {
double scale = 0.625D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, -6);
}
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_tex);
ResourceManager.star_f.renderPart("Gun");
ResourceManager.star_f.renderPart("Slide");
ResourceManager.star_f.renderPart("Mag");
ResourceManager.star_f.renderPart("Hammer");
if(silenced) {
GL11.glTranslated(0, 2.375, -0.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Silencer");
}
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED && !silenced) {
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
double shotRand = 0;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[0];
shotRand = gun.shotRand;
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 6.25);
GL11.glScaled(0.75, 0.75, 0.75);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
public boolean hasSilencer(ItemStack stack) {
return XWeaponModManager.hasUpgrade(stack, 0, XWeaponModManager.ID_SILENCER);
}
}

View File

@ -2,6 +2,8 @@ package com.hbm.tileentity.machine.rbmk;
import api.hbm.fluidmk2.FluidNetMK2;
import api.hbm.fluidmk2.FluidNode;
import api.hbm.fluidmk2.IFluidReceiverMK2;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.rbmk.RBMKBase;
import com.hbm.entity.effect.EntitySpear;
@ -41,12 +43,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
import java.util.*;
/**
* Base class for all RBMK components, active or passive. Handles heat and the explosion sequence
@ -502,8 +499,8 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
/* Hanlde overpressure event */
if(RBMKDials.getOverpressure(worldObj) && !pipes.isEmpty()) {
HashSet pipeBlocks = new HashSet<>();
HashSet pipeReceivers = new HashSet<>();
HashSet<FluidNode> pipeBlocks = new HashSet<>();
HashSet<Map.Entry<IFluidReceiverMK2, Long>> pipeReceivers = new HashSet<>();
//unify all parts into single sets to prevent redundancy
pipes.forEach(x -> {
@ -513,20 +510,23 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
int count = 0;
int max = Math.min(pipeBlocks.size() / 5, 100);
Iterator itPipes = pipeBlocks.iterator();
Iterator itReceivers = pipeReceivers.iterator();
Iterator<FluidNode> itPipes = pipeBlocks.iterator();
Iterator<Map.Entry<IFluidReceiverMK2, Long>> itReceivers = pipeReceivers.iterator();
while(itPipes.hasNext() && count < max) {
Object pipe = itPipes.next();
if(pipe instanceof TileEntity) {
TileEntity tile = (TileEntity) pipe;
worldObj.setBlock(tile.xCoord, tile.yCoord, tile.zCoord, Blocks.air);
FluidNode node = itPipes.next();
for (BlockPos pos : node.positions) {
int x = pos.getX(), y = pos.getY(), z = pos.getZ();
if (worldObj.getTileEntity(x, y ,z) != null) {
worldObj.setBlock(x, y, z, Blocks.air);
}
}
count++;
}
while(itReceivers.hasNext()) {
Object con = itReceivers.next();
Map.Entry<IFluidReceiverMK2, Long> e = itReceivers.next();
IFluidReceiverMK2 con = e.getKey();
if(con instanceof TileEntity) {
TileEntity tile = (TileEntity) con;
if(con instanceof IOverpressurable) {
@ -568,6 +568,9 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
RBMKBase.dropLids = true;
RBMKBase.digamma = false;
columns.clear();
pipes.clear();
}
private void getFF(int x, int y, int z) {

View File

@ -2224,6 +2224,8 @@ item.gun_pepperbox.name=Bündelrevolver
item.gun_panzerschreck.name=Panzerschreck
item.gun_quadro.name=Vierfachraketenwerfer
item.gun_spas12.name=SPAS-12
item.gun_star_f.name=Sportpistole
item.gun_star_f_silenced.name=Schallgedämpfte Pistole
item.gun_stg77.name=StG 77
item.gun_stinger.name=FIM-92 Stinger
item.gun_tau.name=Taukanone

View File

@ -3067,6 +3067,8 @@ item.gun_pepperbox.name=Pepperbox
item.gun_panzerschreck.name=Panzerschreck
item.gun_quadro.name=Quad Rocket Launcher
item.gun_spas12.name=SPAS-12
item.gun_star_f.name=Target Pistol
item.gun_star_f_silenced.name=Silenced Pistol
item.gun_stg77.name=StG 77
item.gun_stinger.name=FIM-92 Stinger
item.gun_tau.name=Tau Cannon

File diff suppressed because it is too large Load Diff

View File

@ -263,6 +263,7 @@
"weapon.fire.stab": {"category": "player", "sounds": ["weapon/fire/stab1", "weapon/fire/stab2"]},
"weapon.fire.grenade": {"category": "player", "sounds": ["weapon/fire/grenade"]},
"weapon.fire.amat": {"category": "player", "sounds": ["weapon/fire/amat"]},
"weapon.fire.pistolLight": {"category": "player", "sounds": ["weapon/fire/pistolLight"]},
"weapon.reload.boltClose": {"category": "player", "sounds": ["weapon/reload/boltClose"]},
"weapon.reload.boltOpen": {"category": "player", "sounds": ["weapon/reload/boltOpen"]},

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB