Skip to content

Commit

Permalink
📍[main/WorldData] private all attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepymalc committed Aug 16, 2021
1 parent 541fb40 commit d51e680
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public void loadLocations() {
List<Document> docList = app.dbClient.findMany("Location", Filters.empty());
for (Document doc : docList) {
tagLocationMap.put(doc.getString("tag"),
new Location(this.app.worldManager.getWorldData(WorldManager.world_lobby).world,
doc.getDouble("x"), doc.getDouble("y"), doc.getDouble("z")));
new Location(this.app.worldManager.getWorldData(WorldManager.world_lobby)
.getWorld(), doc.getDouble("x"), doc.getDouble("y"),
doc.getDouble("z")));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void sendWorldTitle(String worldName) {
WorldData wd = app.worldManager.getWorldData(worldName);
if (wd == null)
return;
player.sendTitle(ChatColor.YELLOW + wd.worldName, wd.worldDescription, 20, 80, 20);
player.sendTitle(ChatColor.YELLOW + wd.getWorldName(), wd.getWorldDescription(), 20, 80, 20);
}

/*********
Expand Down
23 changes: 19 additions & 4 deletions src/main/java/com/linyuanlin/minecraft/models/WorldData.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

public class WorldData {

public String worldId;
public String worldName;
public String worldDescription;
public World world;
private String worldId;
private String worldName;
private String worldDescription;
private World world;

public WorldData(String id, String name, String description, World world) {
worldId = id;
Expand All @@ -16,4 +16,19 @@ public WorldData(String id, String name, String description, World world) {
this.world = world;
}

public String getWoldId() {
return worldId;
}

public String getWorldName() {
return worldName;
}

public String getWorldDescription() {
return worldDescription;
}

public World getWorld() {
return world;
}
}

0 comments on commit d51e680

Please sign in to comment.