mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-03-16 06:35:35 +00:00
Compare commits
75 Commits
6bb6b5426c
...
22bd62f789
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22bd62f789 | ||
|
|
75946a0054 | ||
|
|
29bec0725b | ||
|
|
57db8cc9ab | ||
|
|
0e687e0ff5 | ||
|
|
3361d0a35e | ||
|
|
fcf016b0f3 | ||
|
|
c70cb9aaed | ||
|
|
eba8484a98 | ||
|
|
3a580a6b41 | ||
|
|
67bffe1dab | ||
|
|
d842871ba8 | ||
|
|
720fb07b0f | ||
|
|
f53d7f07e0 | ||
|
|
ecab0fbcb3 | ||
|
|
f9311eff8d | ||
|
|
55f15a274d | ||
|
|
068c3a8b7d | ||
|
|
1ad65345b0 | ||
|
|
4e0bce27df | ||
|
|
27664b36b0 | ||
|
|
3728adfe13 | ||
|
|
bcbc048136 | ||
|
|
9d78cc465c | ||
|
|
1bc33bbcf9 | ||
|
|
a2c06ce752 | ||
|
|
304720b57f | ||
|
|
eb30a5ef3b | ||
|
|
ea50cd5c66 | ||
|
|
24cd4af867 | ||
|
|
171317c9f5 | ||
|
|
2e4b2c2d30 | ||
|
|
4fb369e4e3 | ||
|
|
6f9e8c9542 | ||
|
|
b0b1b4c0af | ||
|
|
44edbfe2f3 | ||
|
|
b7d54ffb06 | ||
|
|
eb1773f7fc | ||
|
|
d1c1820c1a | ||
|
|
477c038e70 | ||
|
|
e7d632bdbc | ||
|
|
a288d4b1bf | ||
|
|
222781da42 | ||
|
|
a5685f4d16 | ||
|
|
081de229fd | ||
|
|
b52107b2c3 | ||
|
|
c0b6089f70 | ||
|
|
52c1c0f20a | ||
|
|
dadaa752ff | ||
|
|
21cd47d063 | ||
|
|
efbc676765 | ||
|
|
424fa4fcf6 | ||
|
|
e55f9fadf6 | ||
|
|
e962479af5 | ||
|
|
2a0d887526 | ||
|
|
84e718cd97 | ||
|
|
38e58117da | ||
|
|
97230f1b74 | ||
|
|
aa4942ea68 | ||
|
|
8087582519 | ||
|
|
d13cfdece4 | ||
|
|
14610ef919 | ||
|
|
a56397c8c7 | ||
|
|
aa40b57297 | ||
|
|
843d3ea6cd | ||
|
|
afeaa9e73c | ||
|
|
b358727425 | ||
|
|
6939944868 | ||
|
|
1a83ddea80 | ||
|
|
5a4c2f2183 | ||
|
|
dc55ec75cc | ||
|
|
cb5ea3929b | ||
|
|
a2e0cfb2ee | ||
|
|
17f76d6dc1 | ||
|
|
a4e5b177b7 |
51
changelog
51
changelog
@ -1,27 +1,30 @@
|
||||
## Added
|
||||
* Target pistol
|
||||
* Weapon steel tier pistol that holds 15 rounds and shoots .22 LR
|
||||
* Accepts silencers
|
||||
|
||||
## Changed
|
||||
* 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
|
||||
* Reworked the industrial turbine
|
||||
* New model and texture
|
||||
* Removed the GUI, it now uses the same in-world compressor toggle as the leviathan turbine
|
||||
* No longer has a volatile power buffer, power isn't buffered at all anymore, similar to steam engines and MHD turbines
|
||||
* Steam capacity changes based on compression level, the ratio for turbine cascades is now 1:1:1:1
|
||||
* Comes with a flywheel, energy output slowly ramps up as steam is supplied and slowly goes down as steam cuts out
|
||||
* Leviathan turbines no longer have a power buffer
|
||||
* Updated russian and chinese localization
|
||||
* The PWR can now be controlled via RoR
|
||||
* The RoR value reader can read core and hull heat as well as fuel depletion in percent
|
||||
* The RoR controller can set the control rod level in percent as well as jetison all loaded fuel
|
||||
* Having 528, expensive or rampant mode enabled now displays a badge in the top left corner, showing that it is enabled
|
||||
* Badges can be disabled with the `BADGES_HUD` value of `/ntmclient`
|
||||
* The badge only shows up if the "true" configuration is used, 528 requires default settings, expensive requires the precision assembler config to not be modified and rampant needs most of the default settings enabled
|
||||
* If all three modes are enabled, the "328 mode" badge also appears
|
||||
* Removed toothpicks, as they haven't been used in recipes for well over a year
|
||||
* Cleaned up a ton of unused assets
|
||||
|
||||
# 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
|
||||
* Fixed proxy tiles that do not use electricity at all visually connecting to cables
|
||||
* Fixed missing texture for canned horse slime
|
||||
* Fixed incorrect ore dictionary key used by enriched naquadah watz pellet recipe
|
||||
* Fixed out of bounds light level for the RTG blast furnace
|
||||
* Fixed the recipe configs now allowing NBT data for output items, rendering the precision assembler and annihilator configs useless
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5572
|
||||
mod_build_number=5593
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
|
||||
@ -109,7 +109,7 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
// cannot be done accidentally, and is definitely preferable to multiblocks
|
||||
// just vanishing when their chunks are unloaded in an unlucky way.
|
||||
if(b != this && world.checkChunksExist(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1)) {
|
||||
if (isLegacyMonoblock(world, x, y, z)) {
|
||||
if(isLegacyMonoblock(world, x, y, z)) {
|
||||
fixLegacyMonoblock(world, x, y, z);
|
||||
} else {
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
@ -345,6 +345,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block lightstone;
|
||||
public static Block brick_forgotten;
|
||||
public static Block brick_forgotten_lock;
|
||||
|
||||
public static Block concrete_slab;
|
||||
public static Block concrete_double_slab;
|
||||
@ -846,7 +847,6 @@ public class ModBlocks {
|
||||
public static Block barrel_antimatter;
|
||||
|
||||
public static Block machine_transformer;
|
||||
public static Block machine_transformer_dnt;
|
||||
|
||||
public static Block machine_solar_boiler;
|
||||
public static Block solar_mirror;
|
||||
@ -968,7 +968,14 @@ public class ModBlocks {
|
||||
|
||||
public static Block machine_steam_engine;
|
||||
public static Block machine_turbine;
|
||||
public static Block machine_large_turbine;
|
||||
@Deprecated public static Block machine_large_turbine;
|
||||
public static Block machine_industrial_turbine;
|
||||
public static Block machine_chungus;
|
||||
|
||||
public static Block machine_condenser;
|
||||
public static Block machine_tower_small;
|
||||
public static Block machine_tower_large;
|
||||
public static Block machine_condenser_powered;
|
||||
|
||||
public static Block machine_deuterium_extractor;
|
||||
public static Block machine_deuterium_tower;
|
||||
@ -979,12 +986,6 @@ public class ModBlocks {
|
||||
public static Block machine_compressor;
|
||||
public static Block machine_compressor_compact;
|
||||
|
||||
public static Block machine_chungus;
|
||||
public static Block machine_condenser;
|
||||
public static Block machine_tower_small;
|
||||
public static Block machine_tower_large;
|
||||
public static Block machine_condenser_powered;
|
||||
|
||||
public static Block machine_electrolyser;
|
||||
|
||||
public static Block machine_excavator;
|
||||
@ -1192,17 +1193,8 @@ public class ModBlocks {
|
||||
public static Block corium_block;
|
||||
public static Fluid corium_fluid;
|
||||
public static final Material fluidcorium = (new MaterialLiquid(MapColor.brownColor) {
|
||||
|
||||
@Override
|
||||
public boolean blocksMovement() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Material setImmovableMobility() { //override access modifier
|
||||
return super.setImmovableMobility();
|
||||
}
|
||||
|
||||
@Override public boolean blocksMovement() { return true; }
|
||||
@Override public Material setImmovableMobility() { return super.setImmovableMobility(); } //override access modifier
|
||||
}.setImmovableMobility());
|
||||
|
||||
public static Block volcanic_lava_block;
|
||||
@ -1218,7 +1210,6 @@ public class ModBlocks {
|
||||
public static Block volcano_core;
|
||||
public static Block volcano_rad_core;
|
||||
|
||||
public static Block dummy_block_vault;
|
||||
public static Block dummy_block_blast;
|
||||
public static Block dummy_plate_compact_launcher;
|
||||
public static Block dummy_port_compact_launcher;
|
||||
@ -1542,6 +1533,7 @@ public class ModBlocks {
|
||||
|
||||
lightstone = new BlockLightstone(Material.rock, LightstoneType.class, true, true).setBlockName("lightstone").setCreativeTab(MainRegistry.blockTab).setHardness(2F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":lightstone");
|
||||
brick_forgotten = new BlockPillar(Material.rock, RefStrings.MODID + ":brick_forgotten_top").setBlockName("brick_forgotten").setBlockUnbreakable().setResistance(666_666F).setBlockTextureName(RefStrings.MODID + ":brick_forgotten");
|
||||
brick_forgotten_lock = new BlockForgottenLock(Material.rock, RefStrings.MODID + ":brick_forgotten_top").setBlockName("brick_forgotten_lock").setBlockUnbreakable().setResistance(666_666F).setBlockTextureName(RefStrings.MODID + ":brick_forgotten_lock");
|
||||
|
||||
concrete_slab = new BlockMultiSlab(null, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete, asphalt).setBlockName("concrete_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
concrete_double_slab = new BlockMultiSlab(concrete_slab, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete, asphalt).setBlockName("concrete_double_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
@ -1799,7 +1791,7 @@ public class ModBlocks {
|
||||
machine_difurnace_on = new MachineDiFurnace(true).setBlockName("machine_difurnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_difurnace_extension = new MachineDiFurnaceExtension().setBlockName("machine_difurnace_extension").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_difurnace_rtg_off = new MachineDiFurnaceRTG(false).setBlockName("machine_difurnace_rtg_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_difurnace_rtg_on = new MachineDiFurnaceRTG(true).setBlockName("machine_difurnace_rtg_on").setHardness(5.0F).setResistance(10.0F).setLightLevel(2.0F).setCreativeTab(null);
|
||||
machine_difurnace_rtg_on = new MachineDiFurnaceRTG(true).setBlockName("machine_difurnace_rtg_on").setHardness(5.0F).setResistance(10.0F).setLightLevel(1.0F).setCreativeTab(null);
|
||||
|
||||
machine_centrifuge = new MachineCentrifuge(Material.iron).setBlockName("machine_centrifuge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_gascent = new MachineGasCent(Material.iron).setBlockName("machine_gascent").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -1978,8 +1970,7 @@ public class ModBlocks {
|
||||
barrel_tcalloy = new BlockFluidBarrel(Material.iron, 24000).setBlockName("barrel_tcalloy").setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(5.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":barrel_tcalloy");
|
||||
barrel_antimatter = new BlockFluidBarrel(Material.iron, 16000).setBlockName("barrel_antimatter").setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(5.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":barrel_antimatter");
|
||||
|
||||
machine_transformer = new MachineTransformer(Material.iron, 10000L, 1).setBlockName("machine_transformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_transformer_iron");
|
||||
machine_transformer_dnt = new MachineTransformer(Material.iron, 1000000000000000L, 1).setBlockName("machine_transformer_dnt").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_transformer");
|
||||
machine_transformer = new MachineTransformer(Material.iron).setBlockName("machine_transformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_transformer_iron");
|
||||
|
||||
machine_satlinker = new MachineSatLinker(Material.iron).setBlockName("machine_satlinker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":machine_satlinker_side");
|
||||
machine_keyforge = new MachineKeyForge(Material.iron).setBlockName("machine_keyforge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":machine_keyforge_side");
|
||||
@ -2070,7 +2061,7 @@ public class ModBlocks {
|
||||
seal_controller = new BlockSeal(Material.iron).setBlockName("seal_controller").setHardness(10.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
seal_hatch = new BlockHatch(Material.iron).setBlockName("seal_hatch").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":seal_hatch_3");
|
||||
|
||||
vault_door = new VaultDoor(Material.iron).setBlockName("vault_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vault_door");
|
||||
vault_door = new BlockDoorGeneric(Material.iron, DoorDecl.VAULT_DOOR).setBlockName("vault_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vault_door");
|
||||
blast_door = new BlastDoor(Material.iron).setBlockName("blast_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":blast_door");
|
||||
|
||||
sliding_blast_door = new BlockDoorGeneric(Material.iron, DoorDecl.SLIDE_DOOR).setBlockName("sliding_blast_door").setHardness(10.0F).setResistance(750.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":sliding_blast_door");
|
||||
@ -2254,7 +2245,8 @@ public class ModBlocks {
|
||||
machine_steam_engine = new MachineSteamEngine().setBlockName("machine_steam_engine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_turbine = new MachineTurbine(Material.iron).setBlockName("machine_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbine");
|
||||
machine_large_turbine = new MachineLargeTurbine(Material.iron).setBlockName("machine_large_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_large_turbine");
|
||||
machine_chungus = new MachineChungus(Material.iron).setBlockName("machine_chungus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_chungus");
|
||||
machine_industrial_turbine = new MachineIndustrialTurbine().setBlockName("machine_industrial_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_chungus = new MachineChungus().setBlockName("machine_chungus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_condenser = new MachineCondenser(Material.iron).setBlockName("machine_condenser").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":condenser");
|
||||
machine_tower_small = new MachineTowerSmall(Material.iron).setBlockName("machine_tower_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
machine_tower_large = new MachineTowerLarge(Material.iron).setBlockName("machine_tower_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
@ -2373,7 +2365,6 @@ public class ModBlocks {
|
||||
Fluid liquidConcrete = new GenericFluid("concrete_liquid").setViscosity(2000);
|
||||
concrete_liquid = new GenericFiniteFluid(liquidConcrete, Material.rock, "concrete_liquid", "concrete_liquid_flowing").setQuantaPerBlock(4).setBlockName("concrete_liquid").setResistance(500F);
|
||||
|
||||
dummy_block_vault = new DummyBlockVault(Material.iron).setBlockName("dummy_block_vault").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_blast = new DummyBlockBlast(Material.iron).setBlockName("dummy_block_blast").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_plate_compact_launcher = new DummyBlockMachine(Material.iron, compact_launcher, false).setBounds(0, 16, 0, 16, 16, 16).setBlockName("dummy_plate_compact_launcher").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_compact_launcher = new DummyBlockMachine(Material.iron, compact_launcher, true).setBlockName("dummy_port_compact_launcher").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2713,6 +2704,7 @@ public class ModBlocks {
|
||||
register(stones_double_slab, ItemModSlab.class);
|
||||
|
||||
register(brick_forgotten);
|
||||
register(brick_forgotten_lock);
|
||||
|
||||
GameRegistry.registerBlock(concrete_slab, ItemModSlab.class, concrete_slab.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(concrete_double_slab, ItemModSlab.class, concrete_double_slab.getUnlocalizedName());
|
||||
@ -3266,7 +3258,6 @@ public class ModBlocks {
|
||||
register(capacitor_tantalium);
|
||||
register(capacitor_schrabidate);
|
||||
GameRegistry.registerBlock(machine_transformer, machine_transformer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_transformer_dnt, machine_transformer_dnt.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_converter_he_rf, machine_converter_he_rf.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_converter_rf_he, machine_converter_rf_he.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_electric_furnace_off, machine_electric_furnace_off.getUnlocalizedName());
|
||||
@ -3293,6 +3284,7 @@ public class ModBlocks {
|
||||
register(machine_steam_engine);
|
||||
register(machine_turbine);
|
||||
register(machine_large_turbine);
|
||||
register(machine_industrial_turbine);
|
||||
register(machine_chungus);
|
||||
GameRegistry.registerBlock(machine_condenser, machine_condenser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_tower_small, machine_tower_small.getUnlocalizedName());
|
||||
@ -3300,8 +3292,8 @@ public class ModBlocks {
|
||||
register(machine_condenser_powered);
|
||||
GameRegistry.registerBlock(machine_deuterium_extractor, machine_deuterium_extractor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_deuterium_tower, machine_deuterium_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_solidifier, ItemBlockBase.class, machine_solidifier.getUnlocalizedName());
|
||||
register(machine_liquefactor);
|
||||
register(machine_solidifier);
|
||||
register(machine_intake);
|
||||
register(machine_compressor);
|
||||
register(machine_compressor_compact);
|
||||
@ -3499,7 +3491,6 @@ public class ModBlocks {
|
||||
//GameRegistry.registerBlock(concrete_liquid, concrete_liquid.getUnlocalizedName());
|
||||
|
||||
//Multiblock Dummy Blocks
|
||||
GameRegistry.registerBlock(dummy_block_vault, dummy_block_vault.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_blast, dummy_block_blast.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_plate_compact_launcher, dummy_plate_compact_launcher.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_compact_launcher, dummy_port_compact_launcher.getUnlocalizedName());
|
||||
|
||||
@ -54,21 +54,24 @@ public class BlockCrashedBomb extends BlockEnumMulti implements ITileEntityProvi
|
||||
|
||||
EnumDudType type = EnumUtil.grabEnumSafely(EnumDudType.class, world.getBlockMetadata(x, y, z));
|
||||
|
||||
//TODO: make this less scummy
|
||||
if(type == type.BALEFIRE) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.egg_balefire_shard)));
|
||||
dropItems(world, x, y, z,
|
||||
new ItemStack(ModItems.egg_balefire_shard));
|
||||
}
|
||||
if(type == type.CONVENTIONAL) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ball_tnt, 16)));
|
||||
dropItems(world, x, y, z,
|
||||
new ItemStack(ModItems.ball_tnt, 16));
|
||||
}
|
||||
if(type == type.NUKE) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ball_tnt, 8)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.billet_plutonium, 4)));
|
||||
dropItems(world, x, y, z,
|
||||
new ItemStack(ModItems.ball_tnt, 8),
|
||||
new ItemStack(ModItems.billet_plutonium, 4));
|
||||
}
|
||||
if(type == type.SALTED) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ball_tnt, 8)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.billet_plutonium, 2)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ingot_cobalt, 12)));
|
||||
dropItems(world, x, y, z,
|
||||
new ItemStack(ModItems.ball_tnt, 8),
|
||||
new ItemStack(ModItems.billet_plutonium, 2),
|
||||
new ItemStack(ModItems.ingot_cobalt, 12));
|
||||
}
|
||||
|
||||
world.func_147480_a(x, y, z, false);
|
||||
@ -78,6 +81,10 @@ public class BlockCrashedBomb extends BlockEnumMulti implements ITileEntityProvi
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void dropItems(World world, int x, int y, int z, ItemStack... drops) {
|
||||
for(ItemStack drop : drops) world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, drop));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||
|
||||
|
||||
@ -3,13 +3,14 @@ package com.hbm.blocks.generic;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.items.special.ItemDoorSkin;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.Rotation;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
@ -23,7 +24,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
public class BlockDoorGeneric extends BlockDummyable implements IBomb, IToolable {
|
||||
|
||||
public DoorDecl type;
|
||||
|
||||
@ -34,8 +35,7 @@ public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta){
|
||||
if(meta >= 12)
|
||||
return new TileEntityDoorGeneric();
|
||||
if(meta >= 12) return new TileEntityDoorGeneric();
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -69,21 +69,30 @@ public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer playerIn, int side, float hitX, float hitY, float hitZ){
|
||||
if(!world.isRemote && !playerIn.isSneaking()) {
|
||||
int[] pos1 = findCore(world, x, y, z);
|
||||
if(pos1 == null)
|
||||
return false;
|
||||
if(pos1 == null) return false;
|
||||
TileEntityDoorGeneric door = (TileEntityDoorGeneric) world.getTileEntity(pos1[0], pos1[1], pos1[2]);
|
||||
|
||||
if(door != null) {
|
||||
if(playerIn.getHeldItem() != null && playerIn.getHeldItem().getItem() instanceof ItemDoorSkin) {
|
||||
return door.setSkinIndex((byte) playerIn.getHeldItem().getItemDamage());
|
||||
} else {
|
||||
return door.tryToggle(playerIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
return !playerIn.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
if(tool != ToolType.SCREWDRIVER || !player.isSneaking()) return false;
|
||||
|
||||
int[] pos1 = findCore(world, x, y, z);
|
||||
if(pos1 == null) return false;
|
||||
TileEntityDoorGeneric door = (TileEntityDoorGeneric) world.getTileEntity(pos1[0], pos1[1], pos1[2]);
|
||||
|
||||
if(door == null || !door.getDoorType().hasSkins()) return false;
|
||||
if(world.isRemote) return true;
|
||||
door.cycleSkinIndex();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
@ -159,7 +168,6 @@ public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return getBoundingBox(world, x, y, z, false);
|
||||
//return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBoundingBox(World world, int x, int y, int z, boolean forCollision) {
|
||||
@ -183,4 +191,24 @@ public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, getDimensions(), x, y, z, dir)) return false;
|
||||
|
||||
if(type.getExtraDimensions() != null) for(int[] dims : type.getExtraDimensions()) {
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, dims, x, y, z, dir)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, getDimensions(), this, dir);
|
||||
|
||||
if(type.getExtraDimensions() != null) for(int[] dims : type.getExtraDimensions()) {
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, dims, this, dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
42
src/main/java/com/hbm/blocks/generic/BlockForgottenLock.java
Normal file
42
src/main/java/com/hbm/blocks/generic/BlockForgottenLock.java
Normal file
@ -0,0 +1,42 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.machine.BlockPillar;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockForgottenLock extends BlockPillar {
|
||||
|
||||
public BlockForgottenLock(Material mat, String top) {
|
||||
super(mat, top);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
// placeholder
|
||||
if(player.getHeldItem() != null) {
|
||||
boolean cracked = player.getHeldItem().getItem() == ModItems.key_red_cracked;
|
||||
if((player.getHeldItem().getItem() == ModItems.key_red || cracked) && side != 0 && side != 1) {
|
||||
if(cracked) player.getHeldItem().stackSize--;
|
||||
if(world.isRemote) return true;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
|
||||
generate(world, x, y, z, meta, dir);
|
||||
|
||||
world.playSoundAtEntity(player, "hbm:block.lockOpen", 1.0F, 1.0F);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void generate(World world, int x, int y, int z, int meta, ForgeDirection dir) {
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyBlockAssembler extends DummyOldBase {
|
||||
|
||||
public DummyBlockAssembler(Material p_i45386_1_, boolean port) {
|
||||
super(p_i45386_1_, port);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_assembler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
TileEntityMachineAssembler entity = (TileEntityMachineAssembler) world.getTileEntity(a, b, c);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, a, b, c);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyBlockRefinery extends DummyOldBase {
|
||||
|
||||
public DummyBlockRefinery(Material p_i45386_1_, boolean port) {
|
||||
super(p_i45386_1_, port);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_refinery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
TileEntityMachineRefinery entity = (TileEntityMachineRefinery) world.getTileEntity(a, b, c);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, a, b, c);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyBlockTurbofan extends DummyOldBase {
|
||||
|
||||
public DummyBlockTurbofan(Material p_i45386_1_, boolean port) {
|
||||
super(p_i45386_1_, port);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_turbofan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
TileEntityMachineTurbofan entity = (TileEntityMachineTurbofan) world.getTileEntity(a, b, c);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, a, b, c);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,141 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.interfaces.IDummy;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemLock;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityVaultDoor;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyBlockVault extends BlockContainer implements IDummy, IBomb {
|
||||
|
||||
public static boolean safeBreak = false;
|
||||
|
||||
public DummyBlockVault(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityDummy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i) {
|
||||
if(!safeBreak) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy) te).targetX;
|
||||
int b = ((TileEntityDummy) te).targetY;
|
||||
int c = ((TileEntityDummy) te).targetZ;
|
||||
|
||||
if(!world.isRemote)
|
||||
world.func_147480_a(a, b, c, true);
|
||||
}
|
||||
}
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z) {
|
||||
return Item.getItemFromBlock(ModBlocks.vault_door);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
|
||||
return false;
|
||||
|
||||
} else if(!player.isSneaking()) {
|
||||
TileEntity til = world.getTileEntity(x, y, z);
|
||||
if(til != null && til instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy) til).targetX;
|
||||
int b = ((TileEntityDummy) til).targetY;
|
||||
int c = ((TileEntityDummy) til).targetZ;
|
||||
|
||||
TileEntityVaultDoor entity = (TileEntityVaultDoor) world.getTileEntity(a, b, c);
|
||||
if(entity != null) {
|
||||
if(entity.canAccess(player))
|
||||
entity.tryToggle();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy) te).targetX;
|
||||
int b = ((TileEntityDummy) te).targetY;
|
||||
int c = ((TileEntityDummy) te).targetZ;
|
||||
|
||||
TileEntityVaultDoor entity = (TileEntityVaultDoor) world.getTileEntity(a, b, c);
|
||||
if(entity != null) {
|
||||
entity.type++;
|
||||
if(entity.type >= entity.maxTypes)
|
||||
entity.type = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy) te).targetX;
|
||||
int b = ((TileEntityDummy) te).targetY;
|
||||
int c = ((TileEntityDummy) te).targetZ;
|
||||
|
||||
TileEntityVaultDoor entity = (TileEntityVaultDoor) world.getTileEntity(a, b, c);
|
||||
if(entity != null && !entity.isLocked()) {
|
||||
entity.tryToggle();
|
||||
return BombReturnCode.TRIGGERED;
|
||||
}
|
||||
}
|
||||
|
||||
return BombReturnCode.ERROR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
return BombReturnCode.UNDEFINED;
|
||||
}
|
||||
}
|
||||
@ -20,8 +20,7 @@ public class FurnaceCombination extends BlockDummyable implements ITooltipProvid
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12)
|
||||
return new TileEntityFurnaceCombination();
|
||||
if(meta >= 12) return new TileEntityFurnaceCombination();
|
||||
return new TileEntityProxyCombo().inventory().fluid();
|
||||
}
|
||||
|
||||
|
||||
@ -74,6 +74,7 @@ public class MachineAssemblyFactory extends BlockDummyable implements ITooltipPr
|
||||
TileEntityMachineAssemblyFactory assemfac = (TileEntityMachineAssemblyFactory) te;
|
||||
|
||||
DirPos[] cool = assemfac.getCoolPos();
|
||||
DirPos[] io = assemfac.getIOPos();
|
||||
|
||||
for(DirPos dirPos : cool) if(dirPos.compare(x + dirPos.getDir().offsetX, y, z + dirPos.getDir().offsetZ)) {
|
||||
List<String> text = new ArrayList();
|
||||
@ -84,5 +85,15 @@ public class MachineAssemblyFactory extends BlockDummyable implements ITooltipPr
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
break;
|
||||
}
|
||||
|
||||
for(int i = 0; i < io.length; i++) {
|
||||
DirPos port = io[i];
|
||||
if(port.compare(x + port.getDir().offsetX, y, z + port.getDir().offsetZ)) {
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.YELLOW + "-> " + EnumChatFormatting.RESET + "Recipe field [" + (i + 1) + "]");
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +74,7 @@ public class MachineChemicalFactory extends BlockDummyable implements ITooltipPr
|
||||
TileEntityMachineChemicalFactory chemfac = (TileEntityMachineChemicalFactory) te;
|
||||
|
||||
DirPos[] cool = chemfac.getCoolPos();
|
||||
DirPos[] io = chemfac.getIOPos();
|
||||
|
||||
for(DirPos dirPos : cool) if(dirPos.compare(x + dirPos.getDir().offsetX, y, z + dirPos.getDir().offsetZ)) {
|
||||
List<String> text = new ArrayList();
|
||||
@ -84,5 +85,15 @@ public class MachineChemicalFactory extends BlockDummyable implements ITooltipPr
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
break;
|
||||
}
|
||||
|
||||
for(int i = 0; i < io.length; i++) {
|
||||
DirPos port = io[i];
|
||||
if(port.compare(x + port.getDir().offsetX, y, z + port.getDir().offsetZ)) {
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.YELLOW + "-> " + EnumChatFormatting.RESET + "Recipe field [" + (i + 1) + "]");
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
@ -28,19 +29,14 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineChungus extends BlockDummyable implements ITooltipProvider, ILookOverlay {
|
||||
|
||||
public MachineChungus(Material mat) {
|
||||
super(mat);
|
||||
public MachineChungus() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12)
|
||||
return new TileEntityChungus();
|
||||
|
||||
if(meta >= 6)
|
||||
return new TileEntityProxyCombo(false, true, true);
|
||||
|
||||
if(meta >= 12) return new TileEntityChungus();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -66,34 +62,14 @@ public class MachineChungus extends BlockDummyable implements ITooltipProvider,
|
||||
int iZ2 = entity.zCoord + dir.offsetZ * 2 + turn.offsetZ * 2;
|
||||
|
||||
if((x == iX || x == iX2) && (z == iZ || z == iZ2) && y < entity.yCoord + 2) {
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.chungusLever", 1.5F, 1.0F);
|
||||
|
||||
if(!world.isRemote) {
|
||||
FluidType type = entity.tanks[0].getTankType();
|
||||
entity.onLeverPull(type);
|
||||
|
||||
if(type == Fluids.STEAM) {
|
||||
entity.tanks[0].setTankType(Fluids.HOTSTEAM);
|
||||
entity.tanks[1].setTankType(Fluids.STEAM);
|
||||
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
|
||||
entity.tanks[1].setFill(0);
|
||||
} else if(type == Fluids.HOTSTEAM) {
|
||||
entity.tanks[0].setTankType(Fluids.SUPERHOTSTEAM);
|
||||
entity.tanks[1].setTankType(Fluids.HOTSTEAM);
|
||||
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
|
||||
entity.tanks[1].setFill(0);
|
||||
} else if(type == Fluids.SUPERHOTSTEAM) {
|
||||
entity.tanks[0].setTankType(Fluids.ULTRAHOTSTEAM);
|
||||
entity.tanks[1].setTankType(Fluids.SUPERHOTSTEAM);
|
||||
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
|
||||
entity.tanks[1].setFill(0);
|
||||
if(!entity.operational) {
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.chungusLever", 1.5F, 1.0F);
|
||||
entity.onLeverPull();
|
||||
} else {
|
||||
entity.tanks[0].setTankType(Fluids.STEAM);
|
||||
entity.tanks[1].setTankType(Fluids.SPENTSTEAM);
|
||||
entity.tanks[0].setFill(Math.min(entity.tanks[0].getFill() * 1000, entity.tanks[0].getMaxFill()));
|
||||
entity.tanks[1].setFill(0);
|
||||
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "Cannot change compressor setting while operational!"));
|
||||
}
|
||||
entity.markDirty();
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -168,7 +144,7 @@ public class MachineChungus extends BlockDummyable implements ITooltipProvider,
|
||||
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + inputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankInput.getFill()) + "/" + String.format(Locale.US, "%,d", tankInput.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + outputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankOutput.getFill()) + "/" + String.format(Locale.US, "%,d", tankOutput.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(chungus.power) + "/" + BobMathUtil.getShortNumber(chungus.getMaxPower()) + "HE");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(chungus.powerBuffer) + "HE");
|
||||
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
|
||||
@ -0,0 +1,133 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineIndustrialTurbine;
|
||||
import com.hbm.tileentity.machine.TileEntityTurbineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineIndustrialTurbine extends BlockDummyable implements ITooltipProvider, ILookOverlay {
|
||||
|
||||
public MachineIndustrialTurbine() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineIndustrialTurbine();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid().power();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return true;
|
||||
|
||||
TileEntityTurbineBase entity = (TileEntityTurbineBase) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(entity != null) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(entity.getBlockMetadata() - this.offset);
|
||||
|
||||
if(x == entity.xCoord + dir.offsetX * 3 && z == entity.zCoord + dir.offsetZ * 3 && y == entity.yCoord + 1) {
|
||||
if(!world.isRemote) {
|
||||
if(!entity.operational) {
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.chungusLever", 1.5F, 1.0F);
|
||||
entity.onLeverPull();
|
||||
} else {
|
||||
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "Cannot change compressor setting while operational!"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] { 2, 0, 3, 3, 1, 1 }; }
|
||||
@Override public int getOffset() { return 3; }
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x + dir.offsetX * 3 + rot.offsetX, y, z + dir.offsetZ * 3 + rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 3 - rot.offsetX, y, z + dir.offsetZ * 3 - rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX * 1 + rot.offsetX, y, z - dir.offsetZ * 1 + rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX * 1 - rot.offsetX, y, z - dir.offsetZ * 1 - rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 3, y + 2, z + dir.offsetZ * 3);
|
||||
this.makeExtra(world, x - dir.offsetX * 1, y + 2, z - dir.offsetZ * 1);
|
||||
this.makeExtra(world, x - dir.offsetX * 3, y + 1, z - dir.offsetZ * 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
|
||||
private static String[] blocks = new String[] {"▖ ", "▘ ", " ▘", " ▖"}; // right hand side quarter blocks break the renderer so we cheat a little
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(!(te instanceof TileEntityMachineIndustrialTurbine)) return;
|
||||
|
||||
TileEntityMachineIndustrialTurbine chungus = (TileEntityMachineIndustrialTurbine) te;
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
FluidTank tankInput = chungus.tanks[0];
|
||||
FluidTank tankOutput = chungus.tanks[1];
|
||||
|
||||
FluidType inputType = tankInput.getTankType();
|
||||
FluidType outputType = Fluids.NONE;
|
||||
|
||||
if(inputType.hasTrait(FT_Coolable.class)) {
|
||||
outputType = inputType.getTrait(FT_Coolable.class).coolsTo;
|
||||
}
|
||||
|
||||
int color = ((int) (0xFF - 0xFF * chungus.spin)) << 16 | ((int)(0xFF * chungus.spin) << 8);
|
||||
int time = (int) ((world.getTotalWorldTime() / 4) % 4);
|
||||
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + inputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankInput.getFill()) + "/" + String.format(Locale.US, "%,d", tankInput.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + outputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankOutput.getFill()) + "/" + String.format(Locale.US, "%,d", tankOutput.getMaxFill()) + "mB");
|
||||
text.add("&[" + color + "&]" + EnumChatFormatting.RED + "<- " + EnumChatFormatting.WHITE + BobMathUtil.getShortNumber(chungus.powerBuffer) + "HE (" +
|
||||
EnumChatFormatting.RESET + blocks[chungus.powerBuffer <= 0 ? 0 : time] + (int) Math.round(chungus.spin * 100) + "%" + EnumChatFormatting.WHITE + ")");
|
||||
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Deprecated
|
||||
public class MachineLargeTurbine extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineLargeTurbine(Material mat) {
|
||||
|
||||
@ -14,7 +14,7 @@ public class MachineTransformer extends Block {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
|
||||
public MachineTransformer(Material p_i45394_1_, long b, int d) {
|
||||
public MachineTransformer(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
}
|
||||
|
||||
@ -26,10 +26,6 @@ public class MachineTransformer extends Block {
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_transformer_top_iron");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_transformer_iron");
|
||||
}
|
||||
if(this == ModBlocks.machine_transformer_dnt) {
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_transformer_top");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_transformer");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,156 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemLock;
|
||||
import com.hbm.tileentity.machine.TileEntityVaultDoor;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class VaultDoor extends BlockContainer implements IBomb, IMultiblock {
|
||||
|
||||
public VaultDoor(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityVaultDoor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
TileEntityVaultDoor te = (TileEntityVaultDoor) world.getTileEntity(x, y, z);
|
||||
|
||||
if(!te.isLocked()) {
|
||||
te.tryToggle();
|
||||
return BombReturnCode.TRIGGERED;
|
||||
}
|
||||
|
||||
return BombReturnCode.ERROR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
return BombReturnCode.UNDEFINED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
|
||||
TileEntityVaultDoor te = (TileEntityVaultDoor) world.getTileEntity(x, y, z);
|
||||
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
|
||||
// frame
|
||||
if(!(te.placeDummy(x + 1, y, z) && te.placeDummy(x + 2, y, z) && te.placeDummy(x + 2, y + 1, z) && te.placeDummy(x + 2, y + 2, z) && te.placeDummy(x + 2, y + 3, z) && te.placeDummy(x + 2, y + 4, z) && te.placeDummy(x + 1, y + 4, z) && te.placeDummy(x, y + 4, z) && te.placeDummy(x - 1, y + 4, z) && te.placeDummy(x - 2, y + 4, z) && te.placeDummy(x - 2, y + 3, z) && te.placeDummy(x - 2, y + 2, z) && te.placeDummy(x - 2, y + 1, z) && te.placeDummy(x - 2, y, z) && te.placeDummy(x - 1, y, z) &&
|
||||
// cog
|
||||
te.placeDummy(x - 1, y + 1, z) && te.placeDummy(x - 1, y + 2, z) && te.placeDummy(x - 1, y + 3, z) && te.placeDummy(x, y + 1, z) && te.placeDummy(x, y + 2, z) && te.placeDummy(x, y + 3, z) && te.placeDummy(x + 1, y + 1, z) && te.placeDummy(x + 1, y + 2, z) && te.placeDummy(x + 1, y + 3, z) &&
|
||||
// teeth
|
||||
te.placeDummy(x + 2, y, z + 1) && te.placeDummy(x + 1, y, z + 1) && te.placeDummy(x, y, z + 1) && te.placeDummy(x - 1, y, z + 1) && te.placeDummy(x - 2, y, z + 1))) {
|
||||
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
}
|
||||
if(i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
|
||||
// frame
|
||||
if(!(te.placeDummy(x, y, z + 1) && te.placeDummy(x, y, z + 2) && te.placeDummy(x, y + 1, z + 2) && te.placeDummy(x, y + 2, z + 2) && te.placeDummy(x, y + 3, z + 2) && te.placeDummy(x, y + 4, z + 2) && te.placeDummy(x, y + 4, z + 1) && te.placeDummy(x, y + 4, z) && te.placeDummy(x, y + 4, z - 1) && te.placeDummy(x, y + 4, z - 2) && te.placeDummy(x, y + 3, z - 2) && te.placeDummy(x, y + 2, z - 2) && te.placeDummy(x, y + 1, z - 2) && te.placeDummy(x, y, z - 2) && te.placeDummy(x, y, z - 1) &&
|
||||
// cog
|
||||
te.placeDummy(x, y + 1, z - 1) && te.placeDummy(x, y + 2, z - 1) && te.placeDummy(x, y + 3, z - 1) && te.placeDummy(x, y + 1, z) && te.placeDummy(x, y + 2, z) && te.placeDummy(x, y + 3, z) && te.placeDummy(x, y + 1, z + 1) && te.placeDummy(x, y + 2, z + 1) && te.placeDummy(x, y + 3, z + 1) &&
|
||||
// teeth
|
||||
te.placeDummy(x - 1, y, z + 2) && te.placeDummy(x - 1, y, z + 1) && te.placeDummy(x - 1, y, z) && te.placeDummy(x - 1, y, z - 1) && te.placeDummy(x - 1, y, z - 2))) {
|
||||
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
}
|
||||
if(i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
|
||||
// frame
|
||||
if(!(te.placeDummy(x + 1, y, z) && te.placeDummy(x + 2, y, z) && te.placeDummy(x + 2, y + 1, z) && te.placeDummy(x + 2, y + 2, z) && te.placeDummy(x + 2, y + 3, z) && te.placeDummy(x + 2, y + 4, z) && te.placeDummy(x + 1, y + 4, z) && te.placeDummy(x, y + 4, z) && te.placeDummy(x - 1, y + 4, z) && te.placeDummy(x - 2, y + 4, z) && te.placeDummy(x - 2, y + 3, z) && te.placeDummy(x - 2, y + 2, z) && te.placeDummy(x - 2, y + 1, z) && te.placeDummy(x - 2, y, z) && te.placeDummy(x - 1, y, z) &&
|
||||
// cog
|
||||
te.placeDummy(x - 1, y + 1, z) && te.placeDummy(x - 1, y + 2, z) && te.placeDummy(x - 1, y + 3, z) && te.placeDummy(x, y + 1, z) && te.placeDummy(x, y + 2, z) && te.placeDummy(x, y + 3, z) && te.placeDummy(x + 1, y + 1, z) && te.placeDummy(x + 1, y + 2, z) && te.placeDummy(x + 1, y + 3, z) &&
|
||||
// teeth
|
||||
te.placeDummy(x + 2, y, z - 1) && te.placeDummy(x + 1, y, z - 1) && te.placeDummy(x, y, z - 1) && te.placeDummy(x - 1, y, z - 1) && te.placeDummy(x - 2, y, z - 1))) {
|
||||
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
}
|
||||
if(i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
|
||||
// frame
|
||||
if(!(te.placeDummy(x, y, z + 1) && te.placeDummy(x, y, z + 2) && te.placeDummy(x, y + 1, z + 2) && te.placeDummy(x, y + 2, z + 2) && te.placeDummy(x, y + 3, z + 2) && te.placeDummy(x, y + 4, z + 2) && te.placeDummy(x, y + 4, z + 1) && te.placeDummy(x, y + 4, z) && te.placeDummy(x, y + 4, z - 1) && te.placeDummy(x, y + 4, z - 2) && te.placeDummy(x, y + 3, z - 2) && te.placeDummy(x, y + 2, z - 2) && te.placeDummy(x, y + 1, z - 2) && te.placeDummy(x, y, z - 2) && te.placeDummy(x, y, z - 1) &&
|
||||
// cog
|
||||
te.placeDummy(x, y + 1, z - 1) && te.placeDummy(x, y + 2, z - 1) && te.placeDummy(x, y + 3, z - 1) && te.placeDummy(x, y + 1, z) && te.placeDummy(x, y + 2, z) && te.placeDummy(x, y + 3, z) && te.placeDummy(x, y + 1, z + 1) && te.placeDummy(x, y + 2, z + 1) && te.placeDummy(x, y + 3, z + 1) &&
|
||||
// teeth
|
||||
te.placeDummy(x + 1, y, z + 2) && te.placeDummy(x + 1, y, z + 1) && te.placeDummy(x + 1, y, z) && te.placeDummy(x + 1, y, z - 1) && te.placeDummy(x + 1, y, z - 2))) {
|
||||
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
|
||||
return false;
|
||||
|
||||
}
|
||||
if(!player.isSneaking()) {
|
||||
|
||||
TileEntityVaultDoor entity = (TileEntityVaultDoor) world.getTileEntity(x, y, z);
|
||||
if(entity != null) {
|
||||
if(entity.isLocked()) {
|
||||
if(entity.canAccess(player))
|
||||
entity.tryToggle();
|
||||
} else {
|
||||
entity.tryToggle();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
|
||||
TileEntityVaultDoor entity = (TileEntityVaultDoor) world.getTileEntity(x, y, z);
|
||||
if(entity != null) {
|
||||
entity.type++;
|
||||
if(entity.type >= entity.maxTypes)
|
||||
entity.type = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -37,6 +37,8 @@ public class ClientConfig extends RunningConfig {
|
||||
public static ConfigWrapper<Integer> RENDER_REBAR_LIMIT = new ConfigWrapper(250);
|
||||
public static ConfigWrapper<Integer> TOOL_HUD_INDICATOR_X = new ConfigWrapper(0);
|
||||
public static ConfigWrapper<Integer> TOOL_HUD_INDICATOR_Y = new ConfigWrapper(0);
|
||||
public static ConfigWrapper<Boolean> SHOW_BLOCK_META_OVERLAY = new ConfigWrapper(false);
|
||||
public static ConfigWrapper<Boolean> BADGES_HUD = new ConfigWrapper(true);
|
||||
|
||||
private static void initDefaults() {
|
||||
configMap.put("GEIGER_OFFSET_HORIZONTAL", GEIGER_OFFSET_HORIZONTAL);
|
||||
@ -63,6 +65,8 @@ public class ClientConfig extends RunningConfig {
|
||||
configMap.put("RENDER_REBAR_LIMIT", RENDER_REBAR_LIMIT);
|
||||
configMap.put("TOOL_HUD_INDICATOR_X", TOOL_HUD_INDICATOR_X);
|
||||
configMap.put("TOOL_HUD_INDICATOR_Y", TOOL_HUD_INDICATOR_Y);
|
||||
configMap.put("SHOW_BLOCK_META_OVERLAY", SHOW_BLOCK_META_OVERLAY);
|
||||
configMap.put("BADGES_HUD", BADGES_HUD);
|
||||
}
|
||||
|
||||
/** Initializes defaults, then reads the config file if it exists, then writes the config file. */
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.hbm.config;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import com.hbm.inventory.recipes.PrecAssRecipes;
|
||||
import com.hbm.lib.RefStrings;
|
||||
public class GeneralConfig {
|
||||
|
||||
@ -43,6 +45,10 @@ public class GeneralConfig {
|
||||
|
||||
public static boolean enableExpensiveMode = false;
|
||||
|
||||
public static boolean trueExp() {
|
||||
return enableExpensiveMode && !PrecAssRecipes.INSTANCE.modified;
|
||||
}
|
||||
|
||||
public static boolean enable528 = false;
|
||||
public static boolean enable528ReasimBoilers = true;
|
||||
public static boolean enable528ColtanDeposit = true;
|
||||
@ -53,6 +59,11 @@ public class GeneralConfig {
|
||||
public static boolean enable528ExplosiveEnergistics = true;
|
||||
public static int coltanRate = 2;
|
||||
|
||||
public static boolean true528() {
|
||||
return enable528 && enable528ReasimBoilers && !enable528ColtanSpawn && enable528BosniaSimulator &&
|
||||
enable528NetherBurn && enable528PressurizedRecipes && enable528ExplosiveEnergistics && coltanRate <= 2;
|
||||
}
|
||||
|
||||
public static boolean enableLBSM = false;
|
||||
public static boolean enableLBSMFullSchrab = true;
|
||||
public static boolean enableLBSMShorterDecay = true;
|
||||
|
||||
@ -68,6 +68,10 @@ public class MobConfig {
|
||||
public static double rampantSmokeStackOverride = 0.4;
|
||||
public static double pollutionMult = 3;
|
||||
|
||||
public static boolean trueRam() {
|
||||
return rampantMode && rampantNaturalScoutSpawn && scoutThreshold <= 0.1 && rampantExtendedTargetting && rampantDig && rampantGlyphidGuidance;
|
||||
}
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY = CommonConfig.CATEGORY_MOBS;
|
||||
|
||||
@ -161,7 +161,7 @@ public class RodRecipes {
|
||||
|
||||
public static void registerInit() {
|
||||
/* GT6 */
|
||||
if(OreDictionary.doesOreNameExist("ingotNaquadah-Enriched")) addPellet(new DictFrame("Naquadah-Enriched"), EnumWatzType.NQD);
|
||||
if(OreDictionary.doesOreNameExist("ingotNaquadahEnriched")) addPellet(new DictFrame("NaquadahEnriched"), EnumWatzType.NQD);
|
||||
if(OreDictionary.doesOreNameExist("ingotNaquadria")) addPellet(new DictFrame("Naquadria"), EnumWatzType.NQR);
|
||||
}
|
||||
|
||||
|
||||
@ -77,6 +77,8 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_akimbo, 1), new Object[] { "UMU", 'U', ModItems.gun_uzi, 'M', WEAPONSTEEL.mechanism() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "BRM", "BGS", 'B', DESH.lightBarrel(), 'R', DESH.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', ANY_PLASTIC.grip(), 'S', DESH.stock() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_panzerschreck, 1), new Object[] { "BBB", "PGM", 'B', DESH.heavyBarrel(), 'P', STEEL.plateCast(), 'G', DESH.grip(), 'M', GUNMETAL.mechanism() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_star_f, 1), new Object[] { "BRM", " G", 'B', WEAPONSTEEL.lightBarrel(), 'R', WEAPONSTEEL.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_star_f_akimbo, 1), new Object[] { "UMU", 'U', ModItems.gun_star_f, 'M', BIGMT.mechanism() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_g3, 1), new Object[] { "BRM", "WGS", 'B', WEAPONSTEEL.lightBarrel(), 'R', WEAPONSTEEL.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'W', WOOD.grip(), 'G', RUBBER.grip(), 'S', WOOD.stock() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_g3_zebra, 1), new Object[] { " M ", "MPM", " M ", 'M', BIGMT.mechanism(), 'P', ModItems.gun_g3 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stinger, 1), new Object[] { "BBB", "PGM", 'B', WEAPONSTEEL.heavyBarrel(), 'P', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'G', WEAPONSTEEL.grip(), 'M', WEAPONSTEEL.mechanism() });
|
||||
|
||||
@ -150,10 +150,13 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
|
||||
canDestroy.add(Blocks.trapdoor);
|
||||
canDestroy.add(ModBlocks.machine_press);
|
||||
canDestroy.add(ModBlocks.machine_epress);
|
||||
canDestroy.add(ModBlocks.machine_chemplant);
|
||||
canDestroy.add(ModBlocks.machine_chemical_plant);
|
||||
canDestroy.add(ModBlocks.machine_chemical_factory);
|
||||
canDestroy.add(ModBlocks.machine_crystallizer);
|
||||
canDestroy.add(ModBlocks.machine_turbine);
|
||||
canDestroy.add(ModBlocks.machine_large_turbine);
|
||||
canDestroy.add(ModBlocks.machine_industrial_turbine);
|
||||
canDestroy.add(ModBlocks.machine_chungus);
|
||||
canDestroy.add(ModBlocks.machine_purex);
|
||||
canDestroy.add(ModBlocks.crate_iron);
|
||||
canDestroy.add(ModBlocks.crate_steel);
|
||||
canDestroy.add(ModBlocks.machine_diesel);
|
||||
|
||||
@ -11,8 +11,8 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.imc.ICompatNHNEI;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.gui.GUIMachineShredder;
|
||||
import com.hbm.inventory.recipes.MachineRecipes;
|
||||
import com.hbm.inventory.recipes.ShredderRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
@ -175,9 +175,18 @@ public class ShredderRecipeHandler extends TemplateRecipeHandler implements ICom
|
||||
public TemplateRecipeHandler newInstance() {
|
||||
if(fuels == null || fuels.isEmpty())
|
||||
fuels = new ArrayList<Fuel>();
|
||||
for(ItemStack i : MachineRecipes.instance().getBlades()) {
|
||||
for(ItemStack i : getBlades()) {
|
||||
fuels.add(new Fuel(i));
|
||||
}
|
||||
return super.newInstance();
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getBlades() {
|
||||
ArrayList<ItemStack> fuels = new ArrayList<ItemStack>();
|
||||
fuels.add(new ItemStack(ModItems.blades_advanced_alloy));
|
||||
fuels.add(new ItemStack(ModItems.blades_steel));
|
||||
fuels.add(new ItemStack(ModItems.blades_titanium));
|
||||
fuels.add(new ItemStack(ModItems.blades_desh));
|
||||
return fuels;
|
||||
}
|
||||
}
|
||||
|
||||
10
src/main/java/com/hbm/interfaces/HalfLifeType.java
Normal file
10
src/main/java/com/hbm/interfaces/HalfLifeType.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
public enum HalfLifeType {
|
||||
/** Counted in days **/
|
||||
SHORT,
|
||||
/** Counted in years **/
|
||||
MEDIUM,
|
||||
/** Counted in hundreds of years **/
|
||||
LONG;
|
||||
}
|
||||
@ -1,429 +0,0 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
import com.hbm.hazard.HazardRegistry;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
/**
|
||||
* Interface for customizable warheads or other explosive devices
|
||||
* @author UFFR
|
||||
*
|
||||
*/
|
||||
@Beta
|
||||
@Spaghetti("AAAAAAAA")
|
||||
public interface ICustomWarhead
|
||||
{
|
||||
public static enum EnumCustomWarhead
|
||||
{
|
||||
AMAT,
|
||||
BF,
|
||||
BIO,
|
||||
CHEM,
|
||||
FUSION,
|
||||
GRAV,
|
||||
HE,
|
||||
NUCLEAR,
|
||||
TX,
|
||||
SCHRAB,
|
||||
ZPE;
|
||||
public String getLoc()
|
||||
{
|
||||
return I18nUtil.resolveKey("warhead.".concat(toString()));
|
||||
}
|
||||
|
||||
public enum EnumChemicalType
|
||||
{
|
||||
ACID,
|
||||
CHLORINE,
|
||||
NERVE,
|
||||
TOX;
|
||||
public String getLoc()
|
||||
{
|
||||
return I18nUtil.resolveKey("warhead.CHEM.".concat(toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public enum EnumBioType
|
||||
{
|
||||
ANTHRAX,
|
||||
MKU;
|
||||
public String getLoc()
|
||||
{
|
||||
return I18nUtil.resolveKey("warhead.BIO.".concat(toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
public static enum EnumCustomWarheadTrait
|
||||
{
|
||||
CLEAN,
|
||||
CLEANISH,
|
||||
DIRTY,
|
||||
RAD,
|
||||
SALT;
|
||||
public String getLoc()
|
||||
{
|
||||
return I18nUtil.resolveKey("warheadTrait.".concat(toString()));
|
||||
}
|
||||
}
|
||||
public static enum EnumWeaponType
|
||||
{
|
||||
DENIAL,
|
||||
STRATEGIC,
|
||||
TACTICAL,
|
||||
WMD;
|
||||
public String getLoc()
|
||||
{
|
||||
return I18nUtil.resolveKey("warheadType.".concat(toString()));
|
||||
}
|
||||
}
|
||||
public static final String KEY_ANTHRAX = "warheadFuel.ANTHRAX";
|
||||
public static final String KEY_MKU = "warheadFuel.MKU";
|
||||
public static final String KEY_CAUSTIC = "warheadFuel.ACID";
|
||||
public static final String KEY_NERVE = "warheadFuel.NERVE";
|
||||
public static final String KEY_TOX = "warheadFuel.TOX";
|
||||
|
||||
public static final String NBT_GROUP = "NTM_NUKE_INFO";
|
||||
public static final String NBT_YIELD = "YIELD";
|
||||
public static final String NBT_ALTITUDE = "ALTITUDE";
|
||||
public static final String NBT_MASS = "MASS";
|
||||
public static final String NBT_SPECIAL = "SPECIAL_FIELD";
|
||||
public static final String NBT_WARHEAD = "WARHEAD";
|
||||
public static final String NBT_TYPE = "WARHEAD_TYPE";
|
||||
public static final String NBT_TRAIT = "WARHEAD_TRAIT";
|
||||
public static final DecimalFormat df = new DecimalFormat("#.00");
|
||||
|
||||
public static EnumChatFormatting getColorFromWarhead(EnumCustomWarhead warhead)
|
||||
{
|
||||
switch (warhead)
|
||||
{
|
||||
case AMAT:
|
||||
return EnumChatFormatting.DARK_RED;
|
||||
case BF:
|
||||
return EnumChatFormatting.GREEN;
|
||||
case BIO:
|
||||
return EnumChatFormatting.GOLD;
|
||||
case CHEM:
|
||||
return EnumChatFormatting.YELLOW;
|
||||
case FUSION:
|
||||
return EnumChatFormatting.BLUE;
|
||||
case GRAV:
|
||||
return EnumChatFormatting.DARK_GRAY;
|
||||
case HE:
|
||||
return EnumChatFormatting.RED;
|
||||
case NUCLEAR:
|
||||
return EnumChatFormatting.DARK_GREEN;
|
||||
case SCHRAB:
|
||||
return EnumChatFormatting.AQUA;
|
||||
case TX:
|
||||
return EnumChatFormatting.DARK_PURPLE;
|
||||
case ZPE:
|
||||
return (System.currentTimeMillis() % 1000 < 500 ? EnumChatFormatting.DARK_AQUA : EnumChatFormatting.LIGHT_PURPLE);
|
||||
default:
|
||||
return EnumChatFormatting.WHITE;
|
||||
}
|
||||
}
|
||||
|
||||
public default float getYield()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
public default EnumCustomWarhead getWarheadType(NBTTagCompound data)
|
||||
{
|
||||
return EnumCustomWarhead.valueOf(data.getString(NBT_WARHEAD));
|
||||
}
|
||||
public default EnumWeaponType getWeaponType(NBTTagCompound data)
|
||||
{
|
||||
return EnumWeaponType.valueOf(data.getString(NBT_TYPE));
|
||||
}
|
||||
public default EnumCustomWarheadTrait getWeaponTrait(NBTTagCompound data)
|
||||
{
|
||||
return EnumCustomWarheadTrait.valueOf(data.getString(NBT_TRAIT));
|
||||
}
|
||||
public ItemStack constructNew();
|
||||
public ICustomWarhead getInstance();
|
||||
|
||||
public default Item getItem()
|
||||
{
|
||||
return (Item) this;
|
||||
}
|
||||
|
||||
public static ItemStack addData(NBTTagCompound data, Item item)
|
||||
{
|
||||
ItemStack stackOut = new ItemStack(item);
|
||||
|
||||
stackOut.stackTagCompound = new NBTTagCompound();
|
||||
stackOut.stackTagCompound.setTag(NBT_GROUP, data);
|
||||
|
||||
return stackOut.copy();
|
||||
}
|
||||
|
||||
public default NBTTagCompound getWarheadData(ItemStack stack)
|
||||
{
|
||||
return stack.getTagCompound().getCompoundTag(NBT_GROUP);
|
||||
}
|
||||
|
||||
public default ItemStack addFuel(ItemStack stack, Enum<?> fuel, float amount)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof ICustomWarhead)
|
||||
{
|
||||
NBTTagCompound data = getWarheadData(stack);
|
||||
data.setFloat(fuel.toString(), amount);
|
||||
data.setFloat(NBT_MASS, data.getFloat(NBT_MASS) + amount);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
public default ItemStack addData(ItemStack stack, String key, String value)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof ICustomWarhead)
|
||||
getWarheadData(stack).setString(key, value);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
public default void addCompositionalInfo(NBTTagCompound data, List<String> tooltip, List<Enum<?>> combinedFuels)
|
||||
{
|
||||
for (Enum<?> f : combinedFuels)
|
||||
if (data.getFloat(f.toString()) > 0)
|
||||
tooltip.add(String.format(Locale.US, "%s: %skg (%s)", I18nUtil.resolveKey("warheadFuel.".concat(f.toString())), df.format(data.getFloat(f.toString())), BobMathUtil.toPercentage(data.getFloat(f.toString()), data.getFloat(NBT_MASS))));
|
||||
}
|
||||
|
||||
public default void addTooltip(ItemStack stack, List<String> tooltip)
|
||||
{
|
||||
// tooltip.clear();
|
||||
try {
|
||||
NBTTagCompound data = getWarheadData(stack);
|
||||
|
||||
final ArrayList<Enum<?>> combinedFuels = new ArrayList<>();
|
||||
combinedFuels.addAll(Arrays.asList(FissileFuel.values()));
|
||||
combinedFuels.addAll(Arrays.asList(FusionFuel.values()));
|
||||
combinedFuels.addAll(Arrays.asList(SaltedFuel.values()));
|
||||
combinedFuels.addAll(Arrays.asList(EnumCustomWarhead.values()));
|
||||
switch (getWarheadType(data))
|
||||
{
|
||||
case NUCLEAR:
|
||||
case TX:
|
||||
case HE:
|
||||
tooltip.add("Composition:");
|
||||
addCompositionalInfo(data, tooltip, combinedFuels);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
final EnumCustomWarhead warhead = getWarheadType(data);
|
||||
tooltip.add(data.getFloat(NBT_MASS) + "kg total");
|
||||
tooltip.add("");
|
||||
switch (warhead)
|
||||
{
|
||||
case CHEM:
|
||||
case BIO:
|
||||
tooltip.add("Type: " + getColorFromWarhead(warhead) + I18nUtil.resolveKey("warhead.".concat(warhead.toString()), I18nUtil.resolveKey(data.getString(NBT_SPECIAL))));
|
||||
break;
|
||||
default:
|
||||
tooltip.add("Type: " + getColorFromWarhead(warhead) + warhead.getLoc());
|
||||
break;
|
||||
}
|
||||
tooltip.add("Function: " + getWeaponType(data).getLoc());
|
||||
switch (warhead)
|
||||
{
|
||||
case AMAT:
|
||||
case BF:
|
||||
case FUSION:
|
||||
case GRAV:
|
||||
case HE:
|
||||
case NUCLEAR:
|
||||
case TX:
|
||||
tooltip.add("Yield: " + BobMathUtil.getShortNumber(data.getInteger(NBT_YIELD)) + "T");
|
||||
break;
|
||||
case BIO:
|
||||
case CHEM:
|
||||
case SCHRAB:
|
||||
tooltip.add("Radius: " + BobMathUtil.getShortNumber(data.getInteger(NBT_YIELD)) + "M");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tooltip.add("Trait: " + getWeaponTrait(data).getLoc());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MainRegistry.logger.catching(Level.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
public enum FissileFuel
|
||||
{
|
||||
U233(15F, 197.5F, HazardRegistry.u233, 19.05F),
|
||||
U235(52F, 202.5F, HazardRegistry.u235, 19.05F),
|
||||
Np237(60F, 202.5F, HazardRegistry.np237, 20.45F),
|
||||
Pu239(10F, 207.1F, HazardRegistry.pu239, 19.86F),
|
||||
Pu241(12, 210F, HazardRegistry.pu241, 19.86F),
|
||||
Am241(66, 210F, HazardRegistry.am241, 13.67F),
|
||||
Am242m(11F, 212F, HazardRegistry.am242, 13.67F),
|
||||
Sa326(1F, 250F, HazardRegistry.sa326, 39.7F);
|
||||
public final float criticalMass;
|
||||
public final float energyReleased;
|
||||
public final float radioactivity;
|
||||
private final float mass;
|
||||
private FissileFuel(float criticalMass, float energyReleased, float radioactivity, float mass)
|
||||
{
|
||||
this.criticalMass = criticalMass;
|
||||
this.energyReleased = energyReleased;
|
||||
this.radioactivity = radioactivity;
|
||||
this.mass = mass;
|
||||
}
|
||||
public float getBlockMass()
|
||||
{
|
||||
return mass * 100;
|
||||
}
|
||||
public float getIngotMass()
|
||||
{
|
||||
return getBlockMass() / 9;
|
||||
}
|
||||
public float getNuggetMass()
|
||||
{
|
||||
return getIngotMass() / 9;
|
||||
}
|
||||
public String getLoc()
|
||||
{
|
||||
return I18nUtil.resolveKey("warheadFuel.".concat(toString()));
|
||||
}
|
||||
}
|
||||
public enum FusionFuel
|
||||
{
|
||||
DEUT,
|
||||
TRIT,
|
||||
Li,
|
||||
LiDEUT;
|
||||
public String getLoc()
|
||||
{
|
||||
return I18nUtil.resolveKey("warheadFuel".concat(toString()));
|
||||
}
|
||||
}
|
||||
public enum SaltedFuel
|
||||
{
|
||||
Co59(1.4902F * 0.75F, 5, HalfLifeType.MEDIUM, 8.86F),
|
||||
Co60(1.4902F, 5, HalfLifeType.MEDIUM, 8.86F),
|
||||
Sr90(0.546F, 28, HalfLifeType.MEDIUM, 2.64F),
|
||||
Cs137(1.1737F, 30, HalfLifeType.MEDIUM, 1.93F),
|
||||
Ta181(0.52F * 0.75F, 114, HalfLifeType.SHORT, 16.65F),
|
||||
Ta182(0.52F, 114, HalfLifeType.SHORT, 16.654F),
|
||||
Au197(1.3735F * 0.75F, 2, HalfLifeType.SHORT, 19.32F),
|
||||
Au198(1.3735F, 2, HalfLifeType.SHORT, 19.32F),
|
||||
Pu240(5.25575F, 65, HalfLifeType.LONG, 19.86F),
|
||||
Sa327(0.5F, 100, HalfLifeType.LONG, 39.7F);
|
||||
public final float decayEnergy;
|
||||
public final int halfLife;
|
||||
public final HalfLifeType type;
|
||||
private final float mass;
|
||||
SaltedFuel(float decayEnergy, int halfLife, HalfLifeType type, float mass)
|
||||
{
|
||||
this.decayEnergy = decayEnergy;
|
||||
this.halfLife = halfLife;
|
||||
this.type = type;
|
||||
this.mass = mass;
|
||||
}
|
||||
public enum HalfLifeType
|
||||
{
|
||||
/** Counted in days **/
|
||||
SHORT,
|
||||
/** Counted in years **/
|
||||
MEDIUM,
|
||||
/** Counted in hundreds of years **/
|
||||
LONG;
|
||||
}
|
||||
public float getBlockMass()
|
||||
{
|
||||
return mass * 100;
|
||||
}
|
||||
public float getIngotMass()
|
||||
{
|
||||
return getBlockMass() / 9;
|
||||
}
|
||||
public float getNuggetMass()
|
||||
{
|
||||
return getIngotMass() / 9;
|
||||
}
|
||||
}
|
||||
|
||||
/*public static class CustomWarheadWrapper
|
||||
{
|
||||
public static final ICustomWarhead cWarhead = (ICustomWarhead) ModItems.custom_warhead;
|
||||
public static final ICustomWarhead cCore = (ICustomWarhead) ModItems.custom_core;
|
||||
public static final CustomWarheadWrapper gravimetricBase = new CustomWarheadWrapper(cWarhead).addFuel(EnumCustomWarhead.GRAV, 1000.0F).addData(NBT_TYPE, EnumWeaponType.TACTICAL).addData(NBT_WARHEAD, EnumCustomWarhead.GRAV).addData(NBT_TRAIT, EnumCustomWarheadTrait.CLEAN);
|
||||
public static final CustomWarheadWrapper pureFusionBase = new CustomWarheadWrapper(cWarhead).addFuel(FusionFuel.LiDEUT, 500).addData(NBT_TYPE, EnumWeaponType.TACTICAL).addData(NBT_WARHEAD, EnumCustomWarhead.FUSION).addData(NBT_TRAIT, EnumCustomWarheadTrait.CLEANISH).setStackData(8, 1);
|
||||
public static final CustomWarheadWrapper chemicalBase = new CustomWarheadWrapper(cWarhead).addFuel(EnumChemicalType.NERVE, 15).addData(NBT_TYPE, EnumWeaponType.WMD).addData(NBT_WARHEAD, EnumCustomWarhead.CHEM).addData(NBT_TRAIT, EnumCustomWarheadTrait.DIRTY).addData(NBT_SPECIAL, KEY_NERVE).setStackData(1, 2);
|
||||
public static final CustomWarheadWrapper biologicalBase = new CustomWarheadWrapper(cWarhead).addFuel(EnumBioType.ANTHRAX, 15).addData(NBT_TYPE, EnumWeaponType.WMD).addData(NBT_WARHEAD, EnumCustomWarhead.BIO).addData(NBT_TRAIT, EnumCustomWarheadTrait.DIRTY).addData(NBT_SPECIAL, KEY_ANTHRAX).setStackData(1, 3);
|
||||
public static final CustomWarheadWrapper saltedBase = new CustomWarheadWrapper(cWarhead).addFuel(FissileFuel.U235, 20).addFuel(FissileFuel.Pu239, 5).addFuel(FusionFuel.LiDEUT, 20).addFuel(SaltedFuel.Co59, 10).addData(NBT_TYPE, EnumWeaponType.DENIAL).addData(NBT_WARHEAD, EnumCustomWarhead.TX).addData(NBT_TRAIT, EnumCustomWarheadTrait.SALT).setStackData(1, 4);
|
||||
private ItemStack stack;
|
||||
private ICustomWarhead warhead;
|
||||
public CustomWarheadWrapper(ItemStack stack)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof ICustomWarhead)
|
||||
{
|
||||
this.stack = ((ICustomWarhead) stack.getItem()).constructNew();
|
||||
warhead = (ICustomWarhead) stack.getItem();
|
||||
}
|
||||
else
|
||||
throw new IllegalArgumentException("Input stack item is not instance of " + ICustomWarhead.class.toString());
|
||||
}
|
||||
public CustomWarheadWrapper(ICustomWarhead warhead)
|
||||
{
|
||||
stack = warhead.constructNew();
|
||||
this.warhead = warhead;
|
||||
}
|
||||
public CustomWarheadWrapper(Item item)
|
||||
{
|
||||
if (!(item instanceof ICustomWarhead))
|
||||
throw new IllegalArgumentException("Input stack item is not instance of [ICustomWarhead]");
|
||||
stack = ((ICustomWarhead) item).constructNew();
|
||||
warhead = (ICustomWarhead) item;
|
||||
}
|
||||
public CustomWarheadWrapper addFuel(Enum<?> fuel, float amount)
|
||||
{
|
||||
warhead.addFuel(stack, fuel, amount);
|
||||
return this;
|
||||
}
|
||||
public CustomWarheadWrapper addData(String key, String value)
|
||||
{
|
||||
warhead.addData(stack, key, value);
|
||||
return this;
|
||||
}
|
||||
public CustomWarheadWrapper addData(String key, Enum<?> value)
|
||||
{
|
||||
return addData(key, value.toString());
|
||||
}
|
||||
public CustomWarheadWrapper setStackData(int stackSize, int meta)
|
||||
{
|
||||
stack.stackSize = stackSize <= 1 ? 1 : stackSize;
|
||||
stack.setItemDamage(meta <= 0 ? 0 : meta);
|
||||
return this;
|
||||
}
|
||||
public NBTTagCompound regurgitateData()
|
||||
{
|
||||
return (NBTTagCompound) warhead.getWarheadData(getStack()).copy();
|
||||
}
|
||||
public ICustomWarhead getInterface()
|
||||
{
|
||||
return warhead;
|
||||
}
|
||||
public ItemStack getStack()
|
||||
{
|
||||
return stack.copy();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@ -386,8 +386,8 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
|
||||
this.register(new GenericRecipe("ass.hephaestus").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_hephaestus, 1))
|
||||
.inputItems(new OreDictStack(STEEL.pipe(), 12), new OreDictStack(STEEL.ingot(), 24), new OreDictStack(CU.plate(), 24), new OreDictStack(NB.ingot(), 4), new OreDictStack(RUBBER.ingot(), 12), new ComparableStack(ModBlocks.glass_quartz, 16))
|
||||
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 8, EnumExpensiveType.HEAVY_FRAME), new OreDictStack(NB.ingot(), 16), new OreDictStack(RUBBER.ingot(), 16), new ComparableStack(ModBlocks.glass_quartz, 16)));
|
||||
this.register(new GenericRecipe("ass.iturbine").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_large_turbine, 1))
|
||||
.inputItems(new OreDictStack(STEEL.plate(), 12), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 6), new OreDictStack(DURA.pipe(), 3), new OreDictStack(STEEL.pipe(), 4), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC))
|
||||
this.register(new GenericRecipe("ass.iturbine").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_industrial_turbine, 1))
|
||||
.inputItems(new OreDictStack(STEEL.plate(), 12), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 6), new OreDictStack(DURA.pipe(), 4), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC))
|
||||
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.HEAVY_FRAME), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 16), new OreDictStack(DURA.pipe(), 16), new ComparableStack(ModItems.item_expensive, 3, EnumExpensiveType.CIRCUIT)));
|
||||
this.register(new GenericRecipe("ass.leviturbine").setup(600, 100).outputItems(new ItemStack(ModBlocks.machine_chungus, 1))
|
||||
.inputItems(new OreDictStack(STEEL.shell(), 6), new OreDictStack(STEEL.plateWelded(), 16), new OreDictStack(TI.plate(), 12), new OreDictStack(ANY_RESISTANTALLOY.ingot(), 16), new ComparableStack(ModItems.turbine_tungsten, 5), new ComparableStack(ModItems.turbine_titanium, 3), new ComparableStack(ModItems.flywheel_beryllium, 1), new OreDictStack(GOLD.wireDense(), 48), new OreDictStack(DURA.pipe(), 16), new OreDictStack(STEEL.pipe(), 16))
|
||||
|
||||
@ -12,7 +12,6 @@ import com.hbm.util.Tuple.Triplet;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@ -50,7 +49,6 @@ public class MachineRecipes {
|
||||
ArrayList<ItemStack> fuels = new ArrayList<ItemStack>();
|
||||
fuels.add(new ItemStack(ModItems.battery_potato));
|
||||
fuels.add(new ItemStack(ModItems.battery_potatos));
|
||||
fuels.add(new ItemStack(ModItems.fusion_core));
|
||||
fuels.add(new ItemStack(ModItems.energy_core));
|
||||
for(EnumBatteryPack num : EnumBatteryPack.values()) fuels.add(new ItemStack(ModItems.battery_pack, 1, num.ordinal()));
|
||||
for(EnumBatterySC num : EnumBatterySC.values()) fuels.add(new ItemStack(ModItems.battery_sc, 1, num.ordinal()));
|
||||
@ -58,35 +56,6 @@ public class MachineRecipes {
|
||||
return fuels;
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> getBlades() {
|
||||
ArrayList<ItemStack> fuels = new ArrayList<ItemStack>();
|
||||
fuels.add(new ItemStack(ModItems.blades_advanced_alloy));
|
||||
fuels.add(new ItemStack(ModItems.blades_steel));
|
||||
fuels.add(new ItemStack(ModItems.blades_titanium));
|
||||
fuels.add(new ItemStack(ModItems.blades_desh));
|
||||
return fuels;
|
||||
}
|
||||
|
||||
public static boolean mODE(Item item, String[] names) {
|
||||
return mODE(new ItemStack(item), names);
|
||||
}
|
||||
|
||||
public static boolean mODE(ItemStack item, String[] names) {
|
||||
boolean flag = false;
|
||||
if(names.length > 0) {
|
||||
for(int i = 0; i < names.length; i++) {
|
||||
if(mODE(item, names[i]))
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
public static boolean mODE(Item item, String name) {
|
||||
return mODE(new ItemStack(item), name);
|
||||
}
|
||||
|
||||
//Matches Ore Dict Entry
|
||||
public static boolean mODE(ItemStack stack, String name) {
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@ import com.hbm.inventory.recipes.*;
|
||||
import com.hbm.inventory.recipes.anvil.AnvilRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import api.hbm.recipe.IRecipeRegisterListener;
|
||||
@ -301,7 +302,7 @@ public abstract class SerializableRecipe {
|
||||
writer.value(comp.nbt != null ? "nbt" : "item"); //NBT identifier
|
||||
writer.value(Item.itemRegistry.getNameForObject(comp.toStack().getItem())); //item name
|
||||
if(comp.stacksize != 1 || comp.meta > 0) writer.value(comp.stacksize); //stack size
|
||||
if(comp.meta > 0) writer.value(comp.meta); //metadata
|
||||
if(comp.meta > 0 || comp.nbt != null) writer.value(comp.meta); //metadata
|
||||
if(comp.nbt != null) writer.value(comp.nbt.toString()); //NBT
|
||||
} else if(astack instanceof ComparableStack) {
|
||||
ComparableStack comp = (ComparableStack) astack;
|
||||
@ -324,7 +325,11 @@ public abstract class SerializableRecipe {
|
||||
Item item = (Item) Item.itemRegistry.getObject(array.get(0).getAsString());
|
||||
int stacksize = array.size() > 1 ? array.get(1).getAsInt() : 1;
|
||||
int meta = array.size() > 2 ? array.get(2).getAsInt() : 0;
|
||||
if(item != null) return new ItemStack(item, stacksize, meta);
|
||||
if(item != null) {
|
||||
ItemStack stack = new ItemStack(item, stacksize, meta);
|
||||
if(array.size() > 3) ItemStackUtil.addNBTFromString(stack, array.get(3).getAsString());
|
||||
return stack;
|
||||
}
|
||||
} catch(Exception ex) { }
|
||||
MainRegistry.logger.error("Error reading stack array " + array.toString() + " - defaulting to NOTHING item!");
|
||||
return new ItemStack(ModItems.nothing);
|
||||
@ -335,8 +340,12 @@ public abstract class SerializableRecipe {
|
||||
Item item = (Item) Item.itemRegistry.getObject(array.get(0).getAsString());
|
||||
int stacksize = array.size() > 2 ? array.get(1).getAsInt() : 1;
|
||||
int meta = array.size() > 3 ? array.get(2).getAsInt() : 0;
|
||||
if(item != null) {
|
||||
ItemStack stack = new ItemStack(item, stacksize, meta);
|
||||
if(array.size() > 4) ItemStackUtil.addNBTFromString(stack, array.get(3).getAsString());
|
||||
float chance = array.get(array.size() - 1).getAsFloat();
|
||||
if(item != null) return new Pair(new ItemStack(item, stacksize, meta), chance);
|
||||
return new Pair(stack, chance);
|
||||
}
|
||||
} catch(Exception ex) { }
|
||||
MainRegistry.logger.error("Error reading stack array " + array.toString() + " - defaulting to NOTHING item!");
|
||||
return new Pair(new ItemStack(ModItems.nothing), 1F);
|
||||
@ -366,8 +375,9 @@ public abstract class SerializableRecipe {
|
||||
writer.beginArray();
|
||||
writer.setIndent("");
|
||||
writer.value(Item.itemRegistry.getNameForObject(stack.getItem())); //item name
|
||||
if(stack.stackSize != 1 || stack.getItemDamage() != 0) writer.value(stack.stackSize); //stack size
|
||||
if(stack.getItemDamage() != 0) writer.value(stack.getItemDamage()); //metadata
|
||||
if(stack.stackSize != 1 || stack.getItemDamage() != 0 || stack.hasTagCompound()) writer.value(stack.stackSize); //stack size
|
||||
if(stack.getItemDamage() != 0 || stack.hasTagCompound()) writer.value(stack.getItemDamage()); //metadata
|
||||
if(stack.hasTagCompound()) writer.value(stack.stackTagCompound.toString()); //nbt
|
||||
writer.endArray();
|
||||
writer.setIndent(" ");
|
||||
}
|
||||
@ -376,8 +386,9 @@ public abstract class SerializableRecipe {
|
||||
writer.beginArray();
|
||||
writer.setIndent("");
|
||||
writer.value(Item.itemRegistry.getNameForObject(stack.getKey().getItem())); //item name
|
||||
if(stack.getKey().stackSize != 1 || stack.getKey().getItemDamage() != 0) writer.value(stack.getKey().stackSize); //stack size
|
||||
if(stack.getKey().getItemDamage() != 0) writer.value(stack.getKey().getItemDamage()); //metadata
|
||||
if(stack.getKey().stackSize != 1 || stack.getKey().getItemDamage() != 0 || stack.getKey().hasTagCompound()) writer.value(stack.getKey().stackSize); //stack size
|
||||
if(stack.getKey().getItemDamage() != 0 || stack.getKey().hasTagCompound()) writer.value(stack.getKey().getItemDamage()); //metadata
|
||||
if(stack.getKey().hasTagCompound()) writer.value(stack.getKey().stackTagCompound.toString()); //nbt
|
||||
writer.value(stack.value); //chance
|
||||
writer.endArray();
|
||||
writer.setIndent(" ");
|
||||
|
||||
@ -122,10 +122,10 @@ public class ItemPoolsComponent {
|
||||
weighted(Items.map, 0, 1, 1, 50),
|
||||
weighted(Items.writable_book, 0, 1, 1, 30),
|
||||
weighted(ModItems.cigarette, 0, 1, 16, 20),
|
||||
weighted(ModItems.toothpicks, 0, 1, 16, 10),
|
||||
weighted(ModItems.dust, 0, 1, 1, 40),
|
||||
weighted(ModItems.dust_tiny, 0, 1, 3, 75),
|
||||
weighted(ModItems.ink, 0, 1, 1, 1),
|
||||
weighted(ModItems.screwdriver, 0, 1, 1, 10),
|
||||
weighted(ModItems.blueprint_folder, 0, 1, 1, 5)
|
||||
};
|
||||
}};
|
||||
|
||||
@ -8,7 +8,7 @@ import com.hbm.handler.BucketHandler;
|
||||
import com.hbm.handler.ability.IToolAreaAbility;
|
||||
import com.hbm.handler.ability.IToolHarvestAbility;
|
||||
import com.hbm.handler.ability.IWeaponAbility;
|
||||
import com.hbm.interfaces.ICustomWarhead.SaltedFuel.HalfLifeType;
|
||||
import com.hbm.interfaces.HalfLifeType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
@ -610,7 +610,6 @@ public class ModItems {
|
||||
public static Item gear_large;
|
||||
public static Item sawblade;
|
||||
|
||||
public static Item toothpicks;
|
||||
public static Item ducttape;
|
||||
public static Item catalyst_clay;
|
||||
|
||||
@ -774,12 +773,6 @@ public class ModItems {
|
||||
public static Item ams_catalyst_thorium;
|
||||
public static Item ams_catalyst_tungsten;
|
||||
|
||||
public static Item ams_focus_blank;
|
||||
public static Item ams_focus_limiter;
|
||||
public static Item ams_focus_booster;
|
||||
|
||||
public static Item ams_muzzle;
|
||||
|
||||
public static Item ams_lens;
|
||||
|
||||
public static Item ams_core_sing;
|
||||
@ -1347,16 +1340,6 @@ public class ModItems {
|
||||
public static Item mp_chip_4;
|
||||
public static Item mp_chip_5;
|
||||
|
||||
public static Item missile_skin_camo;
|
||||
public static Item missile_skin_desert;
|
||||
public static Item missile_skin_flames;
|
||||
public static Item missile_skin_manly_pink;
|
||||
public static Item missile_skin_orange_insulation;
|
||||
public static Item missile_skin_sleek;
|
||||
public static Item missile_skin_soviet_glory;
|
||||
public static Item missile_skin_soviet_stank;
|
||||
public static Item missile_skin_metal;
|
||||
|
||||
public static Item missile_custom;
|
||||
|
||||
public static Item missile_soyuz;
|
||||
@ -1416,6 +1399,8 @@ public class ModItems {
|
||||
public static Item gun_uzi_akimbo;
|
||||
public static Item gun_spas12;
|
||||
public static Item gun_panzerschreck;
|
||||
public static Item gun_star_f;
|
||||
public static Item gun_star_f_akimbo;
|
||||
public static Item gun_g3;
|
||||
public static Item gun_g3_zebra;
|
||||
public static Item gun_stinger;
|
||||
@ -1793,6 +1778,10 @@ public class ModItems {
|
||||
public static Item rpa_plate;
|
||||
public static Item rpa_legs;
|
||||
public static Item rpa_boots;
|
||||
public static Item ncrpa_helmet;
|
||||
public static Item ncrpa_plate;
|
||||
public static Item ncrpa_legs;
|
||||
public static Item ncrpa_boots;
|
||||
public static Item bismuth_helmet;
|
||||
public static Item bismuth_plate;
|
||||
public static Item bismuth_legs;
|
||||
@ -2135,8 +2124,6 @@ public class ModItems {
|
||||
public static Item door_bunker;
|
||||
public static Item door_red;
|
||||
|
||||
public static Item sliding_blast_door_skin;
|
||||
|
||||
public static Item record_lc;
|
||||
public static Item record_ss;
|
||||
public static Item record_vc;
|
||||
@ -2707,7 +2694,6 @@ public class ModItems {
|
||||
blade_tungsten = new Item().setUnlocalizedName("blade_tungsten").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":blade_tungsten");
|
||||
turbine_tungsten = new Item().setUnlocalizedName("turbine_tungsten").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":turbine_tungsten");
|
||||
|
||||
toothpicks = new Item().setUnlocalizedName("toothpicks").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":toothpicks");
|
||||
ducttape = new Item().setUnlocalizedName("ducttape").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ducttape");
|
||||
catalyst_clay = new Item().setUnlocalizedName("catalyst_clay").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":catalyst_clay");
|
||||
|
||||
@ -2948,7 +2934,7 @@ public class ModItems {
|
||||
radx = new ItemPill(0).setUnlocalizedName("radx").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":radx");
|
||||
siox = new ItemPill(0).setUnlocalizedName("siox").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":siox");
|
||||
pill_herbal = new ItemPill(0).setUnlocalizedName("pill_herbal").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_herbal");
|
||||
xanax = new ItemPill(0).setUnlocalizedName("xanax").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":xanax_2");
|
||||
xanax = new ItemPill(0).setUnlocalizedName("xanax").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":xanax");
|
||||
fmn = new ItemPill(0).setUnlocalizedName("fmn").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":tablet");
|
||||
five_htp = new ItemPill(0).setUnlocalizedName("five_htp").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":5htp");
|
||||
pill_iodine = new ItemPill(0).setUnlocalizedName("pill_iodine").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_iodine");
|
||||
@ -3440,7 +3426,7 @@ public class ModItems {
|
||||
icf_pellet = new ItemICFPellet().setUnlocalizedName("icf_pellet").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":icf_pellet");
|
||||
icf_pellet_depleted = new Item().setUnlocalizedName("icf_pellet_depleted").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":icf_pellet_depleted");
|
||||
|
||||
trinitite = new ItemNuclearWaste().setUnlocalizedName("trinitite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":trinitite_new");
|
||||
trinitite = new ItemNuclearWaste().setUnlocalizedName("trinitite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":trinitite");
|
||||
nuclear_waste_long = new ItemWasteLong().setUnlocalizedName("nuclear_waste_long").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nuclear_waste_long");
|
||||
nuclear_waste_long_tiny = new ItemWasteLong().setUnlocalizedName("nuclear_waste_long_tiny").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nuclear_waste_long_tiny");
|
||||
nuclear_waste_short = new ItemWasteShort().setUnlocalizedName("nuclear_waste_short").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nuclear_waste_short");
|
||||
@ -3680,16 +3666,6 @@ public class ModItems {
|
||||
mp_chip_4 = new ItemCustomMissilePart().makeChip(0.005F) .setUnlocalizedName("mp_c_4").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":mp_c_4");
|
||||
mp_chip_5 = new ItemCustomMissilePart().makeChip(0.0F) .setUnlocalizedName("mp_c_5").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":mp_c_5");
|
||||
|
||||
missile_skin_camo = new ItemCustomLore().setUnlocalizedName("missile_skin_camo").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_camo");
|
||||
missile_skin_desert = new ItemCustomLore().setUnlocalizedName("missile_skin_desert").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_desert");
|
||||
missile_skin_flames = new ItemCustomLore().setUnlocalizedName("missile_skin_flames").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_flames");
|
||||
missile_skin_manly_pink = new ItemCustomLore().setUnlocalizedName("missile_skin_manly_pink").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_manly_pink");
|
||||
missile_skin_orange_insulation = new ItemCustomLore().setUnlocalizedName("missile_skin_orange_insulation").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_orange_insulation");
|
||||
missile_skin_sleek = new ItemCustomLore().setUnlocalizedName("missile_skin_sleek").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_sleek");
|
||||
missile_skin_soviet_glory = new ItemCustomLore().setUnlocalizedName("missile_skin_soviet_glory").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_soviet_glory");
|
||||
missile_skin_soviet_stank = new ItemCustomLore().setUnlocalizedName("missile_skin_soviet_stank").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_soviet_stank");
|
||||
missile_skin_metal = new ItemCustomLore().setUnlocalizedName("missile_skin_metal").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_metal");
|
||||
|
||||
ammo_shell = (ItemEnumMulti) new ItemAmmo(Ammo240Shell.class).setCreativeTab(MainRegistry.weaponTab).setUnlocalizedName("ammo_shell");
|
||||
ammo_dgk = new ItemCustomLore().setUnlocalizedName("ammo_dgk").setCreativeTab(MainRegistry.weaponTab);
|
||||
ammo_fireext = (ItemEnumMulti) new ItemAmmo(AmmoFireExt.class).setCreativeTab(MainRegistry.weaponTab).setUnlocalizedName("ammo_fireext");
|
||||
@ -3905,10 +3881,6 @@ public class ModItems {
|
||||
arc_electrode = new ItemArcElectrode().setUnlocalizedName("arc_electrode").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":arc_electrode");
|
||||
arc_electrode_burnt = new ItemArcElectrodeBurnt().setUnlocalizedName("arc_electrode_burnt").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":arc_electrode_burnt");
|
||||
|
||||
ams_focus_blank = new Item().setUnlocalizedName("ams_focus_blank").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":ams_focus_blank");
|
||||
ams_focus_limiter = new ItemCustomLore().setUnlocalizedName("ams_focus_limiter").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":ams_focus_limiter");
|
||||
ams_focus_booster = new ItemCustomLore().setUnlocalizedName("ams_focus_booster").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":ams_focus_booster");
|
||||
ams_muzzle = new ItemCustomLore().setUnlocalizedName("ams_muzzle").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":ams_muzzle");
|
||||
ams_lens = new ItemLens(60 * 60 * 60 * 20 * 100).setUnlocalizedName("ams_lens").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":ams_lens");
|
||||
ams_core_sing = new ItemAMSCore(1000000000L, 200, 10).setUnlocalizedName("ams_core_sing").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":ams_core_sing");
|
||||
ams_core_wormhole = new ItemAMSCore(1500000000L, 200, 15).setUnlocalizedName("ams_core_wormhole").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":ams_core_wormhole");
|
||||
@ -4286,6 +4258,20 @@ public class ModItems {
|
||||
rpa_legs = new ArmorRPA(aMatAJR, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("rpa_legs").setTextureName(RefStrings.MODID + ":rpa_legs");
|
||||
rpa_boots = new ArmorRPA(aMatAJR, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("rpa_boots").setTextureName(RefStrings.MODID + ":rpa_boots");
|
||||
|
||||
ncrpa_helmet = new ArmorNCRPA(aMatAJR, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25)
|
||||
.enableVATS(true)
|
||||
.setHasGeigerSound(true)
|
||||
.setHasHardLanding(true)
|
||||
.addEffect(new PotionEffect(Potion.damageBoost.id, 20, 3))
|
||||
.setStep("hbm:step.powered")
|
||||
.setJump("hbm:step.powered")
|
||||
.setFall("hbm:step.powered")
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("ncrpa_helmet").setTextureName(RefStrings.MODID + ":rpa_helmet");
|
||||
ncrpa_plate = new ArmorNCRPA(aMatAJR, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("ncrpa_plate").setTextureName(RefStrings.MODID + ":rpa_plate");
|
||||
ncrpa_legs = new ArmorNCRPA(aMatAJR, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("ncrpa_legs").setTextureName(RefStrings.MODID + ":rpa_legs");
|
||||
ncrpa_boots = new ArmorNCRPA(aMatAJR, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("ncrpa_boots").setTextureName(RefStrings.MODID + ":rpa_boots");
|
||||
|
||||
ArmorMaterial aMatBJ = EnumHelper.addArmorMaterial("HBM_BLACKJACK", 150, new int[] { 3, 8, 6, 3 }, 0);
|
||||
aMatBJ.customCraftingMaterial = ModItems.plate_armor_lunar;
|
||||
bj_helmet = new ArmorBJ(aMatBJ, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100)
|
||||
@ -4850,8 +4836,6 @@ public class ModItems {
|
||||
door_bunker = new ItemModDoor().setUnlocalizedName("door_bunker").setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":door_bunker");
|
||||
door_red = new ItemModDoor().setUnlocalizedName("door_red").setCreativeTab(null).setTextureName(RefStrings.MODID + ":door_red");
|
||||
|
||||
sliding_blast_door_skin = new ItemSlidingBlastDoorSkin().setUnlocalizedName("sliding_blast_door_skin").setCreativeTab(CreativeTabs.tabMisc).setTextureName(RefStrings.MODID + ":sliding_blast_door_default");
|
||||
|
||||
record_lc = new ItemModRecord("lc").setUnlocalizedName("record_lc").setCreativeTab(CreativeTabs.tabMisc).setTextureName(RefStrings.MODID + ":record_lc");
|
||||
record_ss = new ItemModRecord("ss").setUnlocalizedName("record_ss").setCreativeTab(CreativeTabs.tabMisc).setTextureName(RefStrings.MODID + ":record_ss");
|
||||
record_vc = new ItemModRecord("vc").setUnlocalizedName("record_vc").setCreativeTab(CreativeTabs.tabMisc).setTextureName(RefStrings.MODID + ":record_vc");
|
||||
@ -5482,7 +5466,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(turbine_titanium, turbine_titanium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(turbine_tungsten, turbine_tungsten.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flywheel_beryllium, flywheel_beryllium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(toothpicks, toothpicks.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ducttape, ducttape.getUnlocalizedName());
|
||||
GameRegistry.registerItem(catalyst_clay, catalyst_clay.getUnlocalizedName());
|
||||
GameRegistry.registerItem(missile_assembly, missile_assembly.getUnlocalizedName());
|
||||
@ -5857,10 +5840,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(catalytic_converter, catalytic_converter.getUnlocalizedName());
|
||||
|
||||
//AMS Components
|
||||
GameRegistry.registerItem(ams_focus_blank, ams_focus_blank.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ams_focus_limiter, ams_focus_limiter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ams_focus_booster, ams_focus_booster.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ams_muzzle, ams_muzzle.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ams_lens, ams_lens.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ams_core_sing, ams_core_sing.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ams_core_wormhole, ams_core_wormhole.getUnlocalizedName());
|
||||
@ -6307,6 +6286,8 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_uzi_akimbo, gun_uzi_akimbo.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_star_f, gun_star_f.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_star_f_akimbo, gun_star_f_akimbo.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_g3, gun_g3.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_g3_zebra, gun_g3_zebra.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName());
|
||||
@ -6844,6 +6825,10 @@ public class ModItems {
|
||||
GameRegistry.registerItem(rpa_plate, rpa_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rpa_legs, rpa_legs.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rpa_boots, rpa_boots.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ncrpa_helmet, ncrpa_helmet.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ncrpa_plate, ncrpa_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ncrpa_legs, ncrpa_legs.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ncrpa_boots, ncrpa_boots.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bj_helmet, bj_helmet.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bj_plate, bj_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bj_plate_jetpack, bj_plate_jetpack.getUnlocalizedName());
|
||||
@ -7032,7 +7017,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(door_office, door_office.getUnlocalizedName());
|
||||
GameRegistry.registerItem(door_bunker, door_bunker.getUnlocalizedName());
|
||||
GameRegistry.registerItem(door_red, door_red.getUnlocalizedName());
|
||||
GameRegistry.registerItem(sliding_blast_door_skin, sliding_blast_door_skin.getUnlocalizedName());
|
||||
|
||||
//Records
|
||||
GameRegistry.registerItem(record_lc, record_lc.getUnlocalizedName());
|
||||
|
||||
49
src/main/java/com/hbm/items/armor/ArmorNCRPA.java
Normal file
49
src/main/java/com/hbm/items/armor/ArmorNCRPA.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.render.model.ModelArmorNCRPA;
|
||||
import com.hbm.render.tileentity.IItemRendererProvider;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ArmorNCRPA extends ArmorFSBPowered implements IItemRendererProvider {
|
||||
|
||||
public ArmorNCRPA(ArmorMaterial material, int slot, String texture, long maxPower, long chargeRate, long consumption, long drain) {
|
||||
super(material, slot, texture, maxPower, chargeRate, consumption, drain);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelArmorNCRPA[] models;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
|
||||
|
||||
if(models == null) { models = new ModelArmorNCRPA[4];
|
||||
for(int i = 0; i < 4; i++) models[i] = new ModelArmorNCRPA(i);
|
||||
}
|
||||
|
||||
return models[armorSlot];
|
||||
}
|
||||
|
||||
@Override public Item getItemForRenderer() { return this; }
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() { setupRenderInv(); }
|
||||
public void renderNonInv() { setupRenderNonInv(); }
|
||||
public void renderCommon() {
|
||||
renderStandard(ResourceManager.armor_ncr, armorType,
|
||||
ResourceManager.ncrpa_helmet, ResourceManager.ncrpa_chest, ResourceManager.ncrpa_arm, ResourceManager.ncrpa_leg,
|
||||
"Helmet,Eyes", "Chest", "LeftArm", "RightArm", "LeftLeg", "RightLeg", "LeftBoot", "RightBoot");
|
||||
}};
|
||||
}
|
||||
}
|
||||
@ -36,7 +36,7 @@ public class ItemStamp extends Item {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
if((this.type == StampType.PLATE || this.type == StampType.WIRE || this.type == StampType.CIRCUIT) && this.getMaxDamage() > 0)
|
||||
if(this.type == StampType.PLATE || this.type == StampType.WIRE || this.type == StampType.CIRCUIT)
|
||||
list.add("[CREATED USING TEMPLATE FOLDER]");
|
||||
}
|
||||
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemDoorSkin extends Item {
|
||||
protected final IIcon[] icons;
|
||||
|
||||
public ItemDoorSkin(int skinCount) {
|
||||
setMaxStackSize(1);
|
||||
icons = new IIcon[skinCount];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasSubtypes() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
return icons[meta];
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemSlidingBlastDoorSkin extends ItemDoorSkin {
|
||||
public ItemSlidingBlastDoorSkin() {
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister reg) {
|
||||
this.itemIcon = reg.registerIcon(this.getIconString());
|
||||
|
||||
this.icons[0] = reg.registerIcon(RefStrings.MODID + ":sliding_blast_door_default");
|
||||
this.icons[1] = reg.registerIcon(RefStrings.MODID + ":sliding_blast_door_variant1");
|
||||
this.icons[2] = reg.registerIcon(RefStrings.MODID + ":sliding_blast_door_variant2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + "." + stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@ -66,6 +66,8 @@ public class GunFactoryClient {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_akimbo, new ItemRenderUziAkimbo());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderSPAS12());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_panzerschreck, new ItemRenderPanzerschreck());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_star_f, new ItemRenderStarF());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_star_f_akimbo, new ItemRenderStarFAkimbo());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3, new ItemRenderG3(ResourceManager.g3_tex));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3_zebra, new ItemRenderG3(ResourceManager.g3_zebra_tex));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_stinger, new ItemRenderStinger());
|
||||
@ -263,6 +265,7 @@ public class GunFactoryClient {
|
||||
((ItemGunBaseNT) ModItems.gun_uzi) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_spas12) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_panzerschreck) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_star_f) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_g3) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_g3_zebra) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_stinger) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
@ -305,6 +308,8 @@ public class GunFactoryClient {
|
||||
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_star_f_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_star_f_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_aberrator_eott) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
|
||||
@ -765,6 +765,81 @@ public class Orchestras {
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STAR_F = (stack, ctx) -> {
|
||||
EntityLivingBase entity = ctx.entity;
|
||||
if(entity.worldObj.isRemote) return;
|
||||
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
|
||||
|
||||
if(type == GunAnimation.CYCLE) {
|
||||
if(timer == 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.1875D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 12.5F + (float)entity.getRNG().nextFloat() * 5F, casing.getName());
|
||||
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
|
||||
}
|
||||
}
|
||||
if(type == GunAnimation.CYCLE_DRY) {
|
||||
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.9F);
|
||||
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1.1F);
|
||||
|
||||
}
|
||||
if(type == GunAnimation.RELOAD) {
|
||||
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
|
||||
if(timer == 22) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
|
||||
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
|
||||
}
|
||||
if(type == GunAnimation.JAMMED) {
|
||||
if(timer == 15) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
if(timer == 19) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
|
||||
if(timer == 23) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
if(timer == 27) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
|
||||
}
|
||||
if(type == GunAnimation.INSPECT) {
|
||||
if(timer == 7) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STAR_F_AKIMBO = (stack, ctx) -> {
|
||||
EntityLivingBase entity = ctx.entity;
|
||||
if(entity.worldObj.isRemote) return;
|
||||
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
|
||||
|
||||
if(type == GunAnimation.CYCLE) {
|
||||
if(timer == 0) {
|
||||
int side = ctx.configIndex == 0 ? -1 : 1;
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.1875D * side, 0, 0.18, -0.12 * side, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 12.5F + (float)entity.getRNG().nextFloat() * 5F, casing.getName());
|
||||
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
|
||||
}
|
||||
}
|
||||
if(type == GunAnimation.CYCLE_DRY) {
|
||||
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.9F);
|
||||
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1.1F);
|
||||
|
||||
}
|
||||
if(type == GunAnimation.RELOAD) {
|
||||
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
|
||||
if(timer == 22) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
|
||||
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
|
||||
}
|
||||
if(type == GunAnimation.JAMMED) {
|
||||
if(timer == 15) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
if(timer == 19) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
|
||||
if(timer == 23) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
if(timer == 27) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
|
||||
}
|
||||
if(type == GunAnimation.INSPECT) {
|
||||
if(timer == 7) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
|
||||
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_G3 = (stack, ctx) -> {
|
||||
EntityLivingBase entity = ctx.entity;
|
||||
if(entity.worldObj.isRemote) return;
|
||||
|
||||
@ -17,6 +17,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
@ -54,23 +55,60 @@ public class XFactory22lr {
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_AM180))
|
||||
.setupStandardConfiguration()
|
||||
.anim(LAMBDA_AM180_ANIMS).orchestra(Orchestras.ORCHESTRA_AM180)
|
||||
).setDefaultAmmo(EnumAmmo.P22_SP, 35).setNameMutator(LAMBDA_NAME_AM180)
|
||||
).setDefaultAmmo(EnumAmmo.P22_SP, 35).setNameMutator(LAMBDA_NAME_SILENCED)
|
||||
.setUnlocalizedName("gun_am180");
|
||||
|
||||
ModItems.gun_star_f = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(15 * 25).draw(15).inspect(38).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12.5F).delay(5).dry(17).spread(0.01F).reload(40).jam(32).sound("hbm:weapon.fire.pistolLight", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(0, 15).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
|
||||
.offset(1, -0.0625 * 1.5, -0.1875D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
|
||||
.setupStandardConfiguration()
|
||||
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F)
|
||||
).setDefaultAmmo(EnumAmmo.P22_SP, 15).setNameMutator(LAMBDA_NAME_SILENCED)
|
||||
.setUnlocalizedName("gun_star_f");
|
||||
|
||||
ModItems.gun_star_f_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE,
|
||||
new GunConfig().dura(15 * 25).draw(15).inspect(38).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12.5F).delay(5).dry(17).spread(0.01F).reload(40).jam(32).sound("hbm:weapon.fire.pistolLight", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(0, 15).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
|
||||
.offset(1, -0.0625 * 1.5, 0.25D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
|
||||
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
|
||||
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F_AKIMBO),
|
||||
new GunConfig().dura(15 * 25).draw(15).inspect(38).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12.5F).delay(5).dry(17).spread(0.01F).reload(40).jam(32).sound("hbm:weapon.fire.pistolLight", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(1, 15).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
|
||||
.offset(1, -0.0625 * 1.5, -0.25D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
|
||||
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
|
||||
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F_AKIMBO)
|
||||
).setDefaultAmmo(EnumAmmo.P9_SP, 30).setUnlocalizedName("gun_star_f_akimbo");
|
||||
}
|
||||
|
||||
public static Function<ItemStack, String> LAMBDA_NAME_AM180 = (stack) -> {
|
||||
public static Function<ItemStack, String> LAMBDA_NAME_SILENCED = (stack) -> {
|
||||
if(XWeaponModManager.hasUpgrade(stack, 0, XWeaponModManager.ID_SILENCER)) return stack.getUnlocalizedName() + "_silenced";
|
||||
return null;
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
|
||||
Lego.handleStandardSmoke(ctx.entity, stack, 3000, 0.05D, 1.1D, 0);
|
||||
Lego.handleStandardSmoke(ctx.entity, stack, 3000, 0.05D, 1.1D, ctx.configIndex);
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_AM180 = (stack, ctx) -> {
|
||||
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25));
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_STAR_F = (stack, ctx) -> {
|
||||
ItemGunBaseNT.setupRecoil(2.5F, (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5));
|
||||
};
|
||||
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_AM180_ANIMS = (stack, type) -> {
|
||||
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
|
||||
switch(type) {
|
||||
@ -109,4 +147,42 @@ public class XFactory22lr {
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_STAR_F_ANIMS = (stack, type) -> {
|
||||
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
||||
switch(type) {
|
||||
case EQUIP: return new BusAnimation()
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||
case CYCLE: return new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.125 : -0.5, 15, IType.SIN_DOWN).addPos(0, 0, 0, 35, IType.SIN_FULL))
|
||||
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -1, 25, IType.SIN_DOWN).addPos(0, 0, 0, 75, IType.SIN_UP))
|
||||
.addBus("HAMMER", new BusAnimationSequence().addPos(1, 0, 0, 50, IType.SIN_UP).addPos(0, 0, 0, 50, IType.SIN_DOWN))
|
||||
.addBus("BULLET", ammo <= 1 ? new BusAnimationSequence().setPos(100, 0, 0) : new BusAnimationSequence().addPos(0, 0, 0, 90).addPos(0, 0.5, 2.25, 50));
|
||||
case CYCLE_DRY: return new BusAnimation()
|
||||
.addBus("HAMMER", new BusAnimationSequence().addPos(1, 0, 0, 50, IType.SIN_UP).hold(450).addPos(0, 0, 0, 50, IType.SIN_DOWN))
|
||||
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -1, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 75, IType.SIN_UP))
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(-3, 0, 0, 175, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
|
||||
.addBus("BULLET", new BusAnimationSequence().setPos(100, 0, 0));
|
||||
case RELOAD:
|
||||
return new BusAnimation()
|
||||
.addBus("TILT", new BusAnimationSequence().addPos(-30, 0, 0, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
|
||||
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -1, 100, IType.SIN_FULL).hold(1125).addPos(0, 0, 0, 100, IType.SIN_UP))
|
||||
.addBus("MAG", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, -7, -1.5, 300, IType.SIN_UP).hold(400).addPos(0, 0, 0, 300, IType.SIN_UP))
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(3, 0, 0, 750, IType.SIN_FULL).addPos(-3, 0, 0, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
|
||||
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 200).addPos(0, 0, 15, 300, IType.SIN_FULL).hold(900).addPos(0, 0, 0, 150, IType.SIN_FULL))
|
||||
.addBus("BULLET", new BusAnimationSequence().setPos(ammo <= 1 ? 100 : 0, 0, 0).hold(750).setPos(0, 0, 0).hold(750).addPos(0, 0.5, 2.25, 50));
|
||||
case JAMMED: return new BusAnimation()
|
||||
.addBus("TILT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-30, 0, 0, 150, IType.SIN_FULL).hold(800).addPos(0, 0, 0, 150, IType.SIN_FULL))
|
||||
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, 25, 150, IType.SIN_FULL).hold(800).addPos(0, 0, 0, 150, IType.SIN_FULL))
|
||||
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 750).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 100, IType.SIN_UP).hold(100).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 100, IType.SIN_UP))
|
||||
.addBus("BULLET", new BusAnimationSequence().setPos(0, 0.5, 2.25).hold(750).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(100).addPos(0, 0.5, 2.25, 100, IType.SIN_UP).hold(100).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(100).addPos(0, 0.5, 2.25, 100, IType.SIN_UP));
|
||||
case INSPECT: return new BusAnimation()
|
||||
.addBus("TILT", new BusAnimationSequence().addPos(-30, 0, 0, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
|
||||
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 25, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
|
||||
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 350).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(1125).addPos(0, 0, 0, 100, IType.SIN_UP))
|
||||
.addBus("BULLET", ammo <= 1 ? new BusAnimationSequence().setPos(100, 0, 0) : new BusAnimationSequence().setPos(0, 0.5, 2.25).hold(350).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(1125).addPos(0, 0.5, 2.25, 100, IType.SIN_UP));
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ public class XFactory50 {
|
||||
.setCasing(casing50.clone().setColor(SpentCasing.COLOR_CASE_44).register("bmg50ap"));
|
||||
bmg50_du = new BulletConfig().setItem(EnumAmmo.BMG50_DU).setCasing(EnumCasingType.LARGE_STEEL, 12).setDoesPenetrate(true).setDamageFalloffByPen(false).setDamage(1.5F).setThresholdNegation(21F).setArmorPiercing(0.25F)
|
||||
.setCasing(casing50.clone().setColor(SpentCasing.COLOR_CASE_44).register("bmg50du"));
|
||||
bmg50_he = new BulletConfig().setItem(EnumAmmo.BMG50_HE).setCasing(EnumCasingType.LARGE_STEEL, 12).setWear(3F).setDoesPenetrate(true).setDamageFalloffByPen(false).setDamage(1.75F).setOnImpact(LAMBDA_STANDARD_EXPLODE)
|
||||
bmg50_he = new BulletConfig().setItem(EnumAmmo.BMG50_HE).setCasing(EnumCasingType.LARGE_STEEL, 12).setWear(3F).setDamage(1.75F).setOnImpact(LAMBDA_STANDARD_EXPLODE)
|
||||
.setCasing(casing50.clone().setColor(SpentCasing.COLOR_CASE_44).register("bmg50he"));
|
||||
bmg50_sm = new BulletConfig().setItem(EnumAmmo.BMG50_SM).setCasing(EnumCasingType.LARGE_STEEL, 6).setWear(10F).setDoesPenetrate(true).setDamageFalloffByPen(false).setDamage(2.5F).setThresholdNegation(30F).setArmorPiercing(0.35F)
|
||||
.setCasing(casing50.clone().setColor(SpentCasing.COLOR_CASE_44).register("bmg50sm"));
|
||||
|
||||
@ -41,7 +41,7 @@ public class HUDComponentAmmoCounter implements IHUDComponent {
|
||||
|
||||
@Override
|
||||
public int getComponentHeight(EntityPlayer player, ItemStack stack){
|
||||
return 19;
|
||||
return 17;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -91,6 +91,7 @@ public class XWeaponModManager {
|
||||
ModItems.gun_spas12,
|
||||
ModItems.gun_panzerschreck };
|
||||
Item[] wsteelGuns = new Item[] {
|
||||
ModItems.gun_star_f, ModItems.gun_star_f_akimbo,
|
||||
ModItems.gun_g3, ModItems.gun_g3_zebra,
|
||||
ModItems.gun_stinger,
|
||||
ModItems.gun_chemthrower };
|
||||
@ -130,7 +131,7 @@ public class XWeaponModManager {
|
||||
new WeaponModDefinition(EnumModGeneric.BRONZE_DURA).addMod(bronzeGuns, new WeaponModGenericDurability(117));
|
||||
|
||||
new WeaponModDefinition(EnumModSpecial.SPEEDLOADER).addMod(ModItems.gun_liberator, new WeaponModLiberatorSpeedloader(200));
|
||||
new WeaponModDefinition(EnumModSpecial.SILENCER).addMod(new Item[] {ModItems.gun_am180, ModItems.gun_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_g3, ModItems.gun_amat}, new WeaponModSilencer(ID_SILENCER));
|
||||
new WeaponModDefinition(EnumModSpecial.SILENCER).addMod(new Item[] {ModItems.gun_am180, ModItems.gun_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_star_f, ModItems.gun_star_f_akimbo, ModItems.gun_g3, ModItems.gun_amat}, new WeaponModSilencer(ID_SILENCER));
|
||||
new WeaponModDefinition(EnumModSpecial.SCOPE).addMod(new Item[] {ModItems.gun_heavy_revolver, ModItems.gun_g3, ModItems.gun_mas36, ModItems.gun_charge_thrower}, new WeaponModScope(ID_SCOPE));
|
||||
new WeaponModDefinition(EnumModSpecial.SAW)
|
||||
.addMod(new Item[] {ModItems.gun_maresleg, ModItems.gun_double_barrel}, new WeaponModSawedOff(ID_SAWED_OFF))
|
||||
@ -176,7 +177,9 @@ public class XWeaponModManager {
|
||||
BulletConfig[] r762 = new BulletConfig[] {XFactory762mm.r762_sp, XFactory762mm.r762_fmj, XFactory762mm.r762_jhp, XFactory762mm.r762_ap, XFactory762mm.r762_du, XFactory762mm.r762_he};
|
||||
BulletConfig[] bmg50 = new BulletConfig[] {XFactory50.bmg50_sp, XFactory50.bmg50_fmj, XFactory50.bmg50_jhp, XFactory50.bmg50_ap, XFactory50.bmg50_du, XFactory50.bmg50_he};
|
||||
new WeaponModDefinition(EnumModCaliber.P9)
|
||||
.addMod(ModItems.gun_henry, new WeaponModCaliber(300, 28, 10F, p9));
|
||||
.addMod(ModItems.gun_henry, new WeaponModCaliber(300, 28, 10F, p9))
|
||||
.addMod(ModItems.gun_star_f, new WeaponModCaliber(301, 12, 15F, p9))
|
||||
.addMod(ModItems.gun_star_f_akimbo, new WeaponModCaliber(302, 12, 15F, p9));
|
||||
new WeaponModDefinition(EnumModCaliber.P45)
|
||||
.addMod(ModItems.gun_henry, new WeaponModCaliber(310, 28, 10F, p45))
|
||||
.addMod(ModItems.gun_greasegun, new WeaponModCaliber(311, 24, 3F, p45))
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.lib;
|
||||
public class RefStrings {
|
||||
public static final String MODID = "hbm";
|
||||
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
||||
public static final String VERSION = "1.0.27 BETA (5572)";
|
||||
public static final String VERSION = "1.0.27 BETA (5593)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -61,6 +61,7 @@ import com.hbm.render.item.ItemRenderMissileGeneric.RenderMissileType;
|
||||
import com.hbm.render.item.block.ItemRenderBlock;
|
||||
import com.hbm.render.item.block.ItemRenderDecoBlock;
|
||||
import com.hbm.render.item.weapon.*;
|
||||
import com.hbm.render.loader.HFRModelReloader;
|
||||
import com.hbm.render.loader.HmfModelLoader;
|
||||
import com.hbm.render.model.ModelPigeon;
|
||||
import com.hbm.render.tileentity.*;
|
||||
@ -162,7 +163,9 @@ public class ClientProxy extends ServerProxy {
|
||||
|
||||
Jars.initJars();
|
||||
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new QMAWLoader());
|
||||
IReloadableResourceManager resourceMan = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager();
|
||||
resourceMan.registerReloadListener(new QMAWLoader());
|
||||
resourceMan.registerReloadListener(new HFRModelReloader());
|
||||
|
||||
if(GeneralConfig.enableSoundExtension) {
|
||||
SoundSystemConfig.setNumberNormalChannels(GeneralConfig.normalSoundChannels);
|
||||
@ -309,6 +312,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBatterySocket.class, new RenderBatterySocket());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBatteryREDD.class, new RenderBatteryREDD());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLargeTurbine.class, new RenderBigTurbine());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineIndustrialTurbine.class, new RenderIndustrialTurbine());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineReactorBreeding.class, new RenderBreeder());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolarBoiler.class, new RenderSolarBoiler());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStorageDrum.class, new RenderStorageDrum());
|
||||
@ -440,7 +444,6 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatz.class, new RenderWatz());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatzPump.class, new RenderWatzPump());
|
||||
//doors
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVaultDoor.class, new RenderVaultDoor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlastDoor.class, new RenderBlastDoor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDoorGeneric.class, new RenderDoorGeneric());
|
||||
//storage
|
||||
|
||||
@ -220,7 +220,6 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModItems.memespoon, 1), new Object[] { "CGC", "PSP", "IAI", 'C', ModItems.powder_yellowcake, 'G', TH232.block(), 'P', ModItems.photo_panel, 'S', ModItems.steel_shovel, 'I', ModItems.plate_polymer, 'A', "ingotAustralium" });
|
||||
addShapelessAuto(new ItemStack(ModItems.cbt_device, 1), new Object[] { STEEL.bolt(), ModItems.wrench });
|
||||
|
||||
addShapelessAuto(new ItemStack(ModItems.toothpicks, 3), new Object[] { KEY_STICK, KEY_STICK, KEY_STICK });
|
||||
addRecipeAuto(new ItemStack(ModItems.ducttape, 4), new Object[] { "F", "P", "S", 'F', Items.string, 'S', KEY_SLIME, 'P', Items.paper });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.radio_torch_sender, 4), new Object[] { "G", "R", "I", 'G', "dustGlowstone", 'R', Blocks.redstone_torch, 'I', NETHERQUARTZ.gem() });
|
||||
@ -619,7 +618,6 @@ public class CraftingManager {
|
||||
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) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_transformer), new Object[] { "SCS", "MDM", "SCS", 'S', IRON.ingot(), 'D', MINGRADE.ingot(), 'M',ModItems.coil_advanced_alloy, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CAPACITOR) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_transformer_dnt), new Object[] { "SDS", "MCM", "MCM", 'S', STAR.ingot(), 'D', DESH.ingot(), 'M', MAGTUNG.wireDense(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.radiobox), new Object[] { "PLP", "PSP", "PLP", 'P', STEEL.plate(), 'S', ModItems.ring_starmetal, 'C', ModItems.fusion_core, 'L', getReflector() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.radiorec), new Object[] { " W", "PCP", "PIP", 'W', CU.wireFine(), 'P', STEEL.plate(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE), 'I', ANY_PLASTIC.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModItems.jackt), new Object[] { "S S", "LIL", "LIL", 'S', STEEL.plate(), 'L', Items.leather, 'I', ANY_RUBBER.ingot() });
|
||||
@ -729,8 +727,8 @@ public class CraftingManager {
|
||||
addShapelessAuto(new ItemStack(ModItems.ams_catalyst_schrabidium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_dagaz, ModItems.rune_hagalaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, SA326.dust(), SA326.dust(), SA326.dust(), SA326.dust() });
|
||||
addShapelessAuto(new ItemStack(ModItems.ams_catalyst_dineutronium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_hagalaz, ModItems.rune_hagalaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, DNT.dust(), DNT.dust(), DNT.dust(), DNT.dust() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_core, 1), new Object[] { "DLD", "LML", "DLD", 'D', ModItems.ingot_bismuth, 'L', DNT.block(), 'M', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_emitter, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModItems.crystal_xen, 'L', ModItems.sat_head_laser });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_receiver, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModBlocks.block_dineutronium, 'L', STEEL.shell() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_emitter, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', new ItemStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_QUANTUM.ordinal()), 'X', ModItems.crystal_xen, 'L', ModItems.sat_head_laser });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_receiver, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', new ItemStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_QUANTUM.ordinal()), 'X', ModBlocks.block_dineutronium, 'L', STEEL.shell() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_injector, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', CMB.plate(), 'T', ModBlocks.machine_fluidtank, 'X', ModItems.motor, 'L', STEEL.pipe() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_stabilizer, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModItems.singularity_spark, 'X', ModBlocks.hadron_coil_alloy, 'L', ModItems.crystal_xen });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.barrel_plastic, 1), new Object[] { "IPI", "I I", "IPI", 'I', ModItems.plate_polymer, 'P', AL.plate() });
|
||||
@ -1072,11 +1070,6 @@ public class CraftingManager {
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.BOARD_BLANK)
|
||||
});
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.sliding_blast_door_skin), "SPS", "DPD", "SPS", 'P', Items.paper, 'D', "dye", 'S', STEEL.plate());
|
||||
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin, 1, 1), new ItemStack(ModItems.sliding_blast_door_skin, 1, 0));
|
||||
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin, 1, 2), new ItemStack(ModItems.sliding_blast_door_skin, 1, 1));
|
||||
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin), new ItemStack(ModItems.sliding_blast_door_skin, 1, 2));
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 0), " I ", "IPI", " I ", 'I', STEEL.ingot(), 'P', STEEL.plateCast());
|
||||
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 1), " I ", "IPI", " I ", 'I', ALLOY.ingot(), 'P', ALLOY.plateCast());
|
||||
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 2), " I ", "IPI", " I ", 'I', DESH.ingot(), 'P', DESH.plateCast());
|
||||
|
||||
@ -1477,6 +1477,14 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:tile.sat_laser");
|
||||
ignoreMappings.add("hbm:tile.sat_foeq");
|
||||
ignoreMappings.add("hbm:tile.sat_resonator");
|
||||
ignoreMappings.add("hbm:item.sliding_blast_door_skin");
|
||||
ignoreMappings.add("hbm:tile.dummy_block_vault");
|
||||
ignoreMappings.add("hbm:item.toothpicks");
|
||||
ignoreMappings.add("hbm:item.ams_focus_blank");
|
||||
ignoreMappings.add("hbm:item.ams_focus_limiter");
|
||||
ignoreMappings.add("hbm:item.ams_focus_booster");
|
||||
ignoreMappings.add("hbm:item.ams_muzzle");
|
||||
ignoreMappings.add("hbm:tile.machine_transformer_dnt");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -224,6 +224,15 @@ public class ModEventHandlerClient {
|
||||
text.add("Meta: " + world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ));
|
||||
ILookOverlay.printGeneric(event, "DEBUG", 0xffff00, 0x4040000, text);*/
|
||||
|
||||
if(ClientConfig.SHOW_BLOCK_META_OVERLAY.get()) {
|
||||
Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ);
|
||||
int i = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ);
|
||||
List<String> text = new ArrayList();
|
||||
text.add(b.getUnlocalizedName());
|
||||
text.add("Meta: " + i);
|
||||
ILookOverlay.printGeneric(event, "DEBUG", 0xffff00, 0x4040000, text);
|
||||
}
|
||||
|
||||
} else if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
|
||||
Entity entity = mop.entityHit;
|
||||
|
||||
@ -821,8 +830,7 @@ public class ModEventHandlerClient {
|
||||
//@SubscribeEvent
|
||||
public void onRenderStorm(RenderHandEvent event) {
|
||||
|
||||
if(BlockAshes.ashes == 0)
|
||||
return;
|
||||
if(BlockAshes.ashes <= 0) return;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@ -896,7 +904,7 @@ public class ModEventHandlerClient {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ArmorNo9.updateWorldHook(mc.theWorld);
|
||||
|
||||
boolean supportsHighRenderDistance = FMLClientHandler.instance().hasOptifine() || Loader.isModLoaded("angelica");
|
||||
boolean supportsHighRenderDistance = FMLClientHandler.instance().hasOptifine() || Loader.isModLoaded(Compat.MOD_ANG);
|
||||
|
||||
if(mc.gameSettings.renderDistanceChunks > 16 && GeneralConfig.enableRenderDistCheck && !supportsHighRenderDistance) {
|
||||
mc.gameSettings.renderDistanceChunks = 16;
|
||||
@ -929,7 +937,6 @@ public class ModEventHandlerClient {
|
||||
|
||||
//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);
|
||||
|
||||
@ -13,6 +13,7 @@ import com.hbm.items.weapon.sedna.factory.XFactoryDrill;
|
||||
import com.hbm.packet.PermaSyncHandler;
|
||||
import com.hbm.render.item.weapon.sedna.ItemRenderWeaponBase;
|
||||
import com.hbm.render.model.ModelMan;
|
||||
import com.hbm.render.util.RenderScreenOverlay;
|
||||
import com.hbm.util.Clock;
|
||||
import com.hbm.world.biome.BiomeGenCraterBase;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
@ -570,6 +571,11 @@ public class ModEventHandlerRenderer {
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onRenderHUD(RenderGameOverlayEvent.Pre event) {
|
||||
|
||||
//TODO: using ALL doesn't work as anticipated - still hides in F1. need a different event for this
|
||||
if(event.type == ElementType.ALL) {
|
||||
if(ClientConfig.BADGES_HUD.get()) RenderScreenOverlay.renderBadges(event.resolution, Minecraft.getMinecraft().ingameGUI);
|
||||
}
|
||||
|
||||
if(event.type == ElementType.HOTBAR && (ModEventHandlerClient.shakeTimestamp + ModEventHandlerClient.shakeDuration - System.currentTimeMillis()) > 0 && ClientConfig.NUKE_HUD_SHAKE.get()) {
|
||||
double mult = (ModEventHandlerClient.shakeTimestamp + ModEventHandlerClient.shakeDuration - System.currentTimeMillis()) / (double) ModEventHandlerClient.shakeDuration * 2;
|
||||
double horizontal = MathHelper.clamp_double(Math.sin(System.currentTimeMillis() * 0.02), -0.7, 0.7) * 15;
|
||||
@ -581,7 +587,7 @@ public class ModEventHandlerRenderer {
|
||||
@SubscribeEvent
|
||||
public void onRenderHand(RenderHandEvent event) {
|
||||
|
||||
//can't use plaxer.getHeldItem() here because the item rendering persists for a few frames after hitting the switch key
|
||||
//can't use player.getHeldItem() here because the item rendering persists for a few frames after hitting the switch key
|
||||
ItemStack toRender = Minecraft.getMinecraft().entityRenderer.itemRenderer.itemToRender;
|
||||
|
||||
if(toRender != null) {
|
||||
|
||||
@ -69,7 +69,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(ModItems.burnt_bark));
|
||||
API.hideItem(new ItemStack(ModItems.ams_core_thingy));
|
||||
}
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_vault));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_blast));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_compact_launcher));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_launch_table));
|
||||
|
||||
@ -105,9 +105,10 @@ public class ResourceManager {
|
||||
public static final IModelCustom pump = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/pump.obj")).asVBO();
|
||||
|
||||
//Large Turbine
|
||||
public static final IModelCustom steam_engine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/steam_engine.obj")).asVBO();
|
||||
public static final IModelCustom turbine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/turbine.obj"));
|
||||
public static final IModelCustom chungus = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/chungus.obj")).asVBO();
|
||||
public static final IModelCustom steam_engine = new HFRWavefrontObject("models/machines/steam_engine.obj").asVBO();
|
||||
public static final IModelCustom turbine = new HFRWavefrontObject("models/machines/turbine.obj").asVBO();
|
||||
public static final IModelCustom industrial_turbine = new HFRWavefrontObject("models/machines/industrial_turbine.obj").asVBO();
|
||||
public static final IModelCustom chungus = new HFRWavefrontObject("models/machines/chungus.obj").asVBO();
|
||||
|
||||
//Cooling Tower
|
||||
public static final IModelCustom tower_small = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/tower_small.obj")).asVBO();
|
||||
@ -118,13 +119,13 @@ public class ResourceManager {
|
||||
public static final IModelCustom condenser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/condenser.obj")).asVBO();
|
||||
|
||||
//Wood burner
|
||||
public static final IModelCustom wood_burner = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/wood_burner.obj"));
|
||||
public static final IModelCustom wood_burner = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/wood_burner.obj")).asVBO();
|
||||
|
||||
//IGen
|
||||
public static final IModelCustom igen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/igen.obj"));
|
||||
|
||||
//Combustion Engine
|
||||
public static final IModelCustom dieselgen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/dieselgen.obj"));
|
||||
public static final IModelCustom dieselgen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/dieselgen.obj")).asVBO();
|
||||
public static final IModelCustom combustion_engine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/combustion_engine.obj")).asVBO();
|
||||
|
||||
//Press
|
||||
@ -159,7 +160,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom purex = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/purex.obj")).asVBO();
|
||||
|
||||
//Mixer
|
||||
public static final IModelCustom mixer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mixer.obj"));
|
||||
public static final IModelCustom mixer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mixer.obj")).asVBO();
|
||||
|
||||
//Arc Welder
|
||||
public static final IModelCustom arc_welder = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/arc_welder.obj"), false).asVBO();
|
||||
@ -183,7 +184,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom microwave = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/microwave.obj"));
|
||||
|
||||
//Big Man Johnson
|
||||
public static final IModelCustom autosaw = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/autosaw.obj"));
|
||||
public static final IModelCustom autosaw = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/autosaw.obj"), false).asVBO();
|
||||
|
||||
//Mining Drill
|
||||
public static final IModelCustom mining_drill = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mining_drill.obj")).asVBO();
|
||||
@ -326,53 +327,52 @@ public class ResourceManager {
|
||||
public static final IModelCustom blast_door_slider = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blast_door_slider.obj"));
|
||||
public static final IModelCustom blast_door_block = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blast_door_block.obj"));
|
||||
|
||||
//Sliding Blast Door
|
||||
public static final ResourceLocation sliding_blast_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/sliding_blast_door.png");
|
||||
public static final ResourceLocation sliding_blast_door_variant1_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/sliding_blast_door_variant1.png");
|
||||
public static final ResourceLocation sliding_blast_door_variant2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/sliding_blast_door_variant2.png");
|
||||
|
||||
public static AnimatedModel sliding_blast_door = ColladaLoader.load(new ResourceLocation(RefStrings.MODID, "models/doors/sliding_blast_door.dae"));
|
||||
public static Animation sliding_blast_door_anim = ColladaLoader.loadAnim(1200, new ResourceLocation(RefStrings.MODID, "models/doors/sliding_blast_door.dae"));
|
||||
|
||||
//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"));
|
||||
|
||||
//PheoDoors
|
||||
public static final ResourceLocation pheo_fire_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/fire_door.png");
|
||||
public static final ResourceLocation pheo_fire_door_black_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/fire_door_black.png");
|
||||
public static final ResourceLocation pheo_fire_door_orange_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/fire_door_orange.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 final ResourceLocation pheo_airlock_door_clean_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/airlock_door_clean.png");
|
||||
public static final ResourceLocation pheo_airlock_door_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/airlock_door_green.png");
|
||||
public static IModelCustomNamed pheo_airlock_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/airlock_door.obj")).asVBO();
|
||||
public static final ResourceLocation pheo_blast_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/blast_door.png");
|
||||
public static IModelCustomNamed pheo_blast_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/blast_door.obj")).asVBO();
|
||||
public static final ResourceLocation pheo_containment_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/containment_door.png");
|
||||
public static IModelCustomNamed pheo_containment_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/containment_door.obj")).asVBO();
|
||||
public static final ResourceLocation pheo_seal_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/seal_door.png");
|
||||
public static IModelCustomNamed pheo_seal_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/seal_door.obj")).asVBO();
|
||||
public static final ResourceLocation pheo_secure_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/secure_door.png");
|
||||
public static final ResourceLocation pheo_secure_door_grey_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/secure_door_grey.png");
|
||||
public static IModelCustomNamed pheo_secure_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/secure_door.obj")).asVBO();
|
||||
public static final ResourceLocation pheo_sliding_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/sliding_door.png");
|
||||
public static IModelCustomNamed pheo_sliding_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/sliding_door.obj")).asVBO();
|
||||
public static final ResourceLocation pheo_vehicle_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vehicle_door.png");
|
||||
public static IModelCustomNamed pheo_vehicle_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/vehicle_door.obj")).asVBO();
|
||||
public static final ResourceLocation pheo_water_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/water_door.png");
|
||||
public static IModelCustomNamed pheo_water_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/water_door.obj")).asVBO();
|
||||
public static final ResourceLocation pheo_vault_door_3 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/vault_door_3.png");
|
||||
public static final ResourceLocation pheo_vault_door_4 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/vault_door_4.png");
|
||||
public static final ResourceLocation pheo_vault_door_s = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/vault_door_s.png");
|
||||
public static final ResourceLocation pheo_label_2 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_2.png");
|
||||
public static final ResourceLocation pheo_label_81 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_81.png");
|
||||
public static final ResourceLocation pheo_label_87 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_87.png");
|
||||
public static final ResourceLocation pheo_label_99 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_99.png");
|
||||
public static final ResourceLocation pheo_label_101 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_101.png");
|
||||
public static final ResourceLocation pheo_label_106 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_106.png");
|
||||
public static final ResourceLocation pheo_label_111 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_111.png");
|
||||
public static IModelCustomNamed pheo_vault_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/vault_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");
|
||||
public static IModelCustomNamed secure_access_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/secure_access_door.obj")).asVBO();
|
||||
|
||||
public static final ResourceLocation water_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/water_door.png");
|
||||
public static IModelCustomNamed water_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/water_door.obj")).asVBO();
|
||||
|
||||
public static final ResourceLocation sliding_seal_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/sliding_seal_door.png");
|
||||
public static IModelCustomNamed sliding_seal_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/sliding_seal_door.obj")).asVBO();
|
||||
|
||||
public static final ResourceLocation round_airlock_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/round_airlock_door.png");
|
||||
public static IModelCustomNamed round_airlock_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/round_airlock_door.obj")).asVBO();
|
||||
|
||||
public static final ResourceLocation qe_sliding_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/qe_sliding_door.png");
|
||||
public static IModelCustomNamed qe_sliding_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/qe_sliding_door.obj")).asVBO();
|
||||
|
||||
public static final ResourceLocation qe_containment_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/qe_containment.png");
|
||||
public static IModelCustomNamed qe_containment = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/qe_containment.obj")).asVBO();
|
||||
|
||||
public static final ResourceLocation large_vehicle_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/large_vehicle_door.png");
|
||||
public static IModelCustomNamed large_vehicle_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/large_vehicle_door.obj")).asVBO();
|
||||
public static final ResourceLocation qe_containment_decal = new ResourceLocation(RefStrings.MODID, "textures/models/doors/qe_containment_decal.png");
|
||||
|
||||
//Doors
|
||||
public static final ResourceLocation silo_hatch_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/silo_hatch.png");
|
||||
public static IModelCustomNamed silo_hatch = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/silo_hatch.obj")).asVBO();
|
||||
public static final ResourceLocation silo_hatch_large_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/silo_hatch_large.png");
|
||||
public static IModelCustomNamed silo_hatch_large = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/silo_hatch_large.obj")).asVBO();
|
||||
|
||||
|
||||
//Skeleton
|
||||
public static final IModelCustom skeleton_holder = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/blocks/skeleton_holder.obj"),false).asVBO();
|
||||
|
||||
@ -547,6 +547,7 @@ public class ResourceManager {
|
||||
//Large Turbine
|
||||
public static final ResourceLocation steam_engine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/steam_engine.png");
|
||||
public static final ResourceLocation turbine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/turbine.png");
|
||||
public static final ResourceLocation industrial_turbine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/industrial_turbine.png");
|
||||
public static final ResourceLocation chungus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/chungus.png");
|
||||
|
||||
//Cooling Tower
|
||||
@ -914,6 +915,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom uzi = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/uzi.obj")).asVBO();
|
||||
public static final IModelCustom spas_12 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/spas-12.obj")).asVBO();
|
||||
public static final IModelCustom panzerschreck = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/panzerschreck.obj")).asVBO();
|
||||
public static final IModelCustom star_f = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/star_f.obj")).asVBO();
|
||||
public static final IModelCustom g3 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/g3.obj")).asVBO();
|
||||
public static final IModelCustom stinger = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/stinger.obj")).asVBO();
|
||||
public static final IModelCustom chemthrower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/chemthrower.obj")).asVBO();
|
||||
@ -966,6 +968,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom armor_steamsuit = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/steamsuit.obj")).asVBO();
|
||||
public static final IModelCustom armor_dieselsuit = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/bnuuy.obj")).asVBO();
|
||||
public static final IModelCustom armor_remnant = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/remnant.obj")).asVBO();
|
||||
public static final IModelCustom armor_ncr = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/ncrpa.obj")).asVBO();
|
||||
public static final IModelCustom armor_bismuth = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/bismuth.obj")).asVBO();
|
||||
public static final IModelCustom armor_mod_tesla = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/mod_tesla.obj")).asVBO();
|
||||
public static final IModelCustom armor_wings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/murk.obj")).asVBO();
|
||||
@ -1038,6 +1041,8 @@ public class ResourceManager {
|
||||
public static final ResourceLocation uzi_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi.png");
|
||||
public static final ResourceLocation uzi_saturnite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi_saturnite.png");
|
||||
public static final ResourceLocation panzerschreck_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/panzerschreck.png");
|
||||
public static final ResourceLocation star_f_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/star_f.png");
|
||||
public static final ResourceLocation star_f_elite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/star_f_elite.png");
|
||||
public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.png");
|
||||
public static final ResourceLocation g3_zebra_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_zebra.png");
|
||||
public static final ResourceLocation g3_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_green.png");
|
||||
@ -1150,6 +1155,11 @@ public class ResourceManager {
|
||||
public static final ResourceLocation rpa_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/rpa_chest.png");
|
||||
public static final ResourceLocation rpa_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/rpa_arm.png");
|
||||
|
||||
public static final ResourceLocation ncrpa_helmet = new ResourceLocation(RefStrings.MODID, "textures/armor/ncrpa_helmet.png");
|
||||
public static final ResourceLocation ncrpa_leg = new ResourceLocation(RefStrings.MODID, "textures/armor/ncrpa_leg.png");
|
||||
public static final ResourceLocation ncrpa_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/ncrpa_chest.png");
|
||||
public static final ResourceLocation ncrpa_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/ncrpa_arm.png");
|
||||
|
||||
public static final ResourceLocation taurun_helmet = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_helmet.png");
|
||||
public static final ResourceLocation taurun_leg = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_leg.png");
|
||||
public static final ResourceLocation taurun_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_chest.png");
|
||||
|
||||
@ -50,8 +50,6 @@ public class MuzzleFlashPacket implements IMessage {
|
||||
if(stack == null) return null;
|
||||
|
||||
if(stack.getItem() instanceof ItemGunBaseNT) {
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
|
||||
ItemRenderWeaponBase.flashMap.put(entity, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.hbm.packet.toclient;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityBlastDoor;
|
||||
import com.hbm.tileentity.machine.TileEntityVaultDoor;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@ -22,9 +21,7 @@ public class TEVaultPacket implements IMessage {
|
||||
long sysTime;
|
||||
int type;
|
||||
|
||||
public TEVaultPacket() {
|
||||
|
||||
}
|
||||
public TEVaultPacket() { }
|
||||
|
||||
public TEVaultPacket(int x, int y, int z, boolean isOpening, int state, long sysTime, int type) {
|
||||
this.x = x;
|
||||
@ -66,23 +63,11 @@ public class TEVaultPacket implements IMessage {
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
|
||||
try {
|
||||
if (te != null && te instanceof TileEntityVaultDoor) {
|
||||
|
||||
TileEntityVaultDoor vault = (TileEntityVaultDoor) te;
|
||||
vault.isOpening = m.isOpening;
|
||||
vault.state = m.state;
|
||||
if(m.sysTime == 1)
|
||||
vault.sysTime = System.currentTimeMillis();
|
||||
vault.type = m.type;
|
||||
}
|
||||
|
||||
if (te != null && te instanceof TileEntityBlastDoor) {
|
||||
|
||||
TileEntityBlastDoor vault = (TileEntityBlastDoor) te;
|
||||
vault.isOpening = m.isOpening;
|
||||
vault.state = m.state;
|
||||
if(m.sysTime == 1)
|
||||
vault.sysTime = System.currentTimeMillis();
|
||||
if(m.sysTime == 1) vault.sysTime = System.currentTimeMillis();
|
||||
}
|
||||
} catch (Exception x) {
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import java.util.Random;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
@ -69,6 +70,9 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
this.motionY = my;
|
||||
this.motionZ = mz;
|
||||
|
||||
// i am at a loss for words as to what the fuck is going on here, but this is needed, stop asking, fuck you
|
||||
this.setPosition(x, y, z);
|
||||
|
||||
particleGravity = 1F;
|
||||
}
|
||||
|
||||
@ -128,16 +132,26 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
|
||||
rotationPitch += momentumPitch;
|
||||
rotationYaw += momentumYaw;
|
||||
|
||||
if(Math.abs(prevRotationPitch - rotationPitch) > 180) {
|
||||
if(prevRotationPitch < rotationPitch) prevRotationPitch += 360;
|
||||
if(prevRotationPitch > rotationPitch) prevRotationPitch -= 360;
|
||||
}
|
||||
|
||||
if(Math.abs(prevRotationYaw - rotationYaw) > 180) {
|
||||
if(prevRotationYaw < rotationYaw) prevRotationYaw += 360;
|
||||
if(prevRotationYaw > rotationYaw) prevRotationYaw -= 360;
|
||||
}
|
||||
}
|
||||
|
||||
public void moveEntity(double motionX, double motionY, double motionZ) {
|
||||
this.worldObj.theProfiler.startSection("move");
|
||||
this.ySize *= 0.4F;
|
||||
|
||||
if (this.isInWeb) {
|
||||
if(this.isInWeb) {
|
||||
this.isInWeb = false;
|
||||
motionX *= 0.25D;
|
||||
motionY *= 0.05000000074505806D;
|
||||
motionY *= 0.05D;
|
||||
motionZ *= 0.25D;
|
||||
this.motionX = 0.0D;
|
||||
this.motionY = 0.0D;
|
||||
@ -151,7 +165,7 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
|
||||
List list = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(motionX, motionY, motionZ));
|
||||
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
for(int i = 0; i < list.size(); ++i) {
|
||||
motionY = ((AxisAlignedBB)list.get(i)).calculateYOffset(this.boundingBox, motionY);
|
||||
}
|
||||
|
||||
@ -159,13 +173,13 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
|
||||
int j;
|
||||
|
||||
for (j = 0; j < list.size(); ++j) {
|
||||
for(j = 0; j < list.size(); ++j) {
|
||||
motionX = ((AxisAlignedBB)list.get(j)).calculateXOffset(this.boundingBox, motionX);
|
||||
}
|
||||
|
||||
this.boundingBox.offset(motionX, 0.0D, 0.0D);
|
||||
|
||||
for (j = 0; j < list.size(); ++j) {
|
||||
for(j = 0; j < list.size(); ++j) {
|
||||
motionZ = ((AxisAlignedBB)list.get(j)).calculateZOffset(this.boundingBox, motionZ);
|
||||
}
|
||||
|
||||
@ -215,6 +229,10 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
momentumYaw = (float) rand.nextGaussian() * 10F * this.config.getBounceYaw();
|
||||
}
|
||||
|
||||
if(this.config.getSound() != null && isCollidedVertically && Math.abs(initMoY) >= 0.2) {
|
||||
MainRegistry.proxy.playSoundClient(posX, posY, posZ, this.config.getSound(), this.config.PLINK_LARGE.equals(this.config.getSound()) ? 1F : 0.5F, 1F + this.rand.nextFloat() * 0.2F);
|
||||
}
|
||||
|
||||
this.worldObj.theProfiler.endSection();
|
||||
}
|
||||
|
||||
@ -262,8 +280,8 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
|
||||
GL11.glScalef(dScale, dScale, dScale);
|
||||
|
||||
GL11.glRotatef(180 - rotationYaw, 0, 1, 0);
|
||||
GL11.glRotatef(-rotationPitch, 1, 0, 0);
|
||||
GL11.glRotatef(180 - (float) BobMathUtil.interp(prevRotationYaw, rotationYaw, interp), 0, 1, 0);
|
||||
GL11.glRotatef((float) -BobMathUtil.interp(prevRotationPitch, rotationPitch, interp), 1, 0, 0);
|
||||
|
||||
GL11.glScalef(config.getScaleX(), config.getScaleY(), config.getScaleZ());
|
||||
|
||||
|
||||
@ -23,8 +23,7 @@ public class SpentCasing implements Cloneable {
|
||||
public enum CasingType {
|
||||
STRAIGHT("Straight"),
|
||||
BOTTLENECK("Bottleneck"),
|
||||
SHOTGUN("Shotgun", "ShotgunCase"), //plastic shell, brass case
|
||||
AR2("AR2", "AR2Highlight"); //plug, back detailing
|
||||
SHOTGUN("Shotgun", "ShotgunCase"); //plastic shell, brass case
|
||||
|
||||
public final String[] partNames;
|
||||
|
||||
@ -44,8 +43,19 @@ public class SpentCasing implements Cloneable {
|
||||
private float bouncePitch = 1F;
|
||||
private int maxAge = 240;
|
||||
|
||||
public static final String PLINK_SHELL = "hbm:weapon.casing.shell";
|
||||
public static final String PLINK_SMALL = "hbm:weapon.casing.small";
|
||||
public static final String PLINK_MEDIUM = "hbm:weapon.casing.medium";
|
||||
public static final String PLINK_LARGE = "hbm:weapon.casing.large";
|
||||
|
||||
public SpentCasing(CasingType type) {
|
||||
this.type = type;
|
||||
|
||||
if(type == CasingType.SHOTGUN) {
|
||||
this.setSound(PLINK_SHELL);
|
||||
} else {
|
||||
this.setSound(PLINK_SMALL);
|
||||
}
|
||||
}
|
||||
|
||||
/** Separated from the ctor to allow for easy creation of new casings from templates that don't need to be registered */
|
||||
@ -56,16 +66,15 @@ public class SpentCasing implements Cloneable {
|
||||
}
|
||||
|
||||
public SpentCasing setScale(float scale) {
|
||||
this.scaleX = scale;
|
||||
this.scaleY = scale;
|
||||
this.scaleZ = scale;
|
||||
return this;
|
||||
return setScale(scale, scale, scale);
|
||||
}
|
||||
|
||||
public SpentCasing setScale(float x, float y, float z) {
|
||||
this.scaleX = x;
|
||||
this.scaleY = y;
|
||||
this.scaleZ = z;
|
||||
if(x * y * z >= 3 && this.type != CasingType.SHOTGUN) this.setSound(PLINK_MEDIUM);
|
||||
if(x * y * z >= 100 && this.type != CasingType.SHOTGUN) this.setSound(PLINK_LARGE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@ -32,6 +32,34 @@ public class CasingCreator implements IParticleCreator {
|
||||
composeEffect(world, player, frontOffset, heightOffset, sideOffset, frontMotion, heightMotion, sideMotion, motionVariance, 5F, 10F, casing, false, 0, 0, 0);
|
||||
}
|
||||
|
||||
public static void composeEffect(World world, double x, double y, double z, float yaw, float pitch, double frontMotion, double heightMotion, double sideMotion, double motionVariance, float mPitch, float mYaw, String casing, boolean smoking, int smokeLife, double smokeLift, int nodeLife) {
|
||||
|
||||
Vec3 motion = Vec3.createVectorHelper(sideMotion, heightMotion, frontMotion);
|
||||
motion.rotateAroundX(-pitch / 180F * (float) Math.PI);
|
||||
motion.rotateAroundY(-yaw / 180F * (float) Math.PI);
|
||||
|
||||
double mX = motion.xCoord + world.rand.nextGaussian() * motionVariance;
|
||||
double mY = motion.yCoord + world.rand.nextGaussian() * motionVariance;
|
||||
double mZ = motion.zCoord + world.rand.nextGaussian() * motionVariance;
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "casingNT");
|
||||
data.setDouble("mX", mX);
|
||||
data.setDouble("mY", mY);
|
||||
data.setDouble("mZ", mZ);
|
||||
data.setFloat("yaw", yaw);
|
||||
data.setFloat("pitch", pitch);
|
||||
data.setFloat("mPitch", mPitch);
|
||||
data.setFloat("mYaw", mYaw);
|
||||
data.setString("name", casing);
|
||||
data.setBoolean("smoking", smoking);
|
||||
data.setInteger("smokeLife", smokeLife);
|
||||
data.setDouble("smokeLift", smokeLift);
|
||||
data.setInteger("nodeLife", nodeLife);
|
||||
|
||||
IParticleCreator.sendPacket(world, x, y, z, 50, data);
|
||||
}
|
||||
|
||||
public static void composeEffect(World world, EntityLivingBase player, double frontOffset, double heightOffset, double sideOffset, double frontMotion, double heightMotion, double sideMotion, double motionVariance, float mPitch, float mYaw, String casing, boolean smoking, int smokeLife, double smokeLift, int nodeLife) {
|
||||
|
||||
if(player.isSneaking()) heightOffset -= 0.075F;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.render.anim;
|
||||
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.util.Clock;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -7,6 +8,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@NotableComments
|
||||
public class HbmAnimations {
|
||||
|
||||
//in flans mod and afaik also MW, there's an issue that there is only one
|
||||
|
||||
@ -25,6 +25,7 @@ public class ItemRenderLibrary {
|
||||
public static HashMap<Item, ItemRenderBase> renderers = new HashMap();
|
||||
|
||||
public static void init() {
|
||||
ItemRenderLibraryDoors.init();
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.obj_tester), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
@ -594,168 +595,6 @@ public class ItemRenderLibrary {
|
||||
bindTexture(ResourceManager.satdock_tex); ResourceManager.satDock.renderAll();
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.vault_door), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.vault_cog_tex); ResourceManager.vault_cog.renderAll();
|
||||
bindTexture(ResourceManager.vault_label_101_tex); ResourceManager.vault_label.renderAll();
|
||||
}});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.secure_access_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(2.4, 2.4, 2.4);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.secure_access_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.secure_access_door.renderAll();
|
||||
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() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(1.8, 1.8, 1.8);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.large_vehicle_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.large_vehicle_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.water_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(4, 4, 4);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.water_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.water_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.silo_hatch), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2, 0);
|
||||
GL11.glScaled(2, 2, 2);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.silo_hatch_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
ResourceManager.silo_hatch.renderPart("Frame");
|
||||
GL11.glTranslated(0, 0.875, -1.875);
|
||||
GL11.glRotated(-120, 1, 0, 0);
|
||||
GL11.glTranslated(0, -0.875, 1.875);
|
||||
GL11.glTranslated(0, 0.25, 0);
|
||||
ResourceManager.silo_hatch.renderPart("Hatch");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.silo_hatch_large), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2, 0);
|
||||
GL11.glScaled(1.5, 1.5, 1.5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.silo_hatch_large_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glTranslated(1, 0, 0);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
ResourceManager.silo_hatch_large.renderPart("Frame");
|
||||
GL11.glTranslated(0, 0.875, -2.875);
|
||||
GL11.glRotated(-120, 1, 0, 0);
|
||||
GL11.glTranslated(0, -0.875, 2.875);
|
||||
GL11.glTranslated(0, 0.25, 0);
|
||||
ResourceManager.silo_hatch_large.renderPart("Hatch");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.qe_containment), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3.5, 0);
|
||||
GL11.glScaled(3.8, 3.8, 3.8);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.qe_containment_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.qe_containment.renderAllExcept("decal");
|
||||
bindTexture(ResourceManager.qe_containment_decal);
|
||||
ResourceManager.qe_containment.renderPart("decal");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.qe_sliding_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3.5, 0);
|
||||
GL11.glScaled(6, 6, 6);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.qe_sliding_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.qe_sliding_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.round_airlock_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3.75, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.pheo_airlock_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_airlock_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.sliding_seal_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(7, 7, 7);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.sliding_seal_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.sliding_seal_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.blast_door), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.blast_door_base_tex); ResourceManager.blast_door_base.renderAll();
|
||||
bindTexture(ResourceManager.blast_door_tooth_tex); ResourceManager.blast_door_tooth.renderAll();
|
||||
bindTexture(ResourceManager.blast_door_slider_tex); ResourceManager.blast_door_slider.renderAll();
|
||||
bindTexture(ResourceManager.blast_door_block_tex); ResourceManager.blast_door_block.renderAll();
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.machine_microwave), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 4);
|
||||
|
||||
229
src/main/java/com/hbm/render/item/ItemRenderLibraryDoors.java
Normal file
229
src/main/java/com/hbm/render/item/ItemRenderLibraryDoors.java
Normal file
@ -0,0 +1,229 @@
|
||||
package com.hbm.render.item;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.util.Clock;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
// the ItemRenderLibrary system sucks and is ugly as hell but it's the quickest way of doing it
|
||||
// due to the sheer size if this stupid fucking class i just janked this part out into its own thing
|
||||
// that way, code hotswap doesn't take 5 years to work while vomitting out error messages like
|
||||
// i vomitted out that 20 pack of soggy chicken nuggets last year
|
||||
// still a better use of €15 than hollow knight
|
||||
@NotableComments
|
||||
public class ItemRenderLibraryDoors {
|
||||
|
||||
public static void init() {
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.vault_door), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glScaled(3.5, 3.5, 3.5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glTranslated(0, -1, 0);
|
||||
int index = (int) ((Clock.get_ms() % (DoorDecl.VAULT_DOOR.getSkinCount() * 1000)) / 1000);
|
||||
|
||||
ResourceLocation doorTex = ResourceManager.pheo_vault_door_3;
|
||||
ResourceLocation labelTex = ResourceManager.pheo_label_101;
|
||||
|
||||
switch(index) {
|
||||
case 1: labelTex = ResourceManager.pheo_label_87; break;
|
||||
case 2: labelTex = ResourceManager.pheo_label_106; break;
|
||||
case 3: doorTex = ResourceManager.pheo_vault_door_4; labelTex = ResourceManager.pheo_label_81; break;
|
||||
case 4: doorTex = ResourceManager.pheo_vault_door_4; labelTex = ResourceManager.pheo_label_111; break;
|
||||
case 5: doorTex = ResourceManager.pheo_vault_door_s; labelTex = ResourceManager.pheo_label_2; break;
|
||||
case 6: doorTex = ResourceManager.pheo_vault_door_s; labelTex = ResourceManager.pheo_label_99; break;
|
||||
}
|
||||
|
||||
bindTexture(doorTex);
|
||||
ResourceManager.pheo_vault_door.renderPart("Door");
|
||||
bindTexture(labelTex);
|
||||
ResourceManager.pheo_vault_door.renderPart("Label");
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.secure_access_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3.75, 0);
|
||||
GL11.glScaled(2.4, 2.4, 2.4);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glTranslated(0, 1, 0);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(DoorDecl.SECURE_ACCESS_DOOR.getCyclingSkins());
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_secure_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.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() {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(DoorDecl.FIRE_DOOR.getCyclingSkins());
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_fire_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.sliding_blast_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2.75, 0);
|
||||
GL11.glScaled(2.5, 2.5, 2.5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.pheo_blast_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_blast_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.large_vehicle_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(1.8, 1.8, 1.8);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
bindTexture(ResourceManager.pheo_vehicle_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_vehicle_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.water_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(4, 4, 4);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
bindTexture(ResourceManager.pheo_water_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_water_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.silo_hatch), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2, 0);
|
||||
GL11.glScaled(2, 2, 2);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.silo_hatch_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
ResourceManager.silo_hatch.renderPart("Frame");
|
||||
GL11.glTranslated(0, 0.875, -1.875);
|
||||
GL11.glRotated(-120, 1, 0, 0);
|
||||
GL11.glTranslated(0, -0.875, 1.875);
|
||||
GL11.glTranslated(0, 0.25, 0);
|
||||
ResourceManager.silo_hatch.renderPart("Hatch");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.silo_hatch_large), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2, 0);
|
||||
GL11.glScaled(1.5, 1.5, 1.5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.silo_hatch_large_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glTranslated(1, 0, 0);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
ResourceManager.silo_hatch_large.renderPart("Frame");
|
||||
GL11.glTranslated(0, 0.875, -2.875);
|
||||
GL11.glRotated(-120, 1, 0, 0);
|
||||
GL11.glTranslated(0, -0.875, 2.875);
|
||||
GL11.glTranslated(0, 0.25, 0);
|
||||
ResourceManager.silo_hatch_large.renderPart("Hatch");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.qe_containment), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3.5, 0);
|
||||
GL11.glScaled(3.8, 3.8, 3.8);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.pheo_containment_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_containment_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.qe_sliding_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glScaled(5, 5, 5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.pheo_sliding_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_sliding_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.round_airlock_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3.75, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(DoorDecl.ROUND_AIRLOCK_DOOR.getCyclingSkins());
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_airlock_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.sliding_seal_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(7, 7, 7);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.pheo_seal_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.pheo_seal_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.blast_door), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.blast_door_base_tex); ResourceManager.blast_door_base.renderAll();
|
||||
bindTexture(ResourceManager.blast_door_tooth_tex); ResourceManager.blast_door_tooth.renderAll();
|
||||
bindTexture(ResourceManager.blast_door_slider_tex); ResourceManager.blast_door_slider.renderAll();
|
||||
bindTexture(ResourceManager.blast_door_block_tex); ResourceManager.blast_door_block.renderAll();
|
||||
}});
|
||||
}
|
||||
|
||||
private static void bindTexture(ResourceLocation res) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(res);
|
||||
}
|
||||
}
|
||||
@ -141,11 +141,9 @@ public class ItemRenderDebug extends ItemRenderWeaponBase {
|
||||
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;
|
||||
|
||||
@ -145,7 +145,7 @@ public class ItemRenderMinigun extends ItemRenderWeaponBase {
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, 12);
|
||||
GL11.glTranslated(0, 0, 12.25);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
|
||||
if(stack.getItem() == ModItems.gun_minigun_lacunae) {
|
||||
|
||||
@ -134,7 +134,7 @@ public class ItemRenderMinigunDual extends ItemRenderWeaponBase {
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, 12);
|
||||
GL11.glTranslated(0, 0, 12.25);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
|
||||
GL11.glRotated(shotRand * 90, 1, 0, 0);
|
||||
@ -164,7 +164,7 @@ public class ItemRenderMinigunDual extends ItemRenderWeaponBase {
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, 12);
|
||||
GL11.glTranslated(0, 0, 12.25);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
|
||||
GL11.glRotated(shotRand * 90, 1, 0, 0);
|
||||
|
||||
@ -0,0 +1,204 @@
|
||||
package com.hbm.render.item.weapon.sedna;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemRenderStarF extends ItemRenderWeaponBase {
|
||||
|
||||
@Override
|
||||
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
|
||||
|
||||
@Override
|
||||
public float getViewFOV(ItemStack stack, float fov) {
|
||||
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
|
||||
return fov * (1 - aimingProgress * 0.33F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupFirstPerson(ItemStack stack) {
|
||||
GL11.glTranslated(0, 0, 0.875);
|
||||
|
||||
float offset = 0.8F;
|
||||
standardAimingTransform(stack,
|
||||
-1.75F * offset, -1.75F * offset, 2.5F * offset,
|
||||
0, -7.625 / 8D, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFirstPerson(ItemStack stack) {
|
||||
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_tex);
|
||||
double scale = 0.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
|
||||
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER");
|
||||
double[] tilt = HbmAnimations.getRelevantTransformation("TILT");
|
||||
double[] turn = HbmAnimations.getRelevantTransformation("TURN");
|
||||
double[] mag = HbmAnimations.getRelevantTransformation("MAG");
|
||||
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET");
|
||||
double[] slide = HbmAnimations.getRelevantTransformation("SLIDE");
|
||||
|
||||
GL11.glTranslated(0, -2, -8);
|
||||
GL11.glRotated(equip[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 2, 8);
|
||||
|
||||
GL11.glTranslated(0, 1, -3);
|
||||
GL11.glRotated(turn[2], 0, 0, 1);
|
||||
GL11.glRotated(tilt[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, -1, 3);
|
||||
|
||||
GL11.glTranslated(0, 0, recoil[2]);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.star_f.renderPart("Gun");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.75, -4.25);
|
||||
GL11.glRotated(60 * (hammer[0] - 1), 1, 0, 0);
|
||||
GL11.glTranslated(0, -1.75, 4.25);
|
||||
ResourceManager.star_f.renderPart("Hammer");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, slide[2] * 2.3125);
|
||||
ResourceManager.star_f.renderPart("Slide");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(mag[0], mag[1], mag[2]);
|
||||
ResourceManager.star_f.renderPart("Mag");
|
||||
GL11.glTranslated(bullet[0], bullet[1], bullet[2]);
|
||||
ResourceManager.star_f.renderPart("Bullet");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(hasSilencer(stack)) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 2.375, -0.25);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
|
||||
ResourceManager.uzi.renderPart("Silencer");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} else {
|
||||
double smokeScale = 0.5;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 3, 6.125);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glScaled(smokeScale, smokeScale, smokeScale);
|
||||
this.renderSmokeNodes(gun.getConfig(stack, 0).smokeNodes, 0.75D);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 3, 6.125);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
|
||||
this.renderMuzzleFlash(gun.lastShot[0], 75, 7.5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupThirdPerson(ItemStack stack) {
|
||||
super.setupThirdPerson(stack);
|
||||
GL11.glTranslated(0, -0.25, 1.75);
|
||||
double scale = 0.75D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupInv(ItemStack stack) {
|
||||
super.setupInv(stack);
|
||||
double scale = 1.5D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glRotated(45, 0, 1, 0);
|
||||
GL11.glTranslated(-1, -0.5, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupModTable(ItemStack stack) {
|
||||
double scale = -6.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glTranslated(0, -0.25, -5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderModTable(ItemStack stack, int index) {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
renderStandardGun(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
boolean silenced = hasSilencer(stack);
|
||||
|
||||
if(silenced && type == ItemRenderType.INVENTORY) {
|
||||
double scale = 0.625D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glTranslated(0, 0, -6);
|
||||
}
|
||||
|
||||
renderStandardGun(stack);
|
||||
|
||||
if(type == ItemRenderType.EQUIPPED && !silenced) {
|
||||
EntityLivingBase ent = (EntityLivingBase) data[1];
|
||||
long shot;
|
||||
double shotRand = 0;
|
||||
if(ent == Minecraft.getMinecraft().thePlayer) {
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
shot = gun.lastShot[0];
|
||||
shotRand = gun.shotRand;
|
||||
} else {
|
||||
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
|
||||
if(shot < 0) return;
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 3, 6.25);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glRotated(90 * shotRand, 1, 0, 0);
|
||||
this.renderMuzzleFlash(shot, 75, 7.5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasSilencer(ItemStack stack) {
|
||||
return XWeaponModManager.hasUpgrade(stack, 0, XWeaponModManager.ID_SILENCER);
|
||||
}
|
||||
|
||||
public void renderStandardGun(ItemStack stack) {
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_tex);
|
||||
ResourceManager.star_f.renderPart("Gun");
|
||||
ResourceManager.star_f.renderPart("Slide");
|
||||
ResourceManager.star_f.renderPart("Mag");
|
||||
ResourceManager.star_f.renderPart("Hammer");
|
||||
boolean silenced = hasSilencer(stack);
|
||||
if(silenced) {
|
||||
GL11.glTranslated(0, 2.375, -0.25);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
|
||||
ResourceManager.uzi.renderPart("Silencer");
|
||||
}
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,293 @@
|
||||
package com.hbm.render.item.weapon.sedna;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemRenderStarFAkimbo extends ItemRenderWeaponBase {
|
||||
|
||||
@Override public boolean isAkimbo() { return true; }
|
||||
|
||||
@Override
|
||||
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
|
||||
|
||||
@Override
|
||||
public float getViewFOV(ItemStack stack, float fov) {
|
||||
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
|
||||
return fov * (1 - aimingProgress * 0.33F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupFirstPerson(ItemStack stack) {
|
||||
GL11.glTranslated(0, 0, 0.875);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFirstPerson(ItemStack stack) {
|
||||
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
|
||||
float offset = 0.8F;
|
||||
|
||||
for(int i = -1; i <= 1; i += 2) {
|
||||
int index = i == -1 ? 0 : 1;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_elite_tex);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
standardAimingTransform(stack, -2F * offset * i, -1.75F * offset, 2.5F * offset, 0, -7.625 / 8D, 1);
|
||||
|
||||
double scale = 0.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP", index);
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL", index);
|
||||
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER", index);
|
||||
double[] tilt = HbmAnimations.getRelevantTransformation("TILT", index);
|
||||
double[] turn = HbmAnimations.getRelevantTransformation("TURN", index);
|
||||
double[] mag = HbmAnimations.getRelevantTransformation("MAG", index);
|
||||
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET", index);
|
||||
double[] slide = HbmAnimations.getRelevantTransformation("SLIDE", index);
|
||||
|
||||
GL11.glTranslated(0, -2, -8);
|
||||
GL11.glRotated(equip[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 2, 8);
|
||||
|
||||
GL11.glTranslated(0, 1, -3);
|
||||
GL11.glRotated(turn[2] * i, 0, 0, 1);
|
||||
GL11.glRotated(tilt[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, -1, 3);
|
||||
|
||||
GL11.glTranslated(0, 0, recoil[2]);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.star_f.renderPart("Gun");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.75, -4.25);
|
||||
GL11.glRotated(60 * (hammer[0] - 1), 1, 0, 0);
|
||||
GL11.glTranslated(0, -1.75, 4.25);
|
||||
ResourceManager.star_f.renderPart("Hammer");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, slide[2] * 2.3125);
|
||||
ResourceManager.star_f.renderPart("Slide");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(mag[0], mag[1], mag[2]);
|
||||
ResourceManager.star_f.renderPart("Mag");
|
||||
GL11.glTranslated(bullet[0], bullet[1], bullet[2]);
|
||||
ResourceManager.star_f.renderPart("Bullet");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(hasSilencer(stack, index)) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 2.375, -0.25);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
|
||||
ResourceManager.uzi.renderPart("Silencer");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} else {
|
||||
double smokeScale = 0.5;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 3, 6.125);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glScaled(smokeScale, smokeScale, smokeScale);
|
||||
this.renderSmokeNodes(gun.getConfig(stack, index).smokeNodes, 0.75D);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
renderMuzzleFlash(gun.shotRand, gun.lastShot[index]);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupThirdPerson(ItemStack stack) {
|
||||
super.setupThirdPerson(stack);
|
||||
GL11.glTranslated(0, -0.25, 1.75);
|
||||
double scale = 0.75D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupThirdPersonAkimbo(ItemStack stack) {
|
||||
super.setupThirdPersonAkimbo(stack);
|
||||
GL11.glTranslated(0, -0.25, 1.75);
|
||||
double scale = 0.75D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupInv(ItemStack stack) {
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glScaled(1, 1, -1);
|
||||
GL11.glTranslated(8, 8, 0);
|
||||
double scale = 1.5D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupModTable(ItemStack stack) {
|
||||
double scale = -6.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glTranslated(0, -0.25, -5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderEquipped(ItemStack stack, Object... data) {
|
||||
renderStandardGun(stack, 1);
|
||||
if(!hasSilencer(stack, 1)) renderThirdPersonFlash((EntityLivingBase) data[1], stack, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase ent) {
|
||||
renderStandardGun(stack, 0);
|
||||
if(!hasSilencer(stack, 0)) renderThirdPersonFlash(ent, stack, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderModTable(ItemStack stack, int index) {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_elite_tex);
|
||||
ResourceManager.star_f.renderPart("Gun");
|
||||
ResourceManager.star_f.renderPart("Slide");
|
||||
ResourceManager.star_f.renderPart("Mag");
|
||||
ResourceManager.star_f.renderPart("Hammer");
|
||||
if(hasSilencer(stack, index)) {
|
||||
GL11.glTranslated(0, 2.375, -0.25);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
|
||||
ResourceManager.uzi.renderPart("Silencer");
|
||||
}
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderEntity(ItemStack stack) {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
boolean anySilenced = hasSilencer(stack, 0) || hasSilencer(stack, 1);
|
||||
|
||||
if(anySilenced) {
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-1, 1, 0);
|
||||
renderStandardGun(stack, 1);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(1, 1, 0);
|
||||
renderStandardGun(stack, 0);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
boolean anySilenced = hasSilencer(stack, 0) || hasSilencer(stack, 1);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(225, 0, 0, 1);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glRotated(45, 0, 1, 0);
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
if(anySilenced) {
|
||||
double scale = 0.625D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glTranslated(0, 0, -4);
|
||||
}
|
||||
renderStandardGun(stack, 1);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glTranslated(0, 0, 5);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(225, 0, 0, 1);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
GL11.glRotated(-90, 1, 0, 0);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glRotated(-45, 0, 1, 0);
|
||||
GL11.glTranslated(-0.5, 0, 0);
|
||||
if(anySilenced) {
|
||||
double scale = 0.625D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glTranslated(0, 0, -4);
|
||||
}
|
||||
renderStandardGun(stack, 0);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
public boolean hasSilencer(ItemStack stack, int cfg) {
|
||||
return XWeaponModManager.hasUpgrade(stack, cfg, XWeaponModManager.ID_SILENCER);
|
||||
}
|
||||
|
||||
public void renderStandardGun(ItemStack stack, int index) {
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_elite_tex);
|
||||
ResourceManager.star_f.renderPart("Gun");
|
||||
ResourceManager.star_f.renderPart("Slide");
|
||||
ResourceManager.star_f.renderPart("Mag");
|
||||
ResourceManager.star_f.renderPart("Hammer");
|
||||
boolean silenced = hasSilencer(stack, index);
|
||||
if(silenced) {
|
||||
GL11.glTranslated(0, 2.375, -0.25);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
|
||||
ResourceManager.uzi.renderPart("Silencer");
|
||||
}
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
public void renderThirdPersonFlash(Entity ent, ItemStack stack, int config) {
|
||||
|
||||
long shot;
|
||||
double shotRand = 0;
|
||||
if(ent == Minecraft.getMinecraft().thePlayer) {
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
shot = gun.lastShot[config];
|
||||
shotRand = gun.shotRand;
|
||||
} else {
|
||||
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
|
||||
if(shot < 0) return;
|
||||
}
|
||||
|
||||
renderMuzzleFlash(shotRand, shot);
|
||||
}
|
||||
|
||||
public void renderMuzzleFlash(double shotRand, long shot) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 3, 6.125);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glRotated(90 * shotRand, 1, 0, 0);
|
||||
this.renderMuzzleFlash(shot, 75, 7.5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
34
src/main/java/com/hbm/render/loader/HFRModelReloader.java
Normal file
34
src/main/java/com/hbm/render/loader/HFRModelReloader.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.hbm.render.loader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
|
||||
public class HFRModelReloader implements IResourceManagerReloadListener {
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
|
||||
for(HFRWavefrontObject obj : HFRWavefrontObject.allModels) {
|
||||
try {
|
||||
obj.destroy();
|
||||
IResource resource = Minecraft.getMinecraft().getResourceManager().getResource(obj.resource);
|
||||
obj.loadObjModel(resource.getInputStream());
|
||||
// MainRegistry.logger.info("Reloading OBJ " + obj.resource.getResourcePath());
|
||||
} catch(IOException e) { }
|
||||
}
|
||||
|
||||
for(Entry<HFRWavefrontObjectVBO, HFRWavefrontObject> entry : HFRWavefrontObject.allVBOs.entrySet()) {
|
||||
HFRWavefrontObjectVBO vbo = entry.getKey();
|
||||
HFRWavefrontObject obj = entry.getValue();
|
||||
|
||||
vbo.destroy();
|
||||
vbo.load(obj);
|
||||
// MainRegistry.logger.info("Reloading VBO " + obj.resource.getResourcePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,12 +5,16 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -22,6 +26,11 @@ import net.minecraftforge.client.model.obj.TextureCoordinate;
|
||||
import net.minecraftforge.client.model.obj.Vertex;
|
||||
|
||||
public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
|
||||
/** For resource reloading */
|
||||
public static LinkedHashSet<HFRWavefrontObject> allModels = new LinkedHashSet();
|
||||
public static LinkedHashMap<HFRWavefrontObjectVBO, HFRWavefrontObject> allVBOs = new LinkedHashMap();
|
||||
|
||||
private static Pattern vertexPattern = Pattern.compile("(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)");
|
||||
private static Pattern vertexNormalPattern = Pattern.compile("(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)");
|
||||
private static Pattern textureCoordinatePattern = Pattern.compile("(vt( (\\-){0,1}\\d+\\.\\d+){2,3} *\\n)|(vt( (\\-){0,1}\\d+(\\.\\d+)?){2,3} *$)");
|
||||
@ -40,10 +49,29 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
public ArrayList<TextureCoordinate> textureCoordinates = new ArrayList<TextureCoordinate>();
|
||||
public ArrayList<S_GroupObject> groupObjects = new ArrayList<S_GroupObject>();
|
||||
private S_GroupObject currentGroupObject;
|
||||
public ResourceLocation resource;
|
||||
private String fileName;
|
||||
private boolean smoothing = true;
|
||||
private boolean allowMixedMode = false;
|
||||
|
||||
public HFRWavefrontObject(String name) throws ModelFormatException {
|
||||
this(new ResourceLocation(RefStrings.MODID, name));
|
||||
}
|
||||
|
||||
public HFRWavefrontObject noSmooth() {
|
||||
this.smoothing = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Provides a way for a model to have both tris and quads, however this means it can't be rendered directly.
|
||||
* Useful for ISBRHs which access vertices manually, allowing the quad to tri trick without forcing the entire model to be redundant tris. */
|
||||
public HFRWavefrontObject mixedMode() {
|
||||
this.allowMixedMode = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public HFRWavefrontObject(ResourceLocation resource) throws ModelFormatException {
|
||||
this.resource = resource;
|
||||
this.fileName = resource.toString();
|
||||
|
||||
try {
|
||||
@ -52,6 +80,8 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
} catch(IOException e) {
|
||||
throw new ModelFormatException("IO Exception reading model format", e);
|
||||
}
|
||||
|
||||
this.allModels.add(this);
|
||||
}
|
||||
|
||||
public HFRWavefrontObject(ResourceLocation resource, boolean smoothing) throws ModelFormatException {
|
||||
@ -59,12 +89,15 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
this.smoothing = smoothing;
|
||||
}
|
||||
|
||||
public HFRWavefrontObject(String filename, InputStream inputStream) throws ModelFormatException {
|
||||
this.fileName = filename;
|
||||
loadObjModel(inputStream);
|
||||
public void destroy() {
|
||||
vertices.clear();
|
||||
vertexNormals.clear();
|
||||
textureCoordinates.clear();
|
||||
groupObjects.clear();
|
||||
currentGroupObject = null;
|
||||
}
|
||||
|
||||
private void loadObjModel(InputStream inputStream) throws ModelFormatException {
|
||||
public void loadObjModel(InputStream inputStream) throws ModelFormatException {
|
||||
BufferedReader reader = null;
|
||||
|
||||
String currentLine = null;
|
||||
@ -139,6 +172,8 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderAll() {
|
||||
if(allowMixedMode) throw new UnsupportedOperationException("Rendering of mixed-mode model " + this.fileName + " is not supported!");
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if(currentGroupObject != null) {
|
||||
@ -154,13 +189,15 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void tessellateAll(Tessellator tessellator) {
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
groupObject.render(tessellator);
|
||||
groupObject.tessellate(tessellator);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderOnly(String... groupNames) {
|
||||
if(allowMixedMode) throw new UnsupportedOperationException("Rendering of mixed-mode model " + this.fileName + " is not supported!");
|
||||
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
for(String groupName : groupNames) {
|
||||
if(groupName.equalsIgnoreCase(groupObject.name)) {
|
||||
@ -175,7 +212,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
for(String groupName : groupNames) {
|
||||
if(groupName.equalsIgnoreCase(groupObject.name)) {
|
||||
groupObject.render(tessellator);
|
||||
groupObject.tessellate(tessellator);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -184,6 +221,8 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderPart(String partName) {
|
||||
if(allowMixedMode) throw new UnsupportedOperationException("Rendering of mixed-mode model " + this.fileName + " is not supported!");
|
||||
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
if(partName.equalsIgnoreCase(groupObject.name)) {
|
||||
groupObject.render();
|
||||
@ -195,7 +234,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
public void tessellatePart(Tessellator tessellator, String partName) {
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
if(partName.equalsIgnoreCase(groupObject.name)) {
|
||||
groupObject.render(tessellator);
|
||||
groupObject.tessellate(tessellator);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -203,6 +242,8 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderAllExcept(String... excludedGroupNames) {
|
||||
if(allowMixedMode) throw new UnsupportedOperationException("Rendering of mixed-mode model " + this.fileName + " is not supported!");
|
||||
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
boolean skipPart = false;
|
||||
for(String excludedGroupName : excludedGroupNames) {
|
||||
@ -227,7 +268,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
}
|
||||
}
|
||||
if(!exclude) {
|
||||
groupObject.render(tessellator);
|
||||
groupObject.tessellate(tessellator);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -307,6 +348,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
String[] tokens = trimmedLine.split(" ");
|
||||
String[] subTokens = null;
|
||||
|
||||
if(!this.allowMixedMode) {
|
||||
if(tokens.length == 3) {
|
||||
if(currentGroupObject.glDrawingMode == -1) {
|
||||
currentGroupObject.glDrawingMode = GL11.GL_TRIANGLES;
|
||||
@ -322,6 +364,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
+ "' - Invalid number of points for face (expected 3, found " + tokens.length + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3 ...
|
||||
if(isValidFace_V_VT_VN_Line(line)) {
|
||||
@ -492,7 +535,9 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
return names;
|
||||
}
|
||||
|
||||
public WavefrontObjVBO asVBO() {
|
||||
return new WavefrontObjVBO(this);
|
||||
public HFRWavefrontObjectVBO asVBO() {
|
||||
HFRWavefrontObjectVBO vbo = new HFRWavefrontObjectVBO(this);
|
||||
this.allVBOs.put(vbo, this);
|
||||
return vbo;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import org.lwjgl.opengl.*;
|
||||
import net.minecraftforge.client.model.obj.TextureCoordinate;
|
||||
import net.minecraftforge.client.model.obj.Vertex;
|
||||
|
||||
public class WavefrontObjVBO implements IModelCustomNamed {
|
||||
public class HFRWavefrontObjectVBO implements IModelCustomNamed {
|
||||
|
||||
class VBOBufferData {
|
||||
|
||||
@ -27,7 +27,11 @@ public class WavefrontObjVBO implements IModelCustomNamed {
|
||||
static int VERTEX_SIZE = 3;
|
||||
static int UV_SIZE = 3;
|
||||
|
||||
public WavefrontObjVBO(HFRWavefrontObject obj) {
|
||||
public HFRWavefrontObjectVBO(HFRWavefrontObject obj) {
|
||||
load(obj);
|
||||
}
|
||||
|
||||
public void load(HFRWavefrontObject obj) {
|
||||
for(S_GroupObject g : obj.groupObjects) {
|
||||
VBOBufferData data = new VBOBufferData();
|
||||
data.name = g.name;
|
||||
@ -75,6 +79,19 @@ public class WavefrontObjVBO implements IModelCustomNamed {
|
||||
}
|
||||
}
|
||||
|
||||
// truth be told, i have no fucking idea what i'm doing
|
||||
// i know the VBO sends data to the GPU to be saved there directly which is where the optimization comes from in the first place
|
||||
// so logically, if we want to get rid of this, we need to blow the data up
|
||||
// documentation on GL15 functions seems nonexistant so fuck it we ball i guess
|
||||
public void destroy() {
|
||||
for(VBOBufferData data : groups) {
|
||||
GL15.glDeleteBuffers(data.vertexHandle);
|
||||
GL15.glDeleteBuffers(data.uvHandle);
|
||||
GL15.glDeleteBuffers(data.normalHandle);
|
||||
}
|
||||
groups.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "obj_vbo";
|
||||
@ -1,172 +0,0 @@
|
||||
package com.hbm.render.loader;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelBox;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
public class ModelRendererTest extends ModelRenderer {
|
||||
|
||||
//TODO: blow up mojank HQ with a JDAM
|
||||
private boolean compiled;
|
||||
private int displayList;
|
||||
|
||||
public ModelRendererTest(ModelBase p_i1173_1_) {
|
||||
super(p_i1173_1_);
|
||||
}
|
||||
|
||||
public ModelRendererTest(ModelBase p_i1174_1_, int p_i1174_2_, int p_i1174_3_) {
|
||||
this(p_i1174_1_);
|
||||
this.setTextureOffset(p_i1174_2_, p_i1174_3_);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void render(float p_78785_1_) {
|
||||
if(!this.isHidden) {
|
||||
if(this.showModel) {
|
||||
if(!this.compiled) {
|
||||
this.compileDisplayList(p_78785_1_);
|
||||
}
|
||||
|
||||
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
|
||||
int i;
|
||||
|
||||
if(this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
|
||||
if(this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) {
|
||||
GL11.glCallList(this.displayList);
|
||||
|
||||
if(this.childModels != null) {
|
||||
for(i = 0; i < this.childModels.size(); ++i) {
|
||||
((ModelRenderer) this.childModels.get(i)).render(p_78785_1_);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GL11.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_);
|
||||
GL11.glCallList(this.displayList);
|
||||
|
||||
if(this.childModels != null) {
|
||||
for(i = 0; i < this.childModels.size(); ++i) {
|
||||
((ModelRenderer) this.childModels.get(i)).render(p_78785_1_);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glTranslatef(-this.rotationPointX * p_78785_1_, -this.rotationPointY * p_78785_1_, -this.rotationPointZ * p_78785_1_);
|
||||
}
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_);
|
||||
|
||||
if(this.rotateAngleZ != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(this.rotateAngleY != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
if(this.rotateAngleX != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScaled(0.1, 0.1, 0.1);
|
||||
ResourceManager.chemplant_body.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
//GL11.glCallList(this.displayList);
|
||||
|
||||
if(this.childModels != null) {
|
||||
for(i = 0; i < this.childModels.size(); ++i) {
|
||||
((ModelRenderer) this.childModels.get(i)).render(p_78785_1_);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderWithRotation(float p_78791_1_) {
|
||||
if(!this.isHidden) {
|
||||
if(this.showModel) {
|
||||
if(!this.compiled) {
|
||||
this.compileDisplayList(p_78791_1_);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(this.rotationPointX * p_78791_1_, this.rotationPointY * p_78791_1_, this.rotationPointZ * p_78791_1_);
|
||||
|
||||
if(this.rotateAngleY != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
if(this.rotateAngleX != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
if(this.rotateAngleZ != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
GL11.glCallList(this.displayList);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void postRender(float p_78794_1_) {
|
||||
if(!this.isHidden) {
|
||||
if(this.showModel) {
|
||||
if(!this.compiled) {
|
||||
this.compileDisplayList(p_78794_1_);
|
||||
}
|
||||
|
||||
if(this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
|
||||
if(this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) {
|
||||
GL11.glTranslatef(this.rotationPointX * p_78794_1_, this.rotationPointY * p_78794_1_, this.rotationPointZ * p_78794_1_);
|
||||
}
|
||||
} else {
|
||||
GL11.glTranslatef(this.rotationPointX * p_78794_1_, this.rotationPointY * p_78794_1_, this.rotationPointZ * p_78794_1_);
|
||||
|
||||
if(this.rotateAngleZ != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(this.rotateAngleY != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
if(this.rotateAngleX != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void compileDisplayList(float p_78788_1_) {
|
||||
this.displayList = GLAllocation.generateDisplayLists(1);
|
||||
GL11.glNewList(this.displayList, GL11.GL_COMPILE);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
for(int i = 0; i < this.cubeList.size(); ++i) {
|
||||
((ModelBox) this.cubeList.get(i)).render(tessellator, p_78788_1_);
|
||||
}
|
||||
|
||||
GL11.glEndList();
|
||||
this.compiled = true;
|
||||
}
|
||||
}
|
||||
@ -26,12 +26,12 @@ public class S_GroupObject {
|
||||
if (this.faces.size() > 0) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawing(this.glDrawingMode);
|
||||
render(tessellator);
|
||||
tessellate(tessellator);
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
public void render(Tessellator tessellator) {
|
||||
public void tessellate(Tessellator tessellator) {
|
||||
if (this.faces.size() > 0) {
|
||||
for (S_Face face : this.faces) {
|
||||
face.addFaceForRender(tessellator);
|
||||
|
||||
77
src/main/java/com/hbm/render/model/ModelArmorNCRPA.java
Normal file
77
src/main/java/com/hbm/render/model/ModelArmorNCRPA.java
Normal file
@ -0,0 +1,77 @@
|
||||
package com.hbm.render.model;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.loader.ModelRendererObj;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelArmorNCRPA extends ModelArmorBase {
|
||||
|
||||
ModelRendererObj eyes;
|
||||
|
||||
public ModelArmorNCRPA(int type) {
|
||||
super(type);
|
||||
|
||||
this.head = new ModelRendererObj(ResourceManager.armor_ncr, "Helmet");
|
||||
this.eyes = new ModelRendererObj(ResourceManager.armor_ncr, "Eyes");
|
||||
this.body = new ModelRendererObj(ResourceManager.armor_ncr, "Chest");
|
||||
this.leftArm = new ModelRendererObj(ResourceManager.armor_ncr, "LeftArm").setRotationPoint(5.0F, 2.0F, 0.0F);
|
||||
this.rightArm = new ModelRendererObj(ResourceManager.armor_ncr, "RightArm").setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
this.leftLeg = new ModelRendererObj(ResourceManager.armor_ncr, "LeftLeg").setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
this.rightLeg = new ModelRendererObj(ResourceManager.armor_ncr, "RightLeg").setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
this.leftFoot = new ModelRendererObj(ResourceManager.armor_ncr, "LeftBoot").setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
this.rightFoot = new ModelRendererObj(ResourceManager.armor_ncr, "RightBoot").setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) {
|
||||
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entity);
|
||||
this.head.copyTo(this.eyes);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
if(this.type == 0) {
|
||||
bindTexture(ResourceManager.ncrpa_helmet);
|
||||
this.head.render(scaleFactor);
|
||||
|
||||
/// START GLOW ///
|
||||
float lastX = OpenGlHelper.lastBrightnessX;
|
||||
float lastY = OpenGlHelper.lastBrightnessY;
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.eyes.render(scaleFactor);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastX, lastY);
|
||||
/// END GLOW ///
|
||||
}
|
||||
if(this.type == 1) {
|
||||
|
||||
bindTexture(ResourceManager.ncrpa_arm);
|
||||
this.leftArm.render(scaleFactor);
|
||||
this.rightArm.render(scaleFactor);
|
||||
|
||||
bindTexture(ResourceManager.ncrpa_chest);
|
||||
this.body.render(scaleFactor);
|
||||
}
|
||||
if(this.type == 2) {
|
||||
bindTexture(ResourceManager.ncrpa_leg);
|
||||
this.leftLeg.render(scaleFactor);
|
||||
this.rightLeg.render(scaleFactor);
|
||||
}
|
||||
if(this.type == 3) {
|
||||
bindTexture(ResourceManager.ncrpa_leg);
|
||||
this.leftFoot.render(scaleFactor);
|
||||
this.rightFoot.render(scaleFactor);
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineIndustrialTurbine;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderIndustrialTurbine extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
switch(tile.getBlockMetadata() - 10) {
|
||||
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
TileEntityMachineIndustrialTurbine turbine = (TileEntityMachineIndustrialTurbine) tile;
|
||||
|
||||
bindTexture(ResourceManager.industrial_turbine_tex);
|
||||
ResourceManager.industrial_turbine.renderPart("Turbine");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(135 - (turbine.tanks[0].getTankType().getID() - Fluids.STEAM.getID()) * 90, 0, 0, 1);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.industrial_turbine.renderPart("Gauge");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(turbine.lastRotor + (turbine.rotor - turbine.lastRotor) * interp, 0, 0, -1);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.industrial_turbine.renderPart("Flywheel");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_industrial_turbine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(1, 0, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.industrial_turbine_tex);
|
||||
|
||||
ResourceManager.industrial_turbine.renderPart("Turbine");
|
||||
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(135, 0, 0, 1);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.industrial_turbine.renderPart("Gauge");
|
||||
|
||||
double rot = (System.currentTimeMillis() / 5) % 336D;
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(rot, 0, 0, -1);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.industrial_turbine.renderPart("Flywheel");
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,5 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityVaultDoor;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -13,10 +8,10 @@ public class RenderVaultDoor extends TileEntitySpecialRenderer {
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
renderDoor((TileEntityVaultDoor)tileEntity, x, y, z, f);
|
||||
//renderDoor((TileEntityVaultDoor)tileEntity, x, y, z, f);
|
||||
}
|
||||
|
||||
public void renderDoor(TileEntityVaultDoor tileEntity, double x, double y, double z, float f)
|
||||
/*public void renderDoor(TileEntityVaultDoor tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
@ -120,5 +115,5 @@ public class RenderVaultDoor extends TileEntitySpecialRenderer {
|
||||
double roll = z / circumference * 360;
|
||||
|
||||
return new double[] { x + 0.0005D, z, roll };
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.nio.DoubleBuffer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -17,7 +18,7 @@ public class RenderAirlockDoor implements IRenderDoors {
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_airlock_door_tex);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(DoorDecl.ROUND_AIRLOCK_DOOR.getSkinFromIndex(door.getSkinIndex()));
|
||||
|
||||
double maxOpen = 1.5;
|
||||
double open = 0;
|
||||
@ -52,5 +53,4 @@ public class RenderAirlockDoor implements IRenderDoors {
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE0);
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
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 RenderContainmentDoor implements IRenderDoors {
|
||||
|
||||
public static final RenderContainmentDoor INSTANCE = new RenderContainmentDoor();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_containment_door_tex);
|
||||
|
||||
double maxRaise = 2.25;
|
||||
double raise = 0;
|
||||
if(door.state == door.STATE_OPEN) raise = maxRaise;
|
||||
|
||||
if(door.currentAnimation != null) {
|
||||
raise = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxRaise;
|
||||
}
|
||||
|
||||
GL11.glTranslated(0.25, 0.0, 0.0);
|
||||
ResourceManager.pheo_containment_door.renderPart("Frame");
|
||||
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE0);
|
||||
buf.put(new double[] { 0, -1, 0, 3 }); buf.rewind();
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, buf);
|
||||
|
||||
GL11.glTranslated(0, MathHelper.clamp_double(raise, 0, maxRaise), 0);
|
||||
ResourceManager.pheo_containment_door.renderPart("Door");
|
||||
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE0);
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import java.nio.DoubleBuffer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -17,7 +18,7 @@ public class RenderFireDoor implements IRenderDoors {
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_fire_door_tex);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(DoorDecl.FIRE_DOOR.getSkinFromIndex(door.getSkinIndex()));
|
||||
|
||||
double maxRaise = 2.75;
|
||||
double raise = 0;
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
package com.hbm.render.tileentity.door;
|
||||
|
||||
import java.nio.DoubleBuffer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class RenderSealDoor implements IRenderDoors {
|
||||
|
||||
public static final RenderSealDoor INSTANCE = new RenderSealDoor();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_seal_door_tex);
|
||||
|
||||
double maxRaise = 1;
|
||||
double raise = 0;
|
||||
if(door.state == door.STATE_OPEN) raise = maxRaise;
|
||||
|
||||
if(door.currentAnimation != null) {
|
||||
raise = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxRaise;
|
||||
}
|
||||
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
ResourceManager.pheo_seal_door.renderPart("Frame");
|
||||
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE0);
|
||||
buf.put(new double[] { 0, 0, -1, 0.5001 }); buf.rewind();
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, buf);
|
||||
|
||||
GL11.glTranslated(0, 0, Library.smoothstep(MathHelper.clamp_double(raise, 0, maxRaise), 0, 1) * 0.9);
|
||||
ResourceManager.pheo_seal_door.renderPart("Door");
|
||||
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE0);
|
||||
}
|
||||
}
|
||||
@ -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.DoorDecl;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class RenderSecureDoor implements IRenderDoors {
|
||||
|
||||
public static final RenderSecureDoor INSTANCE = new RenderSecureDoor();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(DoorDecl.SECURE_ACCESS_DOOR.getSkinFromIndex(door.getSkinIndex()));
|
||||
|
||||
double maxRaise = 3.5;
|
||||
double raise = 0;
|
||||
if(door.state == door.STATE_OPEN) raise = maxRaise;
|
||||
|
||||
if(door.currentAnimation != null) {
|
||||
raise = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxRaise;
|
||||
}
|
||||
|
||||
GL11.glTranslated(0, 1, 0);
|
||||
ResourceManager.pheo_secure_door.renderPart("Frame");
|
||||
GL11.glTranslated(0, MathHelper.clamp_double(raise, 0, maxRaise), 0);
|
||||
ResourceManager.pheo_secure_door.renderPart("Door");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
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 RenderSlidingBlastDoor implements IRenderDoors {
|
||||
|
||||
public static final RenderSlidingBlastDoor INSTANCE = new RenderSlidingBlastDoor();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_blast_door_tex);
|
||||
|
||||
double maxOpen = 2.125;
|
||||
double open = 0;
|
||||
double lock = 0;
|
||||
if(door.state == door.STATE_OPEN) {
|
||||
open = maxOpen;
|
||||
lock = 90;
|
||||
}
|
||||
|
||||
if(door.currentAnimation != null) {
|
||||
open = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxOpen;
|
||||
lock = IRenderDoors.getRelevantTransformation("LOCK", door.currentAnimation)[0] * 90;
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
ResourceManager.pheo_blast_door.renderPart("Frame");
|
||||
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE0);
|
||||
buf.put(new double[] { 0.0, 0.0, 1, 2.5 }); buf.rewind();
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, buf);
|
||||
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE1);
|
||||
buf.put(new double[] { 0.0, 0.0, -1, 2.5 }); buf.rewind();
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE1, buf);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, MathHelper.clamp_double(open, 0, maxOpen));
|
||||
ResourceManager.pheo_blast_door.renderPart("LeftDoor");
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.8125, 0);
|
||||
GL11.glRotated(90 + lock, 1, 0, 0);
|
||||
GL11.glTranslated(0, -1.8125, 0);
|
||||
ResourceManager.pheo_blast_door.renderPart("RightLock");
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, -MathHelper.clamp_double(open, 0, maxOpen));
|
||||
ResourceManager.pheo_blast_door.renderPart("RightDoor");
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.8125, 0);
|
||||
GL11.glRotated(90 + lock, 1, 0, 0);
|
||||
GL11.glTranslated(0, -1.8125, 0);
|
||||
ResourceManager.pheo_blast_door.renderPart("LeftLock");
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE0);
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE1);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
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 RenderSlidingDoor implements IRenderDoors {
|
||||
|
||||
public static final RenderSlidingDoor INSTANCE = new RenderSlidingDoor();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_sliding_door_tex);
|
||||
|
||||
double maxOpen = 0.95;
|
||||
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.53125, 0.001, 0.5);
|
||||
ResourceManager.pheo_sliding_door.renderPart("Frame");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, MathHelper.clamp_double(open, 0, maxOpen));
|
||||
ResourceManager.pheo_sliding_door.renderPart("Left");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, -MathHelper.clamp_double(open, 0, maxOpen));
|
||||
ResourceManager.pheo_sliding_door.renderPart("Right");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
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.ResourceLocation;
|
||||
|
||||
public class RenderVaultDoor implements IRenderDoors {
|
||||
|
||||
public static final RenderVaultDoor INSTANCE = new RenderVaultDoor();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
ResourceLocation doorTex = ResourceManager.pheo_vault_door_3;
|
||||
ResourceLocation labelTex = ResourceManager.pheo_label_101;
|
||||
|
||||
switch(door.getSkinIndex()) {
|
||||
case 1: labelTex = ResourceManager.pheo_label_87; break;
|
||||
case 2: labelTex = ResourceManager.pheo_label_106; break;
|
||||
case 3: doorTex = ResourceManager.pheo_vault_door_4; labelTex = ResourceManager.pheo_label_81; break;
|
||||
case 4: doorTex = ResourceManager.pheo_vault_door_4; labelTex = ResourceManager.pheo_label_111; break;
|
||||
case 5: doorTex = ResourceManager.pheo_vault_door_s; labelTex = ResourceManager.pheo_label_2; break;
|
||||
case 6: doorTex = ResourceManager.pheo_vault_door_s; labelTex = ResourceManager.pheo_label_99; break;
|
||||
}
|
||||
|
||||
double pull = 0;
|
||||
double slide = 0;
|
||||
|
||||
if(door.state == door.STATE_OPEN) {
|
||||
pull = 1;
|
||||
slide = 1;
|
||||
}
|
||||
|
||||
if(door.currentAnimation != null) {
|
||||
pull = IRenderDoors.getRelevantTransformation("PULL", door.currentAnimation)[2];
|
||||
slide = IRenderDoors.getRelevantTransformation("SLIDE", door.currentAnimation)[0];
|
||||
}
|
||||
|
||||
double diameter = 4.25D;
|
||||
double circumference = diameter * Math.PI;
|
||||
slide *= 5D;
|
||||
double roll = 360D * slide / circumference;
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(doorTex);
|
||||
ResourceManager.pheo_vault_door.renderPart("Frame");
|
||||
GL11.glTranslated(-pull, 0, 0);
|
||||
GL11.glTranslated(0, 0, slide);
|
||||
GL11.glTranslated(0, 2.5, 0);
|
||||
GL11.glRotated(roll, 1, 0, 0);
|
||||
GL11.glTranslated(0, -2.5, 0);
|
||||
ResourceManager.pheo_vault_door.renderPart("Door");
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(labelTex);
|
||||
ResourceManager.pheo_vault_door.renderPart("Label");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
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 RenderVehicleDoor implements IRenderDoors {
|
||||
|
||||
public static final RenderVehicleDoor INSTANCE = new RenderVehicleDoor();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_vehicle_door_tex);
|
||||
|
||||
double maxOpen = 3;
|
||||
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.glRotated(90, 0, 1, 0);
|
||||
ResourceManager.pheo_vehicle_door.renderPart("Frame");
|
||||
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE0);
|
||||
buf.put(new double[] { 1, 0, 0, 3.4375 }); buf.rewind();
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, buf);
|
||||
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE1);
|
||||
buf.put(new double[] { -1, 0 ,0, 3.4375 }); buf.rewind();
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE1, buf);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-MathHelper.clamp_double(open, 0, maxOpen), 0, 0);
|
||||
ResourceManager.pheo_vehicle_door.renderPart("Left");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(MathHelper.clamp_double(open, 0, maxOpen), 0, 0);
|
||||
ResourceManager.pheo_vehicle_door.renderPart("Right");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE0);
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE1);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
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;
|
||||
|
||||
public class RenderWaterDoor implements IRenderDoors {
|
||||
|
||||
public static final RenderWaterDoor INSTANCE = new RenderWaterDoor();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_water_door_tex);
|
||||
|
||||
double maxRot = 120;
|
||||
double rot = 0;
|
||||
double bolt = 0;
|
||||
if(door.state == door.STATE_OPEN) {
|
||||
rot = maxRot;
|
||||
bolt = 1D;
|
||||
}
|
||||
|
||||
if(door.currentAnimation != null) {
|
||||
rot = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxRot;
|
||||
bolt = IRenderDoors.getRelevantTransformation("BOLT", door.currentAnimation)[2];
|
||||
}
|
||||
|
||||
GL11.glTranslated(0.375, 0.0, 0.0);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
ResourceManager.pheo_water_door.renderPart("Frame");
|
||||
|
||||
GL11.glTranslated(-1.1875, 0, 0);
|
||||
GL11.glRotated(-rot, 0, 1, 0);
|
||||
GL11.glTranslated(1.1875, 0, 0);
|
||||
ResourceManager.pheo_water_door.renderPart("Door_Cube.003"); // ah fuck it
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-0.4 * bolt, 0, 0);
|
||||
ResourceManager.pheo_water_door.renderPart("Bolts");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.40625F, 2.28125, 0);
|
||||
GL11.glRotated(bolt * 360, 0, 0, 1);
|
||||
GL11.glTranslated(-0.40625F, -2.28125, 0);
|
||||
ResourceManager.pheo_water_door.renderPart("Top");
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.40625F, 0.71875, 0);
|
||||
GL11.glRotated(bolt * 360, 0, 0, 1);
|
||||
GL11.glTranslated(-0.40625F, -0.71875, 0);
|
||||
ResourceManager.pheo_water_door.renderPart("Bottom");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,8 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.config.ClientConfig;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.interfaces.Untested;
|
||||
@ -66,24 +68,13 @@ public class RenderScreenOverlay {
|
||||
gui.drawTexturedModalRect(posX, posY, 0, 0, 94, 18);
|
||||
gui.drawTexturedModalRect(posX + 1, posY + 1, 1, 19, bar, 16);
|
||||
|
||||
if(radiation >= 25) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 36, 36, 18, 18);
|
||||
if(radiation >= 25) gui.drawTexturedModalRect(posX + length + 2, posY - 18, 36, 36, 18, 18);
|
||||
else if(radiation >= 10) gui.drawTexturedModalRect(posX + length + 2, posY - 18, 18, 36, 18, 18);
|
||||
else if(radiation >= 2.5) gui.drawTexturedModalRect(posX + length + 2, posY - 18, 0, 36, 18, 18);
|
||||
|
||||
} else if(radiation >= 10) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 18, 36, 18, 18);
|
||||
|
||||
} else if(radiation >= 2.5) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 0, 36, 18, 18);
|
||||
|
||||
}
|
||||
|
||||
if(radiation > 1000) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(">1000 RAD/s", posX, posY - 8, 0xFF0000);
|
||||
} else if(radiation >= 1) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(((int) Math.round(radiation)) + " RAD/s", posX, posY - 8, 0xFF0000);
|
||||
} else if(radiation > 0) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString("<1 RAD/s", posX, posY - 8, 0xFF0000);
|
||||
}
|
||||
if(radiation > 1000) Minecraft.getMinecraft().fontRenderer.drawString(">1000 RAD/s", posX, posY - 8, 0xFF0000);
|
||||
else if(radiation >= 1) Minecraft.getMinecraft().fontRenderer.drawString(((int) Math.round(radiation)) + " RAD/s", posX, posY - 8, 0xFF0000);
|
||||
else if(radiation > 0) Minecraft.getMinecraft().fontRenderer.drawString("<1 RAD/s", posX, posY - 8, 0xFF0000);
|
||||
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(true);
|
||||
@ -92,7 +83,6 @@ public class RenderScreenOverlay {
|
||||
}
|
||||
|
||||
private static int getScaled(double cur, double max, double scale) {
|
||||
|
||||
return (int) Math.min(cur / max * scale, scale);
|
||||
}
|
||||
|
||||
@ -186,7 +176,6 @@ public class RenderScreenOverlay {
|
||||
@Spaghetti ("like a fella once said, aint that a kick in the head")
|
||||
public static void renderDashBar(ScaledResolution resolution, Gui gui, HbmPlayerProps props) {
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
@ -199,8 +188,7 @@ public class RenderScreenOverlay {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
int width = 30;
|
||||
|
||||
int posX = 16;//(int)(resolution.getScaledWidth()/2 - ((props.getDashCount()*(width+2))/2));
|
||||
int posX = 16;
|
||||
int posY = resolution.getScaledHeight() - 40 - 2;
|
||||
|
||||
mc.renderEngine.bindTexture(misc);
|
||||
@ -208,12 +196,7 @@ public class RenderScreenOverlay {
|
||||
gui.drawTexturedModalRect(posX-10, posY, 107, 18, 7, 10);
|
||||
|
||||
int stamina = props.getStamina();
|
||||
|
||||
int dashes = props.getDashCount();
|
||||
|
||||
//int count = props.getDashCount();
|
||||
//int x3count = count / 3;
|
||||
|
||||
int rows = dashes / 3;
|
||||
int finalColumns = dashes % 3;
|
||||
|
||||
@ -231,9 +214,8 @@ public class RenderScreenOverlay {
|
||||
barStatus = 3;
|
||||
} else if(staminaDiv == barID) {
|
||||
barStatus = 2;
|
||||
barSize = (int)((float)(stamina % 30) * (width/30F) );
|
||||
if(barID == 0)
|
||||
barStatus = 0;
|
||||
barSize = (int) ((float) (stamina % 30) * (width/30F));
|
||||
if(barID == 0) barStatus = 0;
|
||||
}
|
||||
gui.drawTexturedModalRect(posX + (width+2)*x, posY - 12*y, 76, 18+(10*barStatus), barSize, 10);
|
||||
|
||||
@ -243,10 +225,9 @@ public class RenderScreenOverlay {
|
||||
if(fadeOut > 0 && staminaDiv-1 == barID) {
|
||||
GL11.glColor4f(1F, 1F, 1F, fadeOut);
|
||||
int bar = barID;
|
||||
if(stamina % 30 >= 25)
|
||||
bar++;
|
||||
if(bar / 3 != y)
|
||||
y++;
|
||||
if(stamina % 30 >= 25) bar++;
|
||||
if(bar / 3 != y) y++;
|
||||
|
||||
bar = bar % 3;
|
||||
gui.drawTexturedModalRect(posX + (width + 2) * bar, posY - 12 * y, 76, 58, width, 10);
|
||||
fadeOut -= 0.04F;
|
||||
@ -255,41 +236,6 @@ public class RenderScreenOverlay {
|
||||
}
|
||||
}
|
||||
|
||||
/*for(int x = 0; x < props.getDashCount(); x++) {
|
||||
int status = 3;
|
||||
gui.drawTexturedModalRect(posX + (24)*x, posY, 76, 48, 24, 10);
|
||||
int staminaDiv = stamina / 60;
|
||||
if(staminaDiv > x) {
|
||||
status = 1;
|
||||
} else if(staminaDiv == x) {
|
||||
width = (int)( (float)(stamina % 60) * (width/60F) );
|
||||
status = 2;
|
||||
if(staminaDiv == 0)
|
||||
status = 0;
|
||||
}
|
||||
/*if(staminaDiv-1 == x && (stamina % 60 < 20 && stamina % 60 != 0)) {
|
||||
status = 4;
|
||||
}
|
||||
/*if(((staminaDiv == x && stamina % 60 >= 55) || (staminaDiv-1 == x && stamina % 60 <= 5)) && !(stamina == props.totalDashCount * 60)) {
|
||||
status = 4;
|
||||
}
|
||||
gui.drawTexturedModalRect(posX + (24)*x, posY, 76, 18+(10*status), width, 10);
|
||||
|
||||
if(staminaDiv == x && stamina % 60 >= 57) {
|
||||
fadeOut = 1F;
|
||||
}
|
||||
if(fadeOut > 0 && staminaDiv-1 == x) {
|
||||
GL11.glColor4f(1F, 1F, 1F, fadeOut);
|
||||
int bar = x;
|
||||
if(stamina % 60 >= 50)
|
||||
bar++;
|
||||
System.out.println(bar);
|
||||
gui.drawTexturedModalRect(posX + 24*bar, posY, 76, 58, width, 10);
|
||||
fadeOut -= 0.04F;
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(true);
|
||||
@ -330,8 +276,6 @@ public class RenderScreenOverlay {
|
||||
public static void renderScope(ScaledResolution res, ResourceLocation tex) {
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
//GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
//GL11.glDepthMask(false);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
@ -367,4 +311,42 @@ public class RenderScreenOverlay {
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public static void renderBadges(ScaledResolution res, Gui gui) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
Minecraft.getMinecraft().entityRenderer.setupOverlayRendering();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
|
||||
int offsetX = 2;
|
||||
int offsetY = 2;
|
||||
int width = 26;
|
||||
|
||||
boolean true528 = GeneralConfig.true528();
|
||||
boolean trueExp = GeneralConfig.trueExp();
|
||||
boolean trueRam = MobConfig.trueRam();
|
||||
boolean true328 = true528 && trueExp && trueRam;
|
||||
|
||||
if(true528) { gui.drawTexturedModalRect(offsetX, offsetY, 0, 218, 24, 8); offsetX += width; }
|
||||
if(trueExp) { gui.drawTexturedModalRect(offsetX, offsetY, 0, 226, 24, 8); offsetX += width; }
|
||||
if(trueRam) { gui.drawTexturedModalRect(offsetX, offsetY, 0, 234, 24, 8); offsetX += width; }
|
||||
if(true328) { gui.drawTexturedModalRect(offsetX, offsetY, 0, 242, 24, 8); offsetX += width; }
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@ import javax.annotation.CheckForNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.interfaces.ICustomWarhead.SaltedFuel.HalfLifeType;
|
||||
import com.hbm.interfaces.HalfLifeType;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
|
||||
@ -24,13 +24,13 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
|
||||
public static byte STATE_CLOSED = 0;
|
||||
public static byte STATE_OPEN = 1;
|
||||
public static byte STATE_CLOSING = 2;
|
||||
public static byte STATE_OPENING = 3;
|
||||
public static final byte STATE_CLOSED = 0;
|
||||
public static final byte STATE_OPEN = 1;
|
||||
public static final byte STATE_CLOSING = 2;
|
||||
public static final byte STATE_OPENING = 3;
|
||||
|
||||
//0: closed, 1: open, 2: closing, 3: opening
|
||||
public byte state = 0;
|
||||
public byte state = STATE_CLOSED;
|
||||
protected DoorDecl doorType;
|
||||
public int openTicks = 0;
|
||||
public long animStartTime = 0;
|
||||
@ -47,16 +47,18 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(state == 3) {
|
||||
|
||||
if(getDoorType().onDoorUpdate() != null) {
|
||||
getDoorType().onDoorUpdate().accept(this);
|
||||
}
|
||||
|
||||
if(state == STATE_OPENING) {
|
||||
openTicks++;
|
||||
if(openTicks >= getDoorType().timeToOpen()) {
|
||||
openTicks = getDoorType().timeToOpen();
|
||||
}
|
||||
} else if(state == 2) {
|
||||
if(openTicks >= getDoorType().timeToOpen()) openTicks = getDoorType().timeToOpen();
|
||||
|
||||
} else if(state == STATE_CLOSING) {
|
||||
openTicks--;
|
||||
if(openTicks <= 0) {
|
||||
openTicks = 0;
|
||||
}
|
||||
if(openTicks <= 0) openTicks = 0;
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
@ -66,7 +68,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
int[][] ranges = getDoorType().getDoorOpenRanges();
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(getBlockMetadata() - BlockDummyable.offset);
|
||||
|
||||
if(state == 3) {
|
||||
if(state == STATE_OPENING) {
|
||||
|
||||
for(int i = 0; i < ranges.length; i++) {
|
||||
|
||||
@ -102,7 +104,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
}
|
||||
}
|
||||
|
||||
} else if(state == 2) {
|
||||
} else if(state == STATE_CLOSING) {
|
||||
|
||||
for(int i = 0; i < ranges.length; i++) {
|
||||
|
||||
@ -139,18 +141,18 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(state == 3 && openTicks == getDoorType().timeToOpen()) {
|
||||
state = 1;
|
||||
if(state == STATE_OPENING && openTicks == getDoorType().timeToOpen()) {
|
||||
state = STATE_OPEN;
|
||||
}
|
||||
if(state == 2 && openTicks == 0) {
|
||||
state = 0;
|
||||
if(state == STATE_CLOSING && openTicks == 0) {
|
||||
state = STATE_CLOSED;
|
||||
}
|
||||
|
||||
this.networkPackNT(100);
|
||||
|
||||
if(redstonePower == -1 && state == 1) {
|
||||
if(redstonePower == -1 && state == STATE_OPEN) {
|
||||
tryToggle(-1);
|
||||
} else if(redstonePower > 0 && state == 0) {
|
||||
} else if(redstonePower > 0 && state == STATE_CLOSED) {
|
||||
tryToggle(-1);
|
||||
}
|
||||
if(redstonePower == -1) {
|
||||
@ -169,7 +171,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
handleNewState(buf.readByte());
|
||||
setSkinIndex(buf.readByte());
|
||||
skinIndex = buf.readByte();
|
||||
shouldUseBB = buf.readBoolean();
|
||||
}
|
||||
|
||||
@ -197,36 +199,31 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
|
||||
if(this.isLocked() && player == null) return false;
|
||||
|
||||
if(state == 0 && redstonePower > 0) {
|
||||
if(state == STATE_CLOSED && redstonePower > 0) {
|
||||
//Redstone "power locks" doors, just like minecraft iron doors
|
||||
return false;
|
||||
}
|
||||
if(this.state == 0) {
|
||||
if(!worldObj.isRemote && canAccess(player)) {
|
||||
this.state = 3;
|
||||
}
|
||||
|
||||
if(this.state == STATE_CLOSED) {
|
||||
if(!worldObj.isRemote && canAccess(player)) this.state = STATE_OPENING;
|
||||
return true;
|
||||
} else if(this.state == 1) {
|
||||
if(!worldObj.isRemote && canAccess(player)) {
|
||||
this.state = 2;
|
||||
}
|
||||
|
||||
} else if(this.state == STATE_OPEN) {
|
||||
if(!worldObj.isRemote && canAccess(player)) this.state = STATE_CLOSING;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean tryToggle(int passcode) {
|
||||
if(this.isLocked() && passcode != this.lock)
|
||||
return false;
|
||||
if(this.state == 0) {
|
||||
if(!worldObj.isRemote) {
|
||||
this.state = 3;
|
||||
}
|
||||
if(this.isLocked() && passcode != this.lock) return false;
|
||||
|
||||
if(this.state == STATE_CLOSED) {
|
||||
if(!worldObj.isRemote) this.state = STATE_OPENING;
|
||||
return true;
|
||||
} else if(this.state == 1) {
|
||||
if(!worldObj.isRemote) {
|
||||
this.state = 2;
|
||||
}
|
||||
|
||||
} else if(this.state == STATE_OPEN) {
|
||||
if(!worldObj.isRemote) this.state = STATE_CLOSING;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -238,7 +235,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
if(this.state != state) {
|
||||
DoorDecl doorType = getDoorType();
|
||||
|
||||
if(this.state == 0 && state == 3) { // Door transitioning to open
|
||||
if(this.state == STATE_CLOSED && state == STATE_OPENING) { // Door transitioning to open
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio.setKeepAlive(0);
|
||||
@ -261,7 +258,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
}
|
||||
}
|
||||
|
||||
if(this.state == 1 && state == 2) { // Door transitioning to closed
|
||||
if(this.state == STATE_OPEN && state == STATE_CLOSING) { // Door transitioning to closed
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
}
|
||||
@ -283,7 +280,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
}
|
||||
}
|
||||
|
||||
if(state == 1 || state == 0) { // Door finished any transition
|
||||
if(state == STATE_OPEN || state == STATE_CLOSED) { // Door finished any transition
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
@ -294,13 +291,13 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
}
|
||||
}
|
||||
|
||||
if(this.state == 3 && state == 1) { // Door finished transitioning to open
|
||||
if(this.state == STATE_OPENING && state == STATE_OPEN) { // Door finished transitioning to open
|
||||
if(doorType.getOpenSoundEnd() != null) {
|
||||
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getOpenSoundEnd(), doorType.getSoundVolume(), 1F, false);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.state == 2 && state == 0) { // Door finished transitioning to closed
|
||||
if(this.state == STATE_CLOSING && state == STATE_CLOSED) { // Door finished transitioning to closed
|
||||
if(doorType.getCloseSoundEnd() != null) {
|
||||
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getCloseSoundEnd(), doorType.getSoundVolume(), 1F, false);
|
||||
}
|
||||
@ -308,10 +305,10 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
|
||||
|
||||
this.state = state;
|
||||
if(state > 1) animStartTime = System.currentTimeMillis();
|
||||
|
||||
if(state == STATE_OPENING || state == STATE_CLOSING) {
|
||||
currentAnimation = this.doorType.getSEDNAAnim(state);
|
||||
animStartTime = System.currentTimeMillis();
|
||||
currentAnimation = this.doorType.getSEDNAAnim(state, this.skinIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -320,23 +317,21 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
|
||||
return skinIndex;
|
||||
}
|
||||
|
||||
public boolean setSkinIndex(byte skinIndex) {
|
||||
if(!getDoorType().hasSkins())
|
||||
return false;
|
||||
if(getDoorType().getSkinCount() < skinIndex) {
|
||||
return false;
|
||||
}
|
||||
this.skinIndex = skinIndex;
|
||||
public boolean cycleSkinIndex() {
|
||||
if(!getDoorType().hasSkins()) return false;
|
||||
this.skinIndex++;
|
||||
this.skinIndex %= getDoorType().getSkinCount();
|
||||
this.markDirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**Useful for logic block interactions, as a way to close/open doors**/
|
||||
public void open(){
|
||||
if(state == 0) state = 3;
|
||||
if(state == STATE_CLOSED) state = STATE_OPENING;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
if(state == 1) state = 2;
|
||||
if(state == STATE_OPEN) state = STATE_CLOSING;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
|
||||
import api.hbm.energymk2.IEnergyConductorMK2;
|
||||
import api.hbm.energymk2.IEnergyConnectorMK2;
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
import api.hbm.fluidmk2.IFluidConnectorMK2;
|
||||
import api.hbm.fluidmk2.IFluidReceiverMK2;
|
||||
@ -148,15 +149,15 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
|
||||
if(power && getCoreObject() instanceof IEnergyReceiverMK2) {
|
||||
return ((IEnergyReceiverMK2)getCoreObject()).canConnect(dir);
|
||||
if(power && getCoreObject() instanceof IEnergyConnectorMK2) {
|
||||
return ((IEnergyConnectorMK2)getCoreObject()).canConnect(dir);
|
||||
}
|
||||
|
||||
if(conductor && getCoreObject() instanceof IEnergyConductorMK2) {
|
||||
return ((IEnergyConductorMK2)getCoreObject()).canConnect(dir);
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -130,7 +130,7 @@ public class TileMappings {
|
||||
put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster");
|
||||
put(TileEntityMachineSatLinker.class, "tileentity_satlinker");
|
||||
put(TileEntityReactorResearch.class, "tileentity_small_reactor");
|
||||
put(TileEntityVaultDoor.class, "tileentity_vault_door");
|
||||
put(TileEntityVaultDoorMigration.class, "tileentity_vault_door");
|
||||
put(TileEntityRadiobox.class, "tileentity_radio_broadcaster");
|
||||
put(TileEntityRadioRec.class, "tileentity_radio_receiver");
|
||||
put(TileEntityVent.class, "tileentity_vent");
|
||||
@ -347,6 +347,7 @@ public class TileMappings {
|
||||
put(TileEntitySteamEngine.class, "tileentity_steam_engine");
|
||||
put(TileEntityMachineTurbine.class, "tileentity_turbine");
|
||||
put(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine");
|
||||
put(TileEntityMachineIndustrialTurbine.class, "tileentity_ind_turbine");
|
||||
put(TileEntityChungus.class, "tileentity_chungus");
|
||||
|
||||
put(TileEntityMachineCombustionEngine.class, "tileentity_combustion_engine");
|
||||
|
||||
@ -7,54 +7,35 @@ import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyProviderMK2;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine, IBufPacketReceiver, IFluidCopiable{
|
||||
public class TileEntityChungus extends TileEntityTurbineBase implements SimpleComponent, CompatHandler.OCComponent, IConfigurableMachine {
|
||||
|
||||
public long power;
|
||||
private int turnTimer;
|
||||
public float rotor;
|
||||
public float lastRotor;
|
||||
public float fanAcceleration = 0F;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
protected double[] info = new double[3];
|
||||
|
||||
private AudioWrapper audio;
|
||||
private float audioDesync;
|
||||
|
||||
//Configurable values
|
||||
public static long maxPower = 100000000000L;
|
||||
public static int inputTankSize = 1_000_000_000;
|
||||
public static int outputTankSize = 1_000_000_000;
|
||||
public static double efficiency = 0.85D;
|
||||
@ -75,7 +56,6 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
@ -83,66 +63,40 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("INFO").value("leviathan steam turbine consumes all availible steam per tick");
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
|
||||
@Override public double consumptionPercent() { return 1D; }
|
||||
@Override public double getEfficiency() { return efficiency; }
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.power *= 0.95;
|
||||
|
||||
this.info = new double[3];
|
||||
|
||||
boolean operational = false;
|
||||
FluidType in = tanks[0].getTankType();
|
||||
boolean valid = false;
|
||||
if(in.hasTrait(FT_Coolable.class)) {
|
||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //85% efficiency by default
|
||||
if(eff > 0) {
|
||||
tanks[1].setTankType(trait.coolsTo);
|
||||
int inputOps = tanks[0].getFill() / trait.amountReq;
|
||||
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
|
||||
int ops = Math.min(inputOps, outputOps);
|
||||
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
|
||||
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
|
||||
this.power += (ops * trait.heatEnergy * eff);
|
||||
info[0] = ops * trait.amountReq;
|
||||
info[1] = ops * trait.amountProduced;
|
||||
info[2] = ops * trait.heatEnergy * eff;
|
||||
valid = true;
|
||||
operational = ops > 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!valid) tanks[1].setTankType(Fluids.NONE);
|
||||
if(power > maxPower) power = maxPower;
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
this.tryProvide(worldObj, xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, dir.getOpposite());
|
||||
|
||||
for(DirPos pos : this.getConPos()) {
|
||||
this.sendFluid(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + dir.offsetX * 5, yCoord + 2, zCoord + dir.offsetZ * 5, dir),
|
||||
new DirPos(xCoord + rot.offsetX * 3, yCoord, zCoord + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord - rot.offsetX * 3, yCoord, zCoord - rot.offsetZ * 3, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
if(power > maxPower)
|
||||
power = maxPower;
|
||||
@Override
|
||||
public DirPos[] getPowerPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
return new DirPos[] { new DirPos(xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, dir.getOpposite()) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServerTick() {
|
||||
turnTimer--;
|
||||
|
||||
if(operational) turnTimer = 25;
|
||||
networkPackNT(150);
|
||||
}
|
||||
|
||||
} else {
|
||||
@Override
|
||||
public void onClientTick() {
|
||||
|
||||
this.lastRotor = this.rotor;
|
||||
this.rotor += this.fanAcceleration;
|
||||
@ -168,15 +122,16 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
-dir.offsetX * 0.2, 0, -dir.offsetZ * 0.2);
|
||||
}
|
||||
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.chungusTurbineRunning", xCoord, yCoord, zCoord, 1.0F, 20F, 1.0F);
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.chungusTurbineRunning", xCoord, yCoord, zCoord, 1.0F, 20F, 1.0F, 20);
|
||||
audio.startSound();
|
||||
}
|
||||
|
||||
float turbineSpeed = this.fanAcceleration / 25F;
|
||||
audio.updateVolume(getVolume(0.5f * turbineSpeed));
|
||||
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
|
||||
audio.keepAlive();
|
||||
|
||||
} else {
|
||||
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration -= 0.1F));
|
||||
|
||||
@ -192,54 +147,17 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onLeverPull(FluidType previous) {
|
||||
for(BlockPos pos : getConPos()) {
|
||||
this.tryUnsubscribe(previous, worldObj, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + dir.offsetX * 5, yCoord + 2, zCoord + dir.offsetZ * 5, dir),
|
||||
new DirPos(xCoord + rot.offsetX * 3, yCoord, zCoord + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord - rot.offsetX * 3, yCoord, zCoord - rot.offsetZ * 3, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeLong(this.power);
|
||||
super.serialize(buf);
|
||||
buf.writeInt(this.turnTimer);
|
||||
this.tanks[0].serialize(buf);
|
||||
this.tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
this.power = buf.readLong();
|
||||
super.deserialize(buf);
|
||||
this.turnTimer = buf.readInt();
|
||||
this.tanks[0].deserialize(buf);
|
||||
this.tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
tanks[0].readFromNBT(nbt, "water");
|
||||
tanks[1].readFromNBT(nbt, "steam");
|
||||
power = nbt.getLong("power");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
tanks[0].writeToNBT(nbt, "water");
|
||||
tanks[1].writeToNBT(nbt, "steam");
|
||||
nbt.setLong("power", power);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -247,32 +165,11 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir != ForgeDirection.UP && dir != ForgeDirection.DOWN && dir != ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public String getComponentName() {
|
||||
@ -321,13 +218,13 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
@Callback(direct = true, doc = "function():number -- Gets the power buffer of the turbine.")
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getPower(Context context, Arguments args) {
|
||||
return new Object[] {power};
|
||||
return new Object[] {powerBuffer};
|
||||
}
|
||||
|
||||
@Callback(direct = true, doc = "function():table -- Gets information about this turbine. The format is the following: <input tank amount>, <input tank capacity>, <output tank amount>, <output tank capacity>, <input tank fluid type>, <power>")
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], power};
|
||||
return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], powerBuffer};
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -359,32 +256,4 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {tanks[1]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tanks[0]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, info[1] > 0);
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, info[0]);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, info[1]);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, info[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank getTankToPaste() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,20 +242,6 @@ public class TileEntityMachineArcFurnaceLarge extends TileEntityMachineBase impl
|
||||
}
|
||||
|
||||
if(this.lid != this.prevLid && this.lid < this.prevLid && this.lid > 0.5F && this.hasMaterial && MainRegistry.proxy.me().getDistance(xCoord + 0.5, yCoord + 4, zCoord + 0.5) < 50) {
|
||||
/*NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "tower");
|
||||
data.setFloat("lift", 0.01F);
|
||||
data.setFloat("base", 0.5F);
|
||||
data.setFloat("max", 2F);
|
||||
data.setInteger("life", 50 + worldObj.rand.nextInt(20));
|
||||
data.setDouble("posX", xCoord + 0.5 + worldObj.rand.nextGaussian() * 0.25);
|
||||
data.setDouble("posZ", zCoord + 0.5 + worldObj.rand.nextGaussian() * 0.25);
|
||||
data.setDouble("posY", yCoord + 4);
|
||||
data.setBoolean("noWind", true);
|
||||
data.setFloat("alphaMod", prevLid / lid);
|
||||
data.setInteger("color", 0x808080);
|
||||
data.setFloat("strafe", 0.15F);
|
||||
MainRegistry.proxy.effectNT(data);*/
|
||||
|
||||
if(worldObj.rand.nextInt(5) == 0) {
|
||||
NBTTagCompound flame = new NBTTagCompound();
|
||||
@ -286,7 +272,7 @@ public class TileEntityMachineArcFurnaceLarge extends TileEntityMachineBase impl
|
||||
// add to existing stacks
|
||||
for(int i /* ingredient */ = 5; i < 25; i++) {
|
||||
if(slots[i] == null) continue;
|
||||
if(!slots[q].isItemEqual(slots[i])) continue;
|
||||
if(!slots[q].isItemEqual(slots[i]) || !ItemStack.areItemStackTagsEqual(slots[q], slots[i])) continue;
|
||||
int toMove = BobMathUtil.min(slots[i].getMaxStackSize() - slots[i].stackSize, slots[q].stackSize, max - slots[i].stackSize);
|
||||
if(toMove > 0) {
|
||||
this.decrStackSize(q, toMove);
|
||||
|
||||
@ -21,6 +21,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.module.machine.ModuleMachineAssembler;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IConditionalInvAccess;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
@ -45,7 +46,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
// TODO: make a base class because 90% of this is just copy pasted from the chemfac
|
||||
@NotableComments
|
||||
public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider {
|
||||
public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider, IConditionalInvAccess {
|
||||
|
||||
public FluidTank[] allTanks;
|
||||
public FluidTank[] inputTanks;
|
||||
@ -122,6 +123,26 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl
|
||||
}; // ho boy, a big fucking array of hand-written values, surely this isn't gonna bite me in the ass some day
|
||||
}
|
||||
|
||||
/// CONDITIONAL ACCESS ///
|
||||
@Override public boolean isItemValidForSlot(int x, int y, int z, int slot, ItemStack stack) { return this.isItemValidForSlot(slot, stack); }
|
||||
@Override public boolean canInsertItem(int x, int y, int z, int slot, ItemStack stack, int side) { return this.canInsertItem(slot, stack, side); }
|
||||
@Override public boolean canExtractItem(int x, int y, int z, int slot, ItemStack stack, int side) { return this.canExtractItem(slot, stack, side); }
|
||||
|
||||
@Override public int[] getAccessibleSlotsFromSide(int x, int y, int z, int side) {
|
||||
DirPos[] io = getIOPos();
|
||||
for(int i = 0; i < io.length; i++) {
|
||||
if(io[i].compare(x + io[i].getDir().offsetX, y, z + io[i].getDir().offsetZ)) {
|
||||
return new int[] {
|
||||
5 + i * 14, 6 + i * 14, 7 + i * 14, 8 + i * 14,
|
||||
9 + i * 14, 10 + i * 14, 11 + i * 14, 12 + i * 14,
|
||||
13 + i * 14, 14 + i * 14, 15 + i * 14, 16 + i * 14,
|
||||
17, 31, 45, 59 // entering flavor town...
|
||||
};
|
||||
}
|
||||
}
|
||||
return this.getAccessibleSlotsFromSide(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineAssemblyFactory";
|
||||
@ -253,7 +274,6 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public DirPos[] getCoolPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
@ -266,6 +286,18 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl
|
||||
};
|
||||
}
|
||||
|
||||
public DirPos[] getIOPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + dir.offsetX + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord - dir.offsetX + rot.offsetX * 3, yCoord, zCoord - dir.offsetZ + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord + dir.offsetX - rot.offsetX * 3, yCoord, zCoord + dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
|
||||
new DirPos(xCoord - dir.offsetX - rot.offsetX * 3, yCoord, zCoord - dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
@ -368,7 +400,7 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_chemical_factory));
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembly_factory));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(KEY_SPEED, "+" + (level * 100 / 3) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(KEY_CONSUMPTION, "+" + (level * 50) + "%"));
|
||||
|
||||
@ -19,6 +19,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.module.machine.ModuleMachineChemplant;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IConditionalInvAccess;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
@ -41,7 +42,7 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineChemicalFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider {
|
||||
public class TileEntityMachineChemicalFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider, IConditionalInvAccess {
|
||||
|
||||
public FluidTank[] allTanks;
|
||||
public FluidTank[] inputTanks;
|
||||
@ -121,6 +122,27 @@ public class TileEntityMachineChemicalFactory extends TileEntityMachineBase impl
|
||||
};
|
||||
}
|
||||
|
||||
/// CONDITIONAL ACCESS ///
|
||||
@Override public boolean isItemValidForSlot(int x, int y, int z, int slot, ItemStack stack) { return this.isItemValidForSlot(slot, stack); }
|
||||
@Override public boolean canInsertItem(int x, int y, int z, int slot, ItemStack stack, int side) { return this.canInsertItem(slot, stack, side); }
|
||||
@Override public boolean canExtractItem(int x, int y, int z, int slot, ItemStack stack, int side) { return this.canExtractItem(slot, stack, side); }
|
||||
|
||||
@Override public int[] getAccessibleSlotsFromSide(int x, int y, int z, int side) {
|
||||
DirPos[] io = getIOPos();
|
||||
for(int i = 0; i < io.length; i++) {
|
||||
if(io[i].compare(x + io[i].getDir().offsetX, y, z + io[i].getDir().offsetZ)) {
|
||||
return new int[] {
|
||||
5 + i * 7, 6 + i * 7, 7 + i * 7,
|
||||
8, 9, 10,
|
||||
15, 16, 17,
|
||||
22, 23, 24,
|
||||
29, 30, 31
|
||||
};
|
||||
}
|
||||
}
|
||||
return this.getAccessibleSlotsFromSide(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineChemicalFactory";
|
||||
@ -289,6 +311,18 @@ public class TileEntityMachineChemicalFactory extends TileEntityMachineBase impl
|
||||
};
|
||||
}
|
||||
|
||||
public DirPos[] getIOPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + dir.offsetX + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord - dir.offsetX + rot.offsetX * 3, yCoord, zCoord - dir.offsetZ + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord + dir.offsetX - rot.offsetX * 3, yCoord, zCoord + dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
|
||||
new DirPos(xCoord - dir.offsetX - rot.offsetX * 3, yCoord, zCoord - dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
|
||||
@ -0,0 +1,238 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase implements IConfigurableMachine {
|
||||
|
||||
public static int inputTankSize = 512_000;
|
||||
public static int outputTankSize = 2_048_000;
|
||||
public static double efficiency = 1D;
|
||||
|
||||
public float rotor;
|
||||
public float lastRotor;
|
||||
|
||||
public double spin = 0;
|
||||
public static double ACCELERATION = 1D / 400D;
|
||||
public long lastPowerTarget = 0;
|
||||
|
||||
private AudioWrapper audio;
|
||||
private float audioDesync;
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "steamturbineIndustrial";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
public TileEntityMachineIndustrialTurbine() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||
|
||||
Random rand = new Random();
|
||||
audioDesync = rand.nextFloat() * 0.05F;
|
||||
}
|
||||
|
||||
// sets the power target so we know how much this steam type can theoretically make, and increments the spin based on actual throughput
|
||||
@Override
|
||||
public void generatePower(long power, int steamConsumed) {
|
||||
FT_Coolable trait = tanks[0].getTankType().getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * getEfficiency();
|
||||
int maxOps = (int) Math.ceil((tanks[0].getMaxFill() * consumptionPercent()) / trait.amountReq);
|
||||
this.lastPowerTarget = (long) (maxOps * trait.heatEnergy * eff); // theoretical max output at full blast with this type
|
||||
double fraction = (double) steamConsumed / (double) (trait.amountReq * maxOps); // % of max steam throughput currently achieved
|
||||
|
||||
if(Math.abs(spin - fraction) <= ACCELERATION) {
|
||||
this.spin = fraction;
|
||||
} else if(spin < fraction) {
|
||||
this.spin += ACCELERATION;
|
||||
} else if(spin > fraction) {
|
||||
this.spin -= ACCELERATION;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServerTick() {
|
||||
if(!operational) {
|
||||
this.spin -= ACCELERATION;
|
||||
}
|
||||
|
||||
if(this.spin <= 0) {
|
||||
this.spin = 0;
|
||||
} else {
|
||||
this.powerBuffer = (long) (this.lastPowerTarget * this.spin);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClientTick() {
|
||||
|
||||
this.lastRotor = this.rotor;
|
||||
float speed = this.spin >= 0.5 ? 30 : (float) (Math.pow(this.spin * 2, 0.5) * 30);
|
||||
this.rotor += speed;
|
||||
|
||||
if(this.rotor >= 360) {
|
||||
this.lastRotor -= 360;
|
||||
this.rotor -= 360;
|
||||
}
|
||||
|
||||
if(this.spin > 0 && MainRegistry.proxy.me().getDistance(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) <= 35) {
|
||||
|
||||
float spinNum = (float) Math.min(1F, spin * 2);
|
||||
float volume = this.getVolume(0.25F + spinNum * 0.75F);
|
||||
float pitch = 0.5F + spinNum * 0.5F + this.audioDesync;
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.largeTurbineRunning", xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, volume, 20F, pitch, 20);
|
||||
audio.startSound();
|
||||
}
|
||||
|
||||
audio.keepAlive();
|
||||
audio.updatePitch(pitch);
|
||||
audio.updateVolume(volume);
|
||||
|
||||
} else {
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
ForgeDirection myDir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
return dir == myDir.getOpposite();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(FluidType type, ForgeDirection dir) {
|
||||
if(!type.hasTrait(FT_Coolable.class)) return false;
|
||||
ForgeDirection myDir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
return dir != myDir && dir != myDir.getOpposite();
|
||||
}
|
||||
|
||||
@Override public double consumptionPercent() { return 0.2D; }
|
||||
@Override public double getEfficiency() { return efficiency; }
|
||||
@Override public boolean doesResizeCompressor() { return true; }
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeDouble(this.spin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.spin = buf.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
lastPowerTarget = nbt.getLong("lastPowerTarget");
|
||||
spin = nbt.getDouble("spin");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("lastPowerTarget", lastPowerTarget);
|
||||
nbt.setDouble("spin", spin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + dir.offsetX * 3 + rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 3 + rot.offsetZ * 2, rot),
|
||||
new DirPos(xCoord + dir.offsetX * 3 - rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 3 - rot.offsetZ * 2, rot.getOpposite()),
|
||||
new DirPos(xCoord - dir.offsetX * 1 + rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 1 + rot.offsetZ * 2, rot),
|
||||
new DirPos(xCoord - dir.offsetX * 1 - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 1 - rot.offsetZ * 2, rot.getOpposite()),
|
||||
new DirPos(xCoord + dir.offsetX * 3, yCoord + 3, zCoord + dir.offsetZ * 3, ForgeDirection.UP),
|
||||
new DirPos(xCoord - dir.offsetX * 1, yCoord + 3, zCoord - dir.offsetZ * 1, ForgeDirection.UP),
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getPowerPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord - dir.offsetX * 4, yCoord + 1, zCoord - dir.offsetZ * 4, dir.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 3,
|
||||
yCoord,
|
||||
zCoord - 3,
|
||||
xCoord + 4,
|
||||
yCoord + 3,
|
||||
zCoord + 4
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.Random;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerMachineLargeTurbine;
|
||||
@ -18,7 +15,6 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
@ -44,7 +40,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine, IFluidCopiable {
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IFluidCopiable {
|
||||
|
||||
public long power;
|
||||
public FluidTank[] tanks;
|
||||
@ -76,28 +72,6 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
audioDesync = rand.nextFloat() * 0.05F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "steamturbineIndustrial";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineLargeTurbine";
|
||||
|
||||
@ -26,7 +26,7 @@ import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||
import api.hbm.redstoneoverradio.IRORInteractive;
|
||||
import api.hbm.redstoneoverradio.IRORValueProvider;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
@ -47,7 +47,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityPWRController extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, SimpleComponent, IFluidStandardTransceiver, CompatHandler.OCComponent, IRORValueProvider, IRORInteractive {
|
||||
public class TileEntityPWRController extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, SimpleComponent, IFluidStandardTransceiverMK2, CompatHandler.OCComponent, IRORValueProvider, IRORInteractive {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public long coreHeat;
|
||||
@ -190,7 +190,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
BlockPos portPos = pos.offset(dir);
|
||||
|
||||
if(tanks[1].getFill() > 0) this.sendFluid(tanks[1], worldObj, portPos.getX(), portPos.getY(), portPos.getZ(), dir);
|
||||
if(tanks[1].getFill() > 0) this.tryProvide(tanks[1], worldObj, portPos.getX(), portPos.getY(), portPos.getZ(), dir);
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) this.trySubscribe(tanks[0].getTankType(), worldObj, portPos.getX(), portPos.getY(), portPos.getZ(), dir);
|
||||
}
|
||||
}
|
||||
@ -634,33 +634,49 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
return new GUIPWR(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] { tanks[1] };
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tanks[0] };
|
||||
}
|
||||
@Override public FluidTank[] getAllTanks() { return tanks; }
|
||||
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] { tanks[1] }; }
|
||||
@Override public FluidTank[] getReceivingTanks() { return new FluidTank[] { tanks[0] }; }
|
||||
|
||||
@Override
|
||||
public String[] getFunctionInfo() {
|
||||
return new String[0]; //TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public String runRORFunction(String name, String[] params) {
|
||||
return "";
|
||||
return new String[] {
|
||||
PREFIX_VALUE + "coreheat",
|
||||
PREFIX_VALUE + "hullheat",
|
||||
PREFIX_VALUE + "flux",
|
||||
PREFIX_VALUE + "depletion",
|
||||
PREFIX_FUNCTION + "setrods" + NAME_SEPARATOR + "percent",
|
||||
PREFIX_FUNCTION + "jettison",
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String provideRORValue(String name) {
|
||||
return "";
|
||||
if((PREFIX_VALUE + "coreheat").equals(name)) return "" + this.coreHeat;
|
||||
if((PREFIX_VALUE + "hullheat").equals(name)) return "" + this.hullHeat;
|
||||
if((PREFIX_VALUE + "flux").equals(name)) return "" + (int) this.flux;
|
||||
if((PREFIX_VALUE + "depletion").equals(name)) return "" + (int) (this.progress * 100 / this.processTime);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String runRORFunction(String name, String[] params) {
|
||||
|
||||
if((PREFIX_FUNCTION + "setrods").equals(name) && params.length > 0) {
|
||||
int percent = IRORInteractive.parseInt(params[0], 0, 100);
|
||||
this.rodTarget = percent;
|
||||
this.markChanged();
|
||||
return null;
|
||||
}
|
||||
|
||||
if((PREFIX_FUNCTION + "jettison").equals(name)) {
|
||||
this.typeLoaded = -1;
|
||||
this.amountLoaded = 0;
|
||||
this.progress = 0;
|
||||
this.markChanged();
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ public class TileEntitySteamEngine extends TileEntityLoadedBase implements IEner
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
ByteBuf buf;
|
||||
protected ByteBuf buf;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
@ -0,0 +1,184 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyProviderMK2;
|
||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public abstract class TileEntityTurbineBase extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiverMK2, IInfoProviderEC, IBufPacketReceiver, IFluidCopiable {
|
||||
|
||||
protected ByteBuf buf;
|
||||
public long powerBuffer;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
protected double[] info = new double[3];
|
||||
public boolean operational = false;
|
||||
|
||||
public abstract double getEfficiency();
|
||||
public abstract DirPos[] getConPos();
|
||||
public abstract DirPos[] getPowerPos();
|
||||
public abstract double consumptionPercent();
|
||||
|
||||
public void generatePower(long power, int steamConsumed) {
|
||||
this.powerBuffer += power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.powerBuffer = 0;
|
||||
this.info = new double[3];
|
||||
|
||||
if(this.buf != null) this.buf.release();
|
||||
this.buf = Unpooled.buffer();
|
||||
|
||||
this.tanks[0].serialize(buf);
|
||||
|
||||
operational = false;
|
||||
FluidType in = tanks[0].getTankType();
|
||||
boolean valid = false;
|
||||
if(in.hasTrait(FT_Coolable.class)) {
|
||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * getEfficiency();
|
||||
if(eff > 0) {
|
||||
tanks[1].setTankType(trait.coolsTo);
|
||||
int inputOps = (int) Math.ceil((tanks[0].getFill() * consumptionPercent()) / trait.amountReq);
|
||||
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
|
||||
int ops = Math.min(inputOps, outputOps);
|
||||
if(ops > 0) {
|
||||
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
|
||||
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
|
||||
this.generatePower((long) (ops * trait.heatEnergy * eff), ops * trait.amountReq);
|
||||
}
|
||||
info[0] = ops * trait.amountReq;
|
||||
info[1] = ops * trait.amountProduced;
|
||||
info[2] = ops * trait.heatEnergy * eff;
|
||||
valid = true;
|
||||
operational = ops > 0;
|
||||
}
|
||||
}
|
||||
|
||||
onServerTick();
|
||||
|
||||
this.tanks[1].serialize(buf);
|
||||
this.buf.writeLong(this.powerBuffer);
|
||||
|
||||
if(!valid) tanks[1].setTankType(Fluids.NONE);
|
||||
|
||||
for(DirPos pos : this.getPowerPos()) {
|
||||
this.tryProvide(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
|
||||
for(DirPos pos : this.getConPos()) {
|
||||
this.tryProvide(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
networkPackNT(150);
|
||||
|
||||
} else {
|
||||
onClientTick();
|
||||
}
|
||||
}
|
||||
|
||||
public void onServerTick() { }
|
||||
public void onClientTick() { }
|
||||
|
||||
public void onLeverPull() {
|
||||
|
||||
FluidType type = tanks[0].getTankType();
|
||||
boolean resize = this.doesResizeCompressor();
|
||||
|
||||
if(type == Fluids.STEAM) {
|
||||
tanks[0].setTankType(Fluids.HOTSTEAM); tanks[1].setTankType(Fluids.STEAM);
|
||||
if(resize) { tanks[0].changeTankSize(tanks[0].getMaxFill() / 10); tanks[1].changeTankSize(tanks[1].getMaxFill() / 10); }
|
||||
} else if(type == Fluids.HOTSTEAM) {
|
||||
tanks[0].setTankType(Fluids.SUPERHOTSTEAM); tanks[1].setTankType(Fluids.HOTSTEAM);
|
||||
if(resize) { tanks[0].changeTankSize(tanks[0].getMaxFill() / 10); tanks[1].changeTankSize(tanks[1].getMaxFill() / 10); }
|
||||
} else if(type == Fluids.SUPERHOTSTEAM) {
|
||||
tanks[0].setTankType(Fluids.ULTRAHOTSTEAM); tanks[1].setTankType(Fluids.SUPERHOTSTEAM);
|
||||
if(resize) { tanks[0].changeTankSize(tanks[0].getMaxFill() / 10); tanks[1].changeTankSize(tanks[1].getMaxFill() / 10); }
|
||||
} else if(type == Fluids.ULTRAHOTSTEAM) {
|
||||
tanks[0].setTankType(Fluids.STEAM); tanks[1].setTankType(Fluids.SPENTSTEAM);
|
||||
if(resize) { tanks[0].changeTankSize(tanks[0].getMaxFill() * 1000); tanks[1].changeTankSize(tanks[1].getMaxFill() * 1000); }
|
||||
} else {
|
||||
tanks[0].setTankType(Fluids.STEAM); tanks[1].setTankType(Fluids.SPENTSTEAM);
|
||||
}
|
||||
|
||||
markDirty();
|
||||
}
|
||||
|
||||
public boolean doesResizeCompressor() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeBytes(this.buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.tanks[0].deserialize(buf);
|
||||
this.tanks[1].deserialize(buf);
|
||||
this.powerBuffer = buf.readLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
tanks[0].readFromNBT(nbt, "water");
|
||||
tanks[1].readFromNBT(nbt, "steam");
|
||||
powerBuffer = nbt.getLong("power");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
tanks[0].writeToNBT(nbt, "water");
|
||||
tanks[1].writeToNBT(nbt, "steam");
|
||||
nbt.setLong("power", powerBuffer);
|
||||
}
|
||||
|
||||
@Override public long getPower() { return powerBuffer; }
|
||||
@Override public long getMaxPower() { return powerBuffer; }
|
||||
@Override public void setPower(long power) { this.powerBuffer = power; }
|
||||
|
||||
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {tanks[1]}; }
|
||||
@Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tanks[0]}; }
|
||||
@Override public FluidTank[] getAllTanks() { return tanks; }
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, info[1] > 0);
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, info[0]);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, info[1]);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, info[2]);
|
||||
}
|
||||
|
||||
@Override public FluidTank getTankToPaste() { return null; }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
@ -1,348 +0,0 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.DummyBlockVault;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.TEVaultPacket;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityVaultDoor extends TileEntityLockableBase {
|
||||
|
||||
public boolean isOpening = false;
|
||||
//0: closed, 1: opening/closing, 2:open
|
||||
public int state = 0;
|
||||
public long sysTime;
|
||||
private int timer = 0;
|
||||
public int type;
|
||||
public static final int maxTypes = 7;
|
||||
public boolean redstoned = false;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(!isLocked()) {
|
||||
boolean flagX = false;
|
||||
boolean flagZ = false;
|
||||
|
||||
for(int x = xCoord - 2; x <= xCoord + 2; x++)
|
||||
for(int y = yCoord; y <= yCoord + 5; y++)
|
||||
if(worldObj.isBlockIndirectlyGettingPowered(x, y, zCoord)) {
|
||||
flagX = true;
|
||||
break;
|
||||
}
|
||||
|
||||
for(int z = zCoord - 2; z <= zCoord + 2; z++)
|
||||
for(int y = yCoord; y <= yCoord + 5; y++)
|
||||
if(worldObj.isBlockIndirectlyGettingPowered(xCoord, y, z)) {
|
||||
flagZ = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 2 || worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 3) {
|
||||
if(flagX) {
|
||||
|
||||
if(!redstoned) {
|
||||
this.tryToggle();
|
||||
}
|
||||
|
||||
redstoned = true;
|
||||
} else {
|
||||
|
||||
redstoned = false;
|
||||
}
|
||||
}
|
||||
if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 4 || worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 5) {
|
||||
if(flagZ) {
|
||||
|
||||
if(!redstoned) {
|
||||
this.tryToggle();
|
||||
}
|
||||
|
||||
redstoned = true;
|
||||
} else {
|
||||
|
||||
redstoned = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isOpening && state == 1) {
|
||||
|
||||
if(timer == 0)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultScrapeNew", 1.0F, 1.0F);
|
||||
if(timer == 45)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 55)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 65)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 75)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 85)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 95)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 105)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 115)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
}
|
||||
if(!isOpening && state == 1) {
|
||||
|
||||
if(timer == 0)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 10)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 20)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 30)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 40)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 50)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 60)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
if(timer == 70)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThudNew", 1.0F, 1.0F);
|
||||
|
||||
if(timer == 80)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultScrapeNew", 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(state != 1) {
|
||||
timer = 0;
|
||||
} else {
|
||||
timer++;
|
||||
|
||||
if(timer >= 120) {
|
||||
|
||||
if(isOpening)
|
||||
finishOpen();
|
||||
else
|
||||
finishClose();
|
||||
}
|
||||
}
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEVaultPacket(xCoord, yCoord, zCoord, isOpening, state, 0, type), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 250));
|
||||
}
|
||||
}
|
||||
|
||||
public void open() {
|
||||
if(state == 0) {
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEVaultPacket(xCoord, yCoord, zCoord, isOpening, state, 1, type), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 250));
|
||||
isOpening = true;
|
||||
state = 1;
|
||||
|
||||
openHatch();
|
||||
}
|
||||
}
|
||||
|
||||
public void finishOpen() {
|
||||
state = 2;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
if(state == 2) {
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEVaultPacket(xCoord, yCoord, zCoord, isOpening, state, 1, type), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 250));
|
||||
isOpening = false;
|
||||
state = 1;
|
||||
|
||||
closeHatch();
|
||||
}
|
||||
}
|
||||
|
||||
public void finishClose() {
|
||||
state = 0;
|
||||
}
|
||||
|
||||
public boolean canOpen() {
|
||||
return state == 0;
|
||||
}
|
||||
|
||||
public boolean canClose() {
|
||||
return state == 2 && isHatchFree();
|
||||
}
|
||||
|
||||
public void tryToggle() {
|
||||
|
||||
if(canOpen())
|
||||
open();
|
||||
else if(canClose())
|
||||
close();
|
||||
}
|
||||
|
||||
public boolean placeDummy(int x, int y, int z) {
|
||||
|
||||
Block present = worldObj.getBlock(x, y, z);
|
||||
if(!present.isReplaceable(worldObj, x, y, z) && present != ModBlocks.dummy_block_vault) worldObj.func_147480_a(x, y, z, false);
|
||||
|
||||
worldObj.setBlock(x, y, z, ModBlocks.dummy_block_vault);
|
||||
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = xCoord;
|
||||
dummy.targetY = yCoord;
|
||||
dummy.targetZ = zCoord;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void removeDummy(int x, int y, int z) {
|
||||
|
||||
if(worldObj.getBlock(x, y, z) == ModBlocks.dummy_block_vault) {
|
||||
DummyBlockVault.safeBreak = true;
|
||||
worldObj.setBlock(x, y, z, Blocks.air);
|
||||
DummyBlockVault.safeBreak = false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isHatchFree() {
|
||||
|
||||
if(this.getBlockMetadata() == 2 || this.getBlockMetadata() == 3)
|
||||
return checkNS();
|
||||
else if(this.getBlockMetadata() == 4 || this.getBlockMetadata() == 5)
|
||||
return checkEW();
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
private void closeHatch() {
|
||||
|
||||
if(this.getBlockMetadata() == 2 || this.getBlockMetadata() == 3)
|
||||
fillNS();
|
||||
else if(this.getBlockMetadata() == 4 || this.getBlockMetadata() == 5)
|
||||
fillEW();
|
||||
}
|
||||
|
||||
private void openHatch() {
|
||||
|
||||
if(this.getBlockMetadata() == 2 || this.getBlockMetadata() == 3)
|
||||
removeNS();
|
||||
else if(this.getBlockMetadata() == 4 || this.getBlockMetadata() == 5)
|
||||
removeEW();
|
||||
}
|
||||
|
||||
private boolean checkNS() {
|
||||
return worldObj.getBlock(xCoord - 1, yCoord + 1, zCoord).isReplaceable(worldObj, xCoord - 1, yCoord + 1, zCoord) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord).isReplaceable(worldObj, xCoord, yCoord + 1, zCoord) &&
|
||||
worldObj.getBlock(xCoord + 1, yCoord + 1, zCoord).isReplaceable(worldObj, xCoord + 1, yCoord + 1, zCoord) &&
|
||||
worldObj.getBlock(xCoord - 1, yCoord + 2, zCoord).isReplaceable(worldObj, xCoord - 1, yCoord + 2, zCoord) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 2, zCoord).isReplaceable(worldObj, xCoord, yCoord + 2, zCoord) &&
|
||||
worldObj.getBlock(xCoord + 1, yCoord + 2, zCoord).isReplaceable(worldObj, xCoord + 1, yCoord + 2, zCoord) &&
|
||||
worldObj.getBlock(xCoord - 1, yCoord + 3, zCoord).isReplaceable(worldObj, xCoord - 1, yCoord + 3, zCoord) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 3, zCoord).isReplaceable(worldObj, xCoord, yCoord + 3, zCoord) &&
|
||||
worldObj.getBlock(xCoord + 1, yCoord + 3, zCoord).isReplaceable(worldObj, xCoord + 1, yCoord + 3, zCoord);
|
||||
}
|
||||
|
||||
private boolean checkEW() {
|
||||
return worldObj.getBlock(xCoord, yCoord + 1, zCoord - 1).isReplaceable(worldObj, xCoord, yCoord + 1, zCoord -1) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord).isReplaceable(worldObj, xCoord, yCoord, zCoord) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord + 1).isReplaceable(worldObj, xCoord, yCoord + 1, zCoord + 1) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 2, zCoord - 1).isReplaceable(worldObj, xCoord, yCoord + 2, zCoord - 1) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 2, zCoord).isReplaceable(worldObj, xCoord, yCoord + 2, zCoord) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 2, zCoord + 1).isReplaceable(worldObj, xCoord, yCoord + 2, zCoord + 1) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 3, zCoord - 1).isReplaceable(worldObj, xCoord, yCoord + 3, zCoord - 1) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 3, zCoord).isReplaceable(worldObj, xCoord, yCoord + 3, zCoord) &&
|
||||
worldObj.getBlock(xCoord, yCoord + 3, zCoord + 1).isReplaceable(worldObj, xCoord, yCoord + 3, zCoord + 1);
|
||||
}
|
||||
|
||||
private void fillNS() {
|
||||
|
||||
placeDummy(xCoord - 1, yCoord + 1, zCoord);
|
||||
placeDummy(xCoord - 1, yCoord + 2, zCoord);
|
||||
placeDummy(xCoord - 1, yCoord + 3, zCoord);
|
||||
placeDummy(xCoord, yCoord + 1, zCoord);
|
||||
placeDummy(xCoord, yCoord + 2, zCoord);
|
||||
placeDummy(xCoord, yCoord + 3, zCoord);
|
||||
placeDummy(xCoord + 1, yCoord + 1, zCoord);
|
||||
placeDummy(xCoord + 1, yCoord + 2, zCoord);
|
||||
placeDummy(xCoord + 1, yCoord + 3, zCoord);
|
||||
}
|
||||
|
||||
private void fillEW() {
|
||||
|
||||
placeDummy(xCoord, yCoord + 1, zCoord - 1);
|
||||
placeDummy(xCoord, yCoord + 2, zCoord - 1);
|
||||
placeDummy(xCoord, yCoord + 3, zCoord - 1);
|
||||
placeDummy(xCoord, yCoord + 1, zCoord);
|
||||
placeDummy(xCoord, yCoord + 2, zCoord);
|
||||
placeDummy(xCoord, yCoord + 3, zCoord);
|
||||
placeDummy(xCoord, yCoord + 1, zCoord + 1);
|
||||
placeDummy(xCoord, yCoord + 2, zCoord + 1);
|
||||
placeDummy(xCoord, yCoord + 3, zCoord + 1);
|
||||
}
|
||||
|
||||
private void removeNS() {
|
||||
|
||||
removeDummy(xCoord - 1, yCoord + 1, zCoord);
|
||||
removeDummy(xCoord - 1, yCoord + 2, zCoord);
|
||||
removeDummy(xCoord - 1, yCoord + 3, zCoord);
|
||||
removeDummy(xCoord, yCoord + 1, zCoord);
|
||||
removeDummy(xCoord, yCoord + 2, zCoord);
|
||||
removeDummy(xCoord, yCoord + 3, zCoord);
|
||||
removeDummy(xCoord + 1, yCoord + 1, zCoord);
|
||||
removeDummy(xCoord + 1, yCoord + 2, zCoord);
|
||||
removeDummy(xCoord + 1, yCoord + 3, zCoord);
|
||||
}
|
||||
|
||||
private void removeEW() {
|
||||
|
||||
removeDummy(xCoord, yCoord + 1, zCoord - 1);
|
||||
removeDummy(xCoord, yCoord + 2, zCoord - 1);
|
||||
removeDummy(xCoord, yCoord + 3, zCoord - 1);
|
||||
removeDummy(xCoord, yCoord + 1, zCoord);
|
||||
removeDummy(xCoord, yCoord + 2, zCoord);
|
||||
removeDummy(xCoord, yCoord + 3, zCoord);
|
||||
removeDummy(xCoord, yCoord + 1, zCoord + 1);
|
||||
removeDummy(xCoord, yCoord + 2, zCoord + 1);
|
||||
removeDummy(xCoord, yCoord + 3, zCoord + 1);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
isOpening = nbt.getBoolean("isOpening");
|
||||
state = nbt.getInteger("state");
|
||||
sysTime = nbt.getLong("sysTime");
|
||||
timer = nbt.getInteger("timer");
|
||||
type = nbt.getInteger("type");
|
||||
redstoned = nbt.getBoolean("redstoned");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setBoolean("isOpening", isOpening);
|
||||
nbt.setInteger("state", state);
|
||||
nbt.setLong("sysTime", sysTime);
|
||||
nbt.setInteger("timer", timer);
|
||||
nbt.setInteger("type", type);
|
||||
nbt.setBoolean("redstoned", redstoned);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockDoorGeneric;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityVaultDoorMigration extends TileEntity {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
int meta = getBlockMetadata();
|
||||
if(meta <= 5) {
|
||||
getWorldObj().setBlock(xCoord, yCoord, zCoord, ModBlocks.vault_door, meta + 10, 3);
|
||||
((BlockDoorGeneric) ModBlocks.vault_door).fillSpace(getWorldObj(), xCoord, yCoord, zCoord, ForgeDirection.getOrientation(meta), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,8 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import api.hbm.fluidmk2.FluidNetMK2;
|
||||
|
||||
import api.hbm.fluidmk2.FluidNode;
|
||||
import api.hbm.fluidmk2.IFluidReceiverMK2;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.entity.effect.EntitySpear;
|
||||
@ -41,12 +43,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Base class for all RBMK components, active or passive. Handles heat and the explosion sequence
|
||||
@ -502,8 +499,8 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
|
||||
|
||||
/* Hanlde overpressure event */
|
||||
if(RBMKDials.getOverpressure(worldObj) && !pipes.isEmpty()) {
|
||||
HashSet pipeBlocks = new HashSet<>();
|
||||
HashSet pipeReceivers = new HashSet<>();
|
||||
HashSet<FluidNode> pipeBlocks = new HashSet<>();
|
||||
HashSet<Map.Entry<IFluidReceiverMK2, Long>> pipeReceivers = new HashSet<>();
|
||||
|
||||
//unify all parts into single sets to prevent redundancy
|
||||
pipes.forEach(x -> {
|
||||
@ -513,20 +510,23 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
|
||||
|
||||
int count = 0;
|
||||
int max = Math.min(pipeBlocks.size() / 5, 100);
|
||||
Iterator itPipes = pipeBlocks.iterator();
|
||||
Iterator itReceivers = pipeReceivers.iterator();
|
||||
Iterator<FluidNode> itPipes = pipeBlocks.iterator();
|
||||
Iterator<Map.Entry<IFluidReceiverMK2, Long>> itReceivers = pipeReceivers.iterator();
|
||||
|
||||
while(itPipes.hasNext() && count < max) {
|
||||
Object pipe = itPipes.next();
|
||||
if(pipe instanceof TileEntity) {
|
||||
TileEntity tile = (TileEntity) pipe;
|
||||
worldObj.setBlock(tile.xCoord, tile.yCoord, tile.zCoord, Blocks.air);
|
||||
FluidNode node = itPipes.next();
|
||||
for (BlockPos pos : node.positions) {
|
||||
int x = pos.getX(), y = pos.getY(), z = pos.getZ();
|
||||
if (worldObj.getTileEntity(x, y ,z) != null) {
|
||||
worldObj.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
while(itReceivers.hasNext()) {
|
||||
Object con = itReceivers.next();
|
||||
Map.Entry<IFluidReceiverMK2, Long> e = itReceivers.next();
|
||||
IFluidReceiverMK2 con = e.getKey();
|
||||
if(con instanceof TileEntity) {
|
||||
TileEntity tile = (TileEntity) con;
|
||||
if(con instanceof IOverpressurable) {
|
||||
@ -568,6 +568,9 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
|
||||
|
||||
RBMKBase.dropLids = true;
|
||||
RBMKBase.digamma = false;
|
||||
|
||||
columns.clear();
|
||||
pipes.clear();
|
||||
}
|
||||
|
||||
private void getFF(int x, int y, int z) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user