use of net.minecraft.nbt.NbtList in project Client by MatHax.
the class SettingGroup method toTag.
@Override
public NbtCompound toTag() {
NbtCompound tag = new NbtCompound();
tag.putString("name", name);
tag.putBoolean("sectionExpanded", sectionExpanded);
NbtList settingsTag = new NbtList();
for (Setting<?> setting : this) if (setting.wasChanged())
settingsTag.add(setting.toTag());
tag.put("settings", settingsTag);
return tag;
}
use of net.minecraft.nbt.NbtList in project Client by MatHax.
the class Settings method fromTag.
@Override
public Settings fromTag(NbtCompound tag) {
NbtList groupsTag = tag.getList("groups", 10);
for (NbtElement t : groupsTag) {
NbtCompound groupTag = (NbtCompound) t;
SettingGroup sg = getGroup(groupTag.getString("name"));
if (sg != null)
sg.fromTag(groupTag);
}
return this;
}
use of net.minecraft.nbt.NbtList in project Client by MatHax.
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 Client by MatHax.
the class Marker method fromTag.
@Override
public Module fromTag(NbtCompound 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 Client by MatHax.
the class Profile method fromTag.
@Override
public Profile fromTag(NbtCompound tag) {
name = tag.getString("name");
accounts = tag.contains("accounts") && tag.getBoolean("accounts");
config = tag.contains("config") && tag.getBoolean("config");
friends = tag.contains("friends") && tag.getBoolean("friends");
macros = tag.contains("macros") && tag.getBoolean("macros");
modules = tag.contains("modules") && tag.getBoolean("modules");
waypoints = tag.contains("waypoints") && tag.getBoolean("waypoints");
hud = tag.contains("hud") && tag.getBoolean("hud");
onLaunch = tag.contains("onLaunch") && tag.getBoolean("onLaunch");
saveOnLeave = tag.contains("saveOnLeave") && tag.getBoolean("saveOnLeave");
saveOnInterval = tag.contains("saveOnInterval") && tag.getBoolean("saveOnInterval");
saveInterval = tag.contains("saveInterval") ? tag.getInt("saveInterval") : 60;
loadOnJoinIps.clear();
if (tag.contains("loadOnJoinIps")) {
NbtList ipsTag = tag.getList("loadOnJoinIps", 8);
for (NbtElement ip : ipsTag) loadOnJoinIps.add(ip.asString());
}
return this;
}
Aggregations