use of net.minecraft.nbt.NbtElement in project UniversalGraves by Patbox.
the class GraveManager method fromNbt.
public static PersistentState fromNbt(NbtCompound nbt) {
GraveManager manager = new GraveManager();
NbtList graves = nbt.getList("Graves", NbtElement.COMPOUND_TYPE);
for (NbtElement graveNbt : graves) {
GraveInfo graveInfo = new GraveInfo();
graveInfo.readNbt((NbtCompound) graveNbt);
if (!graveInfo.shouldBreak()) {
manager.add(graveInfo);
}
}
return manager;
}
use of net.minecraft.nbt.NbtElement in project Client by MatHax.
the class SettingGroup method fromTag.
@Override
public SettingGroup fromTag(NbtCompound tag) {
sectionExpanded = tag.getBoolean("sectionExpanded");
NbtList settingsTag = tag.getList("settings", 10);
for (NbtElement t : settingsTag) {
NbtCompound settingTag = (NbtCompound) t;
Setting<?> setting = get(settingTag.getString("name"));
if (setting != null)
setting.fromTag(settingTag);
}
return this;
}
use of net.minecraft.nbt.NbtElement in project Client by MatHax.
the class SoundEventListSetting method load.
@Override
public List<SoundEvent> load(NbtCompound tag) {
get().clear();
NbtList valueTag = tag.getList("value", 8);
for (NbtElement tagI : valueTag) {
SoundEvent soundEvent = Registry.SOUND_EVENT.get(new Identifier(tagI.asString()));
if (soundEvent != null)
get().add(soundEvent);
}
return get();
}
use of net.minecraft.nbt.NbtElement in project Client by MatHax.
the class BlockListSetting method load.
@Override
protected List<Block> load(NbtCompound tag) {
get().clear();
NbtList valueTag = tag.getList("value", 8);
for (NbtElement tagI : valueTag) {
Block block = Registry.BLOCK.get(new Identifier(tagI.asString()));
if (filter == null || filter.test(block))
get().add(block);
}
return get();
}
use of net.minecraft.nbt.NbtElement in project Client by MatHax.
the class ModuleListSetting method load.
@Override
public List<Module> load(NbtCompound tag) {
get().clear();
NbtList valueTag = tag.getList("modules", 8);
for (NbtElement tagI : valueTag) {
Module module = Modules.get().get(tagI.asString());
if (module != null)
get().add(module);
}
return get();
}
Aggregations