Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
Conflicts: container/AEBaseContainer.java core/sync/AppEngPacketHandlerBase.java
This commit is contained in:
+16
-4
@@ -111,6 +111,22 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
|
||||
h.Tick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
if ( !isInvalid() )
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* for dormant chunk cache.
|
||||
*/
|
||||
public void onChunkLoad()
|
||||
{
|
||||
if ( isInvalid() )
|
||||
validate();
|
||||
}
|
||||
|
||||
@Override
|
||||
// NOTE: WAS FINAL, changed for Immibis
|
||||
public void writeToNBT(NBTTagCompound data)
|
||||
@@ -322,12 +338,8 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
|
||||
for (int l = 0; l < inv.getSizeInventory(); l++)
|
||||
{
|
||||
ItemStack is = inv.getStackInSlot( l );
|
||||
|
||||
if ( is != null )
|
||||
{
|
||||
drops.add( is );
|
||||
inv.setInventorySlotContents( l, (ItemStack) null );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,10 +191,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
|
||||
super.getDrops( w, x, y, z, drops );
|
||||
|
||||
if ( cell.getStackInSlot( 0 ) != null )
|
||||
{
|
||||
drops.add( cell.getStackInSlot( 0 ) );
|
||||
cell.setInventorySlotContents( 0, null );
|
||||
}
|
||||
}
|
||||
|
||||
public ICellWorkbenchItem getCell()
|
||||
|
||||
@@ -31,6 +31,7 @@ import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
import appeng.api.networking.events.MENetworkEventSubscribe;
|
||||
import appeng.api.networking.events.MENetworkPowerStatusChange;
|
||||
import appeng.api.networking.events.MENetworkSecurityChange;
|
||||
import appeng.api.networking.security.ISecurityProvider;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
@@ -40,6 +41,7 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.helpers.PlayerSecuirtyWrapper;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.storage.SecurityInventory;
|
||||
import appeng.tile.events.AETileEventHandler;
|
||||
@@ -53,7 +55,7 @@ import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEAppEngInventory, ILocatable, IConfigManagerHost
|
||||
public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEAppEngInventory, ILocatable, IConfigManagerHost, ISecurityProvider
|
||||
{
|
||||
|
||||
private static int diffrence = 0;
|
||||
@@ -205,7 +207,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
|
||||
if ( i instanceof IBiometricCard )
|
||||
{
|
||||
IBiometricCard bc = (IBiometricCard) i;
|
||||
playerPerms.put( pr.getID( bc.getUsername( is ) ), bc.getPermissions( is ) );
|
||||
bc.registerPermissions( new PlayerSecuirtyWrapper( playerPerms ), pr, is );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,4 +308,10 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSecurityKey()
|
||||
{
|
||||
return securityKey;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import appeng.transformer.annotations.integration.Interface;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@Interface(iname = "IC2", iface = "ic2.api.energy.tile.IEnergySink")
|
||||
public abstract class IC2 extends MinecraftJoules implements IEnergySink
|
||||
public abstract class IC2 extends MinecraftJoules6 implements IEnergySink
|
||||
{
|
||||
|
||||
boolean isInIC2 = false;
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.integration.abstraction.IMJ;
|
||||
import appeng.integration.abstraction.IMJ5;
|
||||
import appeng.integration.abstraction.helpers.BaseMJperdition;
|
||||
import appeng.transformer.annotations.integration.Interface;
|
||||
import appeng.transformer.annotations.integration.Method;
|
||||
@@ -13,20 +13,20 @@ import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerHandler;
|
||||
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
|
||||
@Interface(iname = "BC", iface = "buildcraft.api.power.IPowerReceptor")
|
||||
public abstract class MinecraftJoules extends AERootPoweredTile implements IPowerReceptor
|
||||
@Interface(iname = "MJ5", iface = "buildcraft.api.power.IPowerReceptor")
|
||||
public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPowerReceptor
|
||||
{
|
||||
|
||||
BaseMJperdition bcPowerWrapper;
|
||||
|
||||
public MinecraftJoules() {
|
||||
public MinecraftJoules5() {
|
||||
if ( Platform.isServer() )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( AppEng.instance.isIntegrationEnabled( "MJ" ) )
|
||||
if ( AppEng.instance.isIntegrationEnabled( "MJ5" ) )
|
||||
{
|
||||
IMJ mjIntegration = (IMJ) AppEng.instance.getIntegration( "MJ" );
|
||||
IMJ5 mjIntegration = (IMJ5) AppEng.instance.getIntegration( "MJ5" );
|
||||
if ( mjIntegration != null )
|
||||
{
|
||||
addNewHandler( bcPowerWrapper = (BaseMJperdition) mjIntegration.createPerdition( this ) );
|
||||
@@ -43,7 +43,7 @@ public abstract class MinecraftJoules extends AERootPoweredTile implements IPowe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "BC")
|
||||
@Method(iname = "MJ5")
|
||||
final public PowerReceiver getPowerReceiver(ForgeDirection side)
|
||||
{
|
||||
if ( internalCanAcceptPower && getPowerSides().contains( side ) && bcPowerWrapper != null )
|
||||
@@ -52,7 +52,7 @@ public abstract class MinecraftJoules extends AERootPoweredTile implements IPowe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "BC")
|
||||
@Method(iname = "MJ5")
|
||||
final public void doWork(PowerHandler workProvider)
|
||||
{
|
||||
float requred = (float) getExternalPowerDemand( PowerUnits.MJ );
|
||||
@@ -62,7 +62,7 @@ public abstract class MinecraftJoules extends AERootPoweredTile implements IPowe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "BC")
|
||||
@Method(iname = "MJ5")
|
||||
final public World getWorld()
|
||||
{
|
||||
return worldObj;
|
||||
@@ -0,0 +1,94 @@
|
||||
package appeng.tile.powersink;
|
||||
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.transformer.annotations.integration.Interface;
|
||||
import appeng.transformer.annotations.integration.InterfaceList;
|
||||
import appeng.transformer.annotations.integration.Method;
|
||||
import buildcraft.api.mj.IBatteryObject;
|
||||
import buildcraft.api.mj.IBatteryProvider;
|
||||
|
||||
@InterfaceList(value = { @Interface(iname = "MJ6", iface = "buildcraft.api.mj.IBatteryProvider"),
|
||||
@Interface(iname = "MJ6", iface = "buildcraft.api.mj.IBatteryObject") })
|
||||
public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatteryProvider, IBatteryObject
|
||||
{
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public String kind()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public double getEnergyRequested()
|
||||
{
|
||||
return getExternalPowerDemand( PowerUnits.MJ );
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public double addEnergy(double amount)
|
||||
{
|
||||
double overflow = injectExternalPower( PowerUnits.MJ, amount );
|
||||
return amount - overflow;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public double addEnergy(double amount, boolean ignoreCycleLimit)
|
||||
{
|
||||
double overflow = injectExternalPower( PowerUnits.MJ, amount );
|
||||
return amount - overflow;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public double getEnergyStored()
|
||||
{
|
||||
return PowerUnits.AE.convertTo( PowerUnits.MJ, internalCurrentPower );
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public void setEnergyStored(double mj)
|
||||
{
|
||||
internalCurrentPower = PowerUnits.MJ.convertTo( PowerUnits.AE, mj );
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public double maxCapacity()
|
||||
{
|
||||
return PowerUnits.AE.convertTo( PowerUnits.MJ, internalMaxPower );
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public double minimumConsumption()
|
||||
{
|
||||
return 0.1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public double maxReceivedPerCycle()
|
||||
{
|
||||
return 999999.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public IBatteryObject reconfigure(double maxCapacity, double maxReceivedPerCycle, double minimumConsumption)
|
||||
{
|
||||
return getMjBattery( "" );
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "MJ6")
|
||||
public IBatteryObject getMjBattery(String kind)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user