mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge branch 'master' into more-more-qol
This commit is contained in:
commit
b5f2bb3355
@ -30,11 +30,9 @@ This ties together with the previous point - there's no guarantees that your PR
|
||||
|
||||
## I want to help but don't know where to start
|
||||
|
||||
If you want to help the project, consider getting involved with the [wiki](ntm.fandom.com) first. Writing an article is the easiest and quickest way of helping, and requires no programming knowledge. If you do know Java and want to help, consider these places first:
|
||||
If you want to help the project, consider getting involved with the [wiki](https://nucleartech.wiki/) first. Writing an article is the easiest and quickest way of helping, and requires no programming knowledge. If you do know Java and want to help, consider these places first:
|
||||
|
||||
* Localization, i.e. translations in different language are always accepted.
|
||||
* `IConfigurableMachine`, an interface that allows machines to be added to the `hbmMachines.json` config, is still not used by many machines.
|
||||
* F1 Presentations, also known as "Stare" or "Jar Presentations", is a neat system of creating a short movie explaining functionality. All the relevant code can be found in `com.hbm.wiaj`.
|
||||
* Some guns still use the old "bow-style" systems and not `ItemGunBase`.
|
||||
* Many guns don't have any animations whatsoever, just adding a minor recoil would already improve them by a lot.
|
||||
* Adding tooltips to more machines, explaining some of the basics.
|
||||
|
||||
@ -71,6 +71,10 @@ repositories {
|
||||
name = 'ModMaven'
|
||||
url = 'https://modmaven.dev'
|
||||
}
|
||||
maven {
|
||||
name = "gt"
|
||||
url = "https://gregtech.mechaenetia.com/"
|
||||
}
|
||||
//maven {
|
||||
// name = "CurseForge"
|
||||
// url = "https://minecraft.curseforge.com/api/maven/"
|
||||
@ -87,7 +91,8 @@ dependencies {
|
||||
implementation 'codechicken:NotEnoughItems:1.7.10-1.0.3.74:dev'
|
||||
compileOnly 'codechicken:NotEnoughItems:1.7.10-1.0.3.74:src'
|
||||
|
||||
//compileOnly 'inventory-tweaks:InventoryTweaks:1.62+beta.84:api'
|
||||
compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf"
|
||||
|
||||
implementation "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api"
|
||||
}
|
||||
|
||||
|
||||
38
changelog
38
changelog
@ -1,32 +1,12 @@
|
||||
## Added
|
||||
* Plushies
|
||||
|
||||
## Changed
|
||||
* The fluid burner, heat exchanging heater and cooling tower now use the single steel pipe items instead of the larger steel pipes
|
||||
* Reduced the amount of condensers needed for crafting the cooling towers
|
||||
* Liquefactors and solidifiers now have a base processing time of 5 seconds per operation (instead of 10)
|
||||
* Added some info to the coltass about how the coltan deposit works
|
||||
* Moved some NEI handlers around, fluid containers are now listed last and radiolysis is now listed right after cracking, since they have the same recipes
|
||||
* The autocrafter's inputs are now limited to 4 items per slot
|
||||
* Autocrafters can now receive stacked items again (except for items with containers), if they do not exceed the 4 item threshold
|
||||
* Bedrock ores now produce bedrock ore fragments instead of straight outputs, one fragment is equivalent to a nugget
|
||||
* Fragments also differ in stack size when produced, most primary fractions yield 9 (equal to the previous full powder), but things with lower demands/higher value like bismuth now yield substantially less
|
||||
* The base speed of the large mining drill when mining bedrock has been reduced by 80%, it is now advisable to either invest in upgrades early on or use multiple drills
|
||||
* The bedrock ore processor now has a base speed of 30 seconds
|
||||
* Standard, special, HE artillery shells and most missiles now use updated explosion animations
|
||||
* Decreased hardness of slag blocks
|
||||
* Removed legacy circuits
|
||||
* Removed a bunch of random unused items
|
||||
* Changed the multi fluid ID recipe, they now use analog circuits instead of silicon based ones, no longer requiring plastic to make
|
||||
* Decreased the connection speed for all battery blocks, a full discharge now takes 30 seconds instead of 1 second, and charging now takes 10 seconds
|
||||
* Capacitors have also been nerfed but they are twice as fast as battery blocks, 5 seconds for charging and 15 seconds for discharging
|
||||
* Removed forgotten bricks
|
||||
* Updated CMB brick texture
|
||||
* The ICF machine block now renders with its 3d model in the creative inventory
|
||||
|
||||
## Fixed
|
||||
* Fixed crash caused by decontaminating items with the radiolysis machine
|
||||
* Fixed ICFs not forming correctly depending on the orientation
|
||||
* Fixed electrolyzer metal recipe config not working
|
||||
* Fixed the meteor charms not working when used on helmets
|
||||
* Fixed NEI handler for the ICF's consturction showing inconsistent values
|
||||
* Fixed radiolysis recipes not showing up in NEI unless the usage recipes are loaded first
|
||||
* Fixed autocrafter's grid not properly updating when using NEI drag and drop for the filter
|
||||
* Fixed all carbon-based crucible materials having the wrong ID, this fix will shift IDs but prevent collisions with silicon
|
||||
* Fixed primary bedrock ore fraction roasing yielding one extra pile of crumbs
|
||||
* Fixed filing cabinets being unreasonably laggy due to the old packet code
|
||||
* Fixed the secure access door taking way longer to craft than any other door
|
||||
* Fixed pumpjack gauges not syncing properly
|
||||
* Fixed some concrete variants not being revertable into uncolored concrete
|
||||
* Fixed the ore density scanner not using proper translations for the HUD
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5036
|
||||
mod_build_number=5061
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
@ -11,7 +11,7 @@ credits=HbMinecraft,\
|
||||
\ Alcater (GUI textures, porting),\
|
||||
\ MellowArpeggiation (new animation system, turbine sounds, sound fixes, industrial lights, better particle diodes),\
|
||||
\ Pheo (textures, various machines, models, weapons),\
|
||||
\ Vær (gas centrifuges, better worldgen, ZIRNOX, CP-1 parts, starter guide),\
|
||||
\ Vær (gas centrifuges, better worldgen, ZIRNOX, CP-1 parts, starter guide, new cyclotron),\
|
||||
\ LePeep (coilgun model, BDCL QC),\
|
||||
\ Adam29 (liquid petroleum, ethanol, electric furnace),\
|
||||
\ Pvndols (thorium fuel recipe, gas turbine),\
|
||||
@ -19,15 +19,16 @@ credits=HbMinecraft,\
|
||||
\ Doctor17 (russian localization)),\
|
||||
\ Pashtet (russian localization),\
|
||||
\ Bismarck (chinese localization),\
|
||||
\ Creeper-banner (chinese localization),\
|
||||
\ Maksymisio (polish localization)\
|
||||
\ el3ctro4ndre (italian localization),\
|
||||
\ Pu-238 (Tom impact effects),\
|
||||
\ UFFR (RTGs, guns, casings, euphemium capacitor),\
|
||||
\ Frooz (models),\
|
||||
\ UFFR (RTG pellets, guns, casings, euphemium capacitor),\
|
||||
\ Frooz (gun models),\
|
||||
\ VT-6/24 (models, textures),\
|
||||
\ Nos (models),\
|
||||
\ Minecreep (models),\
|
||||
\ 70k (textures, glyphid AI, strand caster),\
|
||||
\ 70k (textures, glyphid AI, strand caster, electrolyzer changes),\
|
||||
\ haru315 (spiral point algorithm),\
|
||||
\ Sten89 (models),\
|
||||
\ Pixelguru26 (textures),\
|
||||
@ -37,13 +38,14 @@ credits=HbMinecraft,\
|
||||
\ Silly541 (config for safe ME drives),\
|
||||
\ Voxelstice (OpenComputers integration, turbine spinup),\
|
||||
\ BallOfEnergy1 (OpenComputers integration),\
|
||||
\ martemen (project settings),\
|
||||
\ sdddddf80 (recipe configs, chinese localization, custom machine holograms),\
|
||||
\ SuperCraftAlex (tooltips)\
|
||||
\ Ice-Arrow (research reactor tweaks),\
|
||||
\ 245tt (anvil GUI improvements),\
|
||||
\ KoblizekXD (doors),\
|
||||
\ FOlkvangrField (custom machine parts),\
|
||||
\ RosaTryp (centrifuge config),\
|
||||
\ Toshayo (satellite loot system, project settings, gradle curse task),\
|
||||
\ martemen (project settings),\
|
||||
\ OvermindDL1 (project settings),\
|
||||
\ impbk2002 (project settings),\
|
||||
\ impbk2002 (project settings)\
|
||||
|
||||
@ -10,7 +10,7 @@ public interface IBatteryItem {
|
||||
public void setCharge(ItemStack stack, long i);
|
||||
public void dischargeBattery(ItemStack stack, long i);
|
||||
public long getCharge(ItemStack stack);
|
||||
public long getMaxCharge();
|
||||
public long getMaxCharge(ItemStack stack);
|
||||
public long getChargeRate();
|
||||
public long getDischargeRate();
|
||||
|
||||
|
||||
9
src/main/java/api/hbm/redstoneoverradio/IRORInfo.java
Normal file
9
src/main/java/api/hbm/redstoneoverradio/IRORInfo.java
Normal file
@ -0,0 +1,9 @@
|
||||
package api.hbm.redstoneoverradio;
|
||||
|
||||
public interface IRORInfo {
|
||||
|
||||
public static String PREFIX_VALUE = "VAL:";
|
||||
public static String PREFIX_FUNCTION = "FUN:";
|
||||
|
||||
public String[] getFunctionInfo();
|
||||
}
|
||||
32
src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java
Normal file
32
src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java
Normal file
@ -0,0 +1,32 @@
|
||||
package api.hbm.redstoneoverradio;
|
||||
|
||||
public interface IRORInteractive extends IRORInfo {
|
||||
|
||||
public static String NAME_SEPARATOR = "!";
|
||||
public static String PARAM_SEPARATOR = ":";
|
||||
|
||||
public static String EX_NULL = "Exception: Null Command";
|
||||
public static String EX_NAME = "Exception: Multiple Name Separators";
|
||||
|
||||
/** Runs a function on the ROR component, usually causing the component to change or do something. Returns are optional. */
|
||||
public Object runRORFunction(String name, String[] params);
|
||||
|
||||
/** Extracts the command name from a full command string */
|
||||
public static String getCommand(String input) {
|
||||
if(input == null || input.isEmpty()) throw new RORFunctionException(EX_NULL);
|
||||
String[] parts = input.split(NAME_SEPARATOR);
|
||||
if(parts.length <= 0 || parts.length > 2) throw new RORFunctionException(EX_NAME);
|
||||
return parts[0];
|
||||
}
|
||||
|
||||
/** Extracts the param list from a full command string */
|
||||
public static String[] getParams(String input) {
|
||||
if(input == null || input.isEmpty()) throw new RORFunctionException(EX_NULL);
|
||||
String[] parts = input.split(NAME_SEPARATOR);
|
||||
if(parts.length <= 0 || parts.length > 2) throw new RORFunctionException(EX_NAME);
|
||||
if(parts.length == 1) return new String[0];
|
||||
String paramList = parts[1];
|
||||
String[] params = paramList.split(PARAM_SEPARATOR);
|
||||
return params;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package api.hbm.redstoneoverradio;
|
||||
|
||||
public interface IRORValueProvider extends IRORInfo {
|
||||
|
||||
/** Grabs the specified value from this ROR component, operations should not cause any changes with the component itself */
|
||||
public Object provideRORValue(String name);
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package api.hbm.redstoneoverradio;
|
||||
|
||||
public class RORFunctionException extends RuntimeException {
|
||||
|
||||
public RORFunctionException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
46
src/main/java/api/hbm/redstoneoverradio/package-info.java
Normal file
46
src/main/java/api/hbm/redstoneoverradio/package-info.java
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
package api.hbm.redstoneoverradio;
|
||||
|
||||
/*
|
||||
|
||||
__ __ __ _________ ________ __ __ __ __ ______ __
|
||||
/_/| /_/\ /_/| /________/\ /_______/| /_/| /_/| /_/|_____ /_/| /_____/| /_/|
|
||||
| || | \\ | || | ___ \ \ | ______|/ | |\_| || | |/_____| || |___ || | ||
|
||||
| || | \ \\ | || | || \ \/ | ||___ | \/_/ |/ | ______ || /__| || | ||__
|
||||
| || | |\ \\| || | || \ || | |/__/| \ // | |/_____| || | ___|/ | |/_/|
|
||||
| || | ||\ \| || | || | || | ____|/ > </\ |____ ____|/_ | |/__/| | __|/
|
||||
| || | || \ | || | ||___/ |/ | ||_____ / __ \/| /_____| |______/| |______|/ | ||
|
||||
| || | || \ || | |/__/ / | |/____/| | /| \ || |________________|/ | ||
|
||||
|__|/ |__|/ \__|/ |_________/ |________|/ |__|/ |__|/ |__|/
|
||||
|
||||
(not AN index, INDEX is just the codename)
|
||||
(also no i did not use an ASCII font generator i spent like half an hour on this)
|
||||
|
||||
INDEX includes Redstone-over-Radio APIs for interacting with ROR torches in ways more complex than simple comparator output,
|
||||
simply put, certain ROR torches may run functions on the ROR component or read more complex values. This means that with the ROR
|
||||
system alone, one can make complex monitoring and logic systems controlling machines via redstone automation.
|
||||
|
||||
INDEX includes:
|
||||
- IRORInfo, an interface that provides a list of all valid functions. This interface should never be implemented directly because
|
||||
it is worthless on its own, rather it is extended by all other ROR API interfaces
|
||||
- IRORValueProvider, a simple interface that returns values based on names, serving as a simple getter. Get operations should never
|
||||
cause changes within the ROR component, and should be kept simple
|
||||
- IRORInteractive, an interface providing functions equivalent to java, usually performing a state change within the component and
|
||||
optionally returning a value
|
||||
|
||||
On the implementation side we can expect:
|
||||
- ROR readers, torches which have a list of named values which are read, as well as frequencies on which these values are boradcasted
|
||||
- ROR controllers, torches which have one frequency and can receive commands with parameters which will be executed on the component
|
||||
- ROR programmers, torches which have a list of frequencies and return frequencies which can receive commands with parameters and
|
||||
then send the return value on the return frequency
|
||||
- ROR logic receivers, torches which can turn signals into redstone based on various factors like arithmetic comparison and string
|
||||
operators like matches, matches not and substring (thanks to vær for taking care of that)
|
||||
|
||||
ROR programmers can indeed do everything that the readers and controllers can, but their added complexity requires more GUI elements
|
||||
which are more time-consuming to set up and limits the amount of command channels available, hence why readers and controllers exist
|
||||
when only a simple solution is required
|
||||
|
||||
*/
|
||||
@ -4,6 +4,7 @@ import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@ -12,6 +13,7 @@ import net.minecraft.world.World;
|
||||
public class BlockBase extends Block {
|
||||
|
||||
private boolean beaconable = false;
|
||||
private boolean canSpawn = true;
|
||||
|
||||
public BlockBase() {
|
||||
super(Material.rock);
|
||||
@ -36,6 +38,16 @@ public class BlockBase extends Block {
|
||||
this.beaconable = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BlockBase noMobSpawn() {
|
||||
this.canSpawn = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
|
||||
return this.canSpawn ? super.canCreatureSpawn(type, world, x, y, z) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
|
||||
@ -148,11 +148,6 @@ public class ModBlocks {
|
||||
|
||||
public static Block ore_tikite;
|
||||
|
||||
public static Block crystal_power;
|
||||
public static Block crystal_energy;
|
||||
public static Block crystal_robust;
|
||||
public static Block crystal_trixite;
|
||||
|
||||
public static Block block_thorium;
|
||||
public static Block block_thorium_fuel;
|
||||
public static Block block_uranium;
|
||||
@ -273,8 +268,6 @@ public class ModBlocks {
|
||||
public static Block snowglobe;
|
||||
public static Block plushie;
|
||||
|
||||
public static Block hazmat;
|
||||
|
||||
public static Block gravel_obsidian;
|
||||
public static Block gravel_diamond;
|
||||
public static Block asphalt;
|
||||
@ -395,7 +388,6 @@ public class ModBlocks {
|
||||
public static Block brick_jungle_glyph;
|
||||
public static Block brick_jungle_circle;
|
||||
|
||||
public static Block brick_forgotten;
|
||||
public static Block brick_red;
|
||||
|
||||
public static Block deco_computer;
|
||||
@ -501,6 +493,7 @@ public class ModBlocks {
|
||||
public static Block oil_spill;
|
||||
|
||||
public static Block sellafield_slaked;
|
||||
public static Block sellafield_bedrock;
|
||||
public static Block sellafield;
|
||||
public static Block ore_sellafield_diamond;
|
||||
public static Block ore_sellafield_emerald;
|
||||
@ -1011,6 +1004,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block machine_turbofan;
|
||||
public static Block machine_turbinegas;
|
||||
public static Block machine_lpw2;
|
||||
|
||||
public static Block press_preheater;
|
||||
public static Block machine_press;
|
||||
@ -1326,14 +1320,9 @@ public class ModBlocks {
|
||||
ore_oil = new BlockOre(Material.rock).setBlockName("ore_oil").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_oil");
|
||||
ore_oil_empty = new BlockGeneric(Material.rock).setBlockName("ore_oil_empty").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_oil_empty");
|
||||
ore_oil_sand = new BlockFalling(Material.sand).setBlockName("ore_oil_sand").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeSand).setHardness(0.5F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":ore_oil_sand_alt");
|
||||
ore_bedrock_oil = new BlockGeneric(Material.rock).setBlockName("ore_bedrock_oil").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(1_000_000).setBlockTextureName(RefStrings.MODID + ":ore_bedrock_oil");
|
||||
ore_bedrock_oil = new BlockGeneric(Material.rock).noMobSpawn().setBlockName("ore_bedrock_oil").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(1_000_000).setBlockTextureName(RefStrings.MODID + ":ore_bedrock_oil");
|
||||
|
||||
ore_tikite = new BlockDragonProof(Material.rock).setBlockName("ore_tikite").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_tikite_alt");
|
||||
|
||||
crystal_power = new BlockCrystal(Material.glass).setBlockName("crystal_power").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":crystal_power");
|
||||
crystal_energy = new BlockCrystal(Material.glass).setBlockName("crystal_energy").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":crystal_energy");
|
||||
crystal_robust = new BlockCrystal(Material.glass).setBlockName("crystal_robust").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(10.0F).setResistance(100.0F).setBlockTextureName(RefStrings.MODID + ":crystal_robust");
|
||||
crystal_trixite = new BlockCrystal(Material.glass).setBlockName("crystal_trixite").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":crystal_trixite");
|
||||
|
||||
block_uranium = new BlockHazard().makeBeaconable().setBlockName("block_uranium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(50.0F).setBlockTextureName(RefStrings.MODID + ":block_uranium");
|
||||
block_u233 = new BlockHazard().makeBeaconable().setDisplayEffect(ExtDisplayEffect.RADFOG).setBlockName("block_u233").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(50.0F).setBlockTextureName(RefStrings.MODID + ":block_u233");
|
||||
@ -1454,7 +1443,6 @@ public class ModBlocks {
|
||||
bobblehead = new BlockBobble().setBlockName("bobblehead").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
snowglobe = new BlockSnowglobe().setBlockName("snowglobe").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":glass_boron");
|
||||
plushie = new BlockPlushie().setBlockName("plushie").setStepSound(Block.soundTypeCloth).setResistance(50_0000.0F).setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_fiberglass_side");
|
||||
hazmat = new BlockGeneric(Material.cloth).setBlockName("hazmat").setStepSound(Block.soundTypeCloth).setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":hazmat");
|
||||
|
||||
gravel_obsidian = new BlockFalling(Material.iron).setBlockName("gravel_obsidian").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGravel).setHardness(5.0F).setResistance(240.0F).setBlockTextureName(RefStrings.MODID + ":gravel_obsidian");
|
||||
gravel_diamond = new BlockFalling(Material.sand).setBlockName("gravel_diamond").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGravel).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":gravel_diamond");
|
||||
@ -1574,7 +1562,6 @@ public class ModBlocks {
|
||||
brick_jungle_glyph = new BlockGlyph(Material.rock).setBlockName("brick_jungle_glyph").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(360.0F);
|
||||
brick_jungle_circle = new BlockBallsSpawner(Material.rock).setBlockName("brick_jungle_circle").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(360.0F).setBlockTextureName(RefStrings.MODID + ":brick_jungle_circle");
|
||||
|
||||
brick_forgotten = new BlockGeneric(Material.rock).setBlockName("brick_forgotten").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(1000000).setBlockTextureName(RefStrings.MODID + ":brick_forgotten");
|
||||
brick_red = new BlockRedBrick(Material.rock).setBlockName("brick_red").setResistance(10_000);
|
||||
|
||||
deco_computer = new BlockDecoModel(Material.iron, DecoComputerEnum.class, true, false).setBlockBoundsTo(.160749F, 0F, 0F, .839251F, .867849F, .622184F).setBlockName("deco_computer").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_computer");
|
||||
@ -1678,6 +1665,7 @@ public class ModBlocks {
|
||||
stone_cracked = new BlockFalling(Material.rock).setBlockName("stone_cracked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":stone_cracked");
|
||||
|
||||
sellafield_slaked = new BlockSellafieldSlaked(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked");
|
||||
sellafield_bedrock = new BlockSellafieldSlaked(Material.rock).setBlockName("sellafield_bedrock").setBlockUnbreakable().setResistance(6000000.0F).setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked");
|
||||
sellafield = new BlockSellafield(Material.rock).setBlockName("sellafield").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0");
|
||||
ore_sellafield_diamond = new BlockSellafieldOre(Material.rock).setBlockName("ore_sellafield_diamond").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":ore_overlay_diamond");
|
||||
ore_sellafield_emerald = new BlockSellafieldOre(Material.rock).setBlockName("ore_sellafield_emerald").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":ore_overlay_emerald");
|
||||
@ -2163,9 +2151,9 @@ public class ModBlocks {
|
||||
boxcar = new DecoBlock(Material.iron).setBlockName("boxcar").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":boxcar");
|
||||
boat = new DecoBlock(Material.iron).setBlockName("boat").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":boat");
|
||||
|
||||
machine_well = new MachineOilWell().setBlockName("machine_well").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_well");
|
||||
machine_pumpjack = new MachinePumpjack().setBlockName("machine_pumpjack").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_pumpjack");
|
||||
machine_fracking_tower = new MachineFrackingTower().setBlockName("machine_fracking_tower").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_well = new MachineOilWell().setBlockName("machine_well").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_well");
|
||||
machine_pumpjack = new MachinePumpjack().setBlockName("machine_pumpjack").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_pumpjack");
|
||||
machine_fracking_tower = new MachineFrackingTower().setBlockName("machine_fracking_tower").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_pipe");
|
||||
machine_flare = new MachineGasFlare(Material.iron).setBlockName("machine_flare").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
chimney_brick = new MachineChimneyBrick(Material.iron).setBlockName("chimney_brick").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
@ -2195,6 +2183,7 @@ public class ModBlocks {
|
||||
machine_orbus = new MachineOrbus(Material.iron).setBlockName("machine_orbus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_turbofan = new MachineTurbofan(Material.iron).setBlockName("machine_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbofan");
|
||||
machine_turbinegas = new MachineTurbineGas(Material.iron).setBlockName("machine_turbinegas").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_lpw2 = new MachineLPW2().setBlockName("machine_lpw2").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
press_preheater = new BlockBase(Material.iron).setBlockName("press_preheater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":press_preheater");
|
||||
machine_press = new MachinePress(Material.iron).setBlockName("machine_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_press");
|
||||
machine_epress = new MachineEPress(Material.iron).setBlockName("machine_epress").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_epress");
|
||||
@ -2451,12 +2440,6 @@ public class ModBlocks {
|
||||
//Secret
|
||||
register(stone_keyhole);
|
||||
|
||||
//Crystals
|
||||
GameRegistry.registerBlock(crystal_power, crystal_power.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crystal_energy, crystal_energy.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crystal_robust, crystal_robust.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crystal_trixite, crystal_trixite.getUnlocalizedName());
|
||||
|
||||
//Resource-bearing Stones
|
||||
register(stone_resource);
|
||||
register(stalagmite);
|
||||
@ -2599,7 +2582,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(bobblehead, ItemBlockMeta.class, bobblehead.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(snowglobe, ItemBlockMeta.class, snowglobe.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(plushie, ItemBlockBase.class, plushie.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(hazmat, hazmat.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_rbmk, deco_rbmk.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_rbmk_smooth, deco_rbmk_smooth.getUnlocalizedName());
|
||||
|
||||
@ -2737,7 +2719,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(brick_jungle_trap, ItemTrapBlock.class, brick_jungle_trap.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_jungle_glyph, ItemGlyphBlock.class, brick_jungle_glyph.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_jungle_circle, brick_jungle_circle.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_forgotten, brick_forgotten.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_red, brick_red.getUnlocalizedName());
|
||||
register(deco_computer);
|
||||
register(deco_crt);
|
||||
@ -2818,6 +2799,7 @@ public class ModBlocks {
|
||||
|
||||
//RAD
|
||||
register(sellafield_slaked);
|
||||
register(sellafield_bedrock);
|
||||
register(ore_sellafield_diamond);
|
||||
register(ore_sellafield_emerald);
|
||||
register(ore_sellafield_uranium_scorched);
|
||||
@ -3255,6 +3237,7 @@ public class ModBlocks {
|
||||
register(barricade);
|
||||
register(machine_turbofan);
|
||||
register(machine_turbinegas);
|
||||
register(machine_lpw2);
|
||||
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(teleanchor, teleanchor.getUnlocalizedName());
|
||||
|
||||
@ -25,6 +25,7 @@ import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
@ -48,6 +49,11 @@ public class BlockBedrockOreTE extends BlockContainer implements ILookOverlay, I
|
||||
this.setResistance(1_000_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityBedrockOre();
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCrystal extends BlockDragonProof {
|
||||
|
||||
public BlockCrystal(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float hX, float hY, float hZ, int meta) {
|
||||
return side;
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -9,6 +10,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@ -50,4 +52,9 @@ public class BlockSellafieldSlaked extends Block {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
return Color.HSBtoRGB(0F, 0F, 1F - meta / 15F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
|
||||
return this == ModBlocks.sellafield_bedrock ? false : super.canCreatureSpawn(type, world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ public class HEVBattery extends Block {
|
||||
|
||||
if(st.getItem() instanceof IBatteryItem) {
|
||||
|
||||
long maxcharge = ((IBatteryItem) st.getItem()).getMaxCharge();
|
||||
long maxcharge = ((IBatteryItem) st.getItem()).getMaxCharge(st);
|
||||
long charge = ((IBatteryItem) st.getItem()).getCharge(st);
|
||||
long newcharge = Math.min(charge + 150000, maxcharge);
|
||||
|
||||
|
||||
@ -280,6 +280,9 @@ public class MachineBattery extends BlockContainer implements ILookOverlay, IPer
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.GOLD + "Stores up to "+ BobMathUtil.getShortNumber(this.maxPower) + "HE");
|
||||
list.add(EnumChatFormatting.GOLD + "Charge speed: "+ BobMathUtil.getShortNumber(this.maxPower / 200) + "HE");
|
||||
list.add(EnumChatFormatting.GOLD + "Discharge speed: "+ BobMathUtil.getShortNumber(this.maxPower / 600) + "HE");
|
||||
list.add(EnumChatFormatting.YELLOW + "" + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "/" + BobMathUtil.getShortNumber(this.maxPower) + "HE");
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,6 +109,9 @@ public class MachineCapacitor extends BlockContainer implements ILookOverlay, IP
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.GOLD + "Stores up to "+ BobMathUtil.getShortNumber(this.power) + "HE");
|
||||
list.add(EnumChatFormatting.GOLD + "Charge speed: "+ BobMathUtil.getShortNumber(this.power / 200) + "HE");
|
||||
list.add(EnumChatFormatting.GOLD + "Discharge speed: "+ BobMathUtil.getShortNumber(this.power / 600) + "HE");
|
||||
list.add(EnumChatFormatting.YELLOW + "" + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "/" + BobMathUtil.getShortNumber(persistentTag.getLong("maxPower")) + "HE");
|
||||
}
|
||||
|
||||
@ -249,6 +252,14 @@ public class MachineCapacitor extends BlockContainer implements ILookOverlay, IP
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override public long getProviderSpeed() {
|
||||
return this.getMaxPower() / 300;
|
||||
}
|
||||
|
||||
@Override public long getReceiverSpeed() {
|
||||
return this.getMaxPower() / 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionPriority getPriority() {
|
||||
return ConnectionPriority.LOW;
|
||||
|
||||
31
src/main/java/com/hbm/blocks/machine/MachineLPW2.java
Normal file
31
src/main/java/com/hbm/blocks/machine/MachineLPW2.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLPW2;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineLPW2 extends BlockDummyable {
|
||||
|
||||
public MachineLPW2() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineLPW2();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {6, 0, 3, 3, 9, 10};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
@ -5,11 +5,17 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.EntityProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.particle.helper.ExplosionCreator;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
@ -20,6 +26,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@ -31,15 +38,13 @@ public class MachineOilWell extends BlockDummyable implements IPersistentInfoPro
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityMachineOilWell();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {5, 0, 1, 1, 1, 1};
|
||||
return new int[] {9, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,13 +52,24 @@ public class MachineOilWell extends BlockDummyable implements IPersistentInfoPro
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
return MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {1, -1, 0, 0, 0, 0}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x, y + 1, z, new int[] {8, 0, 1, 1, 1, 1}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + 1, y + 1, z + 1, new int[] {-1, 1, 0, 0, 0, 0}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + 1, y + 1, z - 1, new int[] {-1, 1, 0, 0, 0, 0}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x - 1, y + 1, z + 1, new int[] {-1, 1, 0, 0, 0, 0}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x - 1, y + 1, z - 1, new int[] {-1, 1, 0, 0, 0, 0}, x, y, z, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o);
|
||||
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o);
|
||||
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o + 1);
|
||||
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o - 1);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {1, -1, 0, 0, 0, 0}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 1, z, new int[] {8, 0, 1, 1, 1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 1, y + 1, z + 1, new int[] {-1, 1, 0, 0, 0, 0}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 1, y + 1, z - 1, new int[] {-1, 1, 0, 0, 0, 0}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 1, y + 1, z + 1, new int[] {-1, 1, 0, 0, 0, 0}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 1, y + 1, z - 1, new int[] {-1, 1, 0, 0, 0, 0}, this, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -89,4 +105,31 @@ public class MachineOilWell extends BlockDummyable implements IPersistentInfoPro
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
TileEntity core = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(!(core instanceof TileEntityMachineOilWell)) return;
|
||||
|
||||
world.setBlockToAir(x, y, z);
|
||||
onBlockDestroyedByExplosion(world, x, y, z, explosion);
|
||||
|
||||
TileEntityMachineOilWell well = (TileEntityMachineOilWell) core;
|
||||
if(well.tanks[0].getFill() > 0 || well.tanks[1].getFill() > 0) {
|
||||
well.tanks[0].setFill(0);
|
||||
well.tanks[1].setFill(0);
|
||||
|
||||
ExplosionVNT xnt = new ExplosionVNT(world, pos[0] + 0.5, pos[1] + 0.5, pos[2] + 0.5, 15F);
|
||||
xnt.setBlockAllocator(new BlockAllocatorStandard(24));
|
||||
xnt.setBlockProcessor(new BlockProcessorStandard().setNoDrop());
|
||||
xnt.setEntityProcessor(new EntityProcessorStandard());
|
||||
xnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
xnt.explode();
|
||||
|
||||
ExplosionCreator.composeEffect(world, pos[0] + 0.5, pos[1] + 0.5, pos[2] + 0.5, 10, 2F, 0.5F, 25F, 5, 8, 20, 0.75F, 1F, -2F, 150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,6 +87,10 @@ public class FalloutConfigJSON {
|
||||
if(m > 4) entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_schrabidium, m, 1), new Triplet(ModBlocks.ore_sellafield_uranium_scorched, m, 9)) .max(i * 5).sol(true).mB(ModBlocks.ore_uranium));
|
||||
if(m > 4) entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_schrabidium, m, 1), new Triplet(ModBlocks.ore_sellafield_uranium_scorched, m, 9)) .max(i * 5).sol(true).mB(ModBlocks.ore_gneiss_uranium));
|
||||
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_radgem, m, 1)) .max(i * 5).sol(true).mB(Blocks.diamond_ore));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_bedrock, m, 1)).max(i * 5).sol(true).mB(Blocks.bedrock));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_bedrock, m, 1)).max(i * 5).sol(true).mB(ModBlocks.ore_bedrock));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_bedrock, m, 1)).max(i * 5).sol(true).mB(ModBlocks.ore_bedrock_oil));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_bedrock, m, 1)).max(i * 5).sol(true).mB(ModBlocks.sellafield_bedrock));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mMa(Material.iron));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mMa(Material.rock));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mMa(Material.sand));
|
||||
@ -96,7 +100,6 @@ public class FalloutConfigJSON {
|
||||
if(stone != null) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mB(stone));
|
||||
}
|
||||
|
||||
//entries.add(new FalloutEntry().mB(Blocks.grass).prim(new Triplet(ModBlocks.waste_earth, 0, 1)));
|
||||
entries.add(new FalloutEntry()
|
||||
.mB(Blocks.mycelium)
|
||||
.prim(new Triplet(ModBlocks.waste_mycelium, 0, 1)));
|
||||
@ -209,31 +212,23 @@ public class FalloutConfigJSON {
|
||||
if(matchesOpaque && !b.isOpaqueCube()) return false;
|
||||
if(dist > maxDist * falloffStart && Math.abs(world.rand.nextGaussian()) < Math.pow((dist - maxDist * falloffStart) / (maxDist - maxDist * falloffStart), 2D) * 3D) return false;
|
||||
|
||||
if(primaryChance == 1D || rand.nextDouble() < primaryChance) {
|
||||
MetaBlock conversion = chooseRandomOutcome((primaryChance == 1D || rand.nextDouble() < primaryChance) ? primaryBlocks : secondaryBlocks);
|
||||
|
||||
if(conversion != null) {
|
||||
if(conversion.block == ModBlocks.sellafield_slaked && originalBlock == ModBlocks.sellafield_slaked && conversion.meta <= originalMeta) return false;
|
||||
if(conversion.block == ModBlocks.sellafield_bedrock && originalBlock == ModBlocks.sellafield_bedrock && conversion.meta <= originalMeta) return false;
|
||||
if(originalBlock == ModBlocks.sellafield_bedrock && conversion.block != ModBlocks.sellafield_bedrock) return false;
|
||||
if(y == 0 && conversion.block != ModBlocks.sellafield_bedrock) return false;
|
||||
|
||||
if(primaryBlocks == null) return false;
|
||||
|
||||
MetaBlock block = chooseRandomOutcome(primaryBlocks);
|
||||
if(block.block == ModBlocks.sellafield_slaked && originalBlock == ModBlocks.sellafield_slaked) {
|
||||
if(block.meta <= originalMeta) return false;
|
||||
}
|
||||
world.setBlock(x, y, z, block.block, block.meta, 3);
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
if(secondaryBlocks == null) return false;
|
||||
|
||||
MetaBlock block = chooseRandomOutcome(secondaryBlocks);
|
||||
if(block.block == ModBlocks.sellafield_slaked && originalBlock == ModBlocks.sellafield_slaked) {
|
||||
if(block.meta <= originalMeta) return false;
|
||||
}
|
||||
world.setBlock(x, y, z, block.block, block.meta, 3);
|
||||
world.setBlock(x, y, z, conversion.block, conversion.meta, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private MetaBlock chooseRandomOutcome(Triplet<Block, Integer, Integer>[] blocks) {
|
||||
if(blocks == null) return null;
|
||||
|
||||
int weight = 0;
|
||||
|
||||
|
||||
@ -423,8 +423,6 @@ public class MineralRecipes {
|
||||
add1To9Pair(ModItems.powder_paleogenite, ModItems.powder_paleogenite_tiny);
|
||||
add1To9Pair(ModItems.ingot_osmiridium, ModItems.nugget_osmiridium);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.hazmat, 8), new Object[] { "###", "# #", "###", '#', ModItems.hazmat_cloth });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.hazmat_cloth, 1), new Object[] { "#", '#', ModBlocks.hazmat });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.egg_balefire_shard, 1), new Object[] { "##", "##", '#', ModItems.powder_balefire });
|
||||
add9To1(ModItems.cell_balefire, ModItems.egg_balefire_shard);
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ public class PowderRecipes {
|
||||
CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.PINK, 2), new Object[] { DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.RED), DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.WHITE) });
|
||||
CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.GREEN, 2), new Object[] { DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLUE), DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.YELLOW) });
|
||||
|
||||
for(int i = 0; i < 15; i++) CraftingManager.addShapelessAuto(new ItemStack(ModItems.crayon, 4, i), new Object[] { new ItemStack(ModItems.chemical_dye, 1, i), ANY_TAR.any() });
|
||||
for(int i = 0; i < 15; i++) CraftingManager.addShapelessAuto(new ItemStack(ModItems.crayon, 4, i), new Object[] { new ItemStack(ModItems.chemical_dye, 1, i), ANY_TAR.any(), Items.paper });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,9 +98,6 @@ public class EntityMappings {
|
||||
addEntity(EntityGrenadeShrapnel.class, "entity_grenade_shrapnel", 250);
|
||||
addEntity(EntityBlackHole.class, "entity_black_hole", 250);
|
||||
addEntity(EntityGrenadeBlackHole.class, "entity_grenade_black_hole", 250);
|
||||
addEntity(EntityOilSpillFX.class, "entity_spill_fx", 1000);
|
||||
addEntity(EntityOilSpill.class, "entity_oil_spill", 1000);
|
||||
addEntity(EntityGasFX.class, "entity_spill_fx", 1000);
|
||||
addEntity(EntityMinecartTest.class, "entity_minecart_test", 1000);
|
||||
addEntity(EntitySparkBeam.class, "entity_spark_beam", 1000);
|
||||
addEntity(EntityMissileDoomsday.class, "entity_missile_doomsday", 1000);
|
||||
|
||||
@ -64,8 +64,8 @@ public class EntityFalloutRain extends EntityExplosionChunkloading {
|
||||
int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE);
|
||||
int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE);
|
||||
boolean biomeModified = false;
|
||||
for(int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) {
|
||||
for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) {
|
||||
for(int x = chunkPosX << 4; x < (chunkPosX << 4) + 16; x++) {
|
||||
for(int z = chunkPosZ << 4; z < (chunkPosZ << 4) + 16; z++) {
|
||||
double percent = Math.hypot(x - posX, z - posZ) * 100 / getScale();
|
||||
stomp(x, z, percent);
|
||||
BiomeGenBase biome = getBiomeChange(percent, getScale(), worldObj.getBiomeGenForCoords(x, z));
|
||||
@ -82,8 +82,8 @@ public class EntityFalloutRain extends EntityExplosionChunkloading {
|
||||
int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE);
|
||||
int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE);
|
||||
boolean biomeModified = false;
|
||||
for(int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) {
|
||||
for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) {
|
||||
for(int x = chunkPosX << 4; x < (chunkPosX << 4) + 16; x++) {
|
||||
for(int z = chunkPosZ << 4; z < (chunkPosZ << 4) + 16; z++) {
|
||||
double distance = Math.hypot(x - posX, z - posZ);
|
||||
if(distance <= getScale()) {
|
||||
double percent = distance * 100 / getScale();
|
||||
@ -165,14 +165,13 @@ public class EntityFalloutRain extends EntityExplosionChunkloading {
|
||||
|
||||
int depth = 0;
|
||||
|
||||
for(int y = 255; y >= 1; y--) {
|
||||
for(int y = 255; y >= 0; y--) {
|
||||
|
||||
if(depth >= 3) return;
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
|
||||
if(b.getMaterial() == Material.air || b == ModBlocks.fallout) continue;
|
||||
if(b == Blocks.bedrock) return;
|
||||
|
||||
if(b == ModBlocks.volcano_core) {
|
||||
worldObj.setBlock(x, y, z, ModBlocks.volcano_rad_core, worldObj.getBlockMetadata(x, y, z), 3);
|
||||
@ -211,7 +210,7 @@ public class EntityFalloutRain extends EntityExplosionChunkloading {
|
||||
}
|
||||
|
||||
float hardness = b.getBlockHardness(worldObj, x, y, z);
|
||||
if(dist < 65 && hardness <= Blocks.stonebrick.getExplosionResistance(null) && hardness >= 0/* && !b.hasTileEntity(worldObj.getBlockMetadata(x, y, z))*/) {
|
||||
if(y > 0 && dist < 65 && hardness <= Blocks.stonebrick.getExplosionResistance(null) && hardness >= 0/* && !b.hasTileEntity(worldObj.getBlockMetadata(x, y, z))*/) {
|
||||
|
||||
if(worldObj.getBlock(x, y - 1, z) == Blocks.air) {
|
||||
for(int i = 0; i <= depth; i++) {
|
||||
|
||||
@ -1,79 +0,0 @@
|
||||
package com.hbm.entity.particle;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGasFX extends EntityModFX
|
||||
{
|
||||
float smokeParticleScale;
|
||||
public int particleAge;
|
||||
public int maxAge;
|
||||
public EntityGasFX(World world) {
|
||||
super(world, 0, 0, 0);
|
||||
}
|
||||
|
||||
public EntityGasFX(World p_i1225_1_, double p_i1225_2_, double p_i1225_4_, double p_i1225_6_, double p_i1225_8_, double p_i1225_10_, double p_i1225_12_)
|
||||
{
|
||||
this(p_i1225_1_, p_i1225_2_, p_i1225_4_, p_i1225_6_, p_i1225_8_, p_i1225_10_, p_i1225_12_, 1.0F);
|
||||
}
|
||||
|
||||
public EntityGasFX(World p_i1226_1_, double p_i1226_2_, double p_i1226_4_, double p_i1226_6_, double p_i1226_8_, double p_i1226_10_, double p_i1226_12_, float p_i1226_14_)
|
||||
{
|
||||
super(p_i1226_1_, p_i1226_2_, p_i1226_4_, p_i1226_6_, 0.0D, 0.0D, 0.0D);
|
||||
this.motionX *= 0.10000000149011612D;
|
||||
this.motionY *= 0.10000000149011612D;
|
||||
this.motionZ *= 0.10000000149011612D;
|
||||
this.motionX += p_i1226_8_;
|
||||
this.motionY += p_i1226_10_;
|
||||
this.motionZ += p_i1226_12_;
|
||||
this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D);
|
||||
this.particleScale *= 0.75F;
|
||||
this.particleScale *= p_i1226_14_;
|
||||
this.smokeParticleScale = this.particleScale;
|
||||
//this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
|
||||
//this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1226_14_);
|
||||
this.noClip = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if(maxAge < 15)
|
||||
{
|
||||
maxAge = rand.nextInt(4) + 15;
|
||||
}
|
||||
|
||||
this.particleAge++;
|
||||
|
||||
if (this.particleAge >= maxAge)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
this.motionX *= 0.7599999785423279D;
|
||||
//this.motionY *= 0.7599999785423279D;
|
||||
this.motionY += 0.1D;
|
||||
this.motionZ *= 0.7599999785423279D;
|
||||
|
||||
if (this.onGround)
|
||||
{
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
if(this.isBurning()) {
|
||||
this.setDead();
|
||||
worldObj.createExplosion(null, posX, posY, posZ, 3F, true);
|
||||
}
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
}
|
||||
}
|
||||
@ -1,74 +0,0 @@
|
||||
package com.hbm.entity.particle;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityOilSpillFX extends EntityModFX {
|
||||
float smokeParticleScale;
|
||||
public int particleAge;
|
||||
public int maxAge;
|
||||
|
||||
public EntityOilSpillFX(World world) {
|
||||
super(world, 0, 0, 0);
|
||||
}
|
||||
|
||||
public EntityOilSpillFX(World p_i1225_1_, double p_i1225_2_, double p_i1225_4_, double p_i1225_6_, double p_i1225_8_, double p_i1225_10_, double p_i1225_12_) {
|
||||
this(p_i1225_1_, p_i1225_2_, p_i1225_4_, p_i1225_6_, p_i1225_8_, p_i1225_10_, p_i1225_12_, 1.0F);
|
||||
}
|
||||
|
||||
public EntityOilSpillFX(World p_i1226_1_, double p_i1226_2_, double p_i1226_4_, double p_i1226_6_, double p_i1226_8_, double p_i1226_10_, double p_i1226_12_, float p_i1226_14_) {
|
||||
super(p_i1226_1_, p_i1226_2_, p_i1226_4_, p_i1226_6_, 0.0D, 0.0D, 0.0D);
|
||||
this.motionX *= 0.10000000149011612D;
|
||||
this.motionY *= 0.10000000149011612D;
|
||||
this.motionZ *= 0.10000000149011612D;
|
||||
this.motionX += p_i1226_8_;
|
||||
this.motionY += p_i1226_10_;
|
||||
this.motionZ += p_i1226_12_;
|
||||
this.particleRed = this.particleGreen = this.particleBlue = (float) (Math.random() * 0.30000001192092896D);
|
||||
this.particleScale *= 0.75F;
|
||||
this.particleScale *= p_i1226_14_;
|
||||
this.smokeParticleScale = this.particleScale;
|
||||
this.noClip = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if(maxAge < 15) {
|
||||
maxAge = rand.nextInt(4) + 15;
|
||||
}
|
||||
|
||||
this.particleAge++;
|
||||
|
||||
if(this.particleAge >= maxAge) {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
this.motionX *= 0.7599999785423279D;
|
||||
this.motionY *= 0.7599999785423279D;
|
||||
this.motionZ *= 0.7599999785423279D;
|
||||
|
||||
if(this.onGround) {
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean writeToNBTOptional(NBTTagCompound nbt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
super.readEntityFromNBT(nbt);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import com.hbm.entity.particle.EntityOilSpillFX;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityOilSpill extends EntityThrowable {
|
||||
|
||||
public EntityOilSpill(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityOilSpill(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityInit() { }
|
||||
|
||||
public EntityOilSpill(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
if(!worldObj.isRemote) {
|
||||
worldObj.spawnEntityInWorld(new EntityOilSpillFX(worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
||||
if(this.isBurning()) {
|
||||
this.setDead();
|
||||
worldObj.createExplosion(null, posX, posY, posZ, 1.5F, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition p_70184_1_) {
|
||||
if(this.ticksExisted > 5) {
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean writeToNBTOptional(NBTTagCompound nbt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
super.readEntityFromNBT(nbt);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,6 @@ package com.hbm.explosion;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.projectile.EntityOilSpill;
|
||||
import com.hbm.entity.projectile.EntityRubble;
|
||||
import com.hbm.entity.projectile.EntityShrapnel;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
@ -154,20 +153,6 @@ public class ExplosionLarge {
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnOilSpills(World world, double x, double y, double z, int count) {
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
EntityOilSpill shrapnel = new EntityOilSpill(world);
|
||||
shrapnel.posX = x;
|
||||
shrapnel.posY = y;
|
||||
shrapnel.posZ = z;
|
||||
shrapnel.motionY = ((rand.nextFloat() * 0.5) + 0.5) * (1 + (count / (15 + rand.nextInt(21)))) + (rand.nextFloat() / 50 * count) * 0.25F;
|
||||
shrapnel.motionX = rand.nextGaussian() * 1 * (1 + (count / 50)) * 0.15F;
|
||||
shrapnel.motionZ = rand.nextGaussian() * 1 * (1 + (count / 50)) * 0.15F;
|
||||
world.spawnEntityInWorld(shrapnel);
|
||||
}
|
||||
}
|
||||
|
||||
public static void explode(World world, double x, double y, double z, float strength, boolean cloud, boolean rubble, boolean shrapnel, Entity exploder) {
|
||||
world.createExplosion(exploder, x, y, z, strength, true);
|
||||
if(cloud)
|
||||
|
||||
@ -18,6 +18,9 @@ public class ArmorModHandler {
|
||||
public static final int cladding = 5;
|
||||
public static final int kevlar = 6;
|
||||
public static final int extra = 7;
|
||||
public static final int battery = 8;
|
||||
|
||||
public static final int MOD_SLOTS = 9;
|
||||
|
||||
public static final UUID[] UUIDs = new UUID[] {
|
||||
UUID.fromString("8d6e5c77-133e-4056-9c80-a9e42a1a0b65"),
|
||||
@ -131,7 +134,7 @@ public class ArmorModHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Does what the name implies
|
||||
* Does what the name implies. Returns true if the stack has NBT and that NBT has the MOD_COMPOUND_KEY tag.
|
||||
* @param armor
|
||||
* @return
|
||||
*/
|
||||
@ -146,7 +149,7 @@ public class ArmorModHandler {
|
||||
|
||||
public static ItemStack[] pryMods(ItemStack armor) {
|
||||
|
||||
ItemStack[] slots = new ItemStack[8];
|
||||
ItemStack[] slots = new ItemStack[MOD_SLOTS];
|
||||
|
||||
if(!hasMods(armor))
|
||||
return slots;
|
||||
@ -154,7 +157,7 @@ public class ArmorModHandler {
|
||||
NBTTagCompound nbt = armor.getTagCompound();
|
||||
NBTTagCompound mods = nbt.getCompoundTag(MOD_COMPOUND_KEY);
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
for(int i = 0; i < MOD_SLOTS; i++) {
|
||||
|
||||
NBTTagCompound cmp = mods.getCompoundTag(MOD_SLOT_KEY + i);
|
||||
|
||||
@ -168,4 +171,22 @@ public class ArmorModHandler {
|
||||
|
||||
return slots;
|
||||
}
|
||||
|
||||
public static ItemStack pryMod(ItemStack armor, int slot) {
|
||||
|
||||
if(!hasMods(armor))
|
||||
return null;
|
||||
|
||||
NBTTagCompound nbt = armor.getTagCompound();
|
||||
NBTTagCompound mods = nbt.getCompoundTag(MOD_COMPOUND_KEY);
|
||||
NBTTagCompound cmp = mods.getCompoundTag(MOD_SLOT_KEY + slot);
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(cmp);
|
||||
|
||||
if(stack != null)
|
||||
return stack;
|
||||
|
||||
removeMod(armor, slot);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,21 +1,30 @@
|
||||
package com.hbm.handler;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.RecipesCommon;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.Items;
|
||||
import li.cil.oc.api.fs.FileSystem;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import static com.hbm.main.CraftingManager.addShapelessAuto;
|
||||
import static li.cil.oc.api.FileSystem.asReadOnly;
|
||||
import static li.cil.oc.api.FileSystem.fromClass;
|
||||
|
||||
/**
|
||||
* General handler for OpenComputers compatibility.
|
||||
@ -23,13 +32,29 @@ import java.lang.reflect.Array;
|
||||
*/
|
||||
public class CompatHandler {
|
||||
|
||||
/**
|
||||
* Used for converting a steam type to an integer (compression levels).
|
||||
* @param type Steam type.
|
||||
* @return Object[] array containing an int with the "compression level"
|
||||
*/
|
||||
public static Object[] steamTypeToInt(FluidType type) {
|
||||
if(type == Fluids.STEAM) {return new Object[] {0};}
|
||||
else if(type == Fluids.HOTSTEAM) {return new Object[] {1};}
|
||||
else if(type == Fluids.SUPERHOTSTEAM) {return new Object[] {2};}
|
||||
return new Object[] {3};
|
||||
switch(type.getID()) {
|
||||
default:
|
||||
return new Object[] {0};
|
||||
case(4): // Fluids.HOTSTEAM
|
||||
return new Object[] {1};
|
||||
case(5): // Fluids.SUPERHOTSTEAM
|
||||
return new Object[] {2};
|
||||
case(6): // Fluids.ULTRAHOTSTEAM
|
||||
return new Object[] {3};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for converting a compression level to a steam type.
|
||||
* @param arg Steam compression level.
|
||||
* @return FluidType of the steam type based on the compression level.
|
||||
*/
|
||||
public static FluidType intToSteamType(int arg) {
|
||||
switch(arg) {
|
||||
default:
|
||||
@ -43,6 +68,134 @@ public class CompatHandler {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for easy creation of read-only filesystems. Primarily for floppy disks.
|
||||
* (Though maybe reading directly from VOTV drives as filesystems could be implemented. :3)
|
||||
**/
|
||||
private static class ReadOnlyFileSystem implements Callable<FileSystem> {
|
||||
|
||||
private final String name;
|
||||
|
||||
ReadOnlyFileSystem(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public li.cil.oc.api.fs.FileSystem call() throws Exception {
|
||||
return asReadOnly(fromClass(MainRegistry.class, RefStrings.MODID, "disks/" + FloppyDisk.sanitizeName(name)));
|
||||
}
|
||||
}
|
||||
|
||||
// Floppy disk class.
|
||||
public static class FloppyDisk {
|
||||
// Specifies the callable ReadOnlyFileSystem to allow OC to access the floppy.
|
||||
public final ReadOnlyFileSystem fs;
|
||||
// Specifies the color of the floppy disk (0-16 colors defined by OC).
|
||||
public final Byte color;
|
||||
// Set after loading the disk; allows for adding a recipe to the item.
|
||||
public ItemStack item;
|
||||
|
||||
FloppyDisk(String name, int color) {
|
||||
this.fs = new ReadOnlyFileSystem(FloppyDisk.sanitizeName(name));
|
||||
this.color = (byte) color;
|
||||
}
|
||||
|
||||
// Disk names will be sanitized before the FileSystem is created.
|
||||
// This only affects the location/directory, not the display name.
|
||||
// (Prevents filesystems from breaking/crashing due to having file separators, wildcards, etc.
|
||||
public static String sanitizeName(String input) {
|
||||
return input.toLowerCase().replaceAll("\\W", "");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple enum for mapping OC color ordinals to a nicer format for adding new disks.
|
||||
*/
|
||||
public enum OCColors {
|
||||
BLACK, //0x444444
|
||||
RED, //0xB3312C
|
||||
GREEN, //0x339911
|
||||
BROWN, //0x51301A
|
||||
BLUE, //0x6666FF
|
||||
PURPLE, //0x7B2FBE
|
||||
CYAN, //0x66FFFF
|
||||
LIGHTGRAY, //0xABABAB
|
||||
GRAY, //0x666666
|
||||
PINK, //0xD88198
|
||||
LIME, //0x66FF66
|
||||
YELLOW, //0xFFFF66
|
||||
LIGHTBLUE, //0xAAAAFF
|
||||
MAGENTA, //0xC354CD
|
||||
ORANGE, //0xEB8844
|
||||
WHITE //0xF0F0F0
|
||||
}
|
||||
|
||||
// Where all disks are stored with their name and `FloppyDisk` class.
|
||||
public static HashMap<String, FloppyDisk> disks = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Called in the FML PostLoad stage, after the OC API loads.
|
||||
* <br>
|
||||
* Loads various parts of OC compatibility.
|
||||
*/
|
||||
public static void init() {
|
||||
if(Loader.isModLoaded("OpenComputers")) {
|
||||
/*
|
||||
For anyone wanting to add their own floppy disks,
|
||||
read the README found in assets.hbm.disks.
|
||||
*/
|
||||
|
||||
// Idea/Code by instantnootles
|
||||
disks.put("PWRangler", new FloppyDisk("PWRangler", OCColors.CYAN.ordinal()));
|
||||
|
||||
// begin registering disks
|
||||
Logger logger = LogManager.getLogger("HBM");
|
||||
logger.info("Loading OpenComputers disks...");
|
||||
if(disks.size() == 0) {
|
||||
logger.info("No disks registered; see com.hbm.handler.CompatHandler.disks");
|
||||
return;
|
||||
}
|
||||
disks.forEach((s, disk) -> {
|
||||
|
||||
// Test if the disk path even exists.
|
||||
FileSystem fs = fromClass(MainRegistry.class, RefStrings.MODID, "disks/" + disk.fs.name);
|
||||
|
||||
if (fs == null) { // Disk path does NOT exist, and it should not be loaded.
|
||||
|
||||
logger.error("Error loading disk: " + s + " at /assets/" + RefStrings.MODID + "/disks/" + disk.fs.name);
|
||||
logger.error("This is likely due to the path to the disk being non-existent.");
|
||||
|
||||
} else { // Disk path DOES exist, and it should be loaded.
|
||||
|
||||
disk.item = Items.registerFloppy(s, disk.color, disk.fs); // The big part, actually registering the floppies!
|
||||
logger.info("Registered disk: " + s + " at /assets/" + RefStrings.MODID + "/disks/" + disk.fs.name);
|
||||
|
||||
}
|
||||
});
|
||||
logger.info("OpenComputers disks registered.");
|
||||
|
||||
// OC disk recipes!
|
||||
List<ItemStack> floppyDisks = new RecipesCommon.OreDictStack("oc:floppy").toStacks();
|
||||
|
||||
if(floppyDisks.size() > 0) { //check that floppy disks even exist in oredict.
|
||||
|
||||
// Recipes must be initialized here, since if they were initialized in `CraftingManager` then the disk item would not be created yet.
|
||||
addShapelessAuto(disks.get("PWRangler").item, new Object[] {"oc:floppy", new ItemStack(ModBlocks.pwr_casing)});
|
||||
|
||||
logger.info("OpenComputers disk recipe added for PWRangler.");
|
||||
} else {
|
||||
logger.info("OpenComputers floppy disk oredict not found, recipes cannot be loaded!");
|
||||
}
|
||||
|
||||
// boom, OC disks loaded
|
||||
logger.info("OpenComputers disks loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
// Null component name, default to this if broken to avoid NullPointerExceptions.
|
||||
public static final String nullComponent = "ntm_null";
|
||||
|
||||
/**
|
||||
* This is an interface made specifically for adding OC compatibility to NTM machines. The {@link li.cil.oc.api.network.SimpleComponent} interface must also be implemented in the TE.
|
||||
* <br>
|
||||
@ -54,11 +207,10 @@ public class CompatHandler {
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.SidedComponent", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.Analyzable", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.ManagedPeripheral", modid = "OpenComputers"),
|
||||
})
|
||||
@SimpleComponent.SkipInjection // make sure OC doesn't inject this shit into the interface and crash
|
||||
public interface OCComponent extends SimpleComponent, SidedComponent, Analyzable, ManagedPeripheral {
|
||||
public interface OCComponent extends SimpleComponent, SidedComponent, ManagedPeripheral {
|
||||
|
||||
/**
|
||||
* Must be overridden in the implemented TE, or it will default to "ntm_null".
|
||||
@ -69,7 +221,7 @@ public class CompatHandler {
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
default String getComponentName() {
|
||||
return "ntm_null";
|
||||
return nullComponent;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,31 +235,6 @@ public class CompatHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to give more information when analyzing the block. Multiple entries in the array will be sent to the user in the order of the array.
|
||||
* @return Additional text to add in the form of lang entries (ex: "analyze.basic2").
|
||||
*/
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
default String[] getExtraInfo() {return new String[] {"analyze.noInfo"};}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
default Node[] onAnalyze(EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic1").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic2").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic3").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.name", this.getComponentName()).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
|
||||
String[] extraInfo = getExtraInfo();
|
||||
for (String info : extraInfo) {
|
||||
if(!info.equals(""))
|
||||
player.addChatComponentMessage(new ChatComponentTranslation(info).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
|
||||
}
|
||||
TileEntity te = (TileEntity) this;
|
||||
if((Array.getLength(this.methods()) == 0 && te instanceof TileEntityProxyCombo) || this.getComponentName().equals("ntm_null"))
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.error").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard methods array from {@link li.cil.oc.api.network.ManagedPeripheral} extending {@link li.cil.oc.api.network.SimpleComponent}.
|
||||
* @return Array of methods to expose to the computer.
|
||||
|
||||
@ -162,7 +162,7 @@ public class RefineryRecipeHandler extends TemplateRecipeHandler implements ICom
|
||||
guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(138 - 1 - 36 - 27, 23, 36, 18), "refinery"));
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2 + 36, 89 - 7 - 11 - 11, 18 * 4, 18), "refinery"));
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(48, 5, 31, 101), "refinery"));
|
||||
guiGui.add(GUIMachineRefinery.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
@Deprecated //legacy crap we can't get rid of because some ancient machines still use this for sync
|
||||
public interface IFluidContainer {
|
||||
|
||||
//Args: fill, what the fill should be set to; index, index for array if there are multiple tanks
|
||||
public void setFillForSync(int fill, int index);
|
||||
|
||||
//Args: type, what the type should be set to; index, index for array if there are multiple tanks
|
||||
public void setTypeForSync(FluidType type, int index);
|
||||
}
|
||||
@ -117,6 +117,7 @@ public class RecipesCommon {
|
||||
return;
|
||||
}
|
||||
this.item = stack.getItem();
|
||||
if(this.item == null) this.item = ModItems.nothing; //i'm going to bash some fuckard's head in
|
||||
this.stacksize = stack.stackSize;
|
||||
this.meta = stack.getItemDamage();
|
||||
}
|
||||
@ -128,6 +129,7 @@ public class RecipesCommon {
|
||||
|
||||
public ComparableStack(Item item) {
|
||||
this.item = item;
|
||||
if(this.item == null) this.item = ModItems.nothing;
|
||||
this.stacksize = 1;
|
||||
this.meta = 0;
|
||||
}
|
||||
|
||||
@ -19,20 +19,21 @@ import net.minecraft.util.IIcon;
|
||||
|
||||
public class ContainerArmorTable extends Container {
|
||||
|
||||
public InventoryBasic upgrades = new InventoryBasic("Upgrades", false, 8);
|
||||
public InventoryBasic upgrades = new InventoryBasic("Upgrades", false, ArmorModHandler.MOD_SLOTS);
|
||||
public IInventory armor = new InventoryCraftResult();
|
||||
|
||||
public ContainerArmorTable(InventoryPlayer inventory) {
|
||||
EntityPlayer player = inventory.player;
|
||||
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.helmet_only, 26 + 22, 27)); // helmet only
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.plate_only, 62 + 22, 27)); // chestplate only
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.plate_only, 62 + 22, 27)); // chestplate only
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.legs_only, 98 + 22, 27)); // leggins only
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.boots_only, 134 + 22, 45)); // boots only
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.servos, 134 + 22, 81)); //servos/frame
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.cladding, 98 + 22, 99)); //radiation cladding
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.kevlar, 62 + 22, 99)); //kevlar/sapi/(ERA? :) )
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.kevlar, 62 + 22, 99)); //kevlar/sapi/(ERA? :) )
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.extra, 26 + 22, 99)); //special parts
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.battery, 8 + 22, 63)); //special parts
|
||||
|
||||
this.addSlotToContainer(new Slot(armor, 0, 44 + 22, 63) {
|
||||
|
||||
@ -48,7 +49,7 @@ public class ContainerArmorTable extends Container {
|
||||
if(stack != null) {
|
||||
ItemStack[] mods = ArmorModHandler.pryMods(stack);
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
|
||||
|
||||
if(mods != null)
|
||||
upgrades.setInventorySlotContents(i, mods[i]);
|
||||
@ -65,7 +66,7 @@ public class ContainerArmorTable extends Container {
|
||||
|
||||
//if the armor piece is taken, absorb all armor pieces
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
|
||||
|
||||
ItemStack mod = upgrades.getStackInSlot(i);
|
||||
|
||||
@ -126,19 +127,19 @@ public class ContainerArmorTable extends Container {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 8) {
|
||||
if(par2 != 8 || !InventoryUtil.mergeItemStack(this.inventorySlots, var5, 9, 13, false))
|
||||
if(!this.mergeItemStack(var5, 13, this.inventorySlots.size(), true))
|
||||
if(par2 <= ArmorModHandler.MOD_SLOTS) {
|
||||
if(par2 != ArmorModHandler.MOD_SLOTS || !InventoryUtil.mergeItemStack(this.inventorySlots, var5, ArmorModHandler.MOD_SLOTS + 1, ArmorModHandler.MOD_SLOTS + 5, false))
|
||||
if(!this.mergeItemStack(var5, ArmorModHandler.MOD_SLOTS + 5, this.inventorySlots.size(), true))
|
||||
return null;
|
||||
|
||||
var4.onPickupFromSlot(p_82846_1_, var5);
|
||||
} else {
|
||||
|
||||
if(var5.getItem() instanceof ItemArmor) {
|
||||
if(!this.mergeItemStack(var5, 8, 9, false))
|
||||
if(!this.mergeItemStack(var5, ArmorModHandler.MOD_SLOTS, ArmorModHandler.MOD_SLOTS + 1, false))
|
||||
return null;
|
||||
|
||||
} else if(this.inventorySlots.get(8) != null && var5.getItem() instanceof ItemArmorMod) {
|
||||
} else if(this.inventorySlots.get(ArmorModHandler.MOD_SLOTS) != null && var5.getItem() instanceof ItemArmorMod) {
|
||||
|
||||
ItemArmorMod mod = (ItemArmorMod)var5.getItem();
|
||||
int slot = mod.type;
|
||||
|
||||
@ -4,6 +4,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
@invtweaks.api.container.ChestContainer(rowSize = 13, isLargeChest = false)
|
||||
public class ContainerCrateDesh extends ContainerCrateBase {
|
||||
|
||||
public ContainerCrateDesh(InventoryPlayer invPlayer, IInventory tedf) {
|
||||
@ -15,7 +16,7 @@ public class ContainerCrateDesh extends ContainerCrateBase {
|
||||
}
|
||||
}
|
||||
|
||||
this.playerInv(invPlayer,44, 174, 232);
|
||||
this.playerInv(invPlayer, 44, 174, 232);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import com.hbm.tileentity.machine.storage.TileEntityCrateIron;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
//@invtweaks.api.container.ChestContainer
|
||||
@invtweaks.api.container.ChestContainer(rowSize = 9, isLargeChest = false)
|
||||
public class ContainerCrateIron extends ContainerCrateBase {
|
||||
|
||||
public ContainerCrateIron(InventoryPlayer invPlayer, TileEntityCrateIron tedf) {
|
||||
|
||||
@ -4,7 +4,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
//@invtweaks.api.container.ChestContainer
|
||||
@invtweaks.api.container.ChestContainer(rowSize = 9, isLargeChest = false)
|
||||
public class ContainerCrateSteel extends ContainerCrateBase {
|
||||
|
||||
public ContainerCrateSteel(InventoryPlayer invPlayer, IInventory tedf) {
|
||||
@ -16,6 +16,6 @@ public class ContainerCrateSteel extends ContainerCrateBase {
|
||||
}
|
||||
}
|
||||
|
||||
this.playerInv(invPlayer,8, 84 + (18 * 3) + 2, 142 + (18 * 3) + 2);
|
||||
this.playerInv(invPlayer, 8, 84 + (18 * 3) + 2, 142 + (18 * 3) + 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.tileentity.machine.storage.TileEntityCrateTemplate;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
@invtweaks.api.container.ChestContainer(rowSize = 9, isLargeChest = false)
|
||||
public class ContainerCrateTemplate extends ContainerCrateBase {
|
||||
|
||||
public ContainerCrateTemplate(InventoryPlayer invPlayer, TileEntityCrateTemplate tedf) {
|
||||
@ -16,6 +17,6 @@ public class ContainerCrateTemplate extends ContainerCrateBase {
|
||||
}
|
||||
}
|
||||
|
||||
this.playerInv(invPlayer,8, 86, 144);
|
||||
this.playerInv(invPlayer, 8, 86, 144);
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,7 @@ import com.hbm.tileentity.machine.storage.TileEntityCrateTungsten;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
//@invtweaks.api.container.ChestContainer
|
||||
@invtweaks.api.container.ChestContainer(rowSize = 9, isLargeChest = false)
|
||||
public class ContainerCrateTungsten extends ContainerCrateBase {
|
||||
|
||||
public ContainerCrateTungsten(InventoryPlayer invPlayer, TileEntityCrateTungsten te) {
|
||||
@ -17,6 +17,6 @@ public class ContainerCrateTungsten extends ContainerCrateBase {
|
||||
}
|
||||
}
|
||||
|
||||
this.playerInv(invPlayer,8, 32 + 18 * 3, 90 + (18 * 3));
|
||||
this.playerInv(invPlayer, 8, 32 + 18 * 3, 90 + (18 * 3));
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,40 +19,40 @@ public class ContainerMachineRefinery extends Container {
|
||||
testNuke = tedf;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 186, 72));
|
||||
//Canister Input
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 35, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 8, 99));
|
||||
//Canister Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 35, 108));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 8, 119));
|
||||
//Heavy Oil Input
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 80, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 86, 99));
|
||||
//Heavy Oil Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 80, 108));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 86, 119));
|
||||
//Naphtha Input
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 98, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 106, 99));
|
||||
//Naphtha Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 98, 108));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 106, 119));
|
||||
//Light Oil Input
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 116, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 126, 99));
|
||||
//Light Oil Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 8, 116, 108));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 8, 126, 119));
|
||||
//Petroleum Input
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 134, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 146, 99));
|
||||
//Petroleum Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 134, 108));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 146, 119));
|
||||
//Sulfur Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 11, 152, 36));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 11, 58, 119));
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tedf, 12, 8, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 12, 186, 106));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 150 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 208));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -12,17 +12,13 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.gui.GuiInfoContainer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEFluidPacket;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@ -40,7 +36,6 @@ public class FluidTank {
|
||||
FluidType type;
|
||||
int fluid;
|
||||
int maxFluid;
|
||||
@Deprecated public int index = 0;
|
||||
int pressure = 0;
|
||||
|
||||
public FluidTank(FluidType type, int maxFluid) {
|
||||
@ -56,13 +51,6 @@ public class FluidTank {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated // indices are no longer needed
|
||||
public FluidTank(FluidType type, int maxFluid, int index) {
|
||||
this.type = type;
|
||||
this.maxFluid = maxFluid;
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public void setFill(int i) {
|
||||
fluid = i;
|
||||
}
|
||||
@ -108,20 +96,6 @@ public class FluidTank {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Called on TE update
|
||||
@Deprecated public void updateTank(TileEntity te) {
|
||||
updateTank(te, 100);
|
||||
}
|
||||
@Deprecated public void updateTank(TileEntity te, int range) {
|
||||
updateTank(te.xCoord, te.yCoord, te.zCoord, te.getWorldObj().provider.dimensionId, range);
|
||||
}
|
||||
@Deprecated public void updateTank(int x, int y, int z, int dim) {
|
||||
updateTank(x, y, z, dim, 100);
|
||||
}
|
||||
@Deprecated public void updateTank(int x, int y, int z, int dim, int range) {
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEFluidPacket(x, y, z, fluid, index, type), new TargetPoint(dim, x, y, z, range));
|
||||
}
|
||||
|
||||
//Fills tank from canisters
|
||||
public boolean loadTank(int in, int out, ItemStack[] slots) {
|
||||
|
||||
|
||||
@ -46,15 +46,16 @@ public class GUIArmorTable extends GuiInfoContainer {
|
||||
"armorMod.type.cladding",
|
||||
"armorMod.type.insert",
|
||||
"armorMod.type.special",
|
||||
"armorMod.type.battery",
|
||||
"armorMod.insertHere"
|
||||
};
|
||||
|
||||
for(int i = 0; i < 9; ++i) {
|
||||
for(int i = 0; i < ArmorModHandler.MOD_SLOTS + 1; ++i) {
|
||||
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && !slot.getHasStack()) {
|
||||
|
||||
this.drawCreativeTabHoveringText((i < 8 ? EnumChatFormatting.LIGHT_PURPLE : EnumChatFormatting.YELLOW) + I18nUtil.resolveKey(unloc[i]), x, y);
|
||||
this.drawCreativeTabHoveringText((i < ArmorModHandler.MOD_SLOTS ? EnumChatFormatting.LIGHT_PURPLE : EnumChatFormatting.YELLOW) + I18nUtil.resolveKey(unloc[i]), x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -75,7 +76,7 @@ public class GUIArmorTable extends GuiInfoContainer {
|
||||
this.drawTexturedModalRect(guiLeft + 22, guiTop, 0, 0, this.xSize - 22, this.ySize);
|
||||
this.drawTexturedModalRect(guiLeft, guiTop + 31, 176, 96, 22, 100);
|
||||
|
||||
ItemStack armor = this.inventorySlots.getSlot(8).getStack();
|
||||
ItemStack armor = this.inventorySlots.getSlot(ArmorModHandler.MOD_SLOTS).getStack();
|
||||
|
||||
if(armor != null) {
|
||||
|
||||
@ -89,7 +90,7 @@ public class GUIArmorTable extends GuiInfoContainer {
|
||||
this.drawTexturedModalRect(guiLeft + 41 + 22, guiTop + 60, 176, 52, 22, 22);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
|
||||
Slot slot = this.inventorySlots.getSlot(i);
|
||||
drawIndicator(i, slot.xDisplayPosition - 1, slot.yDisplayPosition - 1);
|
||||
}
|
||||
@ -98,7 +99,7 @@ public class GUIArmorTable extends GuiInfoContainer {
|
||||
private void drawIndicator(int index, int x, int y) {
|
||||
|
||||
ItemStack mod = this.inventorySlots.getSlot(index).getStack();
|
||||
ItemStack armor = this.inventorySlots.getSlot(8).getStack();
|
||||
ItemStack armor = this.inventorySlots.getSlot(ArmorModHandler.MOD_SLOTS).getStack();
|
||||
|
||||
if(mod == null)
|
||||
return;
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.util.Tuple;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineRefinery;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
|
||||
@ -12,6 +17,8 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_refinery.png");
|
||||
@ -21,46 +28,100 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
super(new ContainerMachineRefinery(invPlayer, tedf));
|
||||
refinery = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
this.xSize = 210;
|
||||
this.ySize = 231;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
refinery.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 70 - 52, 34, 52);
|
||||
refinery.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 70 - 52, 16, 52);
|
||||
refinery.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 98, guiTop + 70 - 52, 16, 52);
|
||||
refinery.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 116, guiTop + 70 - 52, 16, 52);
|
||||
refinery.tanks[4].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 70 - 52, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 70 - 52, 16, 52, refinery.power, refinery.maxPower);
|
||||
refinery.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 30, guiTop + 27, 21, 104); // Render tooltip for column.
|
||||
refinery.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 86, guiTop + 42, 16, 52);
|
||||
refinery.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 106, guiTop + 42, 16, 52);
|
||||
refinery.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 126, guiTop + 42, 16, 52);
|
||||
refinery.tanks[4].renderTankInfo(this, mouseX, mouseY, guiLeft + 146, guiTop + 42, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 186, guiTop + 18, 16, 52, refinery.power, refinery.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.refinery.hasCustomInventoryName() ? this.refinery.getInventoryName() : I18n.format(this.refinery.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - 34/2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 4, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(refinery.tanks[0].getTankType() == Fluids.HOTCRACKOIL)
|
||||
drawTexturedModalRect(guiLeft + 64, guiTop + 20, 192, 0, 12, 26);
|
||||
func_146110_a(guiLeft, guiTop, 0, 0, xSize, ySize, 350, 256);
|
||||
|
||||
int j = (int)refinery.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 70 - j, 176, 52 - j, 16, j);
|
||||
|
||||
refinery.tanks[0].renderTank(guiLeft + 26, guiTop + 70, this.zLevel, 34, 52);
|
||||
refinery.tanks[1].renderTank(guiLeft + 80, guiTop + 70, this.zLevel, 16, 52);
|
||||
refinery.tanks[2].renderTank(guiLeft + 98, guiTop + 70, this.zLevel, 16, 52);
|
||||
refinery.tanks[3].renderTank(guiLeft + 116, guiTop + 70, this.zLevel, 16, 52);
|
||||
refinery.tanks[4].renderTank(guiLeft + 134, guiTop + 70, this.zLevel, 16, 52);
|
||||
// power
|
||||
int j = (int)refinery.getPowerScaled(50);
|
||||
func_146110_a(guiLeft + 186, guiTop + 69 - j, 210, 52 - j, 16, j, 350, 256);
|
||||
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0); // default
|
||||
|
||||
// input tank
|
||||
FluidTank inputOil = refinery.tanks[0];
|
||||
if (inputOil.getFill() != 0) {
|
||||
|
||||
int targetHeight = inputOil.getFill() * 101 / inputOil.getMaxFill();
|
||||
Color color = new Color(inputOil.getTankType().getColor());
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 33, guiTop + 130 - targetHeight, 226, 101 - targetHeight, 16, targetHeight, 350, 256);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
// fucking kgjhgdfjgdhjfg
|
||||
// func_146110_a lets you set the resolution of the source texture !!!!
|
||||
// 350x256 texture by behated (the pipes wouldn't fit)
|
||||
|
||||
// pipes
|
||||
|
||||
Tuple.Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> recipe = RefineryRecipes.getRefinery(inputOil.getTankType());
|
||||
|
||||
if(recipe == null) {
|
||||
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
|
||||
func_146110_a(guiLeft + 52, guiTop + 32, 247, 50, 66, 52, 350, 256);
|
||||
func_146110_a(guiLeft + 52, guiTop + 24, 247, 145, 86, 35, 350, 256);
|
||||
func_146110_a(guiLeft + 36, guiTop + 16, 211, 119, 122, 25, 350, 256);
|
||||
} else {
|
||||
|
||||
// Heavy Oil Products
|
||||
Color color = new Color(recipe.getV().type.getColor());
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
|
||||
|
||||
// Naphtha Oil Products
|
||||
color = new Color(recipe.getW().type.getColor());
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 52, guiTop + 32, 247, 50, 66, 52, 350, 256);
|
||||
|
||||
// Light Oil Products
|
||||
color = new Color(recipe.getX().type.getColor());
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 52, guiTop + 24, 247, 145, 86, 35, 350, 256);
|
||||
|
||||
// Gaseous Products
|
||||
color = new Color(recipe.getY().type.getColor());
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 36, guiTop + 16, 211, 119, 122, 25, 350, 256);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
|
||||
// output tanks
|
||||
refinery.tanks[1].renderTank(guiLeft + 86, guiTop + 95, this.zLevel, 16, 52);
|
||||
refinery.tanks[2].renderTank(guiLeft + 106, guiTop + 95, this.zLevel, 16, 52);
|
||||
refinery.tanks[3].renderTank(guiLeft + 126, guiTop + 95, this.zLevel, 16, 52);
|
||||
refinery.tanks[4].renderTank(guiLeft + 146, guiTop + 95, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
recipes.put(new OreDictStack(FIBER.ingot()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
recipes.put(new OreDictStack(FIBER.block()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 40)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(9, 2))));
|
||||
recipes.put(new OreDictStack(ASBESTOS.ingot()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
recipes.put(new OreDictStack(ASBESTOS.dust()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
recipes.put(new OreDictStack(ASBESTOS.block()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 40)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(9, 2))));
|
||||
|
||||
recipes.put(new ComparableStack(ModBlocks.sand_quartz), new ArcFurnaceRecipe().solid(new ItemStack(ModBlocks.glass_quartz)));
|
||||
|
||||
@ -74,7 +74,7 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
recipes.add(new ChemRecipe(92, "NITRIC_ACID", 50)
|
||||
.inputItems(new OreDictStack(KNO.dust()))
|
||||
.inputFluids(new FluidStack(Fluids.SULFURIC_ACID, 500))
|
||||
.outputFluids(new FluidStack(Fluids.NITRIC_ACID, 500)));
|
||||
.outputFluids(new FluidStack(Fluids.NITRIC_ACID, 1_000)));
|
||||
recipes.add(new ChemRecipe(93, "SOLVENT", 50)
|
||||
.inputFluids(new FluidStack(Fluids.NAPHTHA, 500), new FluidStack(Fluids.AROMATICS, 500))
|
||||
.outputFluids(new FluidStack(Fluids.SOLVENT, 1000)));
|
||||
@ -208,11 +208,10 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
.inputFluids(new FluidStack(Fluids.WATER, 2000))
|
||||
.outputItems(new ItemStack(ModBlocks.ducrete_smooth, 8)));
|
||||
recipes.add(new ChemRecipe(57, "SOLID_FUEL", 200)
|
||||
.inputItems(
|
||||
new ComparableStack(ModItems.solid_fuel, 2),
|
||||
new OreDictStack(KNO.dust()),
|
||||
new OreDictStack(REDSTONE.dust()))
|
||||
.inputFluids(new FluidStack(Fluids.PETROLEUM, 200, GeneralConfig.enable528 ? 1 : 0))
|
||||
.inputItems(new ComparableStack(ModItems.solid_fuel, 2))
|
||||
.inputFluids(
|
||||
new FluidStack(Fluids.PETROLEUM, 200, GeneralConfig.enable528 ? 1 : 0),
|
||||
new FluidStack(Fluids.NITRIC_ACID, 100))
|
||||
.outputItems(new ItemStack(ModItems.rocket_fuel, 4)));
|
||||
recipes.add(new ChemRecipe(58, "ELECTROLYSIS", 150)
|
||||
.inputFluids(new FluidStack(Fluids.WATER, 4000))
|
||||
|
||||
@ -63,7 +63,7 @@ public class CokerRecipes extends SerializableRecipe {
|
||||
registerRecipe(LUBRICANT, 12_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_200));
|
||||
registerRecipe(CALCIUM_SOLUTION, 125, new ItemStack(ModItems.powder_calcium), new FluidStack(SPENTSTEAM, 100));
|
||||
//only cokable gas to extract sulfur content
|
||||
registerRecipe(SOURGAS, 250, new ItemStack(ModItems.sulfur), new FluidStack(GAS_COKER, 150));
|
||||
registerRecipe(SOURGAS, 1_000, new ItemStack(ModItems.sulfur), new FluidStack(GAS_COKER, 150));
|
||||
registerRecipe(SLOP, 1000, new ItemStack(ModItems.powder_limestone), new FluidStack(COLLOID, 250));
|
||||
registerRecipe(VITRIOL, 4000, new ItemStack(ModItems.powder_iron), new FluidStack(SULFURIC_ACID, 500));
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ public class LiquefactionRecipes extends SerializableRecipe {
|
||||
recipes.put(KEY_CRACK_TAR, new FluidStack(100, Fluids.BITUMEN));
|
||||
recipes.put(KEY_COAL_TAR, new FluidStack(50, Fluids.BITUMEN));
|
||||
recipes.put(KEY_LOG, new FluidStack(100, Fluids.MUG));
|
||||
recipes.put(KNO.dust(), new FluidStack(250, Fluids.NITRIC_ACID));
|
||||
recipes.put(KNO.dust(), new FluidStack(750, Fluids.NITRIC_ACID));
|
||||
recipes.put(NA.dust(), new FluidStack(100, Fluids.SODIUM));
|
||||
//general utility recipes because why not
|
||||
recipes.put(new ComparableStack(Blocks.netherrack), new FluidStack(250, Fluids.LAVA));
|
||||
|
||||
@ -56,7 +56,7 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.NAPHTHA_DS, 500)).setStack2(new FluidStack(Fluids.AROMATICS, 500)),
|
||||
new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.NAPHTHA_COKER, 500)).setStack2(new FluidStack(Fluids.AROMATICS, 500)));
|
||||
register(Fluids.SULFURIC_ACID, new MixerRecipe(500, 50).setStack1(new FluidStack(Fluids.PEROXIDE, 800)).setSolid(new OreDictStack(S.dust())));
|
||||
register(Fluids.NITRIC_ACID, new MixerRecipe(500, 50).setStack1(new FluidStack(Fluids.SULFURIC_ACID, 500)).setSolid(new OreDictStack(KNO.dust())));
|
||||
register(Fluids.NITRIC_ACID, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.SULFURIC_ACID, 500)).setSolid(new OreDictStack(KNO.dust())));
|
||||
register(Fluids.RADIOSOLVENT, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.REFORMGAS, 750)).setStack2(new FluidStack(Fluids.CHLORINE, 250)));
|
||||
register(Fluids.SCHRABIDIC, new MixerRecipe(16_000, 100).setStack1(new FluidStack(Fluids.SAS3, 8_000)).setStack2(new FluidStack(Fluids.PEROXIDE, 6_000)).setSolid(new ComparableStack(ModItems.pellet_charged)));
|
||||
|
||||
|
||||
@ -64,7 +64,6 @@ public class PressRecipes extends SerializableRecipe {
|
||||
makeRecipe(StampType.FLAT, new OreDictStack(LAPIS.dust()), new ItemStack(Items.dye, 1, 4));
|
||||
makeRecipe(StampType.FLAT, new OreDictStack(DIAMOND.dust()), Items.diamond);
|
||||
makeRecipe(StampType.FLAT, new OreDictStack(EMERALD.dust()), Items.emerald);
|
||||
makeRecipe(StampType.FLAT, new ComparableStack(ModItems.pellet_coal), Items.diamond);
|
||||
makeRecipe(StampType.FLAT, new ComparableStack(ModItems.biomass), ModItems.biomass_compressed);
|
||||
makeRecipe(StampType.FLAT, new OreDictStack(ANY_COKE.gem()), ModItems.ingot_graphite);
|
||||
makeRecipe(StampType.FLAT, new ComparableStack(ModItems.meteorite_sword_reforged), ModItems.meteorite_sword_hardened);
|
||||
|
||||
@ -170,13 +170,13 @@ public class AnvilRecipes {
|
||||
|
||||
public static void registerConstructionRecipes() {
|
||||
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(AL.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_aluminium))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(BE.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_beryllium))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(PB.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_lead))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(MINGRADE.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_red_copper))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(STEEL.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_steel))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(TI.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_titanium))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(W.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_tungsten))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(AL.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_aluminium, 4))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(BE.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_beryllium, 4))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(PB.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_lead, 4))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(MINGRADE.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_red_copper, 4))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(STEEL.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_steel, 4))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(TI.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_titanium, 4))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(W.ingot(), 1), new AnvilOutput(new ItemStack(ModBlocks.deco_tungsten, 4))).setTier(1).setOverlay(OverlayType.CONSTRUCTION));
|
||||
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(DNT.ingot(), 4), new ComparableStack(ModBlocks.depth_brick)},
|
||||
@ -715,14 +715,14 @@ public class AnvilRecipes {
|
||||
}
|
||||
).setTier(2));
|
||||
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_titanium), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_titanium, 1), 0.25F)}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_red_copper), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_red_copper, 1), 0.25F)}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_tungsten), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_tungsten, 1), 0.25F)}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_aluminium), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_aluminium, 1), 0.25F)}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_steel), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_steel, 1), 0.25F)}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_lead), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_lead, 1), 0.25F)}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_beryllium), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_beryllium, 1), 0.25F)}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_asbestos), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_asbestos, 1), 0.25F)}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_titanium, 4), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_titanium, 1))}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_red_copper, 4), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_red_copper, 1))}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_tungsten, 4), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_tungsten, 1))}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_aluminium, 4), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_aluminium, 1))}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_steel, 4), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_steel, 1))}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_lead, 4), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_lead, 1))}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_beryllium, 4), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_beryllium, 1))}).setTier(1));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.deco_asbestos, 4), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_asbestos, 1))}).setTier(1));
|
||||
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new ComparableStack(ModBlocks.heater_firebox),
|
||||
|
||||
@ -75,11 +75,6 @@ public class ModItems {
|
||||
public static Item redstone_sword;
|
||||
public static Item big_sword;
|
||||
|
||||
public static Item test_helmet;
|
||||
public static Item test_chestplate;
|
||||
public static Item test_leggings;
|
||||
public static Item test_boots;
|
||||
|
||||
public static Item ingot_th232;
|
||||
public static Item ingot_uranium;
|
||||
public static Item ingot_u233;
|
||||
@ -663,7 +658,6 @@ public class ModItems {
|
||||
public static Item turbine_titanium;
|
||||
public static Item blade_tungsten;
|
||||
public static Item turbine_tungsten;
|
||||
public static Item pellet_coal;
|
||||
public static Item ring_starmetal;
|
||||
public static Item flywheel_beryllium;
|
||||
|
||||
@ -2181,6 +2175,9 @@ public class ModItems {
|
||||
public static Item card_aos;
|
||||
public static Item card_qos;
|
||||
public static Item australium_iii;
|
||||
public static Item armor_battery;
|
||||
public static Item armor_battery_mk2;
|
||||
public static Item armor_battery_mk3;
|
||||
|
||||
public static Item hazmat_helmet;
|
||||
public static Item hazmat_plate;
|
||||
@ -2217,18 +2214,10 @@ public class ModItems {
|
||||
|
||||
public static Item rod_of_discord;
|
||||
|
||||
public static Item cape_test;
|
||||
public static Item cape_radiation;
|
||||
public static Item cape_gasmask;
|
||||
public static Item cape_schrabidium;
|
||||
public static Item cape_hidden;
|
||||
/*public static Item cape_hbm;
|
||||
public static Item cape_dafnik;
|
||||
public static Item cape_lpkukin;
|
||||
public static Item cape_vertice;
|
||||
public static Item cape_codered_;
|
||||
public static Item cape_ayy;
|
||||
public static Item cape_nostalgia;*/
|
||||
|
||||
public static Item nuke_starter_kit;
|
||||
public static Item nuke_advanced_kit;
|
||||
@ -2366,22 +2355,6 @@ public class ModItems {
|
||||
public static Item b_smoke6;
|
||||
public static Item b_smoke7;
|
||||
public static Item b_smoke8;
|
||||
public static Item spill1;
|
||||
public static Item spill2;
|
||||
public static Item spill3;
|
||||
public static Item spill4;
|
||||
public static Item spill5;
|
||||
public static Item spill6;
|
||||
public static Item spill7;
|
||||
public static Item spill8;
|
||||
public static Item gas1;
|
||||
public static Item gas2;
|
||||
public static Item gas3;
|
||||
public static Item gas4;
|
||||
public static Item gas5;
|
||||
public static Item gas6;
|
||||
public static Item gas7;
|
||||
public static Item gas8;
|
||||
public static Item chlorine1;
|
||||
public static Item chlorine2;
|
||||
public static Item chlorine3;
|
||||
@ -2458,11 +2431,6 @@ public class ModItems {
|
||||
{
|
||||
redstone_sword = new RedstoneSword(ToolMaterial.STONE).setUnlocalizedName("redstone_sword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(RefStrings.MODID + ":redstone_sword");
|
||||
big_sword = new BigSword(ToolMaterial.EMERALD).setUnlocalizedName("big_sword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(RefStrings.MODID + ":big_sword");
|
||||
|
||||
test_helmet = new ArmorTest(MainRegistry.enumArmorMaterialEmerald, 0).setUnlocalizedName("test_helmet").setCreativeTab(null).setTextureName(RefStrings.MODID + ":test_helmet");
|
||||
test_chestplate = new ArmorTest(MainRegistry.enumArmorMaterialEmerald, 1).setUnlocalizedName("test_chestplate").setCreativeTab(null).setTextureName(RefStrings.MODID + ":test_chestplate");
|
||||
test_leggings = new ArmorTest(MainRegistry.enumArmorMaterialEmerald, 2).setUnlocalizedName("test_leggings").setCreativeTab(null).setTextureName(RefStrings.MODID + ":test_leggings");
|
||||
test_boots = new ArmorTest(MainRegistry.enumArmorMaterialEmerald, 3).setUnlocalizedName("test_boots").setCreativeTab(null).setTextureName(RefStrings.MODID + ":test_boots");
|
||||
|
||||
test_nuke_igniter = new Item().setUnlocalizedName("test_nuke_igniter").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":test_nuke_igniter");
|
||||
test_nuke_propellant = new Item().setUnlocalizedName("test_nuke_propellant").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":test_nuke_propellant");
|
||||
@ -2718,7 +2686,7 @@ public class ModItems {
|
||||
cinnebar = new Item().setUnlocalizedName("cinnebar").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":cinnebar");
|
||||
powder_ash = new ItemEnumMulti(EnumAshType.class, true, true).setUnlocalizedName("powder_ash").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_ash");
|
||||
powder_limestone = new Item().setUnlocalizedName("powder_limestone").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_limestone");
|
||||
powder_cement = new Item().setUnlocalizedName("powder_cement").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_cement");
|
||||
powder_cement = new ItemLemon(2, 0.5F, false).setUnlocalizedName("powder_cement").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_cement");
|
||||
|
||||
ingot_gh336 = new ItemCustomLore().setRarity(EnumRarity.epic).setUnlocalizedName("ingot_gh336").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_gh336");
|
||||
nugget_gh336 = new ItemCustomLore().setRarity(EnumRarity.epic).setUnlocalizedName("nugget_gh336").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_gh336");
|
||||
@ -2971,7 +2939,6 @@ public class ModItems {
|
||||
coil_gold = new Item().setUnlocalizedName("coil_gold").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_gold");
|
||||
coil_gold_torus = new Item().setUnlocalizedName("coil_gold_torus").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_gold_torus");
|
||||
magnet_circular = new Item().setUnlocalizedName("magnet_circular").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":magnet_circular");
|
||||
pellet_coal = new Item().setUnlocalizedName("pellet_coal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellet_coal");
|
||||
component_limiter = new Item().setUnlocalizedName("component_limiter").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":component_limiter");
|
||||
component_emitter = new Item().setUnlocalizedName("component_emitter").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":component_emitter");
|
||||
chlorine_pinwheel = new ItemInfiniteFluid(Fluids.CHLORINE, 1, 2).setUnlocalizedName("chlorine_pinwheel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":chlorine_pinwheel");
|
||||
@ -3390,6 +3357,9 @@ public class ModItems {
|
||||
card_aos = new ItemModCard().setUnlocalizedName("card_aos").setTextureName(RefStrings.MODID + ":card_aos");
|
||||
card_qos = new ItemModCard().setUnlocalizedName("card_qos").setTextureName(RefStrings.MODID + ":card_qos");
|
||||
australium_iii = new ItemModShield(25F).setUnlocalizedName("australium_iii").setTextureName(RefStrings.MODID + ":australium_iii");
|
||||
armor_battery = new ItemModBattery(1.25D).setUnlocalizedName("armor_battery").setTextureName(RefStrings.MODID + ":armor_battery");
|
||||
armor_battery_mk2 = new ItemModBattery(1.5D).setUnlocalizedName("armor_battery_mk2").setTextureName(RefStrings.MODID + ":armor_battery_mk2");
|
||||
armor_battery_mk3 = new ItemModBattery(2D).setUnlocalizedName("armor_battery_mk3").setTextureName(RefStrings.MODID + ":armor_battery_mk3");
|
||||
|
||||
cap_nuka = new Item().setUnlocalizedName("cap_nuka").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_nuka");
|
||||
cap_quantum = new Item().setUnlocalizedName("cap_quantum").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_quantum");
|
||||
@ -5334,7 +5304,6 @@ public class ModItems {
|
||||
wings_murk = new WingsMurk(MainRegistry.aMatCobalt).setUnlocalizedName("wings_murk").setCreativeTab(CreativeTabs.tabCombat).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":wings_murk");
|
||||
wings_limp = new WingsMurk(MainRegistry.aMatCobalt).setUnlocalizedName("wings_limp").setCreativeTab(CreativeTabs.tabCombat).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":wings_limp");
|
||||
|
||||
cape_test = new ArmorModel(MainRegistry.enumArmorMaterialEmerald, 1).setUnlocalizedName("cape_test").setCreativeTab(null).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_test");
|
||||
cape_radiation = new ArmorModel(ArmorMaterial.CHAIN, 1).setUnlocalizedName("cape_radiation").setCreativeTab(MainRegistry.consumableTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_radiation");
|
||||
cape_gasmask = new ArmorModel(ArmorMaterial.CHAIN, 1).setUnlocalizedName("cape_gasmask").setCreativeTab(MainRegistry.consumableTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_gasmask");
|
||||
cape_schrabidium = new ArmorModel(MainRegistry.aMatSchrab, 1).setUnlocalizedName("cape_schrabidium").setCreativeTab(MainRegistry.consumableTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_schrabidium");
|
||||
@ -5427,22 +5396,6 @@ public class ModItems {
|
||||
b_smoke6 = new Item().setUnlocalizedName("b_smoke6").setTextureName(RefStrings.MODID + ":b_smoke6");
|
||||
b_smoke7 = new Item().setUnlocalizedName("b_smoke7").setTextureName(RefStrings.MODID + ":b_smoke7");
|
||||
b_smoke8 = new Item().setUnlocalizedName("b_smoke8").setTextureName(RefStrings.MODID + ":b_smoke8");
|
||||
spill1 = new Item().setUnlocalizedName("spill1").setTextureName(RefStrings.MODID + ":spill1");
|
||||
spill2 = new Item().setUnlocalizedName("spill2").setTextureName(RefStrings.MODID + ":spill2");
|
||||
spill3 = new Item().setUnlocalizedName("spill3").setTextureName(RefStrings.MODID + ":spill3");
|
||||
spill4 = new Item().setUnlocalizedName("spill4").setTextureName(RefStrings.MODID + ":spill4");
|
||||
spill5 = new Item().setUnlocalizedName("spill5").setTextureName(RefStrings.MODID + ":spill5");
|
||||
spill6 = new Item().setUnlocalizedName("spill6").setTextureName(RefStrings.MODID + ":spill6");
|
||||
spill7 = new Item().setUnlocalizedName("spill7").setTextureName(RefStrings.MODID + ":spill7");
|
||||
spill8 = new Item().setUnlocalizedName("spill8").setTextureName(RefStrings.MODID + ":spill8");
|
||||
gas1 = new Item().setUnlocalizedName("gas1").setTextureName(RefStrings.MODID + ":gas1");
|
||||
gas2 = new Item().setUnlocalizedName("gas2").setTextureName(RefStrings.MODID + ":gas2");
|
||||
gas3 = new Item().setUnlocalizedName("gas3").setTextureName(RefStrings.MODID + ":gas3");
|
||||
gas4 = new Item().setUnlocalizedName("gas4").setTextureName(RefStrings.MODID + ":gas4");
|
||||
gas5 = new Item().setUnlocalizedName("gas5").setTextureName(RefStrings.MODID + ":gas5");
|
||||
gas6 = new Item().setUnlocalizedName("gas6").setTextureName(RefStrings.MODID + ":gas6");
|
||||
gas7 = new Item().setUnlocalizedName("gas7").setTextureName(RefStrings.MODID + ":gas7");
|
||||
gas8 = new Item().setUnlocalizedName("gas8").setTextureName(RefStrings.MODID + ":gas8");
|
||||
chlorine1 = new Item().setUnlocalizedName("chlorine1").setTextureName(RefStrings.MODID + ":chlorine1");
|
||||
chlorine2 = new Item().setUnlocalizedName("chlorine2").setTextureName(RefStrings.MODID + ":chlorine2");
|
||||
chlorine3 = new Item().setUnlocalizedName("chlorine3").setTextureName(RefStrings.MODID + ":chlorine3");
|
||||
@ -5526,13 +5479,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(redstone_sword, redstone_sword.getUnlocalizedName());
|
||||
GameRegistry.registerItem(big_sword, big_sword.getUnlocalizedName());
|
||||
|
||||
//Test Armor
|
||||
GameRegistry.registerItem(test_helmet, test_helmet.getUnlocalizedName());
|
||||
GameRegistry.registerItem(test_chestplate, test_chestplate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(test_leggings, test_leggings.getUnlocalizedName());
|
||||
GameRegistry.registerItem(test_boots, test_boots.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cape_test, cape_test.getUnlocalizedName());
|
||||
|
||||
//Test Nuke
|
||||
GameRegistry.registerItem(test_nuke_igniter, test_nuke_igniter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(test_nuke_propellant, test_nuke_propellant.getUnlocalizedName());
|
||||
@ -6241,7 +6187,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(pellet_charged, pellet_charged.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pellet_gas, pellet_gas.getUnlocalizedName());
|
||||
GameRegistry.registerItem(magnetron, magnetron.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pellet_coal, pellet_coal.getUnlocalizedName());
|
||||
|
||||
//Engine Pieces
|
||||
GameRegistry.registerItem(piston_selenium, piston_selenium.getUnlocalizedName());
|
||||
@ -6322,13 +6267,6 @@ public class ModItems {
|
||||
//Siphon
|
||||
GameRegistry.registerItem(siphon, siphon.getUnlocalizedName());
|
||||
|
||||
//Disperser Canister
|
||||
GameRegistry.registerItem(disperser_canister_empty, disperser_canister_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(disperser_canister, disperser_canister.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(glyphid_gland_empty, glyphid_gland_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(glyphid_gland, glyphid_gland.getUnlocalizedName());
|
||||
|
||||
//Batteries
|
||||
GameRegistry.registerItem(battery_generic, battery_generic.getUnlocalizedName());
|
||||
GameRegistry.registerItem(battery_red_cell, battery_red_cell.getUnlocalizedName());
|
||||
@ -7192,6 +7130,12 @@ public class ModItems {
|
||||
GameRegistry.registerItem(grenade_if_hopwire, grenade_if_hopwire.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_if_null, grenade_if_null.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nuclear_waste_pearl, nuclear_waste_pearl.getUnlocalizedName());
|
||||
|
||||
//Disperser Canister
|
||||
GameRegistry.registerItem(disperser_canister_empty, disperser_canister_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(disperser_canister, disperser_canister.getUnlocalizedName());
|
||||
GameRegistry.registerItem(glyphid_gland_empty, glyphid_gland_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(glyphid_gland, glyphid_gland.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(ullapool_caber, ullapool_caber.getUnlocalizedName());
|
||||
GameRegistry.registerItem(weaponized_starblaster_cell, weaponized_starblaster_cell.getUnlocalizedName());
|
||||
@ -7453,6 +7397,9 @@ public class ModItems {
|
||||
GameRegistry.registerItem(card_aos, card_aos.getUnlocalizedName());
|
||||
GameRegistry.registerItem(card_qos, card_qos.getUnlocalizedName());
|
||||
GameRegistry.registerItem(australium_iii, australium_iii.getUnlocalizedName());
|
||||
GameRegistry.registerItem(armor_battery, armor_battery.getUnlocalizedName());
|
||||
GameRegistry.registerItem(armor_battery_mk2, armor_battery_mk2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(armor_battery_mk3, armor_battery_mk3.getUnlocalizedName());
|
||||
|
||||
//Chaos
|
||||
GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName());
|
||||
@ -7837,22 +7784,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(b_smoke6, b_smoke6.getUnlocalizedName());
|
||||
GameRegistry.registerItem(b_smoke7, b_smoke7.getUnlocalizedName());
|
||||
GameRegistry.registerItem(b_smoke8, b_smoke8.getUnlocalizedName());
|
||||
GameRegistry.registerItem(spill1, spill1.getUnlocalizedName());
|
||||
GameRegistry.registerItem(spill2, spill2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(spill3, spill3.getUnlocalizedName());
|
||||
GameRegistry.registerItem(spill4, spill4.getUnlocalizedName());
|
||||
GameRegistry.registerItem(spill5, spill5.getUnlocalizedName());
|
||||
GameRegistry.registerItem(spill6, spill6.getUnlocalizedName());
|
||||
GameRegistry.registerItem(spill7, spill7.getUnlocalizedName());
|
||||
GameRegistry.registerItem(spill8, spill8.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas1, gas1.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas2, gas2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas3, gas3.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas4, gas4.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas5, gas5.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas6, gas6.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas7, gas7.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas8, gas8.getUnlocalizedName());
|
||||
GameRegistry.registerItem(chlorine1, chlorine1.getUnlocalizedName());
|
||||
GameRegistry.registerItem(chlorine2, chlorine2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(chlorine3, chlorine3.getUnlocalizedName());
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.energymk2.IBatteryItem;
|
||||
@ -30,9 +31,7 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
|
||||
|
||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(getMaxCharge(stack)));
|
||||
super.addInformation(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@ -72,7 +71,7 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", this.maxPower - i);
|
||||
stack.stackTagCompound.setLong("charge", getMaxCharge(stack) - i);
|
||||
}
|
||||
|
||||
if(stack.stackTagCompound.getLong("charge") < 0)
|
||||
@ -84,10 +83,10 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
||||
public long getCharge(ItemStack stack) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
return Math.min(stack.stackTagCompound.getLong("charge"), getMaxCharge(stack));
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", ((ArmorFSBPowered) stack.getItem()).maxPower);
|
||||
stack.stackTagCompound.setLong("charge", getMaxCharge(stack));
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
}
|
||||
}
|
||||
@ -97,18 +96,23 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
|
||||
return getCharge(stack) < maxPower;
|
||||
return getCharge(stack) < getMaxCharge(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
|
||||
return 1 - (double) getCharge(stack) / (double) maxPower;
|
||||
return 1 - (double) getCharge(stack) / (double) getMaxCharge(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxCharge() {
|
||||
public long getMaxCharge(ItemStack stack) {
|
||||
if(ArmorModHandler.hasMods(stack)) {
|
||||
ItemStack mod = ArmorModHandler.pryMod(stack, ArmorModHandler.battery);
|
||||
if(mod != null && mod.getItem() instanceof ItemModBattery) {
|
||||
return (long) (maxPower * ((ItemModBattery) mod.getItem()).mod);
|
||||
}
|
||||
}
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ public class ArmorHEV extends ArmorFSBPowered {
|
||||
ItemStack armor = player.inventory.armorInventory[i];
|
||||
ArmorFSBPowered item = ((ArmorFSBPowered) player.inventory.armorInventory[i].getItem());
|
||||
|
||||
c += (double) item.getCharge(armor) / (double) item.getMaxCharge();
|
||||
c += (double) item.getCharge(armor) / (double) item.getMaxCharge(armor);
|
||||
}
|
||||
|
||||
int aX = (int) (70 / scale);
|
||||
|
||||
@ -70,7 +70,7 @@ public class ArmorModel extends ItemArmor {
|
||||
return this.modelHat;
|
||||
}
|
||||
}
|
||||
if(this == ModItems.cape_test || this == ModItems.cape_radiation || this == ModItems.cape_gasmask || this == ModItems.cape_schrabidium || this == ModItems.cape_hidden) {
|
||||
if(this == ModItems.cape_radiation || this == ModItems.cape_gasmask || this == ModItems.cape_schrabidium || this == ModItems.cape_hidden) {
|
||||
if(armorSlot == 1) {
|
||||
if(this.modelCloak == null) {
|
||||
this.modelCloak = new ModelCloak();
|
||||
@ -86,9 +86,6 @@ public class ArmorModel extends ItemArmor {
|
||||
if(stack.getItem() == ModItems.goggles) {
|
||||
return "hbm:textures/models/Goggles.png";
|
||||
}
|
||||
if(stack.getItem() == ModItems.cape_test) {
|
||||
return "hbm:textures/models/TestCape.png";
|
||||
}
|
||||
if(stack.getItem() == ModItems.cape_radiation) {
|
||||
return "hbm:textures/models/capes/CapeRadiation.png";
|
||||
}
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ArmorTest extends ItemArmor {
|
||||
|
||||
public ArmorTest(ArmorMaterial armorMaterial, int armorType) {
|
||||
super(armorMaterial, 0, armorType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) {
|
||||
if(stack.getItem().equals(ModItems.test_helmet) || stack.getItem().equals(ModItems.test_chestplate) || stack.getItem().equals(ModItems.test_boots)) {
|
||||
return (RefStrings.MODID + ":textures/armor/test_1.png");
|
||||
}
|
||||
if(stack.getItem().equals(ModItems.test_leggings)) {
|
||||
return (RefStrings.MODID + ":textures/armor/test_2.png");
|
||||
}
|
||||
|
||||
else return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -64,6 +64,7 @@ public class ItemArmorMod extends Item {
|
||||
case ArmorModHandler.cladding: list.add(" " + I18nUtil.resolveKey("armorMod.type.cladding")); break;
|
||||
case ArmorModHandler.kevlar: list.add(" " + I18nUtil.resolveKey("armorMod.type.insert")); break;
|
||||
case ArmorModHandler.extra: list.add(" " + I18nUtil.resolveKey("armorMod.type.special")); break;
|
||||
case ArmorModHandler.battery: list.add(" " + I18nUtil.resolveKey("armorMod.type.battery")); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
13
src/main/java/com/hbm/items/armor/ItemModBattery.java
Normal file
13
src/main/java/com/hbm/items/armor/ItemModBattery.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
|
||||
public class ItemModBattery extends ItemArmorMod {
|
||||
|
||||
public double mod;
|
||||
|
||||
public ItemModBattery(double mod) {
|
||||
super(ArmorModHandler.battery, true, true, true, true);
|
||||
this.mod = mod;
|
||||
}
|
||||
}
|
||||
@ -6,7 +6,6 @@ import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@ -35,7 +34,7 @@ public class ItemModCard extends ItemArmorMod {
|
||||
|
||||
@Override
|
||||
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
||||
list.add(EnumChatFormatting.YELLOW + I18n.format("item.night_vision.description.in_armor", stack.getDisplayName()));
|
||||
list.add(EnumChatFormatting.RED + stack.getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -33,7 +33,7 @@ public class ItemModNightVision extends ItemArmorMod {
|
||||
if(!entity.worldObj.isRemote && entity instanceof EntityPlayer && armor.getItem() instanceof ArmorFSBPowered && ArmorFSBPowered.hasFSBArmor((EntityPlayer) entity)) {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.nightVision.id, 15 * 20, 0));
|
||||
|
||||
if(entity.getRNG().nextInt(50) == 0) {
|
||||
if(entity.getRNG().nextInt(100) == 0) {
|
||||
armor.damageItem(1, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ public class ItemPancake extends ItemFood {
|
||||
continue;
|
||||
|
||||
if(st.getItem() instanceof IBatteryItem) {
|
||||
((IBatteryItem)st.getItem()).setCharge(st, ((IBatteryItem)st.getItem()).getMaxCharge());
|
||||
((IBatteryItem)st.getItem()).setCharge(st, ((IBatteryItem)st.getItem()).getMaxCharge(st));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,14 +105,17 @@ public class ItemBattery extends Item implements IBatteryItem {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getMaxCharge() {
|
||||
@Override
|
||||
public long getMaxCharge(ItemStack stack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getChargeRate() {
|
||||
return chargeRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDischargeRate() {
|
||||
return dischargeRate;
|
||||
}
|
||||
@ -134,7 +137,7 @@ public class ItemBattery extends Item implements IBatteryItem {
|
||||
if(item instanceof ItemBattery) {
|
||||
ItemStack stack = new ItemStack(item);
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", ((ItemBattery) item).getMaxCharge());
|
||||
stack.stackTagCompound.setLong("charge", ((ItemBattery) item).getMaxCharge(stack));
|
||||
return stack.copy();
|
||||
}
|
||||
|
||||
@ -146,7 +149,7 @@ public class ItemBattery extends Item implements IBatteryItem {
|
||||
}
|
||||
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
return 1D - (double) getCharge(stack) / (double) getMaxCharge();
|
||||
return 1D - (double) getCharge(stack) / (double) getMaxCharge(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -38,7 +38,7 @@ public class ItemSelfcharger extends Item implements IBatteryItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxCharge() {
|
||||
public long getMaxCharge(ItemStack stack) {
|
||||
return charge;
|
||||
}
|
||||
|
||||
|
||||
@ -241,7 +241,7 @@ public class ItemGlitch extends Item implements IBatteryItem {
|
||||
@Override public void setCharge(ItemStack stack, long i) { }
|
||||
@Override public void dischargeBattery(ItemStack stack, long i) { }
|
||||
@Override public long getCharge(ItemStack stack) { return 200; }
|
||||
@Override public long getMaxCharge() { return 200; }
|
||||
@Override public long getMaxCharge(ItemStack stack) { return 200; }
|
||||
@Override public long getChargeRate() { return 0; }
|
||||
@Override public long getDischargeRate() { return 200; }
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ public class ItemPotatos extends ItemBattery {
|
||||
|
||||
if(p.getHeldItem() == stack) {
|
||||
|
||||
float pitch = (float)getCharge(stack) / (float)this.getMaxCharge() * 0.5F + 0.5F;
|
||||
float pitch = (float)getCharge(stack) / (float)this.getMaxCharge(stack) * 0.5F + 0.5F;
|
||||
|
||||
world.playSoundAtEntity(p, "hbm:potatos.random", 1.0F, pitch);
|
||||
setTimer(stack, 200 + itemRand.nextInt(100));
|
||||
|
||||
@ -33,7 +33,7 @@ public class ItemFusionCore extends Item {
|
||||
|
||||
if(st.getItem() instanceof IBatteryItem) {
|
||||
|
||||
long maxcharge = ((IBatteryItem) st.getItem()).getMaxCharge();
|
||||
long maxcharge = ((IBatteryItem) st.getItem()).getMaxCharge(st);
|
||||
long charge = ((IBatteryItem) st.getItem()).getCharge(st);
|
||||
long newcharge = Math.min(charge + this.charge, maxcharge);
|
||||
|
||||
|
||||
@ -4,13 +4,13 @@ import com.hbm.items.special.ItemBedrockOreBase;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.PlayerInformPacket;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemOreDensityScanner extends Item {
|
||||
@ -25,18 +25,31 @@ public class ItemOreDensityScanner extends Item {
|
||||
for(BedrockOreType type : BedrockOreType.values()) {
|
||||
double level = ItemBedrockOreBase.getOreLevel((int) Math.floor(player.posX), (int) Math.floor(player.posZ), type);
|
||||
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(
|
||||
StatCollector.translateToLocalFormatted("item.bedrock_ore.type." + type.suffix + ".name") + ": " + ((int) (level * 100) / 100D) + " (" + translateDensity(level) + EnumChatFormatting.RESET + ")",
|
||||
ChatBuilder.startTranslation("item.bedrock_ore.type." + type.suffix + ".name")
|
||||
.next(": " + ((int) (level * 100) / 100D) + " (")
|
||||
.nextTranslation(translateDensity(level)).color(getColor(level))
|
||||
.next(")").color(EnumChatFormatting.RESET).flush(),
|
||||
777 + type.ordinal(), 4000), player);
|
||||
}
|
||||
}
|
||||
|
||||
public static String translateDensity(double density) {
|
||||
if(density <= 0.1) return EnumChatFormatting.DARK_RED + "Very poor";
|
||||
if(density <= 0.35) return EnumChatFormatting.RED + "Poor";
|
||||
if(density <= 0.75) return EnumChatFormatting.GOLD + "Low";
|
||||
if(density >= 1.9) return EnumChatFormatting.AQUA + "Excellent";
|
||||
if(density >= 1.65) return EnumChatFormatting.BLUE + "Very high";
|
||||
if(density >= 1.25) return EnumChatFormatting.GREEN + "High";
|
||||
return EnumChatFormatting.YELLOW + "Moderate";
|
||||
if(density <= 0.1) return "item.ore_density_scanner.verypoor";
|
||||
if(density <= 0.35) return "item.ore_density_scanner.poor";
|
||||
if(density <= 0.75) return "item.ore_density_scanner.low";
|
||||
if(density >= 1.9) return "item.ore_density_scanner.excellent";
|
||||
if(density >= 1.65) return "item.ore_density_scanner.veryhigh";
|
||||
if(density >= 1.25) return "item.ore_density_scanner.high";
|
||||
return "item.ore_density_scanner.moderate";
|
||||
}
|
||||
|
||||
public static EnumChatFormatting getColor(double density) {
|
||||
if(density <= 0.1) return EnumChatFormatting.DARK_RED;
|
||||
if(density <= 0.35) return EnumChatFormatting.RED;
|
||||
if(density <= 0.75) return EnumChatFormatting.GOLD;
|
||||
if(density >= 1.9) return EnumChatFormatting.AQUA;
|
||||
if(density >= 1.65) return EnumChatFormatting.BLUE;
|
||||
if(density >= 1.25) return EnumChatFormatting.GREEN;
|
||||
return EnumChatFormatting.YELLOW;
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ public class ItemSwordAbilityPower extends ItemSwordAbility implements IBatteryI
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxCharge() {
|
||||
public long getMaxCharge(ItemStack stack) {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ public class ItemToolAbilityPower extends ItemToolAbility implements IBatteryIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxCharge() {
|
||||
public long getMaxCharge(ItemStack stack) {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
|
||||
}
|
||||
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
return 1D - (double) getCharge(stack) / (double) getMaxCharge();
|
||||
return 1D - (double) getCharge(stack) / (double) getMaxCharge(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -236,7 +236,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxCharge() {
|
||||
public long getMaxCharge(ItemStack stack) {
|
||||
return mainConfig.maxCharge;
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
|
||||
|
||||
ItemStack stack = new ItemStack(item);
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase) item).getMaxCharge());
|
||||
stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase) item).getMaxCharge(stack));
|
||||
|
||||
list.add(stack);
|
||||
}
|
||||
|
||||
@ -36,10 +36,7 @@ public class Library {
|
||||
static Random rand = new Random();
|
||||
|
||||
public static boolean checkForHeld(EntityPlayer player, Item item) {
|
||||
|
||||
if(player.getHeldItem() == null)
|
||||
return false;
|
||||
|
||||
if(player.getHeldItem() == null) return false;
|
||||
return player.getHeldItem().getItem() == item;
|
||||
}
|
||||
|
||||
@ -246,7 +243,7 @@ public class Library {
|
||||
|
||||
IBatteryItem battery = (IBatteryItem) slots[index].getItem();
|
||||
|
||||
long batMax = battery.getMaxCharge();
|
||||
long batMax = battery.getMaxCharge(slots[index]);
|
||||
long batCharge = battery.getCharge(slots[index]);
|
||||
long batRate = battery.getChargeRate();
|
||||
long toCharge = Math.min(Math.min(power, batRate), batMax - batCharge);
|
||||
@ -294,22 +291,6 @@ public class Library {
|
||||
* You won't be missed.
|
||||
*/
|
||||
}
|
||||
|
||||
public static boolean isArrayEmpty(Object[] array) {
|
||||
if(array == null)
|
||||
return true;
|
||||
if(array.length == 0)
|
||||
return true;
|
||||
|
||||
boolean flag = true;
|
||||
|
||||
for(int i = 0; i < array.length; i++) {
|
||||
if(array[i] != null)
|
||||
flag = false;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Added for sake of doors
|
||||
// Original: Drillgon200: https://thebookofshaders.com/glossary/?search=smoothstep
|
||||
@ -332,24 +313,11 @@ public class Library {
|
||||
return pos != null;
|
||||
}
|
||||
|
||||
public static int getFirstNullIndex(int start, Object[] array) {
|
||||
for(int i = start; i < array.length; i++) {
|
||||
if(array[i] == null)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static Block getRandomConcrete() {
|
||||
int i = rand.nextInt(20);
|
||||
|
||||
if(i <= 1)
|
||||
return ModBlocks.brick_concrete_broken;
|
||||
if(i <= 4)
|
||||
return ModBlocks.brick_concrete_cracked;
|
||||
if(i <= 10)
|
||||
return ModBlocks.brick_concrete_mossy;
|
||||
|
||||
if(i <= 1) return ModBlocks.brick_concrete_broken;
|
||||
if(i <= 4) return ModBlocks.brick_concrete_cracked;
|
||||
if(i <= 10) return ModBlocks.brick_concrete_mossy;
|
||||
return ModBlocks.brick_concrete;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 (5036)";
|
||||
public static final String VERSION = "1.0.27 BETA (5061)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -257,6 +257,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFrackingTower.class, new RenderFrackingTower());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbofan.class, new RenderTurbofan());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbineGas.class, new RenderTurbineGas());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLPW2.class, new RenderLPW2());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePress.class, new RenderPress());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());
|
||||
@ -654,7 +655,6 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityRubble.class, new RenderRubble());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityShrapnel.class, new RenderShrapnel());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFireworks.class, new RenderShrapnel());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityOilSpill.class, new RenderEmpty());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityWaterSplash.class, new RenderEmpty());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEMP.class, new RenderEmpty());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBeamVortex.class, new RenderVortexBeam());
|
||||
@ -824,8 +824,6 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(com.hbm.entity.particle.EntityCloudFX.class, new MultiCloudRenderer(new Item[] { ModItems.cloud1, ModItems.cloud2, ModItems.cloud3, ModItems.cloud4, ModItems.cloud5, ModItems.cloud6, ModItems.cloud7, ModItems.cloud8 }));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityOrangeFX.class, new MultiCloudRenderer(new Item[] { ModItems.orange1, ModItems.orange2, ModItems.orange3, ModItems.orange4, ModItems.orange5, ModItems.orange6, ModItems.orange7, ModItems.orange8 }));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFogFX.class, new FogRenderer());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityOilSpillFX.class, new SpillRenderer(ModItems.nuclear_waste));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGasFX.class, new GasRenderer(ModItems.nuclear_waste));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEMPBlast.class, new RenderEMPBlast());
|
||||
}
|
||||
|
||||
@ -852,7 +850,6 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderPipe());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBattery());
|
||||
RenderingRegistry.registerBlockHandler(new RenderAnvil());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCrystal());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCable());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCableClassic());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTestPipe());
|
||||
|
||||
@ -102,7 +102,6 @@ public class CraftingManager {
|
||||
addRecipeAuto(Mats.MAT_DURA.make(ModItems.bolt, 16), new Object[] { "D", "D", 'D', DURA.ingot()});
|
||||
addRecipeAuto(new ItemStack(ModItems.bolt_spike, 2), new Object[] { "BB", "B ", "B ", 'B', STEEL.bolt()});
|
||||
addRecipeAuto(new ItemStack(ModItems.pipes_steel, 1), new Object[] { "B", "B", "B", 'B', STEEL.block() });
|
||||
addRecipeAuto(new ItemStack(ModItems.pellet_coal, 1), new Object[] { "PFP", "FOF", "PFP", 'P', COAL.dust(), 'F', Items.flint, 'O', ModBlocks.gravel_obsidian });
|
||||
addRecipeAuto(new ItemStack(ModItems.plate_polymer, 8), new Object[] { "DD", 'D', ANY_PLASTIC.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModItems.plate_polymer, 8), new Object[] { "DD", 'D', ANY_RUBBER.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModItems.plate_polymer, 16), new Object[] { "DD", 'D', FIBER.ingot()});
|
||||
@ -250,8 +249,6 @@ public class CraftingManager {
|
||||
|
||||
//addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 1), new Object[] { "T T", "PHP", "TFT", 'T', W.ingot(), 'P', ModItems.board_copper, 'H', Blocks.hopper, 'F', Blocks.furnace });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_difurnace_extension, 1), new Object[] { " C ", "BGB", "BGB", 'C', CU.plate(), 'B', ModItems.ingot_firebrick, 'G', ModBlocks.steel_grate });
|
||||
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_uf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', IRON.plate(), 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', MINGRADE.ingot() });
|
||||
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_puf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', STEEL.plate(), 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', MINGRADE.ingot() });
|
||||
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 1), new Object[] { "SSS", "LFL", "CCC", 'S', STEEL.plate(), 'C', CU.plateCast(), 'L', PB.plate(), 'F', Item.getItemFromBlock(Blocks.furnace) });
|
||||
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 1), new Object[] { "BBB", "WFW", "RRR", 'B', BE.ingot(), 'R', ModItems.coil_tungsten, 'W', CU.plateCast(), 'F', Item.getItemFromBlock(Blocks.furnace) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_wire_coated, 16), new Object[] { "WRW", "RIR", "WRW", 'W', ModItems.plate_polymer, 'I', MINGRADE.ingot(), 'R', MINGRADE.wireFine() });
|
||||
@ -280,8 +277,8 @@ public class CraftingManager {
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.machine_coal_off, 1), new Object[] { "STS", "SCS", "SFS", 'S', STEEL.ingot(), 'T', ModItems.tank_steel, 'C', MINGRADE.ingot(), 'F', Blocks.furnace });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_wood_burner, 1), new Object[] { "PPP", "CFC", "I I" , 'P', STEEL.plate528(), 'C', ModItems.coil_copper, 'I', IRON.ingot(), 'F', Blocks.furnace});
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_turbine, 1), new Object[] { "SMS", "PTP", "SMS", 'S', STEEL.ingot(), 'T', ModItems.turbine_titanium, 'M', ModItems.coil_copper, 'P', ANY_PLASTIC.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_converter_he_rf, 1), new Object[] { "SSS", "CRB", "SSS", 'S', STEEL.ingot(), 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus, 'B', REDSTONE.block() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_converter_rf_he, 1), new Object[] { "SSS", "BRC", "SSS", 'S', BE.ingot(), 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus, 'B', REDSTONE.block() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_converter_he_rf, 1), new Object[] { "RRR", "WWW", "III", 'R', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CAPACITOR), 'W', REDSTONE.dust(), 'I', STEEL.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_converter_rf_he, 1), new Object[] { "RRR", "WWW", "III", 'R', REDSTONE.dust(), 'W', MINGRADE.wireFine(), 'I', STEEL.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crate_template, 1), new Object[] { "IPI", "P P", "IPI", 'I', IRON.ingot(), 'P', Items.paper });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crate_iron, 1), new Object[] { "PPP", "I I", "III", 'P', IRON.plate(), 'I', IRON.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crate_steel, 1), new Object[] { "PPP", "I I", "III", 'P', STEEL.plate(), 'I', STEEL.ingot() });
|
||||
@ -411,8 +408,8 @@ public class CraftingManager {
|
||||
String dyeName = "dye" + dyes[15 - i];
|
||||
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored, 8, i), new Object[] { "CCC", "CDC", "CCC", 'C', ModBlocks.concrete_smooth, 'D', dyeName });
|
||||
}
|
||||
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { ModBlocks.concrete_colored });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { ModBlocks.concrete_colored_ext });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { new ItemStack(ModBlocks.concrete_colored, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { new ItemStack(ModBlocks.concrete_colored_ext, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored_ext, 6, EnumConcreteType.MACHINE.ordinal()), new Object[] { "CCC", "1 2", "CCC", 'C', ModBlocks.concrete_smooth, '1', KEY_BROWN, '2', KEY_GRAY });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored_ext, 6, EnumConcreteType.MACHINE_STRIPE.ordinal()), new Object[] { "CCC", "1 2", "CCC", 'C', ModBlocks.concrete_smooth, '1', KEY_BROWN, '2', KEY_BLACK });
|
||||
@ -941,7 +938,7 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.charger), new Object[] { "G", "S", "C", 'G', Items.glowstone_dust, 'S', STEEL.ingot(), 'C', ModItems.coil_copper });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.charger, 16), new Object[] { "G", "S", "C", 'G', Blocks.glowstone, 'S', STEEL.block(), 'C', ModItems.coil_copper_torus });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.press_preheater), new Object[] { "CCC", "SLS", "TST", 'C', CU.plate(), 'S', Blocks.stone, 'L', Fluids.LAVA.getDict(1000), 'T', W.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModItems.fluid_identifier_multi), new Object[] { "D", "C", "P", 'D', "dye", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'P', ANY_PLASTIC.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModItems.fluid_identifier_multi), new Object[] { "D", "C", "P", 'D', "dye", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ANALOG), 'P', IRON.plate() });
|
||||
|
||||
addShapelessAuto(ItemBattery.getEmptyBattery(ModItems.anchor_remote), new Object[] { DIAMOND.gem(), ModItems.ducttape, DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.teleanchor), new Object[] { "ODO", "EAE", "ODO", 'O', Blocks.obsidian, 'D', DIAMOND.gem(), 'E', ModItems.powder_magic, 'A', ModItems.gem_alexandrite });
|
||||
|
||||
@ -137,7 +137,6 @@ public class MainRegistry {
|
||||
public static ToolMaterial enumToolMaterialMultitool = EnumHelper.addToolMaterial("MULTITOOL", 3, 5000, 25F, 5.5F, 25);
|
||||
|
||||
// Armor Materials
|
||||
public static ArmorMaterial enumArmorMaterialEmerald = EnumHelper.addArmorMaterial("HBM_TEST", 2500, new int[] { 3, 8, 6, 3 }, 30);
|
||||
public static ArmorMaterial aMatSchrab = EnumHelper.addArmorMaterial("HBM_SCHRABIDIUM", 100, new int[] { 3, 8, 6, 3 }, 50);
|
||||
public static ArmorMaterial aMatEuph = EnumHelper.addArmorMaterial("HBM_EUPHEMIUM", 15000000, new int[] { 3, 8, 6, 3 }, 100);
|
||||
public static ArmorMaterial aMatHaz = EnumHelper.addArmorMaterial("HBM_HAZMAT", 60, new int[] { 2, 5, 4, 1 }, 5);
|
||||
@ -878,7 +877,10 @@ public class MainRegistry {
|
||||
proxy.registerMissileItems();
|
||||
|
||||
BlockMotherOfAllOres.init();
|
||||
|
||||
|
||||
// Load compatibility for OC.
|
||||
CompatHandler.init();
|
||||
|
||||
//expand for the largest entity we have (currently Quackos who is 17.5m in diameter, that's one fat duck)
|
||||
World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75);
|
||||
|
||||
@ -1392,6 +1394,34 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:item.energy_ball");
|
||||
ignoreMappings.add("hbm:item.discharge");
|
||||
ignoreMappings.add("hbm:item.empblast");
|
||||
ignoreMappings.add("hbm:tile.crystal_power");
|
||||
ignoreMappings.add("hbm:tile.crystal_energy");
|
||||
ignoreMappings.add("hbm:tile.crystal_robust");
|
||||
ignoreMappings.add("hbm:tile.crystal_trixite");
|
||||
ignoreMappings.add("hbm:tile.hazmat");
|
||||
ignoreMappings.add("hbm:item.pellet_coal");
|
||||
ignoreMappings.add("hbm:item.test_helmet");
|
||||
ignoreMappings.add("hbm:item.test_chestplate");
|
||||
ignoreMappings.add("hbm:item.test_leggings");
|
||||
ignoreMappings.add("hbm:item.test_boots");
|
||||
ignoreMappings.add("hbm:item.cape_test");
|
||||
ignoreMappings.add("hbm:item.spill1");
|
||||
ignoreMappings.add("hbm:item.spill2");
|
||||
ignoreMappings.add("hbm:item.spill3");
|
||||
ignoreMappings.add("hbm:item.spill4");
|
||||
ignoreMappings.add("hbm:item.spill5");
|
||||
ignoreMappings.add("hbm:item.spill6");
|
||||
ignoreMappings.add("hbm:item.spill7");
|
||||
ignoreMappings.add("hbm:item.spill8");
|
||||
ignoreMappings.add("hbm:item.gas1");
|
||||
ignoreMappings.add("hbm:item.gas2");
|
||||
ignoreMappings.add("hbm:item.gas3");
|
||||
ignoreMappings.add("hbm:item.gas4");
|
||||
ignoreMappings.add("hbm:item.gas5");
|
||||
ignoreMappings.add("hbm:item.gas6");
|
||||
ignoreMappings.add("hbm:item.gas7");
|
||||
ignoreMappings.add("hbm:item.gas8");
|
||||
ignoreMappings.add("hbm:tile.brick_forgotten");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -233,6 +233,9 @@ public class ResourceManager {
|
||||
//ICF
|
||||
public static final IModelCustom icf = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/icf.obj")).asVBO();
|
||||
|
||||
//ICF
|
||||
public static final IModelCustom lpw2 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/lpw2.obj")).asVBO();
|
||||
|
||||
//Watz
|
||||
public static final IModelCustom watz = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/watz.obj")).asVBO();
|
||||
public static final IModelCustom watz_pump = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/watz_pump.obj")).asVBO();
|
||||
@ -648,6 +651,11 @@ public class ResourceManager {
|
||||
//ICF
|
||||
public static final ResourceLocation icf_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/icf.png");
|
||||
|
||||
//Fat Fuck
|
||||
public static final ResourceLocation lpw2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2.png");
|
||||
public static final ResourceLocation lpw2_term_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2_term.png");
|
||||
public static final ResourceLocation lpw2_error_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2_term_error.png");
|
||||
|
||||
//Watz
|
||||
public static final ResourceLocation watz_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz.png");
|
||||
public static final ResourceLocation watz_pump_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz_pump.png");
|
||||
|
||||
@ -15,8 +15,6 @@ public class PacketDispatcher {
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
//Fluid packet for GUI
|
||||
wrapper.registerMessage(TEFluidPacket.Handler.class, TEFluidPacket.class, i++, Side.CLIENT);
|
||||
//Sound packet that keeps client and server separated
|
||||
wrapper.registerMessage(LoopedSoundPacket.Handler.class, LoopedSoundPacket.class, i++, Side.CLIENT);
|
||||
//Signals server to consume items and create template
|
||||
|
||||
@ -1,73 +0,0 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@Deprecated
|
||||
public class TEFluidPacket implements IMessage {
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int fill;
|
||||
int index;
|
||||
int type;
|
||||
|
||||
public TEFluidPacket() { }
|
||||
|
||||
public TEFluidPacket(int x, int y, int z, int fill, int index, FluidType type)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.fill = fill;
|
||||
this.index = index;
|
||||
this.type = type.getID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
fill = buf.readInt();
|
||||
index = buf.readInt();
|
||||
type = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeInt(fill);
|
||||
buf.writeInt(index);
|
||||
buf.writeInt(type);
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<TEFluidPacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(TEFluidPacket m, MessageContext ctx) {
|
||||
try{
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
|
||||
if (te != null && te instanceof IFluidContainer) {
|
||||
|
||||
IFluidContainer gen = (IFluidContainer) te;
|
||||
gen.setFillForSync(m.fill, m.index);
|
||||
gen.setTypeForSync(Fluids.fromID(m.type), m.index);
|
||||
}
|
||||
} catch(Exception x) { }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,108 +0,0 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockCrystal;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.ObjUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||
|
||||
public class RenderCrystal implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
IIcon iicon = block.getIcon(0, 0);
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
iicon = renderer.overrideBlockTexture;
|
||||
}
|
||||
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
if(block == ModBlocks.crystal_power)
|
||||
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.crystal_power, iicon, tessellator, 0, false);
|
||||
if(block == ModBlocks.crystal_energy)
|
||||
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.crystal_energy, iicon, tessellator, 0, false);
|
||||
if(block == ModBlocks.crystal_robust)
|
||||
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.crystal_robust, iicon, tessellator, 0, false);
|
||||
if(block == ModBlocks.crystal_trixite)
|
||||
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.crystal_trixite, iicon, tessellator, 0, false);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
IIcon iicon = block.getIcon(0, 0);
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
iicon = renderer.overrideBlockTexture;
|
||||
}
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
float flip = 0;
|
||||
float rotation = 0;
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(meta == 0)
|
||||
flip = (float)Math.PI;
|
||||
|
||||
if(meta == 2)
|
||||
rotation = 90F / 180F * (float) Math.PI;
|
||||
|
||||
if(meta == 3)
|
||||
rotation = 270F / 180F * (float) Math.PI;
|
||||
|
||||
if(meta == 4)
|
||||
rotation = 180F / 180F * (float)Math.PI;
|
||||
|
||||
if(rotation != 0F || meta == 5)
|
||||
flip = (float)Math.PI * 0.5F;
|
||||
|
||||
tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F);
|
||||
|
||||
if(block == ModBlocks.crystal_power)
|
||||
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.crystal_power, iicon, tessellator, rotation, flip, true);
|
||||
if(block == ModBlocks.crystal_energy)
|
||||
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.crystal_energy, iicon, tessellator, rotation, flip, true);
|
||||
if(block == ModBlocks.crystal_robust)
|
||||
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.crystal_robust, iicon, tessellator, rotation, flip, true);
|
||||
if(block == ModBlocks.crystal_trixite)
|
||||
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.crystal_trixite, iicon, tessellator, rotation, flip, true);
|
||||
|
||||
tessellator.addTranslation(-x - 0.5F, -y - 0.5F, -z - 0.5F);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockCrystal.renderID;
|
||||
}
|
||||
}
|
||||
@ -1,121 +0,0 @@
|
||||
package com.hbm.render.entity.effect;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.entity.particle.EntityGasFX;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GasRenderer extends Render {
|
||||
private Item field_94151_a;
|
||||
public GasRenderer(Item p_i1259_1_, int p_i1259_2_) {
|
||||
this.field_94151_a = p_i1259_1_;
|
||||
}
|
||||
|
||||
public GasRenderer(Item p_i1260_1_) {
|
||||
this(p_i1260_1_, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void func_76986_a(T entity, double d, double d1, double d2, float f,
|
||||
* float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
|
||||
float p_76986_9_) {
|
||||
if (p_76986_1_ instanceof EntityGasFX) {
|
||||
EntityGasFX fx = (EntityGasFX) p_76986_1_;
|
||||
|
||||
if (fx.particleAge <= fx.maxAge && fx.particleAge >= fx.maxAge / 8 * 7) {
|
||||
field_94151_a = ModItems.gas8;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 7 && fx.particleAge >= fx.maxAge / 8 * 6) {
|
||||
field_94151_a = ModItems.gas7;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 6 && fx.particleAge >= fx.maxAge / 8 * 5) {
|
||||
field_94151_a = ModItems.gas6;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 5 && fx.particleAge >= fx.maxAge / 8 * 4) {
|
||||
field_94151_a = ModItems.gas5;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 4 && fx.particleAge >= fx.maxAge / 8 * 3) {
|
||||
field_94151_a = ModItems.gas4;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 3 && fx.particleAge >= fx.maxAge / 8 * 2) {
|
||||
field_94151_a = ModItems.gas3;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 2 && fx.particleAge >= fx.maxAge / 8 * 1) {
|
||||
field_94151_a = ModItems.gas2;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 && fx.particleAge >= 0) {
|
||||
field_94151_a = ModItems.gas1;
|
||||
}
|
||||
|
||||
IIcon iicon = field_94151_a.getIconFromDamage(0);
|
||||
|
||||
if (iicon != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glScalef(7.5F, 7.5F, 7.5F);
|
||||
//
|
||||
GL11.glScalef(0.25F, 0.25F, 0.25F);
|
||||
//
|
||||
this.bindEntityTexture(p_76986_1_);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
this.func_77026_a(tessellator, iicon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return TextureMap.locationItemsTexture;
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) {
|
||||
float f = p_77026_2_.getMinU();
|
||||
float f1 = p_77026_2_.getMaxU();
|
||||
float f2 = p_77026_2_.getMinV();
|
||||
float f3 = p_77026_2_.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
p_77026_1_.startDrawingQuads();
|
||||
p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
|
||||
p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
|
||||
p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
|
||||
p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
|
||||
p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
|
||||
p_77026_1_.draw();
|
||||
}
|
||||
}
|
||||
@ -1,120 +0,0 @@
|
||||
package com.hbm.render.entity.effect;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.entity.particle.EntityOilSpillFX;
|
||||
import com.hbm.items.ModItems;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class SpillRenderer extends Render {
|
||||
private Item field_94151_a;
|
||||
public SpillRenderer(Item p_i1259_1_, int p_i1259_2_) {
|
||||
this.field_94151_a = p_i1259_1_;
|
||||
}
|
||||
|
||||
public SpillRenderer(Item p_i1260_1_) {
|
||||
this(p_i1260_1_, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void func_76986_a(T entity, double d, double d1, double d2, float f,
|
||||
* float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
|
||||
float p_76986_9_) {
|
||||
if (p_76986_1_ instanceof EntityOilSpillFX) {
|
||||
EntityOilSpillFX fx = (EntityOilSpillFX) p_76986_1_;
|
||||
|
||||
if (fx.particleAge <= fx.maxAge && fx.particleAge >= fx.maxAge / 8 * 7) {
|
||||
field_94151_a = ModItems.spill8;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 7 && fx.particleAge >= fx.maxAge / 8 * 6) {
|
||||
field_94151_a = ModItems.spill7;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 6 && fx.particleAge >= fx.maxAge / 8 * 5) {
|
||||
field_94151_a = ModItems.spill6;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 5 && fx.particleAge >= fx.maxAge / 8 * 4) {
|
||||
field_94151_a = ModItems.spill5;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 4 && fx.particleAge >= fx.maxAge / 8 * 3) {
|
||||
field_94151_a = ModItems.spill4;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 3 && fx.particleAge >= fx.maxAge / 8 * 2) {
|
||||
field_94151_a = ModItems.spill3;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 2 && fx.particleAge >= fx.maxAge / 8 * 1) {
|
||||
field_94151_a = ModItems.spill2;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 && fx.particleAge >= 0) {
|
||||
field_94151_a = ModItems.spill1;
|
||||
}
|
||||
|
||||
IIcon iicon = field_94151_a.getIconFromDamage(0);
|
||||
|
||||
if (iicon != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glScalef(7.5F, 7.5F, 7.5F);
|
||||
//
|
||||
GL11.glScalef(0.25F, 0.25F, 0.25F);
|
||||
//
|
||||
this.bindEntityTexture(p_76986_1_);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
this.func_77026_a(tessellator, iicon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return TextureMap.locationItemsTexture;
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) {
|
||||
float f = p_77026_2_.getMinU();
|
||||
float f1 = p_77026_2_.getMaxU();
|
||||
float f2 = p_77026_2_.getMinV();
|
||||
float f3 = p_77026_2_.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
p_77026_1_.startDrawingQuads();
|
||||
p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
|
||||
p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
|
||||
p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
|
||||
p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
|
||||
p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
|
||||
p_77026_1_.draw();
|
||||
}
|
||||
}
|
||||
@ -2,12 +2,17 @@ package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderDerrick extends TileEntitySpecialRenderer {
|
||||
public class RenderDerrick extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
@ -16,7 +21,14 @@ public class RenderDerrick extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
|
||||
switch(tileEntity.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.derrick_tex);
|
||||
@ -25,4 +37,25 @@ public class RenderDerrick extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_well);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.derrick_tex); ResourceManager.derrick.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public class RenderFluidTank extends TileEntitySpecialRenderer implements IItemR
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0, 0);
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
boolean exploded = false;
|
||||
if(item.hasTagCompound() && item.getTagCompound().hasKey(IPersistentNBT.NBT_PERSISTENT_KEY)) {
|
||||
tank.readFromNBT(item.getTagCompound().getCompoundTag(IPersistentNBT.NBT_PERSISTENT_KEY), "tank");
|
||||
|
||||
@ -3,12 +3,16 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderICF extends TileEntitySpecialRenderer {
|
||||
public class RenderICF extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||
@ -34,4 +38,26 @@ public class RenderICF extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.icf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
double scale = 2.125;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.icf_tex); ResourceManager.icf.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
277
src/main/java/com/hbm/render/tileentity/RenderLPW2.java
Normal file
277
src/main/java/com/hbm/render/tileentity/RenderLPW2.java
Normal file
@ -0,0 +1,277 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderLPW2 extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
switch(te.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
long time = te.getWorldObj().getTotalWorldTime();
|
||||
|
||||
double swayTimer = ((time + interp) / 3D) % (Math.PI * 4);
|
||||
double sway = (Math.sin(swayTimer) + Math.sin(swayTimer * 2) + Math.sin(swayTimer * 4) + 2.23255D) * 0.5;
|
||||
|
||||
double bellTimer = ((time + interp) / 5D) % (Math.PI * 4);
|
||||
double h = (Math.sin(bellTimer + Math.PI) + Math.sin(bellTimer * 1.5D)) / 1.90596D;
|
||||
double v = (Math.sin(bellTimer) + Math.sin(bellTimer * 1.5D)) / 1.90596D;
|
||||
|
||||
double pistonTimer = ((time + interp) / 5D) % (Math.PI * 2);
|
||||
double piston = BobMathUtil.sps(pistonTimer);
|
||||
double rotorTimer = ((time + interp) / 5D) % (Math.PI * 16);
|
||||
double rotor = (BobMathUtil.sps(rotorTimer) + rotorTimer / 2D - 1) / 25.1327412287D;
|
||||
double turbine = ((time + interp) % 100) / 100D;
|
||||
|
||||
bindTexture(ResourceManager.lpw2_tex);
|
||||
ResourceManager.lpw2.renderPart("Frame");
|
||||
|
||||
renderMainAssembly(sway, h, v, piston, rotor, turbine);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-2.9375, 0, 2.375);
|
||||
GL11.glRotated(sway * 10, 0, 1, 0);
|
||||
GL11.glTranslated(2.9375, 0, -2.375);
|
||||
ResourceManager.lpw2.renderPart("WireLeft");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(2.9375, 0, 2.375);
|
||||
GL11.glRotated(sway * -10, 0, 1, 0);
|
||||
GL11.glTranslated(-2.9375, 0, -2.375);
|
||||
ResourceManager.lpw2.renderPart("WireRight");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
double coverTimer = ((time + interp) / 5D) % (Math.PI * 4);
|
||||
double cover = (Math.sin(coverTimer) + Math.sin(coverTimer * 2) + Math.sin(coverTimer * 4)) * 0.5;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, -cover * 0.125);
|
||||
ResourceManager.lpw2.renderPart("Cover");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, 3.5);
|
||||
GL11.glScaled(1, 1, (3 + cover * 0.125) / 3);
|
||||
GL11.glTranslated(0, 0, -3.5);
|
||||
ResourceManager.lpw2.renderPart("SuspensionCoverFront");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, -5.5);
|
||||
GL11.glScaled(1, 1, (1.5 - cover * 0.125) / 1.5);
|
||||
GL11.glTranslated(0, 0, 5.5);
|
||||
ResourceManager.lpw2.renderPart("SuspensionCoverBack");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, -9);
|
||||
GL11.glScaled(1, 1, (1.25 - sway * 0.125) / 1.25);
|
||||
GL11.glTranslated(0, 0, 9);
|
||||
ResourceManager.lpw2.renderPart("SuspensionBackOuter");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, -9.5);
|
||||
GL11.glScaled(1, 1, (1.75 - sway * 0.125) / 1.75);
|
||||
GL11.glTranslated(0, 0, 9.5);
|
||||
ResourceManager.lpw2.renderPart("SuspensionBackCenter");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
double serverTimer = ((time + interp) / 2D) % (Math.PI * 4);
|
||||
double sx = (Math.sin(serverTimer + Math.PI) + Math.sin(serverTimer * 1.5D)) / 1.90596D;
|
||||
double sy = (Math.sin(serverTimer) + Math.sin(serverTimer * 1.5D)) / 1.90596D;
|
||||
|
||||
double serverSway = 0.0625D * 0.25D;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(sx * serverSway, 0, sy * serverSway);
|
||||
ResourceManager.lpw2.renderPart("Server1");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-sy * serverSway, 0, sx * serverSway);
|
||||
ResourceManager.lpw2.renderPart("Server2");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(sy * serverSway, 0, -sx * serverSway);
|
||||
ResourceManager.lpw2.renderPart("Server3");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-sx * serverSway, 0, -sy * serverSway);
|
||||
ResourceManager.lpw2.renderPart("Server4");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
double errorTimer = ((time + interp) / 3D);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(sy * serverSway, 0, sx * serverSway);
|
||||
|
||||
ResourceManager.lpw2.renderPart("Monitor");
|
||||
|
||||
/*Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.lpw2_term_tex);
|
||||
ResourceManager.lpw2.renderPart("Screen");*/
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.lpw2_error_tex);
|
||||
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslated(0, BobMathUtil.sps(errorTimer) + errorTimer / 2D - 1, 0);
|
||||
ResourceManager.lpw2.renderPart("Screen");
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void renderMainAssembly(double sway, double h, double v, double piston, double rotor, double turbine) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, -sway * 0.125);
|
||||
ResourceManager.lpw2.renderPart("Center");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 3.5, 0);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(rotor * 360, 0, 0, -1);
|
||||
GL11.glTranslated(0, -3.5, 0);
|
||||
ResourceManager.lpw2.renderPart("Rotor");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(turbine * 360, 0, 0, 1);
|
||||
GL11.glTranslated(0, -3.5, 0);
|
||||
ResourceManager.lpw2.renderPart("TurbineFront");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(turbine * 360, 0, 0, -1);
|
||||
GL11.glTranslated(0, -3.5, 0);
|
||||
ResourceManager.lpw2.renderPart("TurbineBack");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, piston * 0.375D + 0.375D);
|
||||
ResourceManager.lpw2.renderPart("Piston");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderBell(h, v);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderShroud(h, v);
|
||||
}
|
||||
|
||||
public static void renderBell(double h, double v) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 3.5, 2.75);
|
||||
double magnitude = 2D;
|
||||
GL11.glRotated(v * magnitude, 0, 1, 0);
|
||||
GL11.glRotated(h * magnitude, 1, 0, 0);
|
||||
GL11.glTranslated(0, -3.5, -2.75);
|
||||
ResourceManager.lpw2.renderPart("Engine");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void renderShroud(double h, double v) {
|
||||
|
||||
double magnitude = 0.125D;
|
||||
double rotation = 5D;
|
||||
double offset = 10D;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -h * magnitude, 0);
|
||||
ResourceManager.lpw2.renderPart("ShroudH");
|
||||
|
||||
renderFlap(90 + 22.5D, rotation * v + offset);
|
||||
renderFlap(90 - 22.5D, rotation * v + offset);
|
||||
renderFlap(270 + 22.5D, rotation * -v + offset);
|
||||
renderFlap(270 - 22.5D, rotation * -v + offset);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(v * magnitude, 0, 0);
|
||||
ResourceManager.lpw2.renderPart("ShroudV");
|
||||
|
||||
renderFlap(22.5D, rotation * h + offset);
|
||||
renderFlap(-22.5D, rotation * h + offset);
|
||||
renderFlap(180 + 22.5D, rotation * -h + offset);
|
||||
renderFlap(180 - 22.5D, rotation * -h + offset);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
double length = 0.6875D;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-2.625D, 0, 0);
|
||||
GL11.glScaled((length + v * magnitude) / length, 1, 1);
|
||||
GL11.glTranslated(2.625D, 0, 0);
|
||||
ResourceManager.lpw2.renderPart("SuspensionLeft");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(2.625D, 0, 0);
|
||||
GL11.glScaled((length - v * magnitude) / length, 1, 1);
|
||||
GL11.glTranslated(-2.625D, 0, 0);
|
||||
ResourceManager.lpw2.renderPart("SuspensionRight");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 6.125D, 0);
|
||||
GL11.glScaled(1, (length + h * magnitude) / length, 1);
|
||||
GL11.glTranslated(0, -6.125D, 0);
|
||||
ResourceManager.lpw2.renderPart("SuspensionTop");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0.875D, 0);
|
||||
GL11.glScaled(1, (length - h * magnitude) / length, 1);
|
||||
GL11.glTranslated(0, -0.875D, 0);
|
||||
ResourceManager.lpw2.renderPart("SuspensionBottom");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void renderFlap(double position, double rotation) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslated(0, 3.5D, 0);
|
||||
GL11.glRotated(position, 0, 0, 1);
|
||||
GL11.glTranslated(0, -3.5D, 0);
|
||||
|
||||
GL11.glTranslated(0, 6.96875D, 8.5D);
|
||||
GL11.glRotated(rotation, 1, 0, 0);
|
||||
GL11.glTranslated(0, -6.96875D, -8.5D);
|
||||
|
||||
ResourceManager.lpw2.renderPart("Flap");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,19 @@
|
||||
package com.hbm.tileentity;
|
||||
|
||||
import com.hbm.packet.BufPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface IBufPacketReceiver {
|
||||
|
||||
public void serialize(ByteBuf buf);
|
||||
public void deserialize(ByteBuf buf);
|
||||
|
||||
public default void sendStandard(int range) {
|
||||
TileEntity te = (TileEntity) this;
|
||||
PacketDispatcher.wrapper.sendToAllAround(new BufPacket(te.xCoord, te.yCoord, te.zCoord, this), new TargetPoint(te.getWorldObj().provider.dimensionId, te.xCoord, te.yCoord, te.zCoord, range));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.CompatHandler.OCComponent;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
@ -8,6 +9,7 @@ import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
import api.hbm.fluid.IFluidConnector;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
@ -32,7 +34,11 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
boolean fluid;
|
||||
boolean heat;
|
||||
public boolean moltenMetal;
|
||||
|
||||
|
||||
// due to some issues with OC deciding that it's gonna call the component name function before the worldObj is loaded
|
||||
// the component name must be cached to prevent it from shitting itself
|
||||
String componentName = CompatHandler.nullComponent;
|
||||
|
||||
public TileEntityProxyCombo() { }
|
||||
|
||||
public TileEntityProxyCombo(boolean inventory, boolean power, boolean fluid) {
|
||||
@ -344,6 +350,9 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
this.fluid = nbt.getBoolean("fluid");
|
||||
this.moltenMetal = nbt.getBoolean("metal");
|
||||
this.heat = nbt.getBoolean("heat");
|
||||
if(Loader.isModLoaded("OpenComputers"))
|
||||
this.componentName = nbt.getString("ocname");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -355,6 +364,8 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
nbt.setBoolean("fluid", fluid);
|
||||
nbt.setBoolean("metal", moltenMetal);
|
||||
nbt.setBoolean("heat", heat);
|
||||
if(Loader.isModLoaded("OpenComputers"))
|
||||
nbt.setString("ocname", componentName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -452,27 +463,27 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
@Override // please work
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public String getComponentName() {
|
||||
if(this.getTile() instanceof OCComponent)
|
||||
return ((OCComponent) this.getTile()).getComponentName();
|
||||
if(this.worldObj == null) // OC is going too fast, grab from NBT!
|
||||
return componentName;
|
||||
if(this.getTile() instanceof OCComponent) {
|
||||
if (componentName == null || componentName.equals(OCComponent.super.getComponentName())) {
|
||||
componentName = ((OCComponent) this.getTile()).getComponentName();
|
||||
}
|
||||
return componentName;
|
||||
}
|
||||
return OCComponent.super.getComponentName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public boolean canConnectNode(ForgeDirection side) { //thank you vaer
|
||||
public boolean canConnectNode(ForgeDirection side) {
|
||||
if(this.getTile() instanceof OCComponent)
|
||||
return (this.getTile().getBlockMetadata() & 6) == 6 && ((OCComponent) this.getTile()).canConnectNode(side);
|
||||
return (this.getBlockMetadata() >= 6 && this.getBlockMetadata() <= 11)
|
||||
&& (power || fluid) &&
|
||||
((OCComponent) this.getTile()).canConnectNode(side);
|
||||
return OCComponent.super.canConnectNode(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public String[] getExtraInfo() {
|
||||
if(this.getTile() instanceof OCComponent)
|
||||
return new String[] {"analyze.dummy"};
|
||||
return OCComponent.super.getExtraInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public String[] methods() {
|
||||
|
||||
@ -95,6 +95,7 @@ public class TileMappings {
|
||||
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
|
||||
put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
|
||||
put(TileEntityMachineTurbineGas.class, "tileentity_machine_gasturbine");
|
||||
put(TileEntityMachineLPW2.class, "tileentity_machine_lpw2");
|
||||
put(TileEntityCrateTemplate.class, "tileentity_crate_template");
|
||||
put(TileEntityCrateIron.class, "tileentity_crate_iron");
|
||||
put(TileEntityCrateSteel.class, "tileentity_crate_steel");
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.List;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.handler.MissileStruct;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerCompactLauncher;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -17,10 +16,10 @@ import com.hbm.items.weapon.ItemCustomMissilePart.FuelType;
|
||||
import com.hbm.items.weapon.ItemCustomMissilePart.PartSize;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.BufPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IRadarCommandReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
@ -32,6 +31,7 @@ import api.hbm.item.IDesignatorItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -47,7 +47,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCompactLauncher extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IRadarCommandReceiver {
|
||||
public class TileEntityCompactLauncher extends TileEntityLoadedBase implements ISidedInventory, IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IBufPacketReceiver, IRadarCommandReceiver {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -66,8 +66,8 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
public TileEntityCompactLauncher() {
|
||||
slots = new ItemStack[8];
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 25000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 25000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 25000);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 25000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -177,9 +177,6 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
|
||||
tanks[0].loadTank(2, 6, slots);
|
||||
tanks[1].loadTank(3, 7, slots);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 5, power, maxPower);
|
||||
|
||||
@ -192,8 +189,7 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0)
|
||||
this.updateConnections();
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, solid, 0), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new BufPacket(xCoord, yCoord, zCoord, this), new TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
|
||||
MissileStruct multipart = getStruct(slots[0]);
|
||||
|
||||
@ -234,6 +230,20 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void serialize(ByteBuf buf) {
|
||||
buf.writeLong(power);
|
||||
buf.writeInt(solid);
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override public void deserialize(ByteBuf buf) {
|
||||
this.power = buf.readLong();
|
||||
this.solid = buf.readInt();
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
|
||||
@ -546,18 +556,6 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.MissileStruct;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerLaunchTable;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -18,10 +17,10 @@ import com.hbm.items.weapon.ItemCustomMissilePart.FuelType;
|
||||
import com.hbm.items.weapon.ItemCustomMissilePart.PartSize;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.BufPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IRadarCommandReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
@ -33,10 +32,10 @@ import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
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.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -53,7 +52,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 TileEntityLaunchTable extends TileEntityLoadedBase implements ISidedInventory, IEnergyReceiverMK2, IFluidContainer, IFluidStandardReceiver, IGUIProvider, SimpleComponent, IRadarCommandReceiver, CompatHandler.OCComponent {
|
||||
public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISidedInventory, IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IBufPacketReceiver, IRadarCommandReceiver, CompatHandler.OCComponent {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -74,8 +73,8 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
public TileEntityLaunchTable() {
|
||||
slots = new ItemStack[8];
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 100000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 100000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 100000);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 100000);
|
||||
padSize = PartSize.SIZE_10;
|
||||
height = 10;
|
||||
}
|
||||
@ -190,9 +189,6 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
|
||||
tanks[0].loadTank(2, 6, slots);
|
||||
tanks[1].loadTank(3, 7, slots);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 5, power, maxPower);
|
||||
|
||||
@ -202,9 +198,7 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
solid += 250;
|
||||
}
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, solid, 0), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, padSize.ordinal(), 1), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 250));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new BufPacket(xCoord, yCoord, zCoord, this), new TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
|
||||
MissileStruct multipart = getStruct(slots[0]);
|
||||
|
||||
@ -239,6 +233,22 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void serialize(ByteBuf buf) {
|
||||
buf.writeLong(power);
|
||||
buf.writeInt(solid);
|
||||
buf.writeByte((byte) padSize.ordinal());
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override public void deserialize(ByteBuf buf) {
|
||||
this.power = buf.readLong();
|
||||
this.solid = buf.readInt();
|
||||
this.padSize = PartSize.values()[buf.readByte()];
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
|
||||
@ -543,18 +553,6 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
@ -103,12 +103,12 @@ public class TileEntityNukeBalefire extends TileEntityMachineBase implements IGU
|
||||
public int getBattery() {
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.battery_spark &&
|
||||
((IBatteryItem)ModItems.battery_spark).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_spark).getMaxCharge()) {
|
||||
((IBatteryItem)ModItems.battery_spark).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_spark).getMaxCharge(slots[1])) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.battery_trixite &&
|
||||
((IBatteryItem)ModItems.battery_trixite).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_trixite).getMaxCharge()) {
|
||||
((IBatteryItem)ModItems.battery_trixite).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_trixite).getMaxCharge(slots[1])) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.container.ContainerAshpit;
|
||||
import com.hbm.inventory.gui.GUIAshpit;
|
||||
import com.hbm.items.ItemEnums.EnumAshType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
@ -19,7 +24,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvider {
|
||||
public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvider, IConfigurableMachine {
|
||||
|
||||
private int playersUsing = 0;
|
||||
public float doorAngle = 0;
|
||||
@ -32,10 +37,40 @@ public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvi
|
||||
public int ashLevelFly;
|
||||
public int ashLevelSoot;
|
||||
|
||||
//Configurable values
|
||||
public static int thresholdWood = 2000;
|
||||
public static int thresholdCoal = 2000;
|
||||
public static int thresholdMisc = 2000;
|
||||
public static int thresholdFly = 2000;
|
||||
public static int thresholdSoot = 8000;
|
||||
|
||||
public TileEntityAshpit() {
|
||||
super(5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "ashpit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
thresholdWood = IConfigurableMachine.grab(obj, "I:thresholdWood", thresholdWood);
|
||||
thresholdCoal = IConfigurableMachine.grab(obj, "I:thresholdCoal", thresholdCoal);
|
||||
thresholdMisc = IConfigurableMachine.grab(obj, "I:thresholdMisc", thresholdMisc);
|
||||
thresholdFly = IConfigurableMachine.grab(obj, "I:thresholdFly", thresholdFly);
|
||||
thresholdSoot = IConfigurableMachine.grab(obj, "I:thresholdSoot", thresholdSoot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("I:thresholdWood").value(thresholdWood);
|
||||
writer.name("I:thresholdCoal").value(thresholdCoal);
|
||||
writer.name("I:thresholdMisc").value(thresholdMisc);
|
||||
writer.name("I:thresholdFly").value(thresholdFly);
|
||||
writer.name("I:thresholdSoot").value(thresholdSoot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
if(!worldObj.isRemote) this.playersUsing++;
|
||||
@ -56,13 +91,12 @@ public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvi
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
int threshold = 2000;
|
||||
|
||||
if(processAsh(ashLevelWood, EnumAshType.WOOD, threshold)) ashLevelWood -= threshold;
|
||||
if(processAsh(ashLevelCoal, EnumAshType.COAL, threshold)) ashLevelCoal -= threshold;
|
||||
if(processAsh(ashLevelMisc, EnumAshType.MISC, threshold)) ashLevelMisc -= threshold;
|
||||
if(processAsh(ashLevelFly, EnumAshType.FLY, threshold)) ashLevelFly -= threshold;
|
||||
if(processAsh(ashLevelSoot, EnumAshType.SOOT, threshold * 4)) ashLevelSoot -= threshold * 4;
|
||||
if(processAsh(ashLevelWood, EnumAshType.WOOD, thresholdWood)) ashLevelWood -= thresholdWood;
|
||||
if(processAsh(ashLevelCoal, EnumAshType.COAL, thresholdCoal)) ashLevelCoal -= thresholdCoal;
|
||||
if(processAsh(ashLevelMisc, EnumAshType.MISC, thresholdMisc)) ashLevelMisc -= thresholdMisc;
|
||||
if(processAsh(ashLevelFly, EnumAshType.FLY, thresholdFly)) ashLevelFly -= thresholdFly;
|
||||
if(processAsh(ashLevelSoot, EnumAshType.SOOT, thresholdSoot)) ashLevelSoot -= thresholdSoot;
|
||||
|
||||
isFull = false;
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ public class TileEntityCharger extends TileEntityLoadedBase implements IEnergyRe
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IBatteryItem) {
|
||||
IBatteryItem battery = (IBatteryItem) stack.getItem();
|
||||
charge += Math.min(battery.getMaxCharge() - battery.getCharge(stack), battery.getChargeRate());
|
||||
charge += Math.min(battery.getMaxCharge(stack) - battery.getCharge(stack), battery.getChargeRate());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -127,7 +127,7 @@ public class TileEntityCharger extends TileEntityLoadedBase implements IEnergyRe
|
||||
if(stack != null && stack.getItem() instanceof IBatteryItem) {
|
||||
IBatteryItem battery = (IBatteryItem) stack.getItem();
|
||||
|
||||
long toCharge = Math.min(battery.getMaxCharge() - battery.getCharge(stack), battery.getChargeRate());
|
||||
long toCharge = Math.min(battery.getMaxCharge(stack) - battery.getCharge(stack), battery.getChargeRate());
|
||||
toCharge = Math.min(toCharge, power / 5);
|
||||
battery.chargeBattery(stack, toCharge);
|
||||
power -= toCharge;
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
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.fluid.FluidType;
|
||||
@ -14,6 +17,7 @@ import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
@ -37,10 +41,8 @@ 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, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IFluidCopiable {
|
||||
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine, IFluidCopiable {
|
||||
public long power;
|
||||
public static final long maxPower = 100000000000L;
|
||||
private int turnTimer;
|
||||
public float rotor;
|
||||
public float lastRotor;
|
||||
@ -51,16 +53,46 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
|
||||
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;
|
||||
|
||||
public TileEntityChungus() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, 1_000_000_000);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 1_000_000_000);
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||
|
||||
Random rand = new Random();
|
||||
audioDesync = rand.nextFloat() * 0.05F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "steamturbineLeviathan";
|
||||
}
|
||||
|
||||
@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("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 void updateEntity() {
|
||||
|
||||
@ -73,7 +105,7 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
boolean valid = false;
|
||||
if(in.hasTrait(FT_Coolable.class)) {
|
||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * 0.85D; //85% efficiency
|
||||
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;
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.saveddata.TomSaveData;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
@ -13,7 +18,7 @@ import api.hbm.tile.IInfoProviderEC;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
|
||||
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC, IFluidCopiable {
|
||||
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC, IConfigurableMachine, IFluidCopiable {
|
||||
|
||||
public int age = 0;
|
||||
public FluidTank[] tanks;
|
||||
@ -21,11 +26,34 @@ public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidS
|
||||
public int waterTimer = 0;
|
||||
protected int throughput;
|
||||
|
||||
//Configurable values
|
||||
public static int inputTankSize = 100;
|
||||
public static int outputTankSize = 100;
|
||||
|
||||
public TileEntityCondenser() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 100);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 100);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSize);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, outputTankSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "condenser";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
@ -16,16 +21,41 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
public class TileEntityCondenserPowered extends TileEntityCondenser implements IEnergyReceiverMK2 {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 10_000_000;
|
||||
public float spin;
|
||||
public float lastSpin;
|
||||
|
||||
//Configurable values
|
||||
public static long maxPower = 10_000_000;
|
||||
public static int inputTankSizeP = 1_000_000;
|
||||
public static int outputTankSizeP = 1_000_000;
|
||||
public static int powerConsumption = 10;
|
||||
|
||||
public TileEntityCondenserPowered() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1_000_000);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 1_000_000);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeP);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, outputTankSizeP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "condenserPowered";
|
||||
}
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSizeP = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSizeP);
|
||||
outputTankSizeP = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSizeP);
|
||||
powerConsumption = IConfigurableMachine.grab(obj, "I:powerConsumption", powerConsumption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("I:inputTankSize").value(inputTankSizeP);
|
||||
writer.name("I:outputTankSize").value(outputTankSizeP);
|
||||
writer.name("I:powerConsumption").value(powerConsumption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
@ -63,7 +93,7 @@ public class TileEntityCondenserPowered extends TileEntityCondenser implements I
|
||||
|
||||
@Override
|
||||
public void postConvert(int convert) {
|
||||
this.power -= convert * 10;
|
||||
this.power -= convert * powerConsumption;
|
||||
if(this.power < 0) this.power = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -49,8 +49,8 @@ public class TileEntityCore extends TileEntityMachineBase implements IGUIProvide
|
||||
public TileEntityCore() {
|
||||
super(3);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 128000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 128000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 128000);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 128000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -140,10 +140,8 @@ public class TileEntityCore extends TileEntityMachineBase implements IGUIProvide
|
||||
radiation();
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("tank0", tanks[0].getTankType().ordinal());
|
||||
data.setInteger("tank1", tanks[1].getTankType().ordinal());
|
||||
data.setInteger("fill0", tanks[0].getFill());
|
||||
data.setInteger("fill1", tanks[1].getFill());
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
data.setInteger("field", field);
|
||||
data.setInteger("heat", heat);
|
||||
data.setInteger("color", color);
|
||||
@ -167,10 +165,8 @@ public class TileEntityCore extends TileEntityMachineBase implements IGUIProvide
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
super.networkUnpack(data);
|
||||
|
||||
tanks[0].setTankType(Fluids.fromID(data.getInteger("tank0")));
|
||||
tanks[1].setTankType(Fluids.fromID(data.getInteger("tank1")));
|
||||
tanks[0].setFill(data.getInteger("fill0"));
|
||||
tanks[1].setFill(data.getInteger("fill1"));
|
||||
tanks[0].readFromNBT(data, "t0");
|
||||
tanks[1].readFromNBT(data, "t1");
|
||||
field = data.getInteger("field");
|
||||
heat = data.getInteger("heat");
|
||||
color = data.getInteger("color");
|
||||
|
||||
@ -53,7 +53,7 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
|
||||
public TileEntityCoreEmitter() {
|
||||
super(0);
|
||||
tank = new FluidTank(Fluids.CRYOGEL, 64000, 0);
|
||||
tank = new FluidTank(Fluids.CRYOGEL, 64000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerCoreInjector;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUICoreInjector;
|
||||
@ -28,7 +26,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 TileEntityCoreInjector extends TileEntityMachineBase implements IFluidContainer, IFluidStandardReceiver, SimpleComponent, IGUIProvider, CompatHandler.OCComponent {
|
||||
public class TileEntityCoreInjector extends TileEntityMachineBase implements IFluidStandardReceiver, SimpleComponent, IGUIProvider, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public static final int range = 15;
|
||||
@ -37,8 +35,8 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
public TileEntityCoreInjector() {
|
||||
super(4);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 128000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 128000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 128000);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 128000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,11 +101,10 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
|
||||
this.markDirty();
|
||||
|
||||
tanks[0].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
tanks[1].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("beam", beam);
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
this.networkPack(data, 250);
|
||||
}
|
||||
}
|
||||
@ -115,29 +112,18 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
super.networkUnpack(data);
|
||||
beam = data.getInteger("beam");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
tanks[0].readFromNBT(data, "t0");
|
||||
tanks[1].readFromNBT(data, "t1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerCoreReceiver;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUICoreReceiver;
|
||||
@ -33,7 +31,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 TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidContainer, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyProviderMK2, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public long joules;
|
||||
@ -41,7 +39,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
|
||||
public TileEntityCoreReceiver() {
|
||||
super(0);
|
||||
tank = new FluidTank(Fluids.CRYOGEL, 64000, 0);
|
||||
tank = new FluidTank(Fluids.CRYOGEL, 64000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -54,7 +52,6 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
this.subscribeToAllAround(tank.getTankType(), this);
|
||||
|
||||
power = joules * 5000;
|
||||
@ -74,6 +71,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("joules", joules);
|
||||
tank.writeToNBT(data, "t");
|
||||
this.networkPack(data, 50);
|
||||
|
||||
joules = 0;
|
||||
@ -83,6 +81,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
super.networkUnpack(data);
|
||||
joules = data.getLong("joules");
|
||||
tank.readFromNBT(data, "t");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -105,16 +104,6 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
return this.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir) {
|
||||
|
||||
|
||||
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