Cleaning Up Mod Integrations (#2581)

* Cleaned up unused Mod integrations other than for mods that are likely to be integrated soon.
* Introduced an easier Facade class to access mod integration abstractions (called Integrations).
* Removed the link between IntegrationType and integration abstraction. Integrations are now explicitly instantiated inside of IntegrationNode.
This commit is contained in:
shartte
2016-11-06 20:23:14 +01:00
committed by yueh
parent fbb0c05c7f
commit 0e7981d717
73 changed files with 689 additions and 1295 deletions
@@ -1,71 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
/**
* Contains wrench behaviour
*
* and registers the engines as P2P attunements for RF tunnels (since BC 7, they are part of BC Core) The attunement is
* currently not public anymore, because it
* was only used internally
*
* @author AlgorithmX2
* @version rv3
* @since rv0
*/
public interface IBuildCraftCore
{
/**
* @param eq to be checked item, can be {@code null}
*
* @return {@code true} if it is an {@link buildcraft.api.tools.IToolWrench}
*/
boolean isWrench( @Nullable Item eq );
/**
* @param wrench to be checked item, must be an {@link buildcraft.api.tools.IToolWrench}
* @param wrencher wrenching player, can be probably {@code null}, but not sure
* @param pos pos
*
* @return {@code true} if player can wrench with that {@code wrench}
*
* @throws NullPointerException if {@code wrench} is {@code null}
* @throws ClassCastException if {@code wrench} is not an {@link buildcraft.api.tools.IToolWrench}
*/
boolean canWrench( @Nonnull Item wrench, EntityPlayer wrencher, BlockPos pos );
/**
* @param wrench to be checked item, must be an {@link buildcraft.api.tools.IToolWrench}
* @param wrencher wrenching player, can be probably {@code null}, but not sure
* @param pos pos
*
* @throws NullPointerException if {@code wrench} is {@code null}
* @throws ClassCastException if {@code wrench} is not an {@link buildcraft.api.tools.IToolWrench}
*/
void wrenchUsed( @Nonnull Item wrench, EntityPlayer wrencher, BlockPos pos );
}
@@ -1,117 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import appeng.api.parts.IFacadePart;
import appeng.api.util.AEPartLocation;
/**
* Contains facade logic to interchange BC facades with AE facades,
*
* pipe logic to interact between storage buses and pipes
*
* and using pipes for attunements
* The attunement is currently not public anymore,
* because it was only used internally
*
* @author thatsIch
* @version rv3 - 12.06.2015
* @since rv3 12.06.2015
*/
public interface IBuildCraftTransport
{
/**
* @param is to be checked item
*
* @return {@code true} if the checked item is a {@link buildcraft.api.facades.IFacadeItem}
*/
boolean isFacade( @Nullable ItemStack is );
/**
* @param blk block used for the ae facade
* @param meta meta of the block
* @param side side of the ae facade
*
* @return ae facade through bc facade system
*/
@Nullable
IFacadePart createFacadePart( @Nullable IBlockState blk, @Nonnull AEPartLocation side );
/**
* @param held create facade for that item
* @param side on which side should the part be rendered, should rather be not {@code null}
*
* @return new instance using the {@code held} and side as direct argument, no logic in between
*
* @throws IllegalArgumentException if {@code held} is {@code null}
*/
IFacadePart createFacadePart( @Nonnull ItemStack held, @Nonnull AEPartLocation side );
/**
* @param facade buildcraft facade
*
* @return item with the block and metadata based on the facade or {@code null} if {@code facade} was not a facade
*
* @throws NullPointerException if {@code facade} is {@code null}
*/
@Nullable
ItemStack getTextureForFacade( @Nonnull ItemStack facade );
/**
* @param te the to be checked {@link TileEntity}
* @param dir direction of the {@link TileEntity}
*
* @return {@code true} if {@code te} is a buildcraft pipe, but not plugged
*
* @throws NullPointerException if {@code dir} is {@code null}
*/
boolean isPipe( @Nullable TileEntity te, @Nonnull EnumFacing dir );
/**
* checks weather if the {@code te} is injectable and simulates to inject the item
*
* @param te preferred something like a buildcraft injectable, can handle anything, just fails that way
* @param is to be injected item
* @param dir direction of the pipe
*
* @return {@code true} if items were simulated successfully being added
*/
boolean canAddItemsToPipe( TileEntity te, ItemStack is, EnumFacing dir );
/**
* checks weather if the {@code te} is injectable, simulates the inject and tries to inject the item
*
* @param te preferred something like a buildcraft injectable, can handle anything, just fails that way
* @param is to be injected item
* @param dir direction of the pipe
*
* @return {@code true} if items were added to the buildcraft pipe
*/
boolean addItemsToPipe( @Nullable TileEntity te, @Nullable ItemStack is, @Nonnull EnumFacing dir );
}
@@ -19,15 +19,31 @@
package appeng.integration.abstraction;
import java.util.Set;
import net.minecraft.util.EnumFacing;
import appeng.util.InventoryAdaptor;
public interface IBetterStorage
/**
* Provides an abstraction for the IC2 Basic Sink so it can be stubbed out easily when the integration is disabled, or
* if the IC2 API is not available.
*/
public interface IC2PowerSink
{
boolean isStorageCrate( Object te );
default void invalidate()
{
}
InventoryAdaptor getAdaptor( Object te, EnumFacing d );
default void onChunkUnload()
{
}
default void onLoad()
{
}
default void setValidFaces( Set<EnumFacing> faces )
{
}
}
@@ -1,29 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import appeng.api.util.AEColor;
public interface ICLApi
{
int colorLight( AEColor color, int light );
}
@@ -1,33 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import net.minecraft.tileentity.TileEntity;
import appeng.api.storage.IMEInventory;
public interface IDSU
{
IMEInventory getDSU( TileEntity te );
boolean isDSU( TileEntity te );
}
@@ -1,40 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fml.common.eventhandler.Event;
import appeng.api.parts.IPartHost;
import appeng.parts.CableBusContainer;
public interface IFMP
{
IPartHost getOrCreateHost( TileEntity tile );
CableBusContainer getCableContainer( TileEntity te );
void registerPassThrough( Class<?> layerInterface );
Event newFMPPacketEvent( EntityPlayerMP sender );
}
@@ -1,46 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import appeng.api.storage.IMEInventory;
public interface IFZ
{
ItemStack barrelGetItem( TileEntity te );
int barrelGetMaxItemCount( TileEntity te );
int barrelGetItemCount( TileEntity te );
void setItemType( TileEntity te, ItemStack input );
void barrelSetCount( TileEntity te, int max );
IMEInventory getFactorizationBarrel( TileEntity te );
boolean isBarrel( TileEntity te );
void grinderRecipe( ItemStack is, ItemStack itemStack );
}
@@ -1,29 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import appeng.api.features.IItemComparisonProvider;
public interface IForestry
{
IItemComparisonProvider getGeneticsComparisonProvider();
}
@@ -1,33 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import net.minecraft.tileentity.TileEntity;
import appeng.api.storage.IMEInventory;
public interface IGT
{
boolean isQuantumChest( TileEntity te );
IMEInventory getQuantumChest( TileEntity te );
}
@@ -20,11 +20,29 @@ package appeng.integration.abstraction;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import appeng.integration.IIntegrationModule;
import appeng.integration.modules.ic2.IC2PowerSinkStub;
import appeng.tile.powersink.IExternalPowerSink;
public interface IIC2
public interface IIC2 extends IIntegrationModule
{
void maceratorRecipe( ItemStack in, ItemStack out );
default void maceratorRecipe( ItemStack in, ItemStack out )
{
}
/**
* Create an IC2 power sink for the given external sink.
*/
default IC2PowerSink createPowerSink( TileEntity tileEntity, IExternalPowerSink externalSink ) {
return IC2PowerSinkStub.INSTANCE;
}
class Stub extends IIntegrationModule.Stub implements IIC2
{
}
}
@@ -1,39 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import appeng.api.parts.IPartHost;
public interface IImmibisMicroblocks
{
IPartHost getOrCreateHost( EntityPlayer player, int side, TileEntity te );
/**
* @param te to be left tile entity
*
* @return true if this worked..
*/
boolean leaveParts( TileEntity te );
}
@@ -21,9 +21,19 @@ package appeng.integration.abstraction;
import net.minecraft.item.ItemStack;
import appeng.integration.IIntegrationModule;
public interface IInvTweaks
public interface IInvTweaks extends IIntegrationModule
{
int compareItems( ItemStack i, ItemStack j );
default int compareItems( ItemStack i, ItemStack j )
{
throw new UnsupportedOperationException();
}
class Stub extends IIntegrationModule.Stub implements IInvTweaks
{
}
}
@@ -1,15 +1,43 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import appeng.integration.IIntegrationModule;
/**
* Abstracts access to the JEI API functionality.
*/
public interface IJEI
public interface IJEI extends IIntegrationModule
{
boolean isEnabled();
default String getSearchText()
{
return "";
}
String getSearchText();
default void setSearchText( String searchText )
{
}
void setSearchText( String searchText );
class Stub extends IIntegrationModule.Stub implements IJEI
{
}
}
@@ -1,50 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import appeng.api.storage.IMEInventory;
public interface ILP
{
List<ItemStack> getCraftedItems( TileEntity te );
List<ItemStack> getProvidedItems( TileEntity te );
boolean isRequestPipe( TileEntity te );
List<ItemStack> performRequest( TileEntity te, ItemStack wanted );
IMEInventory getInv( TileEntity te );
Object getGetPowerPipe( TileEntity te );
boolean isPowerSource( TileEntity tt );
boolean canUseEnergy( Object pp, int ceil, List<Object> providersToIgnore );
boolean useEnergy( Object pp, int ceil, List<Object> providersToIgnore );
}
@@ -21,11 +21,21 @@ package appeng.integration.abstraction;
import net.minecraft.item.ItemStack;
import appeng.integration.IIntegrationModule;
public interface IMekanism
public interface IMekanism extends IIntegrationModule
{
void addCrusherRecipe( ItemStack in, ItemStack out );
default void addCrusherRecipe( ItemStack in, ItemStack out )
{
}
void addEnrichmentChamberRecipe( ItemStack in, ItemStack out );
default void addEnrichmentChamberRecipe( ItemStack in, ItemStack out )
{
}
class Stub extends IIntegrationModule.Stub implements IMekanism
{
}
}
@@ -21,9 +21,16 @@ package appeng.integration.abstraction;
import net.minecraft.item.ItemStack;
import appeng.integration.IIntegrationModule;
public interface IRC
public interface IRC extends IIntegrationModule
{
void rockCrusher( ItemStack input, ItemStack output );
default void rockCrusher( ItemStack input, ItemStack output ) {
}
class Stub extends IIntegrationModule.Stub implements IRC {
}
}
@@ -1,38 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import appeng.api.util.AEPartLocation;
public interface ITE
{
void addPulverizerRecipe( int i, ItemStack blkQuartz, ItemStack blockDust );
void addPulverizerRecipe( int i, ItemStack blkQuartzOre, ItemStack matQuartz, ItemStack matQuartzDust );
boolean isPipe( TileEntity te, AEPartLocation opposite );
ItemStack addItemsToPipe( TileEntity ad, ItemStack itemstack, AEPartLocation dir );
}