Merge spawnMinion and spawnMinionAt
This commit is contained in:
@@ -71,60 +71,4 @@ public class MinionPersistentState extends PersistentState {
|
||||
public static void create(MinecraftServer server) {
|
||||
INSTANCE = server.getWorld(World.OVERWORLD).getPersistentStateManager().getOrCreate(TYPE, "minion");
|
||||
}
|
||||
|
||||
public static class MinionData {
|
||||
public UUID uuid;
|
||||
public String name;
|
||||
public boolean programmable;
|
||||
|
||||
public MinionData(UUID uuid, String name, boolean programmable) {
|
||||
this.uuid = uuid;
|
||||
this.name = name;
|
||||
this.programmable = programmable;
|
||||
}
|
||||
|
||||
public NbtCompound writeNbt() {
|
||||
NbtCompound nbt = new NbtCompound();
|
||||
|
||||
/*NbtList posList = new NbtList();
|
||||
posList.add(NbtDouble.of(pos.getX()));
|
||||
posList.add(NbtDouble.of(pos.getY()));
|
||||
posList.add(NbtDouble.of(pos.getZ()));
|
||||
nbt.put("pos", posList);
|
||||
|
||||
NbtList rotList = new NbtList();
|
||||
rotList.add(NbtFloat.of(rot.x));
|
||||
rotList.add(NbtFloat.of(rot.y));
|
||||
nbt.put("rotation", rotList);*/
|
||||
|
||||
nbt.putUuid("uuid", uuid);
|
||||
nbt.putString("name", name);
|
||||
nbt.putBoolean("programmable", programmable);
|
||||
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public static MinionData readNbt(NbtCompound nbt) {
|
||||
/*NbtList posList = nbt.getList("pos", NbtElement.DOUBLE_TYPE);
|
||||
double x = posList.getDouble(0);
|
||||
double y = posList.getDouble(1);
|
||||
double z = posList.getDouble(2);
|
||||
Vec3d pos = new Vec3d(x, y, z);
|
||||
|
||||
NbtList rotList = nbt.getList("rotation", NbtElement.FLOAT_TYPE);
|
||||
float yaw = rotList.getFloat(0);
|
||||
float pitch = rotList.getFloat(1);
|
||||
Vec2f rot = new Vec2f(yaw, pitch);*/
|
||||
|
||||
UUID uuid = nbt.getUuid("uuid");
|
||||
String name = nbt.getString("name");
|
||||
boolean programmable = nbt.getBoolean("programmable");
|
||||
|
||||
return new MinionData(uuid, name, programmable);
|
||||
}
|
||||
|
||||
public static MinionData fromMinion(MinionFakePlayer minion) {
|
||||
return new MinionData(minion.getUuid(), minion.getMinionName(), minion.isProgrammable());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user