Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
This commit is contained in:
@@ -137,15 +137,16 @@ public class BusRenderer implements IItemRenderer
|
||||
else
|
||||
{
|
||||
IPart ip = getRenderer( item, (IPartItem) item.getItem() );
|
||||
|
||||
if ( type == ItemRenderType.ENTITY )
|
||||
{
|
||||
int depth = ip.cableConnectionRenderTo();
|
||||
GL11.glTranslatef( 0.0f, 0.0f, -0.04f * (8 - depth) - 0.06f );
|
||||
}
|
||||
|
||||
if ( ip != null )
|
||||
{
|
||||
if ( type == ItemRenderType.ENTITY )
|
||||
{
|
||||
int depth = ip.cableConnectionRenderTo();
|
||||
GL11.glTranslatef( 0.0f, 0.0f, -0.04f * (8 - depth) - 0.06f );
|
||||
}
|
||||
|
||||
ip.renderInventory( BusRenderHelper.instance, renderer );
|
||||
}
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package appeng.integration.abstraction;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.mj.IBatteryObject;
|
||||
|
||||
public interface IMJ6
|
||||
{
|
||||
|
||||
IBatteryObject provider(TileEntity te, ForgeDirection side);
|
||||
|
||||
}
|
||||
|
||||
@@ -121,11 +121,18 @@ public class BC extends BaseModule implements IBC
|
||||
|
||||
try
|
||||
{
|
||||
return is.getItem() instanceof ItemFacade && ItemFacade.getType( is ) == ItemFacade.TYPE_BASIC;
|
||||
return is.getItem() instanceof ItemFacade && ItemFacade.getType( is ) == ItemFacade.FacadeType.Basic;
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
return is.getItem() instanceof ItemFacade;
|
||||
try
|
||||
{
|
||||
return is.getItem() instanceof ItemFacade && ItemFacade.getType( is ) == ItemFacade.TYPE_BASIC;
|
||||
}
|
||||
catch (Throwable g)
|
||||
{
|
||||
return is.getItem() instanceof ItemFacade;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.integration.BaseModule;
|
||||
import appeng.integration.abstraction.IMJ6;
|
||||
import appeng.transformer.annotations.integration.Method;
|
||||
import buildcraft.api.mj.IBatteryObject;
|
||||
import buildcraft.api.mj.IBatteryProvider;
|
||||
import buildcraft.api.mj.ISidedBatteryProvider;
|
||||
import buildcraft.api.mj.MjAPI;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
import buildcraft.api.power.PowerHandler.Type;
|
||||
|
||||
public class MJ6 extends BaseModule implements IMJ6
|
||||
{
|
||||
@@ -15,7 +22,6 @@ public class MJ6 extends BaseModule implements IMJ6
|
||||
TestClass( IBatteryObject.class );
|
||||
TestClass( IBatteryProvider.class );
|
||||
TestClass( ISidedBatteryProvider.class );
|
||||
throw new RuntimeException( "Disabled For Now!" );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,4 +34,78 @@ public class MJ6 extends BaseModule implements IMJ6
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ5")
|
||||
public IBatteryObject provider(final TileEntity te, final ForgeDirection side)
|
||||
{
|
||||
if ( te instanceof IPowerReceptor )
|
||||
{
|
||||
final IPowerReceptor recp = (IPowerReceptor) te;
|
||||
final PowerReceiver ph = recp.getPowerReceiver( side );
|
||||
|
||||
return new IBatteryObject() {
|
||||
|
||||
@Override
|
||||
public void setEnergyStored(double mj)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBatteryObject reconfigure(double maxCapacity, double maxReceivedPerCycle, double minimumConsumption)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double minimumConsumption()
|
||||
{
|
||||
return ph.getMinEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double maxReceivedPerCycle()
|
||||
{
|
||||
return ph.getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double maxCapacity()
|
||||
{
|
||||
return ph.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String kind()
|
||||
{
|
||||
return MjAPI.DEFAULT_POWER_FRAMEWORK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEnergyStored()
|
||||
{
|
||||
return ph.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEnergyRequested()
|
||||
{
|
||||
return ph.getMaxEnergyStored() - ph.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double addEnergy(double mj, boolean ignoreCycleLimit)
|
||||
{
|
||||
return ph.receiveEnergy( Type.PIPE, mj, side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double addEnergy(double mj)
|
||||
{
|
||||
return ph.receiveEnergy( Type.PIPE, mj, side );
|
||||
}
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import appeng.api.networking.ticking.TickingRequest;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.integration.abstraction.IMJ5;
|
||||
import appeng.integration.abstraction.IMJ6;
|
||||
import appeng.integration.abstraction.helpers.BaseMJperdition;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.cache.helpers.TunnelCollection;
|
||||
@@ -153,7 +154,13 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
|
||||
{
|
||||
TileEntity te = getWorld().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ );
|
||||
if ( te != null )
|
||||
return MjAPI.getMjBattery( te );
|
||||
{
|
||||
IBatteryObject bo = MjAPI.getMjBattery( te, MjAPI.DEFAULT_POWER_FRAMEWORK, side.getOpposite() );
|
||||
if ( bo != null )
|
||||
return bo;
|
||||
if ( AppEng.instance.isIntegrationEnabled( "MJ5" ) )
|
||||
return ((IMJ6) AppEng.instance.getIntegration( "MJ6" )).provider( te, side.getOpposite() );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -213,13 +220,6 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
|
||||
return tile.getWorldObj();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public IBatteryObject getMjBattery(String kind)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public IBatteryObject getMjBattery(String kind, ForgeDirection direction)
|
||||
@@ -267,7 +267,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
|
||||
@Method(iname = "MJ6")
|
||||
private double addEnergyInternal(double mj, boolean cycleLimitMode, boolean ignoreCycleLimit)
|
||||
{
|
||||
if ( !output && proxy.isActive() )
|
||||
if ( output || !proxy.isActive() )
|
||||
return 0;
|
||||
|
||||
double originaInput = mj;
|
||||
|
||||
Reference in New Issue
Block a user