Merge remote-tracking branch 'upstream/master' into RBMK_optimization

# Conflicts:
#	src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java
This commit is contained in:
BallOfEnergy 2024-08-29 21:47:03 -05:00
commit f245863945
105 changed files with 23794 additions and 220 deletions

View File

@ -30,11 +30,9 @@ This ties together with the previous point - there's no guarantees that your PR
## I want to help but don't know where to start
If you want to help the project, consider getting involved with the [wiki](ntm.fandom.com) first. Writing an article is the easiest and quickest way of helping, and requires no programming knowledge. If you do know Java and want to help, consider these places first:
If you want to help the project, consider getting involved with the [wiki](https://nucleartech.wiki/) first. Writing an article is the easiest and quickest way of helping, and requires no programming knowledge. If you do know Java and want to help, consider these places first:
* Localization, i.e. translations in different language are always accepted.
* `IConfigurableMachine`, an interface that allows machines to be added to the `hbmMachines.json` config, is still not used by many machines.
* F1 Presentations, also known as "Stare" or "Jar Presentations", is a neat system of creating a short movie explaining functionality. All the relevant code can be found in `com.hbm.wiaj`.
* Some guns still use the old "bow-style" systems and not `ItemGunBase`.
* Many guns don't have any animations whatsoever, just adding a minor recoil would already improve them by a lot.
* Adding tooltips to more machines, explaining some of the basics.

View File

@ -1,16 +1,12 @@
## 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
* Because of this, using chains of converters as batteries becomes exponentially lossy with size, therefore the input decay has been removed
* Input decay can still be configured if desired
* No input decay also means that converters are no longer infinite energy sinks
* Power converter recipes have been updated
* Soldering stations will no longer work if the recipe requires no input fluid while fluid is present
* 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
* Changed the multi fluid ID recipe, they now use analog circuits instead of silicon based ones, no longer requiring plastic to make
* Decreased the connection speed for all battery blocks, a full discharge now takes 30 seconds instead of 1 second, and charging now takes 10 seconds
* Capacitors have also been nerfed but they are twice as fast as battery blocks, 5 seconds for charging and 15 seconds for discharging
* Removed forgotten bricks
* Updated CMB brick texture
* The ICF machine block now renders with its 3d model in the creative inventory
## Fixed
* Fixed some machines not sending fluid gauge syncs properly
* Fixed refinery GUI crashing when invalid input is used
* Fixed pumpjack gauges not syncing properly
* Fixed some concrete variants not being revertable into uncolored concrete
* Fixed the ore density scanner not using proper translations for the HUD

View File

@ -10,7 +10,7 @@ public interface IBatteryItem {
public void setCharge(ItemStack stack, long i);
public void dischargeBattery(ItemStack stack, long i);
public long getCharge(ItemStack stack);
public long getMaxCharge();
public long getMaxCharge(ItemStack stack);
public long getChargeRate();
public long getDischargeRate();

View 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();
}

View 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;
}
}

View File

@ -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);
}

View File

@ -0,0 +1,8 @@
package api.hbm.redstoneoverradio;
public class RORFunctionException extends RuntimeException {
public RORFunctionException(String message) {
super(message);
}
}

View 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
*/

View File

@ -388,7 +388,6 @@ public class ModBlocks {
public static Block brick_jungle_glyph;
public static Block brick_jungle_circle;
public static Block brick_forgotten;
public static Block brick_red;
public static Block deco_computer;
@ -1005,6 +1004,7 @@ public class ModBlocks {
public static Block machine_turbofan;
public static Block machine_turbinegas;
public static Block machine_lpw2;
public static Block press_preheater;
public static Block machine_press;
@ -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_circle = new BlockBallsSpawner(Material.rock).setBlockName("brick_jungle_circle").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(360.0F).setBlockTextureName(RefStrings.MODID + ":brick_jungle_circle");
brick_forgotten = new BlockGeneric(Material.rock).setBlockName("brick_forgotten").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(1000000).setBlockTextureName(RefStrings.MODID + ":brick_forgotten");
brick_red = new BlockRedBrick(Material.rock).setBlockName("brick_red").setResistance(10_000);
deco_computer = new BlockDecoModel(Material.iron, DecoComputerEnum.class, true, false).setBlockBoundsTo(.160749F, 0F, 0F, .839251F, .867849F, .622184F).setBlockName("deco_computer").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_computer");
@ -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_turbofan = new MachineTurbofan(Material.iron).setBlockName("machine_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbofan");
machine_turbinegas = new MachineTurbineGas(Material.iron).setBlockName("machine_turbinegas").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_lpw2 = new MachineLPW2().setBlockName("machine_lpw2").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
press_preheater = new BlockBase(Material.iron).setBlockName("press_preheater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":press_preheater");
machine_press = new MachinePress(Material.iron).setBlockName("machine_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_press");
machine_epress = new MachineEPress(Material.iron).setBlockName("machine_epress").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_epress");
@ -2719,7 +2719,6 @@ public class ModBlocks {
GameRegistry.registerBlock(brick_jungle_trap, ItemTrapBlock.class, brick_jungle_trap.getUnlocalizedName());
GameRegistry.registerBlock(brick_jungle_glyph, ItemGlyphBlock.class, brick_jungle_glyph.getUnlocalizedName());
GameRegistry.registerBlock(brick_jungle_circle, brick_jungle_circle.getUnlocalizedName());
GameRegistry.registerBlock(brick_forgotten, brick_forgotten.getUnlocalizedName());
GameRegistry.registerBlock(brick_red, brick_red.getUnlocalizedName());
register(deco_computer);
register(deco_crt);
@ -3238,6 +3237,7 @@ public class ModBlocks {
register(barricade);
register(machine_turbofan);
register(machine_turbinegas);
register(machine_lpw2);
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
GameRegistry.registerBlock(teleanchor, teleanchor.getUnlocalizedName());

View File

@ -67,7 +67,7 @@ public class HEVBattery extends Block {
if(st.getItem() instanceof IBatteryItem) {
long maxcharge = ((IBatteryItem) st.getItem()).getMaxCharge();
long maxcharge = ((IBatteryItem) st.getItem()).getMaxCharge(st);
long charge = ((IBatteryItem) st.getItem()).getCharge(st);
long newcharge = Math.min(charge + 150000, maxcharge);

View File

@ -280,6 +280,9 @@ public class MachineBattery extends BlockContainer implements ILookOverlay, IPer
@Override
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
list.add(EnumChatFormatting.GOLD + "Stores up to "+ BobMathUtil.getShortNumber(this.maxPower) + "HE");
list.add(EnumChatFormatting.GOLD + "Charge speed: "+ BobMathUtil.getShortNumber(this.maxPower / 200) + "HE");
list.add(EnumChatFormatting.GOLD + "Discharge speed: "+ BobMathUtil.getShortNumber(this.maxPower / 600) + "HE");
list.add(EnumChatFormatting.YELLOW + "" + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "/" + BobMathUtil.getShortNumber(this.maxPower) + "HE");
}
}

View File

@ -109,6 +109,9 @@ public class MachineCapacitor extends BlockContainer implements ILookOverlay, IP
@Override
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
list.add(EnumChatFormatting.GOLD + "Stores up to "+ BobMathUtil.getShortNumber(this.power) + "HE");
list.add(EnumChatFormatting.GOLD + "Charge speed: "+ BobMathUtil.getShortNumber(this.power / 200) + "HE");
list.add(EnumChatFormatting.GOLD + "Discharge speed: "+ BobMathUtil.getShortNumber(this.power / 600) + "HE");
list.add(EnumChatFormatting.YELLOW + "" + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "/" + BobMathUtil.getShortNumber(persistentTag.getLong("maxPower")) + "HE");
}
@ -249,6 +252,14 @@ public class MachineCapacitor extends BlockContainer implements ILookOverlay, IP
return maxPower;
}
@Override public long getProviderSpeed() {
return this.getMaxPower() / 300;
}
@Override public long getReceiverSpeed() {
return this.getMaxPower() / 100;
}
@Override
public ConnectionPriority getPriority() {
return ConnectionPriority.LOW;

View 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;
}
}

View File

@ -18,6 +18,9 @@ public class ArmorModHandler {
public static final int cladding = 5;
public static final int kevlar = 6;
public static final int extra = 7;
public static final int battery = 8;
public static final int MOD_SLOTS = 9;
public static final UUID[] UUIDs = new UUID[] {
UUID.fromString("8d6e5c77-133e-4056-9c80-a9e42a1a0b65"),
@ -131,7 +134,7 @@ public class ArmorModHandler {
}
/**
* Does what the name implies
* Does what the name implies. Returns true if the stack has NBT and that NBT has the MOD_COMPOUND_KEY tag.
* @param armor
* @return
*/
@ -146,7 +149,7 @@ public class ArmorModHandler {
public static ItemStack[] pryMods(ItemStack armor) {
ItemStack[] slots = new ItemStack[8];
ItemStack[] slots = new ItemStack[MOD_SLOTS];
if(!hasMods(armor))
return slots;
@ -154,7 +157,7 @@ public class ArmorModHandler {
NBTTagCompound nbt = armor.getTagCompound();
NBTTagCompound mods = nbt.getCompoundTag(MOD_COMPOUND_KEY);
for(int i = 0; i < 8; i++) {
for(int i = 0; i < MOD_SLOTS; i++) {
NBTTagCompound cmp = mods.getCompoundTag(MOD_SLOT_KEY + i);
@ -168,4 +171,22 @@ public class ArmorModHandler {
return slots;
}
public static ItemStack pryMod(ItemStack armor, int slot) {
if(!hasMods(armor))
return null;
NBTTagCompound nbt = armor.getTagCompound();
NBTTagCompound mods = nbt.getCompoundTag(MOD_COMPOUND_KEY);
NBTTagCompound cmp = mods.getCompoundTag(MOD_SLOT_KEY + slot);
ItemStack stack = ItemStack.loadItemStackFromNBT(cmp);
if(stack != null)
return stack;
removeMod(armor, slot);
return null;
}
}

View File

@ -1,21 +1,30 @@
package com.hbm.handler;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.RecipesCommon;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import li.cil.oc.api.Items;
import li.cil.oc.api.fs.FileSystem;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.Callable;
import static com.hbm.main.CraftingManager.addShapelessAuto;
import static li.cil.oc.api.FileSystem.asReadOnly;
import static li.cil.oc.api.FileSystem.fromClass;
/**
* General handler for OpenComputers compatibility.
@ -23,13 +32,29 @@ import java.lang.reflect.Array;
*/
public class CompatHandler {
/**
* Used for converting a steam type to an integer (compression levels).
* @param type Steam type.
* @return Object[] array containing an int with the "compression level"
*/
public static Object[] steamTypeToInt(FluidType type) {
if(type == Fluids.STEAM) {return new Object[] {0};}
else if(type == Fluids.HOTSTEAM) {return new Object[] {1};}
else if(type == Fluids.SUPERHOTSTEAM) {return new Object[] {2};}
return new Object[] {3};
switch(type.getID()) {
default:
return new Object[] {0};
case(4): // Fluids.HOTSTEAM
return new Object[] {1};
case(5): // Fluids.SUPERHOTSTEAM
return new Object[] {2};
case(6): // Fluids.ULTRAHOTSTEAM
return new Object[] {3};
}
}
/**
* Used for converting a compression level to a steam type.
* @param arg Steam compression level.
* @return FluidType of the steam type based on the compression level.
*/
public static FluidType intToSteamType(int arg) {
switch(arg) {
default:
@ -43,6 +68,134 @@ public class CompatHandler {
}
}
/**
* Allows for easy creation of read-only filesystems. Primarily for floppy disks.
* (Though maybe reading directly from VOTV drives as filesystems could be implemented. :3)
**/
private static class ReadOnlyFileSystem implements Callable<FileSystem> {
private final String name;
ReadOnlyFileSystem(String name) {
this.name = name;
}
@Override
@Optional.Method(modid = "OpenComputers")
public li.cil.oc.api.fs.FileSystem call() throws Exception {
return asReadOnly(fromClass(MainRegistry.class, RefStrings.MODID, "disks/" + FloppyDisk.sanitizeName(name)));
}
}
// Floppy disk class.
public static class FloppyDisk {
// Specifies the callable ReadOnlyFileSystem to allow OC to access the floppy.
public final ReadOnlyFileSystem fs;
// Specifies the color of the floppy disk (0-16 colors defined by OC).
public final Byte color;
// Set after loading the disk; allows for adding a recipe to the item.
public ItemStack item;
FloppyDisk(String name, int color) {
this.fs = new ReadOnlyFileSystem(FloppyDisk.sanitizeName(name));
this.color = (byte) color;
}
// Disk names will be sanitized before the FileSystem is created.
// This only affects the location/directory, not the display name.
// (Prevents filesystems from breaking/crashing due to having file separators, wildcards, etc.
public static String sanitizeName(String input) {
return input.toLowerCase().replaceAll("\\W", "");
}
}
/**
* Simple enum for mapping OC color ordinals to a nicer format for adding new disks.
*/
public enum OCColors {
BLACK, //0x444444
RED, //0xB3312C
GREEN, //0x339911
BROWN, //0x51301A
BLUE, //0x6666FF
PURPLE, //0x7B2FBE
CYAN, //0x66FFFF
LIGHTGRAY, //0xABABAB
GRAY, //0x666666
PINK, //0xD88198
LIME, //0x66FF66
YELLOW, //0xFFFF66
LIGHTBLUE, //0xAAAAFF
MAGENTA, //0xC354CD
ORANGE, //0xEB8844
WHITE //0xF0F0F0
}
// Where all disks are stored with their name and `FloppyDisk` class.
public static HashMap<String, FloppyDisk> disks = new HashMap<>();
/**
* Called in the FML PostLoad stage, after the OC API loads.
* <br>
* Loads various parts of OC compatibility.
*/
public static void init() {
if(Loader.isModLoaded("OpenComputers")) {
/*
For anyone wanting to add their own floppy disks,
read the README found in assets.hbm.disks.
*/
// Idea/Code by instantnootles
disks.put("PWRangler", new FloppyDisk("PWRangler", OCColors.CYAN.ordinal()));
// begin registering disks
Logger logger = LogManager.getLogger("HBM");
logger.info("Loading OpenComputers disks...");
if(disks.size() == 0) {
logger.info("No disks registered; see com.hbm.handler.CompatHandler.disks");
return;
}
disks.forEach((s, disk) -> {
// Test if the disk path even exists.
FileSystem fs = fromClass(MainRegistry.class, RefStrings.MODID, "disks/" + disk.fs.name);
if (fs == null) { // Disk path does NOT exist, and it should not be loaded.
logger.error("Error loading disk: " + s + " at /assets/" + RefStrings.MODID + "/disks/" + disk.fs.name);
logger.error("This is likely due to the path to the disk being non-existent.");
} else { // Disk path DOES exist, and it should be loaded.
disk.item = Items.registerFloppy(s, disk.color, disk.fs); // The big part, actually registering the floppies!
logger.info("Registered disk: " + s + " at /assets/" + RefStrings.MODID + "/disks/" + disk.fs.name);
}
});
logger.info("OpenComputers disks registered.");
// OC disk recipes!
List<ItemStack> floppyDisks = new RecipesCommon.OreDictStack("oc:floppy").toStacks();
if(floppyDisks.size() > 0) { //check that floppy disks even exist in oredict.
// Recipes must be initialized here, since if they were initialized in `CraftingManager` then the disk item would not be created yet.
addShapelessAuto(disks.get("PWRangler").item, new Object[] {"oc:floppy", new ItemStack(ModBlocks.pwr_casing)});
logger.info("OpenComputers disk recipe added for PWRangler.");
} else {
logger.info("OpenComputers floppy disk oredict not found, recipes cannot be loaded!");
}
// boom, OC disks loaded
logger.info("OpenComputers disks loaded.");
}
}
// Null component name, default to this if broken to avoid NullPointerExceptions.
public static final String nullComponent = "ntm_null";
/**
* This is an interface made specifically for adding OC compatibility to NTM machines. The {@link li.cil.oc.api.network.SimpleComponent} interface must also be implemented in the TE.
* <br>
@ -54,11 +207,10 @@ public class CompatHandler {
@Optional.InterfaceList({
@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
@Optional.Interface(iface = "li.cil.oc.api.network.SidedComponent", modid = "OpenComputers"),
@Optional.Interface(iface = "li.cil.oc.api.network.Analyzable", modid = "OpenComputers"),
@Optional.Interface(iface = "li.cil.oc.api.network.ManagedPeripheral", modid = "OpenComputers"),
})
@SimpleComponent.SkipInjection // make sure OC doesn't inject this shit into the interface and crash
public interface OCComponent extends SimpleComponent, SidedComponent, Analyzable, ManagedPeripheral {
public interface OCComponent extends SimpleComponent, SidedComponent, ManagedPeripheral {
/**
* Must be overridden in the implemented TE, or it will default to "ntm_null".
@ -69,7 +221,7 @@ public class CompatHandler {
@Override
@Optional.Method(modid = "OpenComputers")
default String getComponentName() {
return "ntm_null";
return nullComponent;
}
/**
@ -83,31 +235,6 @@ public class CompatHandler {
return true;
}
/**
* Function to give more information when analyzing the block. Multiple entries in the array will be sent to the user in the order of the array.
* @return Additional text to add in the form of lang entries (ex: "analyze.basic2").
*/
@Optional.Method(modid = "OpenComputers")
default String[] getExtraInfo() {return new String[] {"analyze.noInfo"};}
@Override
@Optional.Method(modid = "OpenComputers")
default Node[] onAnalyze(EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic1").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic2").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic3").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
player.addChatComponentMessage(new ChatComponentTranslation("analyze.name", this.getComponentName()).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
String[] extraInfo = getExtraInfo();
for (String info : extraInfo) {
if(!info.equals(""))
player.addChatComponentMessage(new ChatComponentTranslation(info).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
}
TileEntity te = (TileEntity) this;
if((Array.getLength(this.methods()) == 0 && te instanceof TileEntityProxyCombo) || this.getComponentName().equals("ntm_null"))
player.addChatComponentMessage(new ChatComponentTranslation("analyze.error").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
return null;
}
/**
* Standard methods array from {@link li.cil.oc.api.network.ManagedPeripheral} extending {@link li.cil.oc.api.network.SimpleComponent}.
* @return Array of methods to expose to the computer.

View File

@ -161,7 +161,7 @@ public class RefineryRecipeHandler extends TemplateRecipeHandler implements ICom
transferRectsGui = new LinkedList<RecipeTransferRect>();
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"));
guiGui.add(GUIMachineRefinery.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);

View File

@ -19,20 +19,21 @@ import net.minecraft.util.IIcon;
public class ContainerArmorTable extends Container {
public InventoryBasic upgrades = new InventoryBasic("Upgrades", false, 8);
public InventoryBasic upgrades = new InventoryBasic("Upgrades", false, ArmorModHandler.MOD_SLOTS);
public IInventory armor = new InventoryCraftResult();
public ContainerArmorTable(InventoryPlayer inventory) {
EntityPlayer player = inventory.player;
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.helmet_only, 26 + 22, 27)); // helmet only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.plate_only, 62 + 22, 27)); // chestplate only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.plate_only, 62 + 22, 27)); // chestplate only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.legs_only, 98 + 22, 27)); // leggins only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.boots_only, 134 + 22, 45)); // boots only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.servos, 134 + 22, 81)); //servos/frame
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.cladding, 98 + 22, 99)); //radiation cladding
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.kevlar, 62 + 22, 99)); //kevlar/sapi/(ERA? :) )
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.kevlar, 62 + 22, 99)); //kevlar/sapi/(ERA? :) )
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.extra, 26 + 22, 99)); //special parts
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.battery, 8 + 22, 63)); //special parts
this.addSlotToContainer(new Slot(armor, 0, 44 + 22, 63) {
@ -48,7 +49,7 @@ public class ContainerArmorTable extends Container {
if(stack != null) {
ItemStack[] mods = ArmorModHandler.pryMods(stack);
for(int i = 0; i < 8; i++) {
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
if(mods != null)
upgrades.setInventorySlotContents(i, mods[i]);
@ -65,7 +66,7 @@ public class ContainerArmorTable extends Container {
//if the armor piece is taken, absorb all armor pieces
for(int i = 0; i < 8; i++) {
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
ItemStack mod = upgrades.getStackInSlot(i);
@ -126,19 +127,19 @@ public class ContainerArmorTable extends Container {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if(par2 <= 8) {
if(par2 != 8 || !InventoryUtil.mergeItemStack(this.inventorySlots, var5, 9, 13, false))
if(!this.mergeItemStack(var5, 13, this.inventorySlots.size(), true))
if(par2 <= ArmorModHandler.MOD_SLOTS) {
if(par2 != ArmorModHandler.MOD_SLOTS || !InventoryUtil.mergeItemStack(this.inventorySlots, var5, ArmorModHandler.MOD_SLOTS + 1, ArmorModHandler.MOD_SLOTS + 5, false))
if(!this.mergeItemStack(var5, ArmorModHandler.MOD_SLOTS + 5, this.inventorySlots.size(), true))
return null;
var4.onPickupFromSlot(p_82846_1_, var5);
} else {
if(var5.getItem() instanceof ItemArmor) {
if(!this.mergeItemStack(var5, 8, 9, false))
if(!this.mergeItemStack(var5, ArmorModHandler.MOD_SLOTS, ArmorModHandler.MOD_SLOTS + 1, false))
return null;
} else if(this.inventorySlots.get(8) != null && var5.getItem() instanceof ItemArmorMod) {
} else if(this.inventorySlots.get(ArmorModHandler.MOD_SLOTS) != null && var5.getItem() instanceof ItemArmorMod) {
ItemArmorMod mod = (ItemArmorMod)var5.getItem();
int slot = mod.type;

View File

@ -46,15 +46,16 @@ public class GUIArmorTable extends GuiInfoContainer {
"armorMod.type.cladding",
"armorMod.type.insert",
"armorMod.type.special",
"armorMod.type.battery",
"armorMod.insertHere"
};
for(int i = 0; i < 9; ++i) {
for(int i = 0; i < ArmorModHandler.MOD_SLOTS + 1; ++i) {
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
if(this.isMouseOverSlot(slot, x, y) && !slot.getHasStack()) {
this.drawCreativeTabHoveringText((i < 8 ? EnumChatFormatting.LIGHT_PURPLE : EnumChatFormatting.YELLOW) + I18nUtil.resolveKey(unloc[i]), x, y);
this.drawCreativeTabHoveringText((i < ArmorModHandler.MOD_SLOTS ? EnumChatFormatting.LIGHT_PURPLE : EnumChatFormatting.YELLOW) + I18nUtil.resolveKey(unloc[i]), x, y);
}
}
}
@ -75,7 +76,7 @@ public class GUIArmorTable extends GuiInfoContainer {
this.drawTexturedModalRect(guiLeft + 22, guiTop, 0, 0, this.xSize - 22, this.ySize);
this.drawTexturedModalRect(guiLeft, guiTop + 31, 176, 96, 22, 100);
ItemStack armor = this.inventorySlots.getSlot(8).getStack();
ItemStack armor = this.inventorySlots.getSlot(ArmorModHandler.MOD_SLOTS).getStack();
if(armor != null) {
@ -89,7 +90,7 @@ public class GUIArmorTable extends GuiInfoContainer {
this.drawTexturedModalRect(guiLeft + 41 + 22, guiTop + 60, 176, 52, 22, 22);
}
for(int i = 0; i < 8; i++) {
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
Slot slot = this.inventorySlots.getSlot(i);
drawIndicator(i, slot.xDisplayPosition - 1, slot.yDisplayPosition - 1);
}
@ -98,7 +99,7 @@ public class GUIArmorTable extends GuiInfoContainer {
private void drawIndicator(int index, int x, int y) {
ItemStack mod = this.inventorySlots.getSlot(index).getStack();
ItemStack armor = this.inventorySlots.getSlot(8).getStack();
ItemStack armor = this.inventorySlots.getSlot(ArmorModHandler.MOD_SLOTS).getStack();
if(mod == null)
return;

View File

@ -28,7 +28,7 @@ public class GUIMachineRefinery extends GuiInfoContainer {
super(new ContainerMachineRefinery(invPlayer, tedf));
refinery = tedf;
this.xSize = 209;
this.xSize = 210;
this.ySize = 231;
}
@ -84,35 +84,39 @@ public class GUIMachineRefinery extends GuiInfoContainer {
// pipes
Tuple.Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> recipe = RefineryRecipes.getRefinery(inputOil.getTankType());
if(recipe != null) {
GL11.glEnable(GL11.GL_BLEND);
if(recipe == null) {
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
func_146110_a(guiLeft + 52, guiTop + 32, 247, 50, 66, 52, 350, 256);
func_146110_a(guiLeft + 52, guiTop + 24, 247, 145, 86, 35, 350, 256);
func_146110_a(guiLeft + 36, guiTop + 16, 211, 119, 122, 25, 350, 256);
} else {
// Heavy Oil Products
Color color = new Color(recipe.getV().type.getColor());
GL11.glEnable(GL11.GL_BLEND);
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
// Naphtha Oil Products
color = new Color(recipe.getW().type.getColor());
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
func_146110_a(guiLeft + 52, guiTop + 32, 247, 50, 66, 52, 350, 256);
// Light Oil Products
color = new Color(recipe.getX().type.getColor());
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
func_146110_a(guiLeft + 52, guiTop + 24, 247, 145, 86, 35, 350, 256);
// Gaseous Products
color = new Color(recipe.getY().type.getColor());
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
func_146110_a(guiLeft + 36, guiTop + 16, 211, 119, 122, 25, 350, 256);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1F, 1F, 1F, 1F);
}
// output tanks
refinery.tanks[1].renderTank(guiLeft + 86, guiTop + 95, this.zLevel, 16, 52);

View File

@ -2178,6 +2178,9 @@ public class ModItems {
public static Item card_aos;
public static Item card_qos;
public static Item australium_iii;
public static Item armor_battery;
public static Item armor_battery_mk2;
public static Item armor_battery_mk3;
public static Item hazmat_helmet;
public static Item hazmat_plate;
@ -3357,6 +3360,9 @@ public class ModItems {
card_aos = new ItemModCard().setUnlocalizedName("card_aos").setTextureName(RefStrings.MODID + ":card_aos");
card_qos = new ItemModCard().setUnlocalizedName("card_qos").setTextureName(RefStrings.MODID + ":card_qos");
australium_iii = new ItemModShield(25F).setUnlocalizedName("australium_iii").setTextureName(RefStrings.MODID + ":australium_iii");
armor_battery = new ItemModBattery(1.25D).setUnlocalizedName("armor_battery").setTextureName(RefStrings.MODID + ":armor_battery");
armor_battery_mk2 = new ItemModBattery(1.5D).setUnlocalizedName("armor_battery_mk2").setTextureName(RefStrings.MODID + ":armor_battery_mk2");
armor_battery_mk3 = new ItemModBattery(2D).setUnlocalizedName("armor_battery_mk3").setTextureName(RefStrings.MODID + ":armor_battery_mk3");
cap_nuka = new Item().setUnlocalizedName("cap_nuka").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_nuka");
cap_quantum = new Item().setUnlocalizedName("cap_quantum").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_quantum");
@ -7402,6 +7408,9 @@ public class ModItems {
GameRegistry.registerItem(card_aos, card_aos.getUnlocalizedName());
GameRegistry.registerItem(card_qos, card_qos.getUnlocalizedName());
GameRegistry.registerItem(australium_iii, australium_iii.getUnlocalizedName());
GameRegistry.registerItem(armor_battery, armor_battery.getUnlocalizedName());
GameRegistry.registerItem(armor_battery_mk2, armor_battery_mk2.getUnlocalizedName());
GameRegistry.registerItem(armor_battery_mk3, armor_battery_mk3.getUnlocalizedName());
//Chaos
GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName());

View File

@ -2,6 +2,7 @@ package com.hbm.items.armor;
import java.util.List;
import com.hbm.handler.ArmorModHandler;
import com.hbm.util.BobMathUtil;
import api.hbm.energymk2.IBatteryItem;
@ -30,9 +31,7 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(getMaxCharge(stack)));
super.addInformation(stack, player, list, ext);
}
@ -72,7 +71,7 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", this.maxPower - i);
stack.stackTagCompound.setLong("charge", getMaxCharge(stack) - i);
}
if(stack.stackTagCompound.getLong("charge") < 0)
@ -84,10 +83,10 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
public long getCharge(ItemStack stack) {
if(stack.getItem() instanceof ArmorFSBPowered) {
if(stack.hasTagCompound()) {
return stack.stackTagCompound.getLong("charge");
return Math.min(stack.stackTagCompound.getLong("charge"), getMaxCharge(stack));
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", ((ArmorFSBPowered) stack.getItem()).maxPower);
stack.stackTagCompound.setLong("charge", getMaxCharge(stack));
return stack.stackTagCompound.getLong("charge");
}
}
@ -97,18 +96,23 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
@Override
public boolean showDurabilityBar(ItemStack stack) {
return getCharge(stack) < maxPower;
return getCharge(stack) < getMaxCharge(stack);
}
@Override
public double getDurabilityForDisplay(ItemStack stack) {
return 1 - (double) getCharge(stack) / (double) maxPower;
return 1 - (double) getCharge(stack) / (double) getMaxCharge(stack);
}
@Override
public long getMaxCharge() {
public long getMaxCharge(ItemStack stack) {
if(ArmorModHandler.hasMods(stack)) {
ItemStack mod = ArmorModHandler.pryMod(stack, ArmorModHandler.battery);
if(mod != null && mod.getItem() instanceof ItemModBattery) {
return (long) (maxPower * ((ItemModBattery) mod.getItem()).mod);
}
}
return maxPower;
}

View File

@ -108,7 +108,7 @@ public class ArmorHEV extends ArmorFSBPowered {
ItemStack armor = player.inventory.armorInventory[i];
ArmorFSBPowered item = ((ArmorFSBPowered) player.inventory.armorInventory[i].getItem());
c += (double) item.getCharge(armor) / (double) item.getMaxCharge();
c += (double) item.getCharge(armor) / (double) item.getMaxCharge(armor);
}
int aX = (int) (70 / scale);

View File

@ -64,6 +64,7 @@ public class ItemArmorMod extends Item {
case ArmorModHandler.cladding: list.add(" " + I18nUtil.resolveKey("armorMod.type.cladding")); break;
case ArmorModHandler.kevlar: list.add(" " + I18nUtil.resolveKey("armorMod.type.insert")); break;
case ArmorModHandler.extra: list.add(" " + I18nUtil.resolveKey("armorMod.type.special")); break;
case ArmorModHandler.battery: list.add(" " + I18nUtil.resolveKey("armorMod.type.battery")); break;
}
}

View 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;
}
}

View File

@ -30,7 +30,7 @@ public class ItemPancake extends ItemFood {
continue;
if(st.getItem() instanceof IBatteryItem) {
((IBatteryItem)st.getItem()).setCharge(st, ((IBatteryItem)st.getItem()).getMaxCharge());
((IBatteryItem)st.getItem()).setCharge(st, ((IBatteryItem)st.getItem()).getMaxCharge(st));
}
}
}

View File

@ -105,14 +105,17 @@ public class ItemBattery extends Item implements IBatteryItem {
return 0;
}
public long getMaxCharge() {
@Override
public long getMaxCharge(ItemStack stack) {
return maxCharge;
}
@Override
public long getChargeRate() {
return chargeRate;
}
@Override
public long getDischargeRate() {
return dischargeRate;
}
@ -134,7 +137,7 @@ public class ItemBattery extends Item implements IBatteryItem {
if(item instanceof ItemBattery) {
ItemStack stack = new ItemStack(item);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", ((ItemBattery) item).getMaxCharge());
stack.stackTagCompound.setLong("charge", ((ItemBattery) item).getMaxCharge(stack));
return stack.copy();
}
@ -146,7 +149,7 @@ public class ItemBattery extends Item implements IBatteryItem {
}
public double getDurabilityForDisplay(ItemStack stack) {
return 1D - (double) getCharge(stack) / (double) getMaxCharge();
return 1D - (double) getCharge(stack) / (double) getMaxCharge(stack);
}
@Override

View File

@ -38,7 +38,7 @@ public class ItemSelfcharger extends Item implements IBatteryItem {
}
@Override
public long getMaxCharge() {
public long getMaxCharge(ItemStack stack) {
return charge;
}

View File

@ -241,7 +241,7 @@ public class ItemGlitch extends Item implements IBatteryItem {
@Override public void setCharge(ItemStack stack, long i) { }
@Override public void dischargeBattery(ItemStack stack, long i) { }
@Override public long getCharge(ItemStack stack) { return 200; }
@Override public long getMaxCharge() { return 200; }
@Override public long getMaxCharge(ItemStack stack) { return 200; }
@Override public long getChargeRate() { return 0; }
@Override public long getDischargeRate() { return 200; }
}

View File

@ -28,7 +28,7 @@ public class ItemPotatos extends ItemBattery {
if(p.getHeldItem() == stack) {
float pitch = (float)getCharge(stack) / (float)this.getMaxCharge() * 0.5F + 0.5F;
float pitch = (float)getCharge(stack) / (float)this.getMaxCharge(stack) * 0.5F + 0.5F;
world.playSoundAtEntity(p, "hbm:potatos.random", 1.0F, pitch);
setTimer(stack, 200 + itemRand.nextInt(100));

View File

@ -33,7 +33,7 @@ public class ItemFusionCore extends Item {
if(st.getItem() instanceof IBatteryItem) {
long maxcharge = ((IBatteryItem) st.getItem()).getMaxCharge();
long maxcharge = ((IBatteryItem) st.getItem()).getMaxCharge(st);
long charge = ((IBatteryItem) st.getItem()).getCharge(st);
long newcharge = Math.min(charge + this.charge, maxcharge);

View File

@ -4,13 +4,13 @@ import com.hbm.items.special.ItemBedrockOreBase;
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.PlayerInformPacket;
import com.hbm.util.ChatBuilder;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
public class ItemOreDensityScanner extends Item {
@ -25,18 +25,31 @@ public class ItemOreDensityScanner extends Item {
for(BedrockOreType type : BedrockOreType.values()) {
double level = ItemBedrockOreBase.getOreLevel((int) Math.floor(player.posX), (int) Math.floor(player.posZ), type);
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(
StatCollector.translateToLocalFormatted("item.bedrock_ore.type." + type.suffix + ".name") + ": " + ((int) (level * 100) / 100D) + " (" + translateDensity(level) + EnumChatFormatting.RESET + ")",
ChatBuilder.startTranslation("item.bedrock_ore.type." + type.suffix + ".name")
.next(": " + ((int) (level * 100) / 100D) + " (")
.nextTranslation(translateDensity(level)).color(getColor(level))
.next(")").color(EnumChatFormatting.RESET).flush(),
777 + type.ordinal(), 4000), player);
}
}
public static String translateDensity(double density) {
if(density <= 0.1) return EnumChatFormatting.DARK_RED + "Very poor";
if(density <= 0.35) return EnumChatFormatting.RED + "Poor";
if(density <= 0.75) return EnumChatFormatting.GOLD + "Low";
if(density >= 1.9) return EnumChatFormatting.AQUA + "Excellent";
if(density >= 1.65) return EnumChatFormatting.BLUE + "Very high";
if(density >= 1.25) return EnumChatFormatting.GREEN + "High";
return EnumChatFormatting.YELLOW + "Moderate";
if(density <= 0.1) return "item.ore_density_scanner.verypoor";
if(density <= 0.35) return "item.ore_density_scanner.poor";
if(density <= 0.75) return "item.ore_density_scanner.low";
if(density >= 1.9) return "item.ore_density_scanner.excellent";
if(density >= 1.65) return "item.ore_density_scanner.veryhigh";
if(density >= 1.25) return "item.ore_density_scanner.high";
return "item.ore_density_scanner.moderate";
}
public static EnumChatFormatting getColor(double density) {
if(density <= 0.1) return EnumChatFormatting.DARK_RED;
if(density <= 0.35) return EnumChatFormatting.RED;
if(density <= 0.75) return EnumChatFormatting.GOLD;
if(density >= 1.9) return EnumChatFormatting.AQUA;
if(density >= 1.65) return EnumChatFormatting.BLUE;
if(density >= 1.25) return EnumChatFormatting.GREEN;
return EnumChatFormatting.YELLOW;
}
}

View File

@ -106,7 +106,7 @@ public class ItemSwordAbilityPower extends ItemSwordAbility implements IBatteryI
}
@Override
public long getMaxCharge() {
public long getMaxCharge(ItemStack stack) {
return maxPower;
}

View File

@ -102,7 +102,7 @@ public class ItemToolAbilityPower extends ItemToolAbility implements IBatteryIte
}
@Override
public long getMaxCharge() {
public long getMaxCharge(ItemStack stack) {
return maxPower;
}

View File

@ -181,7 +181,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
}
public double getDurabilityForDisplay(ItemStack stack) {
return 1D - (double) getCharge(stack) / (double) getMaxCharge();
return 1D - (double) getCharge(stack) / (double) getMaxCharge(stack);
}
@Override
@ -236,7 +236,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
}
@Override
public long getMaxCharge() {
public long getMaxCharge(ItemStack stack) {
return mainConfig.maxCharge;
}
@ -266,7 +266,7 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
ItemStack stack = new ItemStack(item);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase) item).getMaxCharge());
stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase) item).getMaxCharge(stack));
list.add(stack);
}

View File

@ -243,7 +243,7 @@ public class Library {
IBatteryItem battery = (IBatteryItem) slots[index].getItem();
long batMax = battery.getMaxCharge();
long batMax = battery.getMaxCharge(slots[index]);
long batCharge = battery.getCharge(slots[index]);
long batRate = battery.getChargeRate();
long toCharge = Math.min(Math.min(power, batRate), batMax - batCharge);

View File

@ -257,6 +257,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFrackingTower.class, new RenderFrackingTower());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbofan.class, new RenderTurbofan());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbineGas.class, new RenderTurbineGas());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLPW2.class, new RenderLPW2());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePress.class, new RenderPress());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());

View File

@ -408,8 +408,8 @@ public class CraftingManager {
String dyeName = "dye" + dyes[15 - i];
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored, 8, i), new Object[] { "CCC", "CDC", "CCC", 'C', ModBlocks.concrete_smooth, 'D', dyeName });
}
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { ModBlocks.concrete_colored });
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { ModBlocks.concrete_colored_ext });
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { new ItemStack(ModBlocks.concrete_colored, 1, OreDictionary.WILDCARD_VALUE) });
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { new ItemStack(ModBlocks.concrete_colored_ext, 1, OreDictionary.WILDCARD_VALUE) });
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored_ext, 6, EnumConcreteType.MACHINE.ordinal()), new Object[] { "CCC", "1 2", "CCC", 'C', ModBlocks.concrete_smooth, '1', KEY_BROWN, '2', KEY_GRAY });
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored_ext, 6, EnumConcreteType.MACHINE_STRIPE.ordinal()), new Object[] { "CCC", "1 2", "CCC", 'C', ModBlocks.concrete_smooth, '1', KEY_BROWN, '2', KEY_BLACK });
@ -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, 16), new Object[] { "G", "S", "C", 'G', Blocks.glowstone, 'S', STEEL.block(), 'C', ModItems.coil_copper_torus });
addRecipeAuto(new ItemStack(ModBlocks.press_preheater), new Object[] { "CCC", "SLS", "TST", 'C', CU.plate(), 'S', Blocks.stone, 'L', Fluids.LAVA.getDict(1000), 'T', W.ingot() });
addRecipeAuto(new ItemStack(ModItems.fluid_identifier_multi), new Object[] { "D", "C", "P", 'D', "dye", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'P', ANY_PLASTIC.ingot() });
addRecipeAuto(new ItemStack(ModItems.fluid_identifier_multi), new Object[] { "D", "C", "P", 'D', "dye", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ANALOG), 'P', IRON.plate() });
addShapelessAuto(ItemBattery.getEmptyBattery(ModItems.anchor_remote), new Object[] { DIAMOND.gem(), ModItems.ducttape, DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) });
addRecipeAuto(new ItemStack(ModBlocks.teleanchor), new Object[] { "ODO", "EAE", "ODO", 'O', Blocks.obsidian, 'D', DIAMOND.gem(), 'E', ModItems.powder_magic, 'A', ModItems.gem_alexandrite });

View File

@ -877,7 +877,10 @@ public class MainRegistry {
proxy.registerMissileItems();
BlockMotherOfAllOres.init();
// Load compatibility for OC.
CompatHandler.init();
//expand for the largest entity we have (currently Quackos who is 17.5m in diameter, that's one fat duck)
World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75);
@ -1418,6 +1421,7 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.gas6");
ignoreMappings.add("hbm:item.gas7");
ignoreMappings.add("hbm:item.gas8");
ignoreMappings.add("hbm:tile.brick_forgotten");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -233,6 +233,9 @@ public class ResourceManager {
//ICF
public static final IModelCustom icf = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/icf.obj")).asVBO();
//ICF
public static final IModelCustom lpw2 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/lpw2.obj")).asVBO();
//Watz
public static final IModelCustom watz = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/watz.obj")).asVBO();
public static final IModelCustom watz_pump = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/watz_pump.obj")).asVBO();
@ -648,6 +651,11 @@ public class ResourceManager {
//ICF
public static final ResourceLocation icf_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/icf.png");
//Fat Fuck
public static final ResourceLocation lpw2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2.png");
public static final ResourceLocation lpw2_term_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2_term.png");
public static final ResourceLocation lpw2_error_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2_term_error.png");
//Watz
public static final ResourceLocation watz_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz.png");
public static final ResourceLocation watz_pump_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz_pump.png");

View File

@ -3,12 +3,16 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.ResourceManager;
import com.hbm.render.item.ItemRenderBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
public class RenderICF extends TileEntitySpecialRenderer {
public class RenderICF extends TileEntitySpecialRenderer implements IItemRendererProvider {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
@ -34,4 +38,26 @@ public class RenderICF extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.icf);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -1.5, 0);
double scale = 2.125;
GL11.glScaled(scale, scale, scale);
}
public void renderCommon() {
GL11.glScaled(0.5, 0.5, 0.5);
GL11.glRotatef(90, 0F, 1F, 0F);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.icf_tex); ResourceManager.icf.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}};
}
}

View 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();
}
}

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity;
import api.hbm.block.ICrucibleAcceptor;
import com.hbm.handler.CompatHandler;
import com.hbm.handler.CompatHandler.OCComponent;
import com.hbm.inventory.fluid.FluidType;
@ -8,6 +9,7 @@ import api.hbm.energymk2.IEnergyReceiverMK2;
import api.hbm.fluid.IFluidConnector;
import api.hbm.tile.IHeatSource;
import com.hbm.inventory.material.Mats;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Context;
@ -32,7 +34,11 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
boolean fluid;
boolean heat;
public boolean moltenMetal;
// due to some issues with OC deciding that it's gonna call the component name function before the worldObj is loaded
// the component name must be cached to prevent it from shitting itself
String componentName = CompatHandler.nullComponent;
public TileEntityProxyCombo() { }
public TileEntityProxyCombo(boolean inventory, boolean power, boolean fluid) {
@ -344,6 +350,9 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
this.fluid = nbt.getBoolean("fluid");
this.moltenMetal = nbt.getBoolean("metal");
this.heat = nbt.getBoolean("heat");
if(Loader.isModLoaded("OpenComputers"))
this.componentName = nbt.getString("ocname");
}
@Override
@ -355,6 +364,8 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
nbt.setBoolean("fluid", fluid);
nbt.setBoolean("metal", moltenMetal);
nbt.setBoolean("heat", heat);
if(Loader.isModLoaded("OpenComputers"))
nbt.setString("ocname", componentName);
}
@Override
@ -452,27 +463,27 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
@Override // please work
@Optional.Method(modid = "OpenComputers")
public String getComponentName() {
if(this.getTile() instanceof OCComponent)
return ((OCComponent) this.getTile()).getComponentName();
if(this.worldObj == null) // OC is going too fast, grab from NBT!
return componentName;
if(this.getTile() instanceof OCComponent) {
if (componentName == null || componentName.equals(OCComponent.super.getComponentName())) {
componentName = ((OCComponent) this.getTile()).getComponentName();
}
return componentName;
}
return OCComponent.super.getComponentName();
}
@Override
@Optional.Method(modid = "OpenComputers")
public boolean canConnectNode(ForgeDirection side) { //thank you vaer
public boolean canConnectNode(ForgeDirection side) {
if(this.getTile() instanceof OCComponent)
return (this.getTile().getBlockMetadata() & 6) == 6 && ((OCComponent) this.getTile()).canConnectNode(side);
return (this.getBlockMetadata() >= 6 && this.getBlockMetadata() <= 11)
&& (power || fluid) &&
((OCComponent) this.getTile()).canConnectNode(side);
return OCComponent.super.canConnectNode(null);
}
@Override
@Optional.Method(modid = "OpenComputers")
public String[] getExtraInfo() {
if(this.getTile() instanceof OCComponent)
return new String[] {"analyze.dummy"};
return OCComponent.super.getExtraInfo();
}
@Override
@Optional.Method(modid = "OpenComputers")
public String[] methods() {

View File

@ -95,6 +95,7 @@ public class TileMappings {
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
put(TileEntityMachineTurbineGas.class, "tileentity_machine_gasturbine");
put(TileEntityMachineLPW2.class, "tileentity_machine_lpw2");
put(TileEntityCrateTemplate.class, "tileentity_crate_template");
put(TileEntityCrateIron.class, "tileentity_crate_iron");
put(TileEntityCrateSteel.class, "tileentity_crate_steel");

View File

@ -103,12 +103,12 @@ public class TileEntityNukeBalefire extends TileEntityMachineBase implements IGU
public int getBattery() {
if(slots[1] != null && slots[1].getItem() == ModItems.battery_spark &&
((IBatteryItem)ModItems.battery_spark).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_spark).getMaxCharge()) {
((IBatteryItem)ModItems.battery_spark).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_spark).getMaxCharge(slots[1])) {
return 1;
}
if(slots[1] != null && slots[1].getItem() == ModItems.battery_trixite &&
((IBatteryItem)ModItems.battery_trixite).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_trixite).getMaxCharge()) {
((IBatteryItem)ModItems.battery_trixite).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_trixite).getMaxCharge(slots[1])) {
return 2;
}

View File

@ -1,10 +1,15 @@
package com.hbm.tileentity.machine;
import java.io.IOException;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.inventory.OreDictManager.DictFrame;
import com.hbm.inventory.container.ContainerAshpit;
import com.hbm.inventory.gui.GUIAshpit;
import com.hbm.items.ItemEnums.EnumAshType;
import com.hbm.items.ModItems;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
@ -19,7 +24,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvider {
public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvider, IConfigurableMachine {
private int playersUsing = 0;
public float doorAngle = 0;
@ -32,10 +37,40 @@ public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvi
public int ashLevelFly;
public int ashLevelSoot;
//Configurable values
public static int thresholdWood = 2000;
public static int thresholdCoal = 2000;
public static int thresholdMisc = 2000;
public static int thresholdFly = 2000;
public static int thresholdSoot = 8000;
public TileEntityAshpit() {
super(5);
}
@Override
public String getConfigName() {
return "ashpit";
}
@Override
public void readIfPresent(JsonObject obj) {
thresholdWood = IConfigurableMachine.grab(obj, "I:thresholdWood", thresholdWood);
thresholdCoal = IConfigurableMachine.grab(obj, "I:thresholdCoal", thresholdCoal);
thresholdMisc = IConfigurableMachine.grab(obj, "I:thresholdMisc", thresholdMisc);
thresholdFly = IConfigurableMachine.grab(obj, "I:thresholdFly", thresholdFly);
thresholdSoot = IConfigurableMachine.grab(obj, "I:thresholdSoot", thresholdSoot);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("I:thresholdWood").value(thresholdWood);
writer.name("I:thresholdCoal").value(thresholdCoal);
writer.name("I:thresholdMisc").value(thresholdMisc);
writer.name("I:thresholdFly").value(thresholdFly);
writer.name("I:thresholdSoot").value(thresholdSoot);
}
@Override
public void openInventory() {
if(!worldObj.isRemote) this.playersUsing++;
@ -56,13 +91,12 @@ public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvi
if(!worldObj.isRemote) {
int threshold = 2000;
if(processAsh(ashLevelWood, EnumAshType.WOOD, threshold)) ashLevelWood -= threshold;
if(processAsh(ashLevelCoal, EnumAshType.COAL, threshold)) ashLevelCoal -= threshold;
if(processAsh(ashLevelMisc, EnumAshType.MISC, threshold)) ashLevelMisc -= threshold;
if(processAsh(ashLevelFly, EnumAshType.FLY, threshold)) ashLevelFly -= threshold;
if(processAsh(ashLevelSoot, EnumAshType.SOOT, threshold * 4)) ashLevelSoot -= threshold * 4;
if(processAsh(ashLevelWood, EnumAshType.WOOD, thresholdWood)) ashLevelWood -= thresholdWood;
if(processAsh(ashLevelCoal, EnumAshType.COAL, thresholdCoal)) ashLevelCoal -= thresholdCoal;
if(processAsh(ashLevelMisc, EnumAshType.MISC, thresholdMisc)) ashLevelMisc -= thresholdMisc;
if(processAsh(ashLevelFly, EnumAshType.FLY, thresholdFly)) ashLevelFly -= thresholdFly;
if(processAsh(ashLevelSoot, EnumAshType.SOOT, thresholdSoot)) ashLevelSoot -= thresholdSoot;
isFull = false;

View File

@ -47,7 +47,7 @@ public class TileEntityCharger extends TileEntityLoadedBase implements IEnergyRe
if(stack != null && stack.getItem() instanceof IBatteryItem) {
IBatteryItem battery = (IBatteryItem) stack.getItem();
charge += Math.min(battery.getMaxCharge() - battery.getCharge(stack), battery.getChargeRate());
charge += Math.min(battery.getMaxCharge(stack) - battery.getCharge(stack), battery.getChargeRate());
}
}
}
@ -127,7 +127,7 @@ public class TileEntityCharger extends TileEntityLoadedBase implements IEnergyRe
if(stack != null && stack.getItem() instanceof IBatteryItem) {
IBatteryItem battery = (IBatteryItem) stack.getItem();
long toCharge = Math.min(battery.getMaxCharge() - battery.getCharge(stack), battery.getChargeRate());
long toCharge = Math.min(battery.getMaxCharge(stack) - battery.getCharge(stack), battery.getChargeRate());
toCharge = Math.min(toCharge, power / 5);
battery.chargeBattery(stack, toCharge);
power -= toCharge;

View File

@ -1,7 +1,10 @@
package com.hbm.tileentity.machine;
import java.util.Random;
import java.io.IOException;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.CompatHandler;
import com.hbm.inventory.fluid.FluidType;
@ -13,6 +16,7 @@ import com.hbm.main.MainRegistry;
import com.hbm.packet.NBTPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.CompatEnergyControl;
@ -36,10 +40,9 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine {
public long power;
public static final long maxPower = 100000000000L;
private int turnTimer;
public float rotor;
public float lastRotor;
@ -50,16 +53,46 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
private AudioWrapper audio;
private float audioDesync;
//Configurable values
public static long maxPower = 100000000000L;
public static int inputTankSize = 1_000_000_000;
public static int outputTankSize = 1_000_000_000;
public static double efficiency = 0.85D;
public TileEntityChungus() {
tanks = new FluidTank[2];
tanks[0] = new FluidTank(Fluids.STEAM, 1_000_000_000);
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 1_000_000_000);
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
Random rand = new Random();
audioDesync = rand.nextFloat() * 0.05F;
}
@Override
public String getConfigName() {
return "steamturbineLeviathan";
}
@Override
public void readIfPresent(JsonObject obj) {
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("L:maxPower").value(maxPower);
writer.name("INFO").value("leviathan steam turbine consumes all availible steam per tick");
writer.name("I:inputTankSize").value(inputTankSize);
writer.name("I:outputTankSize").value(outputTankSize);
writer.name("D:efficiency").value(efficiency);
}
@Override
public void updateEntity() {
@ -72,7 +105,7 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
boolean valid = false;
if(in.hasTrait(FT_Coolable.class)) {
FT_Coolable trait = in.getTrait(FT_Coolable.class);
double eff = trait.getEfficiency(CoolingType.TURBINE) * 0.85D; //85% efficiency
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //85% efficiency by default
if(eff > 0) {
tanks[1].setTankType(trait.coolsTo);
int inputOps = tanks[0].getFill() / trait.amountReq;

View File

@ -1,8 +1,13 @@
package com.hbm.tileentity.machine;
import java.io.IOException;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.saveddata.TomSaveData;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.CompatEnergyControl;
@ -12,7 +17,7 @@ import api.hbm.tile.IInfoProviderEC;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.EnumSkyBlock;
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC {
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC, IConfigurableMachine {
public int age = 0;
public FluidTank[] tanks;
@ -20,11 +25,34 @@ public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidS
public int waterTimer = 0;
protected int throughput;
//Configurable values
public static int inputTankSize = 100;
public static int outputTankSize = 100;
public TileEntityCondenser() {
tanks = new FluidTank[2];
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 100);
tanks[1] = new FluidTank(Fluids.WATER, 100);
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSize);
tanks[1] = new FluidTank(Fluids.WATER, outputTankSize);
}
@Override
public String getConfigName() {
return "condenser";
}
@Override
public void readIfPresent(JsonObject obj) {
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("I:inputTankSize").value(inputTankSize);
writer.name("I:outputTankSize").value(outputTankSize);
}
@Override
public void updateEntity() {

View File

@ -1,8 +1,13 @@
package com.hbm.tileentity.machine;
import java.io.IOException;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energymk2.IEnergyReceiverMK2;
@ -16,16 +21,41 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCondenserPowered extends TileEntityCondenser implements IEnergyReceiverMK2 {
public long power;
public static final long maxPower = 10_000_000;
public float spin;
public float lastSpin;
//Configurable values
public static long maxPower = 10_000_000;
public static int inputTankSizeP = 1_000_000;
public static int outputTankSizeP = 1_000_000;
public static int powerConsumption = 10;
public TileEntityCondenserPowered() {
tanks = new FluidTank[2];
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1_000_000);
tanks[1] = new FluidTank(Fluids.WATER, 1_000_000);
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeP);
tanks[1] = new FluidTank(Fluids.WATER, outputTankSizeP);
}
@Override
public String getConfigName() {
return "condenserPowered";
}
@Override
public void readIfPresent(JsonObject obj) {
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
inputTankSizeP = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSizeP);
outputTankSizeP = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSizeP);
powerConsumption = IConfigurableMachine.grab(obj, "I:powerConsumption", powerConsumption);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("L:maxPower").value(maxPower);
writer.name("I:inputTankSize").value(inputTankSizeP);
writer.name("I:outputTankSize").value(outputTankSizeP);
writer.name("I:powerConsumption").value(powerConsumption);
}
@Override
public void updateEntity() {
super.updateEntity();
@ -63,7 +93,7 @@ public class TileEntityCondenserPowered extends TileEntityCondenser implements I
@Override
public void postConvert(int convert) {
this.power -= convert * 10;
this.power -= convert * powerConsumption;
if(this.power < 0) this.power = 0;
}

View File

@ -111,7 +111,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
}
}
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;
}
}

View File

@ -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;
}
}

View File

@ -1,7 +1,10 @@
package com.hbm.tileentity.machine;
import java.util.Random;
import java.io.IOException;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.CompatHandler;
import com.hbm.inventory.container.ContainerMachineLargeTurbine;
@ -14,6 +17,7 @@ import com.hbm.inventory.gui.GUIMachineLargeTurbine;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.CompatEnergyControl;
@ -39,10 +43,9 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine {
public long power;
public static final long maxPower = 100000000;
public FluidTank[] tanks;
protected double[] info = new double[3];
@ -54,17 +57,46 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
private AudioWrapper audio;
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() {
super(7);
tanks = new FluidTank[2];
tanks[0] = new FluidTank(Fluids.STEAM, 512000);
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 10240000);
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
Random rand = new Random();
audioDesync = rand.nextFloat() * 0.05F;
}
@Override
public String getConfigName() {
return "steamturbineIndustrial";
}
@Override
public void readIfPresent(JsonObject obj) {
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("L:maxPower").value(maxPower);
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
writer.name("I:inputTankSize").value(inputTankSize);
writer.name("I:outputTankSize").value(outputTankSize);
writer.name("D:efficiency").value(efficiency);
}
@Override
public String getName() {
return "container.machineLargeTurbine";
@ -92,7 +124,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
boolean valid = false;
if(in.hasTrait(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) {
tanks[1].setTankType(trait.coolsTo);
int inputOps = (int) Math.floor(tanks[0].getFill() / trait.amountReq); //amount of cycles possible with the entire input buffer

View File

@ -1,5 +1,9 @@
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.inventory.container.ContainerMachineTurbine;
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.gui.GUIMachineTurbine;
import com.hbm.lib.Library;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.tileentity.IBufPacketReceiver;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityLoadedBase;
@ -37,12 +42,11 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class 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[];
public long power;
public static final long maxPower = 1000000;
public int age = 0;
public FluidTank[] tanks;
@ -53,11 +57,40 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
private String customName;
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() {
slots = new ItemStack[7];
tanks = new FluidTank[2];
tanks[0] = new FluidTank(Fluids.STEAM, 64_000);
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 128_000);
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
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
@ -247,12 +280,12 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
boolean valid = false;
if(in.hasTrait(FT_Coolable.class)) {
FT_Coolable trait = in.getTrait(FT_Coolable.class);
double eff = trait.getEfficiency(CoolingType.TURBINE) * 0.85D; //small turbine is only 85% efficient
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //small turbine is only 85% efficient by default
if(eff > 0) {
tanks[1].setTankType(trait.coolsTo);
int inputOps = tanks[0].getFill() / trait.amountReq;
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
int cap = 6_000 / trait.amountReq;
int cap = maxSteamPerTick / trait.amountReq;
int ops = Math.min(inputOps, Math.min(outputOps, cap));
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);

View File

@ -1,10 +1,15 @@
package com.hbm.tileentity.machine;
import java.io.IOException;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.config.GeneralConfig;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.IConfigurableMachine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -15,12 +20,33 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityTowerLarge extends TileEntityCondenser {
//Configurable values
public static int inputTankSizeTL = 10_000;
public static int outputTankSizeTL = 10_000;
public TileEntityTowerLarge() {
tanks = new FluidTank[2];
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 10000);
tanks[1] = new FluidTank(Fluids.WATER, 10000);
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeTL);
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
public void updateEntity() {
super.updateEntity();

View File

@ -1,11 +1,16 @@
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.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.IConfigurableMachine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -15,12 +20,33 @@ import net.minecraft.util.AxisAlignedBB;
public class TileEntityTowerSmall extends TileEntityCondenser {
//Configurable values
public static int inputTankSizeTS = 1_000;
public static int outputTankSizeTS = 1_000;
public TileEntityTowerSmall() {
tanks = new FluidTank[2];
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1000);
tanks[1] = new FluidTank(Fluids.WATER, 1000);
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeTS);
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
public void updateEntity() {
super.updateEntity();

View File

@ -112,12 +112,10 @@ public class TileEntityMachinePumpjack extends TileEntityOilDrillBase {
}
@Override
public void sendUpdate() {
NBTTagCompound data = new NBTTagCompound();
data.setLong("power", power);
data.setInteger("indicator", this.indicator);
data.setFloat("speed", this.indicator == 0 ? (5F + (2F * this.speedLevel)) + (this.overLevel - 1F) * 10: 0F);
this.networkPack(data, 25);
public void networkPack(NBTTagCompound nbt, int range) {
nbt.setFloat("speed", this.indicator == 0 ? (5F + (2F * this.speedLevel)) + (this.overLevel - 1F) * 10: 0F);
super.networkPack(nbt, range);
}
@Override

View File

@ -21,10 +21,10 @@ import com.hbm.util.CompatEnergyControl;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
@ -35,7 +35,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
public class 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 delta = 0;
@ -141,7 +141,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
if(i == 0 && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0) {
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;
}
}
@ -214,13 +214,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
prevPowerState = power;
NBTTagCompound nbt = new NBTTagCompound();
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);
this.networkPackNT(20);
}
}
@ -241,23 +235,34 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
@Override public long getProviderSpeed() {
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() {
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
public void networkUnpack(NBTTagCompound nbt) {
super.networkUnpack(nbt);
public void serialize(ByteBuf buf) {
super.serialize(buf);
this.power = nbt.getLong("power");
this.delta = nbt.getLong("delta");
this.redLow = nbt.getShort("redLow");
this.redHigh = nbt.getShort("redHigh");
this.priority = ConnectionPriority.values()[nbt.getByte("priority")];
buf.writeLong(power);
buf.writeLong(delta);
buf.writeShort(redLow);
buf.writeShort(redHigh);
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

View File

@ -8,7 +8,6 @@ import api.hbm.energymk2.Nodespace;
import api.hbm.energymk2.Nodespace.PowerNode;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
@ -79,13 +78,7 @@ public class TileEntityMachineFENSU extends TileEntityMachineBattery {
this.log[19] = avg;
NBTTagCompound nbt = new NBTTagCompound();
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);
this.networkPackNT(20);
}
if(worldObj.isRemote) {

View File

@ -206,4 +206,15 @@ public class BobMathUtil {
double delta = (beta - alpha + 180) % 360 - 180;
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;
}
}

View File

@ -26,8 +26,8 @@ public class ChatBuilder {
return builder;
}
public static ChatBuilder startTranslation(String text) {
ChatBuilder builder = new ChatBuilder("").nextTranslation(text);
public static ChatBuilder startTranslation(String text, Object... o) {
ChatBuilder builder = new ChatBuilder("").nextTranslation(text, o);
return builder;
}
@ -38,8 +38,8 @@ public class ChatBuilder {
return this;
}
public ChatBuilder nextTranslation(String text) {
ChatComponentTranslation append = new ChatComponentTranslation(text);
public ChatBuilder nextTranslation(String text, Object... o) {
ChatComponentTranslation append = new ChatComponentTranslation(text, o);
this.last.appendSibling(append);
this.last = append;
return this;

View 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).

View File

@ -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," ")

View File

@ -119,6 +119,7 @@ armorMod.chestplates=Brustplatten
armorMod.helmets=Helme
armorMod.leggings=Beinschienen
armorMod.insertHere=Rüstung zum Modifizieren einlegen...
armorMod.type.battery=Batterie
armorMod.type.boots=Stiefel
armorMod.type.chestplate=Brustplatte
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.saturnite.name=Geschmolzene Saturnitelektrode
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.asbestos_boots.name=Hitzeschutzstiefel
item.asbestos_cloth.name=Hitzeschutzanzugsstoff

View File

@ -174,6 +174,7 @@ armorMod.chestplates=Chestplates
armorMod.helmets=Helmets
armorMod.insertHere=Insert armor to modify...
armorMod.leggings=Leggings
armorMod.type.battery=Battery
armorMod.type.boots=Boots
armorMod.type.chestplate=Chestplate
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.saturnite.name=Molten Saturnite 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.asbestos_boots.name=Fire Proximity Boots
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_deepcleaned.name=Deep Cleaned %s Ore
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_nitrated.name=Nitrated %s Ore
item.ore_nitrocrystalline.name=Nitrocrystalline %s Ore

View File

@ -767,7 +767,7 @@ vt 0.306452 0.431818
vt 0.258065 0.045455
vt 0.306452 0.113636
vt 0.580645 0.045455
vt 0.540323 0.125000
vt 0.532258 0.113636
vt 0.580645 0.500000
vt 0.532258 0.431818
vt 0.258065 0.500000

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 10
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 10
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 B

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