Initial Paper-API for Bukkit 1.13 Preview 4 - THIS IS NOT SERVER

This branch/commit is only useful to those who purely use a clean Bukkit/Spigot/Paper API
and does not use NMS/OBC references.

This will let you start updating your plugin to the latest 1.13 builds of Bukkit Preview (4 as of now)

Note that this release is not final!!! API breakages may occur!

It is up to you if you find use out of this work.
This commit is contained in:
Aikar 2018-07-13 21:44:35 -04:00
parent fe9d5b5570
commit 898b8957a8
67 changed files with 2833 additions and 123 deletions

View file

@ -9,7 +9,7 @@ on the real tile entity.
This is useful for where performance is needed
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index 235c15bd..359b81f3 100644
index bda9900e..d5d0e255 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -0,0 +0,0 @@ public interface Block extends Metadatable {

View file

@ -10,7 +10,7 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 23cc8b5e..a882323d 100644
index 60cdd620..32ead009 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -5,11 +5,11 @@ Subject: [PATCH] Access items by EquipmentSlot
diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 5d75bd49..ddded787 100644
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
@@ -0,0 +0,0 @@ public interface PlayerInventory extends Inventory {
public int clear(int id, int data);
public void setHeldItemSlot(int slot);
public HumanEntity getHolder();
+

View file

@ -69,7 +69,7 @@ index 3ab2e4c7..8daf2ddc 100644
/**
* Checks if this player is whitelisted or not
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 87a9b750..d874d166 100644
index cd82ff64..2dd9ecfb 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@

View file

@ -40,7 +40,7 @@ index abf68a2c..fcb03b83 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 1a172aa1..32b495fd 100644
index 5dbec412..5955b20c 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java
new file mode 100644
index 00000000..9d56a9e7
index 00000000..0783ac82
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java
@@ -0,0 +0,0 @@
@ -91,10 +91,10 @@ index 00000000..9d56a9e7
+ }
+
+ public enum SlotType {
+ HEAD(DIAMOND_HELMET, GOLD_HELMET, IRON_HELMET, CHAINMAIL_HELMET, LEATHER_HELMET, PUMPKIN, JACK_O_LANTERN),
+ CHEST(DIAMOND_CHESTPLATE, GOLD_CHESTPLATE, IRON_CHESTPLATE, CHAINMAIL_CHESTPLATE, LEATHER_CHESTPLATE, ELYTRA),
+ LEGS(DIAMOND_LEGGINGS, GOLD_LEGGINGS, IRON_LEGGINGS, CHAINMAIL_LEGGINGS, LEATHER_LEGGINGS),
+ FEET(DIAMOND_BOOTS, GOLD_BOOTS, IRON_BOOTS, CHAINMAIL_BOOTS, LEATHER_BOOTS);
+ HEAD(DIAMOND_HELMET, GOLDEN_HELMET, IRON_HELMET, CHAINMAIL_HELMET, LEATHER_HELMET, PUMPKIN, JACK_O_LANTERN),
+ CHEST(DIAMOND_CHESTPLATE, GOLDEN_CHESTPLATE, IRON_CHESTPLATE, CHAINMAIL_CHESTPLATE, LEATHER_CHESTPLATE, ELYTRA),
+ LEGS(DIAMOND_LEGGINGS, GOLDEN_LEGGINGS, IRON_LEGGINGS, CHAINMAIL_LEGGINGS, LEATHER_LEGGINGS),
+ FEET(DIAMOND_BOOTS, GOLDEN_BOOTS, IRON_BOOTS, CHAINMAIL_BOOTS, LEATHER_BOOTS);
+
+ private final Set<Material> mutableTypes = new HashSet<>();
+ private Set<Material> immutableTypes;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add String based Action Bar API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 5ca1a7b2..4478d84d 100644
index f1876a05..d06f26b9 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 4ed7d2dc..4441a8e0 100644
index 2c1056d1..c98349cc 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add async chunk load API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 9b6eb48f..561ef0e1 100644
index 33b14a07..22ab4633 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 73157ff9..fd423664 100644
index 0844862c..bce4ba1b 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
@ -24,7 +24,7 @@ index 73157ff9..fd423664 100644
public static Server.Spigot spigot()
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 18549ce0..032d6211 100644
index d8ce8173..55f4479d 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add configuration option to prevent player names from being
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 5431b17b..ed403c33 100644
index 70495c15..c918d67c 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
@ -27,7 +27,7 @@ index 5431b17b..ed403c33 100644
public static Server.Spigot spigot()
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 83b370e5..87ab9d2b 100644
index cfc39dbe..2d9d68fa 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
@ -57,6 +57,4 @@ index 2abe1208..c660c178 100644
return super.tabComplete(sender, alias, args);
}
return completions;
--
2.17.0 (Apple Git-106)
--

View file

@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 99b90629..559de54e 100644
index ab33e09e..061954f9 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -0,0 +0,0 @@ public interface ItemFactory {
@ -28,7 +28,7 @@ index 99b90629..559de54e 100644
// Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 6bb19b9d..7a52da9b 100644
index 6df4b97a..864b16b1 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add getTPS method
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index e1898343..4f094f7b 100644
index 68b5e1c9..f3252e20 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
@ -26,7 +26,7 @@ index e1898343..4f094f7b 100644
* Get the advancement specified by this key.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 30b99241..a503bb49 100644
index 331bb061..eb98c600 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add player view distance API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 313dde80..5a02b2e8 100644
index 0481f15b..868d0374 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -85,7 +85,7 @@ index 0abad9ad..93fa3493 100644
/**
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index ca9c7796..bd936d9f 100644
index 9f8537d8..cbf810ef 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 0bc47dd6..3b81f81e 100644
index 6417cefa..9b49ed38 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ package org.bukkit;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index fd423664..5431b17b 100644
index bce4ba1b..70495c15 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
@ -26,7 +26,7 @@ index fd423664..5431b17b 100644
public static Server.Spigot spigot()
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 032d6211..83b370e5 100644
index 55f4479d..cfc39dbe 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
@ -96,6 +96,4 @@ index f331a442..a977045d 100644
} else if ("confirm".equalsIgnoreCase(args[0])) {
confirmed = true;
} else {
--
2.17.0 (Apple Git-106)
--

View file

@ -14,7 +14,7 @@ it without having to shade it in the plugin and going through
several layers of logging abstraction.
diff --git a/pom.xml b/pom.xml
index 13994dc2..45145c5f 100644
index e1a39bfe..db9a57b0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
@ -33,7 +33,7 @@ index 13994dc2..45145c5f 100644
<dependency>
<groupId>junit</groupId>
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index c4e22c62..02670254 100644
index 55debf5d..8d2999ac 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -0,0 +0,0 @@ public interface Plugin extends TabExecutor {

View file

@ -239,7 +239,7 @@ index 00000000..d17061e6
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index ed403c33..690d9c07 100644
index c918d67c..01a226d9 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ import org.bukkit.generator.ChunkGenerator;
@ -291,7 +291,7 @@ index ed403c33..690d9c07 100644
public static Server.Spigot spigot()
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 87ab9d2b..f2ee6516 100644
index 2d9d68fa..e7aab4bb 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ import org.bukkit.generator.ChunkGenerator;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 32b495fd..5ca1a7b2 100644
index 5955b20c..f1876a05 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java
index f537f697..52afa6f9 100644
index c8b4efde..bc2df752 100644
--- a/src/main/java/org/bukkit/entity/Enderman.java
+++ b/src/main/java/org/bukkit/entity/Enderman.java
@@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 219ec25f..69fbdb3c 100644
index 28b169d2..9b0f97f1 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable {
@ -25,7 +25,7 @@ index 219ec25f..69fbdb3c 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index bc56fa22..ad2cd13e 100644
index 0b5c062f..48d6c951 100644
--- a/src/main/java/org/bukkit/entity/FallingBlock.java
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java
@@ -0,0 +0,0 @@ public interface FallingBlock extends Entity {

View file

@ -95,7 +95,7 @@ index c1689168..d0d86e1a 100644
@Override
public boolean equals(Object obj) {
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index e7973c73..4ed7d2dc 100644
index cc74cf53..2c1056d1 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View file

@ -380,14 +380,24 @@ index 00000000..2bccc409
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 9794c13e..cc9c2c5e 100644
index 4d0acaf5..0ae85d85 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -0,0 +0,0 @@ public enum Particle {
public Class<?> getDataType() {
SMOKE_LARGE,
SPELL,
SPELL_INSTANT,
- SPELL_MOB,
- SPELL_MOB_AMBIENT,
+ SPELL_MOB(DustOptions.class), // Paper
+ SPELL_MOB_AMBIENT(DustOptions.class), // Paper
SPELL_WITCH,
DRIP_WATER,
DRIP_LAVA,
@@ -0,0 +0,0 @@ public enum Particle {
return dataType;
}
+
+ // Paper start - Particle API expansion
+ /**
+ * Creates a {@link com.destroystokyo.paper.ParticleBuilder}
@ -396,9 +406,11 @@ index 9794c13e..cc9c2c5e 100644
+ return new com.destroystokyo.paper.ParticleBuilder(this);
+ }
+ // Paper end
}
/**
* Options which can be applied to redstone dust particles - a particle
* color and size.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 3b81f81e..e7973c73 100644
index 9b49ed38..cc74cf53 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View file

@ -55,7 +55,7 @@ index 00000000..9072e384
+
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 39684300..23cc8b5e 100644
index 5c29c11e..60cdd620 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ import org.bukkit.scoreboard.Scoreboard;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 89135b86..94ec8189 100644
index f3252e20..a291ebd6 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ import org.bukkit.boss.BarColor;
@ -39,7 +39,7 @@ index 89135b86..94ec8189 100644
{
return server.spigot();
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c81c073d..63624ff6 100644
index eb98c600..2b43ac1f 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ import org.bukkit.boss.BarColor;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Fix upstream javadoc warnings and errors
Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues.
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
index 1ed8f7e4..bd5238ce 100644
index 19632d17..de1b1112 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java
+++ b/src/main/java/org/bukkit/NamespacedKey.java
@@ -0,0 +0,0 @@ public final class NamespacedKey {
@ -21,7 +21,7 @@ index 1ed8f7e4..bd5238ce 100644
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 8d29dcbd..0bc47dd6 100644
index 65156e80..6417cefa 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
@ -112,7 +112,7 @@ index cfce8fa5..8660070b 100644
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 4478d84d..39684300 100644
index d06f26b9..5c29c11e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@ -305,7 +305,7 @@ index 40f8d12b..33d19228 100644
*/
public Collection<PotionEffect> getEffects(PotionType type, boolean upgraded, boolean extended);
diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java
index 60470b88..76313d4d 100644
index 034421a7..f1a54c23 100644
--- a/src/main/java/org/bukkit/potion/PotionType.java
+++ b/src/main/java/org/bukkit/potion/PotionType.java
@@ -0,0 +0,0 @@ public enum PotionType {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses
Change Javadoc to be accurate
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 39523ea7..73157ff9 100644
index a291ebd6..0844862c 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
@ -37,7 +37,7 @@ index 39523ea7..73157ff9 100644
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 28ea20ef..18549ce0 100644
index 2b43ac1f..d8ce8173 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
@ -68,7 +68,7 @@ index 28ea20ef..18549ce0 100644
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 5a02b2e8..52e11da5 100644
index 868d0374..c2977dc4 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 82240129..574cdf3b 100644
index e9f25924..7689c00a 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -0,0 +0,0 @@ package org.bukkit.inventory;
@ -18,7 +18,7 @@ index 82240129..574cdf3b 100644
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
@@ -0,0 +0,0 @@ import org.bukkit.enchantments.Enchantment;
@@ -0,0 +0,0 @@ import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 567706ac..82240129 100644
index 864b16b1..e9f25924 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
@ -15,8 +15,7 @@ index 567706ac..82240129 100644
}
+
+ public int getMaxItemUseDuration() {
+ Material material = Material.getMaterial(type);
+ if (material == null || !material.isItem()) {
+ if (type == null || type == Material.AIR || !type.isItem()) {
+ return 0;
+ }
+ // Requires access to NMS

View file

@ -5,7 +5,7 @@ Subject: [PATCH] POM changes
diff --git a/pom.xml b/pom.xml
index 7c81917d..4c5bda27 100644
index 99ff13b3..cc8fca48 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
@ -22,7 +22,7 @@ index 7c81917d..4c5bda27 100644
+
+ <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<version>1.13-pre5-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Spigot-API</name>
@ -32,13 +32,7 @@ index 7c81917d..4c5bda27 100644
<description>An enhanced plugin API for Minecraft servers.</description>
<properties>
- <maven.compiler.source>1.7</maven.compiler.source>
- <maven.compiler.target>1.7</maven.compiler.target>
+ <!-- Paper - Bump to 1.8 - Get off your dinosaur and get on this rocket ship... -->
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@@ -0,0 +0,0 @@
<distributionManagement>
<repository>
@ -55,34 +49,17 @@ index 7c81917d..4c5bda27 100644
</snapshotRepository>
</distributionManagement>
- <repositories>
- <repository>
- <id>spigotmc-public</id>
- <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
- </repository>
- </repositories>
-
<pluginRepositories>
<pluginRepository>
<id>spigotmc-public</id>
@@ -0,0 +0,0 @@
</pluginRepository>
</pluginRepositories>
+ <repositories>
+ <repository>
+ <id>spigotmc-public</id>
+ <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
+ </repository>
<id>spigotmc-public</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
+ <repository>
+ <id>sonatype</id>
+ <url>https://oss.sonatype.org/content/groups/public/</url>
+ </repository>
+ </repositories>
+
<dependencies>
<dependency>
<groupId>commons-lang</groupId>
</repositories>
<pluginRepositories>
@@ -0,0 +0,0 @@
<version>1.1.1</version>
<scope>compile</scope>
@ -122,10 +99,10 @@ index 7c81917d..4c5bda27 100644
<!-- when downloading via Maven we can pull depends individually -->
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
@@ -0,0 +0,0 @@
</plugin>
</plugins>
</build>
-
- <profiles>
- <profile>
- <id>development</id>
@ -146,7 +123,7 @@ index 7c81917d..4c5bda27 100644
- <configuration>
- <signature>
- <groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java17</artifactId>
- <artifactId>java18</artifactId>
- <version>1.0</version>
- </signature>
- </configuration>

View file

@ -369,7 +369,7 @@ index 00000000..3c2b63db
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 52e11da5..1a172aa1 100644
index c2977dc4..5dbec412 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ package org.bukkit.entity;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 2c7a17df..313dde80 100644
index 116a1e7a..0481f15b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index a882323d..87a9b750 100644
index 32ead009..cd82ff64 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ package org.bukkit.entity;

View file

@ -7,7 +7,7 @@ Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in p
profiles that had to be looked up.
diff --git a/pom.xml b/pom.xml
index c8b37997..13994dc2 100644
index dfc6c9b5..e1a39bfe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@

View file

@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 22ab4633..65156e80 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ import org.bukkit.util.Vector;

View file

@ -3004,7 +3004,7 @@ index 00000000..df592d85
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index eb6b7976..a9081ddb 100644
index 0f42a66a..68b5e1c9 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
@ -3016,7 +3016,7 @@ index eb6b7976..a9081ddb 100644
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 83b66361..bc3211f9 100644
index 9c3eeaa9..331bb061 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
@ -3529,7 +3529,7 @@ index bba914d7..00000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 965f4207..2c7a17df 100644
index 86eca9e1..116a1e7a 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@ -3651,7 +3651,7 @@ index 80c6a72e..759c4617 100644
eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
} else {
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index e43db9da..ca9c7796 100644
index a9fc08e0..9f8537d8 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginDescriptionFile;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/pom.xml b/pom.xml
index 8d4032e2..21a4a8be 100644
index f5e8d49d..dfc6c9b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@

View file

@ -5,11 +5,11 @@ Subject: [PATCH] add Trove and FastUtil to Bukkit
diff --git a/pom.xml b/pom.xml
index 4220760f..623d9eae 100644
index cc8fca48..f5e8d49d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
</repositories>
</pluginRepositories>
<dependencies>
+ <dependency>

View file

@ -7,14 +7,13 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 52a8d4d8..99b90629 100644
index f74f8ae9..ab33e09e 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -0,0 +0,0 @@ public interface ItemFactory {
* @return the default color for leather armor
*/
Color getDefaultLeatherColor();
+
@Deprecated
Material updateMaterial(final ItemMeta meta, final Material material) throws IllegalArgumentException;
+ // Paper start
+ /**
+ * Minecart updates are converting simple item stacks into more complex NBT oriented Item Stacks.
@ -29,11 +28,11 @@ index 52a8d4d8..99b90629 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 188ae6d7..6bb19b9d 100644
index 6324044d..6df4b97a 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
}
result.setDurability(damage);
}
- return result;

View file

@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 690d9c07..682d2bbf 100644
index 01a226d9..b389677a 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
@ -34,7 +34,7 @@ index 690d9c07..682d2bbf 100644
* Gets the plugin manager for interfacing with plugins.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index f2ee6516..2912bdae 100644
index e7aab4bb..17ac4241 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {

View file

@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 10:36:24 +1000
Subject: [PATCH] POM Changes
diff --git a/pom.xml b/pom.xml
index 2ed1e4de..88b109e0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.bukkit</groupId>
- <artifactId>bukkit</artifactId>
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot-api</artifactId>
<version>1.13-pre5-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Bukkit</name>
+ <name>Spigot-API</name>
<url>https://www.spigotmc.org/</url>
- <description>A plugin API for Minecraft servers.</description>
+ <description>An enhanced plugin API for Minecraft servers.</description>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
--

View file

@ -0,0 +1,187 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 15 May 2017 15:16:15 +1000
Subject: [PATCH] Skeleton API Implementations
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index a3eafe70..3ffce71b 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
public static UnsafeValues getUnsafe() {
return server.getUnsafe();
}
+
+ public static Server.Spigot spigot()
+ {
+ return server.spigot();
+ }
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index dc2e1018..61d8077a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
*/
@Deprecated
UnsafeValues getUnsafe();
+
+ // Spigot start
+ public class Spigot
+ {
+
+ }
+
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 4883d182..ab6b1e3a 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
+ // Spigot start
+ public class Spigot
+ {
+
+ }
+
+ Spigot spigot();
+ // Spigot end
/**
* Represents various map environment types that a world may be
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
index 148756b9..5dcd2218 100644
--- a/src/main/java/org/bukkit/command/CommandSender.java
+++ b/src/main/java/org/bukkit/command/CommandSender.java
@@ -0,0 +0,0 @@ public interface CommandSender extends Permissible {
* @return Name of the sender
*/
public String getName();
+
+ // Spigot start
+ public class Spigot
+ {
+
+ }
+
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java
index 752eeb5e..c77f3a4f 100644
--- a/src/main/java/org/bukkit/entity/Arrow.java
+++ b/src/main/java/org/bukkit/entity/Arrow.java
@@ -0,0 +0,0 @@ public interface Arrow extends Projectile {
*/
CREATIVE_ONLY
}
+
+ // Spigot start
+ public class Spigot extends Entity.Spigot
+ {
+
+ }
+
+ @Override
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 9d96976d..294eb7f7 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable {
* @return reaction
*/
PistonMoveReaction getPistonMoveReaction();
+
+ // Spigot start
+ public class Spigot extends CommandSender.Spigot
+ {
+
+ }
+
+ @Override
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
index c8b5154e..ee2218c1 100644
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -0,0 +0,0 @@ public interface LightningStrike extends Weather {
*/
public boolean isEffect();
+ // Spigot start
+ public class Spigot extends Entity.Spigot
+ {
+
+ }
+
+ @Override
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index b862d7b6..92825490 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @return the player's locale
*/
public String getLocale();
+
+ // Spigot start
+ public class Spigot extends Entity.Spigot
+ {
+
+ }
+
+ @Override
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
index d66e3f59..3b6bf419 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
int getPageCount();
BookMeta clone();
+
+ // Spigot start
+ public class Spigot extends ItemMeta.Spigot {
+
+ }
+
+ @Override
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 76d43266..e48616d2 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable {
@SuppressWarnings("javadoc")
ItemMeta clone();
+
+ // Spigot start
+ public class Spigot
+ {
+
+ }
+
+ Spigot spigot();
+ // Spigot end
}
--

View file

@ -0,0 +1,483 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 2 Jun 2013 10:42:57 +1000
Subject: [PATCH] Spigot Timings
Adds performance tracking timings all around the Minecraft Server, and improves the usability of the /timings command
Plugins can track their own timings with CustomTimingsHandler
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 3ffce71b..27c69e96 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
*/
public static void reload() {
server.reload();
+ org.spigotmc.CustomTimingsHandler.reload(); // Spigot
}
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 61d8077a..c9ef86e4 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
public class Spigot
{
+ public org.bukkit.configuration.file.YamlConfiguration getConfig()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
Spigot spigot();
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index d00bad28..7ca5be84 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -0,0 +0,0 @@ public abstract class Command {
protected String usageMessage;
private String permission;
private String permissionMessage;
+ public org.spigotmc.CustomTimingsHandler timings; // Spigot
protected Command(String name) {
this(name, "", "/" + name, new ArrayList<String>());
@@ -0,0 +0,0 @@ public abstract class Command {
this.usageMessage = usageMessage;
this.aliases = aliases;
this.activeAliases = new ArrayList<String>(aliases);
+ this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot
}
/**
@@ -0,0 +0,0 @@ public abstract class Command {
public boolean setLabel(String name) {
this.nextLabel = name;
if (!isRegistered()) {
+ this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot
this.label = name;
return true;
}
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index f81ae85d..1b5b37bf 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -0,0 +0,0 @@ public class SimpleCommandMap implements CommandMap {
}
try {
+ target.timings.startTiming(); // Spigot
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
target.execute(sender, sentCommandLabel, Arrays.copyOfRange(args, 1, args.length));
+ target.timings.stopTiming(); // Spigot
} catch (CommandException ex) {
+ target.timings.stopTiming(); // Spigot
throw ex;
} catch (Throwable ex) {
+ target.timings.stopTiming(); // Spigot
throw new CommandException("Unhandled exception executing '" + commandLine + "' in " + target, ex);
}
diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
index 66ea6345..bba914d7 100644
--- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
@@ -0,0 +0,0 @@ import org.bukkit.util.StringUtil;
import com.google.common.collect.ImmutableList;
+// Spigot start
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.logging.Level;
+
+import org.bukkit.command.RemoteConsoleCommandSender;
+import org.bukkit.plugin.SimplePluginManager;
+import org.spigotmc.CustomTimingsHandler;
+// Spigot end
+
public class TimingsCommand extends BukkitCommand {
- private static final List<String> TIMINGS_SUBCOMMANDS = ImmutableList.of("merged", "reset", "separate");
+ private static final List<String> TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste"); // Spigot
+ public static long timingStart = 0; // Spigot
public TimingsCommand(String name) {
super(name);
- this.description = "Records timings for all plugin events";
- this.usageMessage = "/timings <reset|merged|separate>";
+ this.description = "Manages Spigot Timings data to see performance of the server."; // Spigot
+ this.usageMessage = "/timings <reset|report|on|off|paste>"; // Spigot
this.setPermission("bukkit.command.timings");
}
+ // Spigot start - redesigned Timings Command
+ public void executeSpigotTimings(CommandSender sender, String[] args) {
+ if ( "on".equals( args[0] ) )
+ {
+ ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true );
+ CustomTimingsHandler.reload();
+ sender.sendMessage( "Enabled Timings & Reset" );
+ return;
+ } else if ( "off".equals( args[0] ) )
+ {
+ ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( false );
+ sender.sendMessage( "Disabled Timings" );
+ return;
+ }
+
+ if ( !Bukkit.getPluginManager().useTimings() )
+ {
+ sender.sendMessage( "Please enable timings by typing /timings on" );
+ return;
+ }
+
+ boolean paste = "paste".equals( args[0] );
+ if ("reset".equals(args[0])) {
+ CustomTimingsHandler.reload();
+ sender.sendMessage("Timings reset");
+ } else if ("merged".equals(args[0]) || "report".equals(args[0]) || paste) {
+ long sampleTime = System.nanoTime() - timingStart;
+ int index = 0;
+ File timingFolder = new File("timings");
+ timingFolder.mkdirs();
+ File timings = new File(timingFolder, "timings.txt");
+ ByteArrayOutputStream bout = ( paste ) ? new ByteArrayOutputStream() : null;
+ while (timings.exists()) timings = new File(timingFolder, "timings" + (++index) + ".txt");
+ PrintStream fileTimings = null;
+ try {
+ fileTimings = ( paste ) ? new PrintStream( bout ) : new PrintStream( timings );
+
+ CustomTimingsHandler.printTimings(fileTimings);
+ fileTimings.println( "Sample time " + sampleTime + " (" + sampleTime / 1E9 + "s)" );
+
+ fileTimings.println( "<spigotConfig>" );
+ fileTimings.println( Bukkit.spigot().getConfig().saveToString() );
+ fileTimings.println( "</spigotConfig>" );
+
+ if ( paste )
+ {
+ new PasteThread( sender, bout ).start();
+ return;
+ }
+
+ sender.sendMessage("Timings written to " + timings.getPath());
+ sender.sendMessage( "Paste contents of file into form at http://www.spigotmc.org/go/timings to read results." );
+
+ } catch (IOException e) {
+ } finally {
+ if (fileTimings != null) {
+ fileTimings.close();
+ }
+ }
+ }
+ }
+ // Spigot end
+
@Override
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (!testPermission(sender)) return true;
- if (args.length != 1) {
+ if (args.length < 1) { // Spigot
sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
return false;
}
+ if (true) { executeSpigotTimings(sender, args); return true; } // Spigot
if (!sender.getServer().getPluginManager().useTimings()) {
sender.sendMessage("Please enable timings by setting \"settings.plugin-profiling\" to true in bukkit.yml");
return true;
@@ -0,0 +0,0 @@ public class TimingsCommand extends BukkitCommand {
}
return ImmutableList.of();
}
+
+ // Spigot start
+ private static class PasteThread extends Thread
+ {
+
+ private final CommandSender sender;
+ private final ByteArrayOutputStream bout;
+
+ public PasteThread(CommandSender sender, ByteArrayOutputStream bout)
+ {
+ super( "Timings paste thread" );
+ this.sender = sender;
+ this.bout = bout;
+ }
+
+ @Override
+ public synchronized void start() {
+ if (sender instanceof RemoteConsoleCommandSender) {
+ run();
+ } else {
+ super.start();
+ }
+ }
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ HttpURLConnection con = (HttpURLConnection) new URL( "https://timings.spigotmc.org/paste" ).openConnection();
+ con.setDoOutput( true );
+ con.setRequestMethod( "POST" );
+ con.setInstanceFollowRedirects( false );
+
+ OutputStream out = con.getOutputStream();
+ out.write( bout.toByteArray() );
+ out.close();
+
+ com.google.gson.JsonObject location = new com.google.gson.Gson().fromJson(new java.io.InputStreamReader(con.getInputStream()), com.google.gson.JsonObject.class);
+ con.getInputStream().close();
+
+ String pasteID = location.get( "key" ).getAsString();
+ sender.sendMessage( ChatColor.GREEN + "Timings results can be viewed at https://www.spigotmc.org/go/timings?url=" + pasteID );
+ } catch ( IOException ex )
+ {
+ sender.sendMessage( ChatColor.RED + "Error pasting timings, check your console for more information" );
+ Bukkit.getServer().getLogger().log( Level.WARNING, "Could not paste timings", ex );
+ }
+ }
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 60b23995..8b130abb 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager {
}
}
+ org.bukkit.command.defaults.TimingsCommand.timingStart = System.nanoTime(); // Spigot
return result.toArray(new Plugin[result.size()]);
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index df613b0c..73372534 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginLoader;
import org.bukkit.plugin.RegisteredListener;
import org.bukkit.plugin.TimedRegisteredListener;
import org.bukkit.plugin.UnknownDependencyException;
+import org.spigotmc.CustomTimingsHandler; // Spigot
import org.yaml.snakeyaml.error.YAMLException;
/**
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {
private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), };
private final Map<String, Class<?>> classes = new HashMap<String, Class<?>>();
private final List<PluginClassLoader> loaders = new CopyOnWriteArrayList<PluginClassLoader>();
+ public static final CustomTimingsHandler pluginParentTimer = new CustomTimingsHandler("** Plugins"); // Spigot
/**
* This class was not meant to be constructed explicitly
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {
}
}
+ final CustomTimingsHandler timings = new CustomTimingsHandler("Plugin: " + plugin.getDescription().getFullName() + " Event: " + listener.getClass().getName() + "::" + method.getName()+"("+eventClass.getSimpleName()+")", pluginParentTimer); // Spigot
EventExecutor executor = new EventExecutor() {
public void execute(Listener listener, Event event) throws EventException {
try {
if (!eventClass.isAssignableFrom(event.getClass())) {
return;
}
+ // Spigot start
+ boolean isAsync = event.isAsynchronous();
+ if (!isAsync) timings.startTiming();
method.invoke(listener, event);
+ if (!isAsync) timings.stopTiming();
+ // Spigot end
} catch (InvocationTargetException ex) {
throw new EventException(ex.getCause());
} catch (Throwable t) {
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {
}
}
};
- if (useTimings) {
+ if (false) { // Spigot - RL handles useTimings check now
eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
} else {
eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
new file mode 100644
index 00000000..8d982974
--- /dev/null
+++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java
@@ -0,0 +0,0 @@
+package org.spigotmc;
+
+import org.bukkit.command.defaults.TimingsCommand;
+import org.bukkit.event.HandlerList;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.RegisteredListener;
+import org.bukkit.plugin.TimedRegisteredListener;
+import java.io.PrintStream;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.bukkit.Bukkit;
+import org.bukkit.World;
+
+/**
+ * Provides custom timing sections for /timings merged.
+ */
+public class CustomTimingsHandler
+{
+
+ private static Queue<CustomTimingsHandler> HANDLERS = new ConcurrentLinkedQueue<CustomTimingsHandler>();
+ /*========================================================================*/
+ private final String name;
+ private final CustomTimingsHandler parent;
+ private long count = 0;
+ private long start = 0;
+ private long timingDepth = 0;
+ private long totalTime = 0;
+ private long curTickTotal = 0;
+ private long violations = 0;
+
+ public CustomTimingsHandler(String name)
+ {
+ this( name, null );
+ }
+
+ public CustomTimingsHandler(String name, CustomTimingsHandler parent)
+ {
+ this.name = name;
+ this.parent = parent;
+ HANDLERS.add( this );
+ }
+
+ /**
+ * Prints the timings and extra data to the given stream.
+ *
+ * @param printStream
+ */
+ public static void printTimings(PrintStream printStream)
+ {
+ printStream.println( "Minecraft" );
+ for ( CustomTimingsHandler timings : HANDLERS )
+ {
+ long time = timings.totalTime;
+ long count = timings.count;
+ if ( count == 0 )
+ {
+ continue;
+ }
+ long avg = time / count;
+
+ printStream.println( " " + timings.name + " Time: " + time + " Count: " + count + " Avg: " + avg + " Violations: " + timings.violations );
+ }
+ printStream.println( "# Version " + Bukkit.getVersion() );
+ int entities = 0;
+ int livingEntities = 0;
+ for ( World world : Bukkit.getWorlds() )
+ {
+ entities += world.getEntities().size();
+ livingEntities += world.getLivingEntities().size();
+ }
+ printStream.println( "# Entities " + entities );
+ printStream.println( "# LivingEntities " + livingEntities );
+ }
+
+ /**
+ * Resets all timings.
+ */
+ public static void reload()
+ {
+ if ( Bukkit.getPluginManager().useTimings() )
+ {
+ for ( CustomTimingsHandler timings : HANDLERS )
+ {
+ timings.reset();
+ }
+ }
+ TimingsCommand.timingStart = System.nanoTime();
+ }
+
+ /**
+ * Ticked every tick by CraftBukkit to count the number of times a timer
+ * caused TPS loss.
+ */
+ public static void tick()
+ {
+ if ( Bukkit.getPluginManager().useTimings() )
+ {
+ for ( CustomTimingsHandler timings : HANDLERS )
+ {
+ if ( timings.curTickTotal > 50000000 )
+ {
+ timings.violations += Math.ceil( timings.curTickTotal / 50000000 );
+ }
+ timings.curTickTotal = 0;
+ timings.timingDepth = 0; // incase reset messes this up
+ }
+ }
+ }
+
+ /**
+ * Starts timing to track a section of code.
+ */
+ public void startTiming()
+ {
+ // If second condtion fails we are already timing
+ if ( Bukkit.getPluginManager().useTimings() && ++timingDepth == 1 )
+ {
+ start = System.nanoTime();
+ if ( parent != null && ++parent.timingDepth == 1 )
+ {
+ parent.start = start;
+ }
+ }
+ }
+
+ /**
+ * Stops timing a section of code.
+ */
+ public void stopTiming()
+ {
+ if ( Bukkit.getPluginManager().useTimings() )
+ {
+ if ( --timingDepth != 0 || start == 0 )
+ {
+ return;
+ }
+ long diff = System.nanoTime() - start;
+ totalTime += diff;
+ curTickTotal += diff;
+ count++;
+ start = 0;
+ if ( parent != null )
+ {
+ parent.stopTiming();
+ }
+ }
+ }
+
+ /**
+ * Reset this timer, setting all values to zero.
+ */
+ public void reset()
+ {
+ count = 0;
+ violations = 0;
+ curTickTotal = 0;
+ totalTime = 0;
+ start = 0;
+ timingDepth = 0;
+ }
+}
--

View file

@ -0,0 +1,67 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 4 Mar 2013 18:31:20 +1100
Subject: [PATCH] Add PlayerItemDamageEvent
diff --git a/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java
new file mode 100644
index 00000000..38a72ab8
--- /dev/null
+++ b/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java
@@ -0,0 +0,0 @@
+package org.bukkit.event.player;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.inventory.ItemStack;
+
+public class PlayerItemDamageEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();
+ private final ItemStack item;
+ private int damage;
+ private boolean cancelled = false;
+
+ public PlayerItemDamageEvent(Player player, ItemStack what, int damage) {
+ super(player);
+ this.item = what;
+ this.damage = damage;
+ }
+
+ public ItemStack getItem() {
+ return item;
+ }
+
+ /**
+ * Gets the amount of durability damage this item will be taking.
+ *
+ * @return durability change
+ */
+ public int getDamage() {
+ return damage;
+ }
+
+ public void setDamage(int damage) {
+ this.damage = damage;
+ }
+
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
--

View file

@ -0,0 +1,85 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:20:49 +1000
Subject: [PATCH] BungeeCord Support
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 92825490..0215e0d0 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
public class Spigot extends Entity.Spigot
{
+ /**
+ * Gets the connection address of this player, regardless of whether it
+ * has been spoofed or not.
+ *
+ * @return the player's connection address
+ */
+ public InetSocketAddress getRawAddress()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
index 8b012ea9..de4fb37f 100644
--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
@@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent {
private final String hostname;
private Result result = Result.ALLOWED;
private String message = "";
+ private final InetAddress realAddress; // Spigot
/**
* This constructor defaults message to an empty string, and result to
@@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent {
* @param address The address the player used to connect, provided for
* timing issues
*/
- public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) {
+ public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address, final InetAddress realAddress) { // Spigot
super(player);
this.hostname = hostname;
this.address = address;
+ // Spigot start
+ this.realAddress = realAddress;
+ }
+
+ public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) {
+ this(player, hostname, address, address);
+ // Spigot end
}
/**
@@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent {
* @param result The result status for this event
* @param message The message to be displayed if result denies login
*/
- public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message) {
- this(player, hostname, address);
+ public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message, final InetAddress realAddress) { // Spigot
+ this(player, hostname, address, realAddress); // Spigot
this.result = result;
this.message = message;
}
+ // Spigot start
+ /**
+ * Gets the connection address of this player, regardless of whether it has been spoofed or not.
+ *
+ * @return the player's connection address
+ */
+ public InetAddress getRealAddress() {
+ return realAddress;
+ }
+ // Spigot end
+
/**
* Gets the current result of the login, as an enum
*
--

View file

@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:08:24 +1000
Subject: [PATCH] Add Arrow API
diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java
index c77f3a4f..99814eee 100644
--- a/src/main/java/org/bukkit/entity/Arrow.java
+++ b/src/main/java/org/bukkit/entity/Arrow.java
@@ -0,0 +0,0 @@ public interface Arrow extends Projectile {
public class Spigot extends Entity.Spigot
{
+ public double getDamage()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setDamage(double damage)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
--

View file

@ -0,0 +1,436 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:57:09 +1000
Subject: [PATCH] Add Particle API
diff --git a/src/main/java/org/bukkit/Effect.java b/src/main/java/org/bukkit/Effect.java
index 21f7db58..eeb25812 100644
--- a/src/main/java/org/bukkit/Effect.java
+++ b/src/main/java/org/bukkit/Effect.java
@@ -0,0 +0,0 @@ import java.util.Map;
import com.google.common.collect.Maps;
import org.bukkit.block.BlockFace;
+import org.bukkit.material.MaterialData;
import org.bukkit.potion.Potion;
/**
@@ -0,0 +0,0 @@ public enum Effect {
* The sound of an enderdragon growling
*/
ENDERDRAGON_GROWL(3001, Type.SOUND),
+ /**
+ * The spark that comes off a fireworks
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ FIREWORKS_SPARK("fireworksSpark", Type.PARTICLE),
+ /**
+ * Critical hit particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ CRIT("crit", Type.PARTICLE),
+ /**
+ * Blue critical hit particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ MAGIC_CRIT("magicCrit", Type.PARTICLE),
+ /**
+ * Multicolored potion effect particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ POTION_SWIRL("mobSpell", Type.PARTICLE),
+ /**
+ * Multicolored potion effect particles that are slightly transparent
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ POTION_SWIRL_TRANSPARENT("mobSpellAmbient", Type.PARTICLE),
+ /**
+ * A puff of white potion swirls
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ SPELL("spell", Type.PARTICLE),
+ /**
+ * A puff of white stars
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ INSTANT_SPELL("instantSpell", Type.PARTICLE),
+ /**
+ * A puff of purple particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ WITCH_MAGIC("witchMagic", Type.PARTICLE),
+ /**
+ * The note that appears above note blocks
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ NOTE("note", Type.PARTICLE),
+ /**
+ * The particles shown at nether portals
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ PORTAL("portal", Type.PARTICLE),
+ /**
+ * The symbols that fly towards the enchantment table
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ FLYING_GLYPH("enchantmenttable", Type.PARTICLE),
+ /**
+ * Fire particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ FLAME("flame", Type.PARTICLE),
+ /**
+ * The particles that pop out of lava
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ LAVA_POP("lava", Type.PARTICLE),
+ /**
+ * A small gray square
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ FOOTSTEP("footstep", Type.PARTICLE),
+ /**
+ * Water particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ SPLASH("splash", Type.PARTICLE),
+ /**
+ * Smoke particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ PARTICLE_SMOKE("smoke", Type.PARTICLE),
+ /**
+ * The biggest explosion particle effect
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ EXPLOSION_HUGE("hugeexplosion", Type.PARTICLE),
+ /**
+ * A larger version of the explode particle
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ EXPLOSION_LARGE("largeexplode", Type.PARTICLE),
+ /**
+ * Explosion particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ EXPLOSION("explode", Type.PARTICLE),
+ /**
+ * Small gray particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ VOID_FOG("depthsuspend", Type.PARTICLE),
+ /**
+ * Small gray particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ SMALL_SMOKE("townaura", Type.PARTICLE),
+ /**
+ * A puff of white smoke
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ CLOUD("cloud", Type.PARTICLE),
+ /**
+ * Multicolored dust particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ COLOURED_DUST("reddust", Type.PARTICLE),
+ /**
+ * Snowball breaking
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ SNOWBALL_BREAK("snowballpoof", Type.PARTICLE),
+ /**
+ * The water drip particle that appears on blocks under water
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ WATERDRIP("dripWater", Type.PARTICLE),
+ /**
+ * The lava drip particle that appears on blocks under lava
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ LAVADRIP("dripLava", Type.PARTICLE),
+ /**
+ * White particles
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ SNOW_SHOVEL("snowshovel", Type.PARTICLE),
+ /**
+ * The particle shown when a slime jumps
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ SLIME("slime", Type.PARTICLE),
+ /**
+ * The particle that appears when breading animals
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ HEART("heart", Type.PARTICLE),
+ /**
+ * The particle that appears when hitting a villager
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ VILLAGER_THUNDERCLOUD("angryVillager", Type.PARTICLE),
+ /**
+ * The particle that appears when trading with a villager
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ HAPPY_VILLAGER("happyVillager", Type.PARTICLE),
+ /**
+ * The smoke particles that appears on blazes, minecarts
+ * with furnaces and fire
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ LARGE_SMOKE("largesmoke", Type.PARTICLE),
+ /**
+ * The particles generated when a tool breaks.
+ * This particle requires a Material so that the client can select the correct texture.
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ ITEM_BREAK("iconcrack", Type.PARTICLE, Material.class),
+ /**
+ * The particles generated while breaking a block.
+ * This particle requires a Material and data value so that the client can select the correct texture.
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ TILE_BREAK("blockcrack", Type.PARTICLE, MaterialData.class),
+ /**
+ * The particles generated while sprinting a block
+ * This particle requires a Material and data value so that the client can select the correct texture.
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ TILE_DUST("blockdust", Type.PARTICLE, MaterialData.class)
;
private final int id;
private final Type type;
private final Class<?> data;
private static final Map<Integer, Effect> BY_ID = Maps.newHashMap();
+ private static final Map<String, Effect> BY_NAME = Maps.newHashMap();
+ private final String particleName;
- Effect(int id, Type type) {
+ private Effect(int id, Type type) {
this(id, type, null);
}
- Effect(int id, Type type, Class<?> data) {
+ private Effect(int id, Type type, Class<?> data) {
this.id = id;
this.type = type;
this.data = data;
+ particleName = null;
+ }
+
+ private Effect(String particleName, Type type, Class<?> data) {
+ this.particleName = particleName;
+ this.type = type;
+ id = 0;
+ this.data = data;
+ }
+
+ private Effect(String particleName, Type type) {
+ this.particleName = particleName;
+ this.type = type;
+ id = 0;
+ this.data = null;
}
/**
* Gets the ID for this effect.
*
- * @return ID of this effect
+ * @return if this Effect isn't of type PARTICLE it returns ID of this effect
* @deprecated Magic value
*/
@Deprecated
@@ -0,0 +0,0 @@ public enum Effect {
return this.id;
}
+ /**
+ * Returns the effect's name. This returns null if the effect is not a particle
+ *
+ * @return The effect's name
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ public String getName() {
+ return particleName;
+ }
+
/**
* @return The type of the effect.
*/
@@ -0,0 +0,0 @@ public enum Effect {
}
/**
- * @return The class which represents data for this effect, or null if
- * none
+ * @return if this Effect isn't of type PARTICLE it returns the class which represents data for this effect, or null if none
*/
public Class<?> getData() {
return this.data;
@@ -0,0 +0,0 @@ public enum Effect {
static {
for (Effect effect : values()) {
- BY_ID.put(effect.id, effect);
+ if (effect.type != Type.PARTICLE) {
+ BY_ID.put(effect.id, effect);
+ }
+ }
+ }
+
+ /**
+ * Gets the Effect associated with the given name.
+ *
+ * @param name name of the Effect to return
+ * @return Effect with the given name
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ public static Effect getByName(String name) {
+ return BY_NAME.get(name);
+ }
+
+ static {
+ for (Effect effect : values()) {
+ if (effect.type == Type.PARTICLE) {
+ BY_NAME.put(effect.particleName, effect);
+ }
}
}
/**
* Represents the type of an effect.
*/
- public enum Type {SOUND, VISUAL}
+ public enum Type {SOUND, VISUAL, PARTICLE}
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index ab6b1e3a..89db7303 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
public class Spigot
{
+ /**
+ * Plays an effect to all players within a default radius around a given
+ * location.
+ *
+ * @param location the {@link Location} around which players must be to
+ * see the effect
+ * @param effect the {@link Effect}
+ * @throws IllegalArgumentException if the location or effect is null.
+ * It also throws when the effect requires a material or a material data
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ public void playEffect(Location location, Effect effect)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Plays an effect to all players within a default radius around a given
+ * location. The effect will use the provided material (and material
+ * data if required). The particle's position on the client will be the
+ * given location, adjusted on each axis by a normal distribution with
+ * mean 0 and standard deviation given in the offset parameters, each
+ * particle has independently calculated offsets. The effect will have
+ * the given speed and particle count if the effect is a particle. Some
+ * effect will create multiple particles.
+ *
+ * @param location the {@link Location} around which players must be to
+ * see the effect
+ * @param effect effect the {@link Effect}
+ * @param id the item/block/data id for the effect
+ * @param data the data value of the block/item for the effect
+ * @param offsetX the amount to be randomly offset by in the X axis
+ * @param offsetY the amount to be randomly offset by in the Y axis
+ * @param offsetZ the amount to be randomly offset by in the Z axis
+ * @param speed the speed of the particles
+ * @param particleCount the number of particles
+ * @param radius the radius around the location
+ * @deprecated Spigot specific API, use {@link Particle}.
+ */
+ @Deprecated
+ public void playEffect(Location location, Effect effect, int id, int data, float offsetX, float offsetY, float offsetZ, float speed, int particleCount, int radius)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
Spigot spigot();
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 0215e0d0..7e6b5963 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ @Deprecated
+ public void playEffect(Location location, Effect effect, int id, int data, float offsetX, float offsetY, float offsetZ, float speed, int particleCount, int radius)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
diff --git a/src/test/java/org/bukkit/EffectTest.java b/src/test/java/org/bukkit/EffectTest.java
index 08aa71d3..5217aecb 100644
--- a/src/test/java/org/bukkit/EffectTest.java
+++ b/src/test/java/org/bukkit/EffectTest.java
@@ -0,0 +0,0 @@ public class EffectTest {
@Test
public void getById() {
for (Effect effect : Effect.values()) {
- assertThat(Effect.getById(effect.getId()), is(effect));
+ if (effect.getType() != Effect.Type.PARTICLE) {
+ assertThat(Effect.getById(effect.getId()), is(effect));
+ } else {
+ assertThat(Effect.getByName(effect.getName()), is(effect));
+ }
}
}
}
--

View file

@ -0,0 +1,217 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Shulman <andy.shulman@hotmail.com>
Date: Mon, 15 Apr 2013 20:06:01 -0500
Subject: [PATCH] Define EntitySpawnEvent and SpawnerSpawnEvent
Defines EntitySpawnEvent and SpawnerSpawnEvent. Adds BUKKIT-267 and BUKKIT-1559
diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
index 4a8f2e18..70212ea5 100644
--- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
@@ -0,0 +0,0 @@ package org.bukkit.event.entity;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.Cancellable;
-import org.bukkit.event.HandlerList;
/**
* Called when a creature is spawned into a world.
* <p>
* If a Creature Spawn event is cancelled, the creature will not spawn.
*/
-public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
- private static final HandlerList handlers = new HandlerList();
- private boolean canceled;
+public class CreatureSpawnEvent extends EntitySpawnEvent {
private final SpawnReason spawnReason;
public CreatureSpawnEvent(final LivingEntity spawnee, final SpawnReason spawnReason) {
@@ -0,0 +0,0 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
this.spawnReason = spawnReason;
}
- public boolean isCancelled() {
- return canceled;
- }
-
- public void setCancelled(boolean cancel) {
- canceled = cancel;
- }
-
@Override
public LivingEntity getEntity() {
return (LivingEntity) entity;
}
- /**
- * Gets the location at which the creature is spawning.
- *
- * @return The location at which the creature is spawning
- */
- public Location getLocation() {
- return getEntity().getLocation();
- }
-
/**
* Gets the reason for why the creature is being spawned.
*
@@ -0,0 +0,0 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
return spawnReason;
}
- @Override
- public HandlerList getHandlers() {
- return handlers;
- }
-
- public static HandlerList getHandlerList() {
- return handlers;
- }
-
/**
* An enum to specify the type of spawning
*/
diff --git a/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java b/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java
new file mode 100644
index 00000000..5dcf98f3
--- /dev/null
+++ b/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java
@@ -0,0 +0,0 @@
+package org.bukkit.event.entity;
+
+import org.bukkit.Location;
+import org.bukkit.entity.Entity;
+import org.bukkit.event.HandlerList;
+
+/**
+ * Called when an entity is spawned into a world.
+ * <p>
+ * If an Entity Spawn event is cancelled, the entity will not spawn.
+ */
+public class EntitySpawnEvent extends EntityEvent implements org.bukkit.event.Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean canceled;
+
+ public EntitySpawnEvent(final Entity spawnee) {
+ super(spawnee);
+ }
+
+ public boolean isCancelled() {
+ return canceled;
+ }
+
+ public void setCancelled(boolean cancel) {
+ canceled = cancel;
+ }
+
+ /**
+ * Gets the location at which the entity is spawning.
+ *
+ * @return The location at which the entity is spawning
+ */
+ public Location getLocation() {
+ return getEntity().getLocation();
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java b/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java
index bafd934a..776f8e72 100644
--- a/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java
@@ -0,0 +0,0 @@
package org.bukkit.event.entity;
-import org.bukkit.entity.Item;
import org.bukkit.Location;
-import org.bukkit.event.Cancellable;
-import org.bukkit.event.HandlerList;
+import org.bukkit.entity.Item;
/**
* Called when an item is spawned into a world
*/
-public class ItemSpawnEvent extends EntityEvent implements Cancellable {
- private static final HandlerList handlers = new HandlerList();
- private final Location location;
- private boolean canceled;
-
- public ItemSpawnEvent(final Item spawnee, final Location loc) {
+public class ItemSpawnEvent extends EntitySpawnEvent {
+ public ItemSpawnEvent(final Item spawnee) {
super(spawnee);
- this.location = loc;
}
- public boolean isCancelled() {
- return canceled;
- }
-
- public void setCancelled(boolean cancel) {
- canceled = cancel;
+ @Deprecated
+ public ItemSpawnEvent(final Item spawnee, final Location loc) {
+ this(spawnee);
}
@Override
public Item getEntity() {
return (Item) entity;
}
-
- /**
- * Gets the location at which the item is spawning.
- *
- * @return The location at which the item is spawning
- */
- public Location getLocation() {
- return location;
- }
-
- @Override
- public HandlerList getHandlers() {
- return handlers;
- }
-
- public static HandlerList getHandlerList() {
- return handlers;
- }
}
diff --git a/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java b/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java
new file mode 100644
index 00000000..1acb3c40
--- /dev/null
+++ b/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java
@@ -0,0 +0,0 @@
+package org.bukkit.event.entity;
+
+import org.bukkit.block.CreatureSpawner;
+import org.bukkit.entity.Entity;
+
+/**
+ * Called when an entity is spawned into a world by a spawner.
+ * <p>
+ * If a Spawner Spawn event is cancelled, the entity will not spawn.
+ */
+public class SpawnerSpawnEvent extends EntitySpawnEvent {
+ private final CreatureSpawner spawner;
+
+ public SpawnerSpawnEvent(final Entity spawnee, final CreatureSpawner spawner) {
+ super(spawnee);
+ this.spawner = spawner;
+ }
+
+ public CreatureSpawner getSpawner() {
+ return spawner;
+ }
+}
--

View file

@ -0,0 +1,110 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 2 Jul 2013 20:32:53 +1000
Subject: [PATCH] Entity Mount and Dismount Events
diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
new file mode 100644
index 00000000..24d4942a
--- /dev/null
+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
@@ -0,0 +0,0 @@
+package org.spigotmc.event.entity;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+
+/**
+ * Called when an entity stops riding another entity.
+ *
+ */
+public class EntityDismountEvent extends EntityEvent
+{
+
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
+ private final Entity dismounted;
+
+ public EntityDismountEvent(Entity what, Entity dismounted)
+ {
+ super( what );
+ this.dismounted = dismounted;
+ }
+
+ public Entity getDismounted()
+ {
+ return dismounted;
+ }
+
+ @Override
+ public HandlerList getHandlers()
+ {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList()
+ {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java
new file mode 100644
index 00000000..16aa2a7e
--- /dev/null
+++ b/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java
@@ -0,0 +0,0 @@
+package org.spigotmc.event.entity;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+
+/**
+ * Called when an entity attempts to ride another entity.
+ *
+ */
+public class EntityMountEvent extends EntityEvent implements Cancellable
+{
+
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
+ private final Entity mount;
+
+ public EntityMountEvent(Entity what, Entity mount)
+ {
+ super( what );
+ this.mount = mount;
+ }
+
+ public Entity getMount()
+ {
+ return mount;
+ }
+
+ @Override
+ public boolean isCancelled()
+ {
+ return cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel)
+ {
+ this.cancelled = cancel;
+ }
+
+ @Override
+ public HandlerList getHandlers()
+ {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList()
+ {
+ return handlers;
+ }
+}
--

View file

@ -0,0 +1,52 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 7 Jul 2013 10:32:05 -0400
Subject: [PATCH] InventoryClickEvent getClickedInventory
Add InventoryClickEvent.getClickedInventory. Adds BUKKIT-4495
Plugins currently have to do the logic themselves on the raw slot ID
in order to determine the inventory clicked. This provides the logic for plugins to
readily identify which inventory was clicked.
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
index 55527652..60feaf3b 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
@@ -0,0 +0,0 @@ public class InventoryClickEvent extends InventoryInteractEvent {
private static final HandlerList handlers = new HandlerList();
private final ClickType click;
private final InventoryAction action;
+ private final Inventory clickedInventory;
private SlotType slot_type;
private int whichSlot;
private int rawSlot;
@@ -0,0 +0,0 @@ public class InventoryClickEvent extends InventoryInteractEvent {
super(view);
this.slot_type = type;
this.rawSlot = slot;
+ if (slot < 0) {
+ this.clickedInventory = null;
+ } else if (view.getTopInventory() != null && slot < view.getTopInventory().getSize()) {
+ this.clickedInventory = view.getTopInventory();
+ } else {
+ this.clickedInventory = view.getBottomInventory();
+ }
this.whichSlot = view.convertSlot(slot);
this.click = click;
this.action = action;
@@ -0,0 +0,0 @@ public class InventoryClickEvent extends InventoryInteractEvent {
this.hotbarKey = key;
}
+ /**
+ * Gets the inventory that was clicked, or null if outside of window
+ * @return The clicked inventory
+ */
+ public Inventory getClickedInventory() {
+ return clickedInventory;
+ }
+
/**
* Gets the type of slot that was clicked.
*
--

View file

@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alex Bennett <alex.eugene.bennett@gmail.com>
Date: Thu, 11 Jul 2013 15:31:32 -0500
Subject: [PATCH] Added getAllSessionData() to the Conversation API.
diff --git a/src/main/java/org/bukkit/conversations/ConversationContext.java b/src/main/java/org/bukkit/conversations/ConversationContext.java
index 4f33ff46..7390a771 100644
--- a/src/main/java/org/bukkit/conversations/ConversationContext.java
+++ b/src/main/java/org/bukkit/conversations/ConversationContext.java
@@ -0,0 +0,0 @@ public class ConversationContext {
return forWhom;
}
+ /**
+ * Gets the entire sessionData map.
+ * @return The full sessionData map.
+ */
+ public Map<Object, Object> getAllSessionData() {
+ return sessionData;
+ }
+
/**
* Gets session data shared between all {@link Prompt} invocations. Use
* this as a way to pass data through each Prompt as the conversation
--

View file

@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:20:50 +1000
Subject: [PATCH] Player Collision API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 7e6b5963..2bb9dffa 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ /**
+ * Gets whether the player collides with entities
+ *
+ * @return the player's collision toggle state
+ * @deprecated see {@link LivingEntity#isCollidable()}
+ */
+ @Deprecated
+ public boolean getCollidesWithEntities()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Sets whether the player collides with entities
+ *
+ * @param collides whether the player should collide with entities or
+ * not.
+ * @deprecated {@link LivingEntity#setCollidable(boolean)}
+ */
+ @Deprecated
+ public void setCollidesWithEntities(boolean collides)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
--

View file

@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:42:16 +1000
Subject: [PATCH] Expand Boolean Prompt Values
diff --git a/src/main/java/org/bukkit/conversations/BooleanPrompt.java b/src/main/java/org/bukkit/conversations/BooleanPrompt.java
index c37d1596..6701c175 100644
--- a/src/main/java/org/bukkit/conversations/BooleanPrompt.java
+++ b/src/main/java/org/bukkit/conversations/BooleanPrompt.java
@@ -0,0 +0,0 @@ public abstract class BooleanPrompt extends ValidatingPrompt {
@Override
protected boolean isInputValid(ConversationContext context, String input) {
- String[] accepted = {"true", "false", "on", "off", "yes", "no"};
+ String[] accepted = {"true", "false", "on", "off", "yes", "no" /* Spigot: */, "y", "n", "1", "0", "right", "wrong", "correct", "incorrect", "valid", "invalid"}; // Spigot
return ArrayUtils.contains(accepted, input.toLowerCase());
}
@Override
protected Prompt acceptValidatedInput(ConversationContext context, String input) {
+ if (input.equalsIgnoreCase("y") || input.equals("1") || input.equalsIgnoreCase("right") || input.equalsIgnoreCase("correct") || input.equalsIgnoreCase("valid")) input = "true"; // Spigot
return acceptValidatedInput(context, BooleanUtils.toBoolean(input));
}
--

View file

@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:49:36 +1000
Subject: [PATCH] Add Getter for Entity Invulnerability
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 294eb7f7..28b169d2 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable {
public class Spigot extends CommandSender.Spigot
{
+ /**
+ * Returns whether this entity is invulnerable.
+ *
+ * @return True if the entity is invulnerable.
+ */
+ public boolean isInvulnerable()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
--

View file

@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: ninja- <xninja@openmailbox.org>
Date: Tue, 8 Oct 2013 14:35:58 +0200
Subject: [PATCH] Add respawn API.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 2bb9dffa..226aa6b6 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ /**
+ * Respawns the player if dead.
+ */
+ public void respawn()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
--

View file

@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Smove <jan@lavasurvival.net>
Date: Sat, 1 Feb 2014 18:10:49 +1100
Subject: [PATCH] Implement Locale Getter for Players
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 226aa6b6..e021495e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ /**
+ * Gets player locale language.
+ *
+ * @return the player's client language settings
+ * @deprecated Use {@link Player#getLocale()}
+ */
+ @Deprecated
+ public String getLocale()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
--

View file

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Sun, 9 Feb 2014 14:02:11 -0500
Subject: [PATCH] Add support for fetching hidden players
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index e021495e..5c55c2e2 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ /**
+ * Gets all players hidden with {@link #hidePlayer(org.bukkit.entity.Player)}.
+ *
+ * @return a Set with all hidden players
+ */
+ public java.util.Set<Player> getHiddenPlayers()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
--

View file

@ -0,0 +1,62 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: drXor <mcyoungsota@gmail.com>
Date: Sun, 23 Feb 2014 16:16:29 -0400
Subject: [PATCH] Silenceable Lightning API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 89db7303..33b14a07 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
{
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ /**
+ * Strikes lightning at the given {@link Location} and possibly without sound
+ *
+ * @param loc The location to strike lightning
+ * @param isSilent Whether this strike makes no sound
+ * @return The lightning entity.
+ */
+ public LightningStrike strikeLightning(Location loc, boolean isSilent)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Strikes lightning at the given {@link Location} without doing damage and possibly without sound
+ *
+ * @param loc The location to strike lightning
+ * @param isSilent Whether this strike makes no sound
+ * @return The lightning entity.
+ */
+ public LightningStrike strikeLightningEffect(Location loc, boolean isSilent)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
Spigot spigot();
diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
index ee2218c1..aa809392 100644
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -0,0 +0,0 @@ public interface LightningStrike extends Weather {
public class Spigot extends Entity.Spigot
{
+ /*
+ * Returns whether the strike is silent.
+ *
+ * @return whether the strike is silent.
+ */
+ public boolean isSilent()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
@Override
--

View file

@ -0,0 +1,92 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 30 Mar 2014 15:58:22 +1100
Subject: [PATCH] Remove deprecation on some player lookup methods
Most of these methods still have plenty of use given that only one player with each name can exist at a time. Deprecating these methods renders even basic functionality such as /msg <name> impossible without causing compiler warnings. We will maintain this API and it should be considered safe and appropriate for most use cases.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 27c69e96..0f42a66a 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
* <p>
* This method may not return objects for offline players.
*
- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
- * guaranteed to be unique
* @param name the name to look up
* @return a player if one was found, null otherwise
*/
- @Deprecated
public static Player getPlayer(String name) {
return server.getPlayer(name);
}
@@ -0,0 +0,0 @@ public final class Bukkit {
/**
* Gets the player with the exact given name, case insensitive.
*
- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
- * guaranteed to be unique
* @param name Exact name of the player to retrieve
* @return a player object if one was found, null otherwise
*/
- @Deprecated
public static Player getPlayerExact(String name) {
return server.getPlayerExact(name);
}
@@ -0,0 +0,0 @@ public final class Bukkit {
* This list is not sorted in any particular order. If an exact match is
* found, the returned list will only contain a single result.
*
- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
- * guaranteed to be unique
* @param name the (partial) name to match
* @return list of all possible players
*/
- @Deprecated
public static List<Player> matchPlayer(String name) {
return server.matchPlayer(name);
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c9ef86e4..65ad9aa0 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
* <p>
* This method may not return objects for offline players.
*
- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
- * guaranteed to be unique
* @param name the name to look up
* @return a player if one was found, null otherwise
*/
- @Deprecated
public Player getPlayer(String name);
/**
* Gets the player with the exact given name, case insensitive.
*
- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
- * guaranteed to be unique
* @param name Exact name of the player to retrieve
* @return a player object if one was found, null otherwise
*/
- @Deprecated
public Player getPlayerExact(String name);
/**
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
* This list is not sorted in any particular order. If an exact match is
* found, the returned list will only contain a single result.
*
- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
- * guaranteed to be unique
* @param name the (partial) name to match
* @return list of all possible players
*/
- @Deprecated
public List<Player> matchPlayer(String name);
/**
--

View file

@ -0,0 +1,63 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: ninja <xninja@openmailbox.org>
Date: Tue, 8 Apr 2014 14:01:32 +0200
Subject: [PATCH] Add PlayerSpawnLocationEvent.
diff --git a/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java b/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java
new file mode 100644
index 00000000..dd3f58ca
--- /dev/null
+++ b/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java
@@ -0,0 +0,0 @@
+package org.spigotmc.event.player;
+
+import org.bukkit.Location;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+
+/**
+ * Called when player is about to spawn in a world after joining the server.
+ */
+public class PlayerSpawnLocationEvent extends PlayerEvent {
+ private static final HandlerList handlers = new HandlerList();
+ private Location spawnLocation;
+
+ public PlayerSpawnLocationEvent(final Player who, Location spawnLocation) {
+ super(who);
+ this.spawnLocation = spawnLocation;
+ }
+
+
+ /**
+ * Gets player's spawn location.
+ * If the player {@link Player#hasPlayedBefore()}, it's going to default to the location inside player.dat file.
+ * For new players, the default spawn location is spawn of the main Bukkit world.
+ *
+ * @return the spawn location
+ */
+ public Location getSpawnLocation() {
+ return spawnLocation;
+ }
+
+ /**
+ * Sets player's spawn location.
+ *
+ * @param location the spawn location
+ */
+ public void setSpawnLocation(Location location) {
+ this.spawnLocation = location;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
--

View file

@ -0,0 +1,65 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 16 Jul 2014 17:24:21 +1000
Subject: [PATCH] Ease ClassLoader Deadlocks Where Possible
When on Java 7 we can register the classloader as parallel capable to prevent deadlocks caused by certain scenarios. Due to the nature of PluginClassLoader this isn't completely safe, but we can make it safer by switching to concurrency focused collections. Either way this is far better than crashing the server.
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 73372534..80c6a72e 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -0,0 +0,0 @@ import org.yaml.snakeyaml.error.YAMLException;
public final class JavaPluginLoader implements PluginLoader {
final Server server;
private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), };
- private final Map<String, Class<?>> classes = new HashMap<String, Class<?>>();
+ private final Map<String, Class<?>> classes = new java.util.concurrent.ConcurrentHashMap<String, Class<?>>(); // Spigot
private final List<PluginClassLoader> loaders = new CopyOnWriteArrayList<PluginClassLoader>();
public static final CustomTimingsHandler pluginParentTimer = new CustomTimingsHandler("** Plugins"); // Spigot
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 5eb42df3..a9fc08e0 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginDescriptionFile;
*/
final class PluginClassLoader extends URLClassLoader {
private final JavaPluginLoader loader;
- private final Map<String, Class<?>> classes = new HashMap<String, Class<?>>();
+ private final Map<String, Class<?>> classes = new java.util.concurrent.ConcurrentHashMap<String, Class<?>>(); // Spigot
private final PluginDescriptionFile description;
private final File dataFolder;
private final File file;
@@ -0,0 +0,0 @@ final class PluginClassLoader extends URLClassLoader {
private JavaPlugin pluginInit;
private IllegalStateException pluginState;
+ // Spigot Start
+ static
+ {
+ try
+ {
+ java.lang.reflect.Method method = ClassLoader.class.getDeclaredMethod( "registerAsParallelCapable" );
+ if ( method != null )
+ {
+ boolean oldAccessible = method.isAccessible();
+ method.setAccessible( true );
+ method.invoke( null );
+ method.setAccessible( oldAccessible );
+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.INFO, "Set PluginClassLoader as parallel capable" );
+ }
+ } catch ( NoSuchMethodException ex )
+ {
+ // Ignore
+ } catch ( Exception ex )
+ {
+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.WARNING, "Error setting PluginClassLoader as parallel capable", ex );
+ }
+ }
+ // Spigot End
+
PluginClassLoader(final JavaPluginLoader loader, final ClassLoader parent, final PluginDescriptionFile description, final File dataFolder, final File file) throws IOException, InvalidPluginException, MalformedURLException {
super(new URL[] {file.toURI().toURL()}, parent);
Validate.notNull(loader, "Loader cannot be null");
--

View file

@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: drXor <mcyoung@mit.edu>
Date: Wed, 23 Jul 2014 15:50:36 -0400
Subject: [PATCH] Undeprecate Player#updateInventory()V
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 5c55c2e2..f59c2c19 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
/**
* Forces an update of the player's entire inventory.
*
- * @deprecated This method should not be relied upon as it is a temporary
- * work-around for a larger, more complicated issue.
*/
- @Deprecated
+ //@Deprecated // Spigot - undeprecate
public void updateInventory();
/**
--

View file

@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: libraryaddict <redwarfare@live.com>
Date: Fri, 22 Aug 2014 05:31:04 -0400
Subject: [PATCH] Added isUnbreakable and setUnbreakable to ItemMeta
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index e48616d2..62ddbbba 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable {
public class Spigot
{
+ /**
+ * Sets the unbreakable tag
+ *
+ * @param unbreakable true if set unbreakable
+ * @deprecated see {@link ItemMeta#setUnbreakable(boolean)}
+ */
+ @Deprecated
+ public void setUnbreakable(boolean unbreakable)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Return if the unbreakable tag is true
+ *
+ * @return true if the unbreakable tag is true
+ * @deprecated see {@link ItemMeta#isUnbreakable()}
+ */
+ @Deprecated
+ public boolean isUnbreakable()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
}
Spigot spigot();
--

View file

@ -0,0 +1,449 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sat, 13 Dec 2014 02:59:14 +0100
Subject: [PATCH] BungeeCord Chat API
diff --git a/pom.xml b/pom.xml
index 88b109e0..99ff13b3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
<version>1.21</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>net.md-5</groupId>
+ <artifactId>bungeecord-chat</artifactId>
+ <version>1.12-SNAPSHOT</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+
<!-- testing -->
<dependency>
<groupId>junit</groupId>
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
index b8872b41..adbae51a 100644
--- a/src/main/java/org/bukkit/ChatColor.java
+++ b/src/main/java/org/bukkit/ChatColor.java
@@ -0,0 +0,0 @@ import com.google.common.collect.Maps;
/**
* All supported color values for chat
*/
-public enum ChatColor {
+public enum ChatColor{
/**
* Represents black
*/
- BLACK('0', 0x00),
+ BLACK('0', 0x00) {
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.BLACK;
+ }
+ },
/**
* Represents dark blue
*/
- DARK_BLUE('1', 0x1),
+ DARK_BLUE('1', 0x1){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.DARK_BLUE;
+ }
+ },
/**
* Represents dark green
*/
- DARK_GREEN('2', 0x2),
+ DARK_GREEN('2', 0x2){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.DARK_GREEN;
+ }
+ },
/**
* Represents dark blue (aqua)
*/
- DARK_AQUA('3', 0x3),
+ DARK_AQUA('3', 0x3){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.DARK_AQUA;
+ }
+ },
/**
* Represents dark red
*/
- DARK_RED('4', 0x4),
+ DARK_RED('4', 0x4){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.DARK_RED;
+ }
+ },
/**
* Represents dark purple
*/
- DARK_PURPLE('5', 0x5),
+ DARK_PURPLE('5', 0x5){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.DARK_PURPLE;
+ }
+ },
/**
* Represents gold
*/
- GOLD('6', 0x6),
+ GOLD('6', 0x6){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.GOLD;
+ }
+ },
/**
* Represents gray
*/
- GRAY('7', 0x7),
+ GRAY('7', 0x7){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.GRAY;
+ }
+ },
/**
* Represents dark gray
*/
- DARK_GRAY('8', 0x8),
+ DARK_GRAY('8', 0x8){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.DARK_GRAY;
+ }
+ },
/**
* Represents blue
*/
- BLUE('9', 0x9),
+ BLUE('9', 0x9){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.BLUE;
+ }
+ },
/**
* Represents green
*/
- GREEN('a', 0xA),
+ GREEN('a', 0xA){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.GREEN;
+ }
+ },
/**
* Represents aqua
*/
- AQUA('b', 0xB),
+ AQUA('b', 0xB){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.AQUA;
+ }
+ },
/**
* Represents red
*/
- RED('c', 0xC),
+ RED('c', 0xC){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.RED;
+ }
+ },
/**
* Represents light purple
*/
- LIGHT_PURPLE('d', 0xD),
+ LIGHT_PURPLE('d', 0xD){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.LIGHT_PURPLE;
+ }
+ },
/**
* Represents yellow
*/
- YELLOW('e', 0xE),
+ YELLOW('e', 0xE){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.YELLOW;
+ }
+ },
/**
* Represents white
*/
- WHITE('f', 0xF),
+ WHITE('f', 0xF){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.WHITE;
+ }
+ },
/**
* Represents magical characters that change around randomly
*/
- MAGIC('k', 0x10, true),
+ MAGIC('k', 0x10, true){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.MAGIC;
+ }
+ },
/**
* Makes the text bold.
*/
- BOLD('l', 0x11, true),
+ BOLD('l', 0x11, true){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.BOLD;
+ }
+ },
/**
* Makes a line appear through the text.
*/
- STRIKETHROUGH('m', 0x12, true),
+ STRIKETHROUGH('m', 0x12, true){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.STRIKETHROUGH;
+ }
+ },
/**
* Makes the text appear underlined.
*/
- UNDERLINE('n', 0x13, true),
+ UNDERLINE('n', 0x13, true){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.UNDERLINE;
+ }
+ },
/**
* Makes the text italic.
*/
- ITALIC('o', 0x14, true),
+ ITALIC('o', 0x14, true){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.ITALIC;
+ }
+ },
/**
* Resets all previous chat colors or formats.
*/
- RESET('r', 0x15);
+ RESET('r', 0x15){
+ @Override
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.RESET;
+ }
+ };
/**
* The special character which prefixes all chat colour codes. Use this if
@@ -0,0 +0,0 @@ public enum ChatColor {
this.toString = new String(new char[] {COLOR_CHAR, code});
}
+ public net.md_5.bungee.api.ChatColor asBungee() {
+ return net.md_5.bungee.api.ChatColor.RESET;
+ };
+
/**
* Gets the char value associated with this color
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 65ad9aa0..2b8f039f 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
{
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ /**
+ * Sends the component to the player
+ *
+ * @param component the components to send
+ */
+ public void broadcast(net.md_5.bungee.api.chat.BaseComponent component) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Sends an array of components as a single message to the player
+ *
+ * @param components the components to send
+ */
+ public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
Spigot spigot();
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
index 5dcd2218..abf68a2c 100644
--- a/src/main/java/org/bukkit/command/CommandSender.java
+++ b/src/main/java/org/bukkit/command/CommandSender.java
@@ -0,0 +0,0 @@ public interface CommandSender extends Permissible {
public class Spigot
{
+ /**
+ * Sends this sender a chat component.
+ *
+ * @param component the components to send
+ */
+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Sends an array of components as a single message to the sender.
+ *
+ * @param components the components to send
+ */
+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
Spigot spigot();
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index f59c2c19..86eca9e1 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ @Override
+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Sends the component to the specified screen position of this player
+ *
+ * @param position the screen position
+ * @param component the components to send
+ */
+ public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent component) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Sends an array of components as a single message to the specified screen position of this player
+ *
+ * @param position the screen position
+ * @param components the components to send
+ */
+ public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
@Override
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
index 3b6bf419..75b03ac3 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
@@ -0,0 +0,0 @@
package org.bukkit.inventory.meta;
import java.util.List;
+import net.md_5.bungee.api.chat.BaseComponent;
import org.bukkit.Material;
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
// Spigot start
public class Spigot extends ItemMeta.Spigot {
+ /**
+ * Gets the specified page in the book. The given page must exist.
+ *
+ * @param page the page number to get
+ * @return the page from the book
+ */
+ public BaseComponent[] getPage(int page) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Sets the specified page in the book. Pages of the book must be
+ * contiguous.
+ * <p>
+ * The data can be up to 256 characters in length, additional characters
+ * are truncated.
+ *
+ * @param page the page number to set
+ * @param data the data to set for that page
+ */
+ public void setPage(int page, BaseComponent... data) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Gets all the pages in the book.
+ *
+ * @return list of all the pages in the book
+ */
+ public List<BaseComponent[]> getPages() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Clears the existing book pages, and sets the book to use the provided
+ * pages. Maximum 50 pages with 256 characters per page.
+ *
+ * @param pages A list of pages to set the book to use
+ */
+ public void setPages(List<BaseComponent[]> pages) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Clears the existing book pages, and sets the book to use the provided
+ * pages. Maximum 50 pages with 256 characters per page.
+ *
+ * @param pages A list of component arrays, each being a page
+ */
+ public void setPages(BaseComponent[]... pages) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /**
+ * Adds new pages to the end of the book. Up to a maximum of 50 pages
+ * with 256 characters per page.
+ *
+ * @param pages A list of component arrays, each being a page
+ */
+ public void addPage(BaseComponent[]... pages) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
@Override
--

View file

@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 13 Jul 2015 19:10:15 +1000
Subject: [PATCH] Add restart API.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 2b8f039f..9c3eeaa9 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ /**
+ * Restart the server. If the server administrator has not configured restarting, the server will stop.
+ */
+ public void restart() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
Spigot spigot();
--

View file

@ -37,7 +37,10 @@ function applyPatch {
echo " Applying patches to $target..."
$gitcmd am --abort >/dev/null 2>&1
#TODO: remove
if [ "$what_name" == "Bukkit" ]; then
what_name="../../pre/Bukkit";
fi
# Special case Windows handling because of ARG_MAX constraint
if [[ $windows == "true" ]]; then
echo " Using workaround for Windows ARG_MAX constraint"
@ -69,11 +72,13 @@ function applyPatch {
# Move into spigot dir
cd "$workdir/Spigot"
basedir=$(pwd)
# Apply Spigot
(
applyPatch ../Bukkit Spigot-API HEAD &&
applyPatch ../CraftBukkit Spigot-Server patched
#TODO: remove ../pre/ and reset to HEAD
applyPatch ../Bukkit Spigot-API origin/preview # &&
#applyPatch ../CraftBukkit Spigot-Server patched
) || (
echo "Failed to apply Spigot Patches"
exit 1
@ -84,13 +89,15 @@ cd "$basedir"
echo "Importing MC Dev"
./scripts/importmcdev.sh "$basedir" >/dev/null 2>&1
# TODO: Remove comment
# ./scripts/importmcdev.sh "$basedir" >/dev/null 2>&1
# Apply paper
cd "$basedir"
(
applyPatch "work/Spigot/Spigot-API" Paper-API HEAD &&
applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD
#TODO remove comment
applyPatch "work/Spigot/Spigot-API" Paper-API HEAD # &&
# applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD
) || (
echo "Failed to apply Paper Patches"
exit 1