Moved Facade Registration to Init.
Removed Urainum Drop Ammo. Storage Cells can now be dismantled and re-assembled. Removed IC2 P2P Logging.
This commit is contained in:
parent
242aad5133
commit
ca64bacd17
5 changed files with 51 additions and 12 deletions
|
@ -180,6 +180,12 @@ public class BC extends BaseModule implements IBC
|
|||
|
||||
AEApi.instance().partHelper().registerNewLayer( "appeng.api.parts.layers.LayerIPipeConnection", "buildcraft.api.transport.IPipeConnection" );
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BCPipeHandler() );
|
||||
|
||||
Blocks b = AEApi.instance().blocks();
|
||||
addFacade( b.blockFluix.stack( 1 ) );
|
||||
addFacade( b.blockQuartz.stack( 1 ) );
|
||||
addFacade( b.blockQuartzChiseled.stack( 1 ) );
|
||||
addFacade( b.blockQuartzPiller.stack( 1 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -187,13 +193,6 @@ public class BC extends BaseModule implements IBC
|
|||
{
|
||||
registerPowerP2P();
|
||||
registerItemP2P();
|
||||
|
||||
Blocks b = AEApi.instance().blocks();
|
||||
addFacade( b.blockFluix.stack( 1 ) );
|
||||
addFacade( b.blockQuartz.stack( 1 ) );
|
||||
addFacade( b.blockQuartzChiseled.stack( 1 ) );
|
||||
addFacade( b.blockQuartzPiller.stack( 1 ) );
|
||||
|
||||
registerLiquidsP2P();
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,8 @@ public class IC2 implements IIntegrationModule, IIC2
|
|||
reg.addNewAttunement( getItem( "detectorCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( getItem( "splitterCableItem" ), TunnelType.IC2_POWER );
|
||||
|
||||
AEApi.instance().registries().matterCannon().registerAmmo( getItem( "uraniumDrop" ), 238.0289 );
|
||||
// this is gone?
|
||||
// AEApi.instance().registries().matterCannon().registerAmmo( getItem( "uraniumDrop" ), 238.0289 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,6 +3,7 @@ package appeng.items.materials;
|
|||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import appeng.core.AppEng;
|
||||
|
@ -92,6 +93,11 @@ public enum MaterialType
|
|||
features.add( AEFeature.DuplicateItems );
|
||||
}
|
||||
|
||||
public ItemStack stack(int size)
|
||||
{
|
||||
return new ItemStack( ItemMaterial.instance, size, damageValue );
|
||||
}
|
||||
|
||||
public EnumSet<AEFeature> getFeature()
|
||||
{
|
||||
return features;
|
||||
|
|
|
@ -4,8 +4,11 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
|
@ -13,6 +16,7 @@ import appeng.api.implementations.items.IStorageCell;
|
|||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
|
@ -21,6 +25,7 @@ import appeng.items.contents.CellUpgrades;
|
|||
import appeng.items.materials.MaterialType;
|
||||
import appeng.me.storage.CellInventory;
|
||||
import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, IItemGroup
|
||||
|
@ -166,4 +171,36 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if ( player.isSneaking() )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
return false;
|
||||
|
||||
InventoryPlayer pinv = player.inventory;
|
||||
IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( stack, StorageChannel.ITEMS );
|
||||
if ( inv != null && pinv.getCurrentItem() == stack )
|
||||
{
|
||||
InventoryAdaptor ia = InventoryAdaptor.getAdaptor( pinv, ForgeDirection.UNKNOWN );
|
||||
IItemList<IAEItemStack> list = inv.getAvailableItems( StorageChannel.ITEMS.createList() );
|
||||
if ( list.isEmpty() && ia != null )
|
||||
{
|
||||
pinv.setInventorySlotContents( pinv.currentItem, null );
|
||||
|
||||
ItemStack extraA = ia.addItems( AEApi.instance().materials().materialEmptyStorageCell.stack( 1 ) );
|
||||
ItemStack extraB = ia.addItems( component.stack( 1 ) );
|
||||
|
||||
if ( extraA != null )
|
||||
player.dropPlayerItemWithRandomChoice( extraA, false );
|
||||
if ( extraB != null )
|
||||
player.dropPlayerItemWithRandomChoice( extraB, false );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.TunnelType;
|
||||
import appeng.core.AELog;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.cache.helpers.TunnelCollection;
|
||||
import appeng.util.Platform;
|
||||
|
@ -108,7 +107,6 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
|
|||
@Override
|
||||
public double injectEnergyUnits(ForgeDirection directionFrom, double amount)
|
||||
{
|
||||
AELog.info( "INJECT: " + amount );
|
||||
TunnelCollection<PartP2PIC2Power> outs;
|
||||
try
|
||||
{
|
||||
|
@ -148,7 +146,6 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
|
|||
@Override
|
||||
public double getOfferedEnergy()
|
||||
{
|
||||
AELog.info( "getOfferedEnergy: " + OutputPacket );
|
||||
if ( output )
|
||||
return OutputPacket;
|
||||
return 0;
|
||||
|
@ -157,7 +154,6 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
|
|||
@Override
|
||||
public void drawEnergy(double amount)
|
||||
{
|
||||
AELog.info( "drawEnergy: " + amount );
|
||||
OutputPacket -= amount;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue