mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 20:25:13 +00:00
Add the Essential APIs
This commit is contained in:
1 parent
5e448c3324
commit
0833425d57
93 files changed
+4909
-1523
No files matched your search
@@ -3,7 +3,7 @@ package kamkeel.npcs.controllers.data.ability.data;
|
||||
import kamkeel.npcs.controllers.data.ability.enums.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyAnchorData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyDisplayData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
/**
|
||||
* Per-projectile data: anchor point + optional color override.
|
||||
@@ -35,7 +35,7 @@ public class ProjectileData {
|
||||
return resolved;
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
// OLD: anchor.writeNBT(new NBTWrapper(nbt));
|
||||
anchor.writeNBT(nbt);
|
||||
nbt.setBoolean("colorOverride", colorOverride);
|
||||
@@ -45,7 +45,7 @@ public class ProjectileData {
|
||||
}
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
// OLD: anchor.readNBT(new NBTWrapper(nbt));
|
||||
anchor.readNBT(nbt);
|
||||
colorOverride = nbt.getBoolean("colorOverride");
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.enums.AnchorPoint;
|
||||
import noppes.npcs.api.ability.data.IEnergyAnchorData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
public class EnergyAnchorData implements IEnergyAnchorData {
|
||||
public AnchorPoint anchorPoint = AnchorPoint.FRONT;
|
||||
@@ -94,7 +94,7 @@ public class EnergyAnchorData implements IEnergyAnchorData {
|
||||
this.launchFromAnchor = launchFromAnchor;
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setInteger("anchorPoint", anchorPoint.ordinal());
|
||||
nbt.setFloat("anchorOffsetX", anchorOffsetX);
|
||||
nbt.setFloat("anchorOffsetY", anchorOffsetY);
|
||||
@@ -102,7 +102,7 @@ public class EnergyAnchorData implements IEnergyAnchorData {
|
||||
nbt.setBoolean("launchFromAnchor", launchFromAnchor);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
this.anchorPoint = AnchorPoint.fromOrdinal(nbt.getInteger("anchorPoint"));
|
||||
this.anchorOffsetX = nbt.getFloat("anchorOffsetX");
|
||||
this.anchorOffsetY = nbt.getFloat("anchorOffsetY");
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -165,7 +165,7 @@ public class EnergyBarrierData {
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setFloat("barrierMaxHealth", maxHealth);
|
||||
nbt.setBoolean("barrierUseHealth", useHealth);
|
||||
nbt.setInteger("barrierDuration", durationTicks);
|
||||
@@ -182,14 +182,14 @@ public class EnergyBarrierData {
|
||||
nbt.setFloat("barrierReflectStrPct", reflectStrengthPct);
|
||||
nbt.setBoolean("barrierTargetOwner", targetOwner);
|
||||
|
||||
INBTCompound multNbt = NBT.compound();
|
||||
INbt multNbt = NBT.compound();
|
||||
for (Map.Entry<String, Float> entry : damageMultipliers.entrySet()) {
|
||||
multNbt.setFloat(entry.getKey(), entry.getValue());
|
||||
}
|
||||
nbt.setCompound("barrierMultipliers", multNbt);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
maxHealth = nbt.hasKey("barrierMaxHealth") ? nbt.getFloat("barrierMaxHealth") : 100.0f;
|
||||
useHealth = !nbt.hasKey("barrierUseHealth") || nbt.getBoolean("barrierUseHealth");
|
||||
durationTicks = nbt.hasKey("barrierDuration") ? nbt.getInteger("barrierDuration") : 200;
|
||||
@@ -208,7 +208,7 @@ public class EnergyBarrierData {
|
||||
|
||||
damageMultipliers.clear();
|
||||
if (nbt.hasKey("barrierMultipliers")) {
|
||||
INBTCompound multNbt = nbt.getCompound("barrierMultipliers");
|
||||
INbt multNbt = nbt.getCompound("barrierMultipliers");
|
||||
Set<String> keys = multNbt.getKeySet();
|
||||
for (String key : keys) {
|
||||
damageMultipliers.put(key, multNbt.getFloat(key));
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
public class EnergyChargingData {
|
||||
|
||||
@@ -61,7 +61,7 @@ public class EnergyChargingData {
|
||||
this.maxCharge = Math.max(0, maxCharge);
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setInteger("chargeDuration", chargeDuration);
|
||||
nbt.setInteger("chargeDelay", chargeDelay);
|
||||
nbt.setInteger("maxCharge", maxCharge);
|
||||
@@ -69,7 +69,7 @@ public class EnergyChargingData {
|
||||
nbt.setBoolean("chargeWindUpSync", chargeWindUpSync);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
chargeDuration = nbt.hasKey("chargeDuration") ? nbt.getInteger("chargeDuration") : 60;
|
||||
chargeDelay = nbt.hasKey("chargeDelay") ? nbt.getInteger("chargeDelay") : 0;
|
||||
maxCharge = nbt.hasKey("maxCharge") ? nbt.getInteger("maxCharge") : 100;
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.enums.HitType;
|
||||
import noppes.npcs.api.ability.data.IEnergyCombatData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
/**
|
||||
* Groups combat properties shared by energy projectile abilities.
|
||||
@@ -124,7 +124,7 @@ public class EnergyCombatData implements IEnergyCombatData {
|
||||
this.maxHits = clampMaxHits(maxHits);
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setFloat("damage", damage);
|
||||
nbt.setFloat("knockback", knockback);
|
||||
nbt.setFloat("knockbackUp", knockbackUp);
|
||||
@@ -136,7 +136,7 @@ public class EnergyCombatData implements IEnergyCombatData {
|
||||
nbt.setInteger("maxHits", maxHits);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 7.0f;
|
||||
knockback = nbt.hasKey("knockback") ? nbt.getFloat("knockback") : 1.0f;
|
||||
knockbackUp = nbt.hasKey("knockbackUp") ? nbt.getFloat("knockbackUp") : 0.1f;
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import noppes.npcs.api.ability.data.IEnergyDisplayData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
/**
|
||||
* Groups visual color properties shared by all energy abilities.
|
||||
@@ -110,7 +110,7 @@ public class EnergyDisplayData implements IEnergyDisplayData {
|
||||
this.rotationSpeed = rotationSpeed;
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setInteger("innerColor", innerColor);
|
||||
nbt.setInteger("outerColor", outerColor);
|
||||
nbt.setBoolean("outerColorEnabled", outerColorEnabled);
|
||||
@@ -120,7 +120,7 @@ public class EnergyDisplayData implements IEnergyDisplayData {
|
||||
nbt.setFloat("rotationSpeed", rotationSpeed);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
innerColor = nbt.hasKey("innerColor") ? nbt.getInteger("innerColor") : 0xFFFFFF;
|
||||
outerColor = nbt.hasKey("outerColor") ? nbt.getInteger("outerColor") : 0x8888FF;
|
||||
outerColorEnabled = !nbt.hasKey("outerColorEnabled") || nbt.getBoolean("outerColorEnabled");
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import noppes.npcs.api.ability.data.IEnergyHomingData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
/**
|
||||
* Groups homing/movement properties for energy projectile abilities.
|
||||
@@ -63,14 +63,14 @@ public class EnergyHomingData implements IEnergyHomingData {
|
||||
this.homingRange = homingRange;
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setFloat("speed", speed);
|
||||
nbt.setBoolean("homing", homing);
|
||||
nbt.setFloat("homingStrength", homingStrength);
|
||||
nbt.setFloat("homingRange", homingRange);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
speed = nbt.hasKey("speed") ? nbt.getFloat("speed") : 0.5f;
|
||||
homing = !nbt.hasKey("homing") || nbt.getBoolean("homing");
|
||||
homingStrength = nbt.hasKey("homingStrength") ? nbt.getFloat("homingStrength") : 0.15f;
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import noppes.npcs.api.ability.data.IEnergyLifespanData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
/**
|
||||
* Groups lifespan/range properties for energy projectile abilities.
|
||||
@@ -39,12 +39,12 @@ public class EnergyLifespanData implements IEnergyLifespanData {
|
||||
this.maxLifetime = maxLifetime <= 0 ? 200 : maxLifetime;
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setFloat("maxDistance", maxDistance);
|
||||
nbt.setInteger("maxLifetime", maxLifetime);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
maxDistance = nbt.getFloat("maxDistance");
|
||||
maxLifetime = nbt.getInteger("maxLifetime");
|
||||
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import noppes.npcs.api.ability.data.IEnergyLightningData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
/**
|
||||
* Groups lightning visual effect properties for energy abilities.
|
||||
@@ -64,14 +64,14 @@ public class EnergyLightningData implements IEnergyLightningData {
|
||||
this.lightningFadeTime = Math.max(1, lightningFadeTime);
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setBoolean("lightningEffect", lightningEffect);
|
||||
nbt.setFloat("lightningDensity", lightningDensity);
|
||||
nbt.setFloat("lightningRadius", lightningRadius);
|
||||
nbt.setInteger("lightningFadeTime", lightningFadeTime);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
lightningEffect = nbt.hasKey("lightningEffect") && nbt.getBoolean("lightningEffect");
|
||||
lightningDensity = nbt.hasKey("lightningDensity") ? nbt.getFloat("lightningDensity") : 0.15f;
|
||||
lightningRadius = nbt.hasKey("lightningRadius") ? nbt.getFloat("lightningRadius") : 0.5f;
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package kamkeel.npcs.controllers.data.ability.data.energy;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
/**
|
||||
* Groups panel-specific properties for energy wall/shield abilities.
|
||||
@@ -88,7 +88,7 @@ public class EnergyPanelData {
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
public void writeNBT(INbt nbt) {
|
||||
nbt.setFloat("panelWidth", panelWidth);
|
||||
nbt.setFloat("panelHeight", panelHeight);
|
||||
nbt.setFloat("panelHeightOffset", heightOffset);
|
||||
@@ -100,7 +100,7 @@ public class EnergyPanelData {
|
||||
nbt.setFloat("panelLaunchKnockback", launchKnockback);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
panelWidth = nbt.hasKey("panelWidth") ? nbt.getFloat("panelWidth") : 3.0f;
|
||||
panelHeight = nbt.hasKey("panelHeight") ? nbt.getFloat("panelHeight") : 3.0f;
|
||||
heightOffset = nbt.hasKey("panelHeightOffset") ? nbt.getFloat("panelHeightOffset") : 0.0f;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package kamkeel.npcs.controllers.data.profile;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
public class ProfileInfoEntry {
|
||||
@@ -27,8 +27,8 @@ public class ProfileInfoEntry {
|
||||
this(label, 0xFFFFFF, result, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT() {
|
||||
INBTCompound tag = NBT.compound();
|
||||
public INbt writeToNBT() {
|
||||
INbt tag = NBT.compound();
|
||||
tag.setString("Label", label);
|
||||
tag.setInteger("LabelColor", labelColor);
|
||||
tag.setString("Result", result);
|
||||
@@ -36,7 +36,7 @@ public class ProfileInfoEntry {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public static ProfileInfoEntry readFromNBT(INBTCompound tag) {
|
||||
public static ProfileInfoEntry readFromNBT(INbt tag) {
|
||||
return new ProfileInfoEntry(
|
||||
tag.getString("Label"),
|
||||
tag.getInteger("LabelColor"),
|
||||
|
||||
@@ -2,7 +2,7 @@ package kamkeel.npcs.controllers.data.profile;
|
||||
|
||||
import noppes.npcs.api.handler.data.ISlot;
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -13,14 +13,14 @@ public class Slot implements ISlot {
|
||||
private String name;
|
||||
private long lastLoaded;
|
||||
private boolean temporary;
|
||||
private Map<String, INBTCompound> components = new HashMap<>();
|
||||
private Map<String, INbt> components = new HashMap<>();
|
||||
|
||||
public Slot(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Slot(int id, String name, long lastLoaded, boolean temporary, Map<String, INBTCompound> components) {
|
||||
public Slot(int id, String name, long lastLoaded, boolean temporary, Map<String, INbt> components) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.lastLoaded = lastLoaded;
|
||||
@@ -68,35 +68,35 @@ public class Slot implements ISlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, INBTCompound> getComponents() {
|
||||
public Map<String, INbt> getComponents() {
|
||||
return components;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setComponentData(String key, INBTCompound data) {
|
||||
public void setComponentData(String key, INbt data) {
|
||||
components.put(key, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public INBTCompound getComponentData(String key) {
|
||||
public INbt getComponentData(String key) {
|
||||
return components.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public INBTCompound toNBT() {
|
||||
INBTCompound slotNBT = NBT.compound();
|
||||
public INbt toNBT() {
|
||||
INbt slotNBT = NBT.compound();
|
||||
slotNBT.setString("Name", name);
|
||||
slotNBT.setLong("LastLoaded", lastLoaded);
|
||||
slotNBT.setBoolean("Temporary", temporary);
|
||||
INBTCompound compCompound = NBT.compound();
|
||||
for (Map.Entry<String, INBTCompound> entry : components.entrySet()) {
|
||||
INbt compCompound = NBT.compound();
|
||||
for (Map.Entry<String, INbt> entry : components.entrySet()) {
|
||||
compCompound.setCompound(entry.getKey(), entry.getValue());
|
||||
}
|
||||
slotNBT.setCompound("Components", compCompound);
|
||||
return slotNBT;
|
||||
}
|
||||
|
||||
public static Slot fromNBT(int id, INBTCompound slotNBT) {
|
||||
public static Slot fromNBT(int id, INbt slotNBT) {
|
||||
String name = slotNBT.getString("Name");
|
||||
long lastLoaded = slotNBT.getLong("LastLoaded");
|
||||
boolean temporary = slotNBT.getBoolean("Temporary");
|
||||
@@ -104,7 +104,7 @@ public class Slot implements ISlot {
|
||||
slot.setLastLoaded(lastLoaded);
|
||||
slot.setTemporary(temporary);
|
||||
if (slotNBT.hasKey("Components")) {
|
||||
INBTCompound compCompound = slotNBT.getCompound("Components");
|
||||
INbt compCompound = slotNBT.getCompound("Components");
|
||||
Set<String> keys = compCompound.getKeySet();
|
||||
for (String key : keys) {
|
||||
slot.setComponentData(key, compCompound.getCompound(key));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package kamkeel.npcs.controllers.data.telegraph;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
/**
|
||||
@@ -70,8 +70,8 @@ public class Telegraph {
|
||||
// NBT SERIALIZATION
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
public INBTCompound writeNBT() {
|
||||
INBTCompound nbt = NBT.compound();
|
||||
public INbt writeNBT() {
|
||||
INbt nbt = NBT.compound();
|
||||
nbt.setString("id", id);
|
||||
nbt.setString("type", type.name());
|
||||
nbt.setFloat("radius", radius);
|
||||
@@ -93,7 +93,7 @@ public class Telegraph {
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
public void readNBT(INbt nbt) {
|
||||
this.id = nbt.getString("id");
|
||||
if (nbt.hasKey("type")) {
|
||||
try {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -15,7 +15,7 @@ import java.util.Vector;
|
||||
|
||||
/**
|
||||
* Core NBT serialization utilities for Map/Set/List collections.
|
||||
* Uses INBTCompound/INBTList abstractions.
|
||||
* Uses INbt/INbtList abstractions.
|
||||
*
|
||||
* NOTE: ItemStack-related methods, IScriptUnit methods, and raw NBT type methods
|
||||
* (nbtDoubleList, getIntAt) remain in the mc1710 version only since they require
|
||||
@@ -42,84 +42,84 @@ public class NBTTags {
|
||||
// OLD: nbtItemStackList(HashMap<Integer, ItemStack>) - uses NoppesUtilServer.writeItem()
|
||||
// OLD: nbtItemStackArray(ItemStack[]) - uses NoppesUtilServer.writeItem()
|
||||
|
||||
public static ArrayList<int[]> getIntegerArraySet(INBTList tagList) {
|
||||
public static ArrayList<int[]> getIntegerArraySet(INbtList tagList) {
|
||||
ArrayList<int[]> set = new ArrayList<int[]>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound compound = tagList.getCompound(i);
|
||||
INbt compound = tagList.getCompound(i);
|
||||
set.add(compound.getIntArray("Array"));
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
public static HashMap<Integer, Boolean> getBooleanList(INBTList tagList) {
|
||||
public static HashMap<Integer, Boolean> getBooleanList(INbtList tagList) {
|
||||
HashMap<Integer, Boolean> list = new HashMap<Integer, Boolean>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getInteger("Slot"), nbttagcompound.getBoolean("Boolean"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<Integer, Integer> getIntegerIntegerMap(INBTList tagList) {
|
||||
public static HashMap<Integer, Integer> getIntegerIntegerMap(INbtList tagList) {
|
||||
HashMap<Integer, Integer> list = new HashMap<Integer, Integer>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getInteger("Slot"), nbttagcompound.getInteger("Integer"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<Integer, Float> getIntegerFloatMap(INBTList tagList) {
|
||||
public static HashMap<Integer, Float> getIntegerFloatMap(INbtList tagList) {
|
||||
HashMap<Integer, Float> list = new HashMap<Integer, Float>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getInteger("Slot"), nbttagcompound.getFloat("Float"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<Integer, Double> getIntegerDoubleMap(INBTList tagList) {
|
||||
public static HashMap<Integer, Double> getIntegerDoubleMap(INbtList tagList) {
|
||||
HashMap<Integer, Double> list = new HashMap<Integer, Double>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getInteger("Slot"), nbttagcompound.getDouble("Double"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<Integer, Long> getIntegerLongMap(INBTList tagList) {
|
||||
public static HashMap<Integer, Long> getIntegerLongMap(INbtList tagList) {
|
||||
HashMap<Integer, Long> list = new HashMap<Integer, Long>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getInteger("Slot"), nbttagcompound.getLong("Long"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashSet<String> getStringSet(INBTList tagList) {
|
||||
public static HashSet<String> getStringSet(INbtList tagList) {
|
||||
HashSet<String> list = new HashSet<>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.add(nbttagcompound.getString("String"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<Integer, Byte> getIntegerByteMap(INBTList tagList) {
|
||||
public static HashMap<Integer, Byte> getIntegerByteMap(INbtList tagList) {
|
||||
HashMap<Integer, Byte> list = new HashMap<Integer, Byte>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getInteger("Slot"), nbttagcompound.getByte("Byte"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static INBTList nbtIntegerByteMap(Map<Integer, Byte> lines) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtIntegerByteMap(Map<Integer, Byte> lines) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (lines == null)
|
||||
return nbttaglist;
|
||||
for (int slot : lines.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setByte("Byte", lines.get(slot));
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
@@ -127,79 +127,79 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtStringSet(HashSet<String> collection) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtStringSet(HashSet<String> collection) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (collection == null)
|
||||
return nbttaglist;
|
||||
for (String slot : collection) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setString("String", slot);
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
}
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static HashSet<Integer> getIntegerSet(INBTList tagList) {
|
||||
public static HashSet<Integer> getIntegerSet(INbtList tagList) {
|
||||
HashSet<Integer> list = new HashSet<Integer>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.add(nbttagcompound.getInteger("Integer"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static INBTList nbtIntegerSet(HashSet<Integer> set) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtIntegerSet(HashSet<Integer> set) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (set == null)
|
||||
return nbttaglist;
|
||||
for (int slot : set) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Integer", slot);
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
}
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static HashMap<String, String> getStringStringMap(INBTList tagList) {
|
||||
public static HashMap<String, String> getStringStringMap(INbtList tagList) {
|
||||
HashMap<String, String> list = new HashMap<String, String>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getString("Slot"), nbttagcompound.getString("Value"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<Integer, String> getIntegerStringMap(INBTList tagList) {
|
||||
public static HashMap<Integer, String> getIntegerStringMap(INbtList tagList) {
|
||||
HashMap<Integer, String> list = new HashMap<Integer, String>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getInteger("Slot"), nbttagcompound.getString("Value"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<String, Integer> getStringIntegerMap(INBTList tagList) {
|
||||
public static HashMap<String, Integer> getStringIntegerMap(INbtList tagList) {
|
||||
HashMap<String, Integer> list = new HashMap<String, Integer>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getString("Slot"), nbttagcompound.getInteger("Value"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<String, int[]> getStringIntegerArrayMap(INBTList tagList) {
|
||||
public static HashMap<String, int[]> getStringIntegerArrayMap(INbtList tagList) {
|
||||
HashMap<String, int[]> list = new HashMap<String, int[]>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getString("Slot"), nbttagcompound.getIntArray("Value"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<String, int[]> getStringIntegerArrayMap(INBTList tagList, int arrayLength) {
|
||||
public static HashMap<String, int[]> getStringIntegerArrayMap(INbtList tagList, int arrayLength) {
|
||||
HashMap<String, int[]> list = new HashMap<String, int[]>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
int[] a = nbttagcompound.getIntArray("Value");
|
||||
if (a.length != arrayLength) a = new int[arrayLength];
|
||||
list.put(nbttagcompound.getString("Slot"), a);
|
||||
@@ -207,14 +207,14 @@ public class NBTTags {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<String, Vector<String>> getVectorMap(INBTList tagList) {
|
||||
public static HashMap<String, Vector<String>> getVectorMap(INbtList tagList) {
|
||||
HashMap<String, Vector<String>> map = new HashMap<String, Vector<String>>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
Vector<String> values = new Vector<String>();
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INBTList list = nbttagcompound.getList("Values", 10);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
INbtList list = nbttagcompound.getTagList("Values", 10);
|
||||
for (int j = 0; j < list.size(); j++) {
|
||||
INBTCompound value = list.getCompound(j);
|
||||
INbt value = list.getCompound(j);
|
||||
values.add(value.getString("Value"));
|
||||
}
|
||||
|
||||
@@ -224,20 +224,20 @@ public class NBTTags {
|
||||
}
|
||||
|
||||
|
||||
public static List<String> getStringList(INBTList tagList) {
|
||||
public static List<String> getStringList(INbtList tagList) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
String line = nbttagcompound.getString("Line");
|
||||
list.add(line);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static String[] getStringArray(INBTList tagList, int size) {
|
||||
public static String[] getStringArray(INbtList tagList, int size) {
|
||||
String[] arr = new String[size];
|
||||
for (int i = 0; i < tagList.size(); i++) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
String line = nbttagcompound.getString("Value");
|
||||
int slot = nbttagcompound.getInteger("Slot");
|
||||
arr[slot] = line;
|
||||
@@ -245,25 +245,25 @@ public class NBTTags {
|
||||
return arr;
|
||||
}
|
||||
|
||||
public static INBTList nbtIntegerArraySet(List<int[]> set) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtIntegerArraySet(List<int[]> set) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (set == null)
|
||||
return nbttaglist;
|
||||
for (int[] arr : set) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setIntArray("Array", arr);
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
}
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtBooleanList(HashMap<Integer, Boolean> updatedSlots) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtBooleanList(HashMap<Integer, Boolean> updatedSlots) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (updatedSlots == null)
|
||||
return nbttaglist;
|
||||
HashMap<Integer, Boolean> inventory2 = updatedSlots;
|
||||
for (Integer slot : inventory2.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setBoolean("Boolean", inventory2.get(slot));
|
||||
|
||||
@@ -272,12 +272,12 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtIntegerIntegerMap(Map<Integer, Integer> lines) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtIntegerIntegerMap(Map<Integer, Integer> lines) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (lines == null)
|
||||
return nbttaglist;
|
||||
for (int slot : lines.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setInteger("Integer", lines.get(slot));
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
@@ -285,12 +285,12 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtIntegerFloatMap(Map<Integer, Float> lines) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtIntegerFloatMap(Map<Integer, Float> lines) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (lines == null)
|
||||
return nbttaglist;
|
||||
for (int slot : lines.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setDouble("Float", lines.get(slot));
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
@@ -298,12 +298,12 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtIntegerDoubleMap(Map<Integer, Double> lines) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtIntegerDoubleMap(Map<Integer, Double> lines) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (lines == null)
|
||||
return nbttaglist;
|
||||
for (int slot : lines.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setDouble("Double", lines.get(slot));
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
@@ -311,12 +311,12 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtIntegerLongMap(Map<Integer, Long> lines) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtIntegerLongMap(Map<Integer, Long> lines) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (lines == null)
|
||||
return nbttaglist;
|
||||
for (int slot : lines.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setLong("Long", lines.get(slot));
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
@@ -324,31 +324,31 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtVectorMap(Map<String, Vector<String>> map) {
|
||||
INBTList list = NBT.list();
|
||||
public static INbtList nbtVectorMap(Map<String, Vector<String>> map) {
|
||||
INbtList list = NBT.list();
|
||||
if (map == null)
|
||||
return list;
|
||||
for (String key : map.keySet()) {
|
||||
INBTCompound compound = NBT.compound();
|
||||
INbt compound = NBT.compound();
|
||||
compound.setString("Key", key);
|
||||
INBTList values = NBT.list();
|
||||
INbtList values = NBT.list();
|
||||
for (String value : map.get(key)) {
|
||||
INBTCompound comp = NBT.compound();
|
||||
INbt comp = NBT.compound();
|
||||
comp.setString("Value", value);
|
||||
values.addCompound(comp);
|
||||
}
|
||||
compound.setList("Values", values);
|
||||
compound.setTagList("Values", values);
|
||||
list.addCompound(compound);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static INBTList nbtStringStringMap(Map<String, String> map) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtStringStringMap(Map<String, String> map) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (map == null)
|
||||
return nbttaglist;
|
||||
for (String slot : map.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setString("Slot", slot);
|
||||
nbttagcompound.setString("Value", map.get(slot));
|
||||
|
||||
@@ -357,12 +357,12 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtStringIntegerMap(Map<String, Integer> map) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtStringIntegerMap(Map<String, Integer> map) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (map == null)
|
||||
return nbttaglist;
|
||||
for (String slot : map.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setString("Slot", slot);
|
||||
nbttagcompound.setInteger("Value", map.get(slot));
|
||||
|
||||
@@ -371,12 +371,12 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtStringIntegerArrayMap(Map<String, int[]> map) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtStringIntegerArrayMap(Map<String, int[]> map) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (map == null)
|
||||
return nbttaglist;
|
||||
for (String slot : map.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setString("Slot", slot);
|
||||
nbttagcompound.setIntArray("Value", map.get(slot));
|
||||
|
||||
@@ -385,12 +385,12 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtIntegerStringMap(HashMap<Integer, String> map) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtIntegerStringMap(HashMap<Integer, String> map) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (map == null)
|
||||
return nbttaglist;
|
||||
for (int slot : map.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setString("Value", map.get(slot));
|
||||
|
||||
@@ -399,14 +399,14 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtStringArray(String[] list) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtStringArray(String[] list) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (list == null)
|
||||
return nbttaglist;
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
if (list[i] == null)
|
||||
continue;
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setString("Value", list[i]);
|
||||
nbttagcompound.setInteger("Slot", i);
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
@@ -414,10 +414,10 @@ public class NBTTags {
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static INBTList nbtStringList(List<String> list) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList nbtStringList(List<String> list) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
for (String s : list) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setString("Line", s);
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
}
|
||||
@@ -427,8 +427,8 @@ public class NBTTags {
|
||||
// TODO: nbtDoubleList stays in mc1710 version - uses NBTTagDouble directly
|
||||
// OLD: public static NBTTagList nbtDoubleList(double... par1ArrayOfDouble)
|
||||
|
||||
public static INBTCompound NBTMerge(INBTCompound data, INBTCompound merge) {
|
||||
INBTCompound compound = data.copy();
|
||||
public static INbt NBTMerge(INbt data, INbt merge) {
|
||||
INbt compound = data.copy();
|
||||
Set<String> names = merge.getKeySet();
|
||||
for (String name : names) {
|
||||
int type = merge.getTagType(name);
|
||||
@@ -436,7 +436,7 @@ public class NBTTags {
|
||||
compound.setCompound(name, NBTMerge(compound.getCompound(name), merge.getCompound(name)));
|
||||
else {
|
||||
// For non-compound types, copy from merge.
|
||||
// We need to handle by type since INBTCompound doesn't have a raw getTag/setTag.
|
||||
// We need to handle by type since INbt doesn't have a raw getTag/setTag.
|
||||
copyTag(compound, merge, name, type);
|
||||
}
|
||||
}
|
||||
@@ -447,7 +447,7 @@ public class NBTTags {
|
||||
* Copy a single tag from source to dest by type.
|
||||
* Used by NBTMerge for non-compound types.
|
||||
*/
|
||||
private static void copyTag(INBTCompound dest, INBTCompound source, String key, int type) {
|
||||
private static void copyTag(INbt dest, INbt source, String key, int type) {
|
||||
switch (type) {
|
||||
case 1: // Byte
|
||||
dest.setByte(key, source.getByte(key));
|
||||
@@ -474,7 +474,7 @@ public class NBTTags {
|
||||
dest.setString(key, source.getString(key));
|
||||
break;
|
||||
case 9: // List
|
||||
dest.setList(key, source.getList(key, 0));
|
||||
dest.setTagList(key, source.getTagList(key, 0));
|
||||
break;
|
||||
case 10: // Compound (handled above in NBTMerge)
|
||||
dest.setCompound(key, source.getCompound(key));
|
||||
@@ -485,24 +485,24 @@ public class NBTTags {
|
||||
}
|
||||
}
|
||||
|
||||
public static TreeMap<Long, String> GetLongStringMap(INBTList tagList) {
|
||||
public static TreeMap<Long, String> GetLongStringMap(INbtList tagList) {
|
||||
TreeMap<Long, String> list = new TreeMap<>();
|
||||
|
||||
for (int i = 0; i < tagList.size(); ++i) {
|
||||
INBTCompound nbttagcompound = tagList.getCompound(i);
|
||||
INbt nbttagcompound = tagList.getCompound(i);
|
||||
list.put(nbttagcompound.getLong("Long"), nbttagcompound.getString("String"));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static INBTList NBTLongStringMap(Map<Long, String> map) {
|
||||
INBTList nbttaglist = NBT.list();
|
||||
public static INbtList NBTLongStringMap(Map<Long, String> map) {
|
||||
INbtList nbttaglist = NBT.list();
|
||||
if (map == null) {
|
||||
return nbttaglist;
|
||||
} else {
|
||||
for (long slot : map.keySet()) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setLong("Long", slot);
|
||||
nbttagcompound.setString("String", map.get(slot));
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
|
||||
@@ -4,8 +4,8 @@ package noppes.npcs.constants;
|
||||
* NBT type ID constants, matching Minecraft's internal NBT type numbering.
|
||||
* These are stable across all MC versions.
|
||||
*
|
||||
* Use these instead of magic numbers when calling INBTCompound.hasKey(key, type)
|
||||
* or INBTCompound.getList(key, type).
|
||||
* Use these instead of magic numbers when calling INbt.hasKey(key, type)
|
||||
* or INbt.getTagList(key, type).
|
||||
*/
|
||||
public final class NBTTypes {
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ package noppes.npcs.controllers;
|
||||
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.controllers.data.Faction;
|
||||
import noppes.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import kamkeel.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
@@ -70,18 +70,18 @@ public class FactionController {
|
||||
// OLD: DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new FileInputStream(file))));
|
||||
// OLD: loadFactions(var1);
|
||||
// OLD: var1.close();
|
||||
INBTCompound nbttagcompound1 = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
INbt nbttagcompound1 = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
loadFactions(nbttagcompound1);
|
||||
}
|
||||
|
||||
public void loadFactions(INBTCompound nbttagcompound1) {
|
||||
public void loadFactions(INbt nbttagcompound1) {
|
||||
HashMap<Integer, Faction> factions = new HashMap<Integer, Faction>();
|
||||
lastUsedID = nbttagcompound1.getInteger("lastID");
|
||||
INBTList list = nbttagcompound1.getList("NPCFactions", 10);
|
||||
INbtList list = nbttagcompound1.getTagList("NPCFactions", 10);
|
||||
|
||||
if (list != null) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound nbttagcompound = list.getCompound(i);
|
||||
INbt nbttagcompound = list.getCompound(i);
|
||||
Faction faction = new Faction();
|
||||
faction.readNBT(nbttagcompound);
|
||||
factions.put(faction.id, faction);
|
||||
@@ -90,17 +90,17 @@ public class FactionController {
|
||||
this.factions = factions;
|
||||
}
|
||||
|
||||
public INBTCompound getNBT() {
|
||||
INBTList list = NBT.list();
|
||||
public INbt getNBT() {
|
||||
INbtList list = NBT.list();
|
||||
for (int slot : factions.keySet()) {
|
||||
Faction faction = factions.get(slot);
|
||||
INBTCompound nbtfactions = NBT.compound();
|
||||
INbt nbtfactions = NBT.compound();
|
||||
faction.writeNBT(nbtfactions);
|
||||
list.addCompound(nbtfactions);
|
||||
}
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("lastID", lastUsedID);
|
||||
nbttagcompound.setList("NPCFactions", list);
|
||||
nbttagcompound.setTagList("NPCFactions", list);
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.controllers;
|
||||
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import kamkeel.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class GlobalDataController {
|
||||
// OLD: try (FileInputStream fis = new FileInputStream(file)) {
|
||||
// OLD: nbttagcompound1 = CompressedStreamTools.readCompressed(fis);
|
||||
// OLD: }
|
||||
INBTCompound nbttagcompound1 = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
INbt nbttagcompound1 = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
itemGiverId = nbttagcompound1.getInteger("itemGiverId");
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GlobalDataController {
|
||||
File saveDir = PlatformServiceHolder.get().getWorldSaveDirectory();
|
||||
|
||||
// OLD: NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("itemGiverId", itemGiverId);
|
||||
|
||||
File file = new File(saveDir, "global.dat_new");
|
||||
|
||||
@@ -5,9 +5,9 @@ import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.controllers.data.Magic;
|
||||
import noppes.npcs.controllers.data.MagicAssociation;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import kamkeel.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
@@ -185,27 +185,27 @@ public class MagicController {
|
||||
// OLD: );
|
||||
// OLD: loadMagic(stream);
|
||||
// OLD: stream.close();
|
||||
INBTCompound compound = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
INbt compound = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
loadMagic(compound);
|
||||
}
|
||||
|
||||
public void loadMagic(INBTCompound compound) {
|
||||
public void loadMagic(INbt compound) {
|
||||
lastUsedMagicID = compound.getInteger("lastID");
|
||||
lastUsedCycleID = compound.getInteger("lastCycleID");
|
||||
|
||||
magics.clear();
|
||||
INBTList magicList = compound.getList("Magics", 10);
|
||||
INbtList magicList = compound.getTagList("Magics", 10);
|
||||
for (int i = 0; i < magicList.size(); i++) {
|
||||
INBTCompound magCompound = magicList.getCompound(i);
|
||||
INbt magCompound = magicList.getCompound(i);
|
||||
Magic mag = new Magic();
|
||||
mag.readNBT(magCompound);
|
||||
magics.put(mag.id, mag);
|
||||
}
|
||||
|
||||
cycles.clear();
|
||||
INBTList cycleList = compound.getList("Cycles", 10);
|
||||
INbtList cycleList = compound.getTagList("Cycles", 10);
|
||||
for (int i = 0; i < cycleList.size(); i++) {
|
||||
INBTCompound catCompound = cycleList.getCompound(i);
|
||||
INbt catCompound = cycleList.getCompound(i);
|
||||
MagicCycle cycle = new MagicCycle();
|
||||
// OLD: cycle.readNBT(new NBTWrapper(catCompound));
|
||||
cycle.readNBT(catCompound);
|
||||
@@ -213,25 +213,25 @@ public class MagicController {
|
||||
}
|
||||
}
|
||||
|
||||
public INBTCompound getNBT() {
|
||||
INBTList magicList = NBT.list();
|
||||
public INbt getNBT() {
|
||||
INbtList magicList = NBT.list();
|
||||
for (Magic mag : magics.values()) {
|
||||
INBTCompound magCompound = NBT.compound();
|
||||
INbt magCompound = NBT.compound();
|
||||
mag.writeNBT(magCompound);
|
||||
magicList.addCompound(magCompound);
|
||||
}
|
||||
INBTList catList = NBT.list();
|
||||
INbtList catList = NBT.list();
|
||||
for (MagicCycle cat : cycles.values()) {
|
||||
INBTCompound catCompound = NBT.compound();
|
||||
INbt catCompound = NBT.compound();
|
||||
// OLD: cat.writeNBT(new NBTWrapper(catCompound));
|
||||
cat.writeNBT(catCompound);
|
||||
catList.addCompound(catCompound);
|
||||
}
|
||||
INBTCompound compound = NBT.compound();
|
||||
INbt compound = NBT.compound();
|
||||
compound.setInteger("lastID", lastUsedMagicID);
|
||||
compound.setInteger("lastCycleID", lastUsedCycleID);
|
||||
compound.setList("Magics", magicList);
|
||||
compound.setList("Cycles", catList);
|
||||
compound.setTagList("Magics", magicList);
|
||||
compound.setTagList("Cycles", catList);
|
||||
return compound;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.controllers;
|
||||
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
import noppes.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import kamkeel.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ServerTagMapController {
|
||||
// OLD: NBTTagCompound nbtCompound = CompressedStreamTools.read(var1);
|
||||
// OLD: this.tagMap.readNBT(new NBTWrapper(nbtCompound));
|
||||
// OLD: var1.close();
|
||||
INBTCompound nbtCompound = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
INbt nbtCompound = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
this.tagMap.readNBT(nbtCompound);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ package noppes.npcs.controllers;
|
||||
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import kamkeel.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
@@ -59,18 +59,18 @@ public class TagController {
|
||||
// OLD: DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new FileInputStream(file))));
|
||||
// OLD: loadTags(var1);
|
||||
// OLD: var1.close();
|
||||
INBTCompound nbttagcompound1 = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
INbt nbttagcompound1 = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
loadTags(nbttagcompound1);
|
||||
}
|
||||
|
||||
public void loadTags(INBTCompound nbttagcompound1) {
|
||||
public void loadTags(INbt nbttagcompound1) {
|
||||
HashMap<Integer, Tag> tags = new HashMap<Integer, Tag>();
|
||||
lastUsedID = nbttagcompound1.getInteger("lastID");
|
||||
INBTList list = nbttagcompound1.getList("NPCTags", 10);
|
||||
INbtList list = nbttagcompound1.getTagList("NPCTags", 10);
|
||||
|
||||
if (list != null) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound nbttagcompound = list.getCompound(i);
|
||||
INbt nbttagcompound = list.getCompound(i);
|
||||
Tag tag = new Tag();
|
||||
// OLD: tag.readNBT(new NBTWrapper(nbttagcompound));
|
||||
tag.readNBT(nbttagcompound);
|
||||
@@ -80,18 +80,18 @@ public class TagController {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public INBTCompound getNBT() {
|
||||
INBTList list = NBT.list();
|
||||
public INbt getNBT() {
|
||||
INbtList list = NBT.list();
|
||||
for (int slot : tags.keySet()) {
|
||||
Tag tag = tags.get(slot);
|
||||
INBTCompound nbtfactions = NBT.compound();
|
||||
INbt nbtfactions = NBT.compound();
|
||||
// OLD: tag.writeNBT(new NBTWrapper(nbtfactions));
|
||||
tag.writeNBT(nbtfactions);
|
||||
list.addCompound(nbtfactions);
|
||||
}
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("lastID", lastUsedID);
|
||||
nbttagcompound.setList("NPCTags", list);
|
||||
nbttagcompound.setTagList("NPCTags", list);
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
@@ -218,23 +218,23 @@ public class TagController {
|
||||
/**
|
||||
* Write a set of tag UUIDs to an NBT compound under the given key.
|
||||
*/
|
||||
public static void writeTagUUIDs(INBTCompound compound, String key, HashSet<UUID> tagUUIDs) {
|
||||
public static void writeTagUUIDs(INbt compound, String key, HashSet<UUID> tagUUIDs) {
|
||||
if (tagUUIDs != null && !tagUUIDs.isEmpty()) {
|
||||
INBTList list = NBT.list();
|
||||
INbtList list = NBT.list();
|
||||
for (UUID uuid : tagUUIDs) {
|
||||
list.addString(uuid.toString());
|
||||
}
|
||||
compound.setList(key, list);
|
||||
compound.setTagList(key, list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a set of tag UUIDs from an NBT compound under the given key.
|
||||
*/
|
||||
public static HashSet<UUID> readTagUUIDs(INBTCompound compound, String key) {
|
||||
public static HashSet<UUID> readTagUUIDs(INbt compound, String key) {
|
||||
HashSet<UUID> uuids = new HashSet<>();
|
||||
if (compound.hasKey(key)) {
|
||||
INBTList list = compound.getList(key, 8);
|
||||
INbtList list = compound.getTagList(key, 8);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
try {
|
||||
uuids.add(UUID.fromString(list.getString(i)));
|
||||
|
||||
@@ -3,13 +3,12 @@ package noppes.npcs.controllers;
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.controllers.data.TransportCategory;
|
||||
import noppes.npcs.controllers.data.TransportLocation;
|
||||
import noppes.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import kamkeel.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TransportController {
|
||||
private HashMap<Integer, TransportLocation> locations = new HashMap<Integer, TransportLocation>();
|
||||
@@ -68,15 +67,15 @@ public class TransportController {
|
||||
// OLD: try (FileInputStream fis = new FileInputStream(file)) {
|
||||
// OLD: nbttagcompound1 = CompressedStreamTools.readCompressed(fis);
|
||||
// OLD: }
|
||||
INBTCompound nbttagcompound1 = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
INbt nbttagcompound1 = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
lastUsedID = nbttagcompound1.getInteger("lastID");
|
||||
INBTList list = nbttagcompound1.getList("NPCTransportCategories", 10);
|
||||
INbtList list = nbttagcompound1.getTagList("NPCTransportCategories", 10);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
TransportCategory category = new TransportCategory();
|
||||
INBTCompound compound = list.getCompound(i);
|
||||
INbt compound = list.getCompound(i);
|
||||
// OLD: category.readNBT(new NBTWrapper(compound));
|
||||
category.readNBT(compound);
|
||||
|
||||
@@ -89,16 +88,16 @@ public class TransportController {
|
||||
this.categories = categories;
|
||||
}
|
||||
|
||||
public INBTCompound getNBT() {
|
||||
INBTList list = NBT.list();
|
||||
public INbt getNBT() {
|
||||
INbtList list = NBT.list();
|
||||
for (TransportCategory category : categories.values()) {
|
||||
INBTCompound compound = NBT.compound();
|
||||
INbt compound = NBT.compound();
|
||||
category.writeNBT(compound);
|
||||
list.addCompound(compound);
|
||||
}
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("lastID", lastUsedID);
|
||||
nbttagcompound.setList("NPCTransportCategories", list);
|
||||
nbttagcompound.setTagList("NPCTransportCategories", list);
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
public class AbilityHotbarData {
|
||||
@@ -26,15 +26,15 @@ public class AbilityHotbarData {
|
||||
return abilityKey;
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound compound) {
|
||||
INBTCompound tag = NBT.compound();
|
||||
public INbt writeToNBT(INbt compound) {
|
||||
INbt tag = NBT.compound();
|
||||
tag.setInteger("slot", slot);
|
||||
tag.setString("abilityKey", abilityKey != null ? abilityKey : "");
|
||||
compound.setCompound("AbilityHotbar" + slot, tag);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
abilityKey = compound.getString("abilityKey");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.constants.EnumAuctionSort;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
@@ -87,13 +87,13 @@ public class AuctionFilter {
|
||||
normalizedSearch = "";
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound compound) {
|
||||
public INbt writeToNBT(INbt compound) {
|
||||
compound.setString("SearchText", searchText != null ? searchText : "");
|
||||
compound.setInteger("SortBy", sortBy.ordinal());
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
searchText = compound.getString("SearchText");
|
||||
normalizedSearch = normalizeForSearch(searchText);
|
||||
sortBy = EnumAuctionSort.fromOrdinal(compound.getInteger("SortBy"));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
/**
|
||||
@@ -19,12 +19,12 @@ public class Category {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
id = compound.getInteger("CatID");
|
||||
title = compound.getString("CatTitle");
|
||||
}
|
||||
|
||||
public INBTCompound writeNBT(INBTCompound compound) {
|
||||
public INbt writeNBT(INbt compound) {
|
||||
compound.setInteger("CatID", id);
|
||||
compound.setString("CatTitle", title);
|
||||
return compound;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
public class CloneFolder {
|
||||
@@ -17,12 +17,12 @@ public class CloneFolder {
|
||||
this.createdDate = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
name = compound.getString("Name");
|
||||
createdDate = compound.getLong("Created");
|
||||
}
|
||||
|
||||
public INBTCompound writeNBT(INBTCompound compound) {
|
||||
public INbt writeNBT(INbt compound) {
|
||||
compound.setString("Name", name);
|
||||
compound.setLong("Created", createdDate);
|
||||
return compound;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
public class DialogColorData {
|
||||
@@ -12,7 +12,7 @@ public class DialogColorData {
|
||||
private int buttonAcceptColor = 0xfff96605;
|
||||
private int buttonRejectColor = 0xfff96605;
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound compound) {
|
||||
public INbt writeToNBT(INbt compound) {
|
||||
compound.setBoolean("ColorSettings", enableColorSettings);
|
||||
if (enableColorSettings) {
|
||||
compound.setInteger("LineColor1", lineColor1);
|
||||
@@ -25,7 +25,7 @@ public class DialogColorData {
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
this.enableColorSettings = compound.getBoolean("ColorSettings");
|
||||
if (enableColorSettings) {
|
||||
lineColor1 = compound.getInteger("LineColor1");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.IDialogImage;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
public class DialogImage implements IDialogImage {
|
||||
public int id;
|
||||
@@ -29,7 +29,7 @@ public class DialogImage implements IDialogImage {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound compound) {
|
||||
public INbt writeToNBT(INbt compound) {
|
||||
compound.setInteger("ID", id);
|
||||
compound.setString("Texture", texture);
|
||||
compound.setInteger("PosX", x);
|
||||
@@ -49,7 +49,7 @@ public class DialogImage implements IDialogImage {
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
id = compound.getInteger("ID");
|
||||
texture = compound.getString("Texture");
|
||||
x = compound.getInteger("PosX");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Faction {
|
||||
return name.substring(0, 1).toUpperCase() + name.substring(1);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
name = compound.getString("Name");
|
||||
color = compound.getInteger("Color");
|
||||
id = compound.getInteger("Slot");
|
||||
@@ -52,10 +52,10 @@ public class Faction {
|
||||
getsAttacked = compound.getBoolean("GetsAttacked");
|
||||
isPassive = compound.getBoolean("IsPassive");
|
||||
|
||||
attackFactions = NBTTags.getIntegerSet(compound.getList("AttackFactions", 10));
|
||||
attackFactions = NBTTags.getIntegerSet(compound.getTagList("AttackFactions", 10));
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound compound) {
|
||||
public void writeNBT(INbt compound) {
|
||||
compound.setInteger("Slot", id);
|
||||
compound.setString("Name", name);
|
||||
compound.setInteger("Color", color);
|
||||
@@ -68,7 +68,7 @@ public class Faction {
|
||||
compound.setBoolean("GetsAttacked", getsAttacked);
|
||||
compound.setBoolean("IsPassive", isPassive);
|
||||
|
||||
compound.setList("AttackFactions", NBTTags.nbtIntegerSet(attackFactions));
|
||||
compound.setTagList("AttackFactions", NBTTags.nbtIntegerSet(attackFactions));
|
||||
}
|
||||
|
||||
// TODO: mc1710 version implements IFaction and adds:
|
||||
|
||||
@@ -3,8 +3,8 @@ package noppes.npcs.controllers.data;
|
||||
import noppes.npcs.api.handler.data.IFrame;
|
||||
import noppes.npcs.api.handler.data.IFramePart;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -124,7 +124,7 @@ public class Frame implements IFrame {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
duration = compound.getInteger("Duration");
|
||||
if (compound.hasKey("ColorMarker")) {
|
||||
this.setColorMarker(compound.getInteger("ColorMarker"));
|
||||
@@ -149,9 +149,9 @@ public class Frame implements IFrame {
|
||||
}
|
||||
|
||||
HashMap<EnumAnimationPart, FramePart> frameParts = new HashMap<>();
|
||||
INBTList list = compound.getList("FrameParts", 10);
|
||||
INbtList list = compound.getTagList("FrameParts", 10);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound item = list.getCompound(i);
|
||||
INbt item = list.getCompound(i);
|
||||
FramePart framePart = new FramePart();
|
||||
framePart.readFromNBT(item);
|
||||
if (!framePart.customized) {
|
||||
@@ -163,8 +163,8 @@ public class Frame implements IFrame {
|
||||
this.frameParts = frameParts;
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT() {
|
||||
INBTCompound compound = NBT.compound();
|
||||
public INbt writeToNBT() {
|
||||
INbt compound = NBT.compound();
|
||||
compound.setInteger("Duration", duration);
|
||||
compound.setInteger("ColorMarker", this.colorMarker);
|
||||
compound.setString("Comment", this.comment);
|
||||
@@ -174,12 +174,12 @@ public class Frame implements IFrame {
|
||||
compound.setByte("Smooth", smooth);
|
||||
}
|
||||
|
||||
INBTList list = NBT.list();
|
||||
INbtList list = NBT.list();
|
||||
for (FramePart framePart : frameParts.values()) {
|
||||
INBTCompound item = framePart.writeToNBT();
|
||||
INbt item = framePart.writeToNBT();
|
||||
list.addCompound(item);
|
||||
}
|
||||
compound.setList("FrameParts", list);
|
||||
compound.setTagList("FrameParts", list);
|
||||
return compound;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.IFramePart;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
public class FramePart implements IFramePart {
|
||||
@@ -111,7 +111,7 @@ public class FramePart implements IFramePart {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
part = EnumAnimationPart.valueOf(compound.getString("Part"));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
rotation[i] = compound.getFloat("Rotation" + i);
|
||||
@@ -131,8 +131,8 @@ public class FramePart implements IFramePart {
|
||||
}
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT() {
|
||||
INBTCompound compound = NBT.compound();
|
||||
public INbt writeToNBT() {
|
||||
INbt compound = NBT.compound();
|
||||
compound.setString("Part", part.toString());
|
||||
for (int i = 0; i < 3; i++) {
|
||||
compound.setFloat("Rotation" + i, rotation[i]);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.entity.data.IHitboxData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.CoreConfig;
|
||||
|
||||
public class HitboxData implements IHitboxData {
|
||||
@@ -10,7 +10,7 @@ public class HitboxData implements IHitboxData {
|
||||
private float heightScale = 1f;
|
||||
private boolean hitboxEnabled = false;
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound nbttagcompound) {
|
||||
public INbt writeToNBT(INbt nbttagcompound) {
|
||||
nbttagcompound.setBoolean("HitboxEnabled", hitboxEnabled);
|
||||
if (hitboxEnabled) {
|
||||
if (widthScale > CoreConfig.HitBoxScaleMax)
|
||||
@@ -24,7 +24,7 @@ public class HitboxData implements IHitboxData {
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound nbttagcompound) {
|
||||
public void readFromNBT(INbt nbttagcompound) {
|
||||
hitboxEnabled = nbttagcompound.getBoolean("HitboxEnabled");
|
||||
if (hitboxEnabled) {
|
||||
widthScale = nbttagcompound.getFloat("HitboxWidthScale");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
public class ItemDisplayData {
|
||||
@@ -18,13 +18,13 @@ public class ItemDisplayData {
|
||||
public Integer frameCount = 1;
|
||||
public Integer frametime = 2;
|
||||
|
||||
public INBTCompound writeToNBT() {
|
||||
INBTCompound compound = NBT.compound();
|
||||
public INbt writeToNBT() {
|
||||
INbt compound = NBT.compound();
|
||||
this.writeToNBT(compound);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound compound) {
|
||||
public INbt writeToNBT(INbt compound) {
|
||||
this.setBoolean(compound, "DurabilityShow", this.durabilityShow);
|
||||
this.setInteger(compound, "DurabilityColor", this.durabilityColor);
|
||||
this.setInteger(compound, "ItemColor", this.itemColor);
|
||||
@@ -55,7 +55,7 @@ public class ItemDisplayData {
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
if (compound.hasKey("DurabilityShow")) {
|
||||
this.durabilityShow = compound.getBoolean("DurabilityShow");
|
||||
}
|
||||
@@ -119,19 +119,19 @@ public class ItemDisplayData {
|
||||
}
|
||||
}
|
||||
|
||||
private void setBoolean(INBTCompound compound, String key, Boolean value) {
|
||||
private void setBoolean(INbt compound, String key, Boolean value) {
|
||||
if (value != null) {
|
||||
compound.setBoolean(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void setInteger(INBTCompound compound, String key, Integer value) {
|
||||
private void setInteger(INbt compound, String key, Integer value) {
|
||||
if (value != null) {
|
||||
compound.setInteger(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void setFloat(INBTCompound compound, String key, Float value) {
|
||||
private void setFloat(INbt compound, String key, Float value) {
|
||||
if (value != null) {
|
||||
compound.setFloat(key, value);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.ILine;
|
||||
import noppes.npcs.api.handler.data.ILines;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -17,13 +17,13 @@ public class Lines implements ILines {
|
||||
|
||||
public HashMap<Integer, Line> lines = new HashMap<Integer, Line>();
|
||||
|
||||
public INBTCompound writeToNBT() {
|
||||
INBTCompound compound = NBT.compound();
|
||||
public INbt writeToNBT() {
|
||||
INbt compound = NBT.compound();
|
||||
|
||||
INBTList nbttaglist = NBT.list();
|
||||
INbtList nbttaglist = NBT.list();
|
||||
for (int slot : lines.keySet()) {
|
||||
Line line = lines.get(slot);
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setString("Line", line.text);
|
||||
nbttagcompound.setString("Song", line.sound);
|
||||
@@ -31,16 +31,16 @@ public class Lines implements ILines {
|
||||
nbttaglist.addCompound(nbttagcompound);
|
||||
}
|
||||
|
||||
compound.setList("Lines", nbttaglist);
|
||||
compound.setTagList("Lines", nbttaglist);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
INBTList nbttaglist = compound.getList("Lines", 10);
|
||||
public void readNBT(INbt compound) {
|
||||
INbtList nbttaglist = compound.getTagList("Lines", 10);
|
||||
|
||||
HashMap<Integer, Line> map = new HashMap<Integer, Line>();
|
||||
for (int i = 0; i < nbttaglist.size(); i++) {
|
||||
INBTCompound nbttagcompound = nbttaglist.getCompound(i);
|
||||
INbt nbttagcompound = nbttaglist.getCompound(i);
|
||||
Line line = new Line();
|
||||
line.text = nbttagcompound.getString("Line");
|
||||
line.sound = nbttagcompound.getString("Song");
|
||||
|
||||
@@ -3,8 +3,8 @@ package noppes.npcs.controllers.data;
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.constants.EnumTextureType;
|
||||
import noppes.npcs.controllers.MagicController;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -37,7 +37,7 @@ public class Magic {
|
||||
return name.substring(0, 1).toUpperCase() + name.substring(1);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
name = compound.getString("Name");
|
||||
displayName = compound.getString("DisplayName");
|
||||
color = compound.getInteger("Color");
|
||||
@@ -54,9 +54,9 @@ public class Magic {
|
||||
|
||||
interactions.clear();
|
||||
if (compound.hasKey("Interactions")) {
|
||||
INBTList interactionsList = compound.getList("Interactions", 10);
|
||||
INbtList interactionsList = compound.getTagList("Interactions", 10);
|
||||
for (int i = 0; i < interactionsList.size(); i++) {
|
||||
INBTCompound interactionTag = interactionsList.getCompound(i);
|
||||
INbt interactionTag = interactionsList.getCompound(i);
|
||||
int magicId = interactionTag.getInteger("MagicID");
|
||||
float percentage = interactionTag.getFloat("Percentage");
|
||||
interactions.put(magicId, percentage);
|
||||
@@ -64,21 +64,21 @@ public class Magic {
|
||||
}
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound compound) {
|
||||
public void writeNBT(INbt compound) {
|
||||
compound.setInteger("Slot", id);
|
||||
compound.setString("Name", name);
|
||||
compound.setString("DisplayName", displayName);
|
||||
compound.setInteger("Color", color);
|
||||
compound.setString("IconTexture", iconTexture);
|
||||
compound.setInteger("Type", type.ordinal());
|
||||
INBTList interactionsList = NBT.list();
|
||||
INbtList interactionsList = NBT.list();
|
||||
for (Map.Entry<Integer, Float> entry : interactions.entrySet()) {
|
||||
INBTCompound interactionTag = NBT.compound();
|
||||
INbt interactionTag = NBT.compound();
|
||||
interactionTag.setInteger("MagicID", entry.getKey());
|
||||
interactionTag.setFloat("Percentage", entry.getValue());
|
||||
interactionsList.addCompound(interactionTag);
|
||||
}
|
||||
compound.setList("Interactions", interactionsList);
|
||||
compound.setTagList("Interactions", interactionsList);
|
||||
|
||||
// TODO: mc1710 version resolves ItemStack from GameRegistry here:
|
||||
// OLD: if (type == EnumTextureType.ITEM && !iconTexture.isEmpty()) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.IMagicCycle;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.constants.EnumDiagramLayout;
|
||||
|
||||
@@ -22,15 +22,15 @@ public class MagicCycle implements IMagicCycle {
|
||||
public MagicCycle() {
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
id = compound.getInteger("ID");
|
||||
name = compound.getString("Name");
|
||||
displayName = compound.getString("DisplayName");
|
||||
layout = EnumDiagramLayout.values()[compound.getInteger("Layout")];
|
||||
associations.clear();
|
||||
INBTList list = compound.getList("Associations", 10); // compound tags
|
||||
INbtList list = compound.getTagList("Associations", 10); // compound tags
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound assocTag = list.getCompound(i);
|
||||
INbt assocTag = list.getCompound(i);
|
||||
MagicAssociation assoc = new MagicAssociation();
|
||||
assoc.magicId = assocTag.getInteger("MagicID");
|
||||
assoc.index = assocTag.getInteger("Index");
|
||||
@@ -39,20 +39,20 @@ public class MagicCycle implements IMagicCycle {
|
||||
}
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound compound) {
|
||||
public void writeNBT(INbt compound) {
|
||||
compound.setInteger("ID", id);
|
||||
compound.setString("Name", name);
|
||||
compound.setString("DisplayName", displayName);
|
||||
compound.setInteger("Layout", layout.ordinal());
|
||||
INBTList list = NBT.list();
|
||||
INbtList list = NBT.list();
|
||||
for (MagicAssociation assoc : associations.values()) {
|
||||
INBTCompound assocTag = NBT.compound();
|
||||
INbt assocTag = NBT.compound();
|
||||
assocTag.setInteger("MagicID", assoc.magicId);
|
||||
assocTag.setInteger("Index", assoc.index);
|
||||
assocTag.setInteger("Priority", assoc.priority);
|
||||
list.addCompound(assocTag);
|
||||
}
|
||||
compound.setList("Associations", list);
|
||||
compound.setTagList("Associations", list);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.IMagicData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -9,16 +9,16 @@ import java.util.HashMap;
|
||||
public class MagicData implements IMagicData {
|
||||
private final HashMap<Integer, MagicEntry> magics = new HashMap<>();
|
||||
|
||||
public void writeToNBT(INBTCompound compound) {
|
||||
INBTCompound magicData = NBT.compound();
|
||||
public void writeToNBT(INbt compound) {
|
||||
INbt magicData = NBT.compound();
|
||||
for (int key : magics.keySet()) {
|
||||
magicData.setCompound(String.valueOf(key), magics.get(key).writeToNBT());
|
||||
}
|
||||
compound.setCompound("MagicData", magicData);
|
||||
}
|
||||
|
||||
public void readToNBT(INBTCompound compound) {
|
||||
INBTCompound magicData = compound.getCompound("MagicData");
|
||||
public void readToNBT(INbt compound) {
|
||||
INbt magicData = compound.getCompound("MagicData");
|
||||
magics.clear();
|
||||
if (magicData == null)
|
||||
return;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
public class MagicEntry {
|
||||
public float damage;
|
||||
public float split;
|
||||
|
||||
public INBTCompound writeToNBT() {
|
||||
INBTCompound compound = NBT.compound();
|
||||
public INbt writeToNBT() {
|
||||
INbt compound = NBT.compound();
|
||||
compound.setFloat("Dmg", damage);
|
||||
compound.setFloat("Split", split);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readToNBT(INBTCompound compound) {
|
||||
public void readToNBT(INbt compound) {
|
||||
damage = compound.getFloat("Dmg");
|
||||
split = compound.getFloat("Split");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.IPartyOptions;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.core.CoreConfig;
|
||||
import noppes.npcs.constants.EnumPartyExchange;
|
||||
@@ -25,7 +25,7 @@ public class PartyOptions implements IPartyOptions {
|
||||
public int minPartySize = CoreConfig.DefaultMinPartySize;
|
||||
public int maxPartySize = CoreConfig.DefaultMaxPartySize;
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
// Party Management
|
||||
allowParty = compound.getBoolean("AllowParty");
|
||||
if (allowParty) {
|
||||
@@ -74,8 +74,8 @@ public class PartyOptions implements IPartyOptions {
|
||||
}
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT() {
|
||||
INBTCompound compound = NBT.compound();
|
||||
public INbt writeToNBT() {
|
||||
INbt compound = NBT.compound();
|
||||
compound.setBoolean("AllowParty", allowParty);
|
||||
if (allowParty) {
|
||||
compound.setBoolean("OnlyParty", onlyParty);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.IPlayerDialogData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -13,31 +13,31 @@ public class PlayerDialogData implements IPlayerDialogData {
|
||||
public PlayerDialogData() {
|
||||
}
|
||||
|
||||
public void loadNBTData(INBTCompound compound) {
|
||||
public void loadNBTData(INbt compound) {
|
||||
HashSet<Integer> dialogsRead = new HashSet<Integer>();
|
||||
if (compound == null)
|
||||
return;
|
||||
INBTList list = compound.getList("DialogData", 10);
|
||||
INbtList list = compound.getTagList("DialogData", 10);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound nbttagcompound = list.getCompound(i);
|
||||
INbt nbttagcompound = list.getCompound(i);
|
||||
dialogsRead.add(nbttagcompound.getInteger("Dialog"));
|
||||
}
|
||||
this.dialogsRead = dialogsRead;
|
||||
}
|
||||
|
||||
public void saveNBTData(INBTCompound compound) {
|
||||
INBTList list = NBT.list();
|
||||
public void saveNBTData(INbt compound) {
|
||||
INbtList list = NBT.list();
|
||||
for (int dia : dialogsRead) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Dialog", dia);
|
||||
list.addCompound(nbttagcompound);
|
||||
}
|
||||
|
||||
compound.setList("DialogData", list);
|
||||
compound.setTagList("DialogData", list);
|
||||
}
|
||||
|
||||
public boolean hasReadDialog(int id) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.constants.NBTTypes;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -16,26 +16,26 @@ public class PlayerEffectData {
|
||||
public PlayerEffectData() {
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound compound) {
|
||||
INBTList list = NBT.list();
|
||||
public INbt writeToNBT(INbt compound) {
|
||||
INbtList list = NBT.list();
|
||||
for (Map.Entry<EffectKey, PlayerEffect> entry : effects.entrySet()) {
|
||||
INBTCompound effectCompound = NBT.compound();
|
||||
INbt effectCompound = NBT.compound();
|
||||
effectCompound.setInteger("id", entry.getKey().getId());
|
||||
effectCompound.setInteger("index", entry.getKey().getIndex());
|
||||
effectCompound.setInteger("duration", entry.getValue().duration);
|
||||
effectCompound.setByte("level", entry.getValue().level);
|
||||
list.addCompound(effectCompound);
|
||||
}
|
||||
compound.setList("Effects", list);
|
||||
compound.setTagList("Effects", list);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
HashSet<EffectKey> newKeys = new HashSet<>();
|
||||
if (compound.hasKey("Effects")) {
|
||||
INBTList list = compound.getList("Effects", NBTTypes.TAG_COMPOUND);
|
||||
INbtList list = compound.getTagList("Effects", NBTTypes.TAG_COMPOUND);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound effectCompound = list.getCompound(i);
|
||||
INbt effectCompound = list.getCompound(i);
|
||||
int id = effectCompound.getInteger("id");
|
||||
int index = effectCompound.getInteger("index");
|
||||
int duration = effectCompound.getInteger("duration");
|
||||
|
||||
@@ -2,8 +2,8 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.IPlayerTransportData;
|
||||
import noppes.npcs.api.handler.data.ITransportLocation;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -14,31 +14,31 @@ public class PlayerTransportData implements IPlayerTransportData {
|
||||
public PlayerTransportData() {
|
||||
}
|
||||
|
||||
public void loadNBTData(INBTCompound compound) {
|
||||
public void loadNBTData(INbt compound) {
|
||||
HashSet<Integer> dialogsRead = new HashSet<Integer>();
|
||||
if (compound == null)
|
||||
return;
|
||||
INBTList list = compound.getList("TransportData", 10);
|
||||
INbtList list = compound.getTagList("TransportData", 10);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound nbttagcompound = list.getCompound(i);
|
||||
INbt nbttagcompound = list.getCompound(i);
|
||||
dialogsRead.add(nbttagcompound.getInteger("Transport"));
|
||||
}
|
||||
this.transports = dialogsRead;
|
||||
}
|
||||
|
||||
public void saveNBTData(INBTCompound compound) {
|
||||
INBTList list = NBT.list();
|
||||
public void saveNBTData(INbt compound) {
|
||||
INbtList list = NBT.list();
|
||||
for (int dia : transports) {
|
||||
INBTCompound nbttagcompound = NBT.compound();
|
||||
INbt nbttagcompound = NBT.compound();
|
||||
nbttagcompound.setInteger("Transport", dia);
|
||||
list.addCompound(nbttagcompound);
|
||||
}
|
||||
|
||||
compound.setList("TransportData", list);
|
||||
compound.setTagList("TransportData", list);
|
||||
}
|
||||
|
||||
public boolean hasTransport(int id) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.IProfileOptions;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.constants.EnumProfileSync;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class ProfileOptions implements IProfileOptions {
|
||||
public EnumProfileSync cooldownControl = EnumProfileSync.Individual;
|
||||
public EnumProfileSync completeControl = EnumProfileSync.Individual;
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
// Party Management
|
||||
enableOptions = compound.getBoolean("EnableProfiles");
|
||||
if (enableOptions) {
|
||||
@@ -30,8 +30,8 @@ public class ProfileOptions implements IProfileOptions {
|
||||
}
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT() {
|
||||
INBTCompound compound = NBT.compound();
|
||||
public INbt writeToNBT() {
|
||||
INbt compound = NBT.compound();
|
||||
compound.setBoolean("EnableProfiles", enableOptions);
|
||||
if (enableOptions) {
|
||||
compound.setInteger("CooldownControl", cooldownControl.ordinal());
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.ISkinOverlay;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
public class SkinOverlay implements ISkinOverlay {
|
||||
private Runnable onChanged;
|
||||
@@ -139,7 +139,7 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
return offsetZ;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
this.texture = compound.getString("SkinOverlayTexture");
|
||||
this.glow = compound.getBoolean("SkinOverlayGlow");
|
||||
this.blend = compound.getBoolean("SkinOverlayBlend");
|
||||
@@ -159,7 +159,7 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
this.offsetZ = compound.getFloat("SkinOverlayOffsetZ");
|
||||
}
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound compound) {
|
||||
public INbt writeToNBT(INbt compound) {
|
||||
compound.setString("SkinOverlayTexture", this.getTexture());
|
||||
compound.setBoolean("SkinOverlayGlow", this.getGlow());
|
||||
compound.setBoolean("SkinOverlayBlend", this.getBlend());
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.ITag;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Tag implements ITag {
|
||||
return name.substring(0, 1).toUpperCase() + name.substring(1);
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
name = compound.getString("Name");
|
||||
color = compound.getInteger("Color");
|
||||
id = compound.getInteger("Slot");
|
||||
@@ -42,7 +42,7 @@ public class Tag implements ITag {
|
||||
uuid = UUID.fromString(compound.getString("Uuid"));
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound compound) {
|
||||
public void writeNBT(INbt compound) {
|
||||
compound.setInteger("Slot", id);
|
||||
compound.setString("Name", name);
|
||||
compound.setInteger("Color", color);
|
||||
@@ -50,12 +50,12 @@ public class Tag implements ITag {
|
||||
compound.setBoolean("HideTag", hideTag);
|
||||
}
|
||||
|
||||
public void readShortNBT(INBTCompound compound) {
|
||||
public void readShortNBT(INbt compound) {
|
||||
name = compound.getString("Name");
|
||||
uuid = UUID.fromString(compound.getString("Uuid"));
|
||||
}
|
||||
|
||||
public void writeShortNBT(INBTCompound compound) {
|
||||
public void writeShortNBT(INbt compound) {
|
||||
compound.setString("Name", name);
|
||||
compound.setString("Uuid", uuid.toString());
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,16 +28,16 @@ public class TagMap {
|
||||
this.tagMap = new HashMap<String, HashSet<UUID>>();
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
this.tagMap = new HashMap<String, HashSet<UUID>>();
|
||||
INBTList list = compound.getList("TagMap", 10);
|
||||
INbtList list = compound.getTagList("TagMap", 10);
|
||||
if (list != null) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound nbttagcompound = list.getCompound(i);
|
||||
INbt nbttagcompound = list.getCompound(i);
|
||||
String cloneName = nbttagcompound.getString("Clone");
|
||||
|
||||
HashSet<UUID> uuids = new HashSet<UUID>();
|
||||
INBTList nbtTagList = nbttagcompound.getList("TagUUIDs", 8);
|
||||
INbtList nbtTagList = nbttagcompound.getTagList("TagUUIDs", 8);
|
||||
for (int j = 0; j < nbtTagList.size(); j++) {
|
||||
String uuid = nbtTagList.getString(j);
|
||||
if (!uuid.isEmpty()) {
|
||||
@@ -49,23 +49,23 @@ public class TagMap {
|
||||
}
|
||||
}
|
||||
|
||||
public INBTCompound writeNBT() {
|
||||
INBTCompound nbt = NBT.compound();
|
||||
INBTList cloneList = NBT.list();
|
||||
public INbt writeNBT() {
|
||||
INbt nbt = NBT.compound();
|
||||
INbtList cloneList = NBT.list();
|
||||
for (String key : tagMap.keySet()) {
|
||||
HashSet<UUID> uuidSet = tagMap.get(key);
|
||||
if (uuidSet.size() > 0) {
|
||||
INBTCompound cloneCompound = NBT.compound();
|
||||
INbt cloneCompound = NBT.compound();
|
||||
cloneCompound.setString("Clone", key);
|
||||
INBTList nbtTagList = NBT.list();
|
||||
INbtList nbtTagList = NBT.list();
|
||||
for (UUID uuid : uuidSet) {
|
||||
nbtTagList.addString(uuid.toString());
|
||||
}
|
||||
cloneCompound.setList("TagUUIDs", nbtTagList);
|
||||
cloneCompound.setTagList("TagUUIDs", nbtTagList);
|
||||
cloneList.addCompound(cloneCompound);
|
||||
}
|
||||
}
|
||||
nbt.setList("TagMap", cloneList);
|
||||
nbt.setTagList("TagMap", cloneList);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.entity.data.ITintData;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
|
||||
public class TintData implements ITintData {
|
||||
private boolean tintEnabled = false;
|
||||
@@ -11,7 +11,7 @@ public class TintData implements ITintData {
|
||||
private int generalTint = 0x000000;
|
||||
private int generalAlpha = 40;
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound nbttagcompound) {
|
||||
public INbt writeToNBT(INbt nbttagcompound) {
|
||||
nbttagcompound.setBoolean("TintEnabled", tintEnabled);
|
||||
if (tintEnabled) {
|
||||
nbttagcompound.setBoolean("HurtTintEnabled", hurtTintEnabled);
|
||||
@@ -23,7 +23,7 @@ public class TintData implements ITintData {
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound nbttagcompound) {
|
||||
public void readFromNBT(INbt nbttagcompound) {
|
||||
tintEnabled = nbttagcompound.getBoolean("TintEnabled");
|
||||
if (tintEnabled) {
|
||||
hurtTintEnabled = nbttagcompound.getBoolean("HurtTintEnabled");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
import noppes.npcs.constants.EnumStockReset;
|
||||
|
||||
@@ -266,7 +266,7 @@ public class TraderStock {
|
||||
|
||||
// ==================== NBT Serialization ====================
|
||||
|
||||
public INBTCompound writeToNBT(INBTCompound compound) {
|
||||
public INbt writeToNBT(INbt compound) {
|
||||
compound.setBoolean("EnableStock", enableStock);
|
||||
compound.setBoolean("PerPlayer", perPlayer);
|
||||
compound.setInteger("ResetType", resetType.ordinal());
|
||||
@@ -276,19 +276,19 @@ public class TraderStock {
|
||||
compound.setLong("LastResetTime", lastResetTime);
|
||||
|
||||
// Save per-player stock
|
||||
INBTList playerList = NBT.list();
|
||||
INbtList playerList = NBT.list();
|
||||
for (Map.Entry<String, PlayerTraderStock> entry : playerStock.entrySet()) {
|
||||
INBTCompound playerTag = NBT.compound();
|
||||
INbt playerTag = NBT.compound();
|
||||
playerTag.setString("Player", entry.getKey());
|
||||
entry.getValue().writeToNBT(playerTag);
|
||||
playerList.addCompound(playerTag);
|
||||
}
|
||||
compound.setList("PlayerStock", playerList);
|
||||
compound.setTagList("PlayerStock", playerList);
|
||||
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
enableStock = compound.getBoolean("EnableStock");
|
||||
perPlayer = compound.getBoolean("PerPlayer");
|
||||
|
||||
@@ -313,9 +313,9 @@ public class TraderStock {
|
||||
|
||||
// Load per-player stock
|
||||
playerStock.clear();
|
||||
INBTList playerList = compound.getList("PlayerStock", 10);
|
||||
INbtList playerList = compound.getTagList("PlayerStock", 10);
|
||||
for (int i = 0; i < playerList.size(); i++) {
|
||||
INBTCompound playerTag = playerList.getCompound(i);
|
||||
INbt playerTag = playerList.getCompound(i);
|
||||
String playerName = playerTag.getString("Player");
|
||||
PlayerTraderStock pStock = new PlayerTraderStock();
|
||||
pStock.readFromNBT(playerTag);
|
||||
@@ -348,11 +348,11 @@ public class TraderStock {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void writeToNBT(INBTCompound compound) {
|
||||
public void writeToNBT(INbt compound) {
|
||||
compound.setIntArray("Purchased", purchasedAmounts);
|
||||
}
|
||||
|
||||
public void readFromNBT(INBTCompound compound) {
|
||||
public void readFromNBT(INbt compound) {
|
||||
int[] loaded = compound.getIntArray("Purchased");
|
||||
if (loaded != null && loaded.length == 18) {
|
||||
purchasedAmounts = loaded;
|
||||
|
||||
@@ -2,8 +2,8 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.ITransportCategory;
|
||||
import noppes.npcs.api.handler.data.ITransportLocation;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -27,11 +27,11 @@ public class TransportCategory implements ITransportCategory {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
id = compound.getInteger("CategoryId");
|
||||
title = compound.getString("CategoryTitle");
|
||||
|
||||
INBTList locs = compound.getList("CategoryLocations", 10);
|
||||
INbtList locs = compound.getTagList("CategoryLocations", 10);
|
||||
if (locs == null || locs.size() == 0)
|
||||
return;
|
||||
|
||||
@@ -43,14 +43,14 @@ public class TransportCategory implements ITransportCategory {
|
||||
}
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound compound) {
|
||||
public void writeNBT(INbt compound) {
|
||||
compound.setInteger("CategoryId", id);
|
||||
compound.setString("CategoryTitle", title);
|
||||
INBTList locs = NBT.list();
|
||||
INbtList locs = NBT.list();
|
||||
for (TransportLocation location : locations.values()) {
|
||||
locs.addCompound(location.writeNBT());
|
||||
}
|
||||
compound.setList("CategoryLocations", locs);
|
||||
compound.setTagList("CategoryLocations", locs);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.handler.data.ITransportLocation;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.core.NBT;
|
||||
|
||||
public class TransportLocation implements ITransportLocation {
|
||||
@@ -23,7 +23,7 @@ public class TransportLocation implements ITransportLocation {
|
||||
this.saveHandler = saveHandler;
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound compound) {
|
||||
public void readNBT(INbt compound) {
|
||||
if (compound == null)
|
||||
return;
|
||||
id = compound.getInteger("Id");
|
||||
@@ -35,8 +35,8 @@ public class TransportLocation implements ITransportLocation {
|
||||
name = compound.getString("Name");
|
||||
}
|
||||
|
||||
public INBTCompound writeNBT() {
|
||||
INBTCompound compound = NBT.compound();
|
||||
public INbt writeNBT() {
|
||||
INbt compound = NBT.compound();
|
||||
compound.setInteger("Id", id);
|
||||
compound.setDouble("PosX", posX);
|
||||
compound.setDouble("PosY", posY);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.core;
|
||||
|
||||
import noppes.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import kamkeel.npcs.platform.PlatformServiceHolder;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.INbtList;
|
||||
|
||||
/**
|
||||
* Convenience factory for creating NBT objects in CORE code.
|
||||
@@ -15,14 +15,14 @@ public final class NBT {
|
||||
/**
|
||||
* Creates a new, empty NBT compound.
|
||||
*/
|
||||
public static INBTCompound compound() {
|
||||
public static INbt compound() {
|
||||
return PlatformServiceHolder.get().nbt().createCompound();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new, empty NBT list.
|
||||
*/
|
||||
public static INBTList list() {
|
||||
public static INbtList list() {
|
||||
return PlatformServiceHolder.get().nbt().createList();
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
* Rules:
|
||||
* - NO imports from net.minecraft.*, cpw.mods.*, net.minecraftforge.*, org.spongepowered.*
|
||||
* - Only java.*, javax.*, noppes.npcs.core.*, noppes.npcs.platform.*, kamkeel.npcs.core.*
|
||||
* - All MC-specific behavior is accessed through noppes.npcs.platform.PlatformServiceHolder
|
||||
* - All MC-specific behavior is accessed through kamkeel.npcs.platform.PlatformServiceHolder
|
||||
*/
|
||||
package noppes.npcs.core;
|
||||
Reference in new issue
Block a user