use of net.minecraft.nbt.NbtList in project bewitchment by MoriyaShiine.
the class DemonEntity method readCustomDataFromNbt.
@Override
public void readCustomDataFromNbt(NbtCompound nbt) {
super.readCustomDataFromNbt(nbt);
dataTracker.set(MALE, nbt.getBoolean("Male"));
if (nbt.contains("Offers")) {
offers.clear();
NbtList offersList = nbt.getList("Offers", NbtType.COMPOUND);
for (NbtElement offerTag : offersList) {
offers.add(new DemonTradeOffer((NbtCompound) offerTag));
}
}
tradeResetTimer = nbt.getInt("TradeResetTimer");
}
use of net.minecraft.nbt.NbtList in project bewitchment by MoriyaShiine.
the class CursesComponent method toNbtCurse.
@SuppressWarnings("ConstantConditions")
public NbtList toNbtCurse() {
NbtList cursesList = new NbtList();
for (Curse.Instance instance : getCurses()) {
NbtCompound curseCompound = new NbtCompound();
curseCompound.putString("Curse", BWRegistries.CURSES.getId(instance.curse).toString());
curseCompound.putInt("Duration", instance.duration);
cursesList.add(curseCompound);
}
return cursesList;
}
use of net.minecraft.nbt.NbtList in project EdenClient by HahaOO7.
the class ChestShopLoader method save.
public NbtList save(Object value) {
ChestShopMap map = cast(value);
NbtList list = new NbtList();
map.values().stream().flatMap(Collection::stream).map(ChestShopEntry::toTag).forEach(list::add);
return list;
}
use of net.minecraft.nbt.NbtList in project EdenClient by HahaOO7.
the class ItemListLoader method save.
public NbtList save(Object value) {
ItemList list = cast(value);
NbtList tag = new NbtList();
list.forEach(item -> tag.add(PerWorldConfig.get().toNbt(item)));
return tag;
}
use of net.minecraft.nbt.NbtList in project EdenClient by HahaOO7.
the class BlockEntityTypeSetLoader method save.
public NbtList save(Object value) {
BlockEntityTypeSet list = cast(value);
NbtList nbt = new NbtList();
for (BlockEntityType<?> item : list) {
nbt.add(PerWorldConfig.get().toNbt(item));
}
return nbt;
}
Aggregations