Merge branch 'HbmMods:master' into Optimization

This commit is contained in:
BallOfEnergy 2024-10-15 19:37:35 -05:00 committed by GitHub
commit 1841255b8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 3256 additions and 30 deletions

View File

@ -28,6 +28,11 @@
* Cable connections (connectors, pylons, substations) now render about 10x faster and no longer have weird inaccuracies where the segments meet
* Cables can be made even faster by setting `RENDER_CABLE_HANG` in the config to `false`
* This causes cable connections to render taut, eliminating the need for multiple segments per pylon side
* Heat exchanging heaters are now set to 24,000mB/t by default
* The ICF GUI now lists the laser input as "per tick"
* Glpyhid hives caught in a fallout zone now turn radioactive
* Glyphids spawned by radioactive hives are immune to fire, twice as fast and five times as strong
* Radioactive glpyhids however are NOT immune to radiation, and typically die quickly
## Fixed
* The conveyor grabber should no longer skip over items when used in long lines

View File

@ -22,6 +22,7 @@ public class BlockGlyphid extends Block implements IBlockMulti {
public IIcon[] iconsStandard = new IIcon[2];
public IIcon[] iconsInfested = new IIcon[2];
public IIcon[] iconsRad = new IIcon[2];
public BlockGlyphid(Material mat) {
super(mat);
@ -57,16 +58,19 @@ public class BlockGlyphid extends Block implements IBlockMulti {
iconsStandard[1] = reg.registerIcon(RefStrings.MODID + ":glyphid_base_alt");
iconsInfested[0] = reg.registerIcon(RefStrings.MODID + ":glyphid_base_infested");
iconsInfested[1] = reg.registerIcon(RefStrings.MODID + ":glyphid_base_infested_alt");
iconsRad[0] = reg.registerIcon(RefStrings.MODID + ":glyphid_base_rad");
iconsRad[1] = reg.registerIcon(RefStrings.MODID + ":glyphid_base_rad_alt");
}
protected IIcon[] getIconArray(int meta) {
if(meta == 1) return this.iconsInfested;
if(meta == 2) return this.iconsRad;
return this.iconsStandard;
}
@Override
public int getSubCount() {
return 2;
return 3;
}
@Override

View File

@ -38,7 +38,7 @@ import net.minecraft.world.World;
public class BlockGlyphidSpawner extends BlockContainer implements IBlockMulti {
public IIcon[] icons = new IIcon[2];
public IIcon[] icons = new IIcon[3];
public BlockGlyphidSpawner(Material mat) {
super(mat);
@ -61,11 +61,12 @@ public class BlockGlyphidSpawner extends BlockContainer implements IBlockMulti {
public void registerBlockIcons(IIconRegister reg) {
icons[0] = reg.registerIcon(RefStrings.MODID + ":glyphid_eggs_alt");
icons[1] = reg.registerIcon(RefStrings.MODID + ":glyphid_eggs_infested");
icons[2] = reg.registerIcon(RefStrings.MODID + ":glyphid_eggs_rad");
}
@Override
public int getSubCount() {
return 2;
return 3;
}
@Override
@ -168,6 +169,7 @@ public class BlockGlyphidSpawner extends BlockContainer implements IBlockMulti {
if(soot >= chance[2] && rand.nextInt(100) <= adjustedChance) {
EntityGlyphid entity = glyphid.getKey().apply(worldObj);
if(meta == 1) entity.getDataWatcher().updateObject(EntityGlyphid.DW_SUBTYPE, (byte) EntityGlyphid.TYPE_INFECTED);
if(meta == 2) entity.getDataWatcher().updateObject(EntityGlyphid.DW_SUBTYPE, (byte) EntityGlyphid.TYPE_RADIOACTIVE);
currentSpawns.add(entity);
}
}

View File

@ -72,6 +72,9 @@ public class FalloutConfigJSON {
entries.add(new FalloutEntry() .mB(ModBlocks.waste_leaves) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange));
entries.add(new FalloutEntry() .mB(Blocks.leaves) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange - 5D));
entries.add(new FalloutEntry() .mB(Blocks.leaves2) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange - 5D));
entries.add(new FalloutEntry() .mB(ModBlocks.glyphid_base) .prim(new Triplet(ModBlocks.glyphid_base, 2, 1)));
entries.add(new FalloutEntry() .mB(ModBlocks.glyphid_spawner) .prim(new Triplet(ModBlocks.glyphid_spawner, 2, 1)));
entries.add(new FalloutEntry().mB(Blocks.mossy_cobblestone).prim(new Triplet(Blocks.coal_ore, 0, 1)));
entries.add(new FalloutEntry().mB(ModBlocks.ore_nether_uranium).prim(new Triplet(ModBlocks.ore_nether_schrabidium, 0, 1), new Triplet(ModBlocks.ore_nether_uranium_scorched, 0, 99)));

View File

@ -166,7 +166,6 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_b93), new Object[] { "PCE", "SEB", "PCE", 'P', ModItems.plate_dineutronium, 'C', ModItems.weaponized_starblaster_cell, 'E', ModItems.component_emitter, 'B', ModItems.gun_b92, 'S', ModItems.singularity_spark });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_b92_ammo, 1), new Object[] { "PSP", "ESE", "PSP", 'P', STEEL.plate(), 'S', STAR.ingot(), 'E', ModItems.powder_spark_mix });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weaponized_starblaster_cell, 1), new Object[] { new ItemStack(ModItems.fluid_tank_full, 1, Fluids.PEROXIDE.getID()), GunB92Cell.getFullCell(), CU.wireFine() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi, 1), new Object[] { "SMS", " PB", " P ", 'S', STEEL.ingot(), 'M', ModItems.mechanism_rifle_2, 'P', STEEL.plate(), 'B', DURA.bolt() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_silencer, 1), new Object[] { "P ", " P ", " U", 'P', ANY_PLASTIC.ingot(), 'U', ModItems.gun_uzi });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_saturnite, 1), new Object[] { "SMS", " PB", " P ", 'S', BIGMT.ingot(), 'M', ModItems.mechanism_rifle_2, 'P', BIGMT.plate(), 'B', W.bolt() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_saturnite_silencer, 1), new Object[] { "P ", " P ", " U", 'P', ANY_PLASTIC.ingot(), 'U', ModItems.gun_uzi_saturnite });

View File

@ -86,6 +86,7 @@ public class EntityGlyphid extends EntityMob {
//subtypes
public static final int TYPE_NORMAL = 0;
public static final int TYPE_INFECTED = 1;
public static final int TYPE_RADIOACTIVE = 2;
//data watcher keys
public static final int DW_WALL = 16;
@ -116,9 +117,10 @@ public class EntityGlyphid extends EntityMob {
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
int variant = this.dataWatcher.getWatchableObjectByte(DW_SUBTYPE);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getGrunt().health);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getGrunt().speed);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getGrunt().damage);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getGrunt().speed * (variant == TYPE_RADIOACTIVE ? 2D : 1D));
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getGrunt().damage * (variant == TYPE_RADIOACTIVE ? 5D : 1D));
}
public float getDivisorPerArmorPoint() {

View File

@ -137,6 +137,7 @@ public abstract class GlyphidStats {
// If damage is fire damage, reduce damage above 5 then ignore armor
if(source.isFireDamage()) {
if(glyphid.getDataWatcher().getWatchableObjectByte(glyphid.DW_SUBTYPE) == glyphid.TYPE_RADIOACTIVE) return false;
float dmg = Math.min(amount, 5F);
if(amount > 5) dmg += (amount - 5F) * 0.1F;
return glyphid.attackSuperclass(source, dmg);

View File

@ -32,7 +32,7 @@ public class GUIICF extends GuiInfoContainer {
icf.tanks[1].renderTankInfo(this, x, y, guiLeft + 188, guiTop + 18, 16, 70);
icf.tanks[2].renderTankInfo(this, x, y, guiLeft + 224, guiTop + 18, 16, 70);
this.drawCustomInfoStat(x, y, guiLeft + 8, guiTop + 18, 16, 70, x, y, icf.maxLaser <= 0 ? "OFFLINE" : (BobMathUtil.getShortNumber(icf.laser) + "TU - " + (icf.laser * 1000 / icf.maxLaser) / 10D + "%"));
this.drawCustomInfoStat(x, y, guiLeft + 8, guiTop + 18, 16, 70, x, y, icf.maxLaser <= 0 ? "OFFLINE" : (BobMathUtil.getShortNumber(icf.laser) + "TU/t - " + (icf.laser * 1000 / icf.maxLaser) / 10D + "%"));
this.drawCustomInfoStat(x, y, guiLeft + 187, guiTop + 89, 18, 18, x, y, BobMathUtil.getShortNumber(icf.heat) + " / " + BobMathUtil.getShortNumber(icf.maxHeat) + "TU");
}

View File

@ -1561,7 +1561,6 @@ public class ModItems {
public static Item gun_chemthrower;
public static Item gun_mp40;
public static Item gun_thompson;
public static Item gun_uzi;
public static Item gun_uzi_silencer;
public static Item gun_uzi_saturnite;
public static Item gun_uzi_saturnite_silencer;
@ -1638,6 +1637,7 @@ public class ModItems {
public static Item gun_congolake;
public static Item gun_flamer;
public static Item gun_lag;
public static Item gun_uzi;
public static Item ammo_standard;
@ -4123,7 +4123,6 @@ public class ModItems {
gun_chemthrower = new ItemGunChemthrower().setUnlocalizedName("gun_chemthrower").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_fatman");
gun_mp40 = new ItemGunBase(Gun9mmFactory.getMP40Config()).setUnlocalizedName("gun_mp40").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mp40");
gun_thompson = new ItemGunBase(Gun45ACPFactory.getThompsonConfig()).setUnlocalizedName("gun_thompson").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_thompson");
gun_uzi = new ItemGunBase(Gun22LRFactory.getUziConfig()).setUnlocalizedName("gun_uzi").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi");
gun_uzi_silencer = new ItemGunBase(Gun22LRFactory.getUziConfig().silenced()).setUnlocalizedName("gun_uzi_silencer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_silencer");
gun_uzi_saturnite = new ItemGunBase(Gun22LRFactory.getSaturniteConfig()).setUnlocalizedName("gun_uzi_saturnite").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_saturnite");
gun_uzi_saturnite_silencer = new ItemGunBase(Gun22LRFactory.getSaturniteConfig().silenced()).setUnlocalizedName("gun_uzi_saturnite_silencer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_saturnite_silencer");
@ -6977,7 +6976,6 @@ public class ModItems {
GameRegistry.registerItem(gun_chemthrower, gun_chemthrower.getUnlocalizedName());
GameRegistry.registerItem(gun_mp40, gun_mp40.getUnlocalizedName());
GameRegistry.registerItem(gun_thompson, gun_thompson.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi, gun_uzi.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi_silencer,gun_uzi_silencer.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi_saturnite, gun_uzi_saturnite.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi_saturnite_silencer,gun_uzi_saturnite_silencer.getUnlocalizedName());
@ -7041,6 +7039,7 @@ public class ModItems {
GameRegistry.registerItem(gun_congolake, gun_congolake.getUnlocalizedName());
GameRegistry.registerItem(gun_flamer, gun_flamer.getUnlocalizedName());
GameRegistry.registerItem(gun_lag, gun_lag.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi, gun_uzi.getUnlocalizedName());
GameRegistry.registerItem(ammo_standard, ammo_standard.getUnlocalizedName());

View File

@ -34,6 +34,7 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_congolake, new ItemRenderCongoLake());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer, new ItemRenderFlamer());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_lag, new ItemRenderLAG());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi, new ItemRenderUzi());
//PROJECTILES
ammo_debug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
ammo_debug_buckshot.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
@ -81,6 +82,7 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_congolake) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_flamer) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO_NOCOUNTER);
((ItemGunBaseNT) ModItems.gun_lag) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_uzi) .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);

View File

@ -114,11 +114,11 @@ public class GunStateDecider {
int remaining = rec.getRoundsPerCycle(stack) - 1;
for(int i = 0; i < remaining; i++) if(rec.getCanFire(stack).apply(stack, ctx)) rec.getOnFire(stack).accept(stack, ctx);
//if not, revert to idle
} else if(rec.getDoesDryFire(stack)) {
} else /*if(rec.getDoesDryFire(stack)) {
ItemGunBaseNT.setState(stack, gunIndex, GunState.DRAWING);
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getDelayAfterDryFire(stack));
ItemGunBaseNT.playAnimation(player, stack, AnimType.CYCLE_DRY, gunIndex);
} else {
} else*/ {
ItemGunBaseNT.setState(stack, gunIndex, GunState.IDLE);
ItemGunBaseNT.setTimer(stack, gunIndex, 0);
}

View File

@ -37,7 +37,7 @@ public class Orchestras {
Receiver rec = ctx.config.getReceivers(stack)[0];
IMagazine mag = rec.getMagazine(stack);
SpentCasing casing = mag.getCasing(stack);
for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(player.worldObj, player, 0.25, -0.125, -0.125, -0.05, 0, 0, 0.01, casing.getName());
if(casing != null) for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(player.worldObj, player, 0.25, -0.125, -0.125, -0.05, 0, 0, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE) {
@ -162,7 +162,7 @@ public class Orchestras {
if(type == AnimType.CYCLE) {
if(timer == 14) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.5, -0.125, aiming ? -0.125 : -0.375D, 0, 0.12, -0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.5, -0.125, aiming ? -0.125 : -0.375D, 0, 0.12, -0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
}
if(timer == 12) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 1F);
}
@ -185,7 +185,7 @@ public class Orchestras {
if(type == AnimType.CYCLE) {
if(timer == 2) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.55, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.55, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
@ -233,7 +233,7 @@ public class Orchestras {
if(type == AnimType.CYCLE) {
if(timer == 14) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, 0.18, -0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, 0.18, -0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
}
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
}
@ -256,7 +256,7 @@ public class Orchestras {
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
if(mag.getAmountAfterReload(stack) > 0) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.625, -0.125, aiming ? -0.125 : -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.625, -0.125, aiming ? -0.125 : -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
mag.setAmountBeforeReload(stack, 0);
}
}
@ -292,7 +292,7 @@ public class Orchestras {
Receiver rec = ctx.config.getReceivers(stack)[0];
IMagazine mag = rec.getMagazine(stack);
SpentCasing casing = mag.getCasing(stack);
for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(player.worldObj, player, 0.25, -0.125, -0.125, -0.05, 0, 0, 0.01, casing.getName());
if(casing != null) for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(player.worldObj, player, 0.25, -0.125, -0.125, -0.05, 0, 0, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE) {
@ -318,7 +318,7 @@ public class Orchestras {
if(type == AnimType.CYCLE) {
if(timer == 2) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.06, 0.01, casing.getName(), true, 60, 0.5D, 20);
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.06, 0.01, casing.getName(), true, 60, 0.5D, 20);
}
}
if(type == AnimType.CYCLE_DRY) {
@ -353,7 +353,7 @@ public class Orchestras {
if(type == AnimType.CYCLE) {
if(timer == 0) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, casing.getName());
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
@ -377,7 +377,7 @@ public class Orchestras {
if(type == AnimType.CYCLE) {
if(timer == 0) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, casing.getName());
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
@ -413,7 +413,7 @@ public class Orchestras {
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
int toEject = mag.getAmountAfterReload(stack) - mag.getAmount(stack);
SpentCasing casing = mag.getCasing(stack);
for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(player.worldObj, player, 0.625, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
if(casing != null) for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(player.worldObj, player, 0.625, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
}
if(timer == 15) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
}
@ -437,7 +437,7 @@ public class Orchestras {
int toEject = mag.getAmountAfterReload(stack) - mag.getAmount(stack);
if(timer == 4 && toEject > 0) {
SpentCasing casing = mag.getCasing(stack);
for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(player.worldObj, player, 0.625, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
if(casing != null) for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(player.worldObj, player, 0.625, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
mag.setAmountAfterReload(stack, 0);
}
if(timer == 20) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
@ -455,7 +455,7 @@ public class Orchestras {
if(timer == 15) {
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
SpentCasing casing = mag.getCasing(stack);
CasingCreator.composeEffect(player.worldObj, player, 0.625, aiming ? -0.0625 : -0.25, aiming ? 0 : -0.375D, 0, 0.18, 0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.625, aiming ? -0.0625 : -0.25, aiming ? 0 : -0.375D, 0, 0.18, 0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
}
}
if(type == AnimType.RELOAD || type == AnimType.RELOAD_CYCLE) {
@ -515,4 +515,36 @@ public class Orchestras {
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_UZI = (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);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.EQUIP) {
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.openLatch", 1F, 1.25F);
}
if(type == AnimType.CYCLE) {
if(timer == 1) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 1F);
}
if(type == AnimType.RELOAD) {
if(timer == 4) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 26) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 36) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 1F);
}
if(type == AnimType.JAMMED) {
if(timer == 17) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 1F);
if(timer == 31) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pistolCock", 1F, 1F);
}
};
}

View File

@ -30,7 +30,7 @@ public class XFactory9mm {
public static BulletConfig p9_ap;
public static void init() {
SpentCasing casing9 = new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_BRASS);
SpentCasing casing9 = new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_BRASS).setScale(1F, 1F, 0.75F);
p9_sp = new BulletConfig().setItem(EnumAmmo.P9_SP)
.setCasing(casing9.clone().register("p9"));
p9_fmj = new BulletConfig().setItem(EnumAmmo.P9_FMJ).setDamage(0.8F).setArmorPiercing(0.1F)
@ -61,6 +61,17 @@ public class XFactory9mm {
.setupStandardConfiguration()
.anim(LAMBDA_LAG_ANIMS).orchestra(Orchestras.ORCHESTRA_LAG)
).setUnlocalizedName("gun_lag").setTextureName(RefStrings.MODID + ":gun_darter");
ModItems.gun_uzi = new ItemGunBaseNT(new GunConfig()
.dura(3_000).draw(15).inspect(31).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(7.5F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardConfiguration()
.anim(LAMBDA_UZI_ANIMS).orchestra(Orchestras.ORCHESTRA_UZI)
).setUnlocalizedName("gun_uzi").setTextureName(RefStrings.MODID + ":gun_darter");
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
@ -80,7 +91,7 @@ public class XFactory9mm {
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, -45, 250, IType.SIN_FULL).addPos(0, 0, -45, 750).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("HANDLE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, 0, 250).addPos(-90, 0, 0, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL));
case RELOAD:
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmountBeforeReload(stack) <= 0;
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack) <= 0;
return new BusAnimation()
.addBus("MAG", new BusAnimationSequence().addPos(0, -8, 0, 250, IType.SIN_UP).addPos(0, -8, 0, 750).addPos(0, 0, 0, 500, IType.SIN_DOWN))
.addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 1750).addPos(0, 0, 0, 500, IType.SIN_FULL))
@ -102,4 +113,32 @@ public class XFactory9mm {
public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_LAG_ANIMS = (stack, type) -> {
return null;
};
public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_UZI_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(80, 0, 0, 0).addPos(80, 0, 0, 500).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("STOCKBACK", new BusAnimationSequence().addPos(-200, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("STOCKFRONT", new BusAnimationSequence().addPos(180, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -0.75, 25, IType.SIN_DOWN).addPos(0, 0, 0, 75, IType.SIN_FULL));
case CYCLE_DRY: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 500).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, -2, 150, IType.SIN_FULL).addPos(0, 0, 0, 50, IType.SIN_UP));
case RELOAD:
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack) <= 0;
return new BusAnimation()
.addBus("MAG", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, -10, 0, 250, IType.SIN_UP).addPos(0, -10, 0, 750).addPos(0, 0, 0, 500, IType.SIN_DOWN))
.addBus("LIFT", new BusAnimationSequence().addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 2000).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 2000).addPos(0, 0, -2, 150, IType.SIN_FULL).addPos(0, 0, 0, 50, IType.SIN_UP))
.addBus("BULLET", new BusAnimationSequence().addPos(empty ? 0 : 1, 0, 0, 0).addPos(empty ? 0 : 1, 0, 0, 500).addPos(1, 0, 0, 0));
case JAMMED: return new BusAnimation()
.addBus("LIFT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-25, 0, 0, 250, IType.SIN_FULL).addPos(-25, 0, 0, 1250).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 1000).addPos(0, 0, -2, 150, IType.SIN_FULL).addPos(0, 0, 0, 50, IType.SIN_UP).addPos(0, 0, 0, 500).addPos(0, 0, -2, 150, IType.SIN_FULL).addPos(0, 0, 0, 50, IType.SIN_UP));
case INSPECT: return new BusAnimation()
.addBus("YEET", new BusAnimationSequence().addPos(0, -1, 0, 100).addPos(0, 0, 0, 100, IType.SIN_UP).addPos(0, 12, 0, 350, IType.SIN_DOWN).addPos(0, 0, 0, 350, IType.SIN_UP).addPos(0, -1, 0, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("SPEEN", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(-360, 0, 0, 600));
}
return null;
};
}

View File

@ -567,7 +567,6 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bolt_action_saturnite, new ItemRenderWeaponFFBolt(ResourceManager.rem700sat, ResourceManager.rem700sat_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_b92, new ItemRenderGunAnim());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_b93, new ItemRenderGunAnim());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi, new ItemRenderUZI());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_silencer, new ItemRenderUZI());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_saturnite, new ItemRenderUZI());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_saturnite_silencer, new ItemRenderUZI());

View File

@ -292,7 +292,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 0), new Object[] { "ICI", "CLC", "ICI", 'I', TI.ingot(), 'C', ModBlocks.crate_steel, 'L', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE) });
GameRegistry.addRecipe(new ContainerUpgradeCraftingHandler(new ItemStack(ModBlocks.mass_storage, 1, 1), new Object[] { "PCP", "PMP", "PPP", 'P', DESH.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP), 'M', new ItemStack(ModBlocks.mass_storage, 1, 0) }));
GameRegistry.addRecipe(new ContainerUpgradeCraftingHandler(new ItemStack(ModBlocks.mass_storage, 1, 2), new Object[] { "PCP", "PMP", "PPP", 'P', ANY_RESISTANTALLOY.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', new ItemStack(ModBlocks.mass_storage, 1, 1) }));
GameRegistry.addRecipe(new ContainerUpgradeCraftingHandler(new ItemStack(ModBlocks.mass_storage, 1, 3), new Object[] { "PPP", "PIP", "PPP", 'P', KEY_PLANKS, 'I', IRON.plate() }));
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 3), new Object[] { "PPP", "PIP", "PPP", 'P', KEY_PLANKS, 'I', IRON.plate() });
addRecipeAuto(new ItemStack(ModBlocks.machine_autocrafter, 1), new Object[] { "SCS", "MWM", "SCS", 'S', STEEL.plate(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE), 'M', ModItems.motor, 'W', Blocks.crafting_table });
addRecipeAuto(new ItemStack(ModBlocks.machine_funnel, 1), new Object[] { "S S", "SRS", " S ", 'S', STEEL.ingot(), 'R', REDSTONE.dust() });

View File

@ -860,6 +860,7 @@ public class ResourceManager {
public static final IModelCustom liberator = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/liberator.obj")).asVBO();
public static final IModelCustom flamethrower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flamethrower.obj")).asVBO();
public static final IModelCustom mike_hawk = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/mike_hawk.obj")).asVBO();
public static final IModelCustom uzi = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/uzi.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"));
@ -985,6 +986,7 @@ public class ResourceManager {
public static final ResourceLocation liberator_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/liberator.png");
public static final ResourceLocation flamethrower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flamethrower.png");
public static final ResourceLocation mike_hawk_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lag.png");
public static final ResourceLocation uzi_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -0,0 +1,134 @@
package com.hbm.render.item.weapon.sedna;
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.item.ItemStack;
public class ItemRenderUzi 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.75F * offset, -1.5F * offset, 2.5F * offset,
0, -4.375 / 8D, 1);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
double scale = 0.25D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] stockFront = HbmAnimations.getRelevantTransformation("STOCKFRONT");
double[] stockBack = HbmAnimations.getRelevantTransformation("STOCKBACK");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] lift = HbmAnimations.getRelevantTransformation("LIFT");
double[] mag = HbmAnimations.getRelevantTransformation("MAG");
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET");
double[] slide = HbmAnimations.getRelevantTransformation("SLIDE");
double[] yeet = HbmAnimations.getRelevantTransformation("YEET");
double[] speen = HbmAnimations.getRelevantTransformation("SPEEN");
GL11.glTranslated(yeet[0], yeet[1], yeet[2]);
GL11.glRotated(speen[0], 0, 0, 1);
GL11.glTranslated(0, -2, -4);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 2, 4);
GL11.glTranslated(0, 0, -6);
GL11.glRotated(lift[0], 1, 0, 0);
GL11.glTranslated(0, 0, 6);
GL11.glTranslated(0, 0, recoil[2]);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.uzi.renderPart("Gun");
GL11.glPushMatrix();
GL11.glTranslated(0, 0.3125D, -5.75);
GL11.glRotated(180 - stockFront[0], 1, 0, 0);
GL11.glTranslated(0, -0.3125D, 5.75);
ResourceManager.uzi.renderPart("StockFront");
GL11.glTranslated(0, -0.3125D, -3);
GL11.glRotated(-200 - stockBack[0], 1, 0, 0);
GL11.glTranslated(0, 0.3125D, 3);
ResourceManager.uzi.renderPart("StockBack");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, slide[2]);
ResourceManager.uzi.renderPart("Slide");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(mag[0], mag[1], mag[2]);
ResourceManager.uzi.renderPart("Magazine");
if(bullet[0] == 1) ResourceManager.uzi.renderPart("Bullet");
GL11.glPopMatrix();
double smokeScale = 0.5;
GL11.glPushMatrix();
GL11.glTranslated(0, 0.75, 8.5);
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, 0.75, 8.5);
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, 1, 1);
}
@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(0, 1, 0);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Gun");
ResourceManager.uzi.renderPart("StockBack");
ResourceManager.uzi.renderPart("StockFront");
ResourceManager.uzi.renderPart("Slide");
ResourceManager.uzi.renderPart("Magazine");
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -113,7 +113,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
return fov;
}
protected float getSwayMagnitude(ItemStack stack) { return 0.5F; }
protected float getSwayMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 0.1F : 0.5F; }
protected float getSwayPeriod(ItemStack stack) { return 0.75F; }
protected float getTurnMagnitude(ItemStack stack) { return 2.75F; }

View File

@ -30,7 +30,7 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHeatSource, IFluidStandardTransceiver, IGUIProvider, IControlReceiver, IFluidCopiable {
public FluidTank[] tanks;
public int amountToCool = 1;
public int amountToCool = 24_000;
public int tickDelay = 1;
public int heatEnergy;

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB