2014-11-14 12:02:52 +01:00
|
|
|
/*
|
|
|
|
* 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>.
|
|
|
|
*/
|
|
|
|
|
2014-08-12 18:58:24 +02:00
|
|
|
package appeng.integration.modules;
|
2014-02-15 07:40:02 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
|
2014-08-30 18:30:22 +02:00
|
|
|
import net.mcft.copy.betterstorage.api.crate.ICrateStorage;
|
2014-02-15 07:40:02 +01:00
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2014-12-29 21:59:05 +01:00
|
|
|
|
2014-02-15 07:40:02 +01:00
|
|
|
import appeng.api.AEApi;
|
2015-08-06 16:01:56 +02:00
|
|
|
import appeng.helpers.Reflected;
|
2015-07-14 20:49:39 +02:00
|
|
|
import appeng.integration.BaseModule;
|
2014-02-15 07:40:02 +01:00
|
|
|
import appeng.integration.IIntegrationModule;
|
2015-08-06 16:01:56 +02:00
|
|
|
import appeng.integration.IntegrationHelper;
|
2014-08-12 18:58:24 +02:00
|
|
|
import appeng.integration.abstraction.IBetterStorage;
|
|
|
|
import appeng.integration.modules.helpers.BSCrateHandler;
|
|
|
|
import appeng.integration.modules.helpers.BSCrateStorageAdaptor;
|
2014-02-15 07:40:02 +01:00
|
|
|
import appeng.util.InventoryAdaptor;
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
|
2015-07-14 20:49:39 +02:00
|
|
|
public class BetterStorage extends BaseModule implements IIntegrationModule, IBetterStorage
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
2015-08-06 16:01:56 +02:00
|
|
|
@Reflected
|
2014-08-12 18:58:24 +02:00
|
|
|
public static BetterStorage instance;
|
2014-02-15 07:40:02 +01:00
|
|
|
|
2015-08-06 16:01:56 +02:00
|
|
|
@Reflected
|
2015-07-14 20:49:39 +02:00
|
|
|
public BetterStorage()
|
|
|
|
{
|
2015-08-06 16:01:56 +02:00
|
|
|
IntegrationHelper.testClassExistence( this, net.mcft.copy.betterstorage.api.crate.ICrateStorage.class );
|
2015-07-14 20:49:39 +02:00
|
|
|
}
|
|
|
|
|
2014-02-15 07:40:02 +01:00
|
|
|
@Override
|
2015-04-03 08:54:31 +02:00
|
|
|
public boolean isStorageCrate( Object te )
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
|
|
|
return te instanceof ICrateStorage;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-04-03 08:54:31 +02:00
|
|
|
public InventoryAdaptor getAdaptor( Object te, ForgeDirection d )
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( te instanceof ICrateStorage )
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
|
|
|
return new BSCrateStorageAdaptor( te, d );
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-12-19 19:01:51 +01:00
|
|
|
public void init()
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-12-19 19:01:51 +01:00
|
|
|
public void postInit()
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
|
|
|
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BSCrateHandler() );
|
|
|
|
}
|
|
|
|
}
|