Compare commits

...

57 Commits

Author SHA1 Message Date
Boblet
6bb6b5426c the ground trembles with my every step 2026-01-23 14:53:39 +01:00
Boblet
492703ab23 amogus 2026-01-23 14:50:29 +01:00
Bob
b4d0122cfc monty python's horrible world of gravity 2026-01-22 21:48:48 +01:00
Boblet
f809843745 calliou is impaled on an asbestos stalagmite and dies 2026-01-22 15:38:17 +01:00
Boblet
6401ffde19 now kiss 2026-01-21 16:27:35 +01:00
Boblet
1aba934d36 e 2026-01-21 13:12:32 +01:00
Boblet
69c1ed01fa the glunch lunch 2026-01-21 13:11:28 +01:00
Boblet
e776b4c8d9 the gloach 2026-01-20 16:56:00 +01:00
HbmMods
6fa00c5771
Merge pull request #2643 from Bufka2011/master
Enhance CI workflow with version update logic
2026-01-20 11:06:19 +01:00
HbmMods
69c1f49f55
Merge pull request #2661 from Voxelstice/oc-comp-fix
OC connection with multiblocks bug fix
2026-01-20 10:33:15 +01:00
HbmMods
ade48e4ac7
Merge pull request #2656 from RayzerHan/master
Update ru_RU lang again
2026-01-20 10:32:18 +01:00
Bob
6c1fd10a50 plushby 2026-01-19 21:23:57 +01:00
Raaaaaaaaaay
a2fd0ea108
ok 2026-01-19 13:50:22 +02:00
Raaaaaaaaaay
33a4b983e5
Компонзит 2026-01-19 13:42:34 +02:00
Raaaaaaaaaay
0d431e387b
ммм 2026-01-19 13:37:10 +02:00
Raaaaaaaaaay
f0a1eaaaff
фикс 2026-01-19 13:36:01 +02:00
Raaaaaaaaaay
165fd062f4
ням 2026-01-18 20:07:30 +02:00
Voxelstice
7b18634b34 here's hoping this doesnt break anything else
OC connection with multiblocks bug fix
2026-01-17 10:42:19 +03:00
Raaaaaaaaaay
99ca4628dc
Kyiv 2026-01-15 21:29:53 +02:00
Raaaaaaaaaay
b892f0cc37
Merge branch 'HbmMods:master' into master 2026-01-15 17:58:02 +02:00
Boblet
7664cacd2f double barrel shaboing hot dog
(frot dog)
2026-01-14 15:54:59 +01:00
Raaaaaaaaaay
e96e821146
next door two 2026-01-14 09:18:38 +02:00
Raaaaaaaaaay
e02e4f6aae
next door 2026-01-14 09:15:59 +02:00
Raaaaaaaaaay
c1464f2881
Update 2026-01-14 02:01:10 +02:00
Raaaaaaaaaay
91dd4cc218
Sometimes I think the wind blows well, but the robot is a slut 2026-01-13 18:56:03 +02:00
Raaaaaaaaaay
6cadca0d89
People are idiots, and that's a fact. 2026-01-13 18:53:52 +02:00
HbmMods
5c9d71c626
Merge pull request #2649 from RayzerHan/master
Update RU_ru lang
2026-01-13 15:14:17 +01:00
Raaaaaaaaaay
bd03028170
фак 2026-01-13 16:06:08 +02:00
HbmMods
67aee6a2e0
Merge pull request #2648 from Vaern/muzzle-flashes
Visible third-person muzzle flashes from other players +self, skeleguns
2026-01-13 15:04:52 +01:00
Vaern
223fe240c1 remove redundant TODO 2026-01-12 23:55:29 -08:00
Vaern
5cb013d545 extended timeout duration
the highest duration for muzzle flashes is 150?, not under 100, so let's be safe
2026-01-12 23:39:50 -08:00
Vaern
82293e46cd copypaste hell
fixed tick issues in eventHandler, added packets to orchestra + third person rendering for every gun with built-in muzzle/laser flashes, and softened playAnimation so skeleguns use orchestra/muzzle flashes. akimbos show both firing, probably won't be changed
2026-01-12 23:33:05 -08:00
Raaaaaaaaaay
2e7af7058c
Merge branch 'HbmMods:master' into master 2026-01-12 19:58:03 +02:00
Raaaaaaaaaay
cc816b40e0
Очень познавательно, милая пони 2026-01-12 19:55:17 +02:00
Boblet
64fc72e18a margret thatcher is dead 2026-01-12 16:45:09 +01:00
Boblet
76c6222f45 post merge cleanup 2026-01-12 10:30:50 +01:00
HbmMods
2f8b0dde49
Merge pull request #2607 from WolfEclipses/METADATA
Rad Absorbers Metadata (Done now)
2026-01-12 10:19:08 +01:00
Vaern
712ae952df we ain't even done wit this we #KillingOurselves
superficial dedicated + integrated server testing worked. ran into a weird race condition on the former, though, but i doubt that's from anythng here
2026-01-11 18:17:36 -08:00
Wolf
90e148e022 I think I finally fixed this shit 2026-01-11 16:18:37 -05:00
WolfEclipses
52440fca2f
Merge branch 'HbmMods:master' into METADATA 2026-01-11 15:58:45 -05:00
Wolf
292b989e09 Testing??? 2026-01-11 15:56:24 -05:00
Raaaaaaaaaay
b0e0b54def
бля 2026-01-11 22:28:00 +02:00
Bufka2011
c146829bf4
Merge branch 'HbmMods:master' into master 2026-01-11 12:24:43 -07:00
Bufka2011
b60cf07e98
Enhance CI workflow with version update logic
Added steps to calculate days since 10/10/10 and update version files accordingly.
2026-01-11 12:24:11 -07:00
WolfEclipses
1f17af27f7
Merge branch 'master' into METADATA 2026-01-11 13:32:05 -05:00
WolfEclipses
5ec68643f8
Merge branch 'master' into METADATA 2026-01-09 20:52:29 -05:00
WolfEclipses
52ae974f51
Merge branch 'master' into METADATA 2026-01-02 20:13:04 -05:00
Wolf
f089578ba7 Got rid of functionality for legacy rad absorber 2026-01-01 19:55:49 -05:00
Wolf
1e4346a54b Fixed redundant functions (there were more than I thought) xd 2026-01-01 19:40:37 -05:00
WolfEclipses
a1b83b4a67
Merge branch 'master' into METADATA 2026-01-01 18:38:27 -05:00
Wolf
838bcb8faa Had them swapped up somehow xd 2025-12-27 18:18:48 -05:00
Wolf
a8b046f46b Bringing up to date because yeah 2025-12-27 17:19:45 -05:00
WolfEclipses
6b87447ca1
Merge branch 'master' into METADATA 2025-12-27 14:01:57 -05:00
WolfEclipses
bce98561d3 Added back old ones, changed lang to OLD for them 2025-12-09 08:31:52 -05:00
WolfEclipses
003afa4071 Forgot to remove this from making the name work xd 2025-12-09 07:46:27 -05:00
WolfEclipses
7f963bdb6f I FORGOT TO ACCOUNT FOR OTHER LANGUAGES T_T 2025-12-08 22:44:49 -05:00
WolfEclipses
96298a5c31 I think this works :P we will find out that Im an
idiot in like 30seconds
2025-12-08 22:20:07 -05:00
149 changed files with 9746 additions and 11863 deletions

View File

@ -7,6 +7,7 @@
# Yes this is a mostly untouched Github actions template
name: Java CI with Gradle
on:
@ -16,19 +17,36 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin' # Temurin because it's default :P
# Calculate days since 10/10/10
- name: Calculate days since 10/10/10
id: calculate_days
run: |
start_date="2010-10-10"
current_date=$(date +%Y-%m-%d)
days_since=$(( ($(date -d "$current_date" +%s) - $(date -d "$start_date" +%s)) / 86400 ))
echo "days=$days_since" >> $GITHUB_OUTPUT
# Update version files with proper sed syntax
- name: Update version files
run: |
days=${{ steps.calculate_days.outputs.days }}
# Use proper sed syntax for Linux runners
sed -i "s/public static final String VERSION = \".*\";/public static final String VERSION = \"1.0.27 BETA ($days)\";/" src/main/java/com/hbm/lib/RefStrings.java
sed -i "s/mod_build_number=.*/mod_build_number=$days/" gradle.properties
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
@ -42,5 +60,3 @@ jobs:
with:
# A file, directory or wildcard pattern that describes what to upload
path: ./build/libs

View File

@ -1,33 +1,27 @@
## Changed
* Material autogen now creates redstone in ingot form, allowing smaller than block quantities to be cast
* Removed the ancient ZPE blocks
* Drone hitboxes are now way smaller, which should cause them to get stuck when flying less
* The new FENSU now keeps its charge and installed muffler when broken
* Battery sockets are now compatible with comparator output
* Battery sockets now have a tooltip when a battery pack is installed
* Sef-charging batteries have been reworked
* They are now a new item with metadata (legacy ones still work)
* The base form is an empty selfcharger which is filled with two billets of material, i.e. no more upgrade recipes
* There are a few new variants like cobalt-60 and gold-198
* New selfchargers have a model when plugged into a battery socket
* Selfchargers are a fair bit weaker than their old counterparts, but substantially cheaper too
* Old batteries now have the "LEGACY" tag
* Pneumatic pipe networks with multiple outputs, especially filtered ones, should now have much better throughput due to not constantly failing to send items in round robin mode
* The [N] calculator window now shows a history of previous operations
* Simplified the cyclotron recipe
* Updated russian localization
* Rad absorbers now use metadata, existing blocks will be converted automatically
* Fissure bombs that go off in crater biomes now create fissures with metadata 1 which creates radioactive volcanic lava
* If a crater biome is created on top of an existing fissure, it will keep producing normal volcanic lava
* Simplified the battery socket's client packets, reducing CPU load
* Muzzle flashes on guns now work in third person mode, including on other players and on NPCs, making it more apparent when you're being fired at
* This includes non-standard special effects like the .44 gap flash and the .35-800 ejector plume
* Removed the old unused satelite deco blocks, freeing up 6 block IDs
* Crucibles that smelt metal with no template set will no place the metal in the recipe stack instead of the waste stack, this should make it easier to get a recipe to work in the many, many cases where people add the template after smelting the material
* Battery sockets and the FENSU now support the copy tool
* Removed unused displaylist support from the model loader
* DLs have been long phased out in favor of VBOs anyway
* Rebranded canned horse slime
* Now with extra bone marrow
* Updated the deuterium tower's model
* Increased the energy requirement for welding osmiridium
## Fixed
* Fixed the FEnSU, cyclotron and reliant robin missile being uncraftable due to stacksize limitations
* The system for detecting impossible recipe has been improved, instead of a fixed 64 item limit, it now uses the actual limit of the item (or 64 for ore dictionary inputs)
* Fixed yet another issue regarding addon fluids breaking on recipe reload
* Fixed YET ANOTHER issue regarding crates, AGAIN
* Fixed a rare issue where the fusion reactor could have negative fuel
* Fixed battery socket priority tooltip offset
* Fixed enchantability on many armor sets being incorrect
* Most power armors are intended to not be enchantable at all
* Fixed crash caused by the balefire bomb
* Fixed JSON gun reload animations becoming faster and faster with the trenchmaster set
* Fixed heat transfer rate labels on the boilers and coker unit being off by a magnitude of 10
* Fixed crucible not having a heat transfer rate tooltip
* Fixed certain heliostat mirror rotations not showing the mirror
* Fixed chopper recipe creating eight choppers instead of one
# Fixed
* Potentially fixed yet another issue regarding crates
* Fixed battery socket `fillpercent` RoR function always assuming a max power of 1
* Fixed issue where multiblock ports would generate many OpenComputers component entries
* Fixed RBMK automatic control rods having incorrect settings when using the copy tool
* Fixed battery sockets producing junk debug data in the logs
* Fixed an issue where the charging station would crash when trying to charge certain items
* Fixed the DFC's core component not dropping its contents when mined
* Fixed audio problems with guns

View File

@ -80,4 +80,5 @@ public class BlockEnums {
FLUORESCENT,
HALOGEN
}
}

View File

@ -30,6 +30,8 @@ import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.DoorDecl;
import com.hbm.tileentity.machine.storage.TileEntityFileCabinet;
import com.hbm.util.Compat;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling;
@ -615,15 +617,7 @@ public class ModBlocks {
public static Block tesla;
public static Block sat_mapper;
public static Block sat_scanner;
public static Block sat_radar;
public static Block sat_laser;
public static Block sat_foeq;
public static Block sat_resonator;
public static Block sat_dock;
public static Block soyuz_capsule;
public static Block crate_supply;
@ -1172,10 +1166,11 @@ public class ModBlocks {
public static Block gas_explosive;
public static Block vacuum;
public static Block absorber;
public static Block absorber_red;
public static Block absorber_green;
public static Block absorber_pink;
@Deprecated public static Block absorber;
@Deprecated public static Block absorber_red;
@Deprecated public static Block absorber_green;
@Deprecated public static Block absorber_pink;
public static Block rad_absorber;
public static Block decon;
public static Block mud_block;
@ -2121,13 +2116,6 @@ public class ModBlocks {
launch_table = new LaunchTable(Material.iron).setBlockName("launch_table").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":launch_table");
soyuz_launcher = new SoyuzLauncher(Material.iron).setBlockName("soyuz_launcher").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":soyuz_launcher");
sat_mapper = new DecoBlock(Material.iron).setBlockName("sat_mapper").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":sat_mapper");
sat_radar = new DecoBlock(Material.iron).setBlockName("sat_radar").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":sat_radar");
sat_scanner = new DecoBlock(Material.iron).setBlockName("sat_scanner").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":sat_scanner");
sat_laser = new DecoBlock(Material.iron).setBlockName("sat_laser").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":sat_laser");
sat_foeq = new DecoBlock(Material.iron).setBlockName("sat_foeq").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":sat_foeq");
sat_resonator = new DecoBlock(Material.iron).setBlockName("sat_resonator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":sat_resonator");
sat_dock = new MachineSatDock(Material.iron).setBlockName("sat_dock").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":sat_dock");
soyuz_capsule = new SoyuzCapsule(Material.iron).setBlockName("soyuz_capsule").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":soyuz_capsule");
crate_supply = new BlockSupplyCrate(Material.wood).setBlockName("crate_supply").setStepSound(Block.soundTypeWood).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":crate_can");
@ -2333,13 +2321,15 @@ public class ModBlocks {
gas_explosive = new BlockGasExplosive().setBlockName("gas_explosive").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":gas_explosive");
vacuum = new BlockVacuum().setBlockName("vacuum").setResistance(1000000F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vacuum");
absorber = new BlockAbsorber(Material.iron, 2.5F).setBlockName("absorber").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":absorber");
absorber_red = new BlockAbsorber(Material.iron, 10F).setBlockName("absorber_red").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":absorber_red");
absorber_green = new BlockAbsorber(Material.iron, 100F).setBlockName("absorber_green").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":absorber_green");
absorber_pink = new BlockAbsorber(Material.iron, 10000F).setBlockName("absorber_pink").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":absorber_pink");
absorber = new BlockGeneric(Material.iron).setBlockName("absorber").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_deprecated");
absorber_red = new BlockGeneric(Material.iron).setBlockName("absorber_red").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_deprecated");
absorber_green = new BlockGeneric(Material.iron).setBlockName("absorber_green").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_deprecated");
absorber_pink = new BlockGeneric(Material.iron).setBlockName("absorber_pink").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_deprecated");
rad_absorber = new BlockAbsorber(Material.iron).setBlockName("rad_absorber").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
decon = new BlockDecon(Material.iron).setBlockName("decon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":decon_side");
if (Loader.isModLoaded("OpenComputers")) {
if(Loader.isModLoaded("OpenComputers")) {
oc_cable_paintable = new BlockOpenComputersCablePaintable().setBlockName("oc_cable_paintable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
}
@ -3369,6 +3359,7 @@ public class ModBlocks {
GameRegistry.registerBlock(absorber_red, absorber_red.getUnlocalizedName());
GameRegistry.registerBlock(absorber_green, absorber_green.getUnlocalizedName());
GameRegistry.registerBlock(absorber_pink, absorber_pink.getUnlocalizedName());
GameRegistry.registerBlock(rad_absorber, ItemBlockBase.class, rad_absorber.getUnlocalizedName());
GameRegistry.registerBlock(decon, decon.getUnlocalizedName());
//Solar Tower Blocks
@ -3466,14 +3457,6 @@ public class ModBlocks {
//Guide
GameRegistry.registerBlock(book_guide, book_guide.getUnlocalizedName());
//Sat Blocks
GameRegistry.registerBlock(sat_mapper, sat_mapper.getUnlocalizedName());
GameRegistry.registerBlock(sat_scanner, sat_scanner.getUnlocalizedName());
GameRegistry.registerBlock(sat_radar, sat_radar.getUnlocalizedName());
GameRegistry.registerBlock(sat_laser, sat_laser.getUnlocalizedName());
GameRegistry.registerBlock(sat_foeq, sat_foeq.getUnlocalizedName());
GameRegistry.registerBlock(sat_resonator, sat_resonator.getUnlocalizedName());
//Rails
GameRegistry.registerBlock(rail_wood, ItemBlockBase.class, rail_wood.getUnlocalizedName());
GameRegistry.registerBlock(rail_narrow, ItemBlockBase.class, rail_narrow.getUnlocalizedName());
@ -3543,7 +3526,7 @@ public class ModBlocks {
GameRegistry.registerBlock(vacuum, vacuum.getUnlocalizedName());
// OC Compat Items
if (Loader.isModLoaded("OpenComputers")) {
if(Loader.isModLoaded(Compat.MOD_OC)) {
register(oc_cable_paintable);
}
@ -3608,15 +3591,15 @@ public class ModBlocks {
}
// Is this block a special structure handling block, so we can ignore it for blacklist selection, etc.
public static boolean isStructureBlock(Block block, boolean includeAir) {
if(block == null) return false;
if(block == wand_air) return includeAir;
public static boolean isStructureBlock(Block block, boolean includeAir) {
if(block == null) return false;
if(block == wand_air) return includeAir;
if(block == wand_structure) return true;
if(block == wand_jigsaw) return true;
if(block == wand_logic) return true;
if(block == wand_tandem) return true;
if(block == wand_loot) return true;
return false;
}
if(block == wand_jigsaw) return true;
if(block == wand_logic) return true;
if(block == wand_tandem) return true;
if(block == wand_loot) return true;
return false;
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.blocks.bomb;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.item.EntityTNTPrimedBase;
import com.hbm.explosion.ExplosionNukeSmall;
import com.hbm.world.biome.BiomeGenCraterBase;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
@ -16,6 +17,8 @@ public class BlockFissureBomb extends BlockTNTBase {
int range = 5;
boolean crater = world.getBiomeGenForCoords((int) Math.floor(x), (int) Math.floor(z)) instanceof BiomeGenCraterBase;
for(int i = -range; i <= range; i++) {
for(int j = -range; j <= range; j++) {
for(int k = -range; k <= range; k++) {
@ -27,7 +30,7 @@ public class BlockFissureBomb extends BlockTNTBase {
Block block = world.getBlock(a, b, c);
if(block == ModBlocks.ore_bedrock) {
world.setBlock(a, b, c, ModBlocks.ore_volcano);
world.setBlock(a, b, c, ModBlocks.ore_volcano, crater ? 1 : 0, 3);
} else if(block == ModBlocks.ore_bedrock_oil) {
world.setBlock(a, b, c, Blocks.bedrock);
}

View File

@ -2,38 +2,79 @@ package com.hbm.blocks.generic;
import java.util.Random;
import com.hbm.blocks.BlockEnumMulti;
import com.hbm.blocks.IBlockMulti;
import com.hbm.handler.radiation.ChunkRadiationManager;
import com.hbm.lib.RefStrings;
import net.minecraft.block.Block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class BlockAbsorber extends Block {
public class BlockAbsorber extends BlockEnumMulti implements IBlockMulti {
float absorb = 0;
// Enum for tiers they are in order of meta data, 0, 1, 2, 3 for Base, Red, Green, Pink
public static enum EnumAbsorberTier {
public BlockAbsorber(Material mat, float ab) {
super(mat);
BASE(2.5F, "absorber"), RED(10F, "absorber_red"), GREEN(100F, "absorber_green"), PINK(10000F, "absorber_pink");
public final float absorbAmount;
public final String textureName;
private EnumAbsorberTier(float absorb, String texture) {
this.absorbAmount = absorb;
this.textureName = texture;
}
}
public BlockAbsorber(Material mat) {
super(mat, EnumAbsorberTier.class, true, true);
this.setTickRandomly(true);
absorb = ab;
this.setBlockName("rad_absorber");
}
public EnumAbsorberTier getTier(int meta) {
return EnumAbsorberTier.values()[rectify(meta)];
}
@Override
public int tickRate(World world) {
public String getUnlocalizedName(ItemStack stack) {
EnumAbsorberTier tier = getTier(stack.getItemDamage());
String tierName = net.minecraft.util.StatCollector.translateToLocal("tile.rad_absorber." + tier.name().toLowerCase());
return tierName;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(net.minecraft.client.renderer.texture.IIconRegister reg) {
icons = new IIcon[EnumAbsorberTier.values().length];
for(int i = 0; i < icons.length; i++) {
icons[i] = reg.registerIcon(RefStrings.MODID + ":" + EnumAbsorberTier.values()[i].textureName);
}
}
// All that rad math shit that was on there already, did not touch this
// -Wolf
@Override
public int tickRate(World world) {
return 10;
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
ChunkRadiationManager.proxy.decrementRad(world, x, y, z, absorb);
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
EnumAbsorberTier tier = getTier(world.getBlockMetadata(x, y, z));
ChunkRadiationManager.proxy.decrementRad(world, x, y, z, tier.absorbAmount);
world.scheduleBlockUpdate(x, y, z, this, tickRate(world));
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z);
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
world.scheduleBlockUpdate(x, y, z, this, tickRate(world));
}
}

View File

@ -55,7 +55,8 @@ public class BlockFissure extends BlockContainer implements IBlockMultiPass {
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if(world.getBlock(x, y + 1, z).isReplaceable(world, x, y + 1, z)) world.setBlock(x, y + 1, z, ModBlocks.volcanic_lava_block);
boolean crater = world.getBlockMetadata(x, y, z) != 0;
if(world.getBlock(x, y + 1, z).isReplaceable(world, x, y + 1, z)) world.setBlock(x, y + 1, z, crater ? ModBlocks.rad_lava_block : ModBlocks.volcanic_lava_block);
}
@Override

View File

@ -159,7 +159,8 @@ public class BlockPlushie extends BlockContainer implements IBlockMulti, IToolti
NONE( "NONE", null),
YOMI( "Yomi", "Hi! Can I be your rabbit friend?"),
NUMBERNINE( "Number Nine", "None of y'all deserve coal."),
HUNDUN( "Hundun", "混沌");
HUNDUN( "Hundun", "混沌"),
DERG( "Dragon", "Squeeze him.");
public String label;
public String inscription;

View File

@ -1,12 +1,18 @@
package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityCore;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@ -50,5 +56,43 @@ public class CoreCore extends BlockContainer {
return false;
}
}
private Random rand = new Random();
// shitty copy pasted crap for the 50th time because i hate this block
@Override
public void breakBlock(World world, int x, int y, int z, Block b, int m) {
TileEntityCore core = (TileEntityCore) world.getTileEntity(x, y, z);
if(core != null) {
for(int i1 = 0; i1 < core.getSizeInventory(); ++i1) {
ItemStack itemstack = core.getStackInSlot(i1);
if(itemstack != null) {
float f = this.rand.nextFloat() * 0.8F + 0.1F;
float f1 = this.rand.nextFloat() * 0.8F + 0.1F;
float f2 = this.rand.nextFloat() * 0.8F + 0.1F;
while(itemstack.stackSize > 0) {
int j1 = this.rand.nextInt(21) + 10;
if(j1 > itemstack.stackSize) j1 = itemstack.stackSize;
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if(itemstack.hasTagCompound()) entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
float f3 = 0.05F;
entityitem.motionX = (float) this.rand.nextGaussian() * f3;
entityitem.motionY = (float) this.rand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) this.rand.nextGaussian() * f3;
world.spawnEntityInWorld(entityitem);
}
}
}
world.func_147453_f(x, y, z, b);
}
super.breakBlock(world, x, y, z, b, m);
}
}

View File

@ -82,9 +82,9 @@ public class MachineBatterySocket extends BlockDummyable implements ITooltipProv
if(socket.syncStack == null) return;
List<String> text = new ArrayList();
text.add(BobMathUtil.getShortNumber(socket.powerFromStack(socket.syncStack)) + " / " + BobMathUtil.getShortNumber(socket.maxPowerFromStack(socket.syncStack)) + "HE");
text.add(BobMathUtil.getShortNumber(socket.syncPower) + " / " + BobMathUtil.getShortNumber(socket.syncMaxPower) + "HE");
double percent = (double) socket.powerFromStack(socket.syncStack) / (double) socket.maxPowerFromStack(socket.syncStack);
double percent = (double) socket.syncPower / socket.syncMaxPower;
int charge = (int) Math.floor(percent * 10_000D);
int color = ((int) (0xFF - 0xFF * percent)) << 16 | ((int)(0xFF * percent) << 8);

View File

@ -149,7 +149,7 @@ public class BobmazonOfferFactory {
special.add(new Offer(ItemKitNBT.create(
new ItemStack(ModItems.rod_of_discord).setStackDisplayName("Cock Joke"),
ModItems.canned_conserve.stackFromEnum(64, EnumFoodType.JIZZ).setStackDisplayName("Class A Horse Semen"),
ModItems.canned_conserve.stackFromEnum(64, EnumFoodType.SLIME).setStackDisplayName("Class A Horse Semen"),
new ItemStack(ModItems.pipe_lead).setStackDisplayName("Get Nutted, Dumbass"),
new ItemStack(ModItems.gem_alexandrite)
).setStackDisplayName("The Nut Bucket"), Requirement.HIDDEN, 64));

View File

@ -6,13 +6,12 @@ import com.hbm.inventory.container.ContainerCrateDesh;
import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
public class GUICrateDesh extends GuiContainer {
public class GUICrateDesh extends GuiCrateBase {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_crate_desh.png");
private IInventory crate;

View File

@ -7,12 +7,11 @@ import com.hbm.inventory.container.ContainerCrateIron;
import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUICrateIron extends GuiContainer {
public class GUICrateIron extends GuiCrateBase {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_crate_iron.png");
private IInventory diFurnace;

View File

@ -6,13 +6,12 @@ import com.hbm.inventory.container.ContainerCrateSteel;
import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
public class GUICrateSteel extends GuiContainer {
public class GUICrateSteel extends GuiCrateBase {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_crate_steel.png");
private IInventory crate;

View File

@ -7,12 +7,11 @@ import com.hbm.inventory.container.ContainerCrateTemplate;
import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUICrateTemplate extends GuiContainer {
public class GUICrateTemplate extends GuiCrateBase {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_crate_template.png");
private IInventory diFurnace;

View File

@ -8,12 +8,11 @@ import com.hbm.inventory.container.ContainerCrateTungsten;
import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUICrateTungsten extends GuiContainer {
public class GUICrateTungsten extends GuiCrateBase {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_crate_tungsten.png");
private static ResourceLocation texture_hot = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_crate_tungsten_hot.png");

View File

@ -0,0 +1,19 @@
package com.hbm.inventory.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Container;
public abstract class GuiCrateBase extends GuiContainer {
public GuiCrateBase(Container container) {
super(container);
}
@Override
protected void mouseClicked(int x, int y, int button) {
boolean touchScreen = this.mc.gameSettings.touchscreen;
this.mc.gameSettings.touchscreen = false;
super.mouseClicked(x, y, button);
this.mc.gameSettings.touchscreen = touchScreen;
}
}

View File

@ -80,7 +80,7 @@ public class ArcWelderRecipes extends SerializableRecipe {
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_CMB.id), 1_200, 10_000_000L, new FluidStack(Fluids.REFORMGAS, 1_000),
new OreDictStack(CMB.plateCast(), 2)));
//pre-DFC
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_OSMIRIDIUM.id), 6_000, 20_000_000L, new FluidStack(Fluids.REFORMGAS, 16_000),
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_OSMIRIDIUM.id), 6_000, 50_000_000L, new FluidStack(Fluids.REFORMGAS, 16_000),
new OreDictStack(OSMIRIDIUM.plateCast(), 2)));
//Missile Parts

View File

@ -67,7 +67,7 @@ public class PedestalRecipes extends SerializableRecipe {
new OreDictStack(STAR.ingot()), new OreDictStack(DURA.plateCast()), new OreDictStack(STAR.ingot())));
register(new PedestalRecipe(new ItemStack(ModItems.gun_flamer_daybreaker),
new OreDictStack(GOLD.plateCast()), new ComparableStack(ModItems.canned_conserve, 1, EnumFoodType.JIZZ), new OreDictStack(GOLD.plateCast()),
new OreDictStack(GOLD.plateCast()), new ComparableStack(ModItems.canned_conserve, 1, EnumFoodType.SLIME), new OreDictStack(GOLD.plateCast()),
new OreDictStack(P_WHITE.ingot()), new ComparableStack(ModItems.gun_flamer), new OreDictStack(P_WHITE.ingot()),
new OreDictStack(GOLD.plateCast()), new ComparableStack(ModItems.stick_dynamite), new OreDictStack(GOLD.plateCast()))
.extra(PedestalExtraCondition.SUN));

View File

@ -936,33 +936,6 @@ public class ModItems {
public static Item cap_fritz;
public static Item ring_pull;
public static Item bdcl;
//public static Item canned_beef;
//public static Item canned_tuna;
//public static Item canned_mystery;
//public static Item canned_pashtet;
//public static Item canned_cheese;
//public static Item canned_jizz;
//public static Item canned_milk;
//public static Item canned_ass;
//public static Item canned_pizza;
//public static Item canned_tube;
//public static Item canned_tomato;
//public static Item canned_asbestos;
//public static Item canned_bhole;
//public static Item canned_hotdogs;
//public static Item canned_leftovers;
//public static Item canned_yogurt;
//public static Item canned_stew;
//public static Item canned_chinese;
//public static Item canned_oil;
//public static Item canned_fist;
//public static Item canned_spam;
//public static Item canned_fried;
//public static Item canned_napalm;
//public static Item canned_diesel;
//public static Item canned_kerosene;
//public static Item canned_recursion;
//public static Item canned_bark;
public static ItemEnumMulti canned_conserve;
public static Item can_key;

View File

@ -113,7 +113,7 @@ public class ItemConserve extends ItemEnumMulti {
MYSTERY(6, 0.5F),
PASHTET(4, 0.5F),
CHEESE(3, 1F),
JIZZ(15, 5F), // :3
SLIME(15, 5F),
MILK(5, 0.25F),
ASS(6, 0.75F), // :3
PIZZA(8, 075F),

View File

@ -274,9 +274,10 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
public static void playAnimation(EntityPlayer player, ItemStack stack, GunAnimation type, int index) {
if(player instanceof EntityPlayerMP) {
PacketDispatcher.wrapper.sendTo(new HbmAnimationPacket(type.ordinal(), 0, index), (EntityPlayerMP) player);
setLastAnim(stack, index, type);
setAnimTimer(stack, index, 0);
}
setLastAnim(stack, index, type);
setAnimTimer(stack, index, 0);
}
@Override
@ -458,9 +459,9 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
for(int i = 0; i < confNo; i++) {
IHUDComponent[] components = gun.getConfig(stack, i).getHUDComponents(stack);
int bottomOffset = 0;
if(components != null) for(IHUDComponent component : components) {
int bottomOffset = 0;
component.renderHUDComponent(event, type, player, stack, bottomOffset, i);
bottomOffset += component.getComponentHeight(player, stack);
}

View File

@ -1,5 +1,7 @@
package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer;
import com.hbm.interfaces.IOrderedEnum;
import com.hbm.items.ItemEnumMulti;
import com.hbm.items.ModItems;
@ -8,6 +10,8 @@ import com.hbm.items.weapon.sedna.Crosshair;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.lib.RefStrings;
@ -16,10 +20,12 @@ import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class GunFactory {
public static BulletConfig ammo_debug;
public static BulletConfig ammo_debug_shot;
public static SpentCasing CASING44 = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F, 1.0F, 1.5F).setColor(SpentCasing.COLOR_CASE_44);
@ -32,6 +38,7 @@ public class GunFactory {
/// BULLLET CFGS ///
ammo_debug = new BulletConfig().setItem(ModItems.ammo_debug).setSpread(0.01F).setRicochetAngle(45).setCasing(CASING44.clone().register("DEBUG0"));
ammo_debug_shot = new BulletConfig().setItem(ModItems.ammo_debug).setSpread(0.05F).setProjectiles(6).setRicochetAngle(45).setCasing(CASING44.clone().register("DEBUG1"));
/// GUNS ///
ModItems.gun_debug = new ItemGunBaseNT(WeaponQuality.DEBUG, new GunConfig()
@ -40,9 +47,15 @@ public class GunFactory {
.dmg(10F).delay(14).reload(46).jam(23).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 12).addConfigs(ammo_debug))
.offset(0.75, -0.0625, -0.3125D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD).pt(Lego.LAMBDA_TOGGLE_AIM)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE),
new Receiver(1)
.dmg(5F).delay(14).reload(46).jam(23).sound("hbm:weapon.44Shoot", 1.0F, 1.0F)
.mag(new MagazineFullReload(1, 12).addConfigs(ammo_debug_shot))
.offset(0.75, -0.0625, -0.3125D)
.canFire(Lego.LAMBDA_SECOND_CAN_FIRE).fire(Lego.LAMBDA_SECOND_FIRE))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).ps((stack, ctx) -> { Lego.clickReceiver(stack, ctx, 1); })
.pr(Lego.LAMBDA_STANDARD_RELOAD).pt(Lego.LAMBDA_TOGGLE_AIM)
.decider(LAMBDA_DEBUG_DECIDER)
.anim(Lego.LAMBDA_DEBUG_ANIMS)
).setUnlocalizedName("gun_debug");
@ -79,6 +92,17 @@ public class GunFactory {
MainRegistry.proxy.registerGunCfg();
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_DEBUG_DECIDER = (stack, ctx) -> {
int index = ctx.configIndex;
GunState lastState = ItemGunBaseNT.getState(stack, index);
GunStateDecider.deciderStandardFinishDraw(stack, lastState, index);
GunStateDecider.deciderStandardClearJam(stack, lastState, index);
GunStateDecider.deciderStandardReload(stack, ctx, lastState, 0, index);
GunStateDecider.deciderStandardReload(stack, ctx, lastState, 1, index);
GunStateDecider.deciderAutoRefire(stack, ctx, lastState, 0, index, () -> { return ItemGunBaseNT.getPrimary(stack, index) && ItemGunBaseNT.getMode(stack, ctx.configIndex) == 0; });
GunStateDecider.deciderAutoRefire(stack, ctx, lastState, 1, index, () -> { return ItemGunBaseNT.getSecondary(stack, index) && ItemGunBaseNT.getMode(stack, ctx.configIndex) == 0; });
};
public static enum EnumAmmo implements IOrderedEnum {
STONE, STONE_AP, STONE_IRON, STONE_SHOT,
M357_BP, M357_SP, M357_FMJ, M357_JHP, M357_AP, M357_EXPRESS,

View File

@ -106,6 +106,7 @@ public class GunFactoryClient {
//PROJECTILES
ammo_debug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
ammo_debug_shot.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
stone.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
flint.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
@ -238,7 +239,8 @@ public class GunFactoryClient {
setRendererBulk(LegoClient.RENDER_GRENADE, shell_normal, shell_explosive, shell_ap, shell_du, shell_w9); //TODO: change the sabots
//HUDS
((ItemGunBaseNT) ModItems.gun_debug) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_debug) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO, LegoClient.HUD_COMPONENT_AMMO_SECOND);
((ItemGunBaseNT) ModItems.gun_pepperbox) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_light_revolver) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_light_revolver_atlas) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);

View File

@ -20,7 +20,8 @@ public class GunStateDecider {
/**
* The meat and bones of the gun system's state machine.
* This standard decider can handle guns with an automatic primary receiver, as well as one receiver's reloading state.
* It supports draw delays as well as semi and auto fire
* It supports draw delays as well as semi and auto fire with a standard left click refire check.
* Only handles single receiver weapons!
*/
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_DECIDER = (stack, ctx) -> {
int index = ctx.configIndex;

View File

@ -175,6 +175,7 @@ public class Lego {
/** Returns true if the mag has ammo in it. Used by keybind functions on whether to fire, and deciders on whether to trigger a refire. */
public static BiFunction<ItemStack, LambdaContext, Boolean> LAMBDA_STANDARD_CAN_FIRE = (stack, ctx) -> { return ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmount(stack, ctx.inventory) > 0; };
public static BiFunction<ItemStack, LambdaContext, Boolean> LAMBDA_SECOND_CAN_FIRE = (stack, ctx) -> { return ctx.config.getReceivers(stack)[1].getMagazine(stack).getAmount(stack, ctx.inventory) > 0; };
/** Returns true if the mag has ammo in it, and the gun is in the locked on state */
public static BiFunction<ItemStack, LambdaContext, Boolean> LAMBDA_LOCKON_CAN_FIRE = (stack, ctx) -> { return ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmount(stack, ctx.inventory) > 0 && ItemGunBaseNT.getIsLockedOn(stack); };
@ -187,26 +188,29 @@ public class Lego {
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg */
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_FIRE = (stack, ctx) -> {
doStandardFire(stack, ctx, GunAnimation.CYCLE, true);
doStandardFire(stack, ctx, GunAnimation.CYCLE, 0, true);
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SECOND_FIRE = (stack, ctx) -> {
doStandardFire(stack, ctx, GunAnimation.CYCLE, 1, true);
};
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg, ignores wear */
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_NOWEAR_FIRE = (stack, ctx) -> {
doStandardFire(stack, ctx, GunAnimation.CYCLE, false);
doStandardFire(stack, ctx, GunAnimation.CYCLE, 0, false);
};
/** Spawns an EntityBulletBaseMK4 with the loaded bulletcfg, then resets lockon progress */
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_LOCKON_FIRE = (stack, ctx) -> {
doStandardFire(stack, ctx, GunAnimation.CYCLE, true);
doStandardFire(stack, ctx, GunAnimation.CYCLE, 0, true);
ItemGunBaseNT.setIsLockedOn(stack, false);
};
public static void doStandardFire(ItemStack stack, LambdaContext ctx, GunAnimation anim, boolean calcWear) {
public static void doStandardFire(ItemStack stack, LambdaContext ctx, GunAnimation anim, int receiver, boolean calcWear) {
EntityLivingBase entity = ctx.entity;
EntityPlayer player = ctx.getPlayer();
int index = ctx.configIndex;
if(anim != null) ItemGunBaseNT.playAnimation(player, stack, anim, ctx.configIndex);
boolean aim = ItemGunBaseNT.getIsAiming(stack);
Receiver primary = ctx.config.getReceivers(stack)[0];
Receiver primary = ctx.config.getReceivers(stack)[receiver];
IMagazine mag = primary.getMagazine(stack);
BulletConfig config = (BulletConfig) mag.getType(stack, ctx.inventory);

View File

@ -35,6 +35,7 @@ public class LegoClient {
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO = new HUDComponentAmmoCounter(0);
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO_MIRROR = new HUDComponentAmmoCounter(0).mirror();
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO_NOCOUNTER = new HUDComponentAmmoCounter(0).noCounter();
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO_SECOND = new HUDComponentAmmoCounter(1);
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_STANDARD_BULLET = (bullet, interp) -> {
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;

View File

@ -14,7 +14,9 @@ import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.AuxParticlePacketNT;
import com.hbm.packet.toclient.MuzzleFlashPacket;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.helper.CasingCreator;
import com.hbm.render.anim.HbmAnimations;
@ -58,6 +60,7 @@ public class Orchestras {
}
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 11) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 1F);
}
if(type == GunAnimation.CYCLE_DRY) {
@ -81,6 +84,7 @@ public class Orchestras {
if(timer == 55) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 1F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 21) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.6F);
}
if(type == GunAnimation.CYCLE_DRY) {
@ -108,6 +112,7 @@ public class Orchestras {
if(timer == 44) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
}
if(type == GunAnimation.CYCLE_DRY) {
@ -136,6 +141,7 @@ public class Orchestras {
if(timer == 44) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
}
if(type == GunAnimation.CYCLE_DRY) {
@ -177,6 +183,7 @@ public class Orchestras {
if(timer == 44) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.leverCock", 1F, 1F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 14) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, -0.125, aiming ? -0.125 : -0.375D, 0, 0.12, -0.12, 0.01, -7.5F + (float)entity.getRNG().nextGaussian() * 5F, (float)entity.getRNG().nextGaussian() * 1.5F, casing.getName(), true, 60, 0.5D, 20);
@ -200,6 +207,7 @@ public class Orchestras {
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.openLatch", 1F, 1F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 2) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.55, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -7.5F + (float)entity.getRNG().nextGaussian() * 5F, 12F + (float)entity.getRNG().nextGaussian() * 5F, casing.getName());
@ -248,6 +256,7 @@ public class Orchestras {
if(timer == 29) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.leverCock", 1F, 0.8F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 14) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, 0.18, -0.12, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 5F, (float)entity.getRNG().nextGaussian() * 2.5F, casing.getName(), true, 60, 0.5D, 20);
@ -283,6 +292,7 @@ public class Orchestras {
if(timer == 29) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.leverCock", 1F, 0.8F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 14) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, -0.08, 0, 0.01, -15F + (float)entity.getRNG().nextGaussian() * 5F, (float)entity.getRNG().nextGaussian() * 2.5F, casing.getName(), true, 60, 0.5D, 20);
@ -303,6 +313,7 @@ public class Orchestras {
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 14) {
int offset = ctx.configIndex == 0 ? -1 : 1;
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
@ -368,6 +379,7 @@ public class Orchestras {
}
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 11) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 1F);
}
if(type == GunAnimation.CYCLE_DRY) {
@ -388,6 +400,7 @@ public class Orchestras {
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 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.25D, 0, 0.21, -0.06, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 2.5F, 2.5F + (float)entity.getRNG().nextGaussian() * 2F, casing.getName(), true, 60, 0.5D, 20);
@ -424,6 +437,7 @@ public class Orchestras {
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, (float)entity.getRNG().nextGaussian() * 10F, (float)entity.getRNG().nextGaussian() * 10F, casing.getName());
}
@ -448,6 +462,7 @@ public class Orchestras {
} else {
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, (float)entity.getRNG().nextGaussian() * 10F, (float)entity.getRNG().nextGaussian() * 10F, casing.getName());
}
@ -478,7 +493,10 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
}
if(type == GunAnimation.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.75F);
if(timer == 4) {
@ -524,6 +542,7 @@ public class Orchestras {
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 15) {
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
SpentCasing casing = mag.getCasing(stack, ctx.inventory);
@ -603,6 +622,7 @@ public class Orchestras {
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 1) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.0625, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 5F, 10F + entity.getRNG().nextFloat() * 10F, casing.getName());
@ -636,6 +656,7 @@ public class Orchestras {
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.openLatch", 1F, 1.25F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 1) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -2.5F + (float)entity.getRNG().nextGaussian() * 5F, 10F + (float)entity.getRNG().nextFloat() * 15F, casing.getName());
@ -667,6 +688,7 @@ public class Orchestras {
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.openLatch", 1F, 1.25F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 1) {
int mult = ctx.configIndex == 0 ? -1 : 1;
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
@ -697,6 +719,7 @@ public class Orchestras {
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE || type == GunAnimation.ALT_CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.shotgunCock", 1F, 1F);
if(timer == 10) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory); //turns out there's a reason why stovepipes look like that
@ -734,7 +757,9 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
}
if(type == GunAnimation.RELOAD) {
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.insertCanister", 1F, 1F);
}
@ -752,6 +777,7 @@ public class Orchestras {
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.5, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 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) {
@ -800,8 +826,11 @@ public class Orchestras {
//stop sound due to timeout
if(runningAudio != null && runningAudio.isPlaying()) runningAudio.stopSound();
}
return;
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
}
if(type == GunAnimation.RELOAD) {
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.insertCanister", 1F, 1F);
}
@ -853,6 +882,7 @@ public class Orchestras {
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 7) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.boltOpen", 0.5F, 1F);
if(timer == 16) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.boltClose", 0.5F, 1F);
if(timer == 12) {
@ -903,6 +933,7 @@ public class Orchestras {
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.3125D, 0, 0.06, -0.18, 0.01, (float)entity.getRNG().nextGaussian() * 20F, 12.5F + (float)entity.getRNG().nextGaussian() * 7.5F, casing.getName());
}
@ -916,6 +947,7 @@ public class Orchestras {
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.fire.shredderCycle", 0.25F, 1.5F);
}
if(type == GunAnimation.CYCLE_DRY) {
@ -940,8 +972,11 @@ public class Orchestras {
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE) {
if(timer == 0 && ctx.config.getReceivers(stack)[0].getMagazine(stack).getType(stack, null) == XFactory12ga.g12_equestrian_bj) {
ItemGunBaseNT.setTimer(stack, 0, 20);
if(timer == 0) {
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(ctx.config.getReceivers(stack)[0].getMagazine(stack).getType(stack, null) == XFactory12ga.g12_equestrian_bj) {
ItemGunBaseNT.setTimer(stack, 0, 20);
}
}
if(timer == 2) {
@ -986,7 +1021,10 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
}
if(type == GunAnimation.RELOAD) {
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.insertCanister", 1F, 1F);
}
@ -1001,6 +1039,7 @@ public class Orchestras {
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
int rounds = XWeaponModManager.hasUpgrade(stack, ctx.configIndex, XWeaponModManager.ID_MINIGUN_SPEED) ? 3 : 1;
for(int i = 0; i < rounds; i++) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
@ -1029,6 +1068,7 @@ public class Orchestras {
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
int index = ctx.configIndex == 0 ? -1 : 1;
int rounds = XWeaponModManager.hasUpgrade(stack, ctx.configIndex, XWeaponModManager.ID_MINIGUN_SPEED) ? 3 : 1;
for(int i = 0; i < rounds; i++) {
@ -1055,7 +1095,10 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE) {
if(timer == 0) 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, 1.25F);
}
@ -1094,7 +1137,10 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE) {
if(timer == 0) 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, 1.5F);
}
@ -1123,6 +1169,7 @@ public class Orchestras {
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.125, aiming ? -0.125 : -0.25, aiming ? -0.125 : -0.25D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 7.5F + entity.getRNG().nextFloat() * 5F, casing.getName());
}
@ -1149,6 +1196,7 @@ public class Orchestras {
} else {
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.25, aiming ? -0.125 : -0.25, aiming ? -0.125 : -0.25D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 7.5F + entity.getRNG().nextFloat() * 5F, casing.getName());
}
@ -1269,7 +1317,10 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE) {
if(timer == 0) 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, 1.5F);
}
@ -1299,7 +1350,10 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE && stack.getItem() == ModItems.gun_n_i_4_n_i) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
}
if(type == GunAnimation.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.coilgunReload", 1F, 1F);
}
@ -1310,7 +1364,10 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == GunAnimation.CYCLE) {
if(timer == 0) 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, 1F);
}
@ -1413,7 +1470,9 @@ public class Orchestras {
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.75F);
if(timer == 19) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.8F);
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) 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 == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F);
}
@ -1433,6 +1492,7 @@ public class Orchestras {
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 1) {
int cba = (stack.getItem() == ModItems.gun_aberrator_eott && ctx.configIndex == 0) ? -1 : 1;
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
@ -1459,6 +1519,7 @@ public class Orchestras {
}
if(type == GunAnimation.CYCLE) {
if(timer == 0) PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
if(timer == 7) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.boltOpen", 0.5F, 1F);
if(timer == 16) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.boltClose", 0.5F, 1F);
if(timer == 12) {

View File

@ -154,7 +154,7 @@ public class XFactory9mm {
ItemGunBaseNT.setTimer(stack, index, primary.getDelayAfterFire(stack));
EntityDamageUtil.attackEntityFromNT(player, BulletConfig.getDamage(player, player, DamageClass.PHYSICAL), 1_000F, true, false, 1D, 5F, 0F);
} else {
Lego.doStandardFire(stack, ctx, GunAnimation.CYCLE, true);
Lego.doStandardFire(stack, ctx, GunAnimation.CYCLE, 0, true);
}
};

View File

@ -124,7 +124,7 @@ public class XFactoryFolly {
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_FIRE = (stack, ctx) -> {
Lego.doStandardFire(stack, ctx, GunAnimation.CYCLE, false);
Lego.doStandardFire(stack, ctx, GunAnimation.CYCLE, 0, false);
};
public static BiFunction<ItemStack, LambdaContext, Boolean> LAMBDA_CAN_FIRE = (stack, ctx) -> {

View File

@ -41,7 +41,7 @@ public class HUDComponentAmmoCounter implements IHUDComponent {
@Override
public int getComponentHeight(EntityPlayer player, ItemStack stack){
return 24;
return 19;
}
@Override
@ -52,7 +52,7 @@ public class HUDComponentAmmoCounter implements IHUDComponent {
Minecraft mc = Minecraft.getMinecraft();
int pX = resolution.getScaledWidth() / 2 + (mirrored ? -(62 + 36 + 52) : (62 + 36)) + (noCounter ? 14 : 0);
int pZ = resolution.getScaledHeight() - bottomOffset - 23;
int pZ = resolution.getScaledHeight() - bottomOffset - 18;
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
IMagazine mag = gun.getConfig(stack, gunIndex).getReceivers(stack)[this.receiver].getMagazine(stack);

View File

@ -3,6 +3,7 @@ package com.hbm.main;
import com.hbm.blocks.BlockEnums.DecoCabinetEnum;
import com.hbm.blocks.BlockEnums.LightstoneType;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockAbsorber.EnumAbsorberTier;
import com.hbm.blocks.generic.BlockConcreteColoredExt.EnumConcreteType;
import com.hbm.blocks.generic.BlockGenericStairs;
import com.hbm.blocks.generic.BlockMultiSlab;
@ -27,7 +28,6 @@ import com.hbm.items.ItemEnums.EnumLegendaryType;
import com.hbm.items.ItemEnums.EnumPages;
import com.hbm.items.ItemEnums.EnumPlantType;
import com.hbm.items.ItemGenericPart.EnumPartType;
import com.hbm.items.food.ItemConserve.EnumFoodType;
import com.hbm.items.machine.ItemArcElectrode.EnumElectrodeType;
import com.hbm.items.machine.ItemBattery;
import com.hbm.items.machine.ItemBatteryPack.EnumBatteryPack;
@ -615,12 +615,6 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.machine_satlinker), new Object[] { "PSP", "SCS", "PSP", 'P', STEEL.plate(), 'S', STAR.ingot(), 'C', ModItems.sat_chip });
addRecipeAuto(new ItemStack(ModBlocks.machine_keyforge), new Object[] { "PCP", "WSW", "WSW", 'P', STEEL.plate(), 'S', W.ingot(), 'C', ModItems.padlock, 'W', KEY_PLANKS });
addRecipeAuto(new ItemStack(ModItems.sat_chip), new Object[] { "WWW", "CIC", "WWW", 'W', MINGRADE.wireFine(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'I', ANY_PLASTIC.ingot() });
addShapelessAuto(new ItemStack(ModItems.sat_mapper), new Object[] { ModBlocks.sat_mapper });
addShapelessAuto(new ItemStack(ModItems.sat_scanner), new Object[] { ModBlocks.sat_scanner });
addShapelessAuto(new ItemStack(ModItems.sat_radar), new Object[] { ModBlocks.sat_radar });
addShapelessAuto(new ItemStack(ModItems.sat_laser), new Object[] { ModBlocks.sat_laser });
addShapelessAuto(new ItemStack(ModItems.sat_resonator), new Object[] { ModBlocks.sat_resonator });
addShapelessAuto(new ItemStack(ModItems.sat_foeq), new Object[] { ModBlocks.sat_foeq });
addShapelessAuto(new ItemStack(ModItems.geiger_counter), new Object[] { ModBlocks.geiger });
addRecipeAuto(new ItemStack(ModItems.sat_interface), new Object[] { "ISI", "PCP", "PAP", 'I', STEEL.ingot(), 'S', STAR.ingot(), 'P', ModItems.plate_polymer, 'C', ModItems.sat_chip, 'A', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
addRecipeAuto(new ItemStack(ModItems.sat_coord), new Object[] { "SII", "SCA", "SPP", 'I', STEEL.ingot(), 'S', STAR.ingot(), 'P', ModItems.plate_polymer, 'C', ModItems.sat_chip, 'A', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
@ -643,11 +637,11 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.ammo_bag, 1), new Object[] { "LLL", "MGM", "LLL", 'L', Items.leather, 'G', WEAPONSTEEL.plate(), 'M', WEAPONSTEEL.mechanism() });
addRecipeAuto(new ItemStack(ModItems.ammo_bag, 1), new Object[] { "LLL", "MGM", "LLL", 'L', ANY_RUBBER.ingot(), 'G', WEAPONSTEEL.plate(), 'M', WEAPONSTEEL.mechanism() });
addRecipeAuto(new ItemStack(ModBlocks.absorber, 1), new Object[] { "ICI", "CPC", "ICI", 'I', CU.ingot(), 'C', COAL.dust(), 'P', PB.dust() });
addRecipeAuto(new ItemStack(ModBlocks.absorber_red, 1), new Object[] { "ICI", "CPC", "ICI", 'I', TI.ingot(), 'C', COAL.dust(), 'P', ModBlocks.absorber });
addRecipeAuto(new ItemStack(ModBlocks.absorber_green, 1), new Object[] { "ICI", "CPC", "ICI", 'I', ANY_PLASTIC.ingot(), 'C', ModItems.powder_desh_mix, 'P', ModBlocks.absorber_red });
addRecipeAuto(new ItemStack(ModBlocks.absorber_pink, 1), new Object[] { "ICI", "CPC", "ICI", 'I', BIGMT.ingot(), 'C', ModItems.powder_nitan_mix, 'P', ModBlocks.absorber_green });
addRecipeAuto(new ItemStack(ModBlocks.decon, 1), new Object[] { "BGB", "SAS", "BSB", 'B', BE.ingot(), 'G', Blocks.iron_bars, 'S', STEEL.ingot(), 'A', ModBlocks.absorber });
addRecipeAuto(new ItemStack(ModBlocks.rad_absorber, 1, EnumAbsorberTier.BASE.ordinal()),new Object[] { "ICI", "CPC", "ICI", 'I', CU.ingot(), 'C', COAL.dust(), 'P', PB.dust() });
addRecipeAuto(new ItemStack(ModBlocks.rad_absorber, 1, EnumAbsorberTier.RED.ordinal()),new Object[] { "ICI", "CPC", "ICI", 'I', TI.ingot(), 'C', COAL.dust(),'P', new ItemStack(ModBlocks.rad_absorber, 1, EnumAbsorberTier.BASE.ordinal()) });
addRecipeAuto(new ItemStack(ModBlocks.rad_absorber, 1, EnumAbsorberTier.GREEN.ordinal()),new Object[] { "ICI", "CPC", "ICI", 'I', ANY_PLASTIC.ingot(), 'C', ModItems.powder_desh_mix,'P', new ItemStack(ModBlocks.rad_absorber, 1, EnumAbsorberTier.RED.ordinal()) });
addRecipeAuto(new ItemStack(ModBlocks.rad_absorber, 1, EnumAbsorberTier.PINK.ordinal()), new Object[] { "ICI", "CPC", "ICI", 'I', BIGMT.ingot(), 'C', ModItems.powder_nitan_mix,'P', new ItemStack(ModBlocks.rad_absorber, 1, EnumAbsorberTier.GREEN.ordinal()) });
addRecipeAuto(new ItemStack(ModBlocks.decon, 1), new Object[] { "BGB", "SAS", "BSB", 'B', BE.ingot(), 'G', Blocks.iron_bars, 'S', STEEL.ingot(), 'A', new ItemStack(ModBlocks.rad_absorber, 1, EnumAbsorberTier.BASE.ordinal()) });
addRecipeAuto(new ItemStack(ModBlocks.machine_minirtg, 1), new Object[] { "LLL", "PPP", "TRT", 'L', PB.plate(), 'P', PU238.billet(), 'T', ModItems.thermo_element, 'R', ModItems.rtg_unit });
addRecipeAuto(new ItemStack(ModBlocks.machine_powerrtg, 1), new Object[] { "SRS", "PTP", "SRS", 'S', STAR.ingot(), 'R', ModItems.rtg_unit, 'P', PO210.billet(), 'T', TS.dust() });
@ -875,7 +869,6 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.machine_condenser), new Object[] { "SIS", "ICI", "SIS", 'S', STEEL.ingot(), 'I', IRON.plate(), 'C', CU.plateCast() });
addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.TEST.ordinal()), new Object[] { Items.book, ModItems.canned_conserve.stackFromEnum(EnumFoodType.JIZZ) });
addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.RBMK.ordinal()), new Object[] { Items.book, Items.potato });
addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.STARTER.ordinal()), new Object[] { Items.book, Items.iron_ingot });

View File

@ -1471,6 +1471,12 @@ public class MainRegistry {
ignoreMappings.add("hbm:tile.fusion_motor");
ignoreMappings.add("hbm:tile.machine_spp_bottom");
ignoreMappings.add("hbm:tile.machine_spp_top");
ignoreMappings.add("hbm:tile.sat_mapper");
ignoreMappings.add("hbm:tile.sat_radar");
ignoreMappings.add("hbm:tile.sat_scanner");
ignoreMappings.add("hbm:tile.sat_laser");
ignoreMappings.add("hbm:tile.sat_foeq");
ignoreMappings.add("hbm:tile.sat_resonator");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -36,7 +36,6 @@ import com.hbm.handler.threading.PacketThreading;
import com.hbm.items.IEquipReceiver;
import com.hbm.items.ModItems;
import com.hbm.items.armor.*;
import com.hbm.items.food.ItemConserve.EnumFoodType;
import com.hbm.items.tool.ItemGuideBook.BookType;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
@ -505,10 +504,10 @@ public class ModEventHandler {
ItemStack[] prevArmor = event.entityLiving.previousEquipment;
if(event.entityLiving instanceof EntityPlayer && prevArmor != null && event.entityLiving.getHeldItem() != null
if(event.entityLiving instanceof EntityPlayerMP && prevArmor != null && event.entityLiving.getHeldItem() != null
&& (prevArmor[0] == null || prevArmor[0].getItem() != event.entityLiving.getHeldItem().getItem())
&& event.entityLiving.getHeldItem().getItem() instanceof IEquipReceiver) {
((IEquipReceiver)event.entityLiving.getHeldItem().getItem()).onEquip((EntityPlayer) event.entityLiving, event.entityLiving.getHeldItem());
}
@ -1071,6 +1070,21 @@ public class ModEventHandler {
event.getChunk().func_150807_a(x, y, z, Blocks.air, 0);
}
}*/
for(int x = 0; x < 16; x++) for(int y = 0; y < 255; y++) for(int z = 0; z < 16; z++) {
if(event.getChunk().getBlock(x, y, z) == ModBlocks.absorber) {
event.getChunk().func_150807_a(x, y, z, ModBlocks.rad_absorber, 0);
}
else if(event.getChunk().getBlock(x, y, z) == ModBlocks.absorber_red) {
event.getChunk().func_150807_a(x, y, z, ModBlocks.rad_absorber, 1);
}
else if(event.getChunk().getBlock(x, y, z) == ModBlocks.absorber_green) {
event.getChunk().func_150807_a(x, y, z, ModBlocks.rad_absorber, 2);
}
else if(event.getChunk().getBlock(x, y, z) == ModBlocks.absorber_pink) {
event.getChunk().func_150807_a(x, y, z, ModBlocks.rad_absorber, 3);
}
}
}
@SubscribeEvent
@ -1110,8 +1124,6 @@ public class ModEventHandler {
@SubscribeEvent
public void onItemPickup(PlayerEvent.ItemPickupEvent event) {
if(event.pickedUp.getEntityItem().getItem() == ModItems.canned_conserve && EnumUtil.grabEnumSafely(EnumFoodType.class, event.pickedUp.getEntityItem().getItemDamage()) == EnumFoodType.JIZZ)
event.player.triggerAchievement(MainRegistry.achC20_5);
if(event.pickedUp.getEntityItem().getItem() == Items.slime_ball)
event.player.triggerAchievement(MainRegistry.achSlimeball);
}

View File

@ -926,6 +926,14 @@ public class ModEventHandlerClient {
if(ArmorUtil.isWearingEmptyMask(mc.thePlayer)) {
MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "Your mask has no filter!", MainRegistry.proxy.ID_FILTER);
}
//prune other entities' muzzle flashes
if(mc.theWorld.getTotalWorldTime() % 30 == 0) {
Iterator itr = ItemRenderWeaponBase.flashMap.keySet().iterator();
long millis = System.currentTimeMillis();
//dead entities may have later insertion order than actively firing ones, so we be safe
ItemRenderWeaponBase.flashMap.values().removeIf(entry -> millis - entry.longValue() >= 150);
}
}
if(Keyboard.isKeyDown(HbmKeybinds.qmaw.getKeyCode()) && Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && Minecraft.getMinecraft().currentScreen != null) {

View File

@ -279,10 +279,10 @@ public class ModEventHandlerRenderer {
if(renderWeapon.isLeftHanded()) {
GL11.glTranslatef(0.1875F, 0F, 0.0F);
renderWeapon.setupThirdPerson(held);
renderWeapon.renderEquippedAkimbo(held);
renderWeapon.renderEquippedAkimbo(held, player);
} else {
renderWeapon.setupThirdPersonAkimbo(held);
renderWeapon.renderEquippedAkimbo(held);
renderWeapon.renderEquippedAkimbo(held, player);
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();

View File

@ -301,13 +301,6 @@ public class ResourceManager {
public static final IModelCustom dud_salted = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/bombs/dud_salted.obj")).asVBO();
//Satellites
public static final IModelCustom sat_base = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_base.obj"));
public static final IModelCustom sat_radar = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_radar.obj"));
public static final IModelCustom sat_resonator = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_resonator.obj"));
public static final IModelCustom sat_scanner = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_scanner.obj"));
public static final IModelCustom sat_mapper = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_mapper.obj"));
public static final IModelCustom sat_laser = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_laser.obj"));
public static final IModelCustom sat_foeq = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_foeq.obj"));
public static final IModelCustom sat_foeq_burning = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_foeq_burning.obj"));
public static final IModelCustom sat_foeq_fire = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_foeq_fire.obj"));
@ -344,7 +337,12 @@ public class ResourceManager {
//Doors
public static AnimatedModel transition_seal = ColladaLoader.load(new ResourceLocation(RefStrings.MODID, "models/doors/seal.dae"), true);
public static Animation transition_seal_anim = ColladaLoader.loadAnim(24040, new ResourceLocation(RefStrings.MODID, "models/doors/seal.dae"));
public static final IModelCustomNamed fire_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/fire_door.obj")).asVBO();
//PheoDoors
public static final ResourceLocation pheo_fire_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/fire_door.png");
public static IModelCustomNamed pheo_fire_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/fire_door.obj")).asVBO();
public static final ResourceLocation pheo_airlock_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/airlock_door.png");
public static IModelCustomNamed pheo_airlock_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/airlock_door.obj")).asVBO();
//Secure Access Door
public static final ResourceLocation secure_access_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/secure_access_door.png");
@ -821,7 +819,6 @@ public class ResourceManager {
//Doors
public static final ResourceLocation transition_seal_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/transition_seal.png");
public static final ResourceLocation fire_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/fire_door.png");
//Skeleton
public static final ResourceLocation skeleton_holder_tex = new ResourceLocation(RefStrings.MODID, "textures/particle/skeleton.png");

View File

@ -69,6 +69,8 @@ public class PacketDispatcher {
wrapper.registerMessage(SerializableRecipePacket.Handler.class, SerializableRecipePacket.class, i++, Side.CLIENT);
//Syncing of NBT for guns
wrapper.registerMessage(HeldItemNBTPacket.Handler.class, HeldItemNBTPacket.class, i++, Side.CLIENT);
//Syncs muzzle flashes of SEDNA guns for clients from other entities/players
wrapper.registerMessage(MuzzleFlashPacket.Handler.class, MuzzleFlashPacket.class, i++, Side.CLIENT);
}
}

View File

@ -0,0 +1,62 @@
package com.hbm.packet.toclient;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.render.item.weapon.sedna.ItemRenderWeaponBase;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class MuzzleFlashPacket implements IMessage {
private int entityID;
//private int gunIndex; //e.g. akimbo
public MuzzleFlashPacket() { }
//public MuzzleFlashPacket(EntityLivingBase entity) { this(entity, 0); }
public MuzzleFlashPacket(EntityLivingBase entity) {
this.entityID = entity.getEntityId();
//this.gunIndex = index;
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(entityID);
//buf.writeInt(gunIndex);
}
@Override
public void fromBytes(ByteBuf buf) {
this.entityID = buf.readInt();
//this.gunIndex = buf.readInt();
}
public static class Handler implements IMessageHandler<MuzzleFlashPacket, IMessage> {
@SideOnly(Side.CLIENT)
@Override
public IMessage onMessage(MuzzleFlashPacket m, MessageContext ctx) {
EntityLivingBase entity = (EntityLivingBase) Minecraft.getMinecraft().theWorld.getEntityByID(m.entityID);
if(entity == null || entity == Minecraft.getMinecraft().thePlayer) return null; //packets are sent to the player who fired
ItemStack stack = entity.getHeldItem();
if(stack == null) return null;
if(stack.getItem() instanceof ItemGunBaseNT) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
ItemRenderWeaponBase.flashMap.put(entity, System.currentTimeMillis());
}
return null;
}
}
}

View File

@ -135,7 +135,7 @@ public class BusAnimationSequence {
continue;
}
if(millis >= endTime) {
if(millis >= endTime || currentFrame.duration == 0) {
transform[i] = currentFrame.value;
continue;
}

View File

@ -18,6 +18,7 @@ public class HbmAnimations {
//animation is playing, though this will cancel the animation entirely.
public static final Animation[][] hotbar = new Animation[9][8]; //now with 8 parallel rails per slot! time to get railed!
/** Keyframe-based animation system primarily used for guns, not to be confused with Drillgon's animloader system. */
public static class Animation {
//the "name" of the animation slot. if the item has a different key than

View File

@ -615,6 +615,20 @@ public class ItemRenderLibrary {
GL11.glShadeModel(GL11.GL_FLAT);
}
});
renderers.put(Item.getItemFromBlock(ModBlocks.fire_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -3, 0);
GL11.glScaled(3.5, 3.5, 3.5);
}
public void renderCommon() {
bindTexture(ResourceManager.pheo_fire_door_tex);
GL11.glRotated(90, 0, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.pheo_fire_door.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
});
renderers.put(Item.getItemFromBlock(ModBlocks.large_vehicle_door), new ItemRenderBase(){
public void renderInventory() {
@ -706,13 +720,13 @@ public class ItemRenderLibrary {
renderers.put(Item.getItemFromBlock(ModBlocks.round_airlock_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -4, 0);
GL11.glTranslated(0, -3.75, 0);
GL11.glScaled(3, 3, 3);
}
public void renderCommon() {
bindTexture(ResourceManager.round_airlock_door_tex);
bindTexture(ResourceManager.pheo_airlock_door_tex);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.round_airlock_door.renderAll();
ResourceManager.pheo_airlock_door.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
});

View File

@ -8,6 +8,7 @@ import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@ -194,7 +195,7 @@ public class ItemRenderAberrator extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
@ -208,6 +209,34 @@ public class ItemRenderAberrator extends ItemRenderWeaponBase {
ResourceManager.aberrator.renderPart("Slide");
ResourceManager.aberrator.renderPart("Sight");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 2, 4);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 2, -1.5);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderFireball(shot);
GL11.glPopMatrix();
}
}
public static void renderFireball(long lastShot) {
@ -218,6 +247,7 @@ public class ItemRenderAberrator extends ItemRenderWeaponBase {
if(System.currentTimeMillis() - lastShot < flash) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
double fire = (System.currentTimeMillis() - lastShot) / (double) flash;
@ -244,6 +274,7 @@ public class ItemRenderAberrator extends ItemRenderWeaponBase {
tess.draw();
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
}
}
}

View File

@ -9,6 +9,7 @@ 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 ItemRenderAm180 extends ItemRenderWeaponBase {
@ -147,7 +148,7 @@ public class ItemRenderAm180 extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -159,6 +160,30 @@ public class ItemRenderAm180 extends ItemRenderWeaponBase {
ResourceManager.am180.renderPart("Mag");
ResourceManager.am180.renderPart("MagPlate");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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;
}
boolean silenced = this.hasSilencer(stack);
GL11.glPushMatrix();
GL11.glTranslated(0, 1.875, silenced ? 16.75 : 12);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
double flashScale = silenced ? 0.5 : 0.75;
GL11.glScaled(flashScale, flashScale, flashScale);
this.renderMuzzleFlash(shot, silenced ? 75 : 50, silenced ? 5 : 7.5);
GL11.glPopMatrix();
}
}
public boolean hasSilencer(ItemStack stack) {

View File

@ -9,6 +9,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -181,7 +182,7 @@ public class ItemRenderAmat extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -194,7 +195,9 @@ public class ItemRenderAmat extends ItemRenderWeaponBase {
ResourceManager.amat.renderPart("BipodRight");
ResourceManager.amat.renderPart("BipodHingeRight");
if(isScoped(stack)) ResourceManager.amat.renderPart("Scope");
if(isSilenced(stack)) {
boolean silenced = isSilenced(stack);
if(silenced) {
GL11.glTranslated(0, 0.625, -4.3125);
GL11.glScaled(1.25, 1.25, 1.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.g3_attachments);
@ -203,6 +206,25 @@ public class ItemRenderAmat extends ItemRenderWeaponBase {
ResourceManager.amat.renderPart("MuzzleBrake");
}
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED && !silenced) {
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[0];
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 0.5, 11);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderGapFlash(shot);
GL11.glPopMatrix();
}
}
public boolean isScoped(ItemStack stack) {

View File

@ -7,6 +7,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -135,12 +136,30 @@ public class ItemRenderAtlas extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
ResourceManager.bio_revolver.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[0];
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 1.5, 9.25);
GL11.glRotated(90, 0, 1, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -114,7 +114,7 @@ public class ItemRenderBolter extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glRotated(180, 0, 1, 0);

View File

@ -8,6 +8,7 @@ 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 ItemRenderCarbine extends ItemRenderWeaponBase {
@ -134,7 +135,7 @@ public class ItemRenderCarbine extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -147,6 +148,28 @@ public class ItemRenderCarbine extends ItemRenderWeaponBase {
ResourceManager.carbine.renderPart("Bayonet");
}
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 1, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
public boolean hasBayonet(ItemStack stack) {

View File

@ -136,7 +136,7 @@ public class ItemRenderChargeThrower extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);

View File

@ -86,7 +86,7 @@ public class ItemRenderChemthrower extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glRotated(90, 0, 1, 0);

View File

@ -83,7 +83,7 @@ public class ItemRenderCoilgun extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glRotated(-90, 0, 1, 0);

View File

@ -13,6 +13,7 @@ import com.hbm.render.anim.AnimationEnums.GunAnimation;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderCongoLake extends ItemRenderWeaponBase {
@ -168,12 +169,34 @@ public class ItemRenderCongoLake extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.congolake_tex);
ResourceManager.congolake.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 1.75, 4.25);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderMuzzleFlash(shot, 150, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -7,6 +7,7 @@ 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 ItemRenderDANI extends ItemRenderWeaponBase {
@ -167,21 +168,54 @@ public class ItemRenderDANI extends ItemRenderWeaponBase {
}
@Override
public void renderEquipped(ItemStack stack) {
public void renderEquipped(ItemStack stack, Object... data) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.dani_lunar_tex);
ResourceManager.bio_revolver.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
//Stopgap: at the moment, the flashMap is gun agnostic and does not care about index.
EntityLivingBase ent = (EntityLivingBase) data[1]; //Entity is second obj. passed
long shot;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[1];
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 1.5, 9.25);
GL11.glRotated(90, 0, 1, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
@Override
public void renderEquippedAkimbo(ItemStack stack) {
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase ent) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.dani_celestial_tex);
ResourceManager.bio_revolver.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
//EntityPlayer is first & only object passed
long shot;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[0];
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 1.5, 9.25);
GL11.glRotated(90, 0, 1, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
@Override
@ -216,7 +250,7 @@ public class ItemRenderDANI extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.dani_celestial_tex);

View File

@ -7,6 +7,7 @@ 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 ItemRenderDebug extends ItemRenderWeaponBase {
@ -120,7 +121,7 @@ public class ItemRenderDebug extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glRotated(90, 0, 1, 0);
GL11.glEnable(GL11.GL_LIGHTING);
@ -136,5 +137,24 @@ public class ItemRenderDebug extends ItemRenderWeaponBase {
ResourceManager.lilmac.renderPart("Pivot");
ResourceManager.lilmac.renderPart("Hammer");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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.125, 2.5, 0);
this.renderGapFlash(shot);
GL11.glPopMatrix();
}
}
}

View File

@ -9,6 +9,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -158,7 +159,7 @@ public class ItemRenderDoubleBarrel extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -170,6 +171,28 @@ public class ItemRenderDoubleBarrel extends ItemRenderWeaponBase {
ResourceManager.double_barrel.renderPart("Lever");
ResourceManager.double_barrel.renderPart("Shells");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(2, 2, 2);
this.renderMuzzleFlash(shot, 75, 5);
GL11.glPopMatrix();
}
}
public boolean isSawedOff(ItemStack stack) {

View File

@ -127,7 +127,7 @@ public class ItemRenderDrill extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);

View File

@ -8,6 +8,7 @@ import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderEOTT extends ItemRenderWeaponBase {
@ -209,7 +210,7 @@ public class ItemRenderEOTT extends ItemRenderWeaponBase {
}
@Override
public void renderEquipped(ItemStack stack) {
public void renderEquipped(ItemStack stack, Object... data) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.eott_tex);
@ -219,10 +220,36 @@ public class ItemRenderEOTT extends ItemRenderWeaponBase {
ResourceManager.aberrator.renderPart("Slide");
ResourceManager.aberrator.renderPart("Sight");
GL11.glShadeModel(GL11.GL_FLAT);
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
double shotRand = 0;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[1];
shotRand = gun.shotRand;
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 2, 4);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 2, -1.5);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderFireball(shot);
GL11.glPopMatrix();
}
@Override
public void renderEquippedAkimbo(ItemStack stack) {
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase ent) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.eott_tex);
@ -232,6 +259,31 @@ public class ItemRenderEOTT extends ItemRenderWeaponBase {
ResourceManager.aberrator.renderPart("Slide");
ResourceManager.aberrator.renderPart("Sight");
GL11.glShadeModel(GL11.GL_FLAT);
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, 2, 4);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 2, -1.5);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderFireball(shot);
GL11.glPopMatrix();
}
@Override
@ -268,7 +320,7 @@ public class ItemRenderEOTT extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
@ -292,6 +344,7 @@ public class ItemRenderEOTT extends ItemRenderWeaponBase {
if(System.currentTimeMillis() - lastShot < flash) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
double fire = (System.currentTimeMillis() - lastShot) / (double) flash;
@ -318,6 +371,7 @@ public class ItemRenderEOTT extends ItemRenderWeaponBase {
tess.draw();
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
}
}
}

View File

@ -119,7 +119,7 @@ public class ItemRenderFatMan extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();

View File

@ -112,7 +112,7 @@ public class ItemRenderFlamer extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);

View File

@ -120,7 +120,7 @@ public class ItemRenderFlaregun extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);

View File

@ -202,7 +202,7 @@ public class ItemRenderFolly extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);

View File

@ -9,6 +9,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -180,7 +181,7 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
boolean silenced = hasSilencer(stack);
@ -209,6 +210,28 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
if(isScoped) ResourceManager.g3.renderPart("Scope");
}
GL11.glShadeModel(GL11.GL_FLAT);
//third-person muzzle flashes
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, 0, 12);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(-25 + shotRand * 10, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 75, 10);
GL11.glPopMatrix();
}
}
public boolean hasStock(ItemStack stack) {

View File

@ -8,6 +8,7 @@ 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 ItemRenderGreasegun extends ItemRenderWeaponBase {
@ -143,13 +144,35 @@ public class ItemRenderGreasegun extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(isRefurbished(stack) ? ResourceManager.greasegun_clean_tex : ResourceManager.greasegun_tex);
ResourceManager.greasegun.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
public boolean isRefurbished(ItemStack stack) {

View File

@ -7,6 +7,7 @@ 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 ItemRenderHangman extends ItemRenderWeaponBase {
@ -134,12 +135,34 @@ public class ItemRenderHangman extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.hangman_tex);
ResourceManager.hangman.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0, 29);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(2, 2, 2);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -9,6 +9,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -153,7 +154,7 @@ public class ItemRenderHeavyRevolver extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glRotated(90, 0, 1, 0);
GL11.glEnable(GL11.GL_LIGHTING);
@ -173,6 +174,23 @@ public class ItemRenderHeavyRevolver extends ItemRenderWeaponBase {
ResourceManager.lilmac.renderPart("Scope");
}
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[0];
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0.125, 2.5, 0);
this.renderGapFlash(shot);
GL11.glPopMatrix();
}
}
public boolean isScoped(ItemStack stack) {

View File

@ -7,6 +7,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -160,12 +161,33 @@ public class ItemRenderHenry extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
ResourceManager.henry.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 1, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 5);
GL11.glPopMatrix();
}
}
}

View File

@ -7,6 +7,7 @@ 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 ItemRenderLAG extends ItemRenderWeaponBase {
@ -135,7 +136,7 @@ public class ItemRenderLAG extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glRotated(90, 0, 1, 0);
@ -145,5 +146,25 @@ public class ItemRenderLAG extends ItemRenderWeaponBase {
ResourceManager.mike_hawk.renderPart("Slide");
ResourceManager.mike_hawk.renderPart("Hammer");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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(-10.25, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -8,6 +8,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -122,7 +123,7 @@ public class ItemRenderLaserPistol extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -131,6 +132,26 @@ public class ItemRenderLaserPistol extends ItemRenderWeaponBase {
ResourceManager.laser_pistol.renderPart("Latch");
if(hasCapacitors(stack)) ResourceManager.laser_pistol.renderPart("Capacitors");
if(hasTape(stack)) ResourceManager.laser_pistol.renderPart("Tape");
if(type == ItemRenderType.EQUIPPED) {
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[0];
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 2, 4.75);
GL11.glRotated(90, 0, 1, 0);
renderLaserFlash(shot, 150, 1.5D, hasEmerald(stack) ? 0x008000 : 0xff0000);
GL11.glTranslated(0, 0, -0.25);
renderLaserFlash(shot, 150, 0.75D, hasEmerald(stack) ? 0x80ff00 : 0xff8000);
GL11.glPopMatrix();
}
GL11.glShadeModel(GL11.GL_FLAT);
}

View File

@ -8,6 +8,7 @@ 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 ItemRenderLasrifle extends ItemRenderWeaponBase {
@ -120,7 +121,7 @@ public class ItemRenderLasrifle extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -134,6 +135,26 @@ public class ItemRenderLasrifle extends ItemRenderWeaponBase {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.lasrifle_mods_tex);
if(hasShotgun(stack)) ResourceManager.lasrifle_mods.renderPart("BarrelShotgun");
if(hasCapacitor(stack)) ResourceManager.lasrifle_mods.renderPart("UnderBarrel");
if(type == ItemRenderType.EQUIPPED) {
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[0];
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 1.5, 12);
GL11.glRotated(90, 0, 1, 0);
renderLaserFlash(shot, 150, 1.5D, 0xff0000);
GL11.glTranslated(0, 0, -0.25);
renderLaserFlash(shot, 150, 0.75D, 0xff8000);
GL11.glPopMatrix();
}
GL11.glShadeModel(GL11.GL_FLAT);
}

View File

@ -8,6 +8,7 @@ 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 ItemRenderLiberator extends ItemRenderWeaponBase {
@ -150,12 +151,34 @@ public class ItemRenderLiberator extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.liberator_tex);
ResourceManager.liberator.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0.5, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(1.5, 1.5, 1.5);
this.renderMuzzleFlash(shot, 75, 5);
GL11.glPopMatrix();
}
}
}

View File

@ -7,6 +7,7 @@ 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 ItemRenderM2 extends ItemRenderWeaponBase {
@ -102,13 +103,37 @@ public class ItemRenderM2 extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPushMatrix();
GL11.glRotated(180, 0, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.m2_tex);
ResourceManager.m2.renderAll();
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 1.625, 5);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -11,6 +11,7 @@ import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderMAS36 extends ItemRenderWeaponBase {
@ -178,7 +179,7 @@ public class ItemRenderMAS36 extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -190,6 +191,28 @@ public class ItemRenderMAS36 extends ItemRenderWeaponBase {
if(type != ItemRenderType.EQUIPPED) GL11.glTranslated(0, -1, -6);
if(hasBayonet(stack)) ResourceManager.mas36.renderPart("Bayonet");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 1, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderMuzzleFlash(shot, 75, 10);
GL11.glPopMatrix();
}
}
public boolean isScoped(ItemStack stack) {

View File

@ -9,6 +9,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -155,7 +156,7 @@ public class ItemRenderMaresleg extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
@ -163,11 +164,33 @@ public class ItemRenderMaresleg extends ItemRenderWeaponBase {
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
ResourceManager.maresleg.renderPart("Gun");
ResourceManager.maresleg.renderPart("Lever");
if(!getShort(stack)) {
boolean shortened = getShort(stack);
if(!shortened) {
ResourceManager.maresleg.renderPart("Stock");
ResourceManager.maresleg.renderPart("Barrel");
}
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 1, shortened ? 3.75 : 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 5);
GL11.glPopMatrix();
}
}
public boolean getShort(ItemStack stack) {

View File

@ -7,6 +7,7 @@ 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 ItemRenderMareslegAkimbo extends ItemRenderWeaponBase {
@ -202,9 +203,56 @@ public class ItemRenderMareslegAkimbo extends ItemRenderWeaponBase {
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void renderEquipped(ItemStack stack, Object... data) {
renderOther(stack, ItemRenderType.EQUIPPED);
//grumble grumble
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
double shotRand = 0;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[1];
shotRand = gun.shotRand;
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 1, 3.75);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 5);
GL11.glPopMatrix();
}
@Override
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase ent) {
renderOther(stack, ItemRenderType.EQUIPPED);
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, 1, 3.75);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 5);
GL11.glPopMatrix();
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.maresleg_tex);

View File

@ -8,6 +8,7 @@ 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;
import net.minecraft.util.ResourceLocation;
@ -120,7 +121,7 @@ public class ItemRenderMinigun extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -129,5 +130,34 @@ public class ItemRenderMinigun extends ItemRenderWeaponBase {
ResourceManager.minigun.renderPart("Grip");
ResourceManager.minigun.renderPart("Barrels");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0, 12);
GL11.glRotated(90, 0, 1, 0);
if(stack.getItem() == ModItems.gun_minigun_lacunae) {
renderLaserFlash(shot, 50, 1D, 0xff00ff);
GL11.glTranslated(0, 0, -0.25);
renderLaserFlash(shot, 50, 0.5D, 0xff0080);
} else {
GL11.glRotated(shotRand * 90, 1, 0, 0);
GL11.glScaled(1.5, 1.5, 1.5);
this.renderMuzzleFlash(shot, 75, 5);
}
GL11.glPopMatrix();
}
}
}

View File

@ -8,6 +8,7 @@ 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 ItemRenderMinigunDual extends ItemRenderWeaponBase {
@ -112,23 +113,64 @@ public class ItemRenderMinigunDual extends ItemRenderWeaponBase {
}
@Override
public void renderEquipped(ItemStack stack) {
public void renderEquipped(ItemStack stack, Object... data) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.minigun_dual_tex);
ResourceManager.minigun.renderPart("Gun");
ResourceManager.minigun.renderPart("Barrels");
GL11.glShadeModel(GL11.GL_FLAT);
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
double shotRand = 0;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[1];
shotRand = gun.shotRand;
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 0, 12);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(shotRand * 90, 1, 0, 0);
GL11.glScaled(1.5, 1.5, 1.5);
this.renderMuzzleFlash(shot, 75, 5);
GL11.glPopMatrix();
}
@Override
public void renderEquippedAkimbo(ItemStack stack) {
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase ent) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.minigun_dual_tex);
ResourceManager.minigun.renderPart("GunDual");
ResourceManager.minigun.renderPart("Barrels");
GL11.glShadeModel(GL11.GL_FLAT);
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, 0, 12);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(shotRand * 90, 1, 0, 0);
GL11.glScaled(1.5, 1.5, 1.5);
this.renderMuzzleFlash(shot, 75, 5);
GL11.glPopMatrix();
}
@Override
@ -172,7 +214,7 @@ public class ItemRenderMinigunDual extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);

View File

@ -11,6 +11,7 @@ import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
@ -141,7 +142,7 @@ public class ItemRenderMissileLauncher extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.missile_launcher_tex);
@ -153,5 +154,26 @@ public class ItemRenderMissileLauncher extends ItemRenderWeaponBase {
ResourceManager.missile_launcher.renderPart("Front");
if(gun.getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, null) > 0) ResourceManager.missile_launcher.renderPart("Missile");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
double shotRand = 0;
if(ent == Minecraft.getMinecraft().thePlayer) {
shot = gun.lastShot[0];
shotRand = gun.shotRand;
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 1, 6.75);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(shotRand * 90, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -10,6 +10,7 @@ import com.hbm.render.tileentity.RenderArcFurnace;
import com.hbm.util.ColorUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderNI4NI extends ItemRenderWeaponBase {
@ -144,7 +145,7 @@ public class ItemRenderNI4NI extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
@ -185,5 +186,27 @@ public class ItemRenderNI4NI extends ItemRenderWeaponBase {
GL11.glEnable(GL11.GL_TEXTURE_2D);
RenderArcFurnace.fullbright(false);
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0.75, 4);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.125, 0.125, 0.125);
this.renderLaserFlash(shot, 75, 7.5, 0xFFFFFF);
GL11.glPopMatrix();
}
}
}

View File

@ -8,6 +8,7 @@ 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 ItemRenderPanzerschreck extends ItemRenderWeaponBase {
@ -99,7 +100,7 @@ public class ItemRenderPanzerschreck extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -107,6 +108,28 @@ public class ItemRenderPanzerschreck extends ItemRenderWeaponBase {
ResourceManager.panzerschreck.renderPart("Tube");
if(hasShield(stack)) ResourceManager.panzerschreck.renderPart("Shield");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0, 6.5);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 150, 7.5);
GL11.glPopMatrix();
}
}
public boolean hasShield(ItemStack stack) {

View File

@ -7,6 +7,7 @@ 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 ItemRenderPepperbox extends ItemRenderWeaponBase {
@ -127,7 +128,7 @@ public class ItemRenderPepperbox extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
@ -138,5 +139,29 @@ public class ItemRenderPepperbox extends ItemRenderWeaponBase {
ResourceManager.pepperbox.renderPart("Hammer");
ResourceManager.pepperbox.renderPart("Trigger");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0.5, 7);
GL11.glScaled(0.5, 0.5, 0.5);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot);
GL11.glRotated(45, 1, 0, 0);
this.renderMuzzleFlash(shot);
GL11.glPopMatrix();
}
}
}

View File

@ -11,6 +11,7 @@ import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
@ -138,12 +139,34 @@ public class ItemRenderQuadro extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.quadro_tex);
ResourceManager.quadro.renderPart("Launcher");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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(); //TODO: adjust in third person, flash is too far forward/ large
GL11.glTranslated(0, 0.75, 2);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 150, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -11,6 +11,7 @@ import com.hbm.particle.SpentCasing;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderSPAS12 extends ItemRenderWeaponBase {
@ -131,7 +132,7 @@ public class ItemRenderSPAS12 extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glRotated(180, 0, 1, 0);
@ -140,5 +141,26 @@ public class ItemRenderSPAS12 extends ItemRenderWeaponBase {
ResourceManager.spas_12.renderPart("MainBody");
ResourceManager.spas_12.renderPart("PumpGrip");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 1.5, -11);
GL11.glRotated(-90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -7,6 +7,7 @@ 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 ItemRenderSTG77 extends ItemRenderWeaponBase {
@ -171,7 +172,7 @@ public class ItemRenderSTG77 extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -184,5 +185,27 @@ public class ItemRenderSTG77 extends ItemRenderWeaponBase {
ResourceManager.stg77.renderPart("Handle");
ResourceManager.stg77.renderPart("Breech");
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0, 7.5);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(0.25, 0.25, 0.25);
GL11.glRotated(-5 + shotRand * 10, 1, 0, 0);
this.renderGapFlash(shot);
GL11.glPopMatrix();
}
}
}

View File

@ -10,6 +10,7 @@ import com.hbm.util.BobMathUtil;
import com.hbm.util.Vec3NT;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@ -212,7 +213,7 @@ public class ItemRenderSexy extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -234,6 +235,27 @@ public class ItemRenderSexy extends ItemRenderWeaponBase {
renderShell(p * 17, p * -20, -90, true);
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 0, 8);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 150, 7.5);
GL11.glPopMatrix();
}
}
public static void renderShell(double x0, double x1, double y0, double y1, double rot0, double rot1, boolean shell, double interp) {

View File

@ -12,6 +12,7 @@ import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
@ -167,12 +168,34 @@ public class ItemRenderShredder extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
ResourceManager.shredder.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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, 1, 7.5);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(shotRand * 90, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
}

View File

@ -9,6 +9,7 @@ import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderStinger extends ItemRenderWeaponBase {
@ -127,7 +128,7 @@ public class ItemRenderStinger extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -135,5 +136,27 @@ public class ItemRenderStinger extends ItemRenderWeaponBase {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.stinger_tex);
ResourceManager.stinger.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
if(type == ItemRenderType.EQUIPPED) {
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.5, -10.3795);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
GL11.glScaled(0.75, 0.75, 0.75);
this.renderMuzzleFlash(shot, 150, 10);
GL11.glPopMatrix();
}
}
}

View File

@ -88,7 +88,7 @@ public class ItemRenderTau extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);

View File

@ -136,7 +136,7 @@ public class ItemRenderTeslaCannon extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.tesla_cannon_tex);

View File

@ -8,6 +8,7 @@ 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 ItemRenderUzi extends ItemRenderWeaponBase {
@ -154,7 +155,7 @@ public class ItemRenderUzi extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
boolean silenced = hasSilencer(stack, 0);
@ -174,6 +175,27 @@ public class ItemRenderUzi extends ItemRenderWeaponBase {
ResourceManager.uzi.renderPart("Magazine");
if(silenced) 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, 0.75, 8.5);
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, int cfg) {

View File

@ -8,6 +8,7 @@ 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 ItemRenderUziAkimbo extends ItemRenderWeaponBase {
@ -153,7 +154,7 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
}
@Override
public void renderEquipped(ItemStack stack) {
public void renderEquipped(ItemStack stack, Object... data) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack, 1) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
@ -162,12 +163,34 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
ResourceManager.uzi.renderPart("StockFront");
ResourceManager.uzi.renderPart("Slide");
ResourceManager.uzi.renderPart("Magazine");
if(hasSilencer(stack, 1)) ResourceManager.uzi.renderPart("Silencer");
boolean silenced = hasSilencer(stack, 1);
if(silenced) ResourceManager.uzi.renderPart("Silencer");
GL11.glShadeModel(GL11.GL_FLAT);
if(!silenced) {
EntityLivingBase ent = (EntityLivingBase) data[1]; //Entity is second obj. passed
long shot;
double shotRand = 0;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[1];
shotRand = gun.shotRand;
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 0.75, 8.5);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
@Override
public void renderEquippedAkimbo(ItemStack stack) {
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase ent) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack, 0) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
@ -176,8 +199,29 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
ResourceManager.uzi.renderPart("StockFront");
ResourceManager.uzi.renderPart("Slide");
ResourceManager.uzi.renderPart("Magazine");
if(hasSilencer(stack, 0)) ResourceManager.uzi.renderPart("Silencer");
boolean silenced = hasSilencer(stack, 0);
if(silenced) ResourceManager.uzi.renderPart("Silencer");
GL11.glShadeModel(GL11.GL_FLAT);
if(!silenced) {
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, 0.75, 8.5);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
@Override
@ -234,7 +278,7 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);

View File

@ -1,5 +1,6 @@
package com.hbm.render.item.weapon.sedna;
import java.util.HashMap;
import java.util.List;
import org.lwjgl.opengl.GL11;
@ -33,6 +34,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
public static final ResourceLocation laser_flash = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/laser_flash.png");
public static float interp;
public static HashMap<EntityLivingBase, Long> flashMap = new HashMap<EntityLivingBase, Long>();
public boolean isAkimbo() { return false; }
public boolean isLeftHanded() { return false; }
@ -46,7 +48,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION;
}
@SuppressWarnings("incomplete-switch") //shut the fuck up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
@ -55,15 +57,15 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
switch(type) {
case EQUIPPED_FIRST_PERSON: setupFirstPerson(item); renderFirstPerson(item); break;
case EQUIPPED:
if(isLeftHanded()) break; setupThirdPerson(item); renderEquipped(item); break;
if(isLeftHanded()) break; setupThirdPerson(item); renderEquipped(item, data); break;
case INVENTORY: setupInv(item); renderInv(item); break;
case ENTITY: setupEntity(item); renderEntity(item); break;
}
GL11.glPopMatrix();
}
public void renderEquipped(ItemStack stack) { renderOther(stack, ItemRenderType.EQUIPPED); }
public void renderEquippedAkimbo(ItemStack stack) { renderOther(stack, ItemRenderType.EQUIPPED); }
//entitylivingbase is second Object passed
public void renderEquipped(ItemStack stack, Object... data) { renderOther(stack, ItemRenderType.EQUIPPED, data); }
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase entity) { renderOther(stack, ItemRenderType.EQUIPPED); }
public void renderInv(ItemStack stack) { renderOther(stack, ItemRenderType.INVENTORY); }
public void renderEntity(ItemStack stack) { renderOther(stack, ItemRenderType.ENTITY); }
@ -277,7 +279,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
}
public abstract void renderFirstPerson(ItemStack stack);
public void renderOther(ItemStack stack, ItemRenderType type) { }
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) { }
public static void standardAimingTransform(ItemStack stack, double sX, double sY, double sZ, double aX, double aY, double aZ) {
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
@ -347,6 +349,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
double fire = (System.currentTimeMillis() - lastShot) / (double) flash;
@ -384,6 +387,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
GL11.glPopMatrix();
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
}
}
@ -395,6 +399,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
if(System.currentTimeMillis() - lastShot < flash) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
double fire = (System.currentTimeMillis() - lastShot) / (double) flash;
@ -433,6 +438,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
tess.draw();
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
}
}
@ -443,6 +449,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix();
double fire = (System.currentTimeMillis() - lastShot) / (double) flash;
@ -465,6 +472,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
GL11.glPopMatrix();
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
}
}
}

View File

@ -495,8 +495,4 @@ public class HFRWavefrontObject implements IModelCustomNamed {
public WavefrontObjVBO asVBO() {
return new WavefrontObjVBO(this);
}
public WavefrontObjDisplayList asDisplayList() {
return new WavefrontObjDisplayList(this);
}
}

View File

@ -1,106 +0,0 @@
package com.hbm.render.loader;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.Tessellator;
import net.minecraftforge.client.model.obj.GroupObject;
import net.minecraftforge.client.model.obj.WavefrontObject;
public class WavefrontObjDisplayList implements IModelCustomNamed {
public List<Pair<String, Integer>> nameToCallList = new ArrayList<>();
public WavefrontObjDisplayList(WavefrontObject obj) {
Tessellator tes = Tessellator.instance;
for(GroupObject g : obj.groupObjects){
int list = GL11.glGenLists(1);
GL11.glNewList(list, GL11.GL_COMPILE);
tes.startDrawing(g.glDrawingMode);
g.render(tes);
tes.draw();
GL11.glEndList();
nameToCallList.add(Pair.of(g.name, list));
}
}
public WavefrontObjDisplayList(HFRWavefrontObject obj) {
for(S_GroupObject g : obj.groupObjects){
int list = GL11.glGenLists(1);
GL11.glNewList(list, GL11.GL_COMPILE);
g.render();
GL11.glEndList();
nameToCallList.add(Pair.of(g.name, list));
}
}
public int getListForName(String name){
for(Pair<String, Integer> p : nameToCallList){
if(p.getLeft().equalsIgnoreCase(name)){
return p.getRight();
}
}
return 0;
}
@Override
public String getType() {
return "obj_list";
}
@Override
public void renderAll() {
for(Pair<String, Integer> p : nameToCallList)
GL11.glCallList(p.getRight());
}
@Override
public void renderOnly(String... groupNames) {
for(Pair<String, Integer> p : nameToCallList){
for(String name : groupNames){
if(p.getLeft().equalsIgnoreCase(name)){
GL11.glCallList(p.getRight());
break;
}
}
}
}
@Override
public void renderPart(String partName) {
for(Pair<String, Integer> p : nameToCallList){
if(p.getLeft().equalsIgnoreCase(partName)){
GL11.glCallList(p.getRight());
}
}
}
@Override
public void renderAllExcept(String... excludedGroupNames) {
for(Pair<String, Integer> p : nameToCallList){
boolean skip = false;
for(String name : excludedGroupNames){
if(p.getLeft().equalsIgnoreCase(name)){
skip = true;
break;
}
}
if(!skip){
GL11.glCallList(p.getRight());
}
}
}
@Override
public List<String> getPartNames() {
List<String> names = new ArrayList<String>();
for(Pair<String, Integer> data : nameToCallList) {
names.add(data.getLeft());
}
return names;
}
}

View File

@ -446,20 +446,28 @@ public class RenderBobble extends TileEntitySpecialRenderer {
break;
case BOB:
GL11.glShadeModel(GL11.GL_SMOOTH);
this.bindTexture(ResourceManager.mini_nuke_tex);
GL11.glScaled(0.5, 0.5, 0.5);
GL11.glPushMatrix();
GL11.glTranslated(0.75, 1, 0.9);
for(int i = 0; i < 3; i++) {
ResourceManager.projectiles.renderPart("MiniNuke");
GL11.glTranslated(-0.75, 0, 0);
GL11.glTranslatef(0, 0.6875F, 0.625F);
GL11.glRotated(-90, 1, 0, 0);
GL11.glScaled(0.125, 0.125, 0.125);
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.fatman_mininuke_tex);
GL11.glTranslatef(-6, 0, 0);
for(int i = -1; i <= 1; i++) {
GL11.glTranslatef(3, 0, 0);
ResourceManager.fatman.renderPart("MiniNuke");
}
GL11.glPopMatrix();
this.bindTexture(ResourceManager.mini_mirv_tex);
GL11.glTranslated(0, 0.75, -0.9);
GL11.glPushMatrix();
GL11.glTranslatef(0.25F, 0.3125F, -0.5F);
GL11.glRotated(-90, 1, 0, 0);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90, 1, 0, 0);
ResourceManager.projectiles.renderPart("MiniMIRV");
GL11.glScaled(0.1, 0.1, 0.1);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.double_barrel_sacred_dragon_tex);
ResourceManager.double_barrel.renderPart("Stock");
ResourceManager.double_barrel.renderPart("BarrelShort");
ResourceManager.double_barrel.renderPart("Buckle");
ResourceManager.double_barrel.renderPart("Lever");
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
break;
case VAER:

View File

@ -118,118 +118,6 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
ResourceManager.duchessgambit.renderAll();
}
if(b == ModBlocks.sat_radar) {
GL11.glRotatef(180, 0F, 0F, 1F);
GL11.glTranslatef(0, -1.5F, 0);
GL11.glRotated(90, 0, 1, 0);
switch(tileentity.getBlockMetadata()) {
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glEnable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.sat_base_tex);
ResourceManager.sat_base.renderAll();
bindTexture(ResourceManager.sat_radar_tex);
ResourceManager.sat_radar.renderAll();
}
if(b == ModBlocks.sat_resonator) {
GL11.glRotatef(180, 0F, 0F, 1F);
GL11.glTranslatef(0, -1.5F, 0);
GL11.glRotated(90, 0, 1, 0);
switch(tileentity.getBlockMetadata()) {
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glEnable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.sat_base_tex);
ResourceManager.sat_base.renderAll();
bindTexture(ResourceManager.sat_resonator_tex);
ResourceManager.sat_resonator.renderAll();
}
if(b == ModBlocks.sat_scanner) {
GL11.glRotatef(180, 0F, 0F, 1F);
GL11.glTranslatef(0, -1.5F, 0);
GL11.glRotated(90, 0, 1, 0);
switch(tileentity.getBlockMetadata()) {
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glEnable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.sat_base_tex);
ResourceManager.sat_base.renderAll();
bindTexture(ResourceManager.sat_scanner_tex);
ResourceManager.sat_scanner.renderAll();
}
if(b == ModBlocks.sat_mapper) {
GL11.glRotatef(180, 0F, 0F, 1F);
GL11.glTranslatef(0, -1.5F, 0);
GL11.glRotated(90, 0, 1, 0);
switch(tileentity.getBlockMetadata()) {
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glEnable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.sat_base_tex);
ResourceManager.sat_base.renderAll();
bindTexture(ResourceManager.sat_mapper_tex);
ResourceManager.sat_mapper.renderAll();
}
if(b == ModBlocks.sat_laser) {
GL11.glRotatef(180, 0F, 0F, 1F);
GL11.glTranslatef(0, -1.5F, 0);
GL11.glRotated(90, 0, 1, 0);
switch(tileentity.getBlockMetadata()) {
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glEnable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.sat_base_tex);
ResourceManager.sat_base.renderAll();
bindTexture(ResourceManager.sat_laser_tex);
ResourceManager.sat_laser.renderAll();
}
if(b == ModBlocks.sat_foeq) {
GL11.glRotatef(180, 0F, 0F, 1F);
GL11.glTranslatef(0, -1.5F, 0);
GL11.glRotated(90, 0, 1, 0);
switch(tileentity.getBlockMetadata()) {
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glEnable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.sat_foeq_tex);
ResourceManager.sat_foeq.renderAll();
}
if(b == ModBlocks.sat_dock) {
GL11.glRotatef(180, 0F, 0F, 1F);
GL11.glTranslatef(0, -1.5F, 0);

View File

@ -11,6 +11,7 @@ import com.hbm.animloader.AnimationWrapper.EndResult;
import com.hbm.animloader.AnimationWrapper.EndType;
import com.hbm.blocks.BlockDummyable;
import com.hbm.render.loader.IModelCustomNamed;
import com.hbm.render.tileentity.door.IRenderDoors;
import com.hbm.tileentity.DoorDecl;
import com.hbm.tileentity.TileEntityDoorGeneric;
@ -32,86 +33,97 @@ public class RenderDoorGeneric extends TileEntitySpecialRenderer {
TileEntityDoorGeneric te = (TileEntityDoorGeneric) tile;
if(buf == null){
buf = GLAllocation.createDirectByteBuffer(8*4).asDoubleBuffer();
}
if(buf == null) buf = GLAllocation.createDirectByteBuffer(8*4).asDoubleBuffer();
DoorDecl door = te.getDoorType();
GL11.glPushMatrix();
GL11.glTranslated(x+0.5, y, z+0.5);
GL11.glTranslated(x + 0.5, y, z + 0.5);
switch(te.getBlockMetadata() - BlockDummyable.offset) {
case 2: GL11.glRotatef(0+90, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(90+90, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(180+90, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(270+90, 0F, 1F, 0F); break;
}
door.doOffsetTransform();
double[][] clip = door.getClippingPlanes();
for(int i = 0; i < clip.length; i ++){
GL11.glEnable(GL11.GL_CLIP_PLANE0+i);
buf.put(clip[i]);
buf.rewind();
GL11.glClipPlane(GL11.GL_CLIP_PLANE0+i, buf);
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_LIGHTING);
IRenderDoors sednaRenderer = door.getSEDNARenderer();
AnimatedModel animModel = door.getAnimatedModel();
if(animModel != null){
Animation anim = door.getAnim();
bindTexture(door.getTextureForPart(te.getSkinIndex(), ""));
long time = System.currentTimeMillis();
long startTime = te.state > 1 ? te.animStartTime : time;
boolean reverse = te.state == 1 || te.state == 2;
AnimationWrapper w = new AnimationWrapper(startTime, anim).onEnd(new EndResult(EndType.STAY));
if(reverse)
w.reverse();
animModel.controller.setAnim(w);
animModel.renderAnimated(System.currentTimeMillis());
} else {
IModelCustomNamed model = door.getModel();
if(sednaRenderer != null) {
long ms = System.currentTimeMillis()-te.animStartTime;
float openTicks = MathHelper.clamp_float(te.state == 2 || te.state == 0 ? door.timeToOpen()*50-ms : ms, 0, door.timeToOpen()*50)*0.02F;
for(String partName : model.getPartNames()) {
if(!door.doesRender(partName, false))
continue;
GL11.glPushMatrix();
{
bindTexture(door.getTextureForPart(te.getSkinIndex(), partName));
doPartTransform(door, partName, openTicks, false);
model.renderPart(partName);
for(String innerPartName : door.getChildren(partName)) {
if(!door.doesRender(innerPartName, true))
continue;
GL11.glPushMatrix();
{
bindTexture(door.getTextureForPart(te.getSkinIndex(), innerPartName));
doPartTransform(door, innerPartName, openTicks, true);
model.renderPart(innerPartName);
}
GL11.glPopMatrix();
}
}
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
sednaRenderer.render(te, buf);
GL11.glShadeModel(GL11.GL_FLAT);
} else {
door.doOffsetTransform();
double[][] clip = door.getClippingPlanes();
for(int i = 0; i < clip.length; i ++){
GL11.glEnable(GL11.GL_CLIP_PLANE0+i);
buf.put(clip[i]);
buf.rewind();
GL11.glClipPlane(GL11.GL_CLIP_PLANE0+i, buf);
}
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_LIGHTING);
AnimatedModel animModel = door.getAnimatedModel();
if(animModel != null){
Animation anim = door.getAnim();
bindTexture(door.getTextureForPart(te.getSkinIndex(), ""));
long time = System.currentTimeMillis();
long startTime = te.state > 1 ? te.animStartTime : time;
boolean reverse = te.state == 1 || te.state == 2;
AnimationWrapper w = new AnimationWrapper(startTime, anim).onEnd(new EndResult(EndType.STAY));
if(reverse)
w.reverse();
animModel.controller.setAnim(w);
animModel.renderAnimated(System.currentTimeMillis());
} else {
IModelCustomNamed model = door.getModel();
long ms = System.currentTimeMillis()-te.animStartTime;
float openTicks = MathHelper.clamp_float(te.state == 2 || te.state == 0 ? door.timeToOpen()*50-ms : ms, 0, door.timeToOpen()*50)*0.02F;
for(String partName : model.getPartNames()) {
if(!door.doesRender(partName, false))
continue;
GL11.glPushMatrix();
{
bindTexture(door.getTextureForPart(te.getSkinIndex(), partName));
doPartTransform(door, partName, openTicks, false);
model.renderPart(partName);
for(String innerPartName : door.getChildren(partName)) {
if(!door.doesRender(innerPartName, true))
continue;
GL11.glPushMatrix();
{
bindTexture(door.getTextureForPart(te.getSkinIndex(), innerPartName));
doPartTransform(door, innerPartName, openTicks, true);
model.renderPart(innerPartName);
}
GL11.glPopMatrix();
}
}
GL11.glPopMatrix();
}
}
for(int i = 0; i < clip.length; i ++){
GL11.glDisable(GL11.GL_CLIP_PLANE0+i);
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glShadeModel(GL11.GL_FLAT);
}
for(int i = 0; i < clip.length; i ++){
GL11.glDisable(GL11.GL_CLIP_PLANE0+i);
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
@ -120,12 +132,9 @@ public class RenderDoorGeneric extends TileEntitySpecialRenderer {
door.getOrigin(name, orig);
door.getRotation(name, openTicks, rot);
GL11.glTranslated(orig[0], orig[1], orig[2]);
if(rot[0] != 0)
GL11.glRotated(rot[0], 1, 0, 0);
if(rot[1] != 0)
GL11.glRotated(rot[1], 0, 1, 0);
if(rot[2] != 0)
GL11.glRotated(rot[2], 0, 0, 1);
if(rot[0] != 0) GL11.glRotated(rot[0], 1, 0, 0);
if(rot[1] != 0) GL11.glRotated(rot[1], 0, 1, 0);
if(rot[2] != 0) GL11.glRotated(rot[2], 0, 0, 1);
GL11.glTranslated(-orig[0]+tran[0], -orig[1]+tran[1], -orig[2]+tran[2]);
}
}

View File

@ -31,9 +31,11 @@ public class RenderPlushie extends TileEntitySpecialRenderer implements IItemRen
public static final IModelCustom yomiModel = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/trinkets/yomi.obj"), false).asVBO();
public static final IModelCustom hundunModel = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/trinkets/hundun.obj"), false).asVBO();
public static final IModelCustom dergModel = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/trinkets/derg.obj"), false).asVBO();
public static final ResourceLocation yomiTex = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/yomi.png");
public static final ResourceLocation numbernineTex = new ResourceLocation(RefStrings.MODID, "textures/models/horse/numbernine.png");
public static final ResourceLocation hundunTex = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/hundun.png");
public static final ResourceLocation dergTex = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/derg.png");
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
@ -54,13 +56,14 @@ public class RenderPlushie extends TileEntitySpecialRenderer implements IItemRen
case YOMI: GL11.glScaled(0.5, 0.5, 0.5); break;
case NUMBERNINE: GL11.glScaled(0.75, 0.75, 0.75); break;
case HUNDUN: GL11.glScaled(1, 1, 1); break;
case DERG: break;
}
renderPlushie(te.type);
renderPlushie(te.type, te.squishTimer > 0);
GL11.glPopMatrix();
}
public static void renderPlushie(PlushieType type) {
public static void renderPlushie(PlushieType type, boolean squish) {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
@ -114,6 +117,11 @@ public class RenderPlushie extends TileEntitySpecialRenderer implements IItemRen
Minecraft.getMinecraft().getTextureManager().bindTexture(hundunTex);
hundunModel.renderPart("goober_posed");
break;
case DERG:
Minecraft.getMinecraft().getTextureManager().bindTexture(dergTex);
dergModel.renderPart("Derg");
dergModel.renderPart(squish ? "Blep" : "ColonThree");
break;
}
}
@ -139,8 +147,9 @@ public class RenderPlushie extends TileEntitySpecialRenderer implements IItemRen
case YOMI: GL11.glScaled(1.25, 1.25, 1.25); break;
case NUMBERNINE: GL11.glTranslated(0, 0.25, 0.25); GL11.glScaled(1.25, 1.25, 1.25); break;
case HUNDUN: GL11.glTranslated(0.5, 0.5, 0); GL11.glScaled(1.25, 1.25, 1.25); break;
case DERG: GL11.glScaled(1.5, 1.5, 1.5); break;
}
renderPlushie(type);
renderPlushie(type, false);
}};
}
}

View File

@ -0,0 +1,40 @@
package com.hbm.render.tileentity.door;
import java.nio.DoubleBuffer;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.Animation;
import com.hbm.tileentity.TileEntityDoorGeneric;
import com.hbm.util.Clock;
public interface IRenderDoors {
public void render(TileEntityDoorGeneric door, DoubleBuffer buf);
public static double[] getRelevantTransformation(String bus, Animation anim) {
if(anim != null) {
BusAnimation buses = anim.animation;
int millis = (int)(Clock.get_ms() - anim.startMillis);
BusAnimationSequence seq = buses.getBus(bus);
if(seq != null) {
double[] trans = seq.getTransformation(millis);
if(trans != null)
return trans;
}
}
return new double[] {
0, 0, 0, // position
0, 0, 0, // rotation
1, 1, 1, // scale
0, 0, 0, // offset
0, 1, 2, // XYZ order
};
}
}

View File

@ -0,0 +1,56 @@
package com.hbm.render.tileentity.door;
import java.nio.DoubleBuffer;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.TileEntityDoorGeneric;
import net.minecraft.client.Minecraft;
import net.minecraft.util.MathHelper;
public class RenderAirlockDoor implements IRenderDoors {
public static final RenderAirlockDoor INSTANCE = new RenderAirlockDoor();
@Override
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_airlock_door_tex);
double maxOpen = 1.5;
double open = 0;
if(door.state == door.STATE_OPEN) open = maxOpen;
if(door.currentAnimation != null) {
open = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxOpen;
}
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glTranslated(0, 0, 0.5);
ResourceManager.pheo_airlock_door.renderPart("Frame");
GL11.glEnable(GL11.GL_CLIP_PLANE0);
buf.put(new double[] { 0.0, 0.0, 1, 1.999 }); buf.rewind();
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, buf);
GL11.glEnable(GL11.GL_CLIP_PLANE1);
buf.put(new double[] { 0.0, 0.0, -1, 1.999 }); buf.rewind();
GL11.glClipPlane(GL11.GL_CLIP_PLANE1, buf);
GL11.glPushMatrix();
GL11.glTranslated(0, 0, MathHelper.clamp_double(open, 0, maxOpen));
ResourceManager.pheo_airlock_door.renderPart("Left");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, -MathHelper.clamp_double(open, 0, maxOpen));
ResourceManager.pheo_airlock_door.renderPart("Right");
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_CLIP_PLANE0);
GL11.glDisable(GL11.GL_CLIP_PLANE1);
}
}

View File

@ -0,0 +1,36 @@
package com.hbm.render.tileentity.door;
import java.nio.DoubleBuffer;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.TileEntityDoorGeneric;
import net.minecraft.client.Minecraft;
import net.minecraft.util.MathHelper;
public class RenderFireDoor implements IRenderDoors {
public static final RenderFireDoor INSTANCE = new RenderFireDoor();
@Override
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_fire_door_tex);
double maxRaise = 2.75;
double raise = 0;
if(door.state == door.STATE_OPEN) raise = maxRaise;
if(door.currentAnimation != null) {
raise = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxRaise;
}
GL11.glRotated(90, 0, 1, 0);
GL11.glTranslated(-0.5, 0, 0);
ResourceManager.pheo_fire_door.renderPart("Frame");
GL11.glTranslated(0, MathHelper.clamp_double(raise, 0, maxRaise), 0);
ResourceManager.pheo_fire_door.renderPart("Door");
}
}

Some files were not shown because too many files have changed in this diff Show More