Search in sources :

Example 1 with IHyperType

use of com.cjm721.overloaded.storage.IHyperType in project Overloaded by CJ-MC-Mods.

the class AbstractBlockInfiniteContainer method getDrops.

@Override
@Nonnull
public final List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
    IHyperType stack = getHyperStack(world, pos);
    if (stack != null && stack.getAmount() != 0) {
        ItemStack toDrop = new ItemStack(this, 1);
        NBTTagCompound compound = new NBTTagCompound();
        world.getTileEntity(pos).writeToNBT(compound);
        toDrop.setTagCompound(compound);
        return Collections.singletonList(toDrop);
    }
    return super.getDrops(world, pos, state, fortune);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack) IHyperType(com.cjm721.overloaded.storage.IHyperType) Nonnull(javax.annotation.Nonnull)

Aggregations

IHyperType (com.cjm721.overloaded.storage.IHyperType)1 Nonnull (javax.annotation.Nonnull)1 ItemStack (net.minecraft.item.ItemStack)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1