Search in sources :

Example 21 with NNList

use of com.enderio.core.common.util.NNList in project EnderIO by SleepyTrousers.

the class BlockPaintedPressurePlate method getSubItems.

@Override
@Nonnull
public NNList<ItemStack> getSubItems() {
    NNList<ItemStack> list = new NNList<>();
    for (EnumPressurePlateType type : EnumPressurePlateType.values()) {
        list.add(new ItemStack(this, 1, EnumPressurePlateType.getMetaFromType(type, false)));
        list.add(new ItemStack(this, 1, EnumPressurePlateType.getMetaFromType(type, true)));
    }
    return list;
}
Also used : NNList(com.enderio.core.common.util.NNList) ItemStack(net.minecraft.item.ItemStack) Nonnull(javax.annotation.Nonnull)

Example 22 with NNList

use of com.enderio.core.common.util.NNList in project EnderIO by SleepyTrousers.

the class BlockPaintedRedstone method getDrops.

@Override
public void getDrops(@Nonnull NonNullList<ItemStack> drops, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull IBlockState state, int fortune) {
    NNList<ItemStack> drops2 = new NNList<>();
    super.getDrops(drops2, world, pos, state, fortune);
    for (ItemStack drop : drops2) {
        PaintUtil.setSourceBlock(NullHelper.notnullM(drop, "null stack from getDrops()"), getPaintSource(state, world, pos));
    }
    drops.addAll(drops2);
}
Also used : NNList(com.enderio.core.common.util.NNList) ItemStack(net.minecraft.item.ItemStack)

Example 23 with NNList

use of com.enderio.core.common.util.NNList in project EnderIO by SleepyTrousers.

the class BlockPaintedSlab method getDrops.

@Override
public void getDrops(@Nonnull NonNullList<ItemStack> drops, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull IBlockState state, int fortune) {
    NNList<ItemStack> drops2 = new NNList<>();
    super.getDrops(drops2, world, pos, state, fortune);
    boolean first = true;
    for (ItemStack drop : drops2) {
        if (first || !isDouble()) {
            PaintUtil.setSourceBlock(NullHelper.notnullM(drop, "null stack from getDrops()"), getPaintSource(state, world, pos));
            first = false;
        } else {
            PaintUtil.setSourceBlock(NullHelper.notnullM(drop, "null stack from getDrops()"), getPaintSource2(state, world, pos));
        }
    }
    drops.addAll(drops2);
}
Also used : NNList(com.enderio.core.common.util.NNList) ItemStack(net.minecraft.item.ItemStack)

Example 24 with NNList

use of com.enderio.core.common.util.NNList in project EnderIO by SleepyTrousers.

the class BlockPaintedTrapDoor method getDrops.

@Override
public void getDrops(@Nonnull NonNullList<ItemStack> drops, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull IBlockState state, int fortune) {
    NNList<ItemStack> drops2 = new NNList<>();
    super.getDrops(drops2, world, pos, state, fortune);
    for (ItemStack drop : drops2) {
        PaintUtil.setSourceBlock(NullHelper.notnullM(drop, "null stack from getDrops()"), getPaintSource(state, world, pos));
    }
    drops.addAll(drops2);
}
Also used : NNList(com.enderio.core.common.util.NNList) ItemStack(net.minecraft.item.ItemStack)

Example 25 with NNList

use of com.enderio.core.common.util.NNList in project EnderIO by SleepyTrousers.

the class BlockPaintedWall method getDrops.

@Override
public void getDrops(@Nonnull NonNullList<ItemStack> drops, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull IBlockState state, int fortune) {
    NNList<ItemStack> drops2 = new NNList<>();
    super.getDrops(drops2, world, pos, state, fortune);
    for (ItemStack drop : drops2) {
        PaintUtil.setSourceBlock(NullHelper.notnullM(drop, "null stack from getDrops()"), getPaintSource(state, world, pos));
    }
    drops.addAll(drops2);
}
Also used : NNList(com.enderio.core.common.util.NNList) ItemStack(net.minecraft.item.ItemStack)

Aggregations

NNList (com.enderio.core.common.util.NNList)53 ItemStack (net.minecraft.item.ItemStack)37 Nonnull (javax.annotation.Nonnull)12 BlockPos (net.minecraft.util.math.BlockPos)8 EntityItem (net.minecraft.entity.item.EntityItem)7 MachineRecipeInput (crazypants.enderio.base.recipe.MachineRecipeInput)5 Block (net.minecraft.block.Block)5 IBlockState (net.minecraft.block.state.IBlockState)5 IHarvestResult (crazypants.enderio.api.farm.IHarvestResult)4 ArrayList (java.util.ArrayList)4 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)4 GhostBackgroundItemSlot (com.enderio.core.client.gui.widget.GhostBackgroundItemSlot)3 Recipe (crazypants.enderio.base.recipe.Recipe)3 RecipeOutput (crazypants.enderio.base.recipe.RecipeOutput)3 ThingsRecipeInput (crazypants.enderio.base.recipe.ThingsRecipeInput)3 World (net.minecraft.world.World)3 Triple (org.apache.commons.lang3.tuple.Triple)3 IConduitBundle (crazypants.enderio.base.conduit.IConduitBundle)2 RaytraceResult (crazypants.enderio.base.conduit.RaytraceResult)2 IMachineRecipe (crazypants.enderio.base.recipe.IMachineRecipe)2