Merge remote-tracking branch 'upstream/master' into RBMK_optimization
# Conflicts: # src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java
@ -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
|
## 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.
|
* 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.
|
* `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`.
|
* 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.
|
* Adding tooltips to more machines, explaining some of the basics.
|
||||||
|
|||||||
22
changelog
@ -1,16 +1,12 @@
|
|||||||
## Changed
|
## Changed
|
||||||
* To address certain balancing concerns, the RF to HE conversion rate is now 2:5. The HE to RF rate however is still 5:1
|
* Changed the multi fluid ID recipe, they now use analog circuits instead of silicon based ones, no longer requiring plastic to make
|
||||||
* Because of this, using chains of converters as batteries becomes exponentially lossy with size, therefore the input decay has been removed
|
* 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
|
||||||
* Input decay can still be configured if desired
|
* Capacitors have also been nerfed but they are twice as fast as battery blocks, 5 seconds for charging and 15 seconds for discharging
|
||||||
* No input decay also means that converters are no longer infinite energy sinks
|
* Removed forgotten bricks
|
||||||
* Power converter recipes have been updated
|
* Updated CMB brick texture
|
||||||
* Soldering stations will no longer work if the recipe requires no input fluid while fluid is present
|
* The ICF machine block now renders with its 3d model in the creative inventory
|
||||||
* While this does complicate using the soldering station manually, as switching from milgrade to standard ICs requires emptying the solderer with a siphon, it does make automating easier, since soldering stations will no longer treat incomplete milgrade circuits as ICs
|
|
||||||
* Cement is now edible
|
|
||||||
* Derricks have been remodeled, the port configuration has changed so existing derricks need to be replaced
|
|
||||||
* Derricks no longer spawn oil spills
|
|
||||||
* Metal deco blocks are now crafted in batches of 4, as well as recycled in batches of 4. Each block is therefore still worth 25% of an ingot, but recycling your own deco blocks is no longer lossy
|
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
* Fixed some machines not sending fluid gauge syncs properly
|
* Fixed pumpjack gauges not syncing properly
|
||||||
* Fixed refinery GUI crashing when invalid input is used
|
* Fixed some concrete variants not being revertable into uncolored concrete
|
||||||
|
* Fixed the ore density scanner not using proper translations for the HUD
|
||||||
@ -10,7 +10,7 @@ public interface IBatteryItem {
|
|||||||
public void setCharge(ItemStack stack, long i);
|
public void setCharge(ItemStack stack, long i);
|
||||||
public void dischargeBattery(ItemStack stack, long i);
|
public void dischargeBattery(ItemStack stack, long i);
|
||||||
public long getCharge(ItemStack stack);
|
public long getCharge(ItemStack stack);
|
||||||
public long getMaxCharge();
|
public long getMaxCharge(ItemStack stack);
|
||||||
public long getChargeRate();
|
public long getChargeRate();
|
||||||
public long getDischargeRate();
|
public long getDischargeRate();
|
||||||
|
|
||||||
|
|||||||
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
@ -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
@ -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
|
||||||
|
|
||||||
|
*/
|
||||||
@ -388,7 +388,6 @@ public class ModBlocks {
|
|||||||
public static Block brick_jungle_glyph;
|
public static Block brick_jungle_glyph;
|
||||||
public static Block brick_jungle_circle;
|
public static Block brick_jungle_circle;
|
||||||
|
|
||||||
public static Block brick_forgotten;
|
|
||||||
public static Block brick_red;
|
public static Block brick_red;
|
||||||
|
|
||||||
public static Block deco_computer;
|
public static Block deco_computer;
|
||||||
@ -1005,6 +1004,7 @@ public class ModBlocks {
|
|||||||
|
|
||||||
public static Block machine_turbofan;
|
public static Block machine_turbofan;
|
||||||
public static Block machine_turbinegas;
|
public static Block machine_turbinegas;
|
||||||
|
public static Block machine_lpw2;
|
||||||
|
|
||||||
public static Block press_preheater;
|
public static Block press_preheater;
|
||||||
public static Block machine_press;
|
public static Block machine_press;
|
||||||
@ -1562,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_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_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);
|
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");
|
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");
|
||||||
@ -2184,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_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_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_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");
|
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_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");
|
machine_epress = new MachineEPress(Material.iron).setBlockName("machine_epress").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_epress");
|
||||||
@ -2719,7 +2719,6 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(brick_jungle_trap, ItemTrapBlock.class, brick_jungle_trap.getUnlocalizedName());
|
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_glyph, ItemGlyphBlock.class, brick_jungle_glyph.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(brick_jungle_circle, brick_jungle_circle.getUnlocalizedName());
|
GameRegistry.registerBlock(brick_jungle_circle, brick_jungle_circle.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(brick_forgotten, brick_forgotten.getUnlocalizedName());
|
|
||||||
GameRegistry.registerBlock(brick_red, brick_red.getUnlocalizedName());
|
GameRegistry.registerBlock(brick_red, brick_red.getUnlocalizedName());
|
||||||
register(deco_computer);
|
register(deco_computer);
|
||||||
register(deco_crt);
|
register(deco_crt);
|
||||||
@ -3238,6 +3237,7 @@ public class ModBlocks {
|
|||||||
register(barricade);
|
register(barricade);
|
||||||
register(machine_turbofan);
|
register(machine_turbofan);
|
||||||
register(machine_turbinegas);
|
register(machine_turbinegas);
|
||||||
|
register(machine_lpw2);
|
||||||
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(teleanchor, teleanchor.getUnlocalizedName());
|
GameRegistry.registerBlock(teleanchor, teleanchor.getUnlocalizedName());
|
||||||
|
|||||||
@ -67,7 +67,7 @@ public class HEVBattery extends Block {
|
|||||||
|
|
||||||
if(st.getItem() instanceof IBatteryItem) {
|
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 charge = ((IBatteryItem) st.getItem()).getCharge(st);
|
||||||
long newcharge = Math.min(charge + 150000, maxcharge);
|
long newcharge = Math.min(charge + 150000, maxcharge);
|
||||||
|
|
||||||
|
|||||||
@ -280,6 +280,9 @@ public class MachineBattery extends BlockContainer implements ILookOverlay, IPer
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
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");
|
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
|
@Override
|
||||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
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");
|
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;
|
return maxPower;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public long getProviderSpeed() {
|
||||||
|
return this.getMaxPower() / 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public long getReceiverSpeed() {
|
||||||
|
return this.getMaxPower() / 100;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ConnectionPriority getPriority() {
|
public ConnectionPriority getPriority() {
|
||||||
return ConnectionPriority.LOW;
|
return ConnectionPriority.LOW;
|
||||||
|
|||||||
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -18,6 +18,9 @@ public class ArmorModHandler {
|
|||||||
public static final int cladding = 5;
|
public static final int cladding = 5;
|
||||||
public static final int kevlar = 6;
|
public static final int kevlar = 6;
|
||||||
public static final int extra = 7;
|
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[] {
|
public static final UUID[] UUIDs = new UUID[] {
|
||||||
UUID.fromString("8d6e5c77-133e-4056-9c80-a9e42a1a0b65"),
|
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
|
* @param armor
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -146,7 +149,7 @@ public class ArmorModHandler {
|
|||||||
|
|
||||||
public static ItemStack[] pryMods(ItemStack armor) {
|
public static ItemStack[] pryMods(ItemStack armor) {
|
||||||
|
|
||||||
ItemStack[] slots = new ItemStack[8];
|
ItemStack[] slots = new ItemStack[MOD_SLOTS];
|
||||||
|
|
||||||
if(!hasMods(armor))
|
if(!hasMods(armor))
|
||||||
return slots;
|
return slots;
|
||||||
@ -154,7 +157,7 @@ public class ArmorModHandler {
|
|||||||
NBTTagCompound nbt = armor.getTagCompound();
|
NBTTagCompound nbt = armor.getTagCompound();
|
||||||
NBTTagCompound mods = nbt.getCompoundTag(MOD_COMPOUND_KEY);
|
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);
|
NBTTagCompound cmp = mods.getCompoundTag(MOD_SLOT_KEY + i);
|
||||||
|
|
||||||
@ -168,4 +171,22 @@ public class ArmorModHandler {
|
|||||||
|
|
||||||
return slots;
|
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;
|
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.FluidType;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
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 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.Arguments;
|
||||||
import li.cil.oc.api.machine.Context;
|
import li.cil.oc.api.machine.Context;
|
||||||
import li.cil.oc.api.network.*;
|
import li.cil.oc.api.network.*;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.ChatComponentTranslation;
|
|
||||||
import net.minecraft.util.ChatStyle;
|
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
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.
|
* General handler for OpenComputers compatibility.
|
||||||
@ -23,13 +32,29 @@ import java.lang.reflect.Array;
|
|||||||
*/
|
*/
|
||||||
public class CompatHandler {
|
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) {
|
public static Object[] steamTypeToInt(FluidType type) {
|
||||||
if(type == Fluids.STEAM) {return new Object[] {0};}
|
switch(type.getID()) {
|
||||||
else if(type == Fluids.HOTSTEAM) {return new Object[] {1};}
|
default:
|
||||||
else if(type == Fluids.SUPERHOTSTEAM) {return new Object[] {2};}
|
return new Object[] {0};
|
||||||
return new Object[] {3};
|
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) {
|
public static FluidType intToSteamType(int arg) {
|
||||||
switch(arg) {
|
switch(arg) {
|
||||||
default:
|
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.
|
* 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>
|
* <br>
|
||||||
@ -54,11 +207,10 @@ public class CompatHandler {
|
|||||||
@Optional.InterfaceList({
|
@Optional.InterfaceList({
|
||||||
@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
|
@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.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"),
|
@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
|
@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".
|
* Must be overridden in the implemented TE, or it will default to "ntm_null".
|
||||||
@ -69,7 +221,7 @@ public class CompatHandler {
|
|||||||
@Override
|
@Override
|
||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "OpenComputers")
|
||||||
default String getComponentName() {
|
default String getComponentName() {
|
||||||
return "ntm_null";
|
return nullComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,31 +235,6 @@ public class CompatHandler {
|
|||||||
return true;
|
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}.
|
* 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.
|
* @return Array of methods to expose to the computer.
|
||||||
|
|||||||
@ -161,7 +161,7 @@ public class RefineryRecipeHandler extends TemplateRecipeHandler implements ICom
|
|||||||
transferRectsGui = new LinkedList<RecipeTransferRect>();
|
transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||||
guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||||
|
|
||||||
transferRects.add(new RecipeTransferRect(new Rectangle(48, 5, 31, 101), "refinery"));
|
transferRects.add(new RecipeTransferRect(new Rectangle(138 - 1 - 36 - 27, 23, 36, 18), "refinery"));
|
||||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(48, 5, 31, 101), "refinery"));
|
transferRectsGui.add(new RecipeTransferRect(new Rectangle(48, 5, 31, 101), "refinery"));
|
||||||
guiGui.add(GUIMachineRefinery.class);
|
guiGui.add(GUIMachineRefinery.class);
|
||||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||||
|
|||||||
@ -19,20 +19,21 @@ import net.minecraft.util.IIcon;
|
|||||||
|
|
||||||
public class ContainerArmorTable extends Container {
|
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 IInventory armor = new InventoryCraftResult();
|
||||||
|
|
||||||
public ContainerArmorTable(InventoryPlayer inventory) {
|
public ContainerArmorTable(InventoryPlayer inventory) {
|
||||||
EntityPlayer player = inventory.player;
|
EntityPlayer player = inventory.player;
|
||||||
|
|
||||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.helmet_only, 26 + 22, 27)); // helmet only
|
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.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.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.servos, 134 + 22, 81)); //servos/frame
|
||||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.cladding, 98 + 22, 99)); //radiation cladding
|
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.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) {
|
this.addSlotToContainer(new Slot(armor, 0, 44 + 22, 63) {
|
||||||
|
|
||||||
@ -48,7 +49,7 @@ public class ContainerArmorTable extends Container {
|
|||||||
if(stack != null) {
|
if(stack != null) {
|
||||||
ItemStack[] mods = ArmorModHandler.pryMods(stack);
|
ItemStack[] mods = ArmorModHandler.pryMods(stack);
|
||||||
|
|
||||||
for(int i = 0; i < 8; i++) {
|
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
|
||||||
|
|
||||||
if(mods != null)
|
if(mods != null)
|
||||||
upgrades.setInventorySlotContents(i, mods[i]);
|
upgrades.setInventorySlotContents(i, mods[i]);
|
||||||
@ -65,7 +66,7 @@ public class ContainerArmorTable extends Container {
|
|||||||
|
|
||||||
//if the armor piece is taken, absorb all armor pieces
|
//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);
|
ItemStack mod = upgrades.getStackInSlot(i);
|
||||||
|
|
||||||
@ -126,19 +127,19 @@ public class ContainerArmorTable extends Container {
|
|||||||
ItemStack var5 = var4.getStack();
|
ItemStack var5 = var4.getStack();
|
||||||
var3 = var5.copy();
|
var3 = var5.copy();
|
||||||
|
|
||||||
if(par2 <= 8) {
|
if(par2 <= ArmorModHandler.MOD_SLOTS) {
|
||||||
if(par2 != 8 || !InventoryUtil.mergeItemStack(this.inventorySlots, var5, 9, 13, false))
|
if(par2 != ArmorModHandler.MOD_SLOTS || !InventoryUtil.mergeItemStack(this.inventorySlots, var5, ArmorModHandler.MOD_SLOTS + 1, ArmorModHandler.MOD_SLOTS + 5, false))
|
||||||
if(!this.mergeItemStack(var5, 13, this.inventorySlots.size(), true))
|
if(!this.mergeItemStack(var5, ArmorModHandler.MOD_SLOTS + 5, this.inventorySlots.size(), true))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var4.onPickupFromSlot(p_82846_1_, var5);
|
var4.onPickupFromSlot(p_82846_1_, var5);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(var5.getItem() instanceof ItemArmor) {
|
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;
|
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();
|
ItemArmorMod mod = (ItemArmorMod)var5.getItem();
|
||||||
int slot = mod.type;
|
int slot = mod.type;
|
||||||
|
|||||||
@ -46,15 +46,16 @@ public class GUIArmorTable extends GuiInfoContainer {
|
|||||||
"armorMod.type.cladding",
|
"armorMod.type.cladding",
|
||||||
"armorMod.type.insert",
|
"armorMod.type.insert",
|
||||||
"armorMod.type.special",
|
"armorMod.type.special",
|
||||||
|
"armorMod.type.battery",
|
||||||
"armorMod.insertHere"
|
"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);
|
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||||
|
|
||||||
if(this.isMouseOverSlot(slot, x, y) && !slot.getHasStack()) {
|
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 + 22, guiTop, 0, 0, this.xSize - 22, this.ySize);
|
||||||
this.drawTexturedModalRect(guiLeft, guiTop + 31, 176, 96, 22, 100);
|
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) {
|
if(armor != null) {
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ public class GUIArmorTable extends GuiInfoContainer {
|
|||||||
this.drawTexturedModalRect(guiLeft + 41 + 22, guiTop + 60, 176, 52, 22, 22);
|
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);
|
Slot slot = this.inventorySlots.getSlot(i);
|
||||||
drawIndicator(i, slot.xDisplayPosition - 1, slot.yDisplayPosition - 1);
|
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) {
|
private void drawIndicator(int index, int x, int y) {
|
||||||
|
|
||||||
ItemStack mod = this.inventorySlots.getSlot(index).getStack();
|
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)
|
if(mod == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
|||||||
super(new ContainerMachineRefinery(invPlayer, tedf));
|
super(new ContainerMachineRefinery(invPlayer, tedf));
|
||||||
refinery = tedf;
|
refinery = tedf;
|
||||||
|
|
||||||
this.xSize = 209;
|
this.xSize = 210;
|
||||||
this.ySize = 231;
|
this.ySize = 231;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,12 +85,17 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
|||||||
|
|
||||||
Tuple.Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> recipe = RefineryRecipes.getRefinery(inputOil.getTankType());
|
Tuple.Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> recipe = RefineryRecipes.getRefinery(inputOil.getTankType());
|
||||||
|
|
||||||
if(recipe != null) {
|
if(recipe == null) {
|
||||||
|
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
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
|
// Heavy Oil Products
|
||||||
Color color = new Color(recipe.getV().type.getColor());
|
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);
|
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);
|
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
|
||||||
|
|
||||||
@ -109,11 +114,10 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
|||||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
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);
|
func_146110_a(guiLeft + 36, guiTop + 16, 211, 119, 122, 25, 350, 256);
|
||||||
|
|
||||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// output tanks
|
// output tanks
|
||||||
refinery.tanks[1].renderTank(guiLeft + 86, guiTop + 95, this.zLevel, 16, 52);
|
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[2].renderTank(guiLeft + 106, guiTop + 95, this.zLevel, 16, 52);
|
||||||
|
|||||||
@ -2178,6 +2178,9 @@ public class ModItems {
|
|||||||
public static Item card_aos;
|
public static Item card_aos;
|
||||||
public static Item card_qos;
|
public static Item card_qos;
|
||||||
public static Item australium_iii;
|
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_helmet;
|
||||||
public static Item hazmat_plate;
|
public static Item hazmat_plate;
|
||||||
@ -3357,6 +3360,9 @@ public class ModItems {
|
|||||||
card_aos = new ItemModCard().setUnlocalizedName("card_aos").setTextureName(RefStrings.MODID + ":card_aos");
|
card_aos = new ItemModCard().setUnlocalizedName("card_aos").setTextureName(RefStrings.MODID + ":card_aos");
|
||||||
card_qos = new ItemModCard().setUnlocalizedName("card_qos").setTextureName(RefStrings.MODID + ":card_qos");
|
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");
|
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_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");
|
cap_quantum = new Item().setUnlocalizedName("cap_quantum").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_quantum");
|
||||||
@ -7402,6 +7408,9 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(card_aos, card_aos.getUnlocalizedName());
|
GameRegistry.registerItem(card_aos, card_aos.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(card_qos, card_qos.getUnlocalizedName());
|
GameRegistry.registerItem(card_qos, card_qos.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(australium_iii, australium_iii.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
|
//Chaos
|
||||||
GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName());
|
GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName());
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.hbm.items.armor;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.handler.ArmorModHandler;
|
||||||
import com.hbm.util.BobMathUtil;
|
import com.hbm.util.BobMathUtil;
|
||||||
|
|
||||||
import api.hbm.energymk2.IBatteryItem;
|
import api.hbm.energymk2.IBatteryItem;
|
||||||
@ -30,9 +31,7 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
|||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||||
|
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(getMaxCharge(stack)));
|
||||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
|
|
||||||
|
|
||||||
super.addInformation(stack, player, list, ext);
|
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);
|
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
|
||||||
} else {
|
} else {
|
||||||
stack.stackTagCompound = new NBTTagCompound();
|
stack.stackTagCompound = new NBTTagCompound();
|
||||||
stack.stackTagCompound.setLong("charge", this.maxPower - i);
|
stack.stackTagCompound.setLong("charge", getMaxCharge(stack) - i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(stack.stackTagCompound.getLong("charge") < 0)
|
if(stack.stackTagCompound.getLong("charge") < 0)
|
||||||
@ -84,10 +83,10 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
|||||||
public long getCharge(ItemStack stack) {
|
public long getCharge(ItemStack stack) {
|
||||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||||
if(stack.hasTagCompound()) {
|
if(stack.hasTagCompound()) {
|
||||||
return stack.stackTagCompound.getLong("charge");
|
return Math.min(stack.stackTagCompound.getLong("charge"), getMaxCharge(stack));
|
||||||
} else {
|
} else {
|
||||||
stack.stackTagCompound = new NBTTagCompound();
|
stack.stackTagCompound = new NBTTagCompound();
|
||||||
stack.stackTagCompound.setLong("charge", ((ArmorFSBPowered) stack.getItem()).maxPower);
|
stack.stackTagCompound.setLong("charge", getMaxCharge(stack));
|
||||||
return stack.stackTagCompound.getLong("charge");
|
return stack.stackTagCompound.getLong("charge");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,18 +96,23 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean showDurabilityBar(ItemStack stack) {
|
public boolean showDurabilityBar(ItemStack stack) {
|
||||||
|
return getCharge(stack) < getMaxCharge(stack);
|
||||||
return getCharge(stack) < maxPower;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getDurabilityForDisplay(ItemStack stack) {
|
public double getDurabilityForDisplay(ItemStack stack) {
|
||||||
|
|
||||||
return 1 - (double) getCharge(stack) / (double) maxPower;
|
return 1 - (double) getCharge(stack) / (double) getMaxCharge(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
return maxPower;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,7 @@ public class ArmorHEV extends ArmorFSBPowered {
|
|||||||
ItemStack armor = player.inventory.armorInventory[i];
|
ItemStack armor = player.inventory.armorInventory[i];
|
||||||
ArmorFSBPowered item = ((ArmorFSBPowered) player.inventory.armorInventory[i].getItem());
|
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);
|
int aX = (int) (70 / scale);
|
||||||
|
|||||||
@ -64,6 +64,7 @@ public class ItemArmorMod extends Item {
|
|||||||
case ArmorModHandler.cladding: list.add(" " + I18nUtil.resolveKey("armorMod.type.cladding")); break;
|
case ArmorModHandler.cladding: list.add(" " + I18nUtil.resolveKey("armorMod.type.cladding")); break;
|
||||||
case ArmorModHandler.kevlar: list.add(" " + I18nUtil.resolveKey("armorMod.type.insert")); 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.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
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -30,7 +30,7 @@ public class ItemPancake extends ItemFood {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(st.getItem() instanceof IBatteryItem) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getMaxCharge() {
|
@Override
|
||||||
|
public long getMaxCharge(ItemStack stack) {
|
||||||
return maxCharge;
|
return maxCharge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getChargeRate() {
|
public long getChargeRate() {
|
||||||
return chargeRate;
|
return chargeRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getDischargeRate() {
|
public long getDischargeRate() {
|
||||||
return dischargeRate;
|
return dischargeRate;
|
||||||
}
|
}
|
||||||
@ -134,7 +137,7 @@ public class ItemBattery extends Item implements IBatteryItem {
|
|||||||
if(item instanceof ItemBattery) {
|
if(item instanceof ItemBattery) {
|
||||||
ItemStack stack = new ItemStack(item);
|
ItemStack stack = new ItemStack(item);
|
||||||
stack.stackTagCompound = new NBTTagCompound();
|
stack.stackTagCompound = new NBTTagCompound();
|
||||||
stack.stackTagCompound.setLong("charge", ((ItemBattery) item).getMaxCharge());
|
stack.stackTagCompound.setLong("charge", ((ItemBattery) item).getMaxCharge(stack));
|
||||||
return stack.copy();
|
return stack.copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +149,7 @@ public class ItemBattery extends Item implements IBatteryItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double getDurabilityForDisplay(ItemStack stack) {
|
public double getDurabilityForDisplay(ItemStack stack) {
|
||||||
return 1D - (double) getCharge(stack) / (double) getMaxCharge();
|
return 1D - (double) getCharge(stack) / (double) getMaxCharge(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public class ItemSelfcharger extends Item implements IBatteryItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getMaxCharge() {
|
public long getMaxCharge(ItemStack stack) {
|
||||||
return charge;
|
return charge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -241,7 +241,7 @@ public class ItemGlitch extends Item implements IBatteryItem {
|
|||||||
@Override public void setCharge(ItemStack stack, long i) { }
|
@Override public void setCharge(ItemStack stack, long i) { }
|
||||||
@Override public void dischargeBattery(ItemStack stack, long i) { }
|
@Override public void dischargeBattery(ItemStack stack, long i) { }
|
||||||
@Override public long getCharge(ItemStack stack) { return 200; }
|
@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 getChargeRate() { return 0; }
|
||||||
@Override public long getDischargeRate() { return 200; }
|
@Override public long getDischargeRate() { return 200; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public class ItemPotatos extends ItemBattery {
|
|||||||
|
|
||||||
if(p.getHeldItem() == stack) {
|
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);
|
world.playSoundAtEntity(p, "hbm:potatos.random", 1.0F, pitch);
|
||||||
setTimer(stack, 200 + itemRand.nextInt(100));
|
setTimer(stack, 200 + itemRand.nextInt(100));
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public class ItemFusionCore extends Item {
|
|||||||
|
|
||||||
if(st.getItem() instanceof IBatteryItem) {
|
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 charge = ((IBatteryItem) st.getItem()).getCharge(st);
|
||||||
long newcharge = Math.min(charge + this.charge, maxcharge);
|
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.items.special.ItemBedrockOreNew.BedrockOreType;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
import com.hbm.packet.PlayerInformPacket;
|
import com.hbm.packet.PlayerInformPacket;
|
||||||
|
import com.hbm.util.ChatBuilder;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.util.StatCollector;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemOreDensityScanner extends Item {
|
public class ItemOreDensityScanner extends Item {
|
||||||
@ -25,18 +25,31 @@ public class ItemOreDensityScanner extends Item {
|
|||||||
for(BedrockOreType type : BedrockOreType.values()) {
|
for(BedrockOreType type : BedrockOreType.values()) {
|
||||||
double level = ItemBedrockOreBase.getOreLevel((int) Math.floor(player.posX), (int) Math.floor(player.posZ), type);
|
double level = ItemBedrockOreBase.getOreLevel((int) Math.floor(player.posX), (int) Math.floor(player.posZ), type);
|
||||||
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(
|
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);
|
777 + type.ordinal(), 4000), player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String translateDensity(double density) {
|
public static String translateDensity(double density) {
|
||||||
if(density <= 0.1) return EnumChatFormatting.DARK_RED + "Very poor";
|
if(density <= 0.1) return "item.ore_density_scanner.verypoor";
|
||||||
if(density <= 0.35) return EnumChatFormatting.RED + "Poor";
|
if(density <= 0.35) return "item.ore_density_scanner.poor";
|
||||||
if(density <= 0.75) return EnumChatFormatting.GOLD + "Low";
|
if(density <= 0.75) return "item.ore_density_scanner.low";
|
||||||
if(density >= 1.9) return EnumChatFormatting.AQUA + "Excellent";
|
if(density >= 1.9) return "item.ore_density_scanner.excellent";
|
||||||
if(density >= 1.65) return EnumChatFormatting.BLUE + "Very high";
|
if(density >= 1.65) return "item.ore_density_scanner.veryhigh";
|
||||||
if(density >= 1.25) return EnumChatFormatting.GREEN + "High";
|
if(density >= 1.25) return "item.ore_density_scanner.high";
|
||||||
return EnumChatFormatting.YELLOW + "Moderate";
|
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
|
@Override
|
||||||
public long getMaxCharge() {
|
public long getMaxCharge(ItemStack stack) {
|
||||||
return maxPower;
|
return maxPower;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -102,7 +102,7 @@ public class ItemToolAbilityPower extends ItemToolAbility implements IBatteryIte
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getMaxCharge() {
|
public long getMaxCharge(ItemStack stack) {
|
||||||
return maxPower;
|
return maxPower;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -181,7 +181,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double getDurabilityForDisplay(ItemStack stack) {
|
public double getDurabilityForDisplay(ItemStack stack) {
|
||||||
return 1D - (double) getCharge(stack) / (double) getMaxCharge();
|
return 1D - (double) getCharge(stack) / (double) getMaxCharge(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -236,7 +236,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getMaxCharge() {
|
public long getMaxCharge(ItemStack stack) {
|
||||||
return mainConfig.maxCharge;
|
return mainConfig.maxCharge;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
|
|||||||
|
|
||||||
ItemStack stack = new ItemStack(item);
|
ItemStack stack = new ItemStack(item);
|
||||||
stack.stackTagCompound = new NBTTagCompound();
|
stack.stackTagCompound = new NBTTagCompound();
|
||||||
stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase) item).getMaxCharge());
|
stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase) item).getMaxCharge(stack));
|
||||||
|
|
||||||
list.add(stack);
|
list.add(stack);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,7 +243,7 @@ public class Library {
|
|||||||
|
|
||||||
IBatteryItem battery = (IBatteryItem) slots[index].getItem();
|
IBatteryItem battery = (IBatteryItem) slots[index].getItem();
|
||||||
|
|
||||||
long batMax = battery.getMaxCharge();
|
long batMax = battery.getMaxCharge(slots[index]);
|
||||||
long batCharge = battery.getCharge(slots[index]);
|
long batCharge = battery.getCharge(slots[index]);
|
||||||
long batRate = battery.getChargeRate();
|
long batRate = battery.getChargeRate();
|
||||||
long toCharge = Math.min(Math.min(power, batRate), batMax - batCharge);
|
long toCharge = Math.min(Math.min(power, batRate), batMax - batCharge);
|
||||||
|
|||||||
@ -257,6 +257,7 @@ public class ClientProxy extends ServerProxy {
|
|||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFrackingTower.class, new RenderFrackingTower());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFrackingTower.class, new RenderFrackingTower());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbofan.class, new RenderTurbofan());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbofan.class, new RenderTurbofan());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbineGas.class, new RenderTurbineGas());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbineGas.class, new RenderTurbineGas());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLPW2.class, new RenderLPW2());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePress.class, new RenderPress());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePress.class, new RenderPress());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());
|
||||||
|
|||||||
@ -408,8 +408,8 @@ public class CraftingManager {
|
|||||||
String dyeName = "dye" + dyes[15 - i];
|
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 });
|
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[] { new ItemStack(ModBlocks.concrete_colored, 1, OreDictionary.WILDCARD_VALUE) });
|
||||||
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_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.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 });
|
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 });
|
||||||
@ -938,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), 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.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(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) });
|
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 });
|
addRecipeAuto(new ItemStack(ModBlocks.teleanchor), new Object[] { "ODO", "EAE", "ODO", 'O', Blocks.obsidian, 'D', DIAMOND.gem(), 'E', ModItems.powder_magic, 'A', ModItems.gem_alexandrite });
|
||||||
|
|||||||
@ -878,6 +878,9 @@ public class MainRegistry {
|
|||||||
|
|
||||||
BlockMotherOfAllOres.init();
|
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)
|
//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);
|
World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75);
|
||||||
|
|
||||||
@ -1418,6 +1421,7 @@ public class MainRegistry {
|
|||||||
ignoreMappings.add("hbm:item.gas6");
|
ignoreMappings.add("hbm:item.gas6");
|
||||||
ignoreMappings.add("hbm:item.gas7");
|
ignoreMappings.add("hbm:item.gas7");
|
||||||
ignoreMappings.add("hbm:item.gas8");
|
ignoreMappings.add("hbm:item.gas8");
|
||||||
|
ignoreMappings.add("hbm:tile.brick_forgotten");
|
||||||
|
|
||||||
/// REMAP ///
|
/// REMAP ///
|
||||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||||
|
|||||||
@ -233,6 +233,9 @@ public class ResourceManager {
|
|||||||
//ICF
|
//ICF
|
||||||
public static final IModelCustom icf = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/icf.obj")).asVBO();
|
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
|
//Watz
|
||||||
public static final IModelCustom watz = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/watz.obj")).asVBO();
|
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();
|
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
|
//ICF
|
||||||
public static final ResourceLocation icf_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/icf.png");
|
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
|
//Watz
|
||||||
public static final ResourceLocation watz_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz.png");
|
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");
|
public static final ResourceLocation watz_pump_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz_pump.png");
|
||||||
|
|||||||
@ -3,12 +3,16 @@ package com.hbm.render.tileentity;
|
|||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
|
import com.hbm.render.item.ItemRenderBase;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
|
|
||||||
public class RenderICF extends TileEntitySpecialRenderer {
|
public class RenderICF extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||||
@ -34,4 +38,26 @@ public class RenderICF extends TileEntitySpecialRenderer {
|
|||||||
|
|
||||||
GL11.glPopMatrix();
|
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
@ -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,6 +1,7 @@
|
|||||||
package com.hbm.tileentity;
|
package com.hbm.tileentity;
|
||||||
|
|
||||||
import api.hbm.block.ICrucibleAcceptor;
|
import api.hbm.block.ICrucibleAcceptor;
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.handler.CompatHandler.OCComponent;
|
import com.hbm.handler.CompatHandler.OCComponent;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
|
|
||||||
@ -8,6 +9,7 @@ import api.hbm.energymk2.IEnergyReceiverMK2;
|
|||||||
import api.hbm.fluid.IFluidConnector;
|
import api.hbm.fluid.IFluidConnector;
|
||||||
import api.hbm.tile.IHeatSource;
|
import api.hbm.tile.IHeatSource;
|
||||||
import com.hbm.inventory.material.Mats;
|
import com.hbm.inventory.material.Mats;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.Optional;
|
import cpw.mods.fml.common.Optional;
|
||||||
import li.cil.oc.api.machine.Arguments;
|
import li.cil.oc.api.machine.Arguments;
|
||||||
import li.cil.oc.api.machine.Context;
|
import li.cil.oc.api.machine.Context;
|
||||||
@ -33,6 +35,10 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
|||||||
boolean heat;
|
boolean heat;
|
||||||
public boolean moltenMetal;
|
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() { }
|
||||||
|
|
||||||
public TileEntityProxyCombo(boolean inventory, boolean power, boolean fluid) {
|
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.fluid = nbt.getBoolean("fluid");
|
||||||
this.moltenMetal = nbt.getBoolean("metal");
|
this.moltenMetal = nbt.getBoolean("metal");
|
||||||
this.heat = nbt.getBoolean("heat");
|
this.heat = nbt.getBoolean("heat");
|
||||||
|
if(Loader.isModLoaded("OpenComputers"))
|
||||||
|
this.componentName = nbt.getString("ocname");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -355,6 +364,8 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
|||||||
nbt.setBoolean("fluid", fluid);
|
nbt.setBoolean("fluid", fluid);
|
||||||
nbt.setBoolean("metal", moltenMetal);
|
nbt.setBoolean("metal", moltenMetal);
|
||||||
nbt.setBoolean("heat", heat);
|
nbt.setBoolean("heat", heat);
|
||||||
|
if(Loader.isModLoaded("OpenComputers"))
|
||||||
|
nbt.setString("ocname", componentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -452,27 +463,27 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
|||||||
@Override // please work
|
@Override // please work
|
||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "OpenComputers")
|
||||||
public String getComponentName() {
|
public String getComponentName() {
|
||||||
if(this.getTile() instanceof OCComponent)
|
if(this.worldObj == null) // OC is going too fast, grab from NBT!
|
||||||
return ((OCComponent) this.getTile()).getComponentName();
|
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();
|
return OCComponent.super.getComponentName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "OpenComputers")
|
||||||
public boolean canConnectNode(ForgeDirection side) { //thank you vaer
|
public boolean canConnectNode(ForgeDirection side) {
|
||||||
if(this.getTile() instanceof OCComponent)
|
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);
|
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
|
@Override
|
||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "OpenComputers")
|
||||||
public String[] methods() {
|
public String[] methods() {
|
||||||
|
|||||||
@ -95,6 +95,7 @@ public class TileMappings {
|
|||||||
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
|
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
|
||||||
put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
|
put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
|
||||||
put(TileEntityMachineTurbineGas.class, "tileentity_machine_gasturbine");
|
put(TileEntityMachineTurbineGas.class, "tileentity_machine_gasturbine");
|
||||||
|
put(TileEntityMachineLPW2.class, "tileentity_machine_lpw2");
|
||||||
put(TileEntityCrateTemplate.class, "tileentity_crate_template");
|
put(TileEntityCrateTemplate.class, "tileentity_crate_template");
|
||||||
put(TileEntityCrateIron.class, "tileentity_crate_iron");
|
put(TileEntityCrateIron.class, "tileentity_crate_iron");
|
||||||
put(TileEntityCrateSteel.class, "tileentity_crate_steel");
|
put(TileEntityCrateSteel.class, "tileentity_crate_steel");
|
||||||
|
|||||||
@ -103,12 +103,12 @@ public class TileEntityNukeBalefire extends TileEntityMachineBase implements IGU
|
|||||||
public int getBattery() {
|
public int getBattery() {
|
||||||
|
|
||||||
if(slots[1] != null && slots[1].getItem() == ModItems.battery_spark &&
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slots[1] != null && slots[1].getItem() == ModItems.battery_trixite &&
|
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;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,15 @@
|
|||||||
package com.hbm.tileentity.machine;
|
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.OreDictManager.DictFrame;
|
||||||
import com.hbm.inventory.container.ContainerAshpit;
|
import com.hbm.inventory.container.ContainerAshpit;
|
||||||
import com.hbm.inventory.gui.GUIAshpit;
|
import com.hbm.inventory.gui.GUIAshpit;
|
||||||
import com.hbm.items.ItemEnums.EnumAshType;
|
import com.hbm.items.ItemEnums.EnumAshType;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
import com.hbm.tileentity.IGUIProvider;
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
import com.hbm.tileentity.TileEntityMachineBase;
|
import com.hbm.tileentity.TileEntityMachineBase;
|
||||||
|
|
||||||
@ -19,7 +24,7 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvider {
|
public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvider, IConfigurableMachine {
|
||||||
|
|
||||||
private int playersUsing = 0;
|
private int playersUsing = 0;
|
||||||
public float doorAngle = 0;
|
public float doorAngle = 0;
|
||||||
@ -32,10 +37,40 @@ public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvi
|
|||||||
public int ashLevelFly;
|
public int ashLevelFly;
|
||||||
public int ashLevelSoot;
|
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() {
|
public TileEntityAshpit() {
|
||||||
super(5);
|
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
|
@Override
|
||||||
public void openInventory() {
|
public void openInventory() {
|
||||||
if(!worldObj.isRemote) this.playersUsing++;
|
if(!worldObj.isRemote) this.playersUsing++;
|
||||||
@ -56,13 +91,12 @@ public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvi
|
|||||||
|
|
||||||
if(!worldObj.isRemote) {
|
if(!worldObj.isRemote) {
|
||||||
|
|
||||||
int threshold = 2000;
|
|
||||||
|
|
||||||
if(processAsh(ashLevelWood, EnumAshType.WOOD, threshold)) ashLevelWood -= threshold;
|
if(processAsh(ashLevelWood, EnumAshType.WOOD, thresholdWood)) ashLevelWood -= thresholdWood;
|
||||||
if(processAsh(ashLevelCoal, EnumAshType.COAL, threshold)) ashLevelCoal -= threshold;
|
if(processAsh(ashLevelCoal, EnumAshType.COAL, thresholdCoal)) ashLevelCoal -= thresholdCoal;
|
||||||
if(processAsh(ashLevelMisc, EnumAshType.MISC, threshold)) ashLevelMisc -= threshold;
|
if(processAsh(ashLevelMisc, EnumAshType.MISC, thresholdMisc)) ashLevelMisc -= thresholdMisc;
|
||||||
if(processAsh(ashLevelFly, EnumAshType.FLY, threshold)) ashLevelFly -= threshold;
|
if(processAsh(ashLevelFly, EnumAshType.FLY, thresholdFly)) ashLevelFly -= thresholdFly;
|
||||||
if(processAsh(ashLevelSoot, EnumAshType.SOOT, threshold * 4)) ashLevelSoot -= threshold * 4;
|
if(processAsh(ashLevelSoot, EnumAshType.SOOT, thresholdSoot)) ashLevelSoot -= thresholdSoot;
|
||||||
|
|
||||||
isFull = false;
|
isFull = false;
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public class TileEntityCharger extends TileEntityLoadedBase implements IEnergyRe
|
|||||||
|
|
||||||
if(stack != null && stack.getItem() instanceof IBatteryItem) {
|
if(stack != null && stack.getItem() instanceof IBatteryItem) {
|
||||||
IBatteryItem battery = (IBatteryItem) stack.getItem();
|
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) {
|
if(stack != null && stack.getItem() instanceof IBatteryItem) {
|
||||||
IBatteryItem battery = (IBatteryItem) stack.getItem();
|
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);
|
toCharge = Math.min(toCharge, power / 5);
|
||||||
battery.chargeBattery(stack, toCharge);
|
battery.chargeBattery(stack, toCharge);
|
||||||
power -= toCharge;
|
power -= toCharge;
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package com.hbm.tileentity.machine;
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
import java.util.Random;
|
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.blocks.BlockDummyable;
|
||||||
import com.hbm.handler.CompatHandler;
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
@ -13,6 +16,7 @@ import com.hbm.main.MainRegistry;
|
|||||||
import com.hbm.packet.NBTPacket;
|
import com.hbm.packet.NBTPacket;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
import com.hbm.sound.AudioWrapper;
|
import com.hbm.sound.AudioWrapper;
|
||||||
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
import com.hbm.tileentity.INBTPacketReceiver;
|
import com.hbm.tileentity.INBTPacketReceiver;
|
||||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||||
import com.hbm.util.CompatEnergyControl;
|
import com.hbm.util.CompatEnergyControl;
|
||||||
@ -36,10 +40,9 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
@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 {
|
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine {
|
||||||
|
|
||||||
public long power;
|
public long power;
|
||||||
public static final long maxPower = 100000000000L;
|
|
||||||
private int turnTimer;
|
private int turnTimer;
|
||||||
public float rotor;
|
public float rotor;
|
||||||
public float lastRotor;
|
public float lastRotor;
|
||||||
@ -51,15 +54,45 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
|||||||
private AudioWrapper audio;
|
private AudioWrapper audio;
|
||||||
private float audioDesync;
|
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() {
|
public TileEntityChungus() {
|
||||||
tanks = new FluidTank[2];
|
tanks = new FluidTank[2];
|
||||||
tanks[0] = new FluidTank(Fluids.STEAM, 1_000_000_000);
|
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 1_000_000_000);
|
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||||
|
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
audioDesync = rand.nextFloat() * 0.05F;
|
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
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
|
|
||||||
@ -72,7 +105,7 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
|||||||
boolean valid = false;
|
boolean valid = false;
|
||||||
if(in.hasTrait(FT_Coolable.class)) {
|
if(in.hasTrait(FT_Coolable.class)) {
|
||||||
FT_Coolable trait = in.getTrait(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) {
|
if(eff > 0) {
|
||||||
tanks[1].setTankType(trait.coolsTo);
|
tanks[1].setTankType(trait.coolsTo);
|
||||||
int inputOps = tanks[0].getFill() / trait.amountReq;
|
int inputOps = tanks[0].getFill() / trait.amountReq;
|
||||||
|
|||||||
@ -1,8 +1,13 @@
|
|||||||
package com.hbm.tileentity.machine;
|
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.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.saveddata.TomSaveData;
|
import com.hbm.saveddata.TomSaveData;
|
||||||
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
import com.hbm.tileentity.INBTPacketReceiver;
|
import com.hbm.tileentity.INBTPacketReceiver;
|
||||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||||
import com.hbm.util.CompatEnergyControl;
|
import com.hbm.util.CompatEnergyControl;
|
||||||
@ -12,7 +17,7 @@ import api.hbm.tile.IInfoProviderEC;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.EnumSkyBlock;
|
import net.minecraft.world.EnumSkyBlock;
|
||||||
|
|
||||||
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC {
|
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC, IConfigurableMachine {
|
||||||
|
|
||||||
public int age = 0;
|
public int age = 0;
|
||||||
public FluidTank[] tanks;
|
public FluidTank[] tanks;
|
||||||
@ -20,12 +25,35 @@ public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidS
|
|||||||
public int waterTimer = 0;
|
public int waterTimer = 0;
|
||||||
protected int throughput;
|
protected int throughput;
|
||||||
|
|
||||||
|
//Configurable values
|
||||||
|
public static int inputTankSize = 100;
|
||||||
|
public static int outputTankSize = 100;
|
||||||
|
|
||||||
public TileEntityCondenser() {
|
public TileEntityCondenser() {
|
||||||
tanks = new FluidTank[2];
|
tanks = new FluidTank[2];
|
||||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 100);
|
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSize);
|
||||||
tanks[1] = new FluidTank(Fluids.WATER, 100);
|
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
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,13 @@
|
|||||||
package com.hbm.tileentity.machine;
|
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.FluidType;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||||
@ -16,14 +21,39 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
public class TileEntityCondenserPowered extends TileEntityCondenser implements IEnergyReceiverMK2 {
|
public class TileEntityCondenserPowered extends TileEntityCondenser implements IEnergyReceiverMK2 {
|
||||||
|
|
||||||
public long power;
|
public long power;
|
||||||
public static final long maxPower = 10_000_000;
|
|
||||||
public float spin;
|
public float spin;
|
||||||
public float lastSpin;
|
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() {
|
public TileEntityCondenserPowered() {
|
||||||
tanks = new FluidTank[2];
|
tanks = new FluidTank[2];
|
||||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1_000_000);
|
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeP);
|
||||||
tanks[1] = new FluidTank(Fluids.WATER, 1_000_000);
|
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
|
@Override
|
||||||
@ -63,7 +93,7 @@ public class TileEntityCondenserPowered extends TileEntityCondenser implements I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postConvert(int convert) {
|
public void postConvert(int convert) {
|
||||||
this.power -= convert * 10;
|
this.power -= convert * powerConsumption;
|
||||||
if(this.power < 0) this.power = 0;
|
if(this.power < 0) this.power = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -111,7 +111,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(i == 2) {
|
if(i == 2) {
|
||||||
if(stack.getItem() instanceof IBatteryItem && ((IBatteryItem) stack.getItem()).getCharge(stack) == ((IBatteryItem) stack.getItem()).getMaxCharge()) {
|
if(stack.getItem() instanceof IBatteryItem && ((IBatteryItem) stack.getItem()).getCharge(stack) == ((IBatteryItem) stack.getItem()).getMaxCharge(stack)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
|
||||||
|
public class TileEntityMachineLPW2 extends TileEntity {
|
||||||
|
|
||||||
|
AxisAlignedBB bb = null;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getRenderBoundingBox() {
|
||||||
|
if(bb == null) bb = AxisAlignedBB.getBoundingBox(xCoord - 10, yCoord, zCoord - 10, xCoord + 11, yCoord + 7, zCoord + 11);
|
||||||
|
return bb;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public double getMaxRenderDistanceSquared() {
|
||||||
|
return 65536.0D;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,7 +1,10 @@
|
|||||||
package com.hbm.tileentity.machine;
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
import java.util.Random;
|
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.blocks.BlockDummyable;
|
||||||
import com.hbm.handler.CompatHandler;
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.container.ContainerMachineLargeTurbine;
|
import com.hbm.inventory.container.ContainerMachineLargeTurbine;
|
||||||
@ -14,6 +17,7 @@ import com.hbm.inventory.gui.GUIMachineLargeTurbine;
|
|||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.sound.AudioWrapper;
|
import com.hbm.sound.AudioWrapper;
|
||||||
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
import com.hbm.tileentity.IGUIProvider;
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
import com.hbm.tileentity.TileEntityMachineBase;
|
import com.hbm.tileentity.TileEntityMachineBase;
|
||||||
import com.hbm.util.CompatEnergyControl;
|
import com.hbm.util.CompatEnergyControl;
|
||||||
@ -39,10 +43,9 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine {
|
||||||
|
|
||||||
public long power;
|
public long power;
|
||||||
public static final long maxPower = 100000000;
|
|
||||||
public FluidTank[] tanks;
|
public FluidTank[] tanks;
|
||||||
protected double[] info = new double[3];
|
protected double[] info = new double[3];
|
||||||
|
|
||||||
@ -54,17 +57,46 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
|||||||
private AudioWrapper audio;
|
private AudioWrapper audio;
|
||||||
private float audioDesync;
|
private float audioDesync;
|
||||||
|
|
||||||
|
//Configurable Values
|
||||||
|
public static long maxPower = 100000000;
|
||||||
|
public static int inputTankSize = 512_000;
|
||||||
|
public static int outputTankSize = 10_240_000;
|
||||||
|
public static double efficiency = 1.0;
|
||||||
|
|
||||||
|
|
||||||
public TileEntityMachineLargeTurbine() {
|
public TileEntityMachineLargeTurbine() {
|
||||||
super(7);
|
super(7);
|
||||||
|
|
||||||
tanks = new FluidTank[2];
|
tanks = new FluidTank[2];
|
||||||
tanks[0] = new FluidTank(Fluids.STEAM, 512000);
|
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 10240000);
|
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||||
|
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
audioDesync = rand.nextFloat() * 0.05F;
|
audioDesync = rand.nextFloat() * 0.05F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getConfigName() {
|
||||||
|
return "steamturbineIndustrial";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readIfPresent(JsonObject obj) {
|
||||||
|
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||||
|
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||||
|
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||||
|
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeConfig(JsonWriter writer) throws IOException {
|
||||||
|
writer.name("L:maxPower").value(maxPower);
|
||||||
|
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
|
||||||
|
writer.name("I:inputTankSize").value(inputTankSize);
|
||||||
|
writer.name("I:outputTankSize").value(outputTankSize);
|
||||||
|
writer.name("D:efficiency").value(efficiency);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "container.machineLargeTurbine";
|
return "container.machineLargeTurbine";
|
||||||
@ -92,7 +124,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
|||||||
boolean valid = false;
|
boolean valid = false;
|
||||||
if(in.hasTrait(FT_Coolable.class)) {
|
if(in.hasTrait(FT_Coolable.class)) {
|
||||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||||
double eff = trait.getEfficiency(CoolingType.TURBINE); //100% efficiency
|
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //100% efficiency by default
|
||||||
if(eff > 0) {
|
if(eff > 0) {
|
||||||
tanks[1].setTankType(trait.coolsTo);
|
tanks[1].setTankType(trait.coolsTo);
|
||||||
int inputOps = (int) Math.floor(tanks[0].getFill() / trait.amountReq); //amount of cycles possible with the entire input buffer
|
int inputOps = (int) Math.floor(tanks[0].getFill() / trait.amountReq); //amount of cycles possible with the entire input buffer
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
package com.hbm.tileentity.machine;
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
import com.hbm.handler.CompatHandler;
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.container.ContainerMachineTurbine;
|
import com.hbm.inventory.container.ContainerMachineTurbine;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
@ -9,6 +13,7 @@ import com.hbm.inventory.fluid.trait.FT_Coolable;
|
|||||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||||
import com.hbm.inventory.gui.GUIMachineTurbine;
|
import com.hbm.inventory.gui.GUIMachineTurbine;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
import com.hbm.tileentity.IBufPacketReceiver;
|
import com.hbm.tileentity.IBufPacketReceiver;
|
||||||
import com.hbm.tileentity.IGUIProvider;
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||||
@ -37,12 +42,11 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IEnergyProviderMK2, IFluidStandardTransceiver, IBufPacketReceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IEnergyProviderMK2, IFluidStandardTransceiver, IBufPacketReceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine{
|
||||||
|
|
||||||
private ItemStack slots[];
|
private ItemStack slots[];
|
||||||
|
|
||||||
public long power;
|
public long power;
|
||||||
public static final long maxPower = 1000000;
|
|
||||||
public int age = 0;
|
public int age = 0;
|
||||||
public FluidTank[] tanks;
|
public FluidTank[] tanks;
|
||||||
|
|
||||||
@ -53,11 +57,40 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
|
|||||||
private String customName;
|
private String customName;
|
||||||
protected double[] info = new double[3];
|
protected double[] info = new double[3];
|
||||||
|
|
||||||
|
//Configurable values
|
||||||
|
public static long maxPower = 1_000_000;
|
||||||
|
public static int inputTankSize = 64_000;
|
||||||
|
public static int outputTankSize = 128_000;
|
||||||
|
public static int maxSteamPerTick = 6_000;
|
||||||
|
public static double efficiency = 0.85D;
|
||||||
|
|
||||||
public TileEntityMachineTurbine() {
|
public TileEntityMachineTurbine() {
|
||||||
slots = new ItemStack[7];
|
slots = new ItemStack[7];
|
||||||
tanks = new FluidTank[2];
|
tanks = new FluidTank[2];
|
||||||
tanks[0] = new FluidTank(Fluids.STEAM, 64_000);
|
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 128_000);
|
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getConfigName() {
|
||||||
|
return "steamturbine";
|
||||||
|
}
|
||||||
|
|
||||||
|
@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);
|
||||||
|
maxSteamPerTick = IConfigurableMachine.grab(obj, "I:maxSteamPerTick", maxSteamPerTick);
|
||||||
|
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeConfig(JsonWriter writer) throws IOException {
|
||||||
|
writer.name("L:maxPower").value(maxPower);
|
||||||
|
writer.name("I:inputTankSize").value(inputTankSize);
|
||||||
|
writer.name("I:outputTankSize").value(outputTankSize);
|
||||||
|
writer.name("I:maxSteamPerTick").value(maxSteamPerTick);
|
||||||
|
writer.name("D:efficiency").value(efficiency);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -247,12 +280,12 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
|
|||||||
boolean valid = false;
|
boolean valid = false;
|
||||||
if(in.hasTrait(FT_Coolable.class)) {
|
if(in.hasTrait(FT_Coolable.class)) {
|
||||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * 0.85D; //small turbine is only 85% efficient
|
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //small turbine is only 85% efficient by default
|
||||||
if(eff > 0) {
|
if(eff > 0) {
|
||||||
tanks[1].setTankType(trait.coolsTo);
|
tanks[1].setTankType(trait.coolsTo);
|
||||||
int inputOps = tanks[0].getFill() / trait.amountReq;
|
int inputOps = tanks[0].getFill() / trait.amountReq;
|
||||||
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
|
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
|
||||||
int cap = 6_000 / trait.amountReq;
|
int cap = maxSteamPerTick / trait.amountReq;
|
||||||
int ops = Math.min(inputOps, Math.min(outputOps, cap));
|
int ops = Math.min(inputOps, Math.min(outputOps, cap));
|
||||||
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
|
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
|
||||||
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
|
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
|
||||||
|
|||||||
@ -1,10 +1,15 @@
|
|||||||
package com.hbm.tileentity.machine;
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
import com.hbm.config.GeneralConfig;
|
import com.hbm.config.GeneralConfig;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@ -15,10 +20,31 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
|
|
||||||
public class TileEntityTowerLarge extends TileEntityCondenser {
|
public class TileEntityTowerLarge extends TileEntityCondenser {
|
||||||
|
|
||||||
|
//Configurable values
|
||||||
|
public static int inputTankSizeTL = 10_000;
|
||||||
|
public static int outputTankSizeTL = 10_000;
|
||||||
|
|
||||||
public TileEntityTowerLarge() {
|
public TileEntityTowerLarge() {
|
||||||
tanks = new FluidTank[2];
|
tanks = new FluidTank[2];
|
||||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 10000);
|
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeTL);
|
||||||
tanks[1] = new FluidTank(Fluids.WATER, 10000);
|
tanks[1] = new FluidTank(Fluids.WATER, outputTankSizeTL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getConfigName() {
|
||||||
|
return "condenserTowerLarge";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readIfPresent(JsonObject obj) {
|
||||||
|
inputTankSizeTL = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSizeTL);
|
||||||
|
outputTankSizeTL = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSizeTL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeConfig(JsonWriter writer) throws IOException {
|
||||||
|
writer.name("I:inputTankSize").value(inputTankSizeTL);
|
||||||
|
writer.name("I:outputTankSize").value(outputTankSizeTL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
package com.hbm.tileentity.machine;
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
import com.hbm.config.GeneralConfig;
|
import com.hbm.config.GeneralConfig;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@ -15,10 +20,31 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
|
|
||||||
public class TileEntityTowerSmall extends TileEntityCondenser {
|
public class TileEntityTowerSmall extends TileEntityCondenser {
|
||||||
|
|
||||||
|
//Configurable values
|
||||||
|
public static int inputTankSizeTS = 1_000;
|
||||||
|
public static int outputTankSizeTS = 1_000;
|
||||||
|
|
||||||
public TileEntityTowerSmall() {
|
public TileEntityTowerSmall() {
|
||||||
tanks = new FluidTank[2];
|
tanks = new FluidTank[2];
|
||||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1000);
|
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeTS);
|
||||||
tanks[1] = new FluidTank(Fluids.WATER, 1000);
|
tanks[1] = new FluidTank(Fluids.WATER, outputTankSizeTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getConfigName() {
|
||||||
|
return "condenserTowerSmall";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readIfPresent(JsonObject obj) {
|
||||||
|
inputTankSizeTS = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSizeTS);
|
||||||
|
outputTankSizeTS = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSizeTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeConfig(JsonWriter writer) throws IOException {
|
||||||
|
writer.name("I:inputTankSize").value(inputTankSizeTS);
|
||||||
|
writer.name("I:outputTankSize").value(outputTankSizeTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -112,12 +112,10 @@ public class TileEntityMachinePumpjack extends TileEntityOilDrillBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUpdate() {
|
public void networkPack(NBTTagCompound nbt, int range) {
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
nbt.setFloat("speed", this.indicator == 0 ? (5F + (2F * this.speedLevel)) + (this.overLevel - 1F) * 10: 0F);
|
||||||
data.setLong("power", power);
|
|
||||||
data.setInteger("indicator", this.indicator);
|
super.networkPack(nbt, range);
|
||||||
data.setFloat("speed", this.indicator == 0 ? (5F + (2F * this.speedLevel)) + (this.overLevel - 1F) * 10: 0F);
|
|
||||||
this.networkPack(data, 25);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -21,10 +21,10 @@ import com.hbm.util.CompatEnergyControl;
|
|||||||
import cpw.mods.fml.common.Optional;
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
import li.cil.oc.api.machine.Arguments;
|
import li.cil.oc.api.machine.Arguments;
|
||||||
import li.cil.oc.api.machine.Callback;
|
import li.cil.oc.api.machine.Callback;
|
||||||
import li.cil.oc.api.machine.Context;
|
import li.cil.oc.api.machine.Context;
|
||||||
import li.cil.oc.api.network.SimpleComponent;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
@ -35,7 +35,7 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||||
public class TileEntityMachineBattery extends TileEntityMachineBase implements IEnergyConductorMK2, IEnergyProviderMK2, IEnergyReceiverMK2, IPersistentNBT, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
public class TileEntityMachineBattery extends TileEntityMachineBase implements IEnergyConductorMK2, IEnergyProviderMK2, IEnergyReceiverMK2, IPersistentNBT, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||||
|
|
||||||
public long[] log = new long[20];
|
public long[] log = new long[20];
|
||||||
public long delta = 0;
|
public long delta = 0;
|
||||||
@ -141,7 +141,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
|||||||
if(i == 0 && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0) {
|
if(i == 0 && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(i == 1 && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == ((IBatteryItem)itemStack.getItem()).getMaxCharge()) {
|
if(i == 1 && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == ((IBatteryItem)itemStack.getItem()).getMaxCharge(itemStack)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -214,13 +214,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
|||||||
|
|
||||||
prevPowerState = power;
|
prevPowerState = power;
|
||||||
|
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
this.networkPackNT(20);
|
||||||
nbt.setLong("power", avg);
|
|
||||||
nbt.setLong("delta", delta);
|
|
||||||
nbt.setShort("redLow", redLow);
|
|
||||||
nbt.setShort("redHigh", redHigh);
|
|
||||||
nbt.setByte("priority", (byte) this.priority.ordinal());
|
|
||||||
this.networkPack(nbt, 20);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,23 +235,34 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
|||||||
|
|
||||||
@Override public long getProviderSpeed() {
|
@Override public long getProviderSpeed() {
|
||||||
int mode = this.getRelevantMode(true);
|
int mode = this.getRelevantMode(true);
|
||||||
return mode == mode_output || mode == mode_buffer ? this.getMaxPower() / 20 : 0;
|
return mode == mode_output || mode == mode_buffer ? this.getMaxPower() / 600 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public long getReceiverSpeed() {
|
@Override public long getReceiverSpeed() {
|
||||||
int mode = this.getRelevantMode(true);
|
int mode = this.getRelevantMode(true);
|
||||||
return mode == mode_input || mode == mode_buffer ? this.getMaxPower() / 20 : 0;
|
return mode == mode_input || mode == mode_buffer ? this.getMaxPower() / 200 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void networkUnpack(NBTTagCompound nbt) {
|
public void serialize(ByteBuf buf) {
|
||||||
super.networkUnpack(nbt);
|
super.serialize(buf);
|
||||||
|
|
||||||
this.power = nbt.getLong("power");
|
buf.writeLong(power);
|
||||||
this.delta = nbt.getLong("delta");
|
buf.writeLong(delta);
|
||||||
this.redLow = nbt.getShort("redLow");
|
buf.writeShort(redLow);
|
||||||
this.redHigh = nbt.getShort("redHigh");
|
buf.writeShort(redHigh);
|
||||||
this.priority = ConnectionPriority.values()[nbt.getByte("priority")];
|
buf.writeByte(priority.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deserialize(ByteBuf buf) {
|
||||||
|
super.deserialize(buf);
|
||||||
|
|
||||||
|
power = buf.readLong();
|
||||||
|
delta = buf.readLong();
|
||||||
|
redLow = buf.readShort();
|
||||||
|
redHigh = buf.readShort();
|
||||||
|
priority = ConnectionPriority.values()[buf.readByte()];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import api.hbm.energymk2.Nodespace;
|
|||||||
import api.hbm.energymk2.Nodespace.PowerNode;
|
import api.hbm.energymk2.Nodespace.PowerNode;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
@ -79,13 +78,7 @@ public class TileEntityMachineFENSU extends TileEntityMachineBattery {
|
|||||||
|
|
||||||
this.log[19] = avg;
|
this.log[19] = avg;
|
||||||
|
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
this.networkPackNT(20);
|
||||||
nbt.setLong("power", avg);
|
|
||||||
nbt.setLong("delta", delta);
|
|
||||||
nbt.setShort("redLow", redLow);
|
|
||||||
nbt.setShort("redHigh", redHigh);
|
|
||||||
nbt.setByte("priority", (byte) this.priority.ordinal());
|
|
||||||
this.networkPack(nbt, 20);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(worldObj.isRemote) {
|
if(worldObj.isRemote) {
|
||||||
|
|||||||
@ -206,4 +206,15 @@ public class BobMathUtil {
|
|||||||
double delta = (beta - alpha + 180) % 360 - 180;
|
double delta = (beta - alpha + 180) % 360 - 180;
|
||||||
return delta < -180 ? delta + 360 : delta;
|
return delta < -180 ? delta + 360 : delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Soft peak sine */
|
||||||
|
public static double sps(double x) {
|
||||||
|
return Math.sin(Math.PI / 2D * Math.cos(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Square wave sine, make sure squarination is [0;1] */
|
||||||
|
public static double sws(double x, double squarination) {
|
||||||
|
double s = Math.sin(x);
|
||||||
|
return Math.pow(Math.abs(s), 2 - squarination) / s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,8 @@ public class ChatBuilder {
|
|||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChatBuilder startTranslation(String text) {
|
public static ChatBuilder startTranslation(String text, Object... o) {
|
||||||
ChatBuilder builder = new ChatBuilder("").nextTranslation(text);
|
ChatBuilder builder = new ChatBuilder("").nextTranslation(text, o);
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,8 +38,8 @@ public class ChatBuilder {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChatBuilder nextTranslation(String text) {
|
public ChatBuilder nextTranslation(String text, Object... o) {
|
||||||
ChatComponentTranslation append = new ChatComponentTranslation(text);
|
ChatComponentTranslation append = new ChatComponentTranslation(text, o);
|
||||||
this.last.appendSibling(append);
|
this.last.appendSibling(append);
|
||||||
this.last = append;
|
this.last = append;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
13
src/main/resources/assets/hbm/disks/README.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# OpenComputers Floppy Disks
|
||||||
|
|
||||||
|
This directory is where the contents of floppy disks registered by `com.hbm.handler.CompatHandler` reside.
|
||||||
|
|
||||||
|
New floppy disks can be added by:
|
||||||
|
1. Adding a line inside the `init()` function in the `CompatHandler` class to add the floppy disk to the list of disks to register
|
||||||
|
(actually registering the disks is done automatically by the handler.)
|
||||||
|
2. Adding the Lua (Preferably 5.3) files to the directory path based on the name you chose for your floppy disk.
|
||||||
|
<br>Note: the names of drives are "sanitized", meaning the directory path will be the name you selected but all lowercase and stripped of any non-word character.
|
||||||
|
(A-Z, a-z, 0-9, _)
|
||||||
|
3. Add a recipe to the disk at the end of the `init()` function in the `CompatHandler` class, though this step is not required.
|
||||||
|
|
||||||
|
After those steps are complete, a new floppy disk should be registered into OC with a recipe (if added).
|
||||||
@ -0,0 +1,274 @@
|
|||||||
|
local component = require "component"
|
||||||
|
local event = require "event"
|
||||||
|
local gpu = component.gpu
|
||||||
|
local call = component.invoke
|
||||||
|
|
||||||
|
colorGradient = {0x00FF00, 0x6BEE00, 0x95DB00, 0xB0C800, 0xC5B400, 0xD79F00, 0xE68700, 0xF46900, 0xFC4700, 0xFF0000}
|
||||||
|
coreHeatESTOP = true
|
||||||
|
coolantLossESTOP = true
|
||||||
|
|
||||||
|
runSig = true
|
||||||
|
|
||||||
|
coldCoolantLevel = 0
|
||||||
|
coldCoolantOutflow = 0
|
||||||
|
prevCoolantFlow = 0
|
||||||
|
|
||||||
|
hotCoolantLevel = 0
|
||||||
|
hotCoolantOutflow = 0
|
||||||
|
prevHotCoolantFlow = 0
|
||||||
|
|
||||||
|
gpu.fill(1,1,160,160," ")
|
||||||
|
|
||||||
|
-- Button Bullshit
|
||||||
|
function newButton(x, y, width, height, colorUp, colorDown, func)
|
||||||
|
local button = {xpos = 0, ypos = 0, width = 0, height = 0, colorUp = 0, colorDown = 0, func = nil}
|
||||||
|
button.xpos = x
|
||||||
|
button.ypos = y
|
||||||
|
button.width = width
|
||||||
|
button.height = height
|
||||||
|
button.colorUp = colorUp
|
||||||
|
button.colorDown = colorDown
|
||||||
|
button.func = func
|
||||||
|
return button
|
||||||
|
end
|
||||||
|
|
||||||
|
function drawButton(button, color)
|
||||||
|
component.gpu.setBackground(color)
|
||||||
|
component.gpu.fill(button.xpos, button.ypos, button.width, button.height, " ")
|
||||||
|
component.gpu.setBackground(0x000000)
|
||||||
|
end
|
||||||
|
|
||||||
|
pressedButton = nil
|
||||||
|
function buttonPress(_, _, x, y, _, _)
|
||||||
|
for _, b in pairs(buttons) do
|
||||||
|
if((x>=b.xpos) and (x<(b.xpos+b.width)) and (y>=b.ypos) and (y<(b.ypos+b.height)) ) then
|
||||||
|
drawButton(b, b.colorDown)
|
||||||
|
pressedButton = b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function buttonRelease(_, _, x, y, _, _)
|
||||||
|
drawButton(pressedButton, pressedButton.colorUp)
|
||||||
|
pressedButton.func()
|
||||||
|
pressedButton = nil
|
||||||
|
end
|
||||||
|
--Button bullshit ends
|
||||||
|
|
||||||
|
buttons = {}
|
||||||
|
|
||||||
|
buttons[1] = newButton(61, 6, 6, 2, 0xFFFFFF, 0xAAAAAA, function() component.proxy(pwrController).setLevel(call(pwrController, "getLevel")+1) end)
|
||||||
|
buttons[2] = newButton(68, 6, 6, 2, 0xFFFFFF, 0xAAAAAA, function() component.proxy(pwrController).setLevel(call(pwrController, "getLevel")+5) end)
|
||||||
|
buttons[3] = newButton(75, 6, 6, 2, 0xFFFFFF, 0xAAAAAA, function() component.proxy(pwrController).setLevel(call(pwrController, "getLevel")+10) end)
|
||||||
|
|
||||||
|
buttons[4] = newButton(61, 9, 6, 2, 0xFFFFFF, 0xAAAAAA, function() component.proxy(pwrController).setLevel(call(pwrController, "getLevel")-1) end)
|
||||||
|
buttons[5] = newButton(68, 9, 6, 2, 0xFFFFFF, 0xAAAAAA, function() component.proxy(pwrController).setLevel(call(pwrController, "getLevel")-5) end)
|
||||||
|
buttons[6] = newButton(75, 9, 6, 2, 0xFFFFFF, 0xAAAAAA, function() component.proxy(pwrController).setLevel(call(pwrController, "getLevel")-10) end)
|
||||||
|
|
||||||
|
buttons[7] = newButton(82, 6, 11, 5, 0xFF0000, 0xAA0000, function() component.proxy(pwrController).setLevel(100) end)
|
||||||
|
buttons[8] = newButton(94, 6, 12, 2, 0x00FF00, 0x00AA00, function() coreHeatESTOP = not coreHeatESTOP if coreHeatESTOP == true then buttons[8].colorUp = 0x00FF00 buttons[8].colorDown = 0x00AA00 else buttons[8].colorUp = 0xFF0000 buttons[8].colorDown = 0xAA0000 end end)
|
||||||
|
buttons[9] = newButton(94, 9, 12, 2, 0x00FF00, 0x00AA00, function() coolantLossESTOP = not coolantLossESTOP if coolantLossESTOP == true then buttons[9].colorUp = 0x00FF00 buttons[9].colorDown = 0x00AA00 else buttons[9].colorUp = 0xFF0000 buttons[9].colorDown = 0xAA0000 end end)
|
||||||
|
|
||||||
|
buttons[10] = newButton(107, 8, 5, 3, 0xFF0000, 0xAA0000, function() runSig = false end)
|
||||||
|
|
||||||
|
for address, _ in component.list("ntm_pwr_control") do
|
||||||
|
pwrController = address
|
||||||
|
end
|
||||||
|
|
||||||
|
gpu.setForeground(0xAAAAAA)
|
||||||
|
|
||||||
|
--Control rods
|
||||||
|
gpu.fill(60,4,54,8,"█")
|
||||||
|
|
||||||
|
--Outlet
|
||||||
|
gpu.fill(91,13,16,8,"█")
|
||||||
|
|
||||||
|
--Inlet
|
||||||
|
gpu.fill(91,30,16,8,"█")
|
||||||
|
|
||||||
|
gpu.set(61,13," █████████████████████")
|
||||||
|
gpu.set(61,14," █ █ █ █ █ █ █ █ █ █")
|
||||||
|
gpu.set(61,15," █ █ █▄█▄█▄█▄█▄█ █ █")
|
||||||
|
gpu.set(61,16," ▄█████▀█▀█▀█▀█▀█████▄")
|
||||||
|
gpu.set(61,17," ▄███▀█ █ █ █ █ █ █ █▀███▄")
|
||||||
|
gpu.set(61,18," ▄██ █ █ █ █ █ █ █ █ █ █ ██▄")
|
||||||
|
gpu.set(61,19," ██ ██")
|
||||||
|
gpu.set(61,20,"██▀ █████████████████████ ▀██")
|
||||||
|
gpu.set(61,21,"██ █████████████████████ ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄")
|
||||||
|
gpu.set(61,22,"██ █ █ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀")
|
||||||
|
gpu.set(61,23,"██ █████████████████████ → → → → → → → → → →")
|
||||||
|
gpu.set(61,24,"██ █ █ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄")
|
||||||
|
gpu.set(61,25,"██ █████████████████████ ██▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀")
|
||||||
|
gpu.set(61,26,"██ █ █ ██")
|
||||||
|
gpu.set(61,27,"██ █████████████████████ ██")
|
||||||
|
gpu.set(61,28,"██ █ █ ██")
|
||||||
|
gpu.set(61,29,"██ █████████████████████ ██")
|
||||||
|
gpu.set(61,30,"██ █ █ ██")
|
||||||
|
gpu.set(61,31,"██ █████████████████████ ██")
|
||||||
|
gpu.set(61,32,"██ ██")
|
||||||
|
gpu.set(61,33,"██ ██")
|
||||||
|
gpu.set(61,34,"██ ██")
|
||||||
|
gpu.set(61,35,"██ ██")
|
||||||
|
gpu.set(61,36,"██ ██")
|
||||||
|
gpu.set(61,37,"██ ██")
|
||||||
|
gpu.set(61,38,"██ ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄")
|
||||||
|
gpu.set(61,39,"██ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀")
|
||||||
|
gpu.set(61,40,"██ ← ← ← ← ← ← ← ← ← ←")
|
||||||
|
gpu.set(61,41,"██ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄")
|
||||||
|
gpu.set(61,42,"██ ██▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀")
|
||||||
|
gpu.set(61,43,"██▄ ▄██")
|
||||||
|
gpu.set(61,44," ██ ██")
|
||||||
|
gpu.set(61,45," ▀██ ██▀")
|
||||||
|
gpu.set(61,46," ▀██▄▄ ▄▄██▀")
|
||||||
|
gpu.set(61,47," ▀▀███▄▄▄▄▄▄▄▄▄▄▄███▀▀")
|
||||||
|
gpu.set(61,48," ▀▀▀▀▀▀▀▀▀▀▀▀")
|
||||||
|
|
||||||
|
gpu.setBackground(0xAAAAAA)
|
||||||
|
gpu.setForeground(0x000000)
|
||||||
|
|
||||||
|
gpu.set(70,4,"CONTROL RODS")
|
||||||
|
gpu.set(61,5,"INS+1 INS+5 INS+10")
|
||||||
|
gpu.set(61,8,"RET+1 RET+5 RET+10")
|
||||||
|
|
||||||
|
gpu.set(85,5,"ESTOP")
|
||||||
|
gpu.set(107,5,"LEVEL")
|
||||||
|
gpu.set(107,7,"QUIT")
|
||||||
|
|
||||||
|
gpu.set(94,5,"OVHEAT ESTOP")
|
||||||
|
gpu.set(94,8,"NOCOOL ESTOP")
|
||||||
|
|
||||||
|
gpu.set(95,13,"OUTFLOW")
|
||||||
|
gpu.set(92,14,"BUFFER")
|
||||||
|
gpu.set(99,14,"HOTΔ")
|
||||||
|
|
||||||
|
gpu.set(95,30,"INFLOW")
|
||||||
|
gpu.set(92,31,"BUFFER")
|
||||||
|
gpu.set(99,31,"COOLΔ")
|
||||||
|
|
||||||
|
gpu.set(69,20,"REACTOR CORE")
|
||||||
|
gpu.set(71,21,"CORE HEAT:")
|
||||||
|
gpu.set(71,23,"HULL HEAT:")
|
||||||
|
gpu.set(71,25,"CORE FLUX:")
|
||||||
|
gpu.set(68,27,"COLD HEATEX LVL:")
|
||||||
|
gpu.set(69,29,"HOT HEATEX LVL:")
|
||||||
|
gpu.setBackground(0x000000)
|
||||||
|
|
||||||
|
gpu.setForeground(0xFFFFFF)
|
||||||
|
gpu.fill(107,6,5,1,"█")
|
||||||
|
|
||||||
|
--Outflow Buffer
|
||||||
|
gpu.fill(92,15,6,5,"█")
|
||||||
|
|
||||||
|
--CoolDelta
|
||||||
|
gpu.fill(99,15,7,1,"█")
|
||||||
|
|
||||||
|
--HotDelta
|
||||||
|
|
||||||
|
gpu.set(66,19,"┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃")
|
||||||
|
gpu.fill(66,22,19,1,"█")
|
||||||
|
gpu.fill(66,24,19,1,"█")
|
||||||
|
gpu.fill(66,26,19,1,"█")
|
||||||
|
gpu.fill(66,28,19,1,"█")
|
||||||
|
gpu.fill(66,30,19,1,"█")
|
||||||
|
gpu.set(66,32,"┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃")
|
||||||
|
gpu.setForeground(0xAAAAAA)
|
||||||
|
|
||||||
|
gpu.setForeground(0x000000)
|
||||||
|
gpu.setBackground(0xFFFFFF)
|
||||||
|
gpu.set(83,22,"TU")
|
||||||
|
gpu.set(83,24,"TU")
|
||||||
|
gpu.setForeground(0xFFFFFF)
|
||||||
|
gpu.setBackground(0x000000)
|
||||||
|
|
||||||
|
|
||||||
|
event.listen("touch", buttonPress)
|
||||||
|
event.listen("drop", buttonRelease)
|
||||||
|
|
||||||
|
while (runSig == true) do
|
||||||
|
rodLevel = call(pwrController, "getLevel")
|
||||||
|
|
||||||
|
coreHeat, _ = call(pwrController, "getHeat")
|
||||||
|
coreHeat = coreHeat//1000000
|
||||||
|
|
||||||
|
for _, b in pairs(buttons) do
|
||||||
|
drawButton(b, b.colorUp)
|
||||||
|
end
|
||||||
|
|
||||||
|
for j=rodLevel//10,10 do
|
||||||
|
gpu.fill(64+(j*2), 33, 1, 10, " ")
|
||||||
|
end
|
||||||
|
|
||||||
|
for j=1,rodLevel//10 do
|
||||||
|
gpu.fill(64+(j*2), 33, 1, 10, "┃")
|
||||||
|
end
|
||||||
|
|
||||||
|
gpu.fill(64+(math.ceil(rodLevel/10)*2), 33, 1, math.fmod(rodLevel,10), "┃")
|
||||||
|
|
||||||
|
for j=0,20,2 do
|
||||||
|
gpu.setForeground(colorGradient[coreHeat+1])
|
||||||
|
gpu.fill(65+j, 33, 1, 9, "█")
|
||||||
|
gpu.setForeground(0xAAAAAA)
|
||||||
|
end
|
||||||
|
|
||||||
|
gpu.setBackground(0xFFFFFF)
|
||||||
|
|
||||||
|
gpu.setForeground(0xFFFFFF)
|
||||||
|
gpu.fill(66,22,19,1,"█")
|
||||||
|
gpu.fill(66,24,19,1,"█")
|
||||||
|
gpu.fill(66,26,19,1,"█")
|
||||||
|
gpu.fill(66,28,19,1,"█")
|
||||||
|
gpu.fill(66,30,19,1,"█")
|
||||||
|
|
||||||
|
gpu.fill(92,15,6,5,"█")
|
||||||
|
gpu.fill(92,32,6,5,"█")
|
||||||
|
|
||||||
|
gpu.fill(99,15,7,1,"█")
|
||||||
|
gpu.fill(99,32,7,1,"█")
|
||||||
|
|
||||||
|
prevCoolantFlow = coldCoolantLevel
|
||||||
|
prevHotCoolantFlow = hotCoolantLevel
|
||||||
|
|
||||||
|
fullCoreHeat, fullHullHeat = call(pwrController, "getHeat")
|
||||||
|
coldCoolantLevel, _, hotCoolantLevel, _ = call(pwrController, "getCoolantInfo")
|
||||||
|
|
||||||
|
coldCoolantOutflow = coldCoolantLevel - prevCoolantFlow
|
||||||
|
hotCoolantOutflow = hotCoolantLevel - prevHotCoolantFlow
|
||||||
|
|
||||||
|
gpu.setForeground(0xFF0099)
|
||||||
|
gpu.fill(92,15+(5-hotCoolantLevel//25600),6,hotCoolantLevel//25600, "█")
|
||||||
|
gpu.setForeground(0x000000)
|
||||||
|
|
||||||
|
gpu.setForeground(0x00FFFF)
|
||||||
|
gpu.fill(92,32+(5-coldCoolantLevel//25600),6,coldCoolantLevel//25600, "█")
|
||||||
|
gpu.setForeground(0x000000)
|
||||||
|
|
||||||
|
gpu.set(66,22,tostring(fullCoreHeat))
|
||||||
|
gpu.set(66,24,tostring(fullHullHeat))
|
||||||
|
gpu.set(66,26,tostring(call(pwrController, "getFlux")))
|
||||||
|
gpu.set(66,28,tostring(coldCoolantLevel))
|
||||||
|
gpu.set(66,30,tostring(hotCoolantLevel))
|
||||||
|
|
||||||
|
gpu.set(99,15,tostring(hotCoolantOutflow))
|
||||||
|
gpu.set(99,32,tostring(coldCoolantOutflow))
|
||||||
|
|
||||||
|
gpu.set(107,6," ")
|
||||||
|
gpu.set(107,6,tostring(call(pwrController, "getLevel")))
|
||||||
|
|
||||||
|
gpu.setBackground(0x000000)
|
||||||
|
gpu.setForeground(0xFFFFFF)
|
||||||
|
|
||||||
|
if (coreHeatESTOP == true) and (fullCoreHeat) > 9000000 then
|
||||||
|
component.proxy(pwrController).setLevel(100)
|
||||||
|
end
|
||||||
|
|
||||||
|
if (coolantLossESTOP == true) and (coldCoolantLevel) < 10000 then
|
||||||
|
component.proxy(pwrController).setLevel(100)
|
||||||
|
end
|
||||||
|
|
||||||
|
os.sleep(0.25)
|
||||||
|
end
|
||||||
|
|
||||||
|
event.ignore("touch", buttonPress)
|
||||||
|
event.ignore("drop", buttonRelease)
|
||||||
|
|
||||||
|
gpu.fill(1,1,160,160," ")
|
||||||
@ -119,6 +119,7 @@ armorMod.chestplates=Brustplatten
|
|||||||
armorMod.helmets=Helme
|
armorMod.helmets=Helme
|
||||||
armorMod.leggings=Beinschienen
|
armorMod.leggings=Beinschienen
|
||||||
armorMod.insertHere=Rüstung zum Modifizieren einlegen...
|
armorMod.insertHere=Rüstung zum Modifizieren einlegen...
|
||||||
|
armorMod.type.battery=Batterie
|
||||||
armorMod.type.boots=Stiefel
|
armorMod.type.boots=Stiefel
|
||||||
armorMod.type.chestplate=Brustplatte
|
armorMod.type.chestplate=Brustplatte
|
||||||
armorMod.type.cladding=Beschläge
|
armorMod.type.cladding=Beschläge
|
||||||
@ -1188,6 +1189,9 @@ item.arc_electrode_burnt.graphite.name=Geschmolzene Graphitelektrode
|
|||||||
item.arc_electrode_burnt.lanthanium.name=Geschmolzene Lanthanelektrode
|
item.arc_electrode_burnt.lanthanium.name=Geschmolzene Lanthanelektrode
|
||||||
item.arc_electrode_burnt.saturnite.name=Geschmolzene Saturnitelektrode
|
item.arc_electrode_burnt.saturnite.name=Geschmolzene Saturnitelektrode
|
||||||
item.arc_electrode_desh.name=Desh-Elektrode
|
item.arc_electrode_desh.name=Desh-Elektrode
|
||||||
|
item.armor_battery.name=Powerrüstung-Akkusatz
|
||||||
|
item.armor_battery_mk2.name=Powerrüstung-Akkusatz Mk2
|
||||||
|
item.armor_battery_mk3.name=Powerrüstung-Akkusatz Mk3
|
||||||
item.armor_polish.name=ShiningArmor™ Rüstungspolitur
|
item.armor_polish.name=ShiningArmor™ Rüstungspolitur
|
||||||
item.asbestos_boots.name=Hitzeschutzstiefel
|
item.asbestos_boots.name=Hitzeschutzstiefel
|
||||||
item.asbestos_cloth.name=Hitzeschutzanzugsstoff
|
item.asbestos_cloth.name=Hitzeschutzanzugsstoff
|
||||||
|
|||||||
@ -174,6 +174,7 @@ armorMod.chestplates=Chestplates
|
|||||||
armorMod.helmets=Helmets
|
armorMod.helmets=Helmets
|
||||||
armorMod.insertHere=Insert armor to modify...
|
armorMod.insertHere=Insert armor to modify...
|
||||||
armorMod.leggings=Leggings
|
armorMod.leggings=Leggings
|
||||||
|
armorMod.type.battery=Battery
|
||||||
armorMod.type.boots=Boots
|
armorMod.type.boots=Boots
|
||||||
armorMod.type.chestplate=Chestplate
|
armorMod.type.chestplate=Chestplate
|
||||||
armorMod.type.cladding=Cladding
|
armorMod.type.cladding=Cladding
|
||||||
@ -1900,6 +1901,9 @@ item.arc_electrode_burnt.graphite.name=Molten Graphite Electrode
|
|||||||
item.arc_electrode_burnt.lanthanium.name=Molten Lanthanium Electrode
|
item.arc_electrode_burnt.lanthanium.name=Molten Lanthanium Electrode
|
||||||
item.arc_electrode_burnt.saturnite.name=Molten Saturnite Electrode
|
item.arc_electrode_burnt.saturnite.name=Molten Saturnite Electrode
|
||||||
item.arc_electrode_desh.name=Desh Electrode
|
item.arc_electrode_desh.name=Desh Electrode
|
||||||
|
item.armor_battery.name=Power Armor Battery Pack
|
||||||
|
item.armor_battery_mk2.name=Power Armor Battery Pack Mk2
|
||||||
|
item.armor_battery_mk3.name=Power Armor Battery Pack Mk3
|
||||||
item.armor_polish.name=ShiningArmor™ Armor Polish
|
item.armor_polish.name=ShiningArmor™ Armor Polish
|
||||||
item.asbestos_boots.name=Fire Proximity Boots
|
item.asbestos_boots.name=Fire Proximity Boots
|
||||||
item.asbestos_cloth.name=Fire Proximity Cloth
|
item.asbestos_cloth.name=Fire Proximity Cloth
|
||||||
@ -3566,6 +3570,13 @@ item.ore_centrifuged.name=Centrifuged %s Ore
|
|||||||
item.ore_cleaned.name=Cleaned %s Ore
|
item.ore_cleaned.name=Cleaned %s Ore
|
||||||
item.ore_deepcleaned.name=Deep Cleaned %s Ore
|
item.ore_deepcleaned.name=Deep Cleaned %s Ore
|
||||||
item.ore_density_scanner.name=Bedrock Ore Density Scanner
|
item.ore_density_scanner.name=Bedrock Ore Density Scanner
|
||||||
|
item.ore_density_scanner.excellent=Excellent
|
||||||
|
item.ore_density_scanner.high=High
|
||||||
|
item.ore_density_scanner.low=Low
|
||||||
|
item.ore_density_scanner.moderate=Moderate
|
||||||
|
item.ore_density_scanner.poor=Poor
|
||||||
|
item.ore_density_scanner.veryhigh=Very High
|
||||||
|
item.ore_density_scanner.verypoor=Very Poor
|
||||||
item.ore_enriched.name=Enriched %s Ore
|
item.ore_enriched.name=Enriched %s Ore
|
||||||
item.ore_nitrated.name=Nitrated %s Ore
|
item.ore_nitrated.name=Nitrated %s Ore
|
||||||
item.ore_nitrocrystalline.name=Nitrocrystalline %s Ore
|
item.ore_nitrocrystalline.name=Nitrocrystalline %s Ore
|
||||||
|
|||||||
@ -767,7 +767,7 @@ vt 0.306452 0.431818
|
|||||||
vt 0.258065 0.045455
|
vt 0.258065 0.045455
|
||||||
vt 0.306452 0.113636
|
vt 0.306452 0.113636
|
||||||
vt 0.580645 0.045455
|
vt 0.580645 0.045455
|
||||||
vt 0.540323 0.125000
|
vt 0.532258 0.113636
|
||||||
vt 0.580645 0.500000
|
vt 0.580645 0.500000
|
||||||
vt 0.532258 0.431818
|
vt 0.532258 0.431818
|
||||||
vt 0.258065 0.500000
|
vt 0.258065 0.500000
|
||||||
|
|||||||
16535
src/main/resources/assets/hbm/models/machines/lpw2.obj
Normal file
4149
src/main/resources/assets/hbm/models/weapons/carbine.obj
Normal file
1640
src/main/resources/assets/hbm/models/weapons/henry.obj
Normal file
|
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 520 B |
|
After Width: | Height: | Size: 403 B |
|
After Width: | Height: | Size: 474 B |
|
After Width: | Height: | Size: 478 B |
|
After Width: | Height: | Size: 368 B |
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 404 B |
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 485 B |
|
After Width: | Height: | Size: 484 B |
|
After Width: | Height: | Size: 480 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 260 B |
5
src/main/resources/assets/hbm/textures/blocks/rtty_programmer.png.mcmeta
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"animation": {
|
||||||
|
"frametime": 10
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
src/main/resources/assets/hbm/textures/blocks/rtty_reader.png
Normal file
|
After Width: | Height: | Size: 254 B |
5
src/main/resources/assets/hbm/textures/blocks/rtty_reader.png.mcmeta
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"animation": {
|
||||||
|
"frametime": 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 537 B |
|
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 403 B |
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 370 B |
|
After Width: | Height: | Size: 403 B |
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 231 B |
BIN
src/main/resources/assets/hbm/textures/models/machines/lpw2.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 850 B |