From 109fef18217ccf2c052723c224db70bd60c390f2 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sat, 15 Feb 2014 00:40:02 -0600 Subject: [PATCH] Restore DSU Api, mark all other api's as dead. --- core/AppEng.java | 3 +- .../abstraction/{IMFR.java => IDSU.java} | 26 +- integration/modules/{MFR.java => DSU.java} | 86 ++-- integration/modules/{ => dead}/BC.java | 446 +++++++++--------- integration/modules/{ => dead}/BS.java | 90 ++-- integration/modules/{ => dead}/FMP.java | 304 ++++++------ integration/modules/{ => dead}/FZ.java | 430 ++++++++--------- integration/modules/{ => dead}/Forestry.java | 48 +- integration/modules/{ => dead}/GT.java | 92 ++-- integration/modules/{ => dead}/IC2.java | 140 +++--- integration/modules/{ => dead}/InvTweaks.java | 48 +- integration/modules/{ => dead}/LP.java | 48 +- integration/modules/{ => dead}/MJ.java | 78 +-- integration/modules/{ => dead}/Mekanism.java | 82 ++-- integration/modules/{ => dead}/Mystcraft.java | 48 +- integration/modules/{ => dead}/NEI.java | 84 ++-- integration/modules/{ => dead}/RC.java | 102 ++-- integration/modules/{ => dead}/TE.java | 158 +++---- integration/modules/{ => dead}/UE.java | 48 +- .../modules/helpers/MFRDSUHandler.java | 6 +- .../helpers/{ => dead}/BCPerdition.java | 118 ++--- .../helpers/{ => dead}/BCPipeHandler.java | 54 +-- .../helpers/{ => dead}/BCPipeInventory.java | 114 ++--- .../modules/helpers/{ => dead}/BSCrate.java | 134 +++--- .../helpers/{ => dead}/BSCrateHandler.java | 54 +-- .../{ => dead}/BSCrateStorageAdaptor.java | 370 +++++++-------- .../helpers/{ => dead}/FMPPacketEvent.java | 30 +- .../{ => dead}/FactorizationBarrel.java | 264 +++++------ .../{ => dead}/FactorizationHandler.java | 54 +-- .../ForestryGeneticsComparison.java | 94 ++-- .../{ => dead}/ForestryGeneticsProvider.java | 64 +-- .../helpers/{ => dead}/GregTechHandler.java | 54 +-- .../{ => dead}/GregTechQuantumChest.java | 206 ++++---- .../NEIQuartzShapedRecipeHandler.java | 416 ++++++++-------- 34 files changed, 2197 insertions(+), 2196 deletions(-) rename integration/abstraction/{IMFR.java => IDSU.java} (85%) rename integration/modules/{MFR.java => DSU.java} (81%) rename integration/modules/{ => dead}/BC.java (95%) rename integration/modules/{ => dead}/BS.java (80%) rename integration/modules/{ => dead}/FMP.java (95%) rename integration/modules/{ => dead}/FZ.java (93%) rename integration/modules/{ => dead}/Forestry.java (83%) rename integration/modules/{ => dead}/GT.java (82%) rename integration/modules/{ => dead}/IC2.java (95%) rename integration/modules/{ => dead}/InvTweaks.java (83%) rename integration/modules/{ => dead}/LP.java (82%) rename integration/modules/{ => dead}/MJ.java (84%) rename integration/modules/{ => dead}/Mekanism.java (93%) rename integration/modules/{ => dead}/Mystcraft.java (83%) rename integration/modules/{ => dead}/NEI.java (95%) rename integration/modules/{ => dead}/RC.java (94%) rename integration/modules/{ => dead}/TE.java (95%) rename integration/modules/{ => dead}/UE.java (82%) rename integration/modules/helpers/{ => dead}/BCPerdition.java (91%) rename integration/modules/helpers/{ => dead}/BCPipeHandler.java (90%) rename integration/modules/helpers/{ => dead}/BCPipeInventory.java (92%) rename integration/modules/helpers/{ => dead}/BSCrate.java (93%) rename integration/modules/helpers/{ => dead}/BSCrateHandler.java (91%) rename integration/modules/helpers/{ => dead}/BSCrateStorageAdaptor.java (94%) rename integration/modules/helpers/{ => dead}/FMPPacketEvent.java (81%) rename integration/modules/helpers/{ => dead}/FactorizationBarrel.java (94%) rename integration/modules/helpers/{ => dead}/FactorizationHandler.java (91%) rename integration/modules/helpers/{ => dead}/ForestryGeneticsComparison.java (92%) rename integration/modules/helpers/{ => dead}/ForestryGeneticsProvider.java (91%) rename integration/modules/helpers/{ => dead}/GregTechHandler.java (90%) rename integration/modules/helpers/{ => dead}/GregTechQuantumChest.java (94%) rename integration/modules/helpers/{ => dead}/NEIQuartzShapedRecipeHandler.java (95%) diff --git a/core/AppEng.java b/core/AppEng.java index c7420e731..b066f5bfb 100644 --- a/core/AppEng.java +++ b/core/AppEng.java @@ -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 diff --git a/integration/abstraction/IMFR.java b/integration/abstraction/IDSU.java similarity index 85% rename from integration/abstraction/IMFR.java rename to integration/abstraction/IDSU.java index 7f403d758..9d03df088 100644 --- a/integration/abstraction/IMFR.java +++ b/integration/abstraction/IDSU.java @@ -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); + +} diff --git a/integration/modules/MFR.java b/integration/modules/DSU.java similarity index 81% rename from integration/modules/MFR.java rename to integration/modules/DSU.java index 59b16ae63..287c05f06 100644 --- a/integration/modules/MFR.java +++ b/integration/modules/DSU.java @@ -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() ); + } + +} diff --git a/integration/modules/BC.java b/integration/modules/dead/BC.java similarity index 95% rename from integration/modules/BC.java rename to integration/modules/dead/BC.java index 05ef56b8f..59fb6d2c3 100644 --- a/integration/modules/BC.java +++ b/integration/modules/dead/BC.java @@ -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", - // + "@" + ); - 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", + // + "@" + ); + 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 + } + +} diff --git a/integration/modules/BS.java b/integration/modules/dead/BS.java similarity index 80% rename from integration/modules/BS.java rename to integration/modules/dead/BS.java index 232a25c35..ace05046d 100644 --- a/integration/modules/BS.java +++ b/integration/modules/dead/BS.java @@ -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() ); + } + +} diff --git a/integration/modules/FMP.java b/integration/modules/dead/FMP.java similarity index 95% rename from integration/modules/FMP.java rename to integration/modules/dead/FMP.java index c58edff09..d8f07a341 100644 --- a/integration/modules/FMP.java +++ b/integration/modules/dead/FMP.java @@ -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 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 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 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 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 ); + } + } + +} diff --git a/integration/modules/FZ.java b/integration/modules/dead/FZ.java similarity index 93% rename from integration/modules/FZ.java rename to integration/modules/dead/FZ.java index b440775cf..ec7259821 100644 --- a/integration/modules/FZ.java +++ b/integration/modules/dead/FZ.java @@ -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 ); + } + } +} diff --git a/integration/modules/Forestry.java b/integration/modules/dead/Forestry.java similarity index 83% rename from integration/modules/Forestry.java rename to integration/modules/dead/Forestry.java index 28896159b..d195f0eaa 100644 --- a/integration/modules/Forestry.java +++ b/integration/modules/dead/Forestry.java @@ -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 + + } + +} diff --git a/integration/modules/GT.java b/integration/modules/dead/GT.java similarity index 82% rename from integration/modules/GT.java rename to integration/modules/dead/GT.java index 5f4159ef6..feff1f78d 100644 --- a/integration/modules/GT.java +++ b/integration/modules/dead/GT.java @@ -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() ); + } + +} diff --git a/integration/modules/IC2.java b/integration/modules/dead/IC2.java similarity index 95% rename from integration/modules/IC2.java rename to integration/modules/dead/IC2.java index 26eeee407..4c0af833f 100644 --- a/integration/modules/IC2.java +++ b/integration/modules/dead/IC2.java @@ -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 ); + } + +} diff --git a/integration/modules/InvTweaks.java b/integration/modules/dead/InvTweaks.java similarity index 83% rename from integration/modules/InvTweaks.java rename to integration/modules/dead/InvTweaks.java index a122b8e8a..1a9d2f7fd 100644 --- a/integration/modules/InvTweaks.java +++ b/integration/modules/dead/InvTweaks.java @@ -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 + + } + +} diff --git a/integration/modules/LP.java b/integration/modules/dead/LP.java similarity index 82% rename from integration/modules/LP.java rename to integration/modules/dead/LP.java index ec2d3db83..6b64de18e 100644 --- a/integration/modules/LP.java +++ b/integration/modules/dead/LP.java @@ -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 + + } + +} diff --git a/integration/modules/MJ.java b/integration/modules/dead/MJ.java similarity index 84% rename from integration/modules/MJ.java rename to integration/modules/dead/MJ.java index 646850331..e20e09a0f 100644 --- a/integration/modules/MJ.java +++ b/integration/modules/dead/MJ.java @@ -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 + + } + +} diff --git a/integration/modules/Mekanism.java b/integration/modules/dead/Mekanism.java similarity index 93% rename from integration/modules/Mekanism.java rename to integration/modules/dead/Mekanism.java index e77499785..9e4288abb 100644 --- a/integration/modules/Mekanism.java +++ b/integration/modules/dead/Mekanism.java @@ -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 ); + } +} diff --git a/integration/modules/Mystcraft.java b/integration/modules/dead/Mystcraft.java similarity index 83% rename from integration/modules/Mystcraft.java rename to integration/modules/dead/Mystcraft.java index f5c834619..9262c596c 100644 --- a/integration/modules/Mystcraft.java +++ b/integration/modules/dead/Mystcraft.java @@ -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 + + } + +} diff --git a/integration/modules/NEI.java b/integration/modules/dead/NEI.java similarity index 95% rename from integration/modules/NEI.java rename to integration/modules/dead/NEI.java index 4bdc2ee83..4942e270a 100644 --- a/integration/modules/NEI.java +++ b/integration/modules/dead/NEI.java @@ -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 + { + + } + +} diff --git a/integration/modules/RC.java b/integration/modules/dead/RC.java similarity index 94% rename from integration/modules/RC.java rename to integration/modules/dead/RC.java index 511ebd1b5..92623c2ff 100644 --- a/integration/modules/RC.java +++ b/integration/modules/dead/RC.java @@ -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 ) ); + } +} diff --git a/integration/modules/TE.java b/integration/modules/dead/TE.java similarity index 95% rename from integration/modules/TE.java rename to integration/modules/dead/TE.java index 3d43299ba..febd07d2d 100644 --- a/integration/modules/TE.java +++ b/integration/modules/dead/TE.java @@ -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; + } + +} diff --git a/integration/modules/UE.java b/integration/modules/dead/UE.java similarity index 82% rename from integration/modules/UE.java rename to integration/modules/dead/UE.java index ec087ac87..e656ce17b 100644 --- a/integration/modules/UE.java +++ b/integration/modules/dead/UE.java @@ -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 + + } + +} diff --git a/integration/modules/helpers/MFRDSUHandler.java b/integration/modules/helpers/MFRDSUHandler.java index 4e2aa5973..6dcc77351 100644 --- a/integration/modules/helpers/MFRDSUHandler.java +++ b/integration/modules/helpers/MFRDSUHandler.java @@ -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; } diff --git a/integration/modules/helpers/BCPerdition.java b/integration/modules/helpers/dead/BCPerdition.java similarity index 91% rename from integration/modules/helpers/BCPerdition.java rename to integration/modules/helpers/dead/BCPerdition.java index 8171367d6..a79cfcf9f 100644 --- a/integration/modules/helpers/BCPerdition.java +++ b/integration/modules/helpers/dead/BCPerdition.java @@ -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 ); + } + } \ No newline at end of file diff --git a/integration/modules/helpers/BCPipeHandler.java b/integration/modules/helpers/dead/BCPipeHandler.java similarity index 90% rename from integration/modules/helpers/BCPipeHandler.java rename to integration/modules/helpers/dead/BCPipeHandler.java index dea7ac16e..6dbb0ba94 100644 --- a/integration/modules/helpers/BCPipeHandler.java +++ b/integration/modules/helpers/dead/BCPipeHandler.java @@ -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; + } + +} diff --git a/integration/modules/helpers/BCPipeInventory.java b/integration/modules/helpers/dead/BCPipeInventory.java similarity index 92% rename from integration/modules/helpers/BCPipeInventory.java rename to integration/modules/helpers/dead/BCPipeInventory.java index 99f7afec0..27b614cd2 100644 --- a/integration/modules/helpers/BCPipeInventory.java +++ b/integration/modules/helpers/dead/BCPipeInventory.java @@ -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 -{ - - 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 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 +{ + + 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 getAvailableItems(IItemList out) + { + return out; + } + +} diff --git a/integration/modules/helpers/BSCrate.java b/integration/modules/helpers/dead/BSCrate.java similarity index 93% rename from integration/modules/helpers/BSCrate.java rename to integration/modules/helpers/dead/BSCrate.java index 10a35388f..5140eaab0 100644 --- a/integration/modules/helpers/BSCrate.java +++ b/integration/modules/helpers/dead/BSCrate.java @@ -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 -{ - - 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 +{ + + 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; + } + +} diff --git a/integration/modules/helpers/BSCrateHandler.java b/integration/modules/helpers/dead/BSCrateHandler.java similarity index 91% rename from integration/modules/helpers/BSCrateHandler.java rename to integration/modules/helpers/dead/BSCrateHandler.java index 243735879..d7524c8dc 100644 --- a/integration/modules/helpers/BSCrateHandler.java +++ b/integration/modules/helpers/dead/BSCrateHandler.java @@ -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; + } + +} diff --git a/integration/modules/helpers/BSCrateStorageAdaptor.java b/integration/modules/helpers/dead/BSCrateStorageAdaptor.java similarity index 94% rename from integration/modules/helpers/BSCrateStorageAdaptor.java rename to integration/modules/helpers/dead/BSCrateStorageAdaptor.java index cc290feed..efece6d67 100644 --- a/integration/modules/helpers/BSCrateStorageAdaptor.java +++ b/integration/modules/helpers/dead/BSCrateStorageAdaptor.java @@ -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 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 iterator() + { + return new StackToSlotIterator( cs.getContents( side ).iterator() ); + } + +} diff --git a/integration/modules/helpers/FMPPacketEvent.java b/integration/modules/helpers/dead/FMPPacketEvent.java similarity index 81% rename from integration/modules/helpers/FMPPacketEvent.java rename to integration/modules/helpers/dead/FMPPacketEvent.java index 8a45d9827..23d8742cc 100644 --- a/integration/modules/helpers/FMPPacketEvent.java +++ b/integration/modules/helpers/dead/FMPPacketEvent.java @@ -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; + } + +} diff --git a/integration/modules/helpers/FactorizationBarrel.java b/integration/modules/helpers/dead/FactorizationBarrel.java similarity index 94% rename from integration/modules/helpers/FactorizationBarrel.java rename to integration/modules/helpers/dead/FactorizationBarrel.java index 4fe2bbc14..620b579a7 100644 --- a/integration/modules/helpers/FactorizationBarrel.java +++ b/integration/modules/helpers/dead/FactorizationBarrel.java @@ -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 -{ - - 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 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 +{ + + 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 getAvailableItems(IItemList out) + { + ItemStack i = fProxy.barrelGetItem( te ); + if ( i != null ) + { + i.stackSize = fProxy.barrelGetItemCount( te ); + out.addStorage( AEItemStack.create( i ) ); + } + + return out; + } + } \ No newline at end of file diff --git a/integration/modules/helpers/FactorizationHandler.java b/integration/modules/helpers/dead/FactorizationHandler.java similarity index 91% rename from integration/modules/helpers/FactorizationHandler.java rename to integration/modules/helpers/dead/FactorizationHandler.java index dd0057e13..a3052dc00 100644 --- a/integration/modules/helpers/FactorizationHandler.java +++ b/integration/modules/helpers/dead/FactorizationHandler.java @@ -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; + } + +} diff --git a/integration/modules/helpers/ForestryGeneticsComparison.java b/integration/modules/helpers/dead/ForestryGeneticsComparison.java similarity index 92% rename from integration/modules/helpers/ForestryGeneticsComparison.java rename to integration/modules/helpers/dead/ForestryGeneticsComparison.java index d95445001..fdc5fb3cf 100644 --- a/integration/modules/helpers/ForestryGeneticsComparison.java +++ b/integration/modules/helpers/dead/ForestryGeneticsComparison.java @@ -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; + } + +} diff --git a/integration/modules/helpers/ForestryGeneticsProvider.java b/integration/modules/helpers/dead/ForestryGeneticsProvider.java similarity index 91% rename from integration/modules/helpers/ForestryGeneticsProvider.java rename to integration/modules/helpers/dead/ForestryGeneticsProvider.java index 9a22a4b8b..84890cec0 100644 --- a/integration/modules/helpers/ForestryGeneticsProvider.java +++ b/integration/modules/helpers/dead/ForestryGeneticsProvider.java @@ -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; + } + +} diff --git a/integration/modules/helpers/GregTechHandler.java b/integration/modules/helpers/dead/GregTechHandler.java similarity index 90% rename from integration/modules/helpers/GregTechHandler.java rename to integration/modules/helpers/dead/GregTechHandler.java index f122bcb11..baf990cac 100644 --- a/integration/modules/helpers/GregTechHandler.java +++ b/integration/modules/helpers/dead/GregTechHandler.java @@ -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; + } + +} diff --git a/integration/modules/helpers/GregTechQuantumChest.java b/integration/modules/helpers/dead/GregTechQuantumChest.java similarity index 94% rename from integration/modules/helpers/GregTechQuantumChest.java rename to integration/modules/helpers/dead/GregTechQuantumChest.java index f617a54c2..f321417a7 100644 --- a/integration/modules/helpers/GregTechQuantumChest.java +++ b/integration/modules/helpers/dead/GregTechQuantumChest.java @@ -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; + } } \ No newline at end of file diff --git a/integration/modules/helpers/NEIQuartzShapedRecipeHandler.java b/integration/modules/helpers/dead/NEIQuartzShapedRecipeHandler.java similarity index 95% rename from integration/modules/helpers/NEIQuartzShapedRecipeHandler.java rename to integration/modules/helpers/dead/NEIQuartzShapedRecipeHandler.java index 1869f17df..d8756b4bf 100644 --- a/integration/modules/helpers/NEIQuartzShapedRecipeHandler.java +++ b/integration/modules/helpers/dead/NEIQuartzShapedRecipeHandler.java @@ -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 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 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 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 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 ingredients; - public PositionedStack result; - - public CachedShapedRecipe(AEShapedQuartzRecipe irecipe) { - result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 ); - ingredients = new ArrayList(); - 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 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 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 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 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 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 ingredients; + public PositionedStack result; + + public CachedShapedRecipe(AEShapedQuartzRecipe irecipe) { + result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 ); + ingredients = new ArrayList(); + 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 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(); + } + } } \ No newline at end of file