Search in sources :

Example 11 with Capability

use of net.minecraftforge.common.capabilities.Capability in project Metalworks by canitzp.

the class ItemBattery method initCapabilities.

@Override
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) {
    return new ICapabilityProvider() {

        @Override
        public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing) {
            return capability == CapabilityEnergy.ENERGY;
        }

        @Nullable
        @Override
        public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) {
            int maxTransfer = Math.round(maxEnergy / 50.0F);
            return capability == CapabilityEnergy.ENERGY ? CapabilityEnergy.ENERGY.cast(new EnergyStorage(maxEnergy, maxTransfer, maxTransfer, stack.getTagCompound() != null ? stack.getTagCompound().getInteger("Energy") : 0) {

                @Override
                public int receiveEnergy(int maxReceive, boolean simulate) {
                    int i = super.receiveEnergy(maxReceive, simulate);
                    setEnergy(energy);
                    return i;
                }

                @Override
                public int extractEnergy(int maxExtract, boolean simulate) {
                    int i = super.extractEnergy(maxExtract, simulate);
                    setEnergy(energy);
                    return i;
                }

                private void setEnergy(int energy) {
                    NBTTagCompound nbt = stack.getTagCompound() != null ? stack.getTagCompound() : new NBTTagCompound();
                    nbt.setInteger("Energy", energy);
                    stack.setTagCompound(nbt);
                }
            }) : null;
        }
    };
}
Also used : Capability(net.minecraftforge.common.capabilities.Capability) ICapabilityProvider(net.minecraftforge.common.capabilities.ICapabilityProvider) Nonnull(javax.annotation.Nonnull) EnumFacing(net.minecraft.util.EnumFacing) EnergyStorage(net.minecraftforge.energy.EnergyStorage) IEnergyStorage(net.minecraftforge.energy.IEnergyStorage) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Nullable(javax.annotation.Nullable)

Example 12 with Capability

use of net.minecraftforge.common.capabilities.Capability in project minecolonies by Minecolonies.

the class AbstractBuilding method getCapability.

@Nullable
@Override
public <T> T getCapability(@Nonnull final Capability<T> capability, @Nullable final EnumFacing facing) {
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY && facing == null) {
        final Set<ICapabilityProvider> providers = new HashSet<>();
        // Add myself
        providers.add(getTileEntity());
        // Add additional containers
        providers.addAll(getAdditionalCountainers().stream().map(getTileEntity().getWorld()::getTileEntity).filter(entity -> (entity instanceof TileEntityChest) || (entity instanceof TileEntityRack)).collect(Collectors.toSet()));
        providers.removeIf(Objects::isNull);
        // Map all providers to IItemHandlers.
        final Set<IItemHandlerModifiable> modifiables = providers.stream().flatMap(provider -> InventoryUtils.getItemHandlersFromProvider(provider).stream()).filter(handler -> handler instanceof IItemHandlerModifiable).map(handler -> (IItemHandlerModifiable) handler).collect(Collectors.toSet());
        return (T) new CombinedItemHandler(getSchematicName(), modifiables.toArray(new IItemHandlerModifiable[modifiables.size()]));
    }
    return null;
}
Also used : IRequest(com.minecolonies.api.colony.requestsystem.request.IRequest) BuildingRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.BuildingRequestResolver) Constants(net.minecraftforge.common.util.Constants) ImmutableCollection(com.google.common.collect.ImmutableCollection) TextComponentTranslation(net.minecraft.util.text.TextComponentTranslation) StandardFactoryController(com.minecolonies.api.colony.requestsystem.StandardFactoryController) NBTTagList(net.minecraft.nbt.NBTTagList) Block(net.minecraft.block.Block) CombinedItemHandler(com.minecolonies.coremod.inventory.api.CombinedItemHandler) IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) BuildingBuilderView(com.minecolonies.coremod.colony.buildings.views.BuildingBuilderView) InventoryHelper(net.minecraft.inventory.InventoryHelper) Predicate(java.util.function.Predicate) RequestState(com.minecolonies.api.colony.requestsystem.request.RequestState) TileEntityColonyBuilding(com.minecolonies.coremod.tileentities.TileEntityColonyBuilding) Collectors(java.util.stream.Collectors) Capability(net.minecraftforge.common.capabilities.Capability) InvocationTargetException(java.lang.reflect.InvocationTargetException) AbstractBuildingView(com.minecolonies.coremod.colony.buildings.views.AbstractBuildingView) Nullable(org.jetbrains.annotations.Nullable) IRequestResolver(com.minecolonies.api.colony.requestsystem.resolver.IRequestResolver) BuildingUtils(com.minecolonies.coremod.util.BuildingUtils) EntityPlayer(net.minecraft.entity.player.EntityPlayer) com.minecolonies.coremod.blocks(com.minecolonies.coremod.blocks) CapabilityItemHandler(net.minecraftforge.items.CapabilityItemHandler) IRequestResolverProvider(com.minecolonies.api.colony.requestsystem.resolver.IRequestResolverProvider) ItemStorage(com.minecolonies.api.crafting.ItemStorage) TickEvent(net.minecraftforge.fml.common.gameevent.TickEvent) NotNull(org.jetbrains.annotations.NotNull) NBTUtil(net.minecraft.nbt.NBTUtil) java.util(java.util) ColonyUtils(com.minecolonies.coremod.util.ColonyUtils) ICapabilityProvider(net.minecraftforge.common.capabilities.ICapabilityProvider) Suppression(com.minecolonies.api.util.constant.Suppression) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) IToken(com.minecolonies.api.colony.requestsystem.token.IToken) EntityAIWorkDeliveryman(com.minecolonies.coremod.entity.ai.citizen.deliveryman.EntityAIWorkDeliveryman) TypeToken(com.google.common.reflect.TypeToken) Constructor(java.lang.reflect.Constructor) IRequestManager(com.minecolonies.api.colony.requestsystem.manager.IRequestManager) TileEntityChest(net.minecraft.tileentity.TileEntityChest) ITextComponent(net.minecraft.util.text.ITextComponent) ItemStack(net.minecraft.item.ItemStack) ImmutableList(com.google.common.collect.ImmutableList) ByteBuf(io.netty.buffer.ByteBuf) StructureWrapper(com.minecolonies.coremod.util.StructureWrapper) BuildingBasedRequester(com.minecolonies.coremod.colony.requestsystem.requesters.BuildingBasedRequester) ConstructionTapeHelper(com.minecolonies.coremod.entity.ai.citizen.builder.ConstructionTapeHelper) com.minecolonies.api.util(com.minecolonies.api.util) Nonnull(javax.annotation.Nonnull) WorkOrderBuild(com.minecolonies.coremod.colony.workorders.WorkOrderBuild) IDeliverable(com.minecolonies.api.colony.requestsystem.requestable.IDeliverable) IRequester(com.minecolonies.api.colony.requestsystem.requester.IRequester) BlockContainer(net.minecraft.block.BlockContainer) ILocation(com.minecolonies.api.colony.requestsystem.location.ILocation) World(net.minecraft.world.World) EnumFacing(net.minecraft.util.EnumFacing) Tuple(net.minecraft.util.Tuple) BlockPos(net.minecraft.util.math.BlockPos) IRequestable(com.minecolonies.api.colony.requestsystem.requestable.IRequestable) TileEntityRack(com.minecolonies.coremod.tileentities.TileEntityRack) TextComponentString(net.minecraft.util.text.TextComponentString) IBlockState(net.minecraft.block.state.IBlockState) TypeConstants(com.minecolonies.api.util.constant.TypeConstants) com.minecolonies.coremod.colony(com.minecolonies.coremod.colony) IInventory(net.minecraft.inventory.IInventory) NbtTagConstants(com.minecolonies.api.util.constant.NbtTagConstants) ByteBufUtils(net.minecraftforge.fml.common.network.ByteBufUtils) TileEntity(net.minecraft.tileentity.TileEntity) IRequestSystemBuildingDataStore(com.minecolonies.api.colony.requestsystem.data.IRequestSystemBuildingDataStore) TileEntityChest(net.minecraft.tileentity.TileEntityChest) IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable) TileEntityRack(com.minecolonies.coremod.tileentities.TileEntityRack) CombinedItemHandler(com.minecolonies.coremod.inventory.api.CombinedItemHandler) ICapabilityProvider(net.minecraftforge.common.capabilities.ICapabilityProvider) Nullable(org.jetbrains.annotations.Nullable)

Example 13 with Capability

use of net.minecraftforge.common.capabilities.Capability in project SpringFestival by TeamCovertDragon.

the class ModuleFortune method onPlayerClone.

@SubscribeEvent
public void onPlayerClone(net.minecraftforge.event.entity.player.PlayerEvent.Clone event) {
    Capability<IFortuneValueSystem> capability = CapabilityLoader.fortuneValue;
    Capability.IStorage<IFortuneValueSystem> storage = capability.getStorage();
    if (event.getOriginal().hasCapability(capability, null) && event.getEntityPlayer().hasCapability(capability, null)) {
        NBTBase nbt = storage.writeNBT(capability, event.getOriginal().getCapability(capability, null), null);
        storage.readNBT(capability, event.getEntityPlayer().getCapability(capability, null), null, nbt);
    }
}
Also used : IFortuneValueSystem(team.covertdragon.springfestival.module.fortune.fortunevaluesystem.capability.IFortuneValueSystem) Capability(net.minecraftforge.common.capabilities.Capability) NBTBase(net.minecraft.nbt.NBTBase) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 14 with Capability

use of net.minecraftforge.common.capabilities.Capability in project BluePower by Qmunity.

the class TileBlulectricCable method tick.

@Override
public void tick() {
    storage.resetCurrent();
    if (level != null && !level.isClientSide) {
        BlockState state = getBlockState();
        if (state.getBlock() instanceof BlockBlulectricCable) {
            List<Direction> directions = new ArrayList<>(BlockBlulectricCable.FACING.getPossibleValues());
            // Check the side has capability
            directions.removeIf(d -> !getCapability(CapabilityBlutricity.BLUTRICITY_CAPABILITY, d).isPresent());
            // Balance power of attached blulectric blocks.
            for (Direction facing : directions) {
                Block fBlock = level.getBlockState(worldPosition.relative(facing)).getBlock();
                if (fBlock != Blocks.AIR && fBlock != Blocks.WATER) {
                    TileEntity tile = level.getBlockEntity(worldPosition.relative(facing));
                    if (tile != null)
                        tile.getCapability(CapabilityBlutricity.BLUTRICITY_CAPABILITY, facing.getOpposite()).ifPresent(exStorage -> EnergyHelper.balancePower(exStorage, storage));
                } else {
                    TileEntity tile = level.getBlockEntity(worldPosition.relative(facing).relative(state.getValue(BlockBlulectricCable.FACING).getOpposite()));
                    if (tile != null)
                        tile.getCapability(CapabilityBlutricity.BLUTRICITY_CAPABILITY, state.getValue(BlockBlulectricCable.FACING)).ifPresent(exStorage -> EnergyHelper.balancePower(exStorage, storage));
                }
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) BlockBlulectricCable(com.bluepowermod.block.power.BlockBlulectricCable) IPowerBase(com.bluepowermod.api.power.IPowerBase) CompoundNBT(net.minecraft.nbt.CompoundNBT) CapabilityBlutricity(com.bluepowermod.api.power.CapabilityBlutricity) EnergyHelper(com.bluepowermod.helper.EnergyHelper) TileMachineBase(com.bluepowermod.tile.TileMachineBase) Direction(net.minecraft.util.Direction) NetworkManager(net.minecraft.network.NetworkManager) Blocks(net.minecraft.block.Blocks) Capability(net.minecraftforge.common.capabilities.Capability) LazyOptional(net.minecraftforge.common.util.LazyOptional) ArrayList(java.util.ArrayList) List(java.util.List) BlutricityStorage(com.bluepowermod.api.power.BlutricityStorage) Block(net.minecraft.block.Block) SUpdateTileEntityPacket(net.minecraft.network.play.server.SUpdateTileEntityPacket) BPTileEntityType(com.bluepowermod.tile.BPTileEntityType) TileEntity(net.minecraft.tileentity.TileEntity) BlockState(net.minecraft.block.BlockState) Nonnull(javax.annotation.Nonnull) INBT(net.minecraft.nbt.INBT) Nullable(javax.annotation.Nullable) BlockState(net.minecraft.block.BlockState) BlockBlulectricCable(com.bluepowermod.block.power.BlockBlulectricCable) ArrayList(java.util.ArrayList) Block(net.minecraft.block.Block) Direction(net.minecraft.util.Direction)

Example 15 with Capability

use of net.minecraftforge.common.capabilities.Capability in project BluePower by Qmunity.

the class BlockBPCableBase method getStateForPos.

private BlockState getStateForPos(World world, BlockPos pos, BlockState state, Direction face) {
    List<Direction> directions = new ArrayList<>(FACING.getPossibleValues());
    List<Direction> internal = null;
    boolean connected_left = false;
    boolean connected_right = false;
    boolean connected_front = false;
    boolean connected_back = false;
    boolean join_left = false;
    boolean join_right = false;
    boolean join_front = false;
    boolean join_back = false;
    // Make sure the side we are trying to connect on isn't blocked.
    TileEntity ownTile = world.getBlockEntity(pos);
    if (ownTile instanceof TileBPMultipart) {
        directions.removeIf(d -> ((TileBPMultipart) ownTile).isSideBlocked(getCapability(), d));
        internal = ((TileBPMultipart) ownTile).getStates().stream().filter(s -> s.getBlock() == this).map(s -> s.getValue(FACING)).collect(Collectors.toList());
    }
    // Make sure the cable is on the same side of the block
    directions.removeIf(d -> {
        TileEntity t = world.getBlockEntity(pos.relative(d));
        return (world.getBlockState(pos.relative(d)).getBlock() == this && world.getBlockState(pos.relative(d)).getValue(FACING) != face) || (t instanceof TileBPMultipart && ((TileBPMultipart) t).getStates().stream().noneMatch(s -> s.getValue(FACING) == face));
    });
    // Populate all directions
    for (Direction d : directions) {
        TileEntity tileEntity = world.getBlockEntity(pos.relative(d));
        BlockState dirState = world.getBlockState(pos.relative(d));
        BlockPos dirPos = pos.relative(d);
        boolean join = false;
        // If Air look for a change in Direction
        if (world.getBlockState(pos.relative(d)).getBlock() == Blocks.AIR) {
            dirState = world.getBlockState(pos.relative(d).relative(face.getOpposite()));
            dirPos = pos.relative(d).relative(face.getOpposite());
            if (dirState.getBlock() == this && dirState.getValue(FACING) == d) {
                tileEntity = world.getBlockEntity(pos.relative(d).relative(face.getOpposite()));
                join = true;
            } else if (dirState.getBlock() instanceof BlockBPMultipart) {
                tileEntity = world.getBlockEntity(pos.relative(d).relative(face.getOpposite()));
                if (tileEntity instanceof TileBPMultipart && ((TileBPMultipart) tileEntity).getStates().stream().filter(s -> s.getBlock() == this).anyMatch(s -> s.getValue(FACING) == d)) {
                    join = true;
                } else {
                    tileEntity = null;
                }
            }
        }
        // Check Capability for Direction
        switch(state.getValue(FACING)) {
            case UP:
            case DOWN:
                switch(d) {
                    case EAST:
                        connected_right = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_right = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case WEST:
                        connected_left = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_left = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case NORTH:
                        connected_front = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_front = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case SOUTH:
                        connected_back = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_back = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                }
                break;
            case NORTH:
                switch(d) {
                    case WEST:
                        connected_right = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_right = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case EAST:
                        connected_left = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_left = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case UP:
                        connected_front = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_front = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case DOWN:
                        connected_back = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_back = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                }
                break;
            case SOUTH:
                switch(d) {
                    case EAST:
                        connected_right = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_right = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case WEST:
                        connected_left = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_left = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case UP:
                        connected_front = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_front = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case DOWN:
                        connected_back = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_back = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                }
                break;
            case EAST:
                switch(d) {
                    case NORTH:
                        connected_right = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_right = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case SOUTH:
                        connected_left = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_left = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case UP:
                        connected_front = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_front = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case DOWN:
                        connected_back = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_back = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                }
                break;
            case WEST:
                switch(d) {
                    case SOUTH:
                        connected_right = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_right = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case NORTH:
                        connected_left = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_left = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case UP:
                        connected_front = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_front = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                    case DOWN:
                        connected_back = canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        join_back = join && canConnect(world, dirPos, dirState, tileEntity, d.getOpposite());
                        break;
                }
        }
    }
    if (internal != null)
        for (Direction d : internal) {
            switch(state.getValue(FACING)) {
                case UP:
                case DOWN:
                    switch(d) {
                        case EAST:
                            connected_left = true;
                            break;
                        case WEST:
                            connected_right = true;
                            break;
                        case NORTH:
                            connected_back = true;
                            break;
                        case SOUTH:
                            connected_front = true;
                            break;
                    }
                    break;
                case NORTH:
                    switch(d) {
                        case WEST:
                            connected_left = true;
                            break;
                        case EAST:
                            connected_right = true;
                            break;
                        case UP:
                            connected_back = true;
                            break;
                        case DOWN:
                            connected_front = true;
                            break;
                    }
                    break;
                case SOUTH:
                    switch(d) {
                        case EAST:
                            connected_left = true;
                            break;
                        case WEST:
                            connected_right = true;
                            break;
                        case UP:
                            connected_back = true;
                            break;
                        case DOWN:
                            connected_front = true;
                            break;
                    }
                    break;
                case EAST:
                    switch(d) {
                        case NORTH:
                            connected_left = true;
                            break;
                        case SOUTH:
                            connected_right = true;
                            break;
                        case UP:
                            connected_back = true;
                            break;
                        case DOWN:
                            connected_front = true;
                            break;
                    }
                    break;
                case WEST:
                    switch(d) {
                        case SOUTH:
                            connected_left = true;
                            break;
                        case NORTH:
                            connected_right = true;
                            break;
                        case UP:
                            connected_back = true;
                            break;
                        case DOWN:
                            connected_front = true;
                            break;
                    }
            }
        }
    FluidState fluidstate = world.getFluidState(pos);
    return state.setValue(CONNECTED_LEFT, connected_left).setValue(CONNECTED_RIGHT, connected_right).setValue(CONNECTED_FRONT, connected_front).setValue(CONNECTED_BACK, connected_back).setValue(JOIN_LEFT, join_left).setValue(JOIN_RIGHT, join_right).setValue(JOIN_FRONT, join_front).setValue(JOIN_BACK, join_back).setValue(WATERLOGGED, fluidstate.getType() == Fluids.WATER);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) FluidState(net.minecraft.fluid.FluidState) IWorld(net.minecraft.world.IWorld) Direction(net.minecraft.util.Direction) IWorldReader(net.minecraft.world.IWorldReader) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) StateContainer(net.minecraft.state.StateContainer) IBlockReader(net.minecraft.world.IBlockReader) net.minecraft.block(net.minecraft.block) ISelectionContext(net.minecraft.util.math.shapes.ISelectionContext) VoxelShape(net.minecraft.util.math.shapes.VoxelShape) Nullable(javax.annotation.Nullable) Fluids(net.minecraft.fluid.Fluids) BooleanProperty(net.minecraft.state.BooleanProperty) LivingEntity(net.minecraft.entity.LivingEntity) World(net.minecraft.world.World) BlockPos(net.minecraft.util.math.BlockPos) BlockItemUseContext(net.minecraft.item.BlockItemUseContext) Collectors(java.util.stream.Collectors) TileBPMultipart(com.bluepowermod.tile.TileBPMultipart) Capability(net.minecraftforge.common.capabilities.Capability) AABBUtils(com.bluepowermod.util.AABBUtils) List(java.util.List) IBPPartBlock(com.bluepowermod.api.multipart.IBPPartBlock) Material(net.minecraft.block.material.Material) TileEntity(net.minecraft.tileentity.TileEntity) VoxelShapes(net.minecraft.util.math.shapes.VoxelShapes) DirectionProperty(net.minecraft.state.DirectionProperty) BlockStateProperties(net.minecraft.state.properties.BlockStateProperties) ArrayList(java.util.ArrayList) BlockPos(net.minecraft.util.math.BlockPos) TileBPMultipart(com.bluepowermod.tile.TileBPMultipart) Direction(net.minecraft.util.Direction) FluidState(net.minecraft.fluid.FluidState)

Aggregations

Capability (net.minecraftforge.common.capabilities.Capability)16 EnumFacing (net.minecraft.util.EnumFacing)9 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)7 NBTBase (net.minecraft.nbt.NBTBase)6 Nonnull (javax.annotation.Nonnull)5 Nullable (javax.annotation.Nullable)5 ItemStack (net.minecraft.item.ItemStack)4 TileEntity (net.minecraft.tileentity.TileEntity)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Block (net.minecraft.block.Block)3 BlockPos (net.minecraft.util.math.BlockPos)3 World (net.minecraft.world.World)3 ICapabilityProvider (net.minecraftforge.common.capabilities.ICapabilityProvider)3 Collectors (java.util.stream.Collectors)2 IBlockState (net.minecraft.block.state.IBlockState)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 Direction (net.minecraft.util.Direction)2 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)2 IBPPartBlock (com.bluepowermod.api.multipart.IBPPartBlock)1