use of net.minecraft.nbt.NbtList in project Client by MatHax.
the class StorageBlockListSetting method load.
@Override
public List<BlockEntityType<?>> load(NbtCompound tag) {
get().clear();
NbtList valueTag = tag.getList("value", 8);
for (NbtElement tagI : valueTag) {
BlockEntityType<?> type = Registry.BLOCK_ENTITY_TYPE.get(new Identifier(tagI.asString()));
if (type != null)
get().add(type);
}
return get();
}
use of net.minecraft.nbt.NbtList in project Client by MatHax.
the class StringListSetting method load.
@Override
public List<String> load(NbtCompound tag) {
get().clear();
NbtList valueTag = tag.getList("value", 8);
for (NbtElement tagI : valueTag) {
get().add(tagI.asString());
}
return get();
}
use of net.minecraft.nbt.NbtList in project Client by MatHax.
the class ItemListSetting method save.
@Override
public NbtCompound save(NbtCompound tag) {
NbtList valueTag = new NbtList();
for (Item item : get()) {
if (bypassFilterWhenSavingAndLoading || (filter == null || filter.test(item)))
valueTag.add(NbtString.of(Registry.ITEM.getId(item).toString()));
}
tag.put("value", valueTag);
return tag;
}
use of net.minecraft.nbt.NbtList in project Client by MatHax.
the class ItemListSetting method load.
@Override
public List<Item> load(NbtCompound tag) {
get().clear();
NbtList valueTag = tag.getList("value", 8);
for (NbtElement tagI : valueTag) {
Item item = Registry.ITEM.get(new Identifier(tagI.asString()));
if (bypassFilterWhenSavingAndLoading || (filter == null || filter.test(item)))
get().add(item);
}
return get();
}
use of net.minecraft.nbt.NbtList in project Client by MatHax.
the class ModuleListSetting method save.
@Override
public NbtCompound save(NbtCompound tag) {
NbtList modulesTag = new NbtList();
for (Module module : get()) modulesTag.add(NbtString.of(module.name));
tag.put("modules", modulesTag);
return tag;
}
Aggregations