summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-12 22:16:31 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-12 22:17:18 +0000
commit1cba399b722405bc774c0dde0392481cf8307331 (patch)
treea9c0355524229ecaa30bbbce54c4404232dc6975
parenteefaca55e98f91fadb1006a3d138795d105d90db (diff)
downloadbukkit-1cba399b722405bc774c0dde0392481cf8307331.tar
bukkit-1cba399b722405bc774c0dde0392481cf8307331.tar.gz
bukkit-1cba399b722405bc774c0dde0392481cf8307331.tar.lz
bukkit-1cba399b722405bc774c0dde0392481cf8307331.tar.xz
bukkit-1cba399b722405bc774c0dde0392481cf8307331.zip
Added new 1.1 items, enchantments. Added WorldType, and a method to set/get the type of a world at creation.
-rw-r--r--src/main/java/org/bukkit/Material.java1
-rw-r--r--src/main/java/org/bukkit/WorldCreator.java22
-rw-r--r--src/main/java/org/bukkit/WorldType.java44
-rw-r--r--src/main/java/org/bukkit/enchantments/Enchantment.java20
-rw-r--r--src/main/java/org/bukkit/enchantments/EnchantmentTarget.java7
5 files changed, 93 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index c61e7dcb..c0bafe88 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -263,6 +263,7 @@ public enum Material {
CAULDRON_ITEM(380),
EYE_OF_ENDER(381),
SPECKLED_MELON(382),
+ MONSTER_EGG(383, 1),
GOLD_RECORD(2256, 1),
GREEN_RECORD(2257, 1),
RECORD_3(2258, 1),
diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java
index fec84f0c..17f30356 100644
--- a/src/main/java/org/bukkit/WorldCreator.java
+++ b/src/main/java/org/bukkit/WorldCreator.java
@@ -13,6 +13,7 @@ public class WorldCreator {
private long seed;
private World.Environment environment = World.Environment.NORMAL;
private ChunkGenerator generator = null;
+ private WorldType type = WorldType.NORMAL;
/**
* Creates an empty WorldCreationOptions for the given world name
@@ -116,6 +117,27 @@ public class WorldCreator {
}
/**
+ * Gets the type of the world that will be created or loaded
+ *
+ * @return World type
+ */
+ public WorldType type() {
+ return type;
+ }
+
+ /**
+ * Sets the type of the world that will be created or loaded
+ *
+ * @param type World type
+ * @return This object, for chaining
+ */
+ public WorldCreator type(WorldType type) {
+ this.type = type;
+
+ return this;
+ }
+
+ /**
* Gets the generator that will be used to create or load the world.
* <p>
* This may be null, in which case the "natural" generator for this environment
diff --git a/src/main/java/org/bukkit/WorldType.java b/src/main/java/org/bukkit/WorldType.java
new file mode 100644
index 00000000..acbf4c05
--- /dev/null
+++ b/src/main/java/org/bukkit/WorldType.java
@@ -0,0 +1,44 @@
+package org.bukkit;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Represents various types of worlds that may exist
+ */
+public enum WorldType {
+ NORMAL("normal"),
+ FLAT("flat");
+
+ private final static Map<String, WorldType> lookup = new HashMap<String, WorldType>();
+ private final String name;
+
+ static {
+ for (WorldType type : values()) {
+ lookup.put(type.getName(), type);
+ }
+ }
+
+ private WorldType(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the name of this WorldType
+ *
+ * @return Name of this type
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets a Worldtype by its name
+ *
+ * @param name Name of the WorldType to get
+ * @return Requested WorldType, or null if not found
+ */
+ public static WorldType getByName(String name) {
+ return lookup.get(name.toUpperCase());
+ }
+}
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
index 646334fc..2ec48540 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -93,6 +93,26 @@ public abstract class Enchantment {
*/
public static final Enchantment LOOT_BONUS_BLOCKS = new EnchantmentWrapper(35);
+ /**
+ * Provides extra damage when shooting arrows from bows
+ */
+ public static final Enchantment ARROW_DAMAGE = new EnchantmentWrapper(48);
+
+ /**
+ * Provides a knockback when an entity is hit by an arrow from a bow
+ */
+ public static final Enchantment ARROW_KNOCKBACK = new EnchantmentWrapper(49);
+
+ /**
+ * Sets entities on fire when hit by arrows shot from a bow
+ */
+ public static final Enchantment ARROW_FIRE = new EnchantmentWrapper(50);
+
+ /**
+ * Provides infinite arrows when shooting a bow
+ */
+ public static final Enchantment ARROW_INFINITE = new EnchantmentWrapper(51);
+
private static final Map<Integer, Enchantment> byId = new HashMap<Integer, Enchantment>();
private static final Map<String, Enchantment> byName = new HashMap<String, Enchantment>();
private static boolean acceptingNew = true;
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
index 74d72234..fa006879 100644
--- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
+++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
@@ -42,5 +42,10 @@ public enum EnchantmentTarget {
/**
* Allows the Enchantment to be placed on tools (spades, pickaxe, hoes, axes)
*/
- TOOL;
+ TOOL,
+
+ /**
+ * Allows the Enchantment to be placed on bows.
+ */
+ BOW;
}