From af546e7f1d470eb55f173929aafee7d02678e355 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Thu, 6 Dec 2012 04:04:07 +0100 Subject: [PATCH] Ignore depcreciation - we're using the method correctly. --- ProtocolLib/dependency-reduced-pom.xml | 2 +- .../java/com/comphenix/protocol/CommandProtocol.java | 2 ++ .../comphenix/protocol/async/AsyncListenerHandler.java | 9 +++++++-- .../protocol/injector/player/PlayerInjector.java | 1 - .../java/com/comphenix/protocol/metrics/Metrics.java | 3 ++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ProtocolLib/dependency-reduced-pom.xml b/ProtocolLib/dependency-reduced-pom.xml index f877ad9e..4830e8fd 100644 --- a/ProtocolLib/dependency-reduced-pom.xml +++ b/ProtocolLib/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ com.comphenix.protocol ProtocolLib ProtocolLib - 1.7.2-SNAPSHOT + 1.8.0-SNAPSHOT Provides read/write access to the Minecraft protocol. http://dev.bukkit.org/server-mods/protocollib/ diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java b/ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java index fa20d46d..d4c6aa05 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java @@ -47,6 +47,7 @@ class CommandProtocol extends CommandBase { return true; } + @SuppressWarnings("deprecation") public void checkVersion(final CommandSender sender) { // Perform on an async thread plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable() { @@ -64,6 +65,7 @@ class CommandProtocol extends CommandBase { updateFinished(); } + @SuppressWarnings("deprecation") public void updateVersion(final CommandSender sender) { // Perform on an async thread plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable() { diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncListenerHandler.java b/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncListenerHandler.java index f37511f8..cefd8a0a 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncListenerHandler.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncListenerHandler.java @@ -242,7 +242,7 @@ public class AsyncListenerHandler { final AsyncRunnable listenerLoop = getListenerLoop(); - filterManager.getScheduler().scheduleAsyncDelayedTask(listener.getPlugin(), new Runnable() { + scheduleAsync(new Runnable() { @Override public void run() { Thread thread = Thread.currentThread(); @@ -290,7 +290,7 @@ public class AsyncListenerHandler { final AsyncRunnable listenerLoop = getListenerLoop(); final Function delegateCopy = executor; - filterManager.getScheduler().scheduleAsyncDelayedTask(listener.getPlugin(), new Runnable() { + scheduleAsync(new Runnable() { @Override public void run() { delegateCopy.apply(listenerLoop); @@ -298,6 +298,11 @@ public class AsyncListenerHandler { }); } + @SuppressWarnings("deprecation") + private void scheduleAsync(Runnable runnable) { + filterManager.getScheduler().scheduleAsyncDelayedTask(listener.getPlugin(), runnable); + } + /** * Create a friendly thread name using the following convention: *

diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjector.java index f4f8d871..239f6b7a 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjector.java @@ -28,7 +28,6 @@ import java.net.SocketAddress; import net.sf.cglib.proxy.Factory; import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitWorker; import com.comphenix.protocol.Packets; import com.comphenix.protocol.error.ErrorReporter; diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/metrics/Metrics.java b/ProtocolLib/src/main/java/com/comphenix/protocol/metrics/Metrics.java index 493bbeaf..3ee7d6e9 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/metrics/Metrics.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/metrics/Metrics.java @@ -234,7 +234,8 @@ class Metrics { * * @return True if statistics measuring is running, otherwise false. */ - public boolean start() { + @SuppressWarnings("deprecation") + public boolean start() { synchronized (optOutLock) { // Did we opt out? if (isOptOut()) {