Search in sources :

Example 1 with IItemProvider

use of net.minecraft.util.IItemProvider in project BluePower by Qmunity.

the class TileItemDetector method load.

/**
 * This function gets called whenever the world/chunk loads
 */
@Override
public void load(BlockState blockState, CompoundNBT tCompound) {
    super.load(blockState, tCompound);
    for (int i = 0; i < 9; i++) {
        CompoundNBT tc = tCompound.getCompound("inventory" + i);
        inventory.set(i, new ItemStack((IItemProvider) tc));
    }
    mode = tCompound.getByte("mode");
    fuzzySetting = tCompound.getByte("fuzzySetting");
    savedPulses = tCompound.getInt("savedPulses");
}
Also used : CompoundNBT(net.minecraft.nbt.CompoundNBT) ItemStack(net.minecraft.item.ItemStack) IItemProvider(net.minecraft.util.IItemProvider)

Example 2 with IItemProvider

use of net.minecraft.util.IItemProvider in project BluePower by Qmunity.

the class TileRelay method load.

/**
 * This function gets called whenever the world/chunk loads
 */
@Override
public void load(BlockState blockState, CompoundNBT tCompound) {
    super.load(blockState, tCompound);
    for (int i = 0; i < 9; i++) {
        CompoundNBT tc = tCompound.getCompound("inventory" + i);
        inventory.set(i, new ItemStack((IItemProvider) tc));
    }
}
Also used : CompoundNBT(net.minecraft.nbt.CompoundNBT) ItemStack(net.minecraft.item.ItemStack) IItemProvider(net.minecraft.util.IItemProvider)

Example 3 with IItemProvider

use of net.minecraft.util.IItemProvider in project BluePower by Qmunity.

the class TileFilter method load.

/**
 * This function gets called whenever the world/chunk loads
 */
@Override
public void load(BlockState blockState, CompoundNBT tCompound) {
    super.load(blockState, tCompound);
    for (int i = 0; i < 9; i++) {
        CompoundNBT tc = tCompound.getCompound("inventory" + i);
        inventory.set(i, new ItemStack((IItemProvider) tc));
    }
    filterColor = TubeColor.values()[tCompound.getByte("filterColor")];
    fuzzySetting = tCompound.getByte("fuzzySetting");
}
Also used : CompoundNBT(net.minecraft.nbt.CompoundNBT) ItemStack(net.minecraft.item.ItemStack) IItemProvider(net.minecraft.util.IItemProvider)

Example 4 with IItemProvider

use of net.minecraft.util.IItemProvider in project BluePower by Qmunity.

the class TileEjector method load.

/**
 * This function gets called whenever the world/chunk loads
 */
@Override
public void load(BlockState blockState, CompoundNBT tCompound) {
    super.load(blockState, tCompound);
    for (int i = 0; i < 9; i++) {
        CompoundNBT tc = tCompound.getCompound("inventory" + i);
        inventory.set(i, new ItemStack((IItemProvider) tc));
    }
}
Also used : CompoundNBT(net.minecraft.nbt.CompoundNBT) ItemStack(net.minecraft.item.ItemStack) IItemProvider(net.minecraft.util.IItemProvider)

Aggregations

ItemStack (net.minecraft.item.ItemStack)4 CompoundNBT (net.minecraft.nbt.CompoundNBT)4 IItemProvider (net.minecraft.util.IItemProvider)4