use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileBPMicroblock method getUpdatePacket.
@Override
public SUpdateTileEntityPacket getUpdatePacket() {
CompoundNBT nbtTag = new CompoundNBT();
save(nbtTag);
return new SUpdateTileEntityPacket(getBlockPos(), 1, nbtTag);
}
use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileAlloyFurnace method load.
/**
************* BASIC TE FUNCTIONS *************
*/
/**
* 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));
}
fuelInventory = ItemStack.of(tCompound.getCompound("fuelInventory"));
outputInventory = ItemStack.of(tCompound.getCompound("outputInventory"));
}
use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileBuffer 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 < 20; i++) {
CompoundNBT tc = new CompoundNBT();
allInventories.get(i).save(tc);
tCompound.put("inventory" + i, tc);
}
return tCompound;
}
use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileBuffer 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 < 20; i++) {
CompoundNBT tc = tCompound.getCompound("inventory" + i);
allInventories.set(i, ItemStack.of(tc));
}
}
use of net.minecraft.nbt.CompoundNBT in project BluePower by Qmunity.
the class TileEjector 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;
}
Aggregations