use of com.nukkitx.nbt.NbtMapBuilder in project JukeboxMC by LucGamesYT.
the class BlockEntitySign method toCompound.
@Override
public NbtMapBuilder toCompound() {
NbtMapBuilder compound = super.toCompound();
compound.putString("Text", Joiner.on("\n").skipNulls().join(this.lines));
return compound;
}
use of com.nukkitx.nbt.NbtMapBuilder in project JukeboxMC by LucGamesYT.
the class BlockEntitySkull method toCompound.
@Override
public NbtMapBuilder toCompound() {
NbtMapBuilder nbtMapBuilder = super.toCompound();
nbtMapBuilder.putByte("SkullType", this.skullMeta);
nbtMapBuilder.putByte("Rot", this.rotation);
return nbtMapBuilder;
}
use of com.nukkitx.nbt.NbtMapBuilder in project JukeboxMC by LucGamesYT.
the class BlockEntityShulkerBox method toCompound.
@Override
public NbtMapBuilder toCompound() {
NbtMapBuilder builder = super.toCompound();
List<NbtMap> itemsCompoundList = new ArrayList<>();
for (int slot = 0; slot < this.shulkerBoxInventory.getSize(); slot++) {
NbtMapBuilder itemCompound = NbtMap.builder();
Item item = this.shulkerBoxInventory.getItem(slot);
itemCompound.putByte("Slot", (byte) slot);
this.fromItem(item, itemCompound);
itemsCompoundList.add(itemCompound.build());
}
builder.putList("Items", NbtType.COMPOUND, itemsCompoundList);
builder.putByte("facing", this.facing);
builder.putBoolean("isUndyed", this.undyed);
return builder;
}
use of com.nukkitx.nbt.NbtMapBuilder in project JukeboxMC by LucGamesYT.
the class BlockEntityBanner method toCompound.
@Override
public NbtMapBuilder toCompound() {
NbtMapBuilder compound = super.toCompound();
compound.putInt("Base", this.baseColor);
compound.putInt("Type", this.type);
if (this.patterns.size() > 0) {
List<NbtMap> pattern = new ArrayList<>();
for (Map.Entry<String, Integer> entry : this.patterns.entrySet()) {
NbtMapBuilder patternBuilder = NbtMap.builder();
patternBuilder.putString("Pattern", entry.getKey());
patternBuilder.putInt("Color", entry.getValue());
pattern.add(patternBuilder.build());
}
compound.putList("Patterns", NbtType.COMPOUND, pattern);
}
return compound;
}
use of com.nukkitx.nbt.NbtMapBuilder in project JukeboxMC by LucGamesYT.
the class BlockEntityBarrel method toCompound.
@Override
public NbtMapBuilder toCompound() {
NbtMapBuilder builder = super.toCompound();
List<NbtMap> itemsCompoundList = new ArrayList<>();
for (int slot = 0; slot < this.barrelInventory.getSize(); slot++) {
NbtMapBuilder itemCompound = NbtMap.builder();
Item item = this.barrelInventory.getItem(slot);
itemCompound.putByte("Slot", (byte) slot);
this.fromItem(item, itemCompound);
itemsCompoundList.add(itemCompound.build());
}
builder.putList("Items", NbtType.COMPOUND, itemsCompoundList);
return builder;
}
Aggregations