mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
life extender rework, more EC compat
This commit is contained in:
parent
c77d10cde4
commit
efa790fe75
@ -69,6 +69,11 @@
|
||||
* The bricked furnace now makes charcoal twice as fast
|
||||
* Combination ovens no longer need two welded copper plates and instead only cast plates, therefore no longer being post-arc welder. This should make it more affordable and useful in the initial earlygame where things like automatic wood farms are most important.
|
||||
* Any water-like extinguishing fluid shot from the chemical thrower can now wash away fallout layers
|
||||
* Overhauled the Mk.III life extender
|
||||
* The assembler recipe has been replaced with a simpler but more expensive workbench recipe
|
||||
* Instead of taking up the chestplate slot, it's now an armor mod worn in the insert slot
|
||||
* The armor no longer gives absorption, instead it adds 25 points to the shield count
|
||||
* The +25 bypasses the shield limit of 100, meaning that with enough shield infusions, the total maximum is now 125
|
||||
|
||||
## Fixed
|
||||
* Fixed dupe caused by shift-clicking ashes out of the bricked furnace
|
||||
@ -84,4 +89,6 @@
|
||||
* Fixed rampant mode random scout spawns being able to appear inside blocks
|
||||
* Fixed turret rotation sometimes desyncing when out of range, this is especially noticeable with slow-moving arty
|
||||
* Fixed research reactor OC integration allowing the control rods to be set out of bounds
|
||||
* Fixed fallout falling faster and overlaying if multiple fallout areas intersect
|
||||
* Fixed fallout falling faster and overlaying if multiple fallout areas intersect
|
||||
* Fixed template folder 3D models rendering with weird shading
|
||||
* HUD elements like jetpack charge and the shield bar should now still render even if Tinker's Construct replaces the health bar renderer
|
||||
@ -168,6 +168,7 @@ public class ConsumableRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_esapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', ANY_PLASTIC.ingot(), 'K', ModItems.insert_sapi, 'D', ModItems.ducttape, 'S', BIGMT.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_xsapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', ASBESTOS.ingot(), 'K', ModItems.insert_esapi, 'D', ModItems.ducttape, 'S', ModItems.ingot_meteorite_forged });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_yharonite, 1), new Object[] { "YIY", "IYI", "YIY", 'Y', ModItems.billet_yharonite, 'I', ModItems.insert_du });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.australium_iii, 1), new Object[] { "WSW", "PAP", "SPS", 'S', STEEL.plateWelded(), 'P', ANY_PLASTIC.ingot(), 'A', AUSTRALIUM.ingot(), 'W', GOLD.wireDense() });
|
||||
|
||||
//Servos
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.servo_set, 1), new Object[] { "MBM", "PBP", "MBM", 'M', ModItems.motor, 'B', STEEL.bolt(), 'P', IRON.plate() });
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
package com.hbm.extprop;
|
||||
|
||||
import com.hbm.entity.train.EntityRailCarBase;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
||||
import com.hbm.items.armor.ItemModShield;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
@ -144,8 +147,19 @@ public class HbmPlayerProps implements IExtendedEntityProperties {
|
||||
}
|
||||
}
|
||||
|
||||
public float getMaxShield() {
|
||||
return this.maxShield;
|
||||
public float getEffectiveMaxShield() {
|
||||
|
||||
float max = this.maxShield;
|
||||
|
||||
if(player.getCurrentArmor(2) != null) {
|
||||
ItemStack[] mods = ArmorModHandler.pryMods(player.getCurrentArmor(2));
|
||||
if(mods[ArmorModHandler.kevlar] != null && mods[ArmorModHandler.kevlar].getItem() instanceof ItemModShield) {
|
||||
ItemModShield mod = (ItemModShield) mods[ArmorModHandler.kevlar].getItem();
|
||||
max += mod.shield;
|
||||
}
|
||||
}
|
||||
|
||||
return max;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -77,13 +77,13 @@ public class EntityEffectHandler {
|
||||
HbmPlayerProps pprps = HbmPlayerProps.getData((EntityPlayerMP) entity);
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
if(pprps.shield < pprps.maxShield && entity.ticksExisted > pprps.lastDamage + 60) {
|
||||
if(pprps.shield < pprps.getEffectiveMaxShield() && entity.ticksExisted > pprps.lastDamage + 60) {
|
||||
int tsd = entity.ticksExisted - (pprps.lastDamage + 60);
|
||||
pprps.shield += Math.min(pprps.maxShield - pprps.shield, 0.005F * tsd);
|
||||
pprps.shield += Math.min(pprps.getEffectiveMaxShield() - pprps.shield, 0.005F * tsd);
|
||||
}
|
||||
|
||||
if(pprps.shield > pprps.maxShield)
|
||||
pprps.shield = pprps.maxShield;
|
||||
if(pprps.shield > pprps.getEffectiveMaxShield())
|
||||
pprps.shield = pprps.getEffectiveMaxShield();
|
||||
|
||||
props.saveNBTData(data);
|
||||
pprps.saveNBTData(data);
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Locale;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -313,7 +314,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
||||
public void drawIcon(boolean b) {
|
||||
try {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) 240 / 1.0F, (float) 240 / 1.0F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
if(stack != null) {
|
||||
|
||||
@ -219,7 +219,6 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModItems.tritium_deuterium_cake, 1), new AStack[] {new ComparableStack(ModItems.cell_deuterium, 6), new ComparableStack(ModItems.cell_tritium, 2), new OreDictStack(LI.ingot(), 4), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_cluster, 1), new AStack[] {new OreDictStack(STEEL.plate(), 4), new ComparableStack(Blocks.tnt, 1), }, 50);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_buckshot, 1), new AStack[] {new OreDictStack(PB.nugget(), 6), }, 50);
|
||||
makeRecipe(new ComparableStack(ModItems.australium_iii, 1), new AStack[] {new ComparableStack(ModItems.nugget_australium, 6), new OreDictStack(STEEL.ingot(), 1), new OreDictStack(STEEL.plate(), 6), new OreDictStack(CU.plate(), 2), new ComparableStack(ModItems.wire_copper, 6), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.magnetron, 1), new AStack[] {new OreDictStack(ALLOY.plate(), 3), new ComparableStack(ModItems.wire_tungsten, 1), new ComparableStack(ModItems.coil_tungsten, 1), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_schrabidium, 1), new AStack[] {new OreDictStack(SA326.ingot(), 5), new OreDictStack(IRON.plate(), 2), }, 200);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_hes, 1), new AStack[] {new ComparableStack(ModItems.ingot_hes, 5), new OreDictStack(IRON.plate(), 2), }, 200);
|
||||
|
||||
@ -2017,10 +2017,6 @@ public class ModItems {
|
||||
public static Item robes_legs;
|
||||
public static Item robes_boots;
|
||||
|
||||
public static Item australium_iii;
|
||||
public static Item australium_iv;
|
||||
public static Item australium_v;
|
||||
|
||||
public static Item jetpack_boost;
|
||||
public static Item jetpack_break;
|
||||
public static Item jetpack_fly;
|
||||
@ -2212,6 +2208,7 @@ public class ModItems {
|
||||
public static Item night_vision;
|
||||
public static Item card_aos;
|
||||
public static Item card_qos;
|
||||
public static Item australium_iii;
|
||||
|
||||
public static Item hazmat_helmet;
|
||||
public static Item hazmat_plate;
|
||||
@ -3460,6 +3457,7 @@ public class ModItems {
|
||||
night_vision = new ItemModNightVision().setUnlocalizedName("night_vision").setTextureName(RefStrings.MODID + ":night_vision");
|
||||
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");
|
||||
|
||||
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");
|
||||
@ -5371,8 +5369,6 @@ public class ModItems {
|
||||
liquidator_legs = new ArmorLiquidator(aMatLiquidator, 2, RefStrings.MODID + ":textures/armor/liquidator_2.png").cloneStats((ArmorFSB) liquidator_helmet).setUnlocalizedName("liquidator_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":liquidator_legs");
|
||||
liquidator_boots = new ArmorLiquidator(aMatLiquidator, 3, RefStrings.MODID + ":textures/armor/liquidator_1.png").cloneStats((ArmorFSB) liquidator_helmet).setUnlocalizedName("liquidator_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":liquidator_boots");
|
||||
|
||||
australium_iii = new ArmorAustralium(MainRegistry.aMatAus3, 1).setUnlocalizedName("australium_iii").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":australium_iii");
|
||||
|
||||
jetpack_boost = new JetpackBooster(Fluids.BALEFIRE, 32000).setUnlocalizedName("jetpack_boost").setCreativeTab(CreativeTabs.tabCombat).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_boost");
|
||||
jetpack_break = new JetpackBreak(Fluids.KEROSENE, 12000).setUnlocalizedName("jetpack_break").setCreativeTab(CreativeTabs.tabCombat).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_break");
|
||||
jetpack_fly = new JetpackRegular(Fluids.KEROSENE, 12000).setUnlocalizedName("jetpack_fly").setCreativeTab(CreativeTabs.tabCombat).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_fly");
|
||||
@ -7580,6 +7576,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(night_vision, night_vision.getUnlocalizedName());
|
||||
GameRegistry.registerItem(card_aos, card_aos.getUnlocalizedName());
|
||||
GameRegistry.registerItem(card_qos, card_qos.getUnlocalizedName());
|
||||
GameRegistry.registerItem(australium_iii, australium_iii.getUnlocalizedName());
|
||||
|
||||
//Chaos
|
||||
GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName());
|
||||
@ -7863,7 +7860,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(apple_euphemium, apple_euphemium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(watch, watch.getUnlocalizedName());
|
||||
GameRegistry.registerItem(mask_of_infamy, mask_of_infamy.getUnlocalizedName());
|
||||
GameRegistry.registerItem(australium_iii, australium_iii.getUnlocalizedName());
|
||||
GameRegistry.registerItem(jackt, jackt.getUnlocalizedName());
|
||||
GameRegistry.registerItem(jackt2, jackt2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(jetpack_fly, jetpack_fly.getUnlocalizedName());
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ArmorAustralium extends ItemArmor {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
public ArmorAustralium(ArmorMaterial armorMaterial, int armorType) {
|
||||
super(armorMaterial, 0, armorType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {
|
||||
if(armor.getItemDamage() < armor.getMaxDamage()) {
|
||||
if (armor.getItem() == ModItems.australium_iii) {
|
||||
if(rand.nextInt(3) == 0) {
|
||||
armor.damageItem(1, player);
|
||||
}
|
||||
if(!player.isPotionActive(Potion.field_76444_x.id))
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 80, 2, true));
|
||||
}
|
||||
if (armor.getItem() == ModItems.australium_iv) {
|
||||
if(rand.nextInt(5) == 0) {
|
||||
armor.damageItem(1, player);
|
||||
}
|
||||
if(!player.isPotionActive(Potion.field_76444_x.id))
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 80, 4, true));
|
||||
}
|
||||
if (armor.getItem() == ModItems.australium_v) {
|
||||
if(rand.nextInt(7) == 0) {
|
||||
armor.damageItem(1, player);
|
||||
}
|
||||
if(!player.isPotionActive(Potion.field_76444_x.id))
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 80, 3, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
if (itemstack.getItem() == ModItems.australium_iii)
|
||||
list.add("Ouch, that hurts.");
|
||||
if (itemstack.getItem() == ModItems.australium_iv)
|
||||
list.add("Just do it.");
|
||||
if (itemstack.getItem() == ModItems.australium_v)
|
||||
list.add("Gobbles up less australium than Mark IV!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) {
|
||||
if(stack.getItem().equals(ModItems.australium_iii)) {
|
||||
return (RefStrings.MODID + ":textures/armor/australium_iii.png");
|
||||
}
|
||||
if(stack.getItem().equals(ModItems.australium_iv)) {
|
||||
return (RefStrings.MODID + ":textures/armor/australium_iv.png");
|
||||
}
|
||||
if(stack.getItem().equals(ModItems.australium_v)) {
|
||||
return (RefStrings.MODID + ":textures/armor/australium_v.png");
|
||||
}
|
||||
|
||||
else return null;
|
||||
}
|
||||
|
||||
}
|
||||
33
src/main/java/com/hbm/items/armor/ItemModShield.java
Normal file
33
src/main/java/com/hbm/items/armor/ItemModShield.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class ItemModShield extends ItemArmorMod {
|
||||
|
||||
public final float shield;
|
||||
|
||||
public ItemModShield(float shield) {
|
||||
super(ArmorModHandler.kevlar, false, true, false, false);
|
||||
this.shield = shield;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
String color = "" + (System.currentTimeMillis() % 1000 < 500 ? EnumChatFormatting.YELLOW : EnumChatFormatting.GOLD);
|
||||
list.add(color + "+" + (Math.round(shield * 10) * 0.1) + " shield");
|
||||
list.add("");
|
||||
super.addInformation(itemstack, player, list, bool);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
||||
String color = "" + (System.currentTimeMillis() % 1000 < 500 ? EnumChatFormatting.YELLOW : EnumChatFormatting.GOLD);
|
||||
list.add(color + " " + stack.getDisplayName() + " (+" + (Math.round(shield * 10) * 0.1) + " health)");
|
||||
}
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class ItemFlask extends ItemEnumMulti {
|
||||
float infusion = 5F;
|
||||
HbmPlayerProps props = HbmPlayerProps.getData(player);
|
||||
props.maxShield = Math.min(props.shieldCap, props.maxShield + infusion);
|
||||
props.shield = Math.min(props.shield + infusion, props.maxShield);
|
||||
props.shield = Math.min(props.shield + infusion, props.getEffectiveMaxShield());
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
||||
@ -364,7 +364,7 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(receiveCanceled = true)
|
||||
public void onOverlayRender(RenderGameOverlayEvent.Post event) {
|
||||
|
||||
/// HANDLE ELECTRIC FSB HUD ///
|
||||
@ -374,7 +374,7 @@ public class ModEventHandlerClient {
|
||||
|
||||
if(!event.isCanceled() && event.type == event.type.HEALTH) {
|
||||
HbmPlayerProps props = HbmPlayerProps.getData(player);
|
||||
if(props.maxShield > 0) {
|
||||
if(props.getEffectiveMaxShield() > 0) {
|
||||
RenderScreenOverlay.renderShieldBar(event.resolution, Minecraft.getMinecraft().ingameGUI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ public class RenderScreenOverlay {
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
gui.drawTexturedModalRect(left, top, 146, 0, 81, 9);
|
||||
int i = (int) Math.ceil(props.shield * 79 / props.maxShield);
|
||||
int i = (int) Math.ceil(props.shield * 79 / props.getEffectiveMaxShield());
|
||||
gui.drawTexturedModalRect(left + 1, top, 147, 9, i, 9);
|
||||
|
||||
String label = "" + ((int) (props.shield * 10F)) / 10D;
|
||||
|
||||
@ -1,35 +1,29 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
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.saveddata.TomSaveData;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, INBTPacketReceiver {
|
||||
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC {
|
||||
|
||||
public int age = 0;
|
||||
public FluidTank[] tanks;
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
|
||||
public int waterTimer = 0;
|
||||
protected int throughput;
|
||||
|
||||
public TileEntityCondenser() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 100, 0);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 100, 1);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 100);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,6 +43,8 @@ public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidA
|
||||
this.waterTimer--;
|
||||
|
||||
int convert = Math.min(tanks[0].getFill(), tanks[1].getMaxFill() - tanks[1].getFill());
|
||||
this.throughput = convert;
|
||||
|
||||
if(extraCondition(convert)) {
|
||||
tanks[0].setFill(tanks[0].getFill() - convert);
|
||||
|
||||
@ -71,7 +67,6 @@ public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidA
|
||||
this.subscribeToAllAround(tanks[0].getTankType(), this);
|
||||
this.sendFluidToAll(tanks[1], this);
|
||||
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
data.setByte("timer", (byte) this.waterTimer);
|
||||
packExtra(data);
|
||||
INBTPacketReceiver.networkPack(this, data, 150);
|
||||
@ -103,76 +98,6 @@ public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidA
|
||||
tanks[1].writeToNBT(nbt, "steam");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
fillFluid(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, getTact(), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
if(age == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
tanks[1].setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getFill();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
list.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {tanks [1]};
|
||||
@ -187,4 +112,10 @@ public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidA
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, throughput);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, throughput);
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,8 +91,6 @@ public class TileEntityCondenserPowered extends TileEntityCondenser implements I
|
||||
tanks[1].writeToNBT(nbt, "steam");
|
||||
}
|
||||
|
||||
@Deprecated @Override public void fillFluidInit(FluidType type) { }
|
||||
|
||||
@Override
|
||||
public void subscribeToAllAround(FluidType type, TileEntity te) {
|
||||
for(DirPos pos : getConPos()) {
|
||||
|
||||
@ -27,10 +27,12 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -44,7 +46,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, IGUIProvider /* TODO: finish fluid API impl */ {
|
||||
public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 10000000;
|
||||
@ -649,4 +651,12 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIITER(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, this.isOn && plasma.getFill() > 0);
|
||||
int output = FusionRecipes.getSteamProduction(plasma.getTankType());
|
||||
data.setDouble("consumption", output * 10);
|
||||
data.setDouble("outputmb", output);
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,12 +30,14 @@ import com.hbm.tileentity.IConditionalInvAccess;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -50,7 +52,7 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineCyclotron extends TileEntityMachineBase implements IFluidSource, IFluidAcceptor, IEnergyUser, IFluidStandardTransceiver, IGUIProvider, IConditionalInvAccess, IUpgradeInfoProvider {
|
||||
public class TileEntityMachineCyclotron extends TileEntityMachineBase implements IFluidSource, IFluidAcceptor, IEnergyUser, IFluidStandardTransceiver, IGUIProvider, IConditionalInvAccess, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000;
|
||||
@ -613,4 +615,10 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
||||
if(type == UpgradeType.EFFECT) return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, this.isOn && this.progress > 0);
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_HE, this.progress > 0 ? consumption - 100_000 * getConsumption() : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,11 +18,13 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.RTGUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -37,7 +39,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineIGenerator extends TileEntityMachineBase implements IFluidAcceptor, IEnergyGenerator, IFluidStandardReceiver, IConfigurableMachine, IGUIProvider {
|
||||
public class TileEntityMachineIGenerator extends TileEntityMachineBase implements IFluidAcceptor, IEnergyGenerator, IFluidStandardReceiver, IConfigurableMachine, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public int spin;
|
||||
@ -66,6 +68,8 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
public static int waterRate = 10;
|
||||
public static int lubeRate = 1;
|
||||
public static long fluidHeatDiv = 1_000L;
|
||||
|
||||
protected long output;
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
@ -219,7 +223,8 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
this.tanks[2].setFill(this.tanks[2].getFill() - lubeRate);
|
||||
}
|
||||
|
||||
this.power += this.spin * genMult;
|
||||
this.output = (long) (this.spin * genMult);
|
||||
this.power += this.output;
|
||||
|
||||
if(this.power > this.maxPower)
|
||||
this.power = this.maxPower;
|
||||
@ -385,4 +390,10 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIIGenerator(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, this.output > 0);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, this.output);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,9 +11,11 @@ import com.hbm.items.special.ItemWasteLong;
|
||||
import com.hbm.items.special.ItemWasteShort;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -28,12 +30,13 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineRadGen extends TileEntityMachineBase implements IEnergyGenerator, IGUIProvider {
|
||||
public class TileEntityMachineRadGen extends TileEntityMachineBase implements IEnergyGenerator, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public int[] progress = new int[12];
|
||||
public int[] maxProgress = new int[12];
|
||||
public int[] production = new int[12];
|
||||
public ItemStack[] processing = new ItemStack[12];
|
||||
protected int output;
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000;
|
||||
@ -53,6 +56,8 @@ public class TileEntityMachineRadGen extends TileEntityMachineBase implements IE
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.output = 0;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
this.sendPower(worldObj, this.xCoord - dir.offsetX * 4, this.yCoord, this.zCoord - dir.offsetZ * 4, dir.getOpposite());
|
||||
@ -82,6 +87,7 @@ public class TileEntityMachineRadGen extends TileEntityMachineBase implements IE
|
||||
|
||||
this.isOn = true;
|
||||
this.power += production[i];
|
||||
this.output += production[i];
|
||||
progress[i]++;
|
||||
|
||||
if(progress[i] >= maxProgress[i]) {
|
||||
@ -290,4 +296,9 @@ public class TileEntityMachineRadGen extends TileEntityMachineBase implements IE
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineRadGen(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, output);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,12 +19,14 @@ import com.hbm.items.machine.ItemRTGPelletDepleted;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.RTGUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -37,7 +39,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineRadiolysis extends TileEntityMachineBase implements IEnergyGenerator, IFluidAcceptor, IFluidSource, IFluidContainer, IFluidStandardTransceiver, IGUIProvider {
|
||||
public class TileEntityMachineRadiolysis extends TileEntityMachineBase implements IEnergyGenerator, IFluidAcceptor, IFluidSource, IFluidContainer, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final int maxPower = 1000000;
|
||||
@ -384,4 +386,9 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIRadiolysis(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, this.heat * 10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,9 @@ import com.hbm.inventory.recipes.BreederRecipes;
|
||||
import com.hbm.inventory.recipes.BreederRecipes.BreederRecipe;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -28,7 +30,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 TileEntityMachineReactorBreeding extends TileEntityMachineBase implements SimpleComponent, IGUIProvider {
|
||||
public class TileEntityMachineReactorBreeding extends TileEntityMachineBase implements SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public int flux;
|
||||
public float progress;
|
||||
@ -251,4 +253,9 @@ public class TileEntityMachineReactorBreeding extends TileEntityMachineBase impl
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineReactorBreeding(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setInteger(CompatEnergyControl.I_FLUX, flux);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,9 +19,11 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -39,7 +41,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 TileEntityMachineTurbineGas extends TileEntityMachineBase implements IFluidStandardTransceiver, IEnergyGenerator, IControlReceiver, IGUIProvider, SimpleComponent {
|
||||
public class TileEntityMachineTurbineGas extends TileEntityMachineBase implements IFluidStandardTransceiver, IEnergyGenerator, IControlReceiver, IGUIProvider, SimpleComponent, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000L;
|
||||
@ -649,4 +651,15 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineTurbineGas(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, this.state == 1);
|
||||
data.setDouble(CompatEnergyControl.D_HEAT_C, Math.max(20D, this.temp));
|
||||
data.setDouble(CompatEnergyControl.D_TURBINE_PERCENT, this.powerSliderPos * 100D / 60D);
|
||||
data.setInteger(CompatEnergyControl.I_TURBINE_SPEED, this.rpm);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, this.instantPowerOutput);
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, this.waterToBoil);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, this.waterToBoil * 10);
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,9 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemPlateFuel;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -39,7 +41,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
//TODO: fix reactor control;
|
||||
public class TileEntityReactorResearch extends TileEntityMachineBase implements IControlReceiver, SimpleComponent, IGUIProvider {
|
||||
public class TileEntityReactorResearch extends TileEntityMachineBase implements IControlReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double lastLevel;
|
||||
@ -446,4 +448,11 @@ public class TileEntityReactorResearch extends TileEntityMachineBase implements
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIReactorResearch(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setDouble(CompatEnergyControl.D_HEAT_C, Math.round(heat * 2.0E-5D * 980.0D + 20.0D));
|
||||
data.setInteger(CompatEnergyControl.I_FLUX, totalFlux);
|
||||
data.setInteger(CompatEnergyControl.I_WATER, water);
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,10 +28,12 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -50,7 +52,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityReactorZirnox extends TileEntityMachineBase implements IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver, SimpleComponent, IGUIProvider {
|
||||
public class TileEntityReactorZirnox extends TileEntityMachineBase implements IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver, SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public int heat;
|
||||
public static final int maxHeat = 100000;
|
||||
@ -64,6 +66,7 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
public FluidTank steam;
|
||||
public FluidTank carbonDioxide;
|
||||
public FluidTank water;
|
||||
protected int output;
|
||||
|
||||
private static final int[] slots_io = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
|
||||
|
||||
@ -188,6 +191,7 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.output = 0;
|
||||
age++;
|
||||
|
||||
if (age >= 20) {
|
||||
@ -254,11 +258,11 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
// function of SHS produced per tick
|
||||
// (heat - 10256)/100000 * steamFill (max efficiency at 14b) * 25 * 5 (should get rid of any rounding errors)
|
||||
if(this.heat > 10256) {
|
||||
int Water = (int)((((float)heat - 10256F) / (float)maxHeat) * Math.min(((float)carbonDioxide.getFill() / 14000F), 1F) * 25F * 5F);
|
||||
int Steam = Water * 1;
|
||||
int cycle = (int)((((float)heat - 10256F) / (float)maxHeat) * Math.min(((float)carbonDioxide.getFill() / 14000F), 1F) * 25F * 5F);
|
||||
this.output = cycle;
|
||||
|
||||
water.setFill(water.getFill() - Water);
|
||||
steam.setFill(steam.getFill() + Steam);
|
||||
water.setFill(water.getFill() - cycle);
|
||||
steam.setFill(steam.getFill() + cycle);
|
||||
|
||||
if(water.getFill() < 0)
|
||||
water.setFill(0);
|
||||
@ -606,4 +610,13 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIReactorZirnox(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setDouble(CompatEnergyControl.D_HEAT_C, Math.round(heat * 1.0E-5D * 780.0D + 20.0D));
|
||||
data.setDouble(CompatEnergyControl.D_MAXHEAT_C, Math.round(maxHeat * 1.0E-5D * 780.0D + 20.0D));
|
||||
data.setLong(CompatEnergyControl.L_PRESSURE_BAR, Math.round(pressure * 1.0E-5D * 30.0D));
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, output);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, output);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,10 +15,12 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
import com.hbm.util.WeightedRandomObject;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -32,7 +34,7 @@ import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcceptor, IFluidStandardReceiver, IGUIProvider {
|
||||
public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcceptor, IFluidStandardReceiver, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public EnumWavelengths mode = EnumWavelengths.NULL;
|
||||
public boolean hasLaser;
|
||||
@ -373,4 +375,13 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUISILEX(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, this.progress > 0);
|
||||
if(current == null)
|
||||
data.setString("tank2", "N/A");
|
||||
else
|
||||
data.setString("tank2", String.format("%s: %s mB", current.toStack().getDisplayName(), currentFill));
|
||||
}
|
||||
}
|
||||
@ -16,8 +16,8 @@ public class TileEntityTowerLarge extends TileEntityCondenser {
|
||||
|
||||
public TileEntityTowerLarge() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 10000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 10000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 10000);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 10000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,18 +43,6 @@ public class TileEntityTowerLarge extends TileEntityCondenser {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
for(int i = 2; i < 6; i++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
fillFluid(xCoord + dir.offsetX * 5, yCoord, zCoord + dir.offsetZ * 5, getTact(), type);
|
||||
fillFluid(xCoord + dir.offsetX * 5 + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ * 5 + rot.offsetZ * 3, getTact(), type);
|
||||
fillFluid(xCoord + dir.offsetX * 5 + rot.offsetX * -3, yCoord, zCoord + dir.offsetZ * 5 + rot.offsetZ * -3, getTact(), type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscribeToAllAround(FluidType type, TileEntity te) {
|
||||
|
||||
|
||||
@ -11,14 +11,13 @@ 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;
|
||||
|
||||
public class TileEntityTowerSmall extends TileEntityCondenser {
|
||||
|
||||
public TileEntityTowerSmall() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 1000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1000);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,15 +58,6 @@ public class TileEntityTowerSmall extends TileEntityCondenser {
|
||||
this.sendFluid(this.tanks[1], worldObj, xCoord, yCoord, zCoord + 3, Library.POS_Z);
|
||||
this.sendFluid(this.tanks[1], worldObj, xCoord, yCoord, zCoord - 3, Library.NEG_Z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
for(int i = 2; i <= 6; i++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
fillFluid(xCoord + dir.offsetX * 3, yCoord, zCoord + dir.offsetZ * 3, getTact(), type);
|
||||
}
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -19,11 +19,13 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -35,7 +37,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineLiquefactor extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardSender, IGUIProvider, IUpgradeInfoProvider {
|
||||
public class TileEntityMachineLiquefactor extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardSender, IGUIProvider, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -326,4 +328,10 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, this.progress > 0);
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_HE, this.usage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,12 +16,14 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -33,7 +35,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineSolidifier extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, IFluidStandardReceiver, IGUIProvider, IUpgradeInfoProvider {
|
||||
public class TileEntityMachineSolidifier extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, IFluidStandardReceiver, IGUIProvider, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -302,4 +304,10 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, this.progress > 0);
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_HE, this.usage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,16 +80,18 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
|
||||
goesDown = false;
|
||||
|
||||
if(!worldObj.isRemote && this.canTargetInteract()) {
|
||||
if(this.loadedItem != null) {
|
||||
getColumnAtPos().load(this.loadedItem);
|
||||
this.loadedItem = null;
|
||||
} else {
|
||||
IRBMKLoadable column = getColumnAtPos();
|
||||
this.loadedItem = column.provideNext();
|
||||
column.unload();
|
||||
IRBMKLoadable column = getColumnAtPos();
|
||||
if(column != null) { // canTargetInteract already assumes this, but there seems to be some freak race conditions that cause the column to be null anyway
|
||||
if(this.loadedItem != null) {
|
||||
column.load(this.loadedItem);
|
||||
this.loadedItem = null;
|
||||
} else {
|
||||
this.loadedItem = column.provideNext();
|
||||
column.unload();
|
||||
}
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -139,6 +139,7 @@ public class CompatEnergyControl {
|
||||
public static final String S_LEVEL_PERCENT = "level"; // Research Reactor rods
|
||||
@Deprecated public static final String L_HEATL = "heatL"; // AMS and old Watz heat values
|
||||
public static final String D_HEAT_C = "heat"; // Research Reactor and RBMK column heat
|
||||
public static final String D_MAXHEAT_C = "maxHeat"; // ZIRNOX melting temp
|
||||
public static final String L_PRESSURE_BAR = "bar"; // ZIRNOX pressure
|
||||
public static final String L_FUEL = "fuel"; // RTG Blast Furnace heat
|
||||
@Deprecated public static final String S_FUELTEXT = "fuelText"; // Large Nuclear Reactor only
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 300 B |
Loading…
x
Reference in New Issue
Block a user