use of net.minecraft.nbt.NbtList in project meteor-client by MeteorDevelopment.
the class Marker method toTag.
@Override
public NbtCompound toTag() {
NbtCompound tag = super.toTag();
NbtList list = new NbtList();
for (BaseMarker marker : markers) {
NbtCompound mTag = new NbtCompound();
mTag.putString("type", marker.getTypeName());
mTag.put("marker", marker.toTag());
list.add(mTag);
}
tag.put("markers", list);
return tag;
}
use of net.minecraft.nbt.NbtList in project meteor-client by MeteorDevelopment.
the class Marker method fromTag.
@Override
public Module fromTag(NbtCompound tag) {
super.fromTag(tag);
markers.clear();
NbtList list = tag.getList("markers", 10);
for (NbtElement tagII : list) {
NbtCompound tagI = (NbtCompound) tagII;
String type = tagI.getString("type");
BaseMarker marker = factory.createMarker(type);
if (marker != null) {
NbtCompound markerTag = (NbtCompound) tagI.get("marker");
if (markerTag != null)
marker.fromTag(markerTag);
markers.add(marker);
}
}
return this;
}
use of net.minecraft.nbt.NbtList in project meteor-client by MeteorDevelopment.
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.NbtList in project meteor-client by MeteorDevelopment.
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;
}
use of net.minecraft.nbt.NbtList in project meteor-client by MeteorDevelopment.
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