Paper 1.9

This commit is contained in:
Zach Brown 2016-02-29 17:09:49 -06:00
parent adb92a86db
commit 99fec76702
180 changed files with 7198 additions and 9759 deletions

View file

@ -1,11 +1,11 @@
From 5d7fe1d8ba54b000f583088bc50141a184818516 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Tue, 6 Jan 2015 22:12:31 -0600
From 6f357f8fcd6d70079999cfc38064ec0df97c4b99 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 17:16:08 -0600
Subject: [PATCH] POM changes
diff --git a/pom.xml b/pom.xml
index cb142f2..d63151f 100644
index dec3b6c..b85201d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,35 +4,37 @@
@ -15,22 +15,22 @@ index cb142f2..d63151f 100644
- <groupId>org.sonatype.oss</groupId>
- <artifactId>oss-parent</artifactId>
- <version>9</version>
+ <groupId>org.github.paperspigot</groupId>
+ <artifactId>paperspigot-parent</artifactId>
+ <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-parent</artifactId>
+ <version>dev-SNAPSHOT</version>
</parent>
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
+ <groupId>org.github.paperspigot</groupId>
+ <artifactId>paperspigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
+ <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-api</artifactId>
<version>1.9-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Spigot-API</name>
- <url>http://www.spigotmc.org/</url>
+ <name>PaperSpigot-API</name>
+ <url>https://hub.spigotmc.org/stash/projects/PAPER/</url>
+ <name>Paper-API</name>
+ <url>https://github.com/PaperSpigot/Paper</url>
<description>An enhanced plugin API for Minecraft servers.</description>
<properties>
@ -65,7 +65,7 @@ index cb142f2..d63151f 100644
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.13</version>
- <version>1.14</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
@ -85,7 +85,7 @@ index cb142f2..d63151f 100644
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>2.4.1</version>
--
2.7.1
2.7.2

View file

@ -1,90 +0,0 @@
From 5db35d30b2c5deb83eae1e6b2f9f9e60dba9a31e Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Mon, 19 May 2014 22:51:45 -0500
Subject: [PATCH] Add float methods to configs
diff --git a/src/main/java/org/bukkit/configuration/ConfigurationSection.java b/src/main/java/org/bukkit/configuration/ConfigurationSection.java
index 1bd7fb5..9afc1dc 100644
--- a/src/main/java/org/bukkit/configuration/ConfigurationSection.java
+++ b/src/main/java/org/bukkit/configuration/ConfigurationSection.java
@@ -355,6 +355,48 @@ public interface ConfigurationSection {
*/
public boolean isDouble(String path);
+ // PaperSpigot start - Add getFloat
+ /**
+ * Gets the requested float by path.
+ * <p>
+ * If the float does not exist but a default value has been specified,
+ * this will return the default value. If the float does not exist and no
+ * default value was specified, this will return 0.
+ *
+ * @param path Path of the float to get.
+ * @return Requested float.
+ */
+ public float getFloat(String path);
+
+ /**
+ * Gets the requested float by path, returning a default value if not
+ * found.
+ * <p>
+ * If the float does not exist then the specified default value will
+ * returned regardless of if a default has been identified in the root
+ * {@link Configuration}.
+ *
+ * @param path Path of the float to get.
+ * @param def The default value to return if the path is not found or is
+ * not a float.
+ * @return Requested float.
+ */
+ public float getFloat(String path, float def);
+
+ /**
+ * Checks if the specified path is a float.
+ * <p>
+ * If the path exists but is not a float, this will return false. If the
+ * path does not exist, this will return false. If the path does not exist
+ * but a default value has been specified, this will check if that default
+ * value is a gloat and return appropriately.
+ *
+ * @param path Path of the float to check.
+ * @return Whether or not the specified path is a float.
+ */
+ public boolean isFloat(String path);
+ // PaperSpigot end
+
/**
* Gets the requested long by path.
* <p>
diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java
index f180bf5..0e2b26a 100644
--- a/src/main/java/org/bukkit/configuration/MemorySection.java
+++ b/src/main/java/org/bukkit/configuration/MemorySection.java
@@ -336,6 +336,23 @@ public class MemorySection implements ConfigurationSection {
return val instanceof Double;
}
+ // PaperSpigot start - Add getFloat
+ public float getFloat(String path) {
+ Object def = getDefault(path);
+ return getFloat(path, (def instanceof Float) ? toFloat(def) : 0);
+ }
+
+ public float getFloat(String path, float def) {
+ Object val = get(path, def);
+ return (val instanceof Float) ? toFloat(val) : def;
+ }
+
+ public boolean isFloat(String path) {
+ Object val = get(path);
+ return val instanceof Float;
+ }
+ // PaperSpigot end
+
public long getLong(String path) {
Object def = getDefault(path);
return getLong(path, (def instanceof Number) ? toLong(def) : 0);
--
1.9.1

View file

@ -0,0 +1,34 @@
From 9a4a2c1714d36269d90b39931fbc0209bacc9194 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Mon, 29 Feb 2016 17:22:34 -0600
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 dc58bea..2721f4c 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1270,6 +1270,20 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
*/
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
+ /**
+ * Get whether the player can affect mob spawning
+ *
+ * @return if the player can affect mob spawning
+ */
+ public boolean getAffectsSpawning();
+
+ /**
+ * Set whether the player can affect mob spawning
+ *
+ * @param affects Whether the player can affect mob spawning
+ */
+ public void setAffectsSpawning(boolean affects);
+
// Spigot start
public class Spigot extends Entity.Spigot
{
--
2.7.2

View file

@ -0,0 +1,46 @@
From 9082960948db00f8186644598d78836679ac08cf Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 29 Feb 2016 17:24:57 -0600
Subject: [PATCH] Add getTPS method
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index dc2c9d1..e19f3d7 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1141,6 +1141,14 @@ public final class Bukkit {
}
/**
+ * Gets the current server TPS
+ * @return current server TPS (1m, 5m, 15m in Paper-Server)
+ */
+ public static double[] getTPS() {
+ return server.getTPS();
+ }
+
+ /**
* @see UnsafeValues
* @return the unsafe values instance
*/
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 69720e9..92a5cbc 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -934,6 +934,13 @@ public interface Server extends PluginMessageRecipient {
BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag ...flags);
/**
+ * Gets the current server TPS
+ *
+ * @return current server TPS (1m, 5m, 15m in Paper-Server)
+ */
+ public double[] getTPS();
+
+ /**
* @see UnsafeValues
* @return the unsafe values instance
*/
--
2.7.2

View file

@ -1,31 +0,0 @@
From 1ada1bf4361c4a6312d2228ad5fa62ade8d0d91e Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 28 May 2015 00:00:29 -0500
Subject: [PATCH] Stop using spigot's website for timings
diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
index fc59aa3..9782a3b 100644
--- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
@@ -94,7 +94,7 @@ public class TimingsCommand extends BukkitCommand {
}
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." );
+ sender.sendMessage( "Paste contents of file into form at http://aikar.co/timings.php to read results." );
} catch (IOException e) {
} finally {
@@ -241,7 +241,7 @@ public class TimingsCommand extends BukkitCommand {
String location = con.getHeaderField( "Location" );
String pasteID = location.substring( "http://paste.ubuntu.com/".length(), location.length() - 1 );
- sender.sendMessage( ChatColor.GREEN + "Timings results can be viewed at http://www.spigotmc.org/go/timings?url=" + pasteID );
+ sender.sendMessage( ChatColor.GREEN + "Timings results can be viewed at http://aikar.co/timings.php?url=" + pasteID );
} catch ( IOException ex )
{
sender.sendMessage( ChatColor.RED + "Error pasting timings, check your console for more information" );
--
2.4.1.windows.1

View file

@ -0,0 +1,92 @@
From 71adf6472ca1b721a50a1258ae05839fe735e00d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 29 Feb 2016 17:43:33 -0600
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 4125633..724d7a9 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -130,6 +130,78 @@ public interface World extends PluginMessageRecipient, Metadatable {
public Chunk getChunkAt(Block block);
/**
+ * Used by {@link World#getChunkAtAsync(Location,ChunkLoadCallback)} methods
+ * to request a {@link Chunk} to be loaded, with this callback receiving
+ * the chunk when it is finished.
+ *
+ * This callback will be executed on synchronously on the main thread.
+ *
+ * Timing and order this callback is fired is intentionally not defined and
+ * and subject to change.
+ */
+ public static interface ChunkLoadCallback {
+ public void onLoad(Chunk chunk);
+ }
+
+ /**
+ * Requests a {@link Chunk} to be loaded at the given coordinates
+ *
+ * This method makes no guarantee on how fast the chunk will load,
+ * and will return the chunk to the callback at a later time.
+ *
+ * You should use this method if you need a chunk but do not need it
+ * immediately, and you wish to let the server control the speed
+ * of chunk loads, keeping performance in mind.
+ *
+ * The {@link ChunkLoadCallback} will always be executed synchronously
+ * on the main Server Thread.
+ *
+ * @param x Chunk X-coordinate of the chunk - (world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - (world coordinate / 16)
+ * @param cb Callback to receive the chunk when it is loaded.
+ * will be executed synchronously
+ */
+ public void getChunkAtAsync(int x, int z, ChunkLoadCallback cb);
+
+ /**
+ * Requests a {@link Chunk} to be loaded at the given {@link Location}
+ *
+ * This method makes no guarantee on how fast the chunk will load,
+ * and will return the chunk to the callback at a later time.
+ *
+ * You should use this method if you need a chunk but do not need it
+ * immediately, and you wish to let the server control the speed
+ * of chunk loads, keeping performance in mind.
+ *
+ * The {@link ChunkLoadCallback} will always be executed synchronously
+ * on the main Server Thread.
+ *
+ * @param location Location of the chunk
+ * @param cb Callback to receive the chunk when it is loaded.
+ * will be executed synchronously
+ */
+ public void getChunkAtAsync(Location location, ChunkLoadCallback cb);
+
+ /**
+ * Requests {@link Chunk} to be loaded that contains the given {@link Block}
+ *
+ * This method makes no guarantee on how fast the chunk will load,
+ * and will return the chunk to the callback at a later time.
+ *
+ * You should use this method if you need a chunk but do not need it
+ * immediately, and you wish to let the server control the speed
+ * of chunk loads, keeping performance in mind.
+ *
+ * The {@link ChunkLoadCallback} will always be executed synchronously
+ * on the main Server Thread.
+ *
+ * @param block Block to get the containing chunk from
+ * @param cb Callback to receive the chunk when it is loaded.
+ * will be executed synchronously
+ */
+ public void getChunkAtAsync(Block block, ChunkLoadCallback cb);
+
+ /**
* Checks if the specified {@link Chunk} is loaded
*
* @param chunk The chunk to check
--
2.7.2

View file

@ -1,42 +0,0 @@
From ca5a9ea7df0a2f0fbe9f584560528dcc1cdb1605 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Fri, 8 Aug 2014 22:51:26 -0500
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 9508e84..f93dcec 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1161,6 +1161,28 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ /**
+ * Get whether the player affects mob spawning
+ *
+ * @return whether or not the player affects
+ * mob spawning.
+ */
+ public boolean getAffectsSpawning()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Set whether or not the player affects mob spawning
+ *
+ * @param affects whether or not the player should affect
+ * spawning or not.
+ */
+ public void setAffectsSpawning(boolean affects)
+ {
+ throw new UnsupportedOperationException( "Not supported yet" );
+ }
}
Spigot spigot();
--
1.9.5.msysgit.1

View file

@ -1,27 +0,0 @@
From 8bce4a508162d640c99efa7ddde38c1fe773d49e Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Sun, 19 Oct 2014 18:22:18 -0500
Subject: [PATCH] Add getTPS method
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 169008a..26acdda 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -956,6 +956,13 @@ public interface Server extends PluginMessageRecipient {
public void restart() {
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ // PaperSpigot start - Add getTPS method
+ public double[] getTPS()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+ // PaperSpigot end
}
Spigot spigot();
--
2.5.0

View file

@ -0,0 +1,41 @@
From a1986bb1ab9932a428e2e58202ee90900c09e620 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Mon, 29 Feb 2016 17:50:31 -0600
Subject: [PATCH] FallingBlock and TNTPrimed source location API
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index bc56fa2..ae9033c 100644
--- a/src/main/java/org/bukkit/entity/FallingBlock.java
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java
@@ -59,4 +59,11 @@ public interface FallingBlock extends Entity {
* @param hurtEntities whether entities will be damaged by this block.
*/
void setHurtEntities(boolean hurtEntities);
+
+ /**
+ * Gets the source block location of the FallingBlock
+ *
+ * @return the source block location the FallingBlock was spawned from
+ */
+ public org.bukkit.Location getSourceLoc();
}
diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java
index 3ce322d..74b82f9 100644
--- a/src/main/java/org/bukkit/entity/TNTPrimed.java
+++ b/src/main/java/org/bukkit/entity/TNTPrimed.java
@@ -35,4 +35,11 @@ public interface TNTPrimed extends Explosive {
* @return the source of this primed TNT
*/
public Entity getSource();
+
+ /**
+ * Gets the source block location of the TNTPrimed
+ *
+ * @return the source block location the TNTPrimed was spawned from
+ */
+ public org.bukkit.Location getSourceLoc();
}
--
2.7.2

View file

@ -1,29 +0,0 @@
From 498f77bac894f37bb813f93a2d3da2c127a2384f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 6 Nov 2014 18:29:20 -0600
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 ab73174..c962e7d 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -129,6 +129,15 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public Chunk getChunkAt(Block block);
+ // PaperSpigot start - Async chunk load API
+ public static interface ChunkLoadCallback {
+ public void onLoad(Chunk chunk);
+ }
+ public void getChunkAtAsync(int x, int z, ChunkLoadCallback cb);
+ public void getChunkAtAsync(Location location, ChunkLoadCallback cb);
+ public void getChunkAtAsync(Block block, ChunkLoadCallback cb);
+ // PaperSpigot end
+
/**
* Checks if the specified {@link Chunk} is loaded
*
--
1.9.1

View file

@ -0,0 +1,77 @@
From 7d9c89c650173fed78c662109eea960d61b6e678 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 17:58:01 -0600
Subject: [PATCH] Check Paper versions
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index b55abdb..e1bea95 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -185,30 +185,17 @@ public class VersionCommand extends BukkitCommand {
private void obtainVersion() {
String version = Bukkit.getVersion();
if (version == null) version = "Custom";
- if (version.startsWith("git-Spigot-")) {
- String[] parts = version.substring("git-Spigot-".length()).split("-");
- int cbVersions = getDistance("craftbukkit", parts[1].substring(0, parts[1].indexOf(' ')));
- int spigotVersions = getDistance("spigot", parts[0]);
- if (cbVersions == -1 || spigotVersions == -1) {
+ // Paper start
+ if (version.startsWith("git-Paper-")) {
+ String[] parts = version.substring("git-Paper-".length()).split("[-\\s]");
+ int paperVersions = getDistance("paper", parts[0]);
+ if (paperVersions == -1) {
setVersionMessage("Error obtaining version information");
} else {
- if (cbVersions == 0 && spigotVersions == 0) {
+ if (paperVersions == 0) {
setVersionMessage("You are running the latest version");
} else {
- setVersionMessage("You are " + (cbVersions + spigotVersions) + " version(s) behind");
- }
- }
-
- } else if (version.startsWith("git-Bukkit-")) {
- version = version.substring("git-Bukkit-".length());
- int cbVersions = getDistance("craftbukkit", version.substring(0, version.indexOf(' ')));
- if (cbVersions == -1) {
- setVersionMessage("Error obtaining version information");
- } else {
- if (cbVersions == 0) {
- setVersionMessage("You are running the latest version");
- } else {
- setVersionMessage("You are " + cbVersions + " version(s) behind");
+ setVersionMessage("You are " + paperVersions + " version(s) behind");
}
}
} else {
@@ -232,17 +219,20 @@ public class VersionCommand extends BukkitCommand {
}
}
- private static int getDistance(String repo, String hash) {
+ private static int getDistance(String repo, String currentVerInt) { // Paper
try {
BufferedReader reader = Resources.asCharSource(
- new URL("https://hub.spigotmc.org/stash/rest/api/1.0/projects/SPIGOT/repos/" + repo + "/commits?since=" + URLEncoder.encode(hash, "UTF-8") + "&withCounts=true"),
+ new URL("https://ci.destroystokyo.com/job/PaperSpigot/lastSuccessfulBuild/buildNumber"), // Paper
Charsets.UTF_8
).openBufferedStream();
try {
- JSONObject obj = (JSONObject) new JSONParser().parse(reader);
- return ((Number) obj.get("totalCount")).intValue();
- } catch (ParseException ex) {
+ // Paper start
+ int newVer = Integer.decode(reader.readLine());
+ int currentVer = Integer.decode(currentVerInt);
+ return newVer - currentVer;
+ } catch (NumberFormatException ex) {
ex.printStackTrace();
+ // Paper end
return -1;
} finally {
reader.close();
--
2.7.2

View file

@ -1,19 +1,20 @@
From eb89a2994624f064ca2508434247629e746a8dd4 Mon Sep 17 00:00:00 2001
From: Isaac Moore <rmsy@me.com>
Date: Mon, 27 Apr 2015 21:41:39 -0500
From 3c8bd87bc36a0c83f24b14609fe615824d1b6002 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 18:02:25 -0600
Subject: [PATCH] Add PlayerLocaleChangeEvent
diff --git a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java
new file mode 100644
index 0000000..3efd159
index 0000000..17afc8c
--- /dev/null
+++ b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
@@ -0,0 +1,46 @@
+package org.bukkit.event.player;
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java
@@ -0,0 +1,47 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+
+/**
+ * Called when the locale of the player is changed.
@ -56,7 +57,6 @@ index 0000000..3efd159
+ return handlers;
+ }
+}
\ No newline at end of file
--
1.9.1
2.7.2

View file

@ -1,25 +0,0 @@
From 28b66c77af202f83255000ebfa9050978a83af4a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 30 Nov 2014 22:57:17 -0600
Subject: [PATCH] Add TNT source location API
diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java
index 3ce322d..7b1b6b6 100644
--- a/src/main/java/org/bukkit/entity/TNTPrimed.java
+++ b/src/main/java/org/bukkit/entity/TNTPrimed.java
@@ -35,4 +35,11 @@ public interface TNTPrimed extends Explosive {
* @return the source of this primed TNT
*/
public Entity getSource();
+
+ /**
+ * Gets the source block location of the primed TNT.
+ *
+ * @return the source block location the TNT was spawned from
+ */
+ public org.bukkit.Location getSourceLoc();
}
--
1.9.1

View file

@ -0,0 +1,34 @@
From 43f1261cbeab869585712a558a8a333b7a316348 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Mon, 29 Feb 2016 18:05:37 -0600
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 2721f4c..ed8b8f1 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1284,6 +1284,20 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
*/
public void setAffectsSpawning(boolean affects);
+ /**
+ * Gets the view distance for this player
+ *
+ * @return the player's view distance
+ */
+ public int getViewDistance();
+
+ /**
+ * Sets the view distance for this player
+ *
+ * @param viewDistance the player's view distance
+ */
+ public void setViewDistance(int viewDistance);
+
// Spigot start
public class Spigot extends Entity.Spigot
{
--
2.7.2

View file

@ -1,63 +0,0 @@
From 386d76f2e47c4d3e3b824d6ec2c25d914fbe6e2c Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Sun, 28 Dec 2014 16:28:21 -0600
Subject: [PATCH] Check PaperSpigot versions
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index b55abdb..e91e1d8 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -185,7 +185,21 @@ public class VersionCommand extends BukkitCommand {
private void obtainVersion() {
String version = Bukkit.getVersion();
if (version == null) version = "Custom";
- if (version.startsWith("git-Spigot-")) {
+ // PaperSpigot start
+ if (version.startsWith("git-PaperSpigot-")) {
+ String[] parts = version.substring("git-PaperSpigot-".length()).split("[-\\s]");
+ int paperSpigotVersions = getDistance("paperspigot", parts[0]);
+ if (paperSpigotVersions == -1) {
+ setVersionMessage("Error obtaining version information");
+ } else {
+ if (paperSpigotVersions == 0) {
+ setVersionMessage("You are running the latest version");
+ } else {
+ setVersionMessage("You are " + paperSpigotVersions + " version(s) behind");
+ }
+ }
+ } else if (version.startsWith("git-Spigot-")) {
+ // PaperSpigot end
String[] parts = version.substring("git-Spigot-".length()).split("-");
int cbVersions = getDistance("craftbukkit", parts[1].substring(0, parts[1].indexOf(' ')));
int spigotVersions = getDistance("spigot", parts[0]);
@@ -232,17 +246,20 @@ public class VersionCommand extends BukkitCommand {
}
}
- private static int getDistance(String repo, String hash) {
+ private static int getDistance(String repo, String currentVerInt) { // PaperSpigot
try {
BufferedReader reader = Resources.asCharSource(
- new URL("https://hub.spigotmc.org/stash/rest/api/1.0/projects/SPIGOT/repos/" + repo + "/commits?since=" + URLEncoder.encode(hash, "UTF-8") + "&withCounts=true"),
+ new URL("https://ci.destroystokyo.com/job/PaperSpigot/lastSuccessfulBuild/buildNumber"), // PaperSpigot
Charsets.UTF_8
).openBufferedStream();
try {
- JSONObject obj = (JSONObject) new JSONParser().parse(reader);
- return ((Number) obj.get("totalCount")).intValue();
- } catch (ParseException ex) {
- ex.printStackTrace();
+ // PaperSpigot start
+ int newVer = Integer.decode(reader.readLine());
+ int currentVer = Integer.decode(currentVerInt);
+ return newVer - currentVer;
+ } catch (NumberFormatException ex) {
+ //ex.printStackTrace();
+ // PaperSpigot end
return -1;
} finally {
reader.close();
--
2.7.1

View file

@ -1,16 +1,16 @@
From f126884b3b8347bc53ee7223e58f653028facacb Mon Sep 17 00:00:00 2001
From 9070ef66368a21f22fca497c89a62e1dacded81a Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Thu, 23 Jul 2015 11:45:20 -0700
Date: Mon, 29 Feb 2016 18:09:40 -0600
Subject: [PATCH] Add BeaconEffectEvent
diff --git a/src/main/java/org/github/paperspigot/event/block/BeaconEffectEvent.java b/src/main/java/org/github/paperspigot/event/block/BeaconEffectEvent.java
diff --git a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
new file mode 100644
index 0000000..d9f9b95
index 0000000..6579ae9
--- /dev/null
+++ b/src/main/java/org/github/paperspigot/event/block/BeaconEffectEvent.java
+++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
@@ -0,0 +1,81 @@
+package org.github.paperspigot.event.block;
+package com.destroystokyo.paper.event.block;
+
+import org.bukkit.block.Block;
+import org.bukkit.entity.Player;
@ -92,5 +92,5 @@ index 0000000..d9f9b95
+ }
+}
--
2.5.1
2.7.2

View file

@ -1,25 +0,0 @@
From f255e1de552da583447620334ba2df03daabf61d Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Fri, 17 Apr 2015 02:43:00 -0700
Subject: [PATCH] Add FallingBlock source location API
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index bc56fa2..240a278 100644
--- a/src/main/java/org/bukkit/entity/FallingBlock.java
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java
@@ -59,4 +59,11 @@ public interface FallingBlock extends Entity {
* @param hurtEntities whether entities will be damaged by this block.
*/
void setHurtEntities(boolean hurtEntities);
+
+ /**
+ * Gets the source block location of the falling block
+ *
+ * @return the source block location the falling block was spawned from
+ */
+ org.bukkit.Location getSourceLoc(); // PaperSpigot - Add FallingBlock source location API
}
--
2.5.2

View file

@ -1,21 +1,22 @@
From 391fd5f868cb9dcafb5be14f3a1efec2eec4faec Mon Sep 17 00:00:00 2001
From 0bae0f2147779322e69049cf9514e97f2b346a0e Mon Sep 17 00:00:00 2001
From: Steve Anton <anxuiz.nx@gmail.com>
Date: Tue, 22 Dec 2015 22:04:15 -0600
Date: Mon, 29 Feb 2016 18:13:58 -0600
Subject: [PATCH] Add PlayerInitialSpawnEvent
For modifying a player's initial spawn location as they join the server
diff --git a/src/main/java/org/bukkit/event/player/PlayerInitialSpawnEvent.java b/src/main/java/org/bukkit/event/player/PlayerInitialSpawnEvent.java
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java
new file mode 100644
index 0000000..be82593
index 0000000..d1d6f33
--- /dev/null
+++ b/src/main/java/org/bukkit/event/player/PlayerInitialSpawnEvent.java
@@ -0,0 +1,42 @@
+package org.bukkit.event.player;
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java
@@ -0,0 +1,43 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+
+public class PlayerInitialSpawnEvent extends PlayerEvent {
+ private static final HandlerList handlers = new HandlerList();
@ -53,7 +54,6 @@ index 0000000..be82593
+ return handlers;
+ }
+}
\ No newline at end of file
--
2.6.4
2.7.2

View file

@ -1,40 +0,0 @@
From 4159fb44e468dfea3813b86d3c69956393ec8dde Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 1 Jul 2015 00:59:50 -0700
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 f93dcec..7522d45 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1183,6 +1183,26 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet" );
}
+
+ /**
+ * Get the view distance for this player
+ *
+ * @return View distance
+ */
+ public int getViewDistance()
+ {
+ throw new UnsupportedOperationException( "Not supported yet" );
+ }
+
+ /**
+ * Set the view distance for this player
+ *
+ * @param viewDistance View distance
+ */
+ public void setViewDistance(int viewDistance)
+ {
+ throw new UnsupportedOperationException( "Not supported yet" );
+ }
}
Spigot spigot();
--
1.9.5.msysgit.1

View file

@ -1,14 +1,19 @@
From b5e8582ab199f61b7dcdf2520e9a921907f4e35f Mon Sep 17 00:00:00 2001
From 2913f79fb789598971e82b36b116972502375d43 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 8 Jan 2016 23:12:28 -0600
Date: Mon, 29 Feb 2016 18:48:17 -0600
Subject: [PATCH] Timings v2
diff --git a/pom.xml b/pom.xml
index d63151f..fe9d6d2 100644
index 2e8b318..3be5e5b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,6 +48,13 @@
@@ -1,4 +1,3 @@
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>
@@ -48,6 +47,13 @@
<dependencies>
<dependency>
@ -1709,7 +1714,7 @@ index 0000000..fe19ea0
+ parent.put("config", createObject(
+ pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
+ pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
+ pair("paperspigot", mapAsJSON(Bukkit.spigot().getPaperSpigotConfig(), null))
+ pair("paperspigot", mapAsJSON(Bukkit.spigot().getPaperConfig(), null))
+ ));
+
+ new TimingsExport(sender, parent, history).start();
@ -2778,10 +2783,10 @@ index 0000000..3a288d2
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 584fe11..a4396e8 100644
index e19f3d7..8d602a3 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -533,7 +533,6 @@ public final class Bukkit {
@@ -537,7 +537,6 @@ public final class Bukkit {
*/
public static void reload() {
server.reload();
@ -2790,10 +2795,10 @@ index 584fe11..a4396e8 100644
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 26acdda..ae75bd4 100644
index 92a5cbc..86fe389 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -926,12 +926,27 @@ public interface Server extends PluginMessageRecipient {
@@ -949,12 +949,27 @@ public interface Server extends PluginMessageRecipient {
public class Spigot
{
@ -2814,7 +2819,7 @@ index 26acdda..ae75bd4 100644
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public org.bukkit.configuration.file.YamlConfiguration getPaperSpigotConfig()
+ public org.bukkit.configuration.file.YamlConfiguration getPaperConfig()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
@ -2896,26 +2901,56 @@ index a08a49d..a300ae7 100644
fallbackPrefix = fallbackPrefix.toLowerCase().trim();
boolean registered = register(label, command, false, fallbackPrefix);
diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
index 9782a3b..80e0b0f 100644
deleted file mode 100644
index fc59aa3..0000000
--- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
@@ -33,87 +33,22 @@ import org.spigotmc.CustomTimingsHandler;
// Spigot end
public class TimingsCommand extends BukkitCommand {
+++ /dev/null
@@ -1,253 +0,0 @@
-package org.bukkit.command.defaults;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang.Validate;
-import org.bukkit.Bukkit;
-import org.bukkit.ChatColor;
-import org.bukkit.command.CommandSender;
-import org.bukkit.event.Event;
-import org.bukkit.event.HandlerList;
-import org.bukkit.plugin.Plugin;
-import org.bukkit.plugin.RegisteredListener;
-import org.bukkit.plugin.TimedRegisteredListener;
-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("report", "reset", "on", "off", "paste"); // Spigot
- public static long timingStart = 0; // Spigot
+ public static final List<String> TIMINGS_SUBCOMMANDS = ImmutableList.of("merged", "reset", "separate");
public TimingsCommand(String name) {
super(name);
-
- public TimingsCommand(String name) {
- super(name);
- this.description = "Manages Spigot Timings data to see performance of the server."; // Spigot
- this.usageMessage = "/timings <reset|report|on|off|paste>"; // Spigot
+ this.description = "Records timings for all plugin events";
+ this.usageMessage = "/timings <reset>";
this.setPermission("bukkit.command.timings");
}
- this.setPermission("bukkit.command.timings");
- }
-
- // Spigot start - redesigned Timings Command
- public void executeSpigotTimings(CommandSender sender, String[] args) {
- if ( "on".equals( args[0] ) )
@ -2967,7 +3002,7 @@ index 9782a3b..80e0b0f 100644
- }
-
- sender.sendMessage("Timings written to " + timings.getPath());
- sender.sendMessage( "Paste contents of file into form at http://aikar.co/timings.php to read results." );
- sender.sendMessage( "Paste contents of file into form at http://www.spigotmc.org/go/timings to read results." );
-
- } catch (IOException e) {
- } finally {
@ -2979,22 +3014,99 @@ index 9782a3b..80e0b0f 100644
- }
- // Spigot end
-
@Override
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (!testPermission(sender)) return true;
- @Override
- public boolean execute(CommandSender sender, String currentAlias, String[] args) {
- if (!testPermission(sender)) return true;
- if (args.length < 1) { // Spigot
+ if (args.length != 1) {
sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
return false;
}
- 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;
@@ -199,55 +134,4 @@ public class TimingsCommand extends BukkitCommand {
}
return ImmutableList.of();
}
- if (!sender.getServer().getPluginManager().useTimings()) {
- sender.sendMessage("Please enable timings by setting \"settings.plugin-profiling\" to true in bukkit.yml");
- return true;
- }
-
- boolean separate = "separate".equalsIgnoreCase(args[0]);
- if ("reset".equalsIgnoreCase(args[0])) {
- for (HandlerList handlerList : HandlerList.getHandlerLists()) {
- for (RegisteredListener listener : handlerList.getRegisteredListeners()) {
- if (listener instanceof TimedRegisteredListener) {
- ((TimedRegisteredListener)listener).reset();
- }
- }
- }
- sender.sendMessage("Timings reset");
- } else if ("merged".equalsIgnoreCase(args[0]) || separate) {
-
- int index = 0;
- int pluginIdx = 0;
- File timingFolder = new File("timings");
- timingFolder.mkdirs();
- File timings = new File(timingFolder, "timings.txt");
- File names = null;
- while (timings.exists()) timings = new File(timingFolder, "timings" + (++index) + ".txt");
- PrintStream fileTimings = null;
- PrintStream fileNames = null;
- try {
- fileTimings = new PrintStream(timings);
- if (separate) {
- names = new File(timingFolder, "names" + index + ".txt");
- fileNames = new PrintStream(names);
- }
- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
- pluginIdx++;
- long totalTime = 0;
- if (separate) {
- fileNames.println(pluginIdx + " " + plugin.getDescription().getFullName());
- fileTimings.println("Plugin " + pluginIdx);
- }
- else fileTimings.println(plugin.getDescription().getFullName());
- for (RegisteredListener listener : HandlerList.getRegisteredListeners(plugin)) {
- if (listener instanceof TimedRegisteredListener) {
- TimedRegisteredListener trl = (TimedRegisteredListener) listener;
- long time = trl.getTotalTime();
- int count = trl.getCount();
- if (count == 0) continue;
- long avg = time / count;
- totalTime += time;
- Class<? extends Event> eventClass = trl.getEventClass();
- if (count > 0 && eventClass != null) {
- fileTimings.println(" " + eventClass.getSimpleName() + (trl.hasMultiple() ? " (and sub-classes)" : "") + " Time: " + time + " Count: " + count + " Avg: " + avg);
- }
- }
- }
- fileTimings.println(" Total time " + totalTime + " (" + totalTime / 1000000000 + "s)");
- }
- sender.sendMessage("Timings written to " + timings.getPath());
- if (separate) sender.sendMessage("Names written to " + names.getPath());
- } catch (IOException e) {
- } finally {
- if (fileTimings != null) {
- fileTimings.close();
- }
- if (fileNames != null) {
- fileNames.close();
- }
- }
- } else {
- sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
- return false;
- }
- return true;
- }
-
- @Override
- public List<String> tabComplete(CommandSender sender, String alias, String[] args) {
- Validate.notNull(sender, "Sender cannot be null");
- Validate.notNull(args, "Arguments cannot be null");
- Validate.notNull(alias, "Alias cannot be null");
-
- if (args.length == 1) {
- return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS, new ArrayList<String>(TIMINGS_SUBCOMMANDS.size()));
- }
- return ImmutableList.of();
- }
-
- // Spigot start
- private static class PasteThread extends Thread
@ -3037,7 +3149,7 @@ index 9782a3b..80e0b0f 100644
-
- String location = con.getHeaderField( "Location" );
- String pasteID = location.substring( "http://paste.ubuntu.com/".length(), location.length() - 1 );
- sender.sendMessage( ChatColor.GREEN + "Timings results can be viewed at http://aikar.co/timings.php?url=" + pasteID );
- sender.sendMessage( ChatColor.GREEN + "Timings results can be viewed at http://www.spigotmc.org/go/timings?url=" + pasteID );
- } catch ( IOException ex )
- {
- sender.sendMessage( ChatColor.RED + "Error pasting timings, check your console for more information" );
@ -3046,14 +3158,14 @@ index 9782a3b..80e0b0f 100644
- }
- }
- // Spigot end
}
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 7522d45..c0ebe65 100644
index ed8b8f1..855bde5 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1203,6 +1203,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet" );
@@ -1384,6 +1384,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ public int getPing()
@ -3426,5 +3538,5 @@ index 8d98297..7e89b97 100644
- }
}
--
2.7.1
2.7.2

View file

@ -1,12 +1,12 @@
From c2382d5656ff7e3c1b42ecc8cec1278b60b366d9 Mon Sep 17 00:00:00 2001
From 78cc4ff51183b89e12aa39a47d39bf06497613ea Mon Sep 17 00:00:00 2001
From: DemonWav <demonwav@gmail.com>
Date: Sat, 30 Jan 2016 18:58:09 -0600
Date: Mon, 29 Feb 2016 19:37:41 -0600
Subject: [PATCH] Add Location support to tab completers (vanilla feature
missing in CraftBukkit)
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 548d570..c126a1e 100644
index 548d570..18c54b3 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -8,6 +8,7 @@ import java.util.Set;
@ -17,11 +17,12 @@ index 548d570..c126a1e 100644
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.entity.minecart.CommandMinecart;
@@ -109,6 +110,30 @@ public abstract class Command {
@@ -109,6 +110,31 @@ public abstract class Command {
return matchedPlayers;
}
+ // PaperSpigot start - location tab-completes
+ // Paper start - location tab-completes
+
+ /**
+ * Executed on tab completion for this command, returning a list of options the player can tab through. This method
+ * returns the {@link Location} of the block the player is looking at at the time of the tab complete.
@ -31,46 +32,40 @@ index 548d570..c126a1e 100644
+ * attempts the tab complete. For this to be valid, the block must be highlighted by the player (i.e. the player is
+ * close enough to interact with the block).
+ *
+ * @param sender Source object which is executing this command
+ * @param alias the alias being used
+ * @param args All arguments passed to the command, split via ' '
+ * @param sender Source object which is executing this command
+ * @param alias the alias being used
+ * @param args All arguments passed to the command, split via ' '
+ * @param location the location of the block the player is looking at
+ * @return a list of tab-completions for the specified arguments. This
+ * will never be null. List may be immutable.
+ * will never be null. List may be immutable.
+ * @throws IllegalArgumentException if sender, alias, or args is null
+ */
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
+ // Simply default to the standard tab-complete, subclasses can override this if needed
+ return tabComplete(sender, alias, args);
+ }
+ // PaperSpigot end
+ // Paper end
+
/**
* Returns the name of this command
*
diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java
index 3bfa31f..597d7c2 100644
index 3bfa31f..9b93872 100644
--- a/src/main/java/org/bukkit/command/PluginCommand.java
+++ b/src/main/java/org/bukkit/command/PluginCommand.java
@@ -1,10 +1,11 @@
package org.bukkit.command;
@@ -3,6 +3,7 @@ package org.bukkit.command;
import java.util.List;
-import java.util.List;
-
import org.apache.commons.lang.Validate;
+import org.bukkit.Location;
import org.bukkit.plugin.Plugin;
+import java.util.List;
+
/**
* Represents a {@link Command} belonging to a plugin
*/
@@ -122,6 +123,15 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
*/
@Override
public java.util.List<String> tabComplete(CommandSender sender, String alias, String[] args) throws CommandException, IllegalArgumentException {
+ return tabComplete(sender, alias, args, null); // PaperSpigot - The code from this method has been (slightly modified) moved to the Location method.
+ return tabComplete(sender, alias, args, null); // Paper - The code from this method has been (slightly modified) moved to the Location method.
+ }
+
+ // PaperSpigot start - location tab-completes
@ -87,11 +82,11 @@ index 3bfa31f..597d7c2 100644
try {
if (completer != null) {
- completions = completer.onTabComplete(sender, this, alias, args);
+ completions = completer.onTabComplete(sender, this, alias, args, location); // PaperSpigot - add location argument
+ completions = completer.onTabComplete(sender, this, alias, args, location); // Paper - add location argument
}
if (completions == null && executor instanceof TabCompleter) {
- completions = ((TabCompleter) executor).onTabComplete(sender, this, alias, args);
+ completions = ((TabCompleter) executor).onTabComplete(sender, this, alias, args, location); // PaperSpigot - add location argument
+ completions = ((TabCompleter) executor).onTabComplete(sender, this, alias, args, location); // Paper - add location argument
}
} catch (Throwable ex) {
StringBuilder message = new StringBuilder();
@ -99,12 +94,12 @@ index 3bfa31f..597d7c2 100644
}
return completions;
}
+ // PaperSpigot end
+ // Paper end
@Override
public String toString() {
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index a300ae7..12d9232 100644
index a300ae7..980c4fd 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -12,6 +12,7 @@ import java.util.Map;
@ -119,12 +114,12 @@ index a300ae7..12d9232 100644
}
public List<String> tabComplete(CommandSender sender, String cmdLine) {
+ return tabComplete(sender, cmdLine, null); // PaperSpigot - location tab-completes, code moved below
+ return tabComplete(sender, cmdLine, null); // Paper - location tab-completes, code moved below
+ }
+
+ // PaperSpigot start - location tab-completes
+ /*
+ this code was copied, except for the noted change, from tabComplete(CommandSender sender, String cmdLine)
+ // Paper start - location tab-completes
+ /**
+ * This code was copied, except for the noted change, from tabComplete(CommandSender sender, String cmdLine)
+ */
+ public List<String> tabComplete(CommandSender sender, String cmdLine, Location location) {
Validate.notNull(sender, "Sender cannot be null");
@ -135,19 +130,19 @@ index a300ae7..12d9232 100644
try {
- return target.tabComplete(sender, commandName, args);
+ return target.tabComplete(sender, commandName, args, location); // PaperSpigot - add location argument
+ return target.tabComplete(sender, commandName, args, location); // Paper - add location argument
} catch (CommandException ex) {
throw ex;
} catch (Throwable ex) {
throw new CommandException("Unhandled exception executing tab-completer for '" + cmdLine + "' in " + target, ex);
}
}
+ // PaperSpigot end
+ // Paper end
public Collection<Command> getCommands() {
return Collections.unmodifiableCollection(knownCommands.values());
diff --git a/src/main/java/org/bukkit/command/TabCompleter.java b/src/main/java/org/bukkit/command/TabCompleter.java
index 6d61e3a..2cb971c 100644
index 6d61e3a..85b10e5 100644
--- a/src/main/java/org/bukkit/command/TabCompleter.java
+++ b/src/main/java/org/bukkit/command/TabCompleter.java
@@ -1,5 +1,7 @@
@ -163,12 +158,12 @@ index 6d61e3a..2cb971c 100644
*/
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args);
+
+ // PaperSpigot start - location tab-completes
+ // Paper start - location tab-completes
+ default List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args, Location location) {
+ return onTabComplete(sender, command, alias, args);
+ }
+ // PaperSpigot end
+ // Paper end
}
--
2.7.1
2.7.2

View file

@ -1,36 +1,36 @@
From 09b55d7828f2499a4179e60f0be9dbb6b7888ba8 Mon Sep 17 00:00:00 2001
From ae556b9d833294cf0e1f865b6851447a11cdcda5 Mon Sep 17 00:00:00 2001
From: Nik Gil <nikmanG@users.noreply.github.com>
Date: Mon, 1 Feb 2016 23:36:31 -0700
Date: Mon, 29 Feb 2016 19:42:10 -0600
Subject: [PATCH] Made EntityDismountEvent Cancellable
diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
index 24d4942..b35c7c1 100644
index 24d4942..ce989bb 100644
--- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
@@ -4,11 +4,15 @@ import org.bukkit.entity.Entity;
@@ -1,6 +1,7 @@
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;
+// PaperSpigot start
+import org.bukkit.event.Cancellable;
+// PaperSpigot end
+
/**
@@ -8,7 +9,7 @@ import org.bukkit.event.entity.EntityEvent;
* Called when an entity stops riding another entity.
*
*/
-public class EntityDismountEvent extends EntityEvent
+public class EntityDismountEvent extends EntityEvent implements Cancellable // PaperSpigot - implement Cancellable
+public class EntityDismountEvent extends EntityEvent implements Cancellable // Paper - implement Cancellable
{
private static final HandlerList handlers = new HandlerList();
@@ -36,4 +40,16 @@ public class EntityDismountEvent extends EntityEvent
@@ -36,4 +37,16 @@ public class EntityDismountEvent extends EntityEvent
{
return handlers;
}
+
+ // PaperSpigot start - implement Cancellable methods
+ // Paper start - Implement cancellable methods
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
@ -40,8 +40,8 @@ index 24d4942..b35c7c1 100644
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+ // PaperSpigot end
+ // Paper end
}
--
2.7.0
2.7.2

View file

@ -1,24 +1,24 @@
From 94997a931505151e58013ba362249d63daa09654 Mon Sep 17 00:00:00 2001
From 9003dd80621ac325f76aab4af72047c9da57f691 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 11 Feb 2016 23:21:31 -0500
Date: Mon, 29 Feb 2016 19:45:21 -0600
Subject: [PATCH] Automatically disable plugins that fail to load
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 4983ea8..b057b05 100644
index 4983ea8..93a43dd 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -332,6 +332,10 @@ public final class JavaPluginLoader implements PluginLoader {
jPlugin.setEnabled(true);
} catch (Throwable ex) {
server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
+ // PaperSpigot start - Disable plugins that fail to load
+ // Paper start - Disable plugins that fail to load
+ disablePlugin(jPlugin);
+ return;
+ // PaperSpigot end
+ // Paper end
}
// Perhaps abort here, rather than continue going, but as it stands,
--
2.7.1
2.7.2

View file

@ -0,0 +1,74 @@
From 7c9892de7be9a27ba1014d2ee6202c70230b114d Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Mon, 29 Feb 2016 19:48:59 -0600
Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 8d602a3..b6a0b40 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -17,10 +17,7 @@ import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarFlag;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
-import org.bukkit.command.CommandException;
-import org.bukkit.command.CommandSender;
-import org.bukkit.command.ConsoleCommandSender;
-import org.bukkit.command.PluginCommand;
+import org.bukkit.command.*;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
@@ -1156,6 +1153,17 @@ public final class Bukkit {
return server.getUnsafe();
}
+ // Paper start
+ /**
+ * Gets the active {@link CommandMap}
+ *
+ * @return the active command map
+ */
+ public static CommandMap getCommandMap() {
+ return server.getCommandMap();
+ }
+ // Paper end
+
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 86fe389..9ee3815 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -17,10 +17,7 @@ import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarFlag;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
-import org.bukkit.command.CommandException;
-import org.bukkit.command.CommandSender;
-import org.bukkit.command.ConsoleCommandSender;
-import org.bukkit.command.PluginCommand;
+import org.bukkit.command.*;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
@@ -940,6 +937,14 @@ public interface Server extends PluginMessageRecipient {
*/
public double[] getTPS();
+ // Paper start
+ /**
+ * Gets the active {@link CommandMap}
+ *
+ * @return the active command map
+ */
+ CommandMap getCommandMap();
+
/**
* @see UnsafeValues
* @return the unsafe values instance
--
2.7.2

View file

@ -1,11 +1,11 @@
From 0cedba608ed4c22ed465f612d48437ec5955953b Mon Sep 17 00:00:00 2001
From 47ecb6bf0557814cd48f9b732e1bd5bee223f923 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 16 Feb 2016 19:15:30 -0600
Date: Mon, 29 Feb 2016 19:54:32 -0600
Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index f0e1b99..8fbc828 100644
index b6a0b40..f93ca2e 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -292,6 +292,26 @@ public final class Bukkit {
@ -36,7 +36,7 @@ index f0e1b99..8fbc828 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 316336d..1b62463 100644
index 9ee3815..77d4f34 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -238,6 +238,22 @@ public interface Server extends PluginMessageRecipient {
@ -63,10 +63,10 @@ index 316336d..1b62463 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 c0ebe65..9ebfa47 100644
index 855bde5..024b8dd 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -330,6 +330,22 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -331,6 +331,22 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
*/
public void sendMap(MapView map);
@ -90,5 +90,5 @@ index c0ebe65..9ebfa47 100644
* Forces an update of the player's entire inventory.
*
--
2.7.1
2.7.2

View file

@ -1,154 +1,16 @@
From 9da88eae7c63d03c2303ddfa86cededaf1244d70 Mon Sep 17 00:00:00 2001
From 084b100716809ddb5c563ed03318c2cb010f7382 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Tue, 16 Feb 2016 19:51:11 -0600
Date: Mon, 29 Feb 2016 20:02:40 -0600
Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 9ebfa47..d02fe56 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -19,6 +19,9 @@ import org.bukkit.conversations.Conversable;
import org.bukkit.map.MapView;
import org.bukkit.plugin.messaging.PluginMessageRecipient;
import org.bukkit.scoreboard.Scoreboard;
+// PaperSpigot start
+import org.github.paperspigot.Title;
+// PaperSpigot end
/**
* Represents a player, connected or not
@@ -344,6 +347,112 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @param components the components to send
*/
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components);
+
+ /**
+ * Set the text displayed in the player list header and footer for this player
+ *
+ * @param header content for the top of the player list
+ * @param footer content for the bottom of the player list
+ */
+ public void setPlayerListHeaderFooter(net.md_5.bungee.api.chat.BaseComponent[] header, net.md_5.bungee.api.chat.BaseComponent[] footer);
+
+ /**
+ * Set the text displayed in the player list header and footer for this player
+ *
+ * @param header content for the top of the player list
+ * @param footer content for the bottom of the player list
+ */
+ public void setPlayerListHeaderFooter(net.md_5.bungee.api.chat.BaseComponent header, net.md_5.bungee.api.chat.BaseComponent footer);
+
+ /**
+ * Update the times for titles displayed to the player
+ *
+ * @param fadeInTicks ticks to fade-in
+ * @param stayTicks ticks to stay visible
+ * @param fadeOutTicks ticks to fade-out
+ * @deprecated Use {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void setTitleTimes(int fadeInTicks, int stayTicks, int fadeOutTicks);
+
+ /**
+ * Update the subtitle of titles displayed to the player
+ * @deprecated Use {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void setSubtitle(net.md_5.bungee.api.chat.BaseComponent[] subtitle);
+
+ /**
+ * Update the subtitle of titles displayed to the player
+ * @deprecated Use {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void setSubtitle(net.md_5.bungee.api.chat.BaseComponent subtitle);
+
+ /**
+ * Show the given title to the player, along with the last subtitle set, using the last set times
+ * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent[] title);
+
+ /**
+ * Show the given title to the player, along with the last subtitle set, using the last set times
+ * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent title);
+
+ /**
+ * Show the given title and subtitle to the player using the given times
+ *
+ * @param title big text
+ * @param subtitle little text under it
+ * @param fadeInTicks ticks to fade-in
+ * @param stayTicks ticks to stay visible
+ * @param fadeOutTicks ticks to fade-out
+ * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent[] title, net.md_5.bungee.api.chat.BaseComponent[] subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks);
+
+ /**
+ * Show the given title and subtitle to the player using the given times
+ *
+ * @param title big text
+ * @param subtitle little text under it
+ * @param fadeInTicks ticks to fade-in
+ * @param stayTicks ticks to stay visible
+ * @param fadeOutTicks ticks to fade-out
+ * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent title, net.md_5.bungee.api.chat.BaseComponent subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks);
+
+ /**
+ * Show the title to the player, overriding any previously displayed title.
+ *
+ * <p>This method overrides any previous title, use {@link #updateTitle(Title)} to change the existing one.</p>
+ *
+ * @param title the title to send
+ * @throws NullPointerException if the title is null
+ */
+ void sendTitle(Title title);
+
+ /**
+ * Show the title to the player, overriding any previously displayed title.
+ *
+ * <p>This method doesn't override previous titles, but changes their values.</p>
+ *
+ * @param title the title to send
+ * @throws NullPointerException if title is null
+ */
+ void updateTitle(Title title);
+
+ /**
+ * Hide any title that is currently visible to the player
+ */
+ public void hideTitle();
// Paper end
/**
@@ -1086,9 +1195,8 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
/**
* Resets the title displayed to the player.
- * @deprecated API subject to change.
*/
- @Deprecated
+ // Paper - Undeprecate
public void resetTitle();
// Spigot start
diff --git a/src/main/java/org/github/paperspigot/Title.java b/src/main/java/org/github/paperspigot/Title.java
diff --git a/src/main/java/com/destroystokyo/paper/Title.java b/src/main/java/com/destroystokyo/paper/Title.java
new file mode 100644
index 0000000..27f9bc2
index 0000000..e1ecd44
--- /dev/null
+++ b/src/main/java/org/github/paperspigot/Title.java
+++ b/src/main/java/com/destroystokyo/paper/Title.java
@@ -0,0 +1,358 @@
+package org.github.paperspigot;
+package com.destroystokyo.paper;
+
+import net.md_5.bungee.api.chat.BaseComponent;
+import net.md_5.bungee.api.chat.TextComponent;
@ -506,7 +368,144 @@ index 0000000..27f9bc2
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 024b8dd..50a6a41 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2,6 +2,7 @@ package org.bukkit.entity;
import java.net.InetSocketAddress;
+import com.destroystokyo.paper.Title;
import org.bukkit.Achievement;
import org.bukkit.ChatColor;
import org.bukkit.Effect;
@@ -345,6 +346,116 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @param components the components to send
*/
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components);
+
+ /**
+ * Set the text displayed in the player list header and footer for this player
+ *
+ * @param header content for the top of the player list
+ * @param footer content for the bottom of the player list
+ */
+ public void setPlayerListHeaderFooter(net.md_5.bungee.api.chat.BaseComponent[] header, net.md_5.bungee.api.chat.BaseComponent[] footer);
+
+ /**
+ * Set the text displayed in the player list header and footer for this player
+ *
+ * @param header content for the top of the player list
+ * @param footer content for the bottom of the player list
+ */
+ public void setPlayerListHeaderFooter(net.md_5.bungee.api.chat.BaseComponent header, net.md_5.bungee.api.chat.BaseComponent footer);
+
+ /**
+ * Update the times for titles displayed to the player
+ *
+ * @param fadeInTicks ticks to fade-in
+ * @param stayTicks ticks to stay visible
+ * @param fadeOutTicks ticks to fade-out
+ * @deprecated Use {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void setTitleTimes(int fadeInTicks, int stayTicks, int fadeOutTicks);
+
+ /**
+ * Update the subtitle of titles displayed to the player
+ *
+ * @deprecated Use {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void setSubtitle(net.md_5.bungee.api.chat.BaseComponent[] subtitle);
+
+ /**
+ * Update the subtitle of titles displayed to the player
+ *
+ * @deprecated Use {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void setSubtitle(net.md_5.bungee.api.chat.BaseComponent subtitle);
+
+ /**
+ * Show the given title to the player, along with the last subtitle set, using the last set times
+ *
+ * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent[] title);
+
+ /**
+ * Show the given title to the player, along with the last subtitle set, using the last set times
+ *
+ * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent title);
+
+ /**
+ * Show the given title and subtitle to the player using the given times
+ *
+ * @param title big text
+ * @param subtitle little text under it
+ * @param fadeInTicks ticks to fade-in
+ * @param stayTicks ticks to stay visible
+ * @param fadeOutTicks ticks to fade-out
+ * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent[] title, net.md_5.bungee.api.chat.BaseComponent[] subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks);
+
+ /**
+ * Show the given title and subtitle to the player using the given times
+ *
+ * @param title big text
+ * @param subtitle little text under it
+ * @param fadeInTicks ticks to fade-in
+ * @param stayTicks ticks to stay visible
+ * @param fadeOutTicks ticks to fade-out
+ * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
+ */
+ @Deprecated
+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent title, net.md_5.bungee.api.chat.BaseComponent subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks);
+
+ /**
+ * Show the title to the player, overriding any previously displayed title.
+ * <p>
+ * <p>This method overrides any previous title, use {@link #updateTitle(Title)} to change the existing one.</p>
+ *
+ * @param title the title to send
+ * @throws NullPointerException if the title is null
+ */
+ void sendTitle(Title title);
+
+ /**
+ * Show the title to the player, overriding any previously displayed title.
+ * <p>
+ * <p>This method doesn't override previous titles, but changes their values.</p>
+ *
+ * @param title the title to send
+ * @throws NullPointerException if title is null
+ */
+ void updateTitle(Title title);
+
+ /**
+ * Hide any title that is currently visible to the player
+ */
+ public void hideTitle();
// Paper end
/**
@@ -1089,7 +1200,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* Resets the title displayed to the player.
* @deprecated API subject to change.
*/
- @Deprecated
+ // Paper - undeprecate
public void resetTitle();
--
2.7.1
2.7.2

View file

@ -1,67 +0,0 @@
From 184494ffcdbd826e48aa98fd8945b44723793af8 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Mon, 15 Feb 2016 07:11:17 -0800
Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index a4396e8..f0e1b99 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -14,6 +14,7 @@ import java.util.logging.Logger;
import org.bukkit.Warning.WarningState;
import org.bukkit.command.CommandException;
+import org.bukkit.command.CommandMap;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.PluginCommand;
@@ -1130,6 +1131,17 @@ public final class Bukkit {
return server.getUnsafe();
}
+ // Paper start
+ /**
+ * Gets the active {@link CommandMap}.
+ *
+ * @return the active command map
+ */
+ public static CommandMap getCommandMap() {
+ return server.getCommandMap();
+ }
+ // Paper end
+
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 ae75bd4..316336d 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -14,6 +14,7 @@ import java.util.logging.Logger;
import org.bukkit.Warning.WarningState;
import org.bukkit.command.CommandException;
+import org.bukkit.command.CommandMap;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.PluginCommand;
@@ -924,6 +925,15 @@ public interface Server extends PluginMessageRecipient {
@Deprecated
UnsafeValues getUnsafe();
+ // Paper start
+ /**
+ * Gets the active {@link CommandMap}.
+ *
+ * @return the active command map
+ */
+ CommandMap getCommandMap();
+ // Paper end
+
public class Spigot
{
@Deprecated
--
2.7.0.rc0.20.g4b9ab0e

View file

@ -1,6 +1,6 @@
From f77db2e56a6185471090b6cfeba2c441e19af096 Mon Sep 17 00:00:00 2001
From c872380e8a9e221324e69639a39bffb18fc8f883 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 24 Feb 2016 00:57:22 -0500
Date: Mon, 29 Feb 2016 20:26:39 -0600
Subject: [PATCH] Fix ServerListPingEvent flagging as Async
This event can sometimes fire Async, set the proper boolean
@ -50,5 +50,5 @@ index 343f238..3c38d85 100644
this.address = address;
this.motd = motd;
--
2.7.1
2.7.2