diff options
author | feildmaster <admin@feildmaster.com> | 2012-10-30 21:21:21 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-10-31 03:44:26 -0400 |
commit | 0eb215cd8f8a0dd6e94b213654d1d8c4698c34c8 (patch) | |
tree | c59666c230a9533bd90c7ba89e1be0421f23ae82 /src/main | |
parent | d982f94d8cfc9ac30279a6735bb94b2a4a6205df (diff) | |
download | bukkit-0eb215cd8f8a0dd6e94b213654d1d8c4698c34c8.tar bukkit-0eb215cd8f8a0dd6e94b213654d1d8c4698c34c8.tar.gz bukkit-0eb215cd8f8a0dd6e94b213654d1d8c4698c34c8.tar.lz bukkit-0eb215cd8f8a0dd6e94b213654d1d8c4698c34c8.tar.xz bukkit-0eb215cd8f8a0dd6e94b213654d1d8c4698c34c8.zip |
Add API for managing and using GameRules. Adds BUKKIT-2757
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/World.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index e758a51d..de49f4d7 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -996,6 +996,45 @@ public interface World extends PluginMessageRecipient, Metadatable { void playSound(Location loc, Sound sound, float volume, float pitch); /** + * Get existing rules + * + * @return An array of rules + */ + public String[] getGameRules(); + + /** + * Gets the current state of the specified rule + * <p /> + * Will return null if rule passed is null + * + * @param rule Rule to look up value of + * @return String value of rule + */ + public String getGameRuleValue(String rule); + + /** + * Set the specified gamerule to specified value. + * <p /> + * The rule may attempt to validate the value passed, will return true if + * value was set. + * <p /> + * If rule is null, the function will return false. + * + * @param rule Rule to set + * @param value Value to set rule to + * @return True if rule was set + */ + public boolean setGameRuleValue(String rule, String value); + + /** + * Checks if string is a valid game rule + * + * @param rule Rule to check + * @return True if rule exists + */ + public boolean isGameRule(String rule); + + /** * Represents various map environment types that a world may be */ public enum Environment { |