Skip to content

Commit

Permalink
Added more detail to the properties documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Swofty-Developments committed Nov 24, 2023
1 parent 1c47aa0 commit 4a1484e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .docs/api/properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ properties.setValue(SlimeProperties.SPAWN_Z, 170);
/* Add as many as you like */
```

Properties can be modified after-the-fact aswell assuming it's loaded in the `worlds.yml` file.
```java
SlimePlugin plugin = (SlimePlugin) Bukkit.getPluginManager().getPlugin("SwoftyWorldManager");
World world = // your world here
WorldsConfig config = plugin.getConfigManager().getWorldConfig();
WorldData worldData = config.getWorlds().get(world.getName());

// Other properties can also be changed, this example is just using the spawn property as an example
worldData.setSpawn(sender.getPlayer().getLocation().getBlockX() + ", " + sender.getPlayer().getLocation().getBlockY() + ", " + sender.getPlayer().getLocation().getBlockZ());

// Save config after the fact
config.save();
```


[1]: ../../swoftyworldmanager-api/src/main/java/com/grinderwolf/swm/api/world/properties/SlimeProperty.java
[2]: ../../swoftyworldmanager-api/src/main/java/com/grinderwolf/swm/api/world/properties/SlimeProperties.java
Expand Down

0 comments on commit 4a1484e

Please sign in to comment.