summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorTheCutter <info@thecutter.net>2014-12-12 21:41:49 +0100
committermd_5 <git@md-5.net>2014-12-14 09:56:22 +1100
commit7714b7034f4f99387db967f2e6e28ec02a3f1cc5 (patch)
tree10127dbf5ea7efdec2f16aab9a4c7a220138ac5e /src/main
parente858ecfa0902829597966e1d51f9c25089b58d7b (diff)
downloadbukkit-7714b7034f4f99387db967f2e6e28ec02a3f1cc5.tar
bukkit-7714b7034f4f99387db967f2e6e28ec02a3f1cc5.tar.gz
bukkit-7714b7034f4f99387db967f2e6e28ec02a3f1cc5.tar.lz
bukkit-7714b7034f4f99387db967f2e6e28ec02a3f1cc5.tar.xz
bukkit-7714b7034f4f99387db967f2e6e28ec02a3f1cc5.zip
Add WorldBorder API
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/World.java7
-rw-r--r--src/main/java/org/bukkit/WorldBorder.java109
2 files changed, 116 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index d306201c..828d228e 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1168,6 +1168,13 @@ public interface World extends PluginMessageRecipient, Metadatable {
public boolean isGameRule(String rule);
/**
+ * Gets the world border for this world.
+ *
+ * @return The world border for this world.
+ */
+ public WorldBorder getWorldBorder();
+
+ /**
* Represents various map environment types that a world may be
*/
public enum Environment {
diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java
new file mode 100644
index 00000000..10c46051
--- /dev/null
+++ b/src/main/java/org/bukkit/WorldBorder.java
@@ -0,0 +1,109 @@
+package org.bukkit;
+
+public interface WorldBorder {
+
+ /**
+ * Resets the border to default values.
+ */
+ public void reset();
+
+ /**
+ * Gets the current border size.
+ *
+ * @return The current size of the border.
+ */
+ public double getSize();
+
+ /**
+ * Sets the border to a square region with the specified size in blocks.
+ *
+ * @param newSize The new size of the border.
+ */
+ public void setSize(double newSize);
+
+ /**
+ * Sets the border to a square region with the specified size in blocks.
+ *
+ * @param newSize The new size of the border.
+ * @param seconds The time in seconds in which the border grows or shrinks from the previous size to that being set.
+ */
+ public void setSize(double newSize, long seconds);
+
+ /**
+ * Gets the current border center.
+ *
+ * @return The current border center.
+ */
+ public Location getCenter();
+
+ /**
+ * Sets the new border center.
+ *
+ * @param x The new center x-coordinate.
+ * @param z The new center z-coordinate.
+ */
+ public void setCenter(double x, double z);
+
+ /**
+ * Sets the new border center.
+ *
+ * @param location The new location of the border center. (Only x/z used)
+ */
+ public void setCenter(Location location);
+
+ /**
+ * Gets the current border damage buffer.
+ *
+ * @return The current border damage buffer.
+ */
+ public double getDamageBuffer();
+
+ /**
+ * Sets the amount of blocks a player may safely be outside the border before taking damage.
+ *
+ * @param blocks The amount of blocks. (The default is 5 blocks.)
+ */
+ public void setDamageBuffer(double blocks);
+
+ /**
+ * Gets the current border damage amount.
+ *
+ * @return The current border damage amount.
+ */
+ public double getDamageAmount();
+
+ /**
+ * Sets the amount of damage a player takes when outside the border plus the border buffer.
+ *
+ * @param damage The amount of damage. (The default is 0.2 damage per second per block.)
+ */
+ public void setDamageAmount(double damage);
+
+ /**
+ * Gets the current border warning time in seconds.
+ *
+ * @return The current border warning time in seconds.
+ */
+ public int getWarningTime();
+
+ /**
+ * Sets the warning time that causes the screen to be tinted red when a contracting border will reach the player within the specified time.
+ *
+ * @param seconds The amount of time in seconds. (The default is 15 seconds.)
+ */
+ public void setWarningTime(int seconds);
+
+ /**
+ * Gets the current border warning distance.
+ *
+ * @return The current border warning distance.
+ */
+ public int getWarningDistance();
+
+ /**
+ * Sets the warning distance that causes the screen to be tinted red when the player is within the specified number of blocks from the border.
+ *
+ * @param distance The distance in blocks. (The default is 5 blocks.)
+ */
+ public void setWarningDistance(int distance);
+}