use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileMachineBase method load.
@Override
public void load(BlockState state, CompoundNBT compound) {
super.load(state, compound);
ListNBT nbttaglist = compound.getList("ItemBuffer", 10);
for (int i = 0; i < nbttaglist.size(); ++i) {
CompoundNBT nbttagcompound1 = nbttaglist.getCompound(i);
internalItemStackBuffer.add(TubeStack.loadFromNBT(nbttagcompound1));
}
}
use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileMachineBase method save.
@Override
public CompoundNBT save(CompoundNBT compound) {
super.save(compound);
ListNBT nbttaglist = new ListNBT();
for (TubeStack tubeStack : internalItemStackBuffer) {
if (tubeStack != null) {
CompoundNBT nbttagcompound1 = new CompoundNBT();
tubeStack.writeToNBT(nbttagcompound1);
nbttaglist.add(nbttagcompound1);
}
}
compound.put("ItemBuffer", nbttaglist);
return compound;
}
use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileDeployer method save.
/**
* This function gets called whenever the world/chunk is saved
*/
@Override
public CompoundNBT save(CompoundNBT tCompound) {
super.save(tCompound);
for (int i = 0; i < 9; i++) {
CompoundNBT tc = new CompoundNBT();
inventory.get(i).save(tc);
tCompound.put("inventory" + i, tc);
}
return tCompound;
}
use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileDeployer 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, ItemStack.of(tc));
}
}
use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileManager 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 < 24; i++) {
CompoundNBT tc = tCompound.getCompound("inventory" + i);
inventory.set(i, ItemStack.of(tc));
}
filterColor = TubeColor.values()[tCompound.getByte("filterColor")];
mode = tCompound.getByte("mode");
priority = tCompound.getByte("priority");
fuzzySetting = tCompound.getByte("fuzzySetting");
}
Aggregations