mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-02-21 05:22:35 +00:00
bringeth forth the sriracha nuggets
This commit is contained in:
parent
4e0bce27df
commit
1ad65345b0
@ -968,7 +968,14 @@ public class ModBlocks {
|
||||
|
||||
public static Block machine_steam_engine;
|
||||
public static Block machine_turbine;
|
||||
public static Block machine_large_turbine;
|
||||
@Deprecated public static Block machine_large_turbine;
|
||||
public static Block machine_industrial_turbine;
|
||||
public static Block machine_chungus;
|
||||
|
||||
public static Block machine_condenser;
|
||||
public static Block machine_tower_small;
|
||||
public static Block machine_tower_large;
|
||||
public static Block machine_condenser_powered;
|
||||
|
||||
public static Block machine_deuterium_extractor;
|
||||
public static Block machine_deuterium_tower;
|
||||
@ -979,12 +986,6 @@ public class ModBlocks {
|
||||
public static Block machine_compressor;
|
||||
public static Block machine_compressor_compact;
|
||||
|
||||
public static Block machine_chungus;
|
||||
public static Block machine_condenser;
|
||||
public static Block machine_tower_small;
|
||||
public static Block machine_tower_large;
|
||||
public static Block machine_condenser_powered;
|
||||
|
||||
public static Block machine_electrolyser;
|
||||
|
||||
public static Block machine_excavator;
|
||||
@ -2244,7 +2245,8 @@ public class ModBlocks {
|
||||
machine_steam_engine = new MachineSteamEngine().setBlockName("machine_steam_engine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_turbine = new MachineTurbine(Material.iron).setBlockName("machine_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbine");
|
||||
machine_large_turbine = new MachineLargeTurbine(Material.iron).setBlockName("machine_large_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_large_turbine");
|
||||
machine_chungus = new MachineChungus(Material.iron).setBlockName("machine_chungus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_chungus");
|
||||
machine_industrial_turbine = new MachineIndustrialTurbine().setBlockName("machine_industrial_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_chungus = new MachineChungus().setBlockName("machine_chungus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_condenser = new MachineCondenser(Material.iron).setBlockName("machine_condenser").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":condenser");
|
||||
machine_tower_small = new MachineTowerSmall(Material.iron).setBlockName("machine_tower_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
machine_tower_large = new MachineTowerLarge(Material.iron).setBlockName("machine_tower_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
@ -3282,6 +3284,7 @@ public class ModBlocks {
|
||||
register(machine_steam_engine);
|
||||
register(machine_turbine);
|
||||
register(machine_large_turbine);
|
||||
register(machine_industrial_turbine);
|
||||
register(machine_chungus);
|
||||
GameRegistry.registerBlock(machine_condenser, machine_condenser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_tower_small, machine_tower_small.getUnlocalizedName());
|
||||
@ -3289,8 +3292,8 @@ public class ModBlocks {
|
||||
register(machine_condenser_powered);
|
||||
GameRegistry.registerBlock(machine_deuterium_extractor, machine_deuterium_extractor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_deuterium_tower, machine_deuterium_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_solidifier, ItemBlockBase.class, machine_solidifier.getUnlocalizedName());
|
||||
register(machine_liquefactor);
|
||||
register(machine_solidifier);
|
||||
register(machine_intake);
|
||||
register(machine_compressor);
|
||||
register(machine_compressor_compact);
|
||||
|
||||
@ -20,8 +20,7 @@ public class FurnaceCombination extends BlockDummyable implements ITooltipProvid
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12)
|
||||
return new TileEntityFurnaceCombination();
|
||||
if(meta >= 12) return new TileEntityFurnaceCombination();
|
||||
return new TileEntityProxyCombo().inventory().fluid();
|
||||
}
|
||||
|
||||
|
||||
@ -28,19 +28,14 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineChungus extends BlockDummyable implements ITooltipProvider, ILookOverlay {
|
||||
|
||||
public MachineChungus(Material mat) {
|
||||
super(mat);
|
||||
public MachineChungus() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12)
|
||||
return new TileEntityChungus();
|
||||
|
||||
if(meta >= 6)
|
||||
return new TileEntityProxyCombo(false, true, true);
|
||||
|
||||
if(meta >= 12) return new TileEntityChungus();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -69,31 +64,7 @@ public class MachineChungus extends BlockDummyable implements ITooltipProvider,
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.chungusLever", 1.5F, 1.0F);
|
||||
|
||||
if(!world.isRemote) {
|
||||
FluidType type = entity.tanks[0].getTankType();
|
||||
entity.onLeverPull(type);
|
||||
|
||||
if(type == Fluids.STEAM) {
|
||||
entity.tanks[0].setTankType(Fluids.HOTSTEAM);
|
||||
entity.tanks[1].setTankType(Fluids.STEAM);
|
||||
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
|
||||
entity.tanks[1].setFill(0);
|
||||
} else if(type == Fluids.HOTSTEAM) {
|
||||
entity.tanks[0].setTankType(Fluids.SUPERHOTSTEAM);
|
||||
entity.tanks[1].setTankType(Fluids.HOTSTEAM);
|
||||
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
|
||||
entity.tanks[1].setFill(0);
|
||||
} else if(type == Fluids.SUPERHOTSTEAM) {
|
||||
entity.tanks[0].setTankType(Fluids.ULTRAHOTSTEAM);
|
||||
entity.tanks[1].setTankType(Fluids.SUPERHOTSTEAM);
|
||||
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
|
||||
entity.tanks[1].setFill(0);
|
||||
} else {
|
||||
entity.tanks[0].setTankType(Fluids.STEAM);
|
||||
entity.tanks[1].setTankType(Fluids.SPENTSTEAM);
|
||||
entity.tanks[0].setFill(Math.min(entity.tanks[0].getFill() * 1000, entity.tanks[0].getMaxFill()));
|
||||
entity.tanks[1].setFill(0);
|
||||
}
|
||||
entity.markDirty();
|
||||
entity.onLeverPull();
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -168,7 +139,7 @@ public class MachineChungus extends BlockDummyable implements ITooltipProvider,
|
||||
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + inputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankInput.getFill()) + "/" + String.format(Locale.US, "%,d", tankInput.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + outputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankOutput.getFill()) + "/" + String.format(Locale.US, "%,d", tankOutput.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(chungus.power) + "/" + BobMathUtil.getShortNumber(chungus.getMaxPower()) + "HE");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(chungus.powerBuffer) + "HE");
|
||||
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
|
||||
@ -0,0 +1,120 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineIndustrialTurbine;
|
||||
import com.hbm.tileentity.machine.TileEntityTurbineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineIndustrialTurbine extends BlockDummyable implements ITooltipProvider, ILookOverlay {
|
||||
|
||||
public MachineIndustrialTurbine() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineIndustrialTurbine();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid().power();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return true;
|
||||
|
||||
TileEntityTurbineBase entity = (TileEntityTurbineBase) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(entity != null) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(entity.getBlockMetadata() - this.offset);
|
||||
|
||||
if(x == entity.xCoord + dir.offsetX * 3 && z == entity.zCoord + dir.offsetZ * 3 && y == entity.yCoord + 1) {
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.chungusLever", 1.5F, 1.0F);
|
||||
if(!world.isRemote) entity.onLeverPull();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] { 2, 0, 3, 3, 1, 1 }; }
|
||||
@Override public int getOffset() { return 3; }
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x + dir.offsetX * 3 + rot.offsetX, y, z + dir.offsetZ * 3 + rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 3 - rot.offsetX, y, z + dir.offsetZ * 3 - rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX * 1 + rot.offsetX, y, z - dir.offsetZ * 1 + rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX * 1 - rot.offsetX, y, z - dir.offsetZ * 1 - rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 3, y + 2, z + dir.offsetZ * 3);
|
||||
this.makeExtra(world, x - dir.offsetX * 1, y + 2, z - dir.offsetZ * 1);
|
||||
this.makeExtra(world, x - dir.offsetX * 3, y + 1, z - dir.offsetZ * 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(!(te instanceof TileEntityMachineIndustrialTurbine)) return;
|
||||
|
||||
TileEntityMachineIndustrialTurbine chungus = (TileEntityMachineIndustrialTurbine) te;
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
FluidTank tankInput = chungus.tanks[0];
|
||||
FluidTank tankOutput = chungus.tanks[1];
|
||||
|
||||
FluidType inputType = tankInput.getTankType();
|
||||
FluidType outputType = Fluids.NONE;
|
||||
|
||||
if(inputType.hasTrait(FT_Coolable.class)) {
|
||||
outputType = inputType.getTrait(FT_Coolable.class).coolsTo;
|
||||
}
|
||||
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + inputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankInput.getFill()) + "/" + String.format(Locale.US, "%,d", tankInput.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + outputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankOutput.getFill()) + "/" + String.format(Locale.US, "%,d", tankOutput.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(chungus.powerBuffer) + "HE (" + (int)(chungus.spin * 100) + "%)");
|
||||
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Deprecated
|
||||
public class MachineLargeTurbine extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineLargeTurbine(Material mat) {
|
||||
|
||||
@ -150,10 +150,13 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
|
||||
canDestroy.add(Blocks.trapdoor);
|
||||
canDestroy.add(ModBlocks.machine_press);
|
||||
canDestroy.add(ModBlocks.machine_epress);
|
||||
canDestroy.add(ModBlocks.machine_chemplant);
|
||||
canDestroy.add(ModBlocks.machine_chemical_plant);
|
||||
canDestroy.add(ModBlocks.machine_chemical_factory);
|
||||
canDestroy.add(ModBlocks.machine_crystallizer);
|
||||
canDestroy.add(ModBlocks.machine_turbine);
|
||||
canDestroy.add(ModBlocks.machine_large_turbine);
|
||||
canDestroy.add(ModBlocks.machine_industrial_turbine);
|
||||
canDestroy.add(ModBlocks.machine_chungus);
|
||||
canDestroy.add(ModBlocks.machine_purex);
|
||||
canDestroy.add(ModBlocks.crate_iron);
|
||||
canDestroy.add(ModBlocks.crate_steel);
|
||||
canDestroy.add(ModBlocks.machine_diesel);
|
||||
|
||||
@ -386,8 +386,8 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
|
||||
this.register(new GenericRecipe("ass.hephaestus").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_hephaestus, 1))
|
||||
.inputItems(new OreDictStack(STEEL.pipe(), 12), new OreDictStack(STEEL.ingot(), 24), new OreDictStack(CU.plate(), 24), new OreDictStack(NB.ingot(), 4), new OreDictStack(RUBBER.ingot(), 12), new ComparableStack(ModBlocks.glass_quartz, 16))
|
||||
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 8, EnumExpensiveType.HEAVY_FRAME), new OreDictStack(NB.ingot(), 16), new OreDictStack(RUBBER.ingot(), 16), new ComparableStack(ModBlocks.glass_quartz, 16)));
|
||||
this.register(new GenericRecipe("ass.iturbine").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_large_turbine, 1))
|
||||
.inputItems(new OreDictStack(STEEL.plate(), 12), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 6), new OreDictStack(DURA.pipe(), 3), new OreDictStack(STEEL.pipe(), 4), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC))
|
||||
this.register(new GenericRecipe("ass.iturbine").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_industrial_turbine, 1))
|
||||
.inputItems(new OreDictStack(STEEL.plate(), 12), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 6), new OreDictStack(DURA.pipe(), 4), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC))
|
||||
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.HEAVY_FRAME), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 16), new OreDictStack(DURA.pipe(), 16), new ComparableStack(ModItems.item_expensive, 3, EnumExpensiveType.CIRCUIT)));
|
||||
this.register(new GenericRecipe("ass.leviturbine").setup(600, 100).outputItems(new ItemStack(ModBlocks.machine_chungus, 1))
|
||||
.inputItems(new OreDictStack(STEEL.shell(), 6), new OreDictStack(STEEL.plateWelded(), 16), new OreDictStack(TI.plate(), 12), new OreDictStack(ANY_RESISTANTALLOY.ingot(), 16), new ComparableStack(ModItems.turbine_tungsten, 5), new ComparableStack(ModItems.turbine_titanium, 3), new ComparableStack(ModItems.flywheel_beryllium, 1), new OreDictStack(GOLD.wireDense(), 48), new OreDictStack(DURA.pipe(), 16), new OreDictStack(STEEL.pipe(), 16))
|
||||
|
||||
@ -312,6 +312,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBatterySocket.class, new RenderBatterySocket());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBatteryREDD.class, new RenderBatteryREDD());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLargeTurbine.class, new RenderBigTurbine());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineIndustrialTurbine.class, new RenderIndustrialTurbine());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineReactorBreeding.class, new RenderBreeder());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolarBoiler.class, new RenderSolarBoiler());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStorageDrum.class, new RenderStorageDrum());
|
||||
|
||||
@ -105,9 +105,10 @@ public class ResourceManager {
|
||||
public static final IModelCustom pump = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/pump.obj")).asVBO();
|
||||
|
||||
//Large Turbine
|
||||
public static final IModelCustom steam_engine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/steam_engine.obj")).asVBO();
|
||||
public static final IModelCustom turbine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/turbine.obj"));
|
||||
public static final IModelCustom chungus = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/chungus.obj")).asVBO();
|
||||
public static final IModelCustom steam_engine = new HFRWavefrontObject("models/machines/steam_engine.obj").asVBO();
|
||||
public static final IModelCustom turbine = new HFRWavefrontObject("models/machines/turbine.obj").asVBO();
|
||||
public static final IModelCustom industrial_turbine = new HFRWavefrontObject("models/machines/industrial_turbine.obj").asVBO();
|
||||
public static final IModelCustom chungus = new HFRWavefrontObject("models/machines/chungus.obj").asVBO();
|
||||
|
||||
//Cooling Tower
|
||||
public static final IModelCustom tower_small = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/tower_small.obj")).asVBO();
|
||||
@ -118,13 +119,13 @@ public class ResourceManager {
|
||||
public static final IModelCustom condenser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/condenser.obj")).asVBO();
|
||||
|
||||
//Wood burner
|
||||
public static final IModelCustom wood_burner = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/wood_burner.obj"));
|
||||
public static final IModelCustom wood_burner = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/wood_burner.obj")).asVBO();
|
||||
|
||||
//IGen
|
||||
public static final IModelCustom igen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/igen.obj"));
|
||||
|
||||
//Combustion Engine
|
||||
public static final IModelCustom dieselgen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/dieselgen.obj"));
|
||||
public static final IModelCustom dieselgen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/dieselgen.obj")).asVBO();
|
||||
public static final IModelCustom combustion_engine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/combustion_engine.obj")).asVBO();
|
||||
|
||||
//Press
|
||||
@ -159,7 +160,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom purex = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/purex.obj")).asVBO();
|
||||
|
||||
//Mixer
|
||||
public static final IModelCustom mixer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mixer.obj"));
|
||||
public static final IModelCustom mixer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mixer.obj")).asVBO();
|
||||
|
||||
//Arc Welder
|
||||
public static final IModelCustom arc_welder = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/arc_welder.obj"), false).asVBO();
|
||||
@ -183,7 +184,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom microwave = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/microwave.obj"));
|
||||
|
||||
//Big Man Johnson
|
||||
public static final IModelCustom autosaw = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/autosaw.obj"));
|
||||
public static final IModelCustom autosaw = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/autosaw.obj"), false).asVBO();
|
||||
|
||||
//Mining Drill
|
||||
public static final IModelCustom mining_drill = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mining_drill.obj")).asVBO();
|
||||
@ -546,6 +547,7 @@ public class ResourceManager {
|
||||
//Large Turbine
|
||||
public static final ResourceLocation steam_engine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/steam_engine.png");
|
||||
public static final ResourceLocation turbine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/turbine.png");
|
||||
public static final ResourceLocation industrial_turbine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/industrial_turbine.png");
|
||||
public static final ResourceLocation chungus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/chungus.png");
|
||||
|
||||
//Cooling Tower
|
||||
|
||||
@ -13,6 +13,8 @@ import java.util.regex.Pattern;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -51,6 +53,15 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
private String fileName;
|
||||
private boolean smoothing = true;
|
||||
|
||||
public HFRWavefrontObject(String name) throws ModelFormatException {
|
||||
this(new ResourceLocation(RefStrings.MODID, name));
|
||||
}
|
||||
|
||||
public HFRWavefrontObject noSmooth() {
|
||||
this.smoothing = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public HFRWavefrontObject(ResourceLocation resource) throws ModelFormatException {
|
||||
this.resource = resource;
|
||||
this.fileName = resource.toString();
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineIndustrialTurbine;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderIndustrialTurbine extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
switch(tile.getBlockMetadata() - 10) {
|
||||
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
TileEntityMachineIndustrialTurbine turbine = (TileEntityMachineIndustrialTurbine) tile;
|
||||
|
||||
bindTexture(ResourceManager.industrial_turbine_tex);
|
||||
ResourceManager.industrial_turbine.renderPart("Turbine");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(135 - (turbine.tanks[0].getTankType().getID() - Fluids.STEAM.getID()) * 90, 0, 0, 1);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.industrial_turbine.renderPart("Gauge");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(turbine.lastRotor + (turbine.rotor - turbine.lastRotor) * interp, 0, 0, -1);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.industrial_turbine.renderPart("Flywheel");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_industrial_turbine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(1, 0, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.industrial_turbine_tex);
|
||||
|
||||
ResourceManager.industrial_turbine.renderPart("Turbine");
|
||||
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(135, 0, 0, 1);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.industrial_turbine.renderPart("Gauge");
|
||||
|
||||
double rot = (System.currentTimeMillis() / 5) % 336D;
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(rot, 0, 0, -1);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.industrial_turbine.renderPart("Flywheel");
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
|
||||
import api.hbm.energymk2.IEnergyConductorMK2;
|
||||
import api.hbm.energymk2.IEnergyConnectorMK2;
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
import api.hbm.fluidmk2.IFluidConnectorMK2;
|
||||
import api.hbm.fluidmk2.IFluidReceiverMK2;
|
||||
@ -148,15 +149,15 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
|
||||
if(power && getCoreObject() instanceof IEnergyReceiverMK2) {
|
||||
return ((IEnergyReceiverMK2)getCoreObject()).canConnect(dir);
|
||||
if(power && getCoreObject() instanceof IEnergyConnectorMK2) {
|
||||
return ((IEnergyConnectorMK2)getCoreObject()).canConnect(dir);
|
||||
}
|
||||
|
||||
if(conductor && getCoreObject() instanceof IEnergyConductorMK2) {
|
||||
return ((IEnergyConductorMK2)getCoreObject()).canConnect(dir);
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -347,6 +347,7 @@ public class TileMappings {
|
||||
put(TileEntitySteamEngine.class, "tileentity_steam_engine");
|
||||
put(TileEntityMachineTurbine.class, "tileentity_turbine");
|
||||
put(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine");
|
||||
put(TileEntityMachineIndustrialTurbine.class, "tileentity_ind_turbine");
|
||||
put(TileEntityChungus.class, "tileentity_chungus");
|
||||
|
||||
put(TileEntityMachineCombustionEngine.class, "tileentity_combustion_engine");
|
||||
|
||||
@ -7,54 +7,35 @@ import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyProviderMK2;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine, IBufPacketReceiver, IFluidCopiable{
|
||||
public class TileEntityChungus extends TileEntityTurbineBase implements SimpleComponent, CompatHandler.OCComponent, IConfigurableMachine {
|
||||
|
||||
public long power;
|
||||
private int turnTimer;
|
||||
public float rotor;
|
||||
public float lastRotor;
|
||||
public float fanAcceleration = 0F;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
protected double[] info = new double[3];
|
||||
|
||||
private AudioWrapper audio;
|
||||
private float audioDesync;
|
||||
|
||||
//Configurable values
|
||||
public static long maxPower = 100000000000L;
|
||||
public static int inputTankSize = 1_000_000_000;
|
||||
public static int outputTankSize = 1_000_000_000;
|
||||
public static double efficiency = 0.85D;
|
||||
@ -75,7 +56,6 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
@ -83,123 +63,16 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("INFO").value("leviathan steam turbine consumes all availible steam per tick");
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override public double consumptionPercent() { return 1D; }
|
||||
@Override public double getEfficiency() { return efficiency; }
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.power *= 0.95;
|
||||
|
||||
this.info = new double[3];
|
||||
|
||||
boolean operational = false;
|
||||
FluidType in = tanks[0].getTankType();
|
||||
boolean valid = false;
|
||||
if(in.hasTrait(FT_Coolable.class)) {
|
||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //85% efficiency by default
|
||||
if(eff > 0) {
|
||||
tanks[1].setTankType(trait.coolsTo);
|
||||
int inputOps = tanks[0].getFill() / trait.amountReq;
|
||||
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
|
||||
int ops = Math.min(inputOps, outputOps);
|
||||
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
|
||||
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
|
||||
this.power += (ops * trait.heatEnergy * eff);
|
||||
info[0] = ops * trait.amountReq;
|
||||
info[1] = ops * trait.amountProduced;
|
||||
info[2] = ops * trait.heatEnergy * eff;
|
||||
valid = true;
|
||||
operational = ops > 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!valid) tanks[1].setTankType(Fluids.NONE);
|
||||
if(power > maxPower) power = maxPower;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
this.tryProvide(worldObj, xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, dir.getOpposite());
|
||||
|
||||
for(DirPos pos : this.getConPos()) {
|
||||
this.sendFluid(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
|
||||
if(power > maxPower)
|
||||
power = maxPower;
|
||||
|
||||
turnTimer--;
|
||||
|
||||
if(operational) turnTimer = 25;
|
||||
networkPackNT(150);
|
||||
|
||||
} else {
|
||||
|
||||
this.lastRotor = this.rotor;
|
||||
this.rotor += this.fanAcceleration;
|
||||
|
||||
if(this.rotor >= 360) {
|
||||
this.rotor -= 360;
|
||||
this.lastRotor -= 360;
|
||||
}
|
||||
|
||||
if(turnTimer > 0) {
|
||||
// Fan accelerates with a random offset to ensure the audio doesn't perfectly align, makes for a more pleasant hum
|
||||
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration += 0.075F + audioDesync));
|
||||
|
||||
Random rand = worldObj.rand;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection side = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
for(int i = 0; i < 10; i++) {
|
||||
worldObj.spawnParticle("cloud",
|
||||
xCoord + 0.5 + dir.offsetX * (rand.nextDouble() + 1.25) + rand.nextGaussian() * side.offsetX * 0.65,
|
||||
yCoord + 2.5 + rand.nextGaussian() * 0.65,
|
||||
zCoord + 0.5 + dir.offsetZ * (rand.nextDouble() + 1.25) + rand.nextGaussian() * side.offsetZ * 0.65,
|
||||
-dir.offsetX * 0.2, 0, -dir.offsetZ * 0.2);
|
||||
}
|
||||
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.chungusTurbineRunning", xCoord, yCoord, zCoord, 1.0F, 20F, 1.0F);
|
||||
audio.startSound();
|
||||
}
|
||||
|
||||
float turbineSpeed = this.fanAcceleration / 25F;
|
||||
audio.updateVolume(getVolume(0.5f * turbineSpeed));
|
||||
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
|
||||
} else {
|
||||
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration -= 0.1F));
|
||||
|
||||
if(audio != null) {
|
||||
if(this.fanAcceleration > 0) {
|
||||
float turbineSpeed = this.fanAcceleration / 25F;
|
||||
audio.updateVolume(getVolume(0.5f * turbineSpeed));
|
||||
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
|
||||
} else {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onLeverPull(FluidType previous) {
|
||||
for(BlockPos pos : getConPos()) {
|
||||
this.tryUnsubscribe(previous, worldObj, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
@ -209,37 +82,82 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
new DirPos(xCoord - rot.offsetX * 3, yCoord, zCoord - rot.offsetZ * 3, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getPowerPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
return new DirPos[] { new DirPos(xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, dir.getOpposite()) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServerTick() {
|
||||
turnTimer--;
|
||||
if(operational) turnTimer = 25;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClientTick() {
|
||||
|
||||
this.lastRotor = this.rotor;
|
||||
this.rotor += this.fanAcceleration;
|
||||
|
||||
if(this.rotor >= 360) {
|
||||
this.rotor -= 360;
|
||||
this.lastRotor -= 360;
|
||||
}
|
||||
|
||||
if(turnTimer > 0) {
|
||||
// Fan accelerates with a random offset to ensure the audio doesn't perfectly align, makes for a more pleasant hum
|
||||
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration += 0.075F + audioDesync));
|
||||
|
||||
Random rand = worldObj.rand;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection side = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
for(int i = 0; i < 10; i++) {
|
||||
worldObj.spawnParticle("cloud",
|
||||
xCoord + 0.5 + dir.offsetX * (rand.nextDouble() + 1.25) + rand.nextGaussian() * side.offsetX * 0.65,
|
||||
yCoord + 2.5 + rand.nextGaussian() * 0.65,
|
||||
zCoord + 0.5 + dir.offsetZ * (rand.nextDouble() + 1.25) + rand.nextGaussian() * side.offsetZ * 0.65,
|
||||
-dir.offsetX * 0.2, 0, -dir.offsetZ * 0.2);
|
||||
}
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.chungusTurbineRunning", xCoord, yCoord, zCoord, 1.0F, 20F, 1.0F, 20);
|
||||
audio.startSound();
|
||||
}
|
||||
|
||||
float turbineSpeed = this.fanAcceleration / 25F;
|
||||
audio.updateVolume(getVolume(0.5f * turbineSpeed));
|
||||
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
|
||||
audio.keepAlive();
|
||||
|
||||
} else {
|
||||
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration -= 0.1F));
|
||||
|
||||
if(audio != null) {
|
||||
if(this.fanAcceleration > 0) {
|
||||
float turbineSpeed = this.fanAcceleration / 25F;
|
||||
audio.updateVolume(getVolume(0.5f * turbineSpeed));
|
||||
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
|
||||
} else {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeLong(this.power);
|
||||
super.serialize(buf);
|
||||
buf.writeInt(this.turnTimer);
|
||||
this.tanks[0].serialize(buf);
|
||||
this.tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
this.power = buf.readLong();
|
||||
super.deserialize(buf);
|
||||
this.turnTimer = buf.readInt();
|
||||
this.tanks[0].deserialize(buf);
|
||||
this.tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
tanks[0].readFromNBT(nbt, "water");
|
||||
tanks[1].readFromNBT(nbt, "steam");
|
||||
power = nbt.getLong("power");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
tanks[0].writeToNBT(nbt, "water");
|
||||
tanks[1].writeToNBT(nbt, "steam");
|
||||
nbt.setLong("power", power);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -247,32 +165,11 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir != ForgeDirection.UP && dir != ForgeDirection.DOWN && dir != ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public String getComponentName() {
|
||||
@ -321,13 +218,13 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
@Callback(direct = true, doc = "function():number -- Gets the power buffer of the turbine.")
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getPower(Context context, Arguments args) {
|
||||
return new Object[] {power};
|
||||
return new Object[] {powerBuffer};
|
||||
}
|
||||
|
||||
@Callback(direct = true, doc = "function():table -- Gets information about this turbine. The format is the following: <input tank amount>, <input tank capacity>, <output tank amount>, <output tank capacity>, <input tank fluid type>, <power>")
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], power};
|
||||
return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], powerBuffer};
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -357,34 +254,6 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
case ("getInfo"):
|
||||
return getInfo(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {tanks[1]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tanks[0]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, info[1] > 0);
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, info[0]);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, info[1]);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, info[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank getTankToPaste() {
|
||||
return null;
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,163 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase implements IConfigurableMachine {
|
||||
|
||||
public static int inputTankSize = 1_000_000_000;
|
||||
public static int outputTankSize = 1_000_000_000;
|
||||
public static double efficiency = 1D;
|
||||
|
||||
public float rotor;
|
||||
public float lastRotor;
|
||||
|
||||
public double spin = 0;
|
||||
public static double ACCELERATION = 1D / 400D;
|
||||
public long lastPowerTarget = 0;
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "steamturbineIndustrial";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
public TileEntityMachineIndustrialTurbine() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||
}
|
||||
|
||||
// sets the power target so we know how much this steam type can theoretically make, and increments the spin based on actual throughput
|
||||
@Override
|
||||
public void generatePower(long power, int steamConsumed) {
|
||||
FT_Coolable trait = tanks[0].getTankType().getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * getEfficiency();
|
||||
int maxOps = (int) Math.ceil((tanks[0].getMaxFill() * consumptionPercent()) / trait.amountReq);
|
||||
this.lastPowerTarget = (long) (maxOps * trait.heatEnergy * eff); // theoretical max output at full blast with this type
|
||||
double fraction = (double) steamConsumed / (double) (trait.amountReq * maxOps); // % of max steam throughput currently achieved
|
||||
|
||||
if(Math.abs(spin - fraction) <= ACCELERATION) {
|
||||
this.spin = fraction;
|
||||
} else if(spin < fraction) {
|
||||
this.spin += ACCELERATION;
|
||||
} else if(spin > fraction) {
|
||||
this.spin -= ACCELERATION;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServerTick() {
|
||||
if(!operational) {
|
||||
this.spin -= ACCELERATION;
|
||||
}
|
||||
|
||||
if(this.spin <= 0) {
|
||||
this.spin = 0;
|
||||
} else {
|
||||
this.powerBuffer = (long) (this.lastPowerTarget * this.spin);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClientTick() {
|
||||
|
||||
this.lastRotor = this.rotor;
|
||||
this.rotor += this.spin * 30;
|
||||
|
||||
if(this.rotor >= 360) {
|
||||
this.lastRotor -= 360;
|
||||
this.rotor -= 360;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
ForgeDirection myDir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
return dir == myDir.getOpposite();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(FluidType type, ForgeDirection dir) {
|
||||
if(!type.hasTrait(FT_Coolable.class)) return false;
|
||||
ForgeDirection myDir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
return dir != myDir && dir != myDir.getOpposite();
|
||||
}
|
||||
|
||||
@Override public double consumptionPercent() { return 0.2D; }
|
||||
@Override public double getEfficiency() { return efficiency; }
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeDouble(this.spin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.spin = buf.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
lastPowerTarget = nbt.getLong("lastPowerTarget");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("lastPowerTarget", lastPowerTarget);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + dir.offsetX * 3 + rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 3 + rot.offsetZ * 2, rot),
|
||||
new DirPos(xCoord + dir.offsetX * 3 - rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 3 - rot.offsetZ * 2, rot.getOpposite()),
|
||||
new DirPos(xCoord - dir.offsetX * 1 + rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 1 + rot.offsetZ * 2, rot),
|
||||
new DirPos(xCoord - dir.offsetX * 1 - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 1 - rot.offsetZ * 2, rot.getOpposite()),
|
||||
new DirPos(xCoord + dir.offsetX * 3, yCoord + 3, zCoord + dir.offsetZ * 3, ForgeDirection.UP),
|
||||
new DirPos(xCoord - dir.offsetX * 1, yCoord + 3, zCoord - dir.offsetZ * 1, ForgeDirection.UP),
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getPowerPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord - dir.offsetX * 4, yCoord + 1, zCoord - dir.offsetZ * 4, dir.getOpposite())
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.Random;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerMachineLargeTurbine;
|
||||
@ -18,7 +15,6 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
@ -44,7 +40,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine, IFluidCopiable {
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IFluidCopiable {
|
||||
|
||||
public long power;
|
||||
public FluidTank[] tanks;
|
||||
@ -76,28 +72,6 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
audioDesync = rand.nextFloat() * 0.05F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "steamturbineIndustrial";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineLargeTurbine";
|
||||
|
||||
@ -70,7 +70,7 @@ public class TileEntitySteamEngine extends TileEntityLoadedBase implements IEner
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
ByteBuf buf;
|
||||
protected ByteBuf buf;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
@ -0,0 +1,185 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyProviderMK2;
|
||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public abstract class TileEntityTurbineBase extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiverMK2, IInfoProviderEC, IBufPacketReceiver, IFluidCopiable {
|
||||
|
||||
protected ByteBuf buf;
|
||||
public long powerBuffer;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
protected double[] info = new double[3];
|
||||
public boolean operational = false;
|
||||
|
||||
public abstract double getEfficiency();
|
||||
public abstract DirPos[] getConPos();
|
||||
public abstract DirPos[] getPowerPos();
|
||||
public abstract double consumptionPercent();
|
||||
|
||||
public void generatePower(long power, int steamConsumed) {
|
||||
this.powerBuffer += power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.powerBuffer = 0;
|
||||
this.info = new double[3];
|
||||
|
||||
if(this.buf != null) this.buf.release();
|
||||
this.buf = Unpooled.buffer();
|
||||
|
||||
this.tanks[0].serialize(buf);
|
||||
|
||||
operational = false;
|
||||
FluidType in = tanks[0].getTankType();
|
||||
boolean valid = false;
|
||||
if(in.hasTrait(FT_Coolable.class)) {
|
||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * getEfficiency();
|
||||
if(eff > 0) {
|
||||
tanks[1].setTankType(trait.coolsTo);
|
||||
int inputOps = (int) Math.ceil((tanks[0].getFill() * consumptionPercent()) / trait.amountReq);
|
||||
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
|
||||
int ops = Math.min(inputOps, outputOps);
|
||||
if(ops > 0) {
|
||||
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
|
||||
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
|
||||
this.generatePower((long) (ops * trait.heatEnergy * eff), tanks[0].getFill() - ops * trait.amountReq);
|
||||
}
|
||||
info[0] = ops * trait.amountReq;
|
||||
info[1] = ops * trait.amountProduced;
|
||||
info[2] = ops * trait.heatEnergy * eff;
|
||||
valid = true;
|
||||
operational = ops > 0;
|
||||
}
|
||||
}
|
||||
|
||||
onServerTick();
|
||||
|
||||
this.tanks[1].serialize(buf);
|
||||
this.buf.writeLong(this.powerBuffer);
|
||||
|
||||
if(!valid) tanks[1].setTankType(Fluids.NONE);
|
||||
|
||||
for(DirPos pos : this.getPowerPos()) {
|
||||
this.tryProvide(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
|
||||
for(DirPos pos : this.getConPos()) {
|
||||
this.tryProvide(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
networkPackNT(150);
|
||||
|
||||
} else {
|
||||
onClientTick();
|
||||
}
|
||||
}
|
||||
|
||||
public void onServerTick() { }
|
||||
public void onClientTick() { }
|
||||
|
||||
public void onLeverPull() {
|
||||
|
||||
FluidType type = tanks[0].getTankType();
|
||||
|
||||
if(type == Fluids.STEAM) {
|
||||
tanks[0].setTankType(Fluids.HOTSTEAM);
|
||||
tanks[1].setTankType(Fluids.STEAM);
|
||||
tanks[0].setFill(tanks[0].getFill() / 10);
|
||||
tanks[1].setFill(0);
|
||||
} else if(type == Fluids.HOTSTEAM) {
|
||||
tanks[0].setTankType(Fluids.SUPERHOTSTEAM);
|
||||
tanks[1].setTankType(Fluids.HOTSTEAM);
|
||||
tanks[0].setFill(tanks[0].getFill() / 10);
|
||||
tanks[1].setFill(0);
|
||||
} else if(type == Fluids.SUPERHOTSTEAM) {
|
||||
tanks[0].setTankType(Fluids.ULTRAHOTSTEAM);
|
||||
tanks[1].setTankType(Fluids.SUPERHOTSTEAM);
|
||||
tanks[0].setFill(tanks[0].getFill() / 10);
|
||||
tanks[1].setFill(0);
|
||||
} else {
|
||||
tanks[0].setTankType(Fluids.STEAM);
|
||||
tanks[1].setTankType(Fluids.SPENTSTEAM);
|
||||
tanks[0].setFill(Math.min(tanks[0].getFill() * 1000, tanks[0].getMaxFill()));
|
||||
tanks[1].setFill(0);
|
||||
}
|
||||
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeBytes(this.buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.tanks[0].deserialize(buf);
|
||||
this.tanks[1].deserialize(buf);
|
||||
this.powerBuffer = buf.readLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
tanks[0].readFromNBT(nbt, "water");
|
||||
tanks[1].readFromNBT(nbt, "steam");
|
||||
powerBuffer = nbt.getLong("power");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
tanks[0].writeToNBT(nbt, "water");
|
||||
tanks[1].writeToNBT(nbt, "steam");
|
||||
nbt.setLong("power", powerBuffer);
|
||||
}
|
||||
|
||||
@Override public long getPower() { return powerBuffer; }
|
||||
@Override public long getMaxPower() { return powerBuffer; }
|
||||
@Override public void setPower(long power) { this.powerBuffer = power; }
|
||||
|
||||
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {tanks[1]}; }
|
||||
@Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tanks[0]}; }
|
||||
@Override public FluidTank[] getAllTanks() { return tanks; }
|
||||
|
||||
@Override
|
||||
public void provideExtraInfo(NBTTagCompound data) {
|
||||
data.setBoolean(CompatEnergyControl.B_ACTIVE, info[1] > 0);
|
||||
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, info[0]);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, info[1]);
|
||||
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, info[2]);
|
||||
}
|
||||
|
||||
@Override public FluidTank getTankToPaste() { return null; }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
@ -429,7 +429,7 @@ f 64/69/15 88/161/15 78/136/4
|
||||
f 54/71/14 77/162/14 79/137/13
|
||||
f 61/25/17 85/163/17 86/138/6
|
||||
f 58/75/11 82/164/11 83/139/8
|
||||
o Gauuge_Gauge
|
||||
o Gauge
|
||||
v -0.031250 1.531250 3.468750
|
||||
v -0.031250 1.468750 3.468750
|
||||
v 0.031250 1.531250 3.468750
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 10 KiB |
Loading…
x
Reference in New Issue
Block a user