Package simpleserver.nbt

Examples of simpleserver.nbt.NBTInt


    return String.format("%d,%d,%d", x, y, z);
  }

  public NBTCompound tag() {
    NBTCompound tag = new NBTCompound("coordinate");
    tag.put(new NBTInt("x", x));
    tag.put(new NBTInt("y", y));
    tag.put(new NBTInt("z", z));
    tag.put(new NBTInt("dimension", dimension.index()));
    return tag;
  }
View Full Code Here


      return nbt.root().getInt("freezeTime").get();
    }
  }

  public void setFreezeTime(int time) {
    nbt.root().put(new NBTInt("freezeTime", time));
    save();
  }
View Full Code Here

  public void set(Player player, StatField field, int value) {
    getInt(player.getName(), field.toString()).set(value);
  }

  public int add(Player player, StatField field, int amount) {
    NBTInt tag = getInt(player.getName(), field.toString());
    tag.set(tag.get() + amount);
    return tag.get();
  }
View Full Code Here

  private NBTInt getInt(String name, String key) {
    NBTCompound player = getStats(name);
    if (player.containsKey(key)) {
      return player.getInt(key);
    } else {
      NBTInt tag = new NBTInt(key, 0);
      player.put(tag);
      return tag;
    }
  }
View Full Code Here

    old.load();
    for (String name : old.stats.keySet()) {
      Statistic oldStats = old.stats.get(name);
      NBTCompound tag = playerData.get(name);
      NBTCompound stats = new NBTCompound(STATS);
      stats.put(new NBTInt(StatField.PLAY_TIME.toString(), oldStats.minutes));
      stats.put(new NBTInt(StatField.BLOCKS_DESTROYED.toString(), oldStats.blocksDestroyed));
      stats.put(new NBTInt(StatField.BLOCKS_PLACED.toString(), oldStats.blocksPlaced));
      tag.put(stats);
    }
    old.save();
  }
View Full Code Here

  public NBTCompound tag() {
    NBTCompound tag = new NBTCompound(POSITION);
    tag.put(new NBTDouble(X, x));
    tag.put(new NBTDouble(Y, y));
    tag.put(new NBTDouble(Z, z));
    tag.put(new NBTInt(DIMENSION, dimension.index()));
    tag.put(new NBTFloat(YAW, yaw));
    tag.put(new NBTFloat(PITCH, pitch));
    return tag;
  }
View Full Code Here

TOP

Related Classes of simpleserver.nbt.NBTInt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.