#2438: Implemented forge energy capabilities. Removed other disabled energy units for the time being.
This commit is contained in:
parent
433d575fd4
commit
a72c97e666
|
@ -28,9 +28,7 @@ public enum PowerUnits
|
|||
{
|
||||
AE( "gui.appliedenergistics2.units.appliedenergstics" ), // Native Units - AE Energy
|
||||
EU( "gui.appliedenergistics2.units.ic2" ), // IndustrialCraft 2 - Energy Units
|
||||
WA( "gui.appliedenergistics2.units.rotarycraft" ), // RotaryCraft - Watts
|
||||
RF( "gui.appliedenergistics2.units.thermalexpansion" ), // ThermalExpansion - Redstone Flux
|
||||
MK( "gui.appliedenergistics2.units.mekanism" ); // Mekanism - Joules
|
||||
RF( "gui.appliedenergistics2.units.rf" ); // RF - Redstone Flux
|
||||
|
||||
/**
|
||||
* unlocalized name for the power unit.
|
||||
|
|
|
@ -86,8 +86,6 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
|||
|
||||
this.registerApp( 16 * 10, Settings.POWER_UNITS, PowerUnits.AE, ButtonToolTips.PowerUnits, PowerUnits.AE.unlocalizedName );
|
||||
this.registerApp( 16 * 10 + 1, Settings.POWER_UNITS, PowerUnits.EU, ButtonToolTips.PowerUnits, PowerUnits.EU.unlocalizedName );
|
||||
this.registerApp( 16 * 10 + 2, Settings.POWER_UNITS, PowerUnits.MK, ButtonToolTips.PowerUnits, PowerUnits.MK.unlocalizedName );
|
||||
this.registerApp( 16 * 10 + 3, Settings.POWER_UNITS, PowerUnits.WA, ButtonToolTips.PowerUnits, PowerUnits.WA.unlocalizedName );
|
||||
this.registerApp( 16 * 10 + 4, Settings.POWER_UNITS, PowerUnits.RF, ButtonToolTips.PowerUnits, PowerUnits.RF.unlocalizedName );
|
||||
|
||||
this.registerApp( 3, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE, ButtonToolTips.RedstoneMode, ButtonToolTips.AlwaysActive );
|
||||
|
|
|
@ -115,15 +115,10 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
|||
|
||||
FMLCommonHandler.instance().bus().register( this );
|
||||
|
||||
final double DEFAULT_MEKANISM_EXCHANGE = 0.2;
|
||||
|
||||
PowerUnits.MK.conversionRatio = this.get( "PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE ).getDouble( DEFAULT_MEKANISM_EXCHANGE );
|
||||
final double DEFAULT_IC2_EXCHANGE = 2.0;
|
||||
PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
|
||||
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
|
||||
PowerUnits.WA.conversionRatio = this.get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE );
|
||||
final double DEFAULT_RF_EXCHANGE = 0.5;
|
||||
PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
|
||||
PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "Forge Energy", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
|
||||
|
||||
final double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
|
||||
PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective );
|
||||
|
|
|
@ -19,10 +19,13 @@
|
|||
package appeng.tile.networking;
|
||||
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.energy.IEnergyGrid;
|
||||
|
@ -118,4 +121,10 @@ public class TileEnergyAcceptor extends AENetworkPowerTile
|
|||
{
|
||||
return this.sides;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable EnumFacing facing )
|
||||
{
|
||||
return super.getCapability( capability, facing );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,13 @@ package appeng.tile.powersink;
|
|||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
|
@ -35,9 +39,8 @@ import appeng.tile.TileEvent;
|
|||
import appeng.tile.events.TileEventType;
|
||||
|
||||
|
||||
public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowerStorage
|
||||
public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowerStorage, IExternalPowerSink
|
||||
{
|
||||
|
||||
// values that determine general function, are set by inheriting classes if
|
||||
// needed. These should generally remain static.
|
||||
private double internalMaxPower = 10000;
|
||||
|
@ -46,6 +49,12 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe
|
|||
// the current power buffer.
|
||||
private double internalCurrentPower = 0;
|
||||
private EnumSet<EnumFacing> internalPowerSides = EnumSet.allOf( EnumFacing.class );
|
||||
private final IEnergyStorage forgeEnergyAdapter;
|
||||
|
||||
public AERootPoweredTile()
|
||||
{
|
||||
forgeEnergyAdapter = new ForgeEnergyAdapter( this );
|
||||
}
|
||||
|
||||
protected EnumSet<EnumFacing> getPowerSides()
|
||||
{
|
||||
|
@ -70,7 +79,8 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe
|
|||
this.setInternalCurrentPower( data.getDouble( "internalCurrentPower" ) );
|
||||
}
|
||||
|
||||
protected final double getExternalPowerDemand( final PowerUnits externalUnit, final double maxPowerRequired )
|
||||
@Override
|
||||
public final double getExternalPowerDemand( final PowerUnits externalUnit, final double maxPowerRequired )
|
||||
{
|
||||
return PowerUnits.AE.convertTo( externalUnit, Math.max( 0.0, this.getFunnelPowerDemand( externalUnit.convertTo( PowerUnits.AE, maxPowerRequired ) ) ) );
|
||||
}
|
||||
|
@ -80,6 +90,7 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe
|
|||
return this.getInternalMaxPower() - this.getInternalCurrentPower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final double injectExternalPower( final PowerUnits input, final double amt )
|
||||
{
|
||||
return PowerUnits.AE.convertTo( input, this.funnelPowerIntoStorage( input.convertTo( PowerUnits.AE, amt ), Actionable.MODULATE ) );
|
||||
|
@ -230,4 +241,34 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe
|
|||
{
|
||||
this.internalPowerFlow = internalPowerFlow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capability, EnumFacing facing )
|
||||
{
|
||||
if( capability == CapabilityEnergy.ENERGY )
|
||||
{
|
||||
if( this.getPowerSides().contains( facing ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.hasCapability( capability, facing );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@Override
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable EnumFacing facing )
|
||||
{
|
||||
if( capability == CapabilityEnergy.ENERGY )
|
||||
{
|
||||
if( this.getPowerSides().contains( facing ) )
|
||||
{
|
||||
return (T) forgeEnergyAdapter;
|
||||
}
|
||||
}
|
||||
|
||||
return super.getCapability( capability, facing );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
|
||||
import appeng.api.config.PowerUnits;
|
||||
|
||||
|
||||
/**
|
||||
* Adapts an {@link IExternalPowerSink} to Forges {@link IEnergyStorage}.
|
||||
*/
|
||||
class ForgeEnergyAdapter implements IEnergyStorage
|
||||
{
|
||||
|
||||
private final IExternalPowerSink sink;
|
||||
|
||||
ForgeEnergyAdapter( IExternalPowerSink sink )
|
||||
{
|
||||
this.sink = sink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int receiveEnergy( int maxReceive, boolean simulate )
|
||||
{
|
||||
final int networkDemand = (int) Math.floor( sink.getExternalPowerDemand( PowerUnits.RF, maxReceive ) );
|
||||
final int used = Math.min( maxReceive, networkDemand );
|
||||
|
||||
if( !simulate )
|
||||
{
|
||||
sink.injectExternalPower( PowerUnits.RF, used );
|
||||
}
|
||||
|
||||
return used;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getEnergyStored()
|
||||
{
|
||||
return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, sink.getAECurrentPower() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getMaxEnergyStored( )
|
||||
{
|
||||
return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, sink.getAEMaxPower() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy( int maxExtract, boolean simulate )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtract()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.networking.energy.IAEPowerStorage;
|
||||
|
||||
|
||||
interface IExternalPowerSink extends IAEPowerStorage
|
||||
{
|
||||
|
||||
double injectExternalPower( PowerUnits input, double amt );
|
||||
|
||||
double getExternalPowerDemand( PowerUnits externalUnit, double maxPowerRequired );
|
||||
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import mekanism.api.energy.IStrictEnergyAcceptor;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//
|
||||
//
|
||||
//@Interface( iname = IntegrationType.Mekanism, iface = "mekanism.api.energy.IStrictEnergyAcceptor" )
|
||||
//public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcceptor
|
||||
//{
|
||||
//
|
||||
// @Override
|
||||
// public double getEnergy()
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setEnergy( double energy )
|
||||
// {
|
||||
// double extra = this.injectExternalPower( PowerUnits.MK, energy );
|
||||
// this.internalCurrentPower += PowerUnits.MK.convertTo( PowerUnits.AE, extra );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double getMaxEnergy()
|
||||
// {
|
||||
// return this.getExternalPowerDemand( PowerUnits.MK, 100000 );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double transferEnergyToAcceptor( ForgeDirection side, double amount )
|
||||
// {
|
||||
// double demand = this.getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE );
|
||||
// if( amount > demand )
|
||||
// {
|
||||
// amount = demand;
|
||||
// }
|
||||
//
|
||||
// double overflow = this.injectExternalPower( PowerUnits.MK, amount );
|
||||
// return amount - overflow;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canReceiveEnergy( ForgeDirection side )
|
||||
// {
|
||||
// return this.getPowerSides().contains( side );
|
||||
// }
|
||||
// }
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import cofh.api.energy.IEnergyReceiver;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//
|
||||
//
|
||||
//@Interface( iname = IntegrationType.RF, iface = "cofh.api.energy.IEnergyReceiver" )
|
||||
//public abstract class RedstoneFlux extends RotaryCraft implements IEnergyReceiver
|
||||
//{
|
||||
// @Override
|
||||
// public final int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate )
|
||||
// {
|
||||
// final int networkRFDemand = (int) Math.floor( this.getExternalPowerDemand( PowerUnits.RF, maxReceive ) );
|
||||
// final int usedRF = Math.min( maxReceive, networkRFDemand );
|
||||
//
|
||||
// if( !simulate )
|
||||
// {
|
||||
// this.injectExternalPower( PowerUnits.RF, usedRF );
|
||||
// }
|
||||
//
|
||||
// return usedRF;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final int getEnergyStored( ForgeDirection from )
|
||||
// {
|
||||
// return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, this.getAECurrentPower() ) );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final int getMaxEnergyStored( ForgeDirection from )
|
||||
// {
|
||||
// return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower() ) );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final boolean canConnectEnergy( ForgeDirection from )
|
||||
// {
|
||||
// return this.getPowerSides().contains( from );
|
||||
// }
|
||||
// }
|
|
@ -1,185 +0,0 @@
|
|||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
//import java.util.ArrayList;
|
||||
//
|
||||
//import net.minecraft.world.World;
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import Reika.RotaryCraft.API.Interfaces.Transducerable;
|
||||
//import Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.tile.TileEvent;
|
||||
//import appeng.tile.events.TileEventType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//import appeng.transformer.annotations.Integration.InterfaceList;
|
||||
//import appeng.transformer.annotations.Integration.Method;
|
||||
//
|
||||
//
|
||||
//@InterfaceList( value = { @Interface( iname = IntegrationType.RotaryCraft, iface = "Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver" ), @Interface( iname = IntegrationType.RotaryCraft, iface = "Reika.RotaryCraft.API.Interfaces.Transducerable" ) } )
|
||||
//public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerReceiver, Transducerable
|
||||
//{
|
||||
//
|
||||
// private int omega = 0;
|
||||
// private int torque = 0;
|
||||
// private long power = 0;
|
||||
// private int alpha = 0;
|
||||
//
|
||||
// private long currentPower = 0;
|
||||
//
|
||||
// @TileEvent( TileEventType.TICK )
|
||||
// @Method( iname = IntegrationType.RotaryCraft )
|
||||
// public void Tick_RotaryCraft()
|
||||
// {
|
||||
// if( this.worldObj != null && !this.worldObj.isRemote && this.currentPower > 0 )
|
||||
// {
|
||||
// this.injectExternalPower( PowerUnits.WA, this.currentPower );
|
||||
// this.currentPower = 0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final boolean addPower( int torque, int omega, long power, ForgeDirection side )
|
||||
// {
|
||||
// this.omega = omega;
|
||||
// this.torque = torque;
|
||||
// this.power = power;
|
||||
//
|
||||
// this.currentPower += power;
|
||||
//
|
||||
// return true;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final int getOmega()
|
||||
// {
|
||||
// return this.omega;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final int getTorque()
|
||||
// {
|
||||
// return this.torque;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final long getPower()
|
||||
// {
|
||||
// return this.power;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final String getName()
|
||||
// {
|
||||
// return "AE";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final int getIORenderAlpha()
|
||||
// {
|
||||
// return this.alpha;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final void setIORenderAlpha( int io )
|
||||
// {
|
||||
// this.alpha = io;
|
||||
// }
|
||||
//
|
||||
// public final boolean canReadFromBlock( int x, int y, int z )
|
||||
// {
|
||||
// ForgeDirection side = ForgeDirection.UNKNOWN;
|
||||
//
|
||||
// if( x == this.xCoord - 1 )
|
||||
// {
|
||||
// side = ForgeDirection.WEST;
|
||||
// }
|
||||
// else if( x == this.xCoord + 1 )
|
||||
// {
|
||||
// side = ForgeDirection.EAST;
|
||||
// }
|
||||
// else if( z == this.zCoord - 1 )
|
||||
// {
|
||||
// side = ForgeDirection.NORTH;
|
||||
// }
|
||||
// else if( z == this.zCoord + 1 )
|
||||
// {
|
||||
// side = ForgeDirection.SOUTH;
|
||||
// }
|
||||
// else if( y == this.yCoord - 1 )
|
||||
// {
|
||||
// side = ForgeDirection.DOWN;
|
||||
// }
|
||||
// else if( y == this.yCoord + 1 )
|
||||
// {
|
||||
// side = ForgeDirection.UP;
|
||||
// }
|
||||
//
|
||||
// return this.getPowerSides().contains( side );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final boolean canReadFrom( ForgeDirection side )
|
||||
// {
|
||||
// return this.getPowerSides().contains( side );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final boolean isReceiving()
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final int getMinTorque( int available )
|
||||
// {
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final ArrayList<String> getMessages( World world, int x, int y, int z, int side )
|
||||
// {
|
||||
// String out;
|
||||
// if( this.power >= 1000000000 )
|
||||
// {
|
||||
// out = String.format( "Receiving %.3f GW @ %d rad/s.", this.power / 1000000000.0D, this.omega );
|
||||
// }
|
||||
// else if( this.power >= 1000000 )
|
||||
// {
|
||||
// out = String.format( "Receiving %.3f MW @ %d rad/s.", this.power / 1000000.0D, this.omega );
|
||||
// }
|
||||
// else if( this.power >= 1000 )
|
||||
// {
|
||||
// out = String.format( "Receiving %.3f kW @ %d rad/s.", this.power / 1000.0D, this.omega );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// out = String.format( "Receiving %d W @ %d rad/s.", this.power, this.omega );
|
||||
// }
|
||||
//
|
||||
// ArrayList<String> messages = new ArrayList<String>( 1 );
|
||||
// messages.add( out );
|
||||
// return messages;
|
||||
// }
|
||||
// }
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
/*
|
||||
* import net.minecraftforge.common.util.ForgeDirection;
|
||||
* import universalelectricity.core.block.IElectrical;
|
||||
* import universalelectricity.core.electricity.ElectricityPack;
|
||||
* import appeng.api.config.PowerUnits;
|
||||
* public abstract class UniversalElectricity extends ThermalExpansion implements IElectrical
|
||||
* {
|
||||
* @Override
|
||||
* public final boolean canConnect(AEPartLocation direction)
|
||||
* {
|
||||
* return internalCanAcceptPower && getPowerSides().contains( direction );
|
||||
* }
|
||||
* @Override
|
||||
* public final float receiveElectricity(AEPartLocation from, ElectricityPack receive, boolean doReceive)
|
||||
* {
|
||||
* float accepted = 0;
|
||||
* double receivedPower = receive.getWatts();
|
||||
* if ( doReceive )
|
||||
* {
|
||||
* accepted = (float) (receivedPower - injectExternalPower( PowerUnits.KJ, receivedPower ));
|
||||
* }
|
||||
* else
|
||||
* {
|
||||
* double whatIWant = getExternalPowerDemand( PowerUnits.KJ );
|
||||
* if ( whatIWant > receivedPower )
|
||||
* accepted = (float) receivedPower;
|
||||
* else
|
||||
* accepted = (float) whatIWant;
|
||||
* }
|
||||
* return accepted;
|
||||
* }
|
||||
* @Override
|
||||
* public final float getRequest(AEPartLocation direction)
|
||||
* {
|
||||
* return (float) getExternalPowerDemand( PowerUnits.KJ );
|
||||
* }
|
||||
* @Override
|
||||
* public final float getVoltage()
|
||||
* {
|
||||
* return 120;
|
||||
* }
|
||||
* @Override
|
||||
* public final ElectricityPack provideElectricity(AEPartLocation from, ElectricityPack request, boolean doProvide)
|
||||
* {
|
||||
* return null; // cannot be dis-charged
|
||||
* }
|
||||
* @Override
|
||||
* public final float getProvide(AEPartLocation direction)
|
||||
* {
|
||||
* return 0;
|
||||
* }
|
||||
* }
|
||||
*/
|
|
@ -193,16 +193,6 @@ public class Platform
|
|||
final String[] preFixes = { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" };
|
||||
String unitName = displayUnits.name();
|
||||
|
||||
if( displayUnits == PowerUnits.WA )
|
||||
{
|
||||
unitName = "J";
|
||||
}
|
||||
|
||||
if( displayUnits == PowerUnits.MK )
|
||||
{
|
||||
unitName = "J";
|
||||
}
|
||||
|
||||
String level = "";
|
||||
int offset = 0;
|
||||
while( p > 1000 && offset < preFixes.length )
|
||||
|
|
|
@ -280,9 +280,7 @@ gui.tooltips.appliedenergistics2.ReportInaccessibleItemsNo=Ne: Vidět budou pouz
|
|||
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=Jednotky energie
|
||||
gui.appliedenergistics2.units.mekanism=Jouly
|
||||
gui.appliedenergistics2.units.rotarycraft=Watty
|
||||
gui.appliedenergistics2.units.thermalexpansion=Ruditový Flux
|
||||
gui.appliedenergistics2.units.rf=Ruditový Flux
|
||||
|
||||
gui.appliedenergistics2.White=Bílá
|
||||
gui.appliedenergistics2.Orange=Oranžová
|
||||
|
|
|
@ -327,9 +327,7 @@ gui.tooltips.appliedenergistics2.ItemsRequestable=Anfragbare Items: %s
|
|||
// Units
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=Energy Units
|
||||
gui.appliedenergistics2.units.mekanism=Joules
|
||||
gui.appliedenergistics2.units.rotarycraft=Watt
|
||||
gui.appliedenergistics2.units.thermalexpansion=Redstone Flux
|
||||
gui.appliedenergistics2.units.rf=Redstone Flux
|
||||
|
||||
// Colors
|
||||
gui.appliedenergistics2.White=Weiß
|
||||
|
|
|
@ -329,9 +329,7 @@ gui.tooltips.appliedenergistics2.ItemsRequestable=Items Requestable: %s
|
|||
// Units
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=Energy Units
|
||||
gui.appliedenergistics2.units.mekanism=Joules
|
||||
gui.appliedenergistics2.units.rotarycraft=Watts
|
||||
gui.appliedenergistics2.units.thermalexpansion=Redstone Flux
|
||||
gui.appliedenergistics2.units.rf=Redstone Flux
|
||||
|
||||
// Colors
|
||||
gui.appliedenergistics2.White=White
|
||||
|
|
|
@ -264,9 +264,7 @@ gui.tooltips.appliedenergistics2.TerminalStyle_Small=Terminal Centrada Pequeña
|
|||
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=Energy Units
|
||||
gui.appliedenergistics2.units.mekanism=Joules
|
||||
gui.appliedenergistics2.units.rotarycraft=Watts
|
||||
gui.appliedenergistics2.units.thermalexpansion=Redstone Flux
|
||||
gui.appliedenergistics2.units.rf=Redstone Flux
|
||||
|
||||
gui.appliedenergistics2.White=Blanco
|
||||
gui.appliedenergistics2.Orange=Naranja
|
||||
|
|
|
@ -324,9 +324,7 @@ gui.tooltips.appliedenergistics2.ItemsRequestable=Eléments recherchable: %s
|
|||
// Units
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=Energy Units
|
||||
gui.appliedenergistics2.units.mekanism=Joules
|
||||
gui.appliedenergistics2.units.rotarycraft=Watts
|
||||
gui.appliedenergistics2.units.thermalexpansion=Redstone Flux
|
||||
gui.appliedenergistics2.units.rf=Redstone Flux
|
||||
|
||||
// Colors
|
||||
gui.appliedenergistics2.White=Blanc
|
||||
|
|
|
@ -307,9 +307,7 @@ gui.tooltips.appliedenergistics2.ItemsRequestable=Oggetti richiedibili: %s
|
|||
// Units
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=Energy Units
|
||||
gui.appliedenergistics2.units.mekanism=Joules
|
||||
gui.appliedenergistics2.units.rotarycraft=Watts
|
||||
gui.appliedenergistics2.units.thermalexpansion=Redstone Flux
|
||||
gui.appliedenergistics2.units.rf=Redstone Flux
|
||||
|
||||
// Colors
|
||||
gui.appliedenergistics2.White=Bianco
|
||||
|
|
|
@ -290,9 +290,7 @@ gui.tooltips.appliedenergistics2.ReportInaccessibleItemsNo=No: Only extractable
|
|||
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=에너지 단위(EU)
|
||||
gui.appliedenergistics2.units.mekanism=줄(J)
|
||||
gui.appliedenergistics2.units.rotarycraft=와트(W)
|
||||
gui.appliedenergistics2.units.thermalexpansion=레드스톤 유율(RF)
|
||||
gui.appliedenergistics2.units.rf=레드스톤 유율(RF)
|
||||
|
||||
gui.appliedenergistics2.White=하양
|
||||
gui.appliedenergistics2.Orange=주황
|
||||
|
|
|
@ -329,9 +329,7 @@ gui.tooltips.appliedenergistics2.ItemsRequestable=Items Solicitáveis: %s
|
|||
// Units
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=Energy Units
|
||||
gui.appliedenergistics2.units.mekanism=Joules
|
||||
gui.appliedenergistics2.units.rotarycraft=Watts
|
||||
gui.appliedenergistics2.units.thermalexpansion=Redstone Flux
|
||||
gui.appliedenergistics2.units.rf=Redstone Flux
|
||||
|
||||
// Cores
|
||||
gui.appliedenergistics2.White=Branco
|
||||
|
|
|
@ -192,9 +192,7 @@ gui.tooltips.appliedenergistics2.TerminalStyle=Stil de Terminalgui.tooltips.appl
|
|||
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
gui.appliedenergistics2.units.ic2=Unități de Energie
|
||||
gui.appliedenergistics2.units.universalelectricity=Kilo Jouli
|
||||
gui.appliedenergistics2.units.rotarycraft=Wați
|
||||
gui.appliedenergistics2.units.thermalexpansion=Flux de Piatră-Roşie
|
||||
gui.appliedenergistics2.units.rf=Flux de Piatră-Roşie
|
||||
|
||||
gui.appliedenergistics2.White=Alb
|
||||
gui.appliedenergistics2.Orange=Portocaliu
|
||||
|
|
Loading…
Reference in New Issue