Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Adds each player in map to the list written in the world cap.
- */
- public CompoundNBT writePlayer() {
- CompoundNBT players = new CompoundNBT();
- for (WorldLifeData data : this.playersMap.values()) {
- CompoundNBT compoundnbt = new CompoundNBT();
- data.write(compoundnbt);
- players.put(this.playerId.toString(), compoundnbt);
- }
- return players;
- }
- public void readPlayer(CompoundNBT nbt) {
- CompoundNBT players = nbt.getCompound("Players");
- this.playersMap.forEach((uuid, info) -> {
- CompoundNBT test = info.write(nbt);
- players.put(uuid.toString(), test);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement