mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-02-21 13:32:28 +00:00
brick by brick, suck my dick
This commit is contained in:
parent
ecab0fbcb3
commit
720fb07b0f
@ -78,6 +78,7 @@ public class WeaponRecipes {
|
|||||||
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_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_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_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_star_f_akimbo, 1), new Object[] { "UMU", 'U', ModItems.gun_star_f, 'M', BIGMT.mechanism() });
|
||||||
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, 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_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() });
|
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() });
|
||||||
|
|||||||
@ -1407,6 +1407,7 @@ public class ModItems {
|
|||||||
public static Item gun_spas12;
|
public static Item gun_spas12;
|
||||||
public static Item gun_panzerschreck;
|
public static Item gun_panzerschreck;
|
||||||
public static Item gun_star_f;
|
public static Item gun_star_f;
|
||||||
|
public static Item gun_star_f_akimbo;
|
||||||
public static Item gun_g3;
|
public static Item gun_g3;
|
||||||
public static Item gun_g3_zebra;
|
public static Item gun_g3_zebra;
|
||||||
public static Item gun_stinger;
|
public static Item gun_stinger;
|
||||||
@ -6285,6 +6286,7 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
|
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName());
|
GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_star_f, gun_star_f.getUnlocalizedName());
|
GameRegistry.registerItem(gun_star_f, gun_star_f.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(gun_star_f_akimbo, gun_star_f_akimbo.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_g3, gun_g3.getUnlocalizedName());
|
GameRegistry.registerItem(gun_g3, gun_g3.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_g3_zebra, gun_g3_zebra.getUnlocalizedName());
|
GameRegistry.registerItem(gun_g3_zebra, gun_g3_zebra.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName());
|
GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName());
|
||||||
|
|||||||
@ -67,6 +67,7 @@ public class GunFactoryClient {
|
|||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderSPAS12());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderSPAS12());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_panzerschreck, new ItemRenderPanzerschreck());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_panzerschreck, new ItemRenderPanzerschreck());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_star_f, new ItemRenderStarF());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_star_f, new ItemRenderStarF());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_star_f_akimbo, new ItemRenderStarFAkimbo());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3, new ItemRenderG3(ResourceManager.g3_tex));
|
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_g3_zebra, new ItemRenderG3(ResourceManager.g3_zebra_tex));
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_stinger, new ItemRenderStinger());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_stinger, new ItemRenderStinger());
|
||||||
@ -307,6 +308,8 @@ public class GunFactoryClient {
|
|||||||
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||||
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||||
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||||
|
((ItemGunBaseNT) ModItems.gun_star_f_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||||
|
((ItemGunBaseNT) ModItems.gun_star_f_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||||
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||||
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||||
((ItemGunBaseNT) ModItems.gun_aberrator_eott) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
((ItemGunBaseNT) ModItems.gun_aberrator_eott) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||||
|
|||||||
@ -802,6 +802,44 @@ public class Orchestras {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STAR_F_AKIMBO = (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) {
|
||||||
|
int side = ctx.configIndex == 0 ? -1 : 1;
|
||||||
|
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 * side, 0, 0.18, -0.12 * side, 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) -> {
|
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_G3 = (stack, ctx) -> {
|
||||||
EntityLivingBase entity = ctx.entity;
|
EntityLivingBase entity = ctx.entity;
|
||||||
if(entity.worldObj.isRemote) return;
|
if(entity.worldObj.isRemote) return;
|
||||||
|
|||||||
@ -69,6 +69,27 @@ public class XFactory22lr {
|
|||||||
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F)
|
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F)
|
||||||
).setDefaultAmmo(EnumAmmo.P22_SP, 15).setNameMutator(LAMBDA_NAME_SILENCED)
|
).setDefaultAmmo(EnumAmmo.P22_SP, 15).setNameMutator(LAMBDA_NAME_SILENCED)
|
||||||
.setUnlocalizedName("gun_star_f");
|
.setUnlocalizedName("gun_star_f");
|
||||||
|
|
||||||
|
ModItems.gun_star_f_akimbo = new ItemGunBaseNT(WeaponQuality.B_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.25D)
|
||||||
|
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
|
||||||
|
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||||
|
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
|
||||||
|
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F_AKIMBO),
|
||||||
|
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(1, 15).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
|
||||||
|
.offset(1, -0.0625 * 1.5, -0.25D)
|
||||||
|
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
|
||||||
|
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||||
|
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
|
||||||
|
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F_AKIMBO)
|
||||||
|
).setDefaultAmmo(EnumAmmo.P9_SP, 30).setUnlocalizedName("gun_star_f_akimbo");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Function<ItemStack, String> LAMBDA_NAME_SILENCED = (stack) -> {
|
public static Function<ItemStack, String> LAMBDA_NAME_SILENCED = (stack) -> {
|
||||||
@ -77,7 +98,7 @@ public class XFactory22lr {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
|
||||||
Lego.handleStandardSmoke(ctx.entity, stack, 3000, 0.05D, 1.1D, 0);
|
Lego.handleStandardSmoke(ctx.entity, stack, 3000, 0.05D, 1.1D, ctx.configIndex);
|
||||||
};
|
};
|
||||||
|
|
||||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_AM180 = (stack, ctx) -> {
|
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_AM180 = (stack, ctx) -> {
|
||||||
|
|||||||
@ -91,7 +91,7 @@ public class XWeaponModManager {
|
|||||||
ModItems.gun_spas12,
|
ModItems.gun_spas12,
|
||||||
ModItems.gun_panzerschreck };
|
ModItems.gun_panzerschreck };
|
||||||
Item[] wsteelGuns = new Item[] {
|
Item[] wsteelGuns = new Item[] {
|
||||||
ModItems.gun_star_f,
|
ModItems.gun_star_f, ModItems.gun_star_f_akimbo,
|
||||||
ModItems.gun_g3, ModItems.gun_g3_zebra,
|
ModItems.gun_g3, ModItems.gun_g3_zebra,
|
||||||
ModItems.gun_stinger,
|
ModItems.gun_stinger,
|
||||||
ModItems.gun_chemthrower };
|
ModItems.gun_chemthrower };
|
||||||
@ -131,7 +131,7 @@ public class XWeaponModManager {
|
|||||||
new WeaponModDefinition(EnumModGeneric.BRONZE_DURA).addMod(bronzeGuns, new WeaponModGenericDurability(117));
|
new WeaponModDefinition(EnumModGeneric.BRONZE_DURA).addMod(bronzeGuns, new WeaponModGenericDurability(117));
|
||||||
|
|
||||||
new WeaponModDefinition(EnumModSpecial.SPEEDLOADER).addMod(ModItems.gun_liberator, new WeaponModLiberatorSpeedloader(200));
|
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_star_f, 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_star_f_akimbo, 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.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)
|
new WeaponModDefinition(EnumModSpecial.SAW)
|
||||||
.addMod(new Item[] {ModItems.gun_maresleg, ModItems.gun_double_barrel}, new WeaponModSawedOff(ID_SAWED_OFF))
|
.addMod(new Item[] {ModItems.gun_maresleg, ModItems.gun_double_barrel}, new WeaponModSawedOff(ID_SAWED_OFF))
|
||||||
@ -178,7 +178,8 @@ public class XWeaponModManager {
|
|||||||
BulletConfig[] bmg50 = new BulletConfig[] {XFactory50.bmg50_sp, XFactory50.bmg50_fmj, XFactory50.bmg50_jhp, XFactory50.bmg50_ap, XFactory50.bmg50_du, XFactory50.bmg50_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)
|
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));
|
.addMod(ModItems.gun_star_f, new WeaponModCaliber(301, 12, 15F, p9))
|
||||||
|
.addMod(ModItems.gun_star_f_akimbo, new WeaponModCaliber(302, 12, 15F, p9));
|
||||||
new WeaponModDefinition(EnumModCaliber.P45)
|
new WeaponModDefinition(EnumModCaliber.P45)
|
||||||
.addMod(ModItems.gun_henry, new WeaponModCaliber(310, 28, 10F, p45))
|
.addMod(ModItems.gun_henry, new WeaponModCaliber(310, 28, 10F, p45))
|
||||||
.addMod(ModItems.gun_greasegun, new WeaponModCaliber(311, 24, 3F, p45))
|
.addMod(ModItems.gun_greasegun, new WeaponModCaliber(311, 24, 3F, p45))
|
||||||
|
|||||||
@ -1041,6 +1041,7 @@ public class ResourceManager {
|
|||||||
public static final ResourceLocation uzi_saturnite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi_saturnite.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 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 star_f_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/star_f.png");
|
||||||
|
public static final ResourceLocation star_f_elite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/star_f_elite.png");
|
||||||
public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.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_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");
|
public static final ResourceLocation g3_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_green.png");
|
||||||
|
|||||||
@ -141,18 +141,7 @@ public class ItemRenderStarF extends ItemRenderWeaponBase {
|
|||||||
public void renderModTable(ItemStack stack, int index) {
|
public void renderModTable(ItemStack stack, int index) {
|
||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
|
||||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
renderStandardGun(stack);
|
||||||
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
|
@Override
|
||||||
@ -167,18 +156,7 @@ public class ItemRenderStarF extends ItemRenderWeaponBase {
|
|||||||
GL11.glTranslated(0, 0, -6);
|
GL11.glTranslated(0, 0, -6);
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
renderStandardGun(stack);
|
||||||
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) {
|
if(type == ItemRenderType.EQUIPPED && !silenced) {
|
||||||
EntityLivingBase ent = (EntityLivingBase) data[1];
|
EntityLivingBase ent = (EntityLivingBase) data[1];
|
||||||
@ -206,4 +184,21 @@ public class ItemRenderStarF extends ItemRenderWeaponBase {
|
|||||||
public boolean hasSilencer(ItemStack stack) {
|
public boolean hasSilencer(ItemStack stack) {
|
||||||
return XWeaponModManager.hasUpgrade(stack, 0, XWeaponModManager.ID_SILENCER);
|
return XWeaponModManager.hasUpgrade(stack, 0, XWeaponModManager.ID_SILENCER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void renderStandardGun(ItemStack stack) {
|
||||||
|
|
||||||
|
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");
|
||||||
|
boolean silenced = hasSilencer(stack);
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,293 @@
|
|||||||
|
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.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ItemRenderStarFAkimbo extends ItemRenderWeaponBase {
|
||||||
|
|
||||||
|
@Override public boolean isAkimbo() { return true; }
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFirstPerson(ItemStack stack) {
|
||||||
|
|
||||||
|
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||||
|
|
||||||
|
float offset = 0.8F;
|
||||||
|
|
||||||
|
for(int i = -1; i <= 1; i += 2) {
|
||||||
|
int index = i == -1 ? 0 : 1;
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_elite_tex);
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
standardAimingTransform(stack, -2F * offset * i, -1.75F * offset, 2.5F * offset, 0, -7.625 / 8D, 1);
|
||||||
|
|
||||||
|
double scale = 0.25D;
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
|
||||||
|
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP", index);
|
||||||
|
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL", index);
|
||||||
|
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER", index);
|
||||||
|
double[] tilt = HbmAnimations.getRelevantTransformation("TILT", index);
|
||||||
|
double[] turn = HbmAnimations.getRelevantTransformation("TURN", index);
|
||||||
|
double[] mag = HbmAnimations.getRelevantTransformation("MAG", index);
|
||||||
|
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET", index);
|
||||||
|
double[] slide = HbmAnimations.getRelevantTransformation("SLIDE", index);
|
||||||
|
|
||||||
|
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] * i, 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, index)) {
|
||||||
|
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, index).smokeNodes, 0.75D);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
|
||||||
|
renderMuzzleFlash(gun.shotRand, gun.lastShot[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
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 setupThirdPersonAkimbo(ItemStack stack) {
|
||||||
|
super.setupThirdPersonAkimbo(stack);
|
||||||
|
GL11.glTranslated(0, -0.25, 1.75);
|
||||||
|
double scale = 0.75D;
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setupInv(ItemStack stack) {
|
||||||
|
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
|
||||||
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||||
|
GL11.glScaled(1, 1, -1);
|
||||||
|
GL11.glTranslated(8, 8, 0);
|
||||||
|
double scale = 1.5D;
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 renderEquipped(ItemStack stack, Object... data) {
|
||||||
|
renderStandardGun(stack, 1);
|
||||||
|
if(!hasSilencer(stack, 1)) renderThirdPersonFlash((EntityLivingBase) data[1], stack, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase ent) {
|
||||||
|
renderStandardGun(stack, 0);
|
||||||
|
if(!hasSilencer(stack, 0)) renderThirdPersonFlash(ent, stack, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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_elite_tex);
|
||||||
|
ResourceManager.star_f.renderPart("Gun");
|
||||||
|
ResourceManager.star_f.renderPart("Slide");
|
||||||
|
ResourceManager.star_f.renderPart("Mag");
|
||||||
|
ResourceManager.star_f.renderPart("Hammer");
|
||||||
|
if(hasSilencer(stack, index)) {
|
||||||
|
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 renderEntity(ItemStack stack) {
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
|
|
||||||
|
boolean anySilenced = hasSilencer(stack, 0) || hasSilencer(stack, 1);
|
||||||
|
|
||||||
|
if(anySilenced) {
|
||||||
|
GL11.glScaled(0.75, 0.75, 0.75);
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslated(-1, 1, 0);
|
||||||
|
renderStandardGun(stack, 1);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslated(1, 1, 0);
|
||||||
|
renderStandardGun(stack, 0);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
|
|
||||||
|
boolean anySilenced = hasSilencer(stack, 0) || hasSilencer(stack, 1);
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glRotated(225, 0, 0, 1);
|
||||||
|
GL11.glRotated(90, 0, 1, 0);
|
||||||
|
GL11.glRotated(25, 1, 0, 0);
|
||||||
|
GL11.glRotated(45, 0, 1, 0);
|
||||||
|
GL11.glTranslated(0.5, 0, 0);
|
||||||
|
if(anySilenced) {
|
||||||
|
double scale = 0.625D;
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
GL11.glTranslated(0, 0, -4);
|
||||||
|
}
|
||||||
|
renderStandardGun(stack, 1);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
GL11.glTranslated(0, 0, 5);
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glRotated(225, 0, 0, 1);
|
||||||
|
GL11.glRotated(-90, 0, 1, 0);
|
||||||
|
GL11.glRotated(-90, 1, 0, 0);
|
||||||
|
GL11.glRotated(25, 1, 0, 0);
|
||||||
|
GL11.glRotated(-45, 0, 1, 0);
|
||||||
|
GL11.glTranslated(-0.5, 0, 0);
|
||||||
|
if(anySilenced) {
|
||||||
|
double scale = 0.625D;
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
GL11.glTranslated(0, 0, -4);
|
||||||
|
}
|
||||||
|
renderStandardGun(stack, 0);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasSilencer(ItemStack stack, int cfg) {
|
||||||
|
return XWeaponModManager.hasUpgrade(stack, cfg, XWeaponModManager.ID_SILENCER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderStandardGun(ItemStack stack, int index) {
|
||||||
|
|
||||||
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_elite_tex);
|
||||||
|
ResourceManager.star_f.renderPart("Gun");
|
||||||
|
ResourceManager.star_f.renderPart("Slide");
|
||||||
|
ResourceManager.star_f.renderPart("Mag");
|
||||||
|
ResourceManager.star_f.renderPart("Hammer");
|
||||||
|
boolean silenced = hasSilencer(stack, index);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderThirdPersonFlash(Entity ent, ItemStack stack, int config) {
|
||||||
|
|
||||||
|
long shot;
|
||||||
|
double shotRand = 0;
|
||||||
|
if(ent == Minecraft.getMinecraft().thePlayer) {
|
||||||
|
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||||
|
shot = gun.lastShot[config];
|
||||||
|
shotRand = gun.shotRand;
|
||||||
|
} else {
|
||||||
|
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
|
||||||
|
if(shot < 0) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
renderMuzzleFlash(shotRand, shot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderMuzzleFlash(double shotRand, long shot) {
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslated(0, 3, 6.125);
|
||||||
|
GL11.glRotated(90, 0, 1, 0);
|
||||||
|
GL11.glRotated(90 * shotRand, 1, 0, 0);
|
||||||
|
this.renderMuzzleFlash(shot, 75, 7.5);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package com.hbm.tileentity.machine;
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
@ -10,6 +11,8 @@ import com.hbm.inventory.fluid.Fluids;
|
|||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.sound.AudioWrapper;
|
||||||
import com.hbm.tileentity.IConfigurableMachine;
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
@ -31,6 +34,9 @@ public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase im
|
|||||||
public static double ACCELERATION = 1D / 400D;
|
public static double ACCELERATION = 1D / 400D;
|
||||||
public long lastPowerTarget = 0;
|
public long lastPowerTarget = 0;
|
||||||
|
|
||||||
|
private AudioWrapper audio;
|
||||||
|
private float audioDesync;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getConfigName() {
|
public String getConfigName() {
|
||||||
return "steamturbineIndustrial";
|
return "steamturbineIndustrial";
|
||||||
@ -55,6 +61,9 @@ public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase im
|
|||||||
tanks = new FluidTank[2];
|
tanks = new FluidTank[2];
|
||||||
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||||
|
|
||||||
|
Random rand = new Random();
|
||||||
|
audioDesync = rand.nextFloat() * 0.05F;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sets the power target so we know how much this steam type can theoretically make, and increments the spin based on actual throughput
|
// sets the power target so we know how much this steam type can theoretically make, and increments the spin based on actual throughput
|
||||||
@ -98,6 +107,28 @@ public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase im
|
|||||||
this.lastRotor -= 360;
|
this.lastRotor -= 360;
|
||||||
this.rotor -= 360;
|
this.rotor -= 360;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.spin > 0 && MainRegistry.proxy.me().getDistance(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) <= 35) {
|
||||||
|
|
||||||
|
float spinNum = (float) Math.min(1F, spin * 2);
|
||||||
|
float volume = this.getVolume(0.25F + spinNum * 0.75F);
|
||||||
|
float pitch = 0.5F + spinNum * 0.5F + this.audioDesync;
|
||||||
|
|
||||||
|
if(audio == null) {
|
||||||
|
audio = MainRegistry.proxy.getLoopedSound("hbm:block.largeTurbineRunning", xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, volume, 20F, pitch, 20);
|
||||||
|
audio.startSound();
|
||||||
|
}
|
||||||
|
|
||||||
|
audio.keepAlive();
|
||||||
|
audio.updatePitch(pitch);
|
||||||
|
audio.updateVolume(volume);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if(audio != null) {
|
||||||
|
audio.stopSound();
|
||||||
|
audio = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -117,6 +148,26 @@ public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase im
|
|||||||
@Override public double getEfficiency() { return efficiency; }
|
@Override public double getEfficiency() { return efficiency; }
|
||||||
@Override public boolean doesResizeCompressor() { return true; }
|
@Override public boolean doesResizeCompressor() { return true; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChunkUnload() {
|
||||||
|
super.onChunkUnload();
|
||||||
|
|
||||||
|
if(audio != null) {
|
||||||
|
audio.stopSound();
|
||||||
|
audio = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invalidate() {
|
||||||
|
super.invalidate();
|
||||||
|
|
||||||
|
if(audio != null) {
|
||||||
|
audio.stopSound();
|
||||||
|
audio = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void serialize(ByteBuf buf) {
|
public void serialize(ByteBuf buf) {
|
||||||
super.serialize(buf);
|
super.serialize(buf);
|
||||||
|
|||||||
@ -2225,6 +2225,7 @@ item.gun_panzerschreck.name=Panzerschreck
|
|||||||
item.gun_quadro.name=Vierfachraketenwerfer
|
item.gun_quadro.name=Vierfachraketenwerfer
|
||||||
item.gun_spas12.name=SPAS-12
|
item.gun_spas12.name=SPAS-12
|
||||||
item.gun_star_f.name=Sportpistole
|
item.gun_star_f.name=Sportpistole
|
||||||
|
item.gun_star_f_akimbo.name=Sportpistolen
|
||||||
item.gun_star_f_silenced.name=Schallgedämpfte Pistole
|
item.gun_star_f_silenced.name=Schallgedämpfte Pistole
|
||||||
item.gun_stg77.name=StG 77
|
item.gun_stg77.name=StG 77
|
||||||
item.gun_stinger.name=FIM-92 Stinger
|
item.gun_stinger.name=FIM-92 Stinger
|
||||||
|
|||||||
@ -3068,6 +3068,7 @@ item.gun_panzerschreck.name=Panzerschreck
|
|||||||
item.gun_quadro.name=Quad Rocket Launcher
|
item.gun_quadro.name=Quad Rocket Launcher
|
||||||
item.gun_spas12.name=SPAS-12
|
item.gun_spas12.name=SPAS-12
|
||||||
item.gun_star_f.name=Target Pistol
|
item.gun_star_f.name=Target Pistol
|
||||||
|
item.gun_star_f_akimbo.name=Target Pistols
|
||||||
item.gun_star_f_silenced.name=Silenced Pistol
|
item.gun_star_f_silenced.name=Silenced Pistol
|
||||||
item.gun_stg77.name=StG 77
|
item.gun_stg77.name=StG 77
|
||||||
item.gun_stinger.name=FIM-92 Stinger
|
item.gun_stinger.name=FIM-92 Stinger
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Loading…
x
Reference in New Issue
Block a user