Restore DSU Api, mark all other api's as dead.
This commit is contained in:
+2
-1
@@ -75,7 +75,8 @@ public class AppEng
|
||||
IntegrationSide.BOTH, "Universal Electricity", null, "UE", // UE
|
||||
IntegrationSide.BOTH, "Logistics Pipes", "LogisticsPipes|Main", "LP", // LP
|
||||
// IntegrationSide.CLIENT, "Inventory Tweaks", "", "InvTweaks",
|
||||
IntegrationSide.BOTH, "Mine Factory Reloaded", "MineFactoryReloaded", "MFR", // MFR
|
||||
// IntegrationSide.BOTH, "Mine Factory Reloaded", "MineFactoryReloaded", "MFR", // MFR
|
||||
IntegrationSide.BOTH, "Deep Storage Unit", null, "DSU", // DSU
|
||||
IntegrationSide.BOTH, "Better Storage", "betterstorage", "BS", // BS
|
||||
IntegrationSide.BOTH, "Factorization", "factorization", "FZ", // FZ
|
||||
IntegrationSide.BOTH, "Forestry", "Forestry", "Forestry", // Forestry
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package appeng.integration.abstraction;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
|
||||
public interface IMFR
|
||||
{
|
||||
|
||||
IMEInventory getDSU(TileEntity te);
|
||||
|
||||
boolean isDSU(TileEntity te);
|
||||
|
||||
}
|
||||
package appeng.integration.abstraction;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
|
||||
public interface IDSU
|
||||
{
|
||||
|
||||
IMEInventory getDSU(TileEntity te);
|
||||
|
||||
boolean isDSU(TileEntity te);
|
||||
|
||||
}
|
||||
@@ -1,43 +1,43 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IMFR;
|
||||
import appeng.integration.modules.helpers.MFRDSU;
|
||||
import appeng.integration.modules.helpers.MFRDSUHandler;
|
||||
|
||||
public class MFR implements IIntegrationModule, IMFR
|
||||
{
|
||||
|
||||
public static MFR instance;
|
||||
|
||||
@Override
|
||||
public IMEInventory getDSU(TileEntity te)
|
||||
{
|
||||
return new MFRDSU( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDSU(TileEntity te)
|
||||
{
|
||||
if ( te instanceof IDeepStorageUnit )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new MFRDSUHandler() );
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IDSU;
|
||||
import appeng.integration.modules.helpers.MFRDSU;
|
||||
import appeng.integration.modules.helpers.MFRDSUHandler;
|
||||
|
||||
public class DSU implements IIntegrationModule, IDSU
|
||||
{
|
||||
|
||||
public static DSU instance;
|
||||
|
||||
@Override
|
||||
public IMEInventory getDSU(TileEntity te)
|
||||
{
|
||||
return new MFRDSU( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDSU(TileEntity te)
|
||||
{
|
||||
if ( te instanceof IDeepStorageUnit )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new MFRDSUHandler() );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,223 +1,223 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.TunnelType;
|
||||
import appeng.api.features.IP2PTunnelRegistry;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
import appeng.facade.FacadePart;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IBC;
|
||||
import appeng.integration.modules.helpers.BCPipeHandler;
|
||||
import buildcraft.BuildCraftEnergy;
|
||||
import buildcraft.BuildCraftTransport;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import buildcraft.api.transport.FacadeManager;
|
||||
import buildcraft.api.transport.IPipeTile;
|
||||
import buildcraft.api.transport.IPipeTile.PipeType;
|
||||
import buildcraft.transport.ItemFacade;
|
||||
import buildcraft.transport.PipeIconProvider;
|
||||
import buildcraft.transport.TileGenericPipe;
|
||||
|
||||
public class BC implements IIntegrationModule, IBC
|
||||
{
|
||||
|
||||
public static BC instance;
|
||||
|
||||
@Override
|
||||
public void addFacade(ItemStack item)
|
||||
{
|
||||
// Myrathi :
|
||||
// FMLInterModComms.sendMessage("BuildCraft|Transport", "add-facade",
|
||||
// <your block ID> + "@" + <your block meta>);
|
||||
FacadeManager.addFacade( item );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWrench(Item eq)
|
||||
{
|
||||
return eq instanceof IToolWrench;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPipe(TileEntity te, ForgeDirection dir)
|
||||
{
|
||||
if ( te instanceof IPipeTile )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( te instanceof TileGenericPipe )
|
||||
if ( ((TileGenericPipe) te).hasPlug( dir.getOpposite() ) )
|
||||
return false;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrench(Item i, EntityPlayer p, int x, int y, int z)
|
||||
{
|
||||
return ((IToolWrench) i).canWrench( p, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wrenchUsed(Item i, EntityPlayer p, int x, int y, int z)
|
||||
{
|
||||
((IToolWrench) i).wrenchUsed( p, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addItemsToPipe(TileEntity te, ItemStack is, ForgeDirection dir)
|
||||
{
|
||||
if ( is != null && te != null && te instanceof IPipeTile )
|
||||
{
|
||||
IPipeTile pt = (IPipeTile) te;
|
||||
if ( pt.getPipeType() == PipeType.ITEM )
|
||||
{
|
||||
int amt = pt.injectItem( is, false, dir );
|
||||
if ( amt == is.stackSize )
|
||||
{
|
||||
pt.injectItem( is, true, dir );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFacade(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return false;
|
||||
return is.getItem() instanceof ItemFacade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddItemsToPipe(TileEntity te, ItemStack is, ForgeDirection dir)
|
||||
{
|
||||
|
||||
if ( is != null && te != null && te instanceof IPipeTile )
|
||||
{
|
||||
IPipeTile pt = (IPipeTile) te;
|
||||
if ( pt.getPipeType() == PipeType.ITEM )
|
||||
{
|
||||
int amt = pt.injectItem( is, false, dir );
|
||||
if ( amt == is.stackSize )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPowerP2P()
|
||||
{
|
||||
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 0 ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 1 ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 2 ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerCobblestone ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerDiamond ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerGold ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerQuartz ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerStone ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerWood ), TunnelType.BC_POWER );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemP2P()
|
||||
{
|
||||
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsWood ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsVoid ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsSandstone ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsQuartz ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsObsidian ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsIron ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsGold ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsEmerald ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsDiamond ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsStone ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsCobblestone ), TunnelType.ITEM );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerLiquidsP2P()
|
||||
{
|
||||
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsCobblestone ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsEmerald ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsGold ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsIron ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsSandstone ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsStone ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsVoid ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsWood ), TunnelType.FLUID );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
AEApi.instance().partHelper().registerNewLayer( "appeng.api.parts.layers.LayerIPipeConnection", "buildcraft.api.transport.IPipeConnection" );
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BCPipeHandler() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
registerPowerP2P();
|
||||
registerItemP2P();
|
||||
registerLiquidsP2P();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFacadePart createFacadePart(int[] ids, ForgeDirection side)
|
||||
{
|
||||
ItemStack fs = ItemFacade.getStack( ids[0], ids[1] );
|
||||
return new FacadePart( fs, side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFacadePart createFacadePart(ItemStack fs, ForgeDirection side)
|
||||
{
|
||||
return new FacadePart( fs, side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getTextureForFacade(ItemStack facade)
|
||||
{
|
||||
return new ItemStack( Block.blocksList[ItemFacade.getBlockId( facade )], 1, ItemFacade.getMetaData( facade ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getFacadeTexture()
|
||||
{
|
||||
try
|
||||
{
|
||||
return BuildCraftTransport.instance.pipeIconProvider.getIcon( PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal() ); // Structure
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
// Pipe
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.TunnelType;
|
||||
import appeng.api.features.IP2PTunnelRegistry;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
import appeng.facade.FacadePart;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IBC;
|
||||
import appeng.integration.modules.helpers.dead.BCPipeHandler;
|
||||
import buildcraft.BuildCraftEnergy;
|
||||
import buildcraft.BuildCraftTransport;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import buildcraft.api.transport.FacadeManager;
|
||||
import buildcraft.api.transport.IPipeTile;
|
||||
import buildcraft.api.transport.IPipeTile.PipeType;
|
||||
import buildcraft.transport.ItemFacade;
|
||||
import buildcraft.transport.PipeIconProvider;
|
||||
import buildcraft.transport.TileGenericPipe;
|
||||
|
||||
public class BC implements IIntegrationModule, IBC
|
||||
{
|
||||
|
||||
public static BC instance;
|
||||
|
||||
@Override
|
||||
public void addFacade(ItemStack item)
|
||||
{
|
||||
// Myrathi :
|
||||
// FMLInterModComms.sendMessage("BuildCraft|Transport", "add-facade",
|
||||
// <your block ID> + "@" + <your block meta>);
|
||||
FacadeManager.addFacade( item );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWrench(Item eq)
|
||||
{
|
||||
return eq instanceof IToolWrench;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPipe(TileEntity te, ForgeDirection dir)
|
||||
{
|
||||
if ( te instanceof IPipeTile )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( te instanceof TileGenericPipe )
|
||||
if ( ((TileGenericPipe) te).hasPlug( dir.getOpposite() ) )
|
||||
return false;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrench(Item i, EntityPlayer p, int x, int y, int z)
|
||||
{
|
||||
return ((IToolWrench) i).canWrench( p, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wrenchUsed(Item i, EntityPlayer p, int x, int y, int z)
|
||||
{
|
||||
((IToolWrench) i).wrenchUsed( p, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addItemsToPipe(TileEntity te, ItemStack is, ForgeDirection dir)
|
||||
{
|
||||
if ( is != null && te != null && te instanceof IPipeTile )
|
||||
{
|
||||
IPipeTile pt = (IPipeTile) te;
|
||||
if ( pt.getPipeType() == PipeType.ITEM )
|
||||
{
|
||||
int amt = pt.injectItem( is, false, dir );
|
||||
if ( amt == is.stackSize )
|
||||
{
|
||||
pt.injectItem( is, true, dir );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFacade(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return false;
|
||||
return is.getItem() instanceof ItemFacade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddItemsToPipe(TileEntity te, ItemStack is, ForgeDirection dir)
|
||||
{
|
||||
|
||||
if ( is != null && te != null && te instanceof IPipeTile )
|
||||
{
|
||||
IPipeTile pt = (IPipeTile) te;
|
||||
if ( pt.getPipeType() == PipeType.ITEM )
|
||||
{
|
||||
int amt = pt.injectItem( is, false, dir );
|
||||
if ( amt == is.stackSize )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPowerP2P()
|
||||
{
|
||||
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 0 ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 1 ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 2 ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerCobblestone ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerDiamond ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerGold ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerQuartz ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerStone ), TunnelType.BC_POWER );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerWood ), TunnelType.BC_POWER );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemP2P()
|
||||
{
|
||||
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsWood ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsVoid ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsSandstone ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsQuartz ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsObsidian ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsIron ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsGold ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsEmerald ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsDiamond ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsStone ), TunnelType.ITEM );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeItemsCobblestone ), TunnelType.ITEM );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerLiquidsP2P()
|
||||
{
|
||||
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsCobblestone ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsEmerald ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsGold ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsIron ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsSandstone ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsStone ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsVoid ), TunnelType.FLUID );
|
||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipeFluidsWood ), TunnelType.FLUID );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
AEApi.instance().partHelper().registerNewLayer( "appeng.api.parts.layers.LayerIPipeConnection", "buildcraft.api.transport.IPipeConnection" );
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BCPipeHandler() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
registerPowerP2P();
|
||||
registerItemP2P();
|
||||
registerLiquidsP2P();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFacadePart createFacadePart(int[] ids, ForgeDirection side)
|
||||
{
|
||||
ItemStack fs = ItemFacade.getStack( ids[0], ids[1] );
|
||||
return new FacadePart( fs, side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFacadePart createFacadePart(ItemStack fs, ForgeDirection side)
|
||||
{
|
||||
return new FacadePart( fs, side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getTextureForFacade(ItemStack facade)
|
||||
{
|
||||
return new ItemStack( Block.blocksList[ItemFacade.getBlockId( facade )], 1, ItemFacade.getMetaData( facade ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getFacadeTexture()
|
||||
{
|
||||
try
|
||||
{
|
||||
return BuildCraftTransport.instance.pipeIconProvider.getIcon( PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal() ); // Structure
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
// Pipe
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,45 +1,45 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.mcft.copy.betterstorage.api.ICrateStorage;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IBS;
|
||||
import appeng.integration.modules.helpers.BSCrateHandler;
|
||||
import appeng.integration.modules.helpers.BSCrateStorageAdaptor;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
|
||||
public class BS implements IIntegrationModule, IBS
|
||||
{
|
||||
|
||||
public static BS instance;
|
||||
|
||||
@Override
|
||||
public boolean isStorageCrate(Object te)
|
||||
{
|
||||
return te instanceof ICrateStorage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryAdaptor getAdaptor(Object te, ForgeDirection d)
|
||||
{
|
||||
if ( te instanceof ICrateStorage )
|
||||
{
|
||||
return new BSCrateStorageAdaptor( te, d );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BSCrateHandler() );
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import net.mcft.copy.betterstorage.api.ICrateStorage;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IBS;
|
||||
import appeng.integration.modules.helpers.dead.BSCrateHandler;
|
||||
import appeng.integration.modules.helpers.dead.BSCrateStorageAdaptor;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
|
||||
public class BS implements IIntegrationModule, IBS
|
||||
{
|
||||
|
||||
public static BS instance;
|
||||
|
||||
@Override
|
||||
public boolean isStorageCrate(Object te)
|
||||
{
|
||||
return te instanceof ICrateStorage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryAdaptor getAdaptor(Object te, ForgeDirection d)
|
||||
{
|
||||
if ( te instanceof ICrateStorage )
|
||||
{
|
||||
return new BSCrateStorageAdaptor( te, d );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BSCrateHandler() );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,152 +1,152 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.core.AELog;
|
||||
import appeng.fmp.CableBusPart;
|
||||
import appeng.fmp.FMPEvent;
|
||||
import appeng.fmp.PartRegistry;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IFMP;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import appeng.util.Platform;
|
||||
import codechicken.lib.vec.BlockCoord;
|
||||
import codechicken.microblock.BlockMicroMaterial;
|
||||
import codechicken.multipart.MultiPartRegistry;
|
||||
import codechicken.multipart.MultiPartRegistry.IPartConverter;
|
||||
import codechicken.multipart.MultiPartRegistry.IPartFactory;
|
||||
import codechicken.multipart.MultipartGenerator;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
|
||||
public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IFMP
|
||||
{
|
||||
|
||||
public static FMP instance;
|
||||
|
||||
@Override
|
||||
public TMultiPart createPart(String name, boolean client)
|
||||
{
|
||||
for (PartRegistry pr : PartRegistry.values())
|
||||
{
|
||||
if ( pr.getName() == name )
|
||||
return pr.construct( 0 );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConvert(int blockID)
|
||||
{
|
||||
return PartRegistry.isPart( Block.blocksList[blockID] );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TMultiPart convert(World world, BlockCoord pos)
|
||||
{
|
||||
int blockID = world.getBlockId( pos.x, pos.y, pos.z );
|
||||
int meta = world.getBlockMetadata( pos.x, pos.y, pos.z );
|
||||
|
||||
TMultiPart part = PartRegistry.getPartByBlock( Block.blocksList[blockID], meta );
|
||||
if ( part instanceof CableBusPart )
|
||||
{
|
||||
CableBusPart cbp = (CableBusPart) part;
|
||||
cbp.convertFromTile( world.getTileEntity( pos.x, pos.y, pos.z ) );
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
BlockMicroMaterial.createAndRegister( AEApi.instance().blocks().blockQuartz.block() );
|
||||
BlockMicroMaterial.createAndRegister( AEApi.instance().blocks().blockQuartzPiller.block() );
|
||||
BlockMicroMaterial.createAndRegister( AEApi.instance().blocks().blockQuartzChiseled.block() );
|
||||
|
||||
PartRegistry reg[] = PartRegistry.values();
|
||||
|
||||
String data[] = new String[reg.length];
|
||||
for (int x = 0; x < data.length; x++)
|
||||
data[x] = reg[x].getName();
|
||||
|
||||
MultiPartRegistry.registerConverter( this );
|
||||
MultiPartRegistry.registerParts( this, data );
|
||||
|
||||
MultipartGenerator.registerPassThroughInterface( "appeng.helpers.AEMultiTile" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit() throws Throwable
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register( new FMPEvent() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPartHost getOrCreateHost(TileEntity tile)
|
||||
{
|
||||
try
|
||||
{
|
||||
BlockCoord loc = new BlockCoord( tile.xCoord, tile.yCoord, tile.zCoord );
|
||||
|
||||
TileMultipart mp = TileMultipart.getOrConvertTile( tile.worldObj, loc );
|
||||
if ( mp != null )
|
||||
{
|
||||
scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
|
||||
while (i.hasNext())
|
||||
{
|
||||
TMultiPart p = i.next();
|
||||
if ( p instanceof CableBusPart )
|
||||
return (IPartHost) p;
|
||||
}
|
||||
|
||||
TMultiPart part = PartRegistry.CableBusPart.construct( 0 );
|
||||
if ( mp.canAddPart( part ) && Platform.isServer() )
|
||||
TileMultipart.addPart( tile.worldObj, loc, part );
|
||||
return (CableBusPart) part;
|
||||
}
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
AELog.error( t );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CableBusContainer getCableContainer(TileEntity te)
|
||||
{
|
||||
if ( te instanceof TileMultipart )
|
||||
{
|
||||
TileMultipart mp = (TileMultipart) te;
|
||||
scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
|
||||
while (i.hasNext())
|
||||
{
|
||||
TMultiPart p = i.next();
|
||||
if ( p instanceof CableBusPart )
|
||||
return ((CableBusPart) p).cb;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPassThru(Class<?> layerInterface)
|
||||
{
|
||||
try
|
||||
{
|
||||
MultipartGenerator.registerPassThroughInterface( layerInterface.getName() );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
AELog.severe( "Failed to register " + layerInterface.getName() + " with FMP, some features may not work with MultiParts." );
|
||||
AELog.error( t );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.core.AELog;
|
||||
import appeng.fmp.CableBusPart;
|
||||
import appeng.fmp.FMPEvent;
|
||||
import appeng.fmp.PartRegistry;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IFMP;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import appeng.util.Platform;
|
||||
import codechicken.lib.vec.BlockCoord;
|
||||
import codechicken.microblock.BlockMicroMaterial;
|
||||
import codechicken.multipart.MultiPartRegistry;
|
||||
import codechicken.multipart.MultiPartRegistry.IPartConverter;
|
||||
import codechicken.multipart.MultiPartRegistry.IPartFactory;
|
||||
import codechicken.multipart.MultipartGenerator;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
|
||||
public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IFMP
|
||||
{
|
||||
|
||||
public static FMP instance;
|
||||
|
||||
@Override
|
||||
public TMultiPart createPart(String name, boolean client)
|
||||
{
|
||||
for (PartRegistry pr : PartRegistry.values())
|
||||
{
|
||||
if ( pr.getName() == name )
|
||||
return pr.construct( 0 );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConvert(int blockID)
|
||||
{
|
||||
return PartRegistry.isPart( Block.blocksList[blockID] );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TMultiPart convert(World world, BlockCoord pos)
|
||||
{
|
||||
int blockID = world.getBlockId( pos.x, pos.y, pos.z );
|
||||
int meta = world.getBlockMetadata( pos.x, pos.y, pos.z );
|
||||
|
||||
TMultiPart part = PartRegistry.getPartByBlock( Block.blocksList[blockID], meta );
|
||||
if ( part instanceof CableBusPart )
|
||||
{
|
||||
CableBusPart cbp = (CableBusPart) part;
|
||||
cbp.convertFromTile( world.getTileEntity( pos.x, pos.y, pos.z ) );
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
BlockMicroMaterial.createAndRegister( AEApi.instance().blocks().blockQuartz.block() );
|
||||
BlockMicroMaterial.createAndRegister( AEApi.instance().blocks().blockQuartzPiller.block() );
|
||||
BlockMicroMaterial.createAndRegister( AEApi.instance().blocks().blockQuartzChiseled.block() );
|
||||
|
||||
PartRegistry reg[] = PartRegistry.values();
|
||||
|
||||
String data[] = new String[reg.length];
|
||||
for (int x = 0; x < data.length; x++)
|
||||
data[x] = reg[x].getName();
|
||||
|
||||
MultiPartRegistry.registerConverter( this );
|
||||
MultiPartRegistry.registerParts( this, data );
|
||||
|
||||
MultipartGenerator.registerPassThroughInterface( "appeng.helpers.AEMultiTile" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit() throws Throwable
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register( new FMPEvent() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPartHost getOrCreateHost(TileEntity tile)
|
||||
{
|
||||
try
|
||||
{
|
||||
BlockCoord loc = new BlockCoord( tile.xCoord, tile.yCoord, tile.zCoord );
|
||||
|
||||
TileMultipart mp = TileMultipart.getOrConvertTile( tile.worldObj, loc );
|
||||
if ( mp != null )
|
||||
{
|
||||
scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
|
||||
while (i.hasNext())
|
||||
{
|
||||
TMultiPart p = i.next();
|
||||
if ( p instanceof CableBusPart )
|
||||
return (IPartHost) p;
|
||||
}
|
||||
|
||||
TMultiPart part = PartRegistry.CableBusPart.construct( 0 );
|
||||
if ( mp.canAddPart( part ) && Platform.isServer() )
|
||||
TileMultipart.addPart( tile.worldObj, loc, part );
|
||||
return (CableBusPart) part;
|
||||
}
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
AELog.error( t );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CableBusContainer getCableContainer(TileEntity te)
|
||||
{
|
||||
if ( te instanceof TileMultipart )
|
||||
{
|
||||
TileMultipart mp = (TileMultipart) te;
|
||||
scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
|
||||
while (i.hasNext())
|
||||
{
|
||||
TMultiPart p = i.next();
|
||||
if ( p instanceof CableBusPart )
|
||||
return ((CableBusPart) p).cb;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPassThru(Class<?> layerInterface)
|
||||
{
|
||||
try
|
||||
{
|
||||
MultipartGenerator.registerPassThroughInterface( layerInterface.getName() );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
AELog.severe( "Failed to register " + layerInterface.getName() + " with FMP, some features may not work with MultiParts." );
|
||||
AELog.error( t );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,215 +1,215 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IFZ;
|
||||
import appeng.integration.modules.helpers.FactorizationBarrel;
|
||||
import appeng.integration.modules.helpers.FactorizationHandler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
/**
|
||||
* 100% Hacks.
|
||||
*/
|
||||
public class FZ implements IFZ, IIntegrationModule
|
||||
{
|
||||
|
||||
public static FZ instance;
|
||||
|
||||
private static Class day_BarrelClass;
|
||||
private static Method day_getItemCount;
|
||||
private static Method day_setItemCount;
|
||||
private static Method day_getMaxSize;
|
||||
private static Field day_item;
|
||||
|
||||
private static Class barrelClass;
|
||||
private static Method getItemCount;
|
||||
private static Method setItemCount;
|
||||
private static Method getMaxSize;
|
||||
private static Field item;
|
||||
|
||||
@Override
|
||||
public ItemStack barrelGetItem(TileEntity te)
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemStack i;
|
||||
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
i = (ItemStack) day_item.get( te );
|
||||
else
|
||||
i = (ItemStack) item.get( te );
|
||||
|
||||
if ( i != null )
|
||||
i = Platform.cloneItemStack( i );
|
||||
return i;
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int barrelGetMaxItemCount(TileEntity te)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
return (Integer) day_getMaxSize.invoke( te );
|
||||
else
|
||||
return (Integer) getMaxSize.invoke( te );
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (InvocationTargetException e)
|
||||
{
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int barrelGetItemCount(TileEntity te)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
return (Integer) day_getItemCount.invoke( te );
|
||||
else
|
||||
return (Integer) getItemCount.invoke( te );
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (InvocationTargetException e)
|
||||
{
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemType(TileEntity te, ItemStack input)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
day_item.set( te, input == null ? null : input.copy() );
|
||||
else
|
||||
item.set( te, input == null ? null : input.copy() );
|
||||
|
||||
te.markDirty();
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void barrelSetCount(TileEntity te, int max)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
day_setItemCount.invoke( te, max );
|
||||
else
|
||||
setItemCount.invoke( te, max );
|
||||
|
||||
te.markDirty();
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (InvocationTargetException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getFactorizationBarrel(TileEntity te)
|
||||
{
|
||||
return new FactorizationBarrel( this, te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBarrel(TileEntity te)
|
||||
{
|
||||
if ( day_BarrelClass.isAssignableFrom( te.getClass() ) )
|
||||
return true;
|
||||
if ( barrelClass.isAssignableFrom( te.getClass() ) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
barrelClass = Class.forName( "factorization.weird.TileEntityBarrel" );
|
||||
day_BarrelClass = Class.forName( "factorization.weird.TileEntityDayBarrel" );
|
||||
|
||||
getItemCount = barrelClass.getDeclaredMethod( "getItemCount", new Class[] {} );
|
||||
setItemCount = barrelClass.getDeclaredMethod( "setItemCount", new Class[] { int.class } );
|
||||
getMaxSize = barrelClass.getDeclaredMethod( "getMaxSize", new Class[] {} );
|
||||
item = barrelClass.getDeclaredField( "item" );
|
||||
|
||||
day_getItemCount = day_BarrelClass.getDeclaredMethod( "getItemCount", new Class[] {} );
|
||||
day_setItemCount = day_BarrelClass.getDeclaredMethod( "setItemCount", new Class[] { int.class } );
|
||||
day_getMaxSize = day_BarrelClass.getDeclaredMethod( "getMaxSize", new Class[] {} );
|
||||
day_item = day_BarrelClass.getDeclaredField( "item" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new FactorizationHandler() );
|
||||
|
||||
// certus quartz
|
||||
grinderRecipe( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
grinderRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
grinderRecipe( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
grinderRecipe( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
|
||||
private void grinderRecipe(ItemStack in, ItemStack out)
|
||||
{
|
||||
try
|
||||
{
|
||||
Class c = Class.forName( "factorization.common.TileEntityGrinder" );
|
||||
Method m = c.getMethod( "addRecipe", Object.class, ItemStack.class, float.class );
|
||||
m.invoke( c, in, out, 1.0 );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
// AELog.info( "" );
|
||||
// throw new RuntimeException( t );
|
||||
}
|
||||
}
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IFZ;
|
||||
import appeng.integration.modules.helpers.dead.FactorizationBarrel;
|
||||
import appeng.integration.modules.helpers.dead.FactorizationHandler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
/**
|
||||
* 100% Hacks.
|
||||
*/
|
||||
public class FZ implements IFZ, IIntegrationModule
|
||||
{
|
||||
|
||||
public static FZ instance;
|
||||
|
||||
private static Class day_BarrelClass;
|
||||
private static Method day_getItemCount;
|
||||
private static Method day_setItemCount;
|
||||
private static Method day_getMaxSize;
|
||||
private static Field day_item;
|
||||
|
||||
private static Class barrelClass;
|
||||
private static Method getItemCount;
|
||||
private static Method setItemCount;
|
||||
private static Method getMaxSize;
|
||||
private static Field item;
|
||||
|
||||
@Override
|
||||
public ItemStack barrelGetItem(TileEntity te)
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemStack i;
|
||||
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
i = (ItemStack) day_item.get( te );
|
||||
else
|
||||
i = (ItemStack) item.get( te );
|
||||
|
||||
if ( i != null )
|
||||
i = Platform.cloneItemStack( i );
|
||||
return i;
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int barrelGetMaxItemCount(TileEntity te)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
return (Integer) day_getMaxSize.invoke( te );
|
||||
else
|
||||
return (Integer) getMaxSize.invoke( te );
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (InvocationTargetException e)
|
||||
{
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int barrelGetItemCount(TileEntity te)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
return (Integer) day_getItemCount.invoke( te );
|
||||
else
|
||||
return (Integer) getItemCount.invoke( te );
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (InvocationTargetException e)
|
||||
{
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemType(TileEntity te, ItemStack input)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
day_item.set( te, input == null ? null : input.copy() );
|
||||
else
|
||||
item.set( te, input == null ? null : input.copy() );
|
||||
|
||||
te.markDirty();
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void barrelSetCount(TileEntity te, int max)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( day_BarrelClass.isInstance( te ) )
|
||||
day_setItemCount.invoke( te, max );
|
||||
else
|
||||
setItemCount.invoke( te, max );
|
||||
|
||||
te.markDirty();
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
}
|
||||
catch (InvocationTargetException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getFactorizationBarrel(TileEntity te)
|
||||
{
|
||||
return new FactorizationBarrel( this, te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBarrel(TileEntity te)
|
||||
{
|
||||
if ( day_BarrelClass.isAssignableFrom( te.getClass() ) )
|
||||
return true;
|
||||
if ( barrelClass.isAssignableFrom( te.getClass() ) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
barrelClass = Class.forName( "factorization.weird.TileEntityBarrel" );
|
||||
day_BarrelClass = Class.forName( "factorization.weird.TileEntityDayBarrel" );
|
||||
|
||||
getItemCount = barrelClass.getDeclaredMethod( "getItemCount", new Class[] {} );
|
||||
setItemCount = barrelClass.getDeclaredMethod( "setItemCount", new Class[] { int.class } );
|
||||
getMaxSize = barrelClass.getDeclaredMethod( "getMaxSize", new Class[] {} );
|
||||
item = barrelClass.getDeclaredField( "item" );
|
||||
|
||||
day_getItemCount = day_BarrelClass.getDeclaredMethod( "getItemCount", new Class[] {} );
|
||||
day_setItemCount = day_BarrelClass.getDeclaredMethod( "setItemCount", new Class[] { int.class } );
|
||||
day_getMaxSize = day_BarrelClass.getDeclaredMethod( "getMaxSize", new Class[] {} );
|
||||
day_item = day_BarrelClass.getDeclaredField( "item" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new FactorizationHandler() );
|
||||
|
||||
// certus quartz
|
||||
grinderRecipe( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
grinderRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
grinderRecipe( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
grinderRecipe( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
|
||||
private void grinderRecipe(ItemStack in, ItemStack out)
|
||||
{
|
||||
try
|
||||
{
|
||||
Class c = Class.forName( "factorization.common.TileEntityGrinder" );
|
||||
Method m = c.getMethod( "addRecipe", Object.class, ItemStack.class, float.class );
|
||||
m.invoke( c, in, out, 1.0 );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
// AELog.info( "" );
|
||||
// throw new RuntimeException( t );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class Forestry implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static Forestry instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class Forestry implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static Forestry instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +1,46 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import gregtechmod.api.interfaces.IDigitalChest;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IGT;
|
||||
import appeng.integration.modules.helpers.GregTechHandler;
|
||||
import appeng.integration.modules.helpers.GregTechQuantumChest;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
|
||||
public class GT implements IGT, IIntegrationModule
|
||||
{
|
||||
|
||||
public static GT instance;
|
||||
|
||||
@Override
|
||||
public IMEInventory getQuantumChest(TileEntity te)
|
||||
{
|
||||
return new GregTechQuantumChest( (IInventory) te, InventoryAdaptor.getAdaptor( te, ForgeDirection.NORTH ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isQuantumChest(TileEntity te)
|
||||
{
|
||||
if ( te instanceof IDigitalChest )
|
||||
return ((IDigitalChest) te).isDigitalChest();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new GregTechHandler() );
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import gregtechmod.api.interfaces.IDigitalChest;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IGT;
|
||||
import appeng.integration.modules.helpers.dead.GregTechHandler;
|
||||
import appeng.integration.modules.helpers.dead.GregTechQuantumChest;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
|
||||
public class GT implements IGT, IIntegrationModule
|
||||
{
|
||||
|
||||
public static GT instance;
|
||||
|
||||
@Override
|
||||
public IMEInventory getQuantumChest(TileEntity te)
|
||||
{
|
||||
return new GregTechQuantumChest( (IInventory) te, InventoryAdaptor.getAdaptor( te, ForgeDirection.NORTH ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isQuantumChest(TileEntity te)
|
||||
{
|
||||
if ( te instanceof IDigitalChest )
|
||||
return ((IDigitalChest) te).isDigitalChest();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new GregTechHandler() );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +1,70 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IIC2;
|
||||
|
||||
public class IC2 implements IIntegrationModule, IIC2
|
||||
{
|
||||
|
||||
public static IC2 instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().matterCannon().registerAmmo( getItem( "uraniumDrop" ), 238.0289 );
|
||||
|
||||
// certus quartz
|
||||
maceratorRecipe( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
maceratorRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
maceratorRecipe( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
maceratorRecipe( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* private void compressorRecipe(ItemStack in, ItemStack out) {
|
||||
* ic2.api.recipe.Recipes.compressor.addRecipe( new RecipeInputItemStack(
|
||||
* in, in.stackSize ), null, out ); }
|
||||
*/
|
||||
private void maceratorRecipe(ItemStack in, ItemStack out)
|
||||
{
|
||||
ic2.api.recipe.Recipes.macerator.addRecipe( new RecipeInputItemStack( in, in.stackSize ), null, out );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToEnergyNet(TileEntity appEngTile)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergyTile) appEngTile ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromEnergyNet(TileEntity appEngTile)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergyTile) appEngTile ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem(String name)
|
||||
{
|
||||
return ic2.api.item.Items.getItem( name );
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IIC2;
|
||||
|
||||
public class IC2 implements IIntegrationModule, IIC2
|
||||
{
|
||||
|
||||
public static IC2 instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
AEApi.instance().registries().matterCannon().registerAmmo( getItem( "uraniumDrop" ), 238.0289 );
|
||||
|
||||
// certus quartz
|
||||
maceratorRecipe( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
maceratorRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
maceratorRecipe( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
maceratorRecipe( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* private void compressorRecipe(ItemStack in, ItemStack out) {
|
||||
* ic2.api.recipe.Recipes.compressor.addRecipe( new RecipeInputItemStack(
|
||||
* in, in.stackSize ), null, out ); }
|
||||
*/
|
||||
private void maceratorRecipe(ItemStack in, ItemStack out)
|
||||
{
|
||||
ic2.api.recipe.Recipes.macerator.addRecipe( new RecipeInputItemStack( in, in.stackSize ), null, out );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToEnergyNet(TileEntity appEngTile)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergyTile) appEngTile ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromEnergyNet(TileEntity appEngTile)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergyTile) appEngTile ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem(String name)
|
||||
{
|
||||
return ic2.api.item.Items.getItem( name );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class InvTweaks implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static InvTweaks instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class InvTweaks implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static InvTweaks instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class LP implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static LP instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class LP implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static LP instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +1,39 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IMJ;
|
||||
import appeng.integration.modules.helpers.BCPerdition;
|
||||
import appeng.integration.modules.helpers.BaseBCperdition;
|
||||
import appeng.tile.powersink.BuildCraft;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
|
||||
public class MJ implements IIntegrationModule, IMJ
|
||||
{
|
||||
|
||||
public static MJ instance;
|
||||
|
||||
@Override
|
||||
public BaseBCperdition createPerdition(BuildCraft buildCraft)
|
||||
{
|
||||
if ( buildCraft instanceof IPowerReceptor )
|
||||
return new BCPerdition( buildCraft );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
if ( ((Object) this) instanceof BCPerdition )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit() throws Throwable
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IMJ;
|
||||
import appeng.integration.modules.helpers.BaseBCperdition;
|
||||
import appeng.integration.modules.helpers.dead.BCPerdition;
|
||||
import appeng.tile.powersink.BuildCraft;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
|
||||
public class MJ implements IIntegrationModule, IMJ
|
||||
{
|
||||
|
||||
public static MJ instance;
|
||||
|
||||
@Override
|
||||
public BaseBCperdition createPerdition(BuildCraft buildCraft)
|
||||
{
|
||||
if ( buildCraft instanceof IPowerReceptor )
|
||||
return new BCPerdition( buildCraft );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
if ( ((Object) this) instanceof BCPerdition )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit() throws Throwable
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +1,41 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class Mekanism implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static Mekanism instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// certus quartz
|
||||
crusher( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
crusher( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
crusher( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
crusher( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
|
||||
private void crusher(ItemStack input, ItemStack output)
|
||||
{
|
||||
mekanism.api.RecipeHelper.addCrusherRecipe( input, output );
|
||||
}
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class Mekanism implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static Mekanism instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// certus quartz
|
||||
crusher( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
crusher( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
crusher( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
crusher( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
|
||||
private void crusher(ItemStack input, ItemStack output)
|
||||
{
|
||||
mekanism.api.RecipeHelper.addCrusherRecipe( input, output );
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class Mystcraft implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static Mystcraft instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class Mystcraft implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static Mystcraft instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,42 +1,42 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.modules.helpers.NEIQuartzShapedRecipeHandler;
|
||||
|
||||
public class NEI implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static NEI instance;
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
Class API = Class.forName( "codechicken.nei.api.API" );
|
||||
Method registerRecipeHandler = API.getDeclaredMethod( "registerRecipeHandler", new Class[] { codechicken.nei.recipe.ICraftingHandler.class } );
|
||||
Method registerUsageHandler = API.getDeclaredMethod( "registerUsageHandler", new Class[] { codechicken.nei.recipe.IUsageHandler.class } );
|
||||
|
||||
registerRecipeHandler.invoke( API, new NEIQuartzShapedRecipeHandler() );
|
||||
registerUsageHandler.invoke( API, new NEIQuartzShapedRecipeHandler() );
|
||||
|
||||
/*
|
||||
* Method registerGuiOverlay = API.getDeclaredMethod( "registerGuiOverlay", new Class[] { Class.class,
|
||||
* String.class, int.class, int.class } ); Class IOverlayHandler = Class.forName(
|
||||
* "codechicken.nei.api.IOverlayHandler" ); Class DefaultOverlayHandler =
|
||||
* NEICraftingTerminalOverlayHandler.class; Method registerGuiOverlayHandler = API.getDeclaredMethod(
|
||||
* "registerGuiOverlayHandler", new Class[] { Class.class, IOverlayHandler, String.class } );
|
||||
* registerGuiOverlay.invoke( API, GuiCraftingTerminal.class, "crafting", 6, 75 ); Constructor
|
||||
* DefaultOverlayHandlerConstructor = DefaultOverlayHandler .getConstructor( new Class[] { int.class, int.class
|
||||
* } ); registerGuiOverlayHandler.invoke( API, GuiCraftingTerminal.class,
|
||||
* DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" );
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit() throws Throwable
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.modules.helpers.NEIQuartzShapedRecipeHandler;
|
||||
|
||||
public class NEI implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static NEI instance;
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
Class API = Class.forName( "codechicken.nei.api.API" );
|
||||
Method registerRecipeHandler = API.getDeclaredMethod( "registerRecipeHandler", new Class[] { codechicken.nei.recipe.ICraftingHandler.class } );
|
||||
Method registerUsageHandler = API.getDeclaredMethod( "registerUsageHandler", new Class[] { codechicken.nei.recipe.IUsageHandler.class } );
|
||||
|
||||
registerRecipeHandler.invoke( API, new NEIQuartzShapedRecipeHandler() );
|
||||
registerUsageHandler.invoke( API, new NEIQuartzShapedRecipeHandler() );
|
||||
|
||||
/*
|
||||
* Method registerGuiOverlay = API.getDeclaredMethod( "registerGuiOverlay", new Class[] { Class.class,
|
||||
* String.class, int.class, int.class } ); Class IOverlayHandler = Class.forName(
|
||||
* "codechicken.nei.api.IOverlayHandler" ); Class DefaultOverlayHandler =
|
||||
* NEICraftingTerminalOverlayHandler.class; Method registerGuiOverlayHandler = API.getDeclaredMethod(
|
||||
* "registerGuiOverlayHandler", new Class[] { Class.class, IOverlayHandler, String.class } );
|
||||
* registerGuiOverlay.invoke( API, GuiCraftingTerminal.class, "crafting", 6, 75 ); Constructor
|
||||
* DefaultOverlayHandlerConstructor = DefaultOverlayHandler .getConstructor( new Class[] { int.class, int.class
|
||||
* } ); registerGuiOverlayHandler.invoke( API, GuiCraftingTerminal.class,
|
||||
* DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" );
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit() throws Throwable
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,51 +1,51 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import mods.railcraft.api.crafting.IRockCrusherRecipe;
|
||||
import mods.railcraft.api.crafting.RailcraftCraftingManager;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class RC implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static RC instance;
|
||||
|
||||
public void rockCrusher(ItemStack input, ItemStack output)
|
||||
{
|
||||
IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
|
||||
re.addOutput( output, 1.0f );
|
||||
}
|
||||
|
||||
public void rockCrusher(ItemStack input, ItemStack output, ItemStack secondary, float chance)
|
||||
{
|
||||
IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
|
||||
re.addOutput( output, 1.0f );
|
||||
if ( secondary != null ) re.addOutput( secondary, chance );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// certus quartz
|
||||
rockCrusher( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
rockCrusher( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
rockCrusher( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
rockCrusher( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import mods.railcraft.api.crafting.IRockCrusherRecipe;
|
||||
import mods.railcraft.api.crafting.RailcraftCraftingManager;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class RC implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static RC instance;
|
||||
|
||||
public void rockCrusher(ItemStack input, ItemStack output)
|
||||
{
|
||||
IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
|
||||
re.addOutput( output, 1.0f );
|
||||
}
|
||||
|
||||
public void rockCrusher(ItemStack input, ItemStack output, ItemStack secondary, float chance)
|
||||
{
|
||||
IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
|
||||
re.addOutput( output, 1.0f );
|
||||
if ( secondary != null ) re.addOutput( secondary, chance );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// certus quartz
|
||||
rockCrusher( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
rockCrusher( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
rockCrusher( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
rockCrusher( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
}
|
||||
@@ -1,79 +1,79 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.ITE;
|
||||
import cofh.api.transport.IItemConduit;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class TE implements IIntegrationModule, ITE
|
||||
{
|
||||
|
||||
public static TE instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// certus quartz
|
||||
pulverizer( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
pulverizer( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
pulverizer( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
pulverizer( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
|
||||
private void pulverizer(ItemStack in, ItemStack out)
|
||||
{
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
toSend.setInteger( "energy", 3200 );
|
||||
toSend.setTag( "input", new NBTTagCompound() );
|
||||
toSend.setTag( "primaryOutput", new NBTTagCompound() );
|
||||
|
||||
in.writeToNBT( toSend.getCompoundTag( "input" ) );
|
||||
out.writeToNBT( toSend.getCompoundTag( "primaryOutput" ) );
|
||||
FMLInterModComms.sendMessage( "ThermalExpansion", "PulverizerRecipe", toSend );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack addItemsToPipe(TileEntity ad, ItemStack itemstack, ForgeDirection dir)
|
||||
{
|
||||
return ((IItemConduit) ad).insertItem( dir, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPulverizerRecipe(int i, ItemStack blkQuartz, ItemStack blockDust)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPulverizerRecipe(int i, ItemStack blkQuartzOre, ItemStack matQuartz, ItemStack matQuartzDust)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPipe(TileEntity te, ForgeDirection opposite)
|
||||
{
|
||||
return te instanceof IItemConduit;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.ITE;
|
||||
import cofh.api.transport.IItemConduit;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class TE implements IIntegrationModule, ITE
|
||||
{
|
||||
|
||||
public static TE instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// certus quartz
|
||||
pulverizer( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
pulverizer( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
pulverizer( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
pulverizer( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
|
||||
private void pulverizer(ItemStack in, ItemStack out)
|
||||
{
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
toSend.setInteger( "energy", 3200 );
|
||||
toSend.setTag( "input", new NBTTagCompound() );
|
||||
toSend.setTag( "primaryOutput", new NBTTagCompound() );
|
||||
|
||||
in.writeToNBT( toSend.getCompoundTag( "input" ) );
|
||||
out.writeToNBT( toSend.getCompoundTag( "primaryOutput" ) );
|
||||
FMLInterModComms.sendMessage( "ThermalExpansion", "PulverizerRecipe", toSend );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack addItemsToPipe(TileEntity ad, ItemStack itemstack, ForgeDirection dir)
|
||||
{
|
||||
return ((IItemConduit) ad).insertItem( dir, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPulverizerRecipe(int i, ItemStack blkQuartz, ItemStack blockDust)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPulverizerRecipe(int i, ItemStack blkQuartzOre, ItemStack matQuartz, ItemStack matQuartzDust)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPipe(TileEntity te, ForgeDirection opposite)
|
||||
{
|
||||
return te instanceof IItemConduit;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class UE implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static UE instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class UE implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static UE instance;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.integration.modules.MFR;
|
||||
import appeng.integration.modules.DSU;
|
||||
|
||||
public class MFRDSUHandler implements IExternalStorageHandler
|
||||
{
|
||||
@@ -13,14 +13,14 @@ public class MFRDSUHandler implements IExternalStorageHandler
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && MFR.instance.isDSU( te );
|
||||
return chan == StorageChannel.ITEMS && DSU.instance.isDSU( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return MFR.instance.getDSU( te );
|
||||
return DSU.instance.getDSU( te );
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+59
-59
@@ -1,60 +1,60 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerHandler;
|
||||
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
import buildcraft.api.power.PowerHandler.Type;
|
||||
|
||||
public class BCPerdition extends BaseBCperdition
|
||||
{
|
||||
|
||||
final protected PowerHandler bcPowerHandler;
|
||||
|
||||
public BCPerdition(IPowerReceptor te) {
|
||||
bcPowerHandler = new PowerHandler( te, Type.MACHINE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Tick()
|
||||
{
|
||||
bcPowerHandler.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound data)
|
||||
{
|
||||
bcPowerHandler.writeToNBT( data, "bcPowerHandler" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound data)
|
||||
{
|
||||
bcPowerHandler.readFromNBT( data, "bcPowerHandler" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public PowerReceiver getPowerReceiver()
|
||||
{
|
||||
return bcPowerHandler.getPowerReceiver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double useEnergy(float min, float max, boolean doUse)
|
||||
{
|
||||
return bcPowerHandler.useEnergy( min, max, doUse );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEnergy(float failed)
|
||||
{
|
||||
bcPowerHandler.addEnergy( failed );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(int i, int j, float f, int k)
|
||||
{
|
||||
bcPowerHandler.configure( i, j, f, k );
|
||||
}
|
||||
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerHandler;
|
||||
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
import buildcraft.api.power.PowerHandler.Type;
|
||||
|
||||
public class BCPerdition extends BaseBCperdition
|
||||
{
|
||||
|
||||
final protected PowerHandler bcPowerHandler;
|
||||
|
||||
public BCPerdition(IPowerReceptor te) {
|
||||
bcPowerHandler = new PowerHandler( te, Type.MACHINE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Tick()
|
||||
{
|
||||
bcPowerHandler.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound data)
|
||||
{
|
||||
bcPowerHandler.writeToNBT( data, "bcPowerHandler" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound data)
|
||||
{
|
||||
bcPowerHandler.readFromNBT( data, "bcPowerHandler" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public PowerReceiver getPowerReceiver()
|
||||
{
|
||||
return bcPowerHandler.getPowerReceiver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double useEnergy(float min, float max, boolean doUse)
|
||||
{
|
||||
return bcPowerHandler.useEnergy( min, max, doUse );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEnergy(float failed)
|
||||
{
|
||||
bcPowerHandler.addEnergy( failed );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(int i, int j, float f, int k)
|
||||
{
|
||||
bcPowerHandler.configure( i, j, f, k );
|
||||
}
|
||||
|
||||
}
|
||||
+27
-27
@@ -1,27 +1,27 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.integration.modules.BC;
|
||||
|
||||
public class BCPipeHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && BC.instance.isPipe( te, d );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return new BCPipeInventory( te, d );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.integration.modules.BC;
|
||||
|
||||
public class BCPipeHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && BC.instance.isPipe( te, d );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return new BCPipeInventory( te, d );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+57
-57
@@ -1,57 +1,57 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.integration.modules.BC;
|
||||
|
||||
public class BCPipeInventory implements IMEInventory<IAEItemStack>
|
||||
{
|
||||
|
||||
TileEntity te;
|
||||
ForgeDirection dir;
|
||||
|
||||
public BCPipeInventory(TileEntity _te, ForgeDirection _dir) {
|
||||
te = _te;
|
||||
dir = _dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel()
|
||||
{
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
{
|
||||
if ( BC.instance.canAddItemsToPipe( te, input.getItemStack(), dir ) )
|
||||
return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
if ( BC.instance.addItemsToPipe( te, input.getItemStack(), dir ) )
|
||||
return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
|
||||
{
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.integration.modules.BC;
|
||||
|
||||
public class BCPipeInventory implements IMEInventory<IAEItemStack>
|
||||
{
|
||||
|
||||
TileEntity te;
|
||||
ForgeDirection dir;
|
||||
|
||||
public BCPipeInventory(TileEntity _te, ForgeDirection _dir) {
|
||||
te = _te;
|
||||
dir = _dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel()
|
||||
{
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
{
|
||||
if ( BC.instance.canAddItemsToPipe( te, input.getItemStack(), dir ) )
|
||||
return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
if ( BC.instance.addItemsToPipe( te, input.getItemStack(), dir ) )
|
||||
return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
|
||||
{
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
+67
-67
@@ -1,67 +1,67 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.mcft.copy.betterstorage.api.ICrateStorage;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class BSCrate implements IMEInventory<IAEItemStack>
|
||||
{
|
||||
|
||||
ICrateStorage cs;
|
||||
ForgeDirection side;
|
||||
|
||||
public BSCrate(Object object, ForgeDirection d) {
|
||||
cs = (ICrateStorage) object;
|
||||
side = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel()
|
||||
{
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
return null;
|
||||
|
||||
ItemStack failed = cs.insertItems( side, input.getItemStack() );
|
||||
if ( failed == null )
|
||||
return null;
|
||||
input.setStackSize( failed.stackSize );
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
{
|
||||
int howMany = cs.getItemCount( side, request.getItemStack() );
|
||||
return howMany > request.getStackSize() ? request : request.copy().setStackSize( howMany );
|
||||
}
|
||||
|
||||
ItemStack Obtained = cs.extractItems( side, request.getItemStack() );
|
||||
return AEItemStack.create( Obtained );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList getAvailableItems(IItemList out)
|
||||
{
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
out.add( AEItemStack.create( is ) );
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.mcft.copy.betterstorage.api.ICrateStorage;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class BSCrate implements IMEInventory<IAEItemStack>
|
||||
{
|
||||
|
||||
ICrateStorage cs;
|
||||
ForgeDirection side;
|
||||
|
||||
public BSCrate(Object object, ForgeDirection d) {
|
||||
cs = (ICrateStorage) object;
|
||||
side = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel()
|
||||
{
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
return null;
|
||||
|
||||
ItemStack failed = cs.insertItems( side, input.getItemStack() );
|
||||
if ( failed == null )
|
||||
return null;
|
||||
input.setStackSize( failed.stackSize );
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
{
|
||||
int howMany = cs.getItemCount( side, request.getItemStack() );
|
||||
return howMany > request.getStackSize() ? request : request.copy().setStackSize( howMany );
|
||||
}
|
||||
|
||||
ItemStack Obtained = cs.extractItems( side, request.getItemStack() );
|
||||
return AEItemStack.create( Obtained );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList getAvailableItems(IItemList out)
|
||||
{
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
out.add( AEItemStack.create( is ) );
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
+27
-27
@@ -1,27 +1,27 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.mcft.copy.betterstorage.api.ICrateStorage;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
|
||||
public class BSCrateHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && te instanceof ICrateStorage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return new BSCrate( te, ForgeDirection.UNKNOWN );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.mcft.copy.betterstorage.api.ICrateStorage;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
|
||||
public class BSCrateHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && te instanceof ICrateStorage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return new BSCrate( te, ForgeDirection.UNKNOWN );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+185
-185
@@ -1,185 +1,185 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.mcft.copy.betterstorage.api.ICrateStorage;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.IInventoryDestination;
|
||||
import appeng.util.inv.ItemSlot;
|
||||
import appeng.util.iterators.StackToSlotIterator;
|
||||
|
||||
public class BSCrateStorageAdaptor extends InventoryAdaptor
|
||||
{
|
||||
|
||||
ICrateStorage cs;
|
||||
ForgeDirection side;
|
||||
|
||||
public BSCrateStorageAdaptor(Object te, ForgeDirection d) {
|
||||
cs = (ICrateStorage) te;
|
||||
side = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack removeItems(int how_many, ItemStack Filter, IInventoryDestination dest)
|
||||
{
|
||||
ItemStack target = null;
|
||||
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
if ( is != null )
|
||||
{
|
||||
if ( is.stackSize > 0 && (Filter == null || Platform.isSameItem( Filter, is )) )
|
||||
{
|
||||
if ( dest == null || dest.canInsert( is ) )
|
||||
{
|
||||
target = is;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
ItemStack f = Platform.cloneItemStack( target );
|
||||
f.stackSize = how_many;
|
||||
return cs.extractItems( side, f );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack simulateRemove(int how_many, ItemStack Filter, IInventoryDestination dest)
|
||||
{
|
||||
ItemStack target = null;
|
||||
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
if ( is != null )
|
||||
{
|
||||
if ( is.stackSize > 0 && (Filter == null || Platform.isSameItem( Filter, is )) )
|
||||
{
|
||||
if ( dest == null || dest.canInsert( is ) )
|
||||
{
|
||||
target = is;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
int cnt = cs.getItemCount( side, target );
|
||||
if ( cnt == 0 )
|
||||
return null;
|
||||
if ( cnt > how_many )
|
||||
cnt = how_many;
|
||||
ItemStack c = target.copy();
|
||||
c.stackSize = cnt;
|
||||
return c;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack removeSimilarItems(int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination dest)
|
||||
{
|
||||
ItemStack target = null;
|
||||
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
if ( is != null )
|
||||
{
|
||||
if ( is.stackSize > 0 && (filter == null || Platform.isSameItemFuzzy( filter, is, fuzzyMode )) )
|
||||
{
|
||||
if ( dest == null || dest.canInsert( is ) )
|
||||
{
|
||||
target = is;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
ItemStack f = Platform.cloneItemStack( target );
|
||||
f.stackSize = amount;
|
||||
return cs.extractItems( side, f );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination dest)
|
||||
{
|
||||
ItemStack target = null;
|
||||
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
if ( is != null )
|
||||
{
|
||||
if ( is.stackSize > 0 && (filter == null || Platform.isSameItemFuzzy( filter, is, fuzzyMode )) )
|
||||
{
|
||||
if ( dest == null || dest.canInsert( is ) )
|
||||
{
|
||||
target = is;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
int cnt = cs.getItemCount( side, target );
|
||||
if ( cnt == 0 )
|
||||
return null;
|
||||
if ( cnt > how_many )
|
||||
cnt = how_many;
|
||||
ItemStack c = target.copy();
|
||||
c.stackSize = cnt;
|
||||
return c;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack addItems(ItemStack A)
|
||||
{
|
||||
return cs.insertItems( side, A );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack simulateAdd(ItemStack A)
|
||||
{
|
||||
int items = cs.spaceForItem( side, A );
|
||||
ItemStack B = Platform.cloneItemStack( A );
|
||||
if ( A.stackSize <= items )
|
||||
return null;
|
||||
B.stackSize -= items;
|
||||
return B;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsItems()
|
||||
{
|
||||
return cs.getContents( side ).size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<ItemSlot> iterator()
|
||||
{
|
||||
return new StackToSlotIterator( cs.getContents( side ).iterator() );
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.mcft.copy.betterstorage.api.ICrateStorage;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.IInventoryDestination;
|
||||
import appeng.util.inv.ItemSlot;
|
||||
import appeng.util.iterators.StackToSlotIterator;
|
||||
|
||||
public class BSCrateStorageAdaptor extends InventoryAdaptor
|
||||
{
|
||||
|
||||
ICrateStorage cs;
|
||||
ForgeDirection side;
|
||||
|
||||
public BSCrateStorageAdaptor(Object te, ForgeDirection d) {
|
||||
cs = (ICrateStorage) te;
|
||||
side = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack removeItems(int how_many, ItemStack Filter, IInventoryDestination dest)
|
||||
{
|
||||
ItemStack target = null;
|
||||
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
if ( is != null )
|
||||
{
|
||||
if ( is.stackSize > 0 && (Filter == null || Platform.isSameItem( Filter, is )) )
|
||||
{
|
||||
if ( dest == null || dest.canInsert( is ) )
|
||||
{
|
||||
target = is;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
ItemStack f = Platform.cloneItemStack( target );
|
||||
f.stackSize = how_many;
|
||||
return cs.extractItems( side, f );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack simulateRemove(int how_many, ItemStack Filter, IInventoryDestination dest)
|
||||
{
|
||||
ItemStack target = null;
|
||||
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
if ( is != null )
|
||||
{
|
||||
if ( is.stackSize > 0 && (Filter == null || Platform.isSameItem( Filter, is )) )
|
||||
{
|
||||
if ( dest == null || dest.canInsert( is ) )
|
||||
{
|
||||
target = is;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
int cnt = cs.getItemCount( side, target );
|
||||
if ( cnt == 0 )
|
||||
return null;
|
||||
if ( cnt > how_many )
|
||||
cnt = how_many;
|
||||
ItemStack c = target.copy();
|
||||
c.stackSize = cnt;
|
||||
return c;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack removeSimilarItems(int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination dest)
|
||||
{
|
||||
ItemStack target = null;
|
||||
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
if ( is != null )
|
||||
{
|
||||
if ( is.stackSize > 0 && (filter == null || Platform.isSameItemFuzzy( filter, is, fuzzyMode )) )
|
||||
{
|
||||
if ( dest == null || dest.canInsert( is ) )
|
||||
{
|
||||
target = is;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
ItemStack f = Platform.cloneItemStack( target );
|
||||
f.stackSize = amount;
|
||||
return cs.extractItems( side, f );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination dest)
|
||||
{
|
||||
ItemStack target = null;
|
||||
|
||||
for (ItemStack is : cs.getContents( side ))
|
||||
{
|
||||
if ( is != null )
|
||||
{
|
||||
if ( is.stackSize > 0 && (filter == null || Platform.isSameItemFuzzy( filter, is, fuzzyMode )) )
|
||||
{
|
||||
if ( dest == null || dest.canInsert( is ) )
|
||||
{
|
||||
target = is;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
int cnt = cs.getItemCount( side, target );
|
||||
if ( cnt == 0 )
|
||||
return null;
|
||||
if ( cnt > how_many )
|
||||
cnt = how_many;
|
||||
ItemStack c = target.copy();
|
||||
c.stackSize = cnt;
|
||||
return c;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack addItems(ItemStack A)
|
||||
{
|
||||
return cs.insertItems( side, A );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack simulateAdd(ItemStack A)
|
||||
{
|
||||
int items = cs.spaceForItem( side, A );
|
||||
ItemStack B = Platform.cloneItemStack( A );
|
||||
if ( A.stackSize <= items )
|
||||
return null;
|
||||
B.stackSize -= items;
|
||||
return B;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsItems()
|
||||
{
|
||||
return cs.getContents( side ).size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<ItemSlot> iterator()
|
||||
{
|
||||
return new StackToSlotIterator( cs.getContents( side ).iterator() );
|
||||
}
|
||||
|
||||
}
|
||||
+15
-15
@@ -1,15 +1,15 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
public class FMPPacketEvent extends Event
|
||||
{
|
||||
|
||||
public final EntityPlayerMP sender;
|
||||
|
||||
public FMPPacketEvent(EntityPlayerMP sender) {
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
public class FMPPacketEvent extends Event
|
||||
{
|
||||
|
||||
public final EntityPlayerMP sender;
|
||||
|
||||
public FMPPacketEvent(EntityPlayerMP sender) {
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
}
|
||||
+132
-132
@@ -1,133 +1,133 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.integration.abstraction.IFZ;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class FactorizationBarrel implements IMEInventory<IAEItemStack>
|
||||
{
|
||||
|
||||
private final TileEntity te;
|
||||
IFZ fProxy;
|
||||
|
||||
public FactorizationBarrel(IFZ proxy, TileEntity tile) {
|
||||
te = tile;
|
||||
fProxy = proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel()
|
||||
{
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
public long remainingItemTypes()
|
||||
{
|
||||
return fProxy.barrelGetItem( te ) == null ? 1 : 0;
|
||||
}
|
||||
|
||||
public long remainingItemCount()
|
||||
{
|
||||
return fProxy.barrelGetMaxItemCount( te ) - fProxy.barrelGetItemCount( te );
|
||||
}
|
||||
|
||||
public boolean containsItemType(IAEItemStack i)
|
||||
{
|
||||
return i.equals( fProxy.barrelGetItem( te ) );
|
||||
}
|
||||
|
||||
public long storedItemCount()
|
||||
{
|
||||
return fProxy.barrelGetItemCount( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( input == null )
|
||||
return null;
|
||||
if ( input.getStackSize() == 0 )
|
||||
return null;
|
||||
|
||||
ItemStack shared = input.getItemStack();
|
||||
if ( shared.isItemDamaged() )
|
||||
return input;
|
||||
|
||||
if ( remainingItemTypes() > 0 )
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
fProxy.setItemType( te, input.getItemStack() );
|
||||
}
|
||||
|
||||
if ( containsItemType( input ) )
|
||||
{
|
||||
int max = fProxy.barrelGetMaxItemCount( te );
|
||||
int newTotal = (int) storedItemCount() + (int) input.getStackSize();
|
||||
if ( newTotal > max )
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
fProxy.barrelSetCount( te, max );
|
||||
IAEItemStack result = input.copy();
|
||||
result.setStackSize( newTotal - max );
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
fProxy.barrelSetCount( te, newTotal );
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( containsItemType( request ) )
|
||||
{
|
||||
int howMany = (int) storedItemCount();
|
||||
if ( request.getStackSize() >= howMany )
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
{
|
||||
fProxy.setItemType( te, null );
|
||||
fProxy.barrelSetCount( te, 0 );
|
||||
}
|
||||
|
||||
IAEItemStack r = request.copy();
|
||||
r.setStackSize( howMany );
|
||||
return r;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
fProxy.barrelSetCount( te, (int) (howMany - request.getStackSize()) );
|
||||
return request.copy();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
|
||||
{
|
||||
ItemStack i = fProxy.barrelGetItem( te );
|
||||
if ( i != null )
|
||||
{
|
||||
i.stackSize = fProxy.barrelGetItemCount( te );
|
||||
out.addStorage( AEItemStack.create( i ) );
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.integration.abstraction.IFZ;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class FactorizationBarrel implements IMEInventory<IAEItemStack>
|
||||
{
|
||||
|
||||
private final TileEntity te;
|
||||
IFZ fProxy;
|
||||
|
||||
public FactorizationBarrel(IFZ proxy, TileEntity tile) {
|
||||
te = tile;
|
||||
fProxy = proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel()
|
||||
{
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
public long remainingItemTypes()
|
||||
{
|
||||
return fProxy.barrelGetItem( te ) == null ? 1 : 0;
|
||||
}
|
||||
|
||||
public long remainingItemCount()
|
||||
{
|
||||
return fProxy.barrelGetMaxItemCount( te ) - fProxy.barrelGetItemCount( te );
|
||||
}
|
||||
|
||||
public boolean containsItemType(IAEItemStack i)
|
||||
{
|
||||
return i.equals( fProxy.barrelGetItem( te ) );
|
||||
}
|
||||
|
||||
public long storedItemCount()
|
||||
{
|
||||
return fProxy.barrelGetItemCount( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( input == null )
|
||||
return null;
|
||||
if ( input.getStackSize() == 0 )
|
||||
return null;
|
||||
|
||||
ItemStack shared = input.getItemStack();
|
||||
if ( shared.isItemDamaged() )
|
||||
return input;
|
||||
|
||||
if ( remainingItemTypes() > 0 )
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
fProxy.setItemType( te, input.getItemStack() );
|
||||
}
|
||||
|
||||
if ( containsItemType( input ) )
|
||||
{
|
||||
int max = fProxy.barrelGetMaxItemCount( te );
|
||||
int newTotal = (int) storedItemCount() + (int) input.getStackSize();
|
||||
if ( newTotal > max )
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
fProxy.barrelSetCount( te, max );
|
||||
IAEItemStack result = input.copy();
|
||||
result.setStackSize( newTotal - max );
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
fProxy.barrelSetCount( te, newTotal );
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( containsItemType( request ) )
|
||||
{
|
||||
int howMany = (int) storedItemCount();
|
||||
if ( request.getStackSize() >= howMany )
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
{
|
||||
fProxy.setItemType( te, null );
|
||||
fProxy.barrelSetCount( te, 0 );
|
||||
}
|
||||
|
||||
IAEItemStack r = request.copy();
|
||||
r.setStackSize( howMany );
|
||||
return r;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( mode == Actionable.MODULATE )
|
||||
fProxy.barrelSetCount( te, (int) (howMany - request.getStackSize()) );
|
||||
return request.copy();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
|
||||
{
|
||||
ItemStack i = fProxy.barrelGetItem( te );
|
||||
if ( i != null )
|
||||
{
|
||||
i.stackSize = fProxy.barrelGetItemCount( te );
|
||||
out.addStorage( AEItemStack.create( i ) );
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
+27
-27
@@ -1,27 +1,27 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.integration.modules.FZ;
|
||||
|
||||
public class FactorizationHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && FZ.instance.isBarrel( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return FZ.instance.getFactorizationBarrel( te );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.integration.modules.FZ;
|
||||
|
||||
public class FactorizationHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && FZ.instance.isBarrel( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return FZ.instance.getFactorizationBarrel( te );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+47
-47
@@ -1,47 +1,47 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import appeng.api.features.IItemComparison;
|
||||
import appeng.api.integration.IBeeComparison;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
public class ForestryGeneticsComparison implements IItemComparison, IBeeComparison
|
||||
{
|
||||
|
||||
IIndividual idiv;
|
||||
String Species;
|
||||
|
||||
@Override
|
||||
public IIndividual getIndividual()
|
||||
{
|
||||
return idiv;
|
||||
}
|
||||
|
||||
public ForestryGeneticsComparison(IIndividual _idiv) {
|
||||
idiv = _idiv;
|
||||
Species = _idiv.getGenome().getActiveAllele( EnumTreeChromosome.SPECIES.ordinal() ).getUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameAsPrecise(IItemComparison comp)
|
||||
{
|
||||
if ( comp instanceof ForestryGeneticsComparison )
|
||||
{
|
||||
IIndividual op = ((ForestryGeneticsComparison) comp).idiv;
|
||||
if ( idiv.isAnalyzed() == op.isAnalyzed() )
|
||||
return idiv.isGeneticEqual( op );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameAsFuzzy(IItemComparison comp)
|
||||
{
|
||||
if ( comp instanceof ForestryGeneticsComparison )
|
||||
return Species.equals( ((ForestryGeneticsComparison) comp).Species );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import appeng.api.features.IItemComparison;
|
||||
import appeng.api.integration.IBeeComparison;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
public class ForestryGeneticsComparison implements IItemComparison, IBeeComparison
|
||||
{
|
||||
|
||||
IIndividual idiv;
|
||||
String Species;
|
||||
|
||||
@Override
|
||||
public IIndividual getIndividual()
|
||||
{
|
||||
return idiv;
|
||||
}
|
||||
|
||||
public ForestryGeneticsComparison(IIndividual _idiv) {
|
||||
idiv = _idiv;
|
||||
Species = _idiv.getGenome().getActiveAllele( EnumTreeChromosome.SPECIES.ordinal() ).getUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameAsPrecise(IItemComparison comp)
|
||||
{
|
||||
if ( comp instanceof ForestryGeneticsComparison )
|
||||
{
|
||||
IIndividual op = ((ForestryGeneticsComparison) comp).idiv;
|
||||
if ( idiv.isAnalyzed() == op.isAnalyzed() )
|
||||
return idiv.isGeneticEqual( op );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameAsFuzzy(IItemComparison comp)
|
||||
{
|
||||
if ( comp instanceof ForestryGeneticsComparison )
|
||||
return Species.equals( ((ForestryGeneticsComparison) comp).Species );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+32
-32
@@ -1,32 +1,32 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.features.IItemComparisionProvider;
|
||||
import appeng.api.features.IItemComparison;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
public class ForestryGeneticsProvider implements IItemComparisionProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public IItemComparison getComparison(ItemStack is)
|
||||
{
|
||||
if ( forestry.api.genetics.AlleleManager.alleleRegistry != null )
|
||||
{
|
||||
IIndividual idiv = forestry.api.genetics.AlleleManager.alleleRegistry.getIndividual( is );
|
||||
if ( idiv == null )
|
||||
return null;
|
||||
return new ForestryGeneticsComparison( idiv );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(ItemStack stack)
|
||||
{
|
||||
if ( forestry.api.genetics.AlleleManager.alleleRegistry != null )
|
||||
return forestry.api.genetics.AlleleManager.alleleRegistry.isIndividual( stack );
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.features.IItemComparisionProvider;
|
||||
import appeng.api.features.IItemComparison;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
public class ForestryGeneticsProvider implements IItemComparisionProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public IItemComparison getComparison(ItemStack is)
|
||||
{
|
||||
if ( forestry.api.genetics.AlleleManager.alleleRegistry != null )
|
||||
{
|
||||
IIndividual idiv = forestry.api.genetics.AlleleManager.alleleRegistry.getIndividual( is );
|
||||
if ( idiv == null )
|
||||
return null;
|
||||
return new ForestryGeneticsComparison( idiv );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(ItemStack stack)
|
||||
{
|
||||
if ( forestry.api.genetics.AlleleManager.alleleRegistry != null )
|
||||
return forestry.api.genetics.AlleleManager.alleleRegistry.isIndividual( stack );
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+27
-27
@@ -1,27 +1,27 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.integration.modules.GT;
|
||||
|
||||
public class GregTechHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && GT.instance.isQuantumChest( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return GT.instance.getQuantumChest( te );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.integration.modules.GT;
|
||||
|
||||
public class GregTechHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && GT.instance.isQuantumChest( te );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return GT.instance.getQuantumChest( te );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+103
-103
@@ -1,104 +1,104 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import gregtechmod.api.interfaces.IDigitalChest;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.me.storage.MEIInventoryWrapper;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class GregTechQuantumChest extends MEIInventoryWrapper
|
||||
{
|
||||
|
||||
IDigitalChest qc;
|
||||
|
||||
public GregTechQuantumChest(IInventory m, InventoryAdaptor ia) {
|
||||
super( m, ia );
|
||||
qc = (IDigitalChest) m;
|
||||
}
|
||||
|
||||
private ItemStack getType()
|
||||
{
|
||||
ItemStack[] array = qc.getStoredItemData();
|
||||
if ( array.length > 0 && array[0].itemID > 0 )
|
||||
return array[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
ItemStack type = getType();
|
||||
if ( input.hasTagCompound() )
|
||||
return input;
|
||||
|
||||
if ( type == null )
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
if ( (type.getItem() == input.getItem() && type.getItemDamage() == input.getItemDamage()) )
|
||||
{
|
||||
if ( type.stackSize < qc.getMaxItemCount() )
|
||||
{
|
||||
int room = (int) ((long) qc.getMaxItemCount() - (long) type.stackSize);
|
||||
if ( input.getStackSize() > room )
|
||||
{
|
||||
IAEItemStack is = input.copy();
|
||||
is.setStackSize( is.getStackSize() - room );
|
||||
if ( mode == Actionable.MODULATE )
|
||||
qc.setItemCount( type.stackSize + room );
|
||||
|
||||
return super.injectItems( is, mode, src );
|
||||
}
|
||||
|
||||
if ( mode == Actionable.MODULATE )
|
||||
qc.setItemCount( type.stackSize + (int) input.getStackSize() );
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return super.injectItems( input, mode, src );
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack i, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
ItemStack type = getType();
|
||||
if ( type != null )
|
||||
{
|
||||
if ( type.getItem() == i.getItem() && type.getItemDamage() == i.getItemDamage() )
|
||||
{
|
||||
if ( type.stackSize > i.getStackSize() )
|
||||
{
|
||||
IAEItemStack output = AEItemStack.create( type );
|
||||
output.setStackSize( (int) i.getStackSize() );
|
||||
if ( mode == Actionable.MODULATE )
|
||||
qc.setItemCount( type.stackSize - (int) output.getStackSize() );
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.extractItems( i, mode, src );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList getAvailableItems(IItemList out)
|
||||
{
|
||||
ItemStack type = getType();
|
||||
if ( type != null )
|
||||
{
|
||||
super.getAvailableItems( out );
|
||||
if ( type != null && type.stackSize > 0 )
|
||||
out.addStorage( AEItemStack.create( type ) );
|
||||
}
|
||||
return out;
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import gregtechmod.api.interfaces.IDigitalChest;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.me.storage.MEIInventoryWrapper;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class GregTechQuantumChest extends MEIInventoryWrapper
|
||||
{
|
||||
|
||||
IDigitalChest qc;
|
||||
|
||||
public GregTechQuantumChest(IInventory m, InventoryAdaptor ia) {
|
||||
super( m, ia );
|
||||
qc = (IDigitalChest) m;
|
||||
}
|
||||
|
||||
private ItemStack getType()
|
||||
{
|
||||
ItemStack[] array = qc.getStoredItemData();
|
||||
if ( array.length > 0 && array[0].itemID > 0 )
|
||||
return array[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
ItemStack type = getType();
|
||||
if ( input.hasTagCompound() )
|
||||
return input;
|
||||
|
||||
if ( type == null )
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
if ( (type.getItem() == input.getItem() && type.getItemDamage() == input.getItemDamage()) )
|
||||
{
|
||||
if ( type.stackSize < qc.getMaxItemCount() )
|
||||
{
|
||||
int room = (int) ((long) qc.getMaxItemCount() - (long) type.stackSize);
|
||||
if ( input.getStackSize() > room )
|
||||
{
|
||||
IAEItemStack is = input.copy();
|
||||
is.setStackSize( is.getStackSize() - room );
|
||||
if ( mode == Actionable.MODULATE )
|
||||
qc.setItemCount( type.stackSize + room );
|
||||
|
||||
return super.injectItems( is, mode, src );
|
||||
}
|
||||
|
||||
if ( mode == Actionable.MODULATE )
|
||||
qc.setItemCount( type.stackSize + (int) input.getStackSize() );
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return super.injectItems( input, mode, src );
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack i, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
ItemStack type = getType();
|
||||
if ( type != null )
|
||||
{
|
||||
if ( type.getItem() == i.getItem() && type.getItemDamage() == i.getItemDamage() )
|
||||
{
|
||||
if ( type.stackSize > i.getStackSize() )
|
||||
{
|
||||
IAEItemStack output = AEItemStack.create( type );
|
||||
output.setStackSize( (int) i.getStackSize() );
|
||||
if ( mode == Actionable.MODULATE )
|
||||
qc.setItemCount( type.stackSize - (int) output.getStackSize() );
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.extractItems( i, mode, src );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList getAvailableItems(IItemList out)
|
||||
{
|
||||
ItemStack type = getType();
|
||||
if ( type != null )
|
||||
{
|
||||
super.getAvailableItems( out );
|
||||
if ( type != null && type.stackSize > 0 )
|
||||
out.addStorage( AEItemStack.create( type ) );
|
||||
}
|
||||
return out;
|
||||
}
|
||||
}
|
||||
+208
-208
@@ -1,209 +1,209 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiCrafting;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import appeng.recipes.AEShapedQuartzRecipe;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.api.DefaultOverlayRenderer;
|
||||
import codechicken.nei.api.IOverlayHandler;
|
||||
import codechicken.nei.api.IRecipeOverlayRenderer;
|
||||
import codechicken.nei.api.IStackPositioner;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
public class NEIQuartzShapedRecipeHandler extends TemplateRecipeHandler
|
||||
{
|
||||
|
||||
public void loadTransferRects()
|
||||
{
|
||||
this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting", new Object[0] ) );
|
||||
}
|
||||
|
||||
public Class<? extends GuiContainer> getGuiClass()
|
||||
{
|
||||
return GuiCrafting.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName()
|
||||
{
|
||||
return NEIClientUtils.translate( "recipe.shaped", new Object[0] );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object[] results)
|
||||
{
|
||||
if ( (outputId.equals( "crafting" )) && (getClass() == NEIQuartzShapedRecipeHandler.class) )
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
|
||||
if ( recipe != null )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
super.loadCraftingRecipes( outputId, results );
|
||||
}
|
||||
}
|
||||
|
||||
public void loadCraftingRecipes(ItemStack result)
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
if ( NEIServerUtils.areStacksSameTypeCrafting( irecipe.getRecipeOutput(), result ) )
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
|
||||
if ( recipe != null )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadUsageRecipes(ItemStack ingredient)
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
|
||||
if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.itemID )) )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
if ( recipe.contains( recipe.ingredients, ingredient ) )
|
||||
{
|
||||
recipe.setIngredientPermutation( recipe.ingredients, ingredient );
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "textures/gui/container/crafting_table.png";
|
||||
}
|
||||
|
||||
public String getOverlayIdentifier()
|
||||
{
|
||||
return "crafting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlay(GuiContainer gui, Container container, int recipe)
|
||||
{
|
||||
return (super.hasOverlay( gui, container, recipe )) || ((isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" )));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipeOverlayRenderer getOverlayRenderer(GuiContainer gui, int recipe)
|
||||
{
|
||||
IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
|
||||
if ( renderer != null )
|
||||
{
|
||||
return renderer;
|
||||
}
|
||||
IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
|
||||
if ( positioner == null )
|
||||
return null;
|
||||
return new DefaultOverlayRenderer( getIngredientStacks( recipe ), positioner );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOverlayHandler getOverlayHandler(GuiContainer gui, int recipe)
|
||||
{
|
||||
IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
|
||||
if ( handler != null )
|
||||
{
|
||||
return handler;
|
||||
}
|
||||
return RecipeInfo.getOverlayHandler( gui, "crafting2x2" );
|
||||
}
|
||||
|
||||
public boolean isRecipe2x2(int recipe)
|
||||
{
|
||||
for (PositionedStack stack : getIngredientStacks( recipe ))
|
||||
{
|
||||
if ( (stack.relx > 43) || (stack.rely > 24) )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public class CachedShapedRecipe extends TemplateRecipeHandler.CachedRecipe
|
||||
{
|
||||
|
||||
public ArrayList<PositionedStack> ingredients;
|
||||
public PositionedStack result;
|
||||
|
||||
public CachedShapedRecipe(AEShapedQuartzRecipe irecipe) {
|
||||
result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 );
|
||||
ingredients = new ArrayList<PositionedStack>();
|
||||
setIngredients( irecipe.getWidth(), irecipe.getHeight(), irecipe.getIngredients() );
|
||||
}
|
||||
|
||||
public void setIngredients(int width, int height, Object[] items)
|
||||
{
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
if ( items[(y * width + x)] != null )
|
||||
{
|
||||
PositionedStack stack = new PositionedStack( items[(y * width + x)], 25 + x * 18, 6 + y * 18, false );
|
||||
stack.setMaxSize( 1 );
|
||||
this.ingredients.add( stack );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients()
|
||||
{
|
||||
return getCycledIngredients( cycleticks / 20, this.ingredients );
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult()
|
||||
{
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void computeVisuals()
|
||||
{
|
||||
for (PositionedStack p : this.ingredients)
|
||||
{
|
||||
p.generatePermutations();
|
||||
}
|
||||
this.result.generatePermutations();
|
||||
}
|
||||
}
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiCrafting;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import appeng.recipes.AEShapedQuartzRecipe;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.api.DefaultOverlayRenderer;
|
||||
import codechicken.nei.api.IOverlayHandler;
|
||||
import codechicken.nei.api.IRecipeOverlayRenderer;
|
||||
import codechicken.nei.api.IStackPositioner;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
public class NEIQuartzShapedRecipeHandler extends TemplateRecipeHandler
|
||||
{
|
||||
|
||||
public void loadTransferRects()
|
||||
{
|
||||
this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting", new Object[0] ) );
|
||||
}
|
||||
|
||||
public Class<? extends GuiContainer> getGuiClass()
|
||||
{
|
||||
return GuiCrafting.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName()
|
||||
{
|
||||
return NEIClientUtils.translate( "recipe.shaped", new Object[0] );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object[] results)
|
||||
{
|
||||
if ( (outputId.equals( "crafting" )) && (getClass() == NEIQuartzShapedRecipeHandler.class) )
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
|
||||
if ( recipe != null )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
super.loadCraftingRecipes( outputId, results );
|
||||
}
|
||||
}
|
||||
|
||||
public void loadCraftingRecipes(ItemStack result)
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
if ( NEIServerUtils.areStacksSameTypeCrafting( irecipe.getRecipeOutput(), result ) )
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
|
||||
if ( recipe != null )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadUsageRecipes(ItemStack ingredient)
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
|
||||
if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.itemID )) )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
if ( recipe.contains( recipe.ingredients, ingredient ) )
|
||||
{
|
||||
recipe.setIngredientPermutation( recipe.ingredients, ingredient );
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "textures/gui/container/crafting_table.png";
|
||||
}
|
||||
|
||||
public String getOverlayIdentifier()
|
||||
{
|
||||
return "crafting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlay(GuiContainer gui, Container container, int recipe)
|
||||
{
|
||||
return (super.hasOverlay( gui, container, recipe )) || ((isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" )));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipeOverlayRenderer getOverlayRenderer(GuiContainer gui, int recipe)
|
||||
{
|
||||
IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
|
||||
if ( renderer != null )
|
||||
{
|
||||
return renderer;
|
||||
}
|
||||
IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
|
||||
if ( positioner == null )
|
||||
return null;
|
||||
return new DefaultOverlayRenderer( getIngredientStacks( recipe ), positioner );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOverlayHandler getOverlayHandler(GuiContainer gui, int recipe)
|
||||
{
|
||||
IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
|
||||
if ( handler != null )
|
||||
{
|
||||
return handler;
|
||||
}
|
||||
return RecipeInfo.getOverlayHandler( gui, "crafting2x2" );
|
||||
}
|
||||
|
||||
public boolean isRecipe2x2(int recipe)
|
||||
{
|
||||
for (PositionedStack stack : getIngredientStacks( recipe ))
|
||||
{
|
||||
if ( (stack.relx > 43) || (stack.rely > 24) )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public class CachedShapedRecipe extends TemplateRecipeHandler.CachedRecipe
|
||||
{
|
||||
|
||||
public ArrayList<PositionedStack> ingredients;
|
||||
public PositionedStack result;
|
||||
|
||||
public CachedShapedRecipe(AEShapedQuartzRecipe irecipe) {
|
||||
result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 );
|
||||
ingredients = new ArrayList<PositionedStack>();
|
||||
setIngredients( irecipe.getWidth(), irecipe.getHeight(), irecipe.getIngredients() );
|
||||
}
|
||||
|
||||
public void setIngredients(int width, int height, Object[] items)
|
||||
{
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
if ( items[(y * width + x)] != null )
|
||||
{
|
||||
PositionedStack stack = new PositionedStack( items[(y * width + x)], 25 + x * 18, 6 + y * 18, false );
|
||||
stack.setMaxSize( 1 );
|
||||
this.ingredients.add( stack );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients()
|
||||
{
|
||||
return getCycledIngredients( cycleticks / 20, this.ingredients );
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult()
|
||||
{
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void computeVisuals()
|
||||
{
|
||||
for (PositionedStack p : this.ingredients)
|
||||
{
|
||||
p.generatePermutations();
|
||||
}
|
||||
this.result.generatePermutations();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user