diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java b/ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java
index 258aaa1e..c06f8248 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java
@@ -59,14 +59,14 @@ class CommandProtocol extends CommandBase {
else if (subCommand.equalsIgnoreCase("timings"))
toggleTimings(sender, args);
else if (subCommand.equalsIgnoreCase("listeners"))
- printListeners(sender, args);
+ printListeners(sender);
else
return false;
return true;
}
// Display every listener on the server
- private void printListeners(final CommandSender sender, String[] args) {
+ private void printListeners(final CommandSender sender) {
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
for (PacketListener listener : manager.getPacketListeners()) {
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolConfig.java b/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolConfig.java
index a2cec719..05a84de1 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolConfig.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolConfig.java
@@ -77,10 +77,6 @@ public class ProtocolConfig {
private int modCount;
public ProtocolConfig(Plugin plugin) {
- this(plugin, plugin.getConfig());
- }
-
- public ProtocolConfig(Plugin plugin, Configuration config) {
this.plugin = plugin;
reloadConfig();
}
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java b/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java
index dac4d905..2fe5a601 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java
@@ -2,16 +2,16 @@
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
* Copyright (C) 2012 Kristian S. Stangeland
*
- * This program is free software; you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation; either version 2 of
+ * This program is free software; you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * You should have received a copy of the GNU General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*/
@@ -81,7 +81,7 @@ public class AsyncFilterManager implements AsynchronousManager {
/**
* Initialize a asynchronous filter manager.
*
- * Internal method. Retrieve the global asynchronous manager from the protocol manager instead.
+ * Internal method. Retrieve the global asynchronous manager from the protocol manager instead.
* @param reporter - desired error reporter.
* @param scheduler - task scheduler.
*/
@@ -148,7 +148,7 @@ public class AsyncFilterManager implements AsynchronousManager {
ImmutableSet.Builder builder = ImmutableSet.builder();
// Add every asynchronous packet listener
- for (PrioritizedListener handler :
+ for (PrioritizedListener handler :
Iterables.concat(serverProcessingQueue.values(), clientProcessingQueue.values())) {
builder.add(handler.getListener().getAsyncListener());
}
@@ -221,7 +221,7 @@ public class AsyncFilterManager implements AsynchronousManager {
if (listener == null)
throw new IllegalArgumentException("listener cannot be NULL.");
- AsyncListenerHandler handler =
+ AsyncListenerHandler handler =
findHandler(serverProcessingQueue, listener.getSendingWhitelist(), listener);
if (handler == null) {
@@ -232,7 +232,7 @@ public class AsyncFilterManager implements AsynchronousManager {
// Search for the first correct handler
private AsyncListenerHandler findHandler(PacketProcessingQueue queue, ListeningWhitelist search, PacketListener target) {
- if (ListeningWhitelist.isEmpty(search))
+ if (ListeningWhitelist.isEmpty(search))
return null;
for (PacketType type : search.getTypes()) {
@@ -250,7 +250,7 @@ public class AsyncFilterManager implements AsynchronousManager {
if (handler == null)
throw new IllegalArgumentException("listenerToken cannot be NULL");
- handler.cancel();
+ handler.cancel();
}
// Called by AsyncListenerHandler
@@ -295,7 +295,7 @@ public class AsyncFilterManager implements AsynchronousManager {
private void unregisterAsyncHandlers(PacketProcessingQueue processingQueue, Plugin plugin) {
// Iterate through every packet listener
- for (PrioritizedListener listener : processingQueue.values()) {
+ for (PrioritizedListener listener : processingQueue.values()) {
// Remove the listener
if (Objects.equal(listener.getListener().getPlugin(), plugin)) {
unregisterAsyncHandler(listener.getListener());
@@ -362,7 +362,7 @@ public class AsyncFilterManager implements AsynchronousManager {
* @return Asynchronous marker.
*/
public AsyncMarker createAsyncMarker() {
- return createAsyncMarker(AsyncMarker.DEFAULT_SENDING_DELTA, AsyncMarker.DEFAULT_TIMEOUT_DELTA);
+ return createAsyncMarker(AsyncMarker.DEFAULT_TIMEOUT_DELTA);
}
/**
@@ -371,14 +371,13 @@ public class AsyncFilterManager implements AsynchronousManager {
* @param timeoutDelta - how long (in ms) until the packet expire.
* @return An async marker.
*/
- public AsyncMarker createAsyncMarker(long sendingDelta, long timeoutDelta) {
- return createAsyncMarker(sendingDelta, timeoutDelta,
- currentSendingIndex.incrementAndGet(), System.currentTimeMillis());
+ public AsyncMarker createAsyncMarker(long timeoutDelta) {
+ return createAsyncMarker(timeoutDelta, currentSendingIndex.incrementAndGet());
}
// Helper method
- private AsyncMarker createAsyncMarker(long sendingDelta, long timeoutDelta, long sendingIndex, long currentTime) {
- return new AsyncMarker(manager, sendingIndex, sendingDelta, System.currentTimeMillis(), timeoutDelta);
+ private AsyncMarker createAsyncMarker(long timeoutDelta, long sendingIndex) {
+ return new AsyncMarker(manager, sendingIndex, System.currentTimeMillis(), timeoutDelta);
}
@Override
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncMarker.java b/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncMarker.java
index 5bcd077b..1d559db2 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncMarker.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncMarker.java
@@ -110,7 +110,7 @@ public class AsyncMarker implements Serializable, Comparable {
* Create a container for asyncronous packets.
* @param initialTime - the current time in milliseconds since 01.01.1970 00:00.
*/
- AsyncMarker(PacketStream packetStream, long sendingIndex, long sendingDelta, long initialTime, long timeoutDelta) {
+ AsyncMarker(PacketStream packetStream, long sendingIndex, long initialTime, long timeoutDelta) {
if (packetStream == null)
throw new IllegalArgumentException("packetStream cannot be NULL");
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/EntityUtilities.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/EntityUtilities.java
index 8965fd60..8bb7835c 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/EntityUtilities.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/EntityUtilities.java
@@ -2,16 +2,16 @@
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
* Copyright (C) 2012 Kristian S. Stangeland
*
- * This program is free software; you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation; either version 2 of
+ * This program is free software; you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * You should have received a copy of the GNU General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*/
@@ -53,7 +53,7 @@ class EntityUtilities {
private static Method scanPlayersMethod;
/*
- * While this function may look pretty bad, it's essentially just a reflection-warped
+ * While this function may look pretty bad, it's essentially just a reflection-warped
* version of the following:
*
* @SuppressWarnings("unchecked")
@@ -133,7 +133,7 @@ class EntityUtilities {
Object trackerEntry = getEntityTrackerEntry(entity.getWorld(), entity.getEntityId());
if (trackerEntry == null) {
- throw new IllegalArgumentException("Cannot find entity trackers for " + entity +
+ throw new IllegalArgumentException("Cannot find entity trackers for " + entity +
(entity.isDead() ? " - entity is dead." : "."));
}
if (trackedPlayersField == null) {
@@ -152,8 +152,6 @@ class EntityUtilities {
} catch (IllegalAccessException e) {
throw new FieldAccessException("Security limitation prevented access to the list of tracked players.", e);
- } catch (InvocationTargetException e) {
- throw new FieldAccessException("Exception occurred in Minecraft.", e);
}
}
@@ -162,9 +160,9 @@ class EntityUtilities {
* @param world - world server.
* @param entityID - entity ID.
* @return The entity tracker entry.
- * @throws FieldAccessException
+ * @throws FieldAccessException
*/
- private static Object getEntityTrackerEntry(World world, int entityID) throws FieldAccessException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+ private static Object getEntityTrackerEntry(World world, int entityID) throws FieldAccessException, IllegalArgumentException {
BukkitUnwrapper unwrapper = new BukkitUnwrapper();
Object worldServer = unwrapper.unwrapItem(world);
@@ -183,9 +181,9 @@ class EntityUtilities {
if (trackedEntitiesField == null) {
@SuppressWarnings("rawtypes")
- Set ignoredTypes = new HashSet();
+ Set ignoredTypes = new HashSet();
- // Well, this is more difficult. But we're looking for a Minecraft object that is not
+ // Well, this is more difficult. But we're looking for a Minecraft object that is not
// created by the constructor(s).
for (Constructor> constructor : tracker.getClass().getConstructors()) {
for (Class> type : constructor.getParameterTypes()) {
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java
index a2d26d02..a92e64e0 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java
@@ -441,7 +441,7 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
playerInjection.checkListener(listener);
}
if (hasSending)
- incrementPhases(processPhase(sending, ConnectionSide.SERVER_SIDE));
+ incrementPhases(processPhase(sending));
// Handle receivers after senders
if (hasReceiving) {
@@ -450,7 +450,7 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
enablePacketFilters(listener, receiving.getTypes());
}
if (hasReceiving)
- incrementPhases(processPhase(receiving, ConnectionSide.CLIENT_SIDE));
+ incrementPhases(processPhase(receiving));
// Inform our injected hooks
packetListeners.add(listener);
@@ -458,7 +458,7 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
}
}
- private GamePhase processPhase(ListeningWhitelist whitelist, ConnectionSide side) {
+ private GamePhase processPhase(ListeningWhitelist whitelist) {
// Determine if this is a login packet, ensuring that gamephase detection is enabled
if (!whitelist.getGamePhase().hasLogin() &&
!whitelist.getOptions().contains(ListenerOptions.DISABLE_GAMEPHASE_DETECTION)) {
@@ -571,11 +571,11 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
// Remove listeners and phases
if (sending != null && sending.isEnabled()) {
sendingRemoved = sendingListeners.removeListener(listener, sending);
- decrementPhases(processPhase(sending, ConnectionSide.SERVER_SIDE));
+ decrementPhases(processPhase(sending));
}
if (receiving != null && receiving.isEnabled()) {
receivingRemoved = recievedListeners.removeListener(listener, receiving);
- decrementPhases(processPhase(receiving, ConnectionSide.CLIENT_SIDE));
+ decrementPhases(processPhase(receiving));
}
// Remove hooks, if needed
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java
index f7735c33..51d51c0b 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java
@@ -225,7 +225,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
protected void encode(ChannelHandlerContext ctx, Object packet, ByteBuf output) throws Exception {
if (packet instanceof WirePacket) {
// Special case for wire format
- ChannelInjector.this.encodeWirePacket(ctx, (WirePacket) packet, output);
+ ChannelInjector.this.encodeWirePacket((WirePacket) packet, output);
} else {
ChannelInjector.this.encode(ctx, packet, output);
}
@@ -356,7 +356,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
*/
private boolean guessCompression(ChannelHandler handler) {
String className = handler != null ? handler.getClass().getCanonicalName() : null;
- return className.contains("PacketCompressor") || className.contains("PacketDecompressor");
+ return className.contains("Compressor") || className.contains("Decompressor");
}
/**
@@ -386,7 +386,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
super.exceptionCaught(ctx, cause);
}
- protected void encodeWirePacket(ChannelHandlerContext ctx, WirePacket packet, ByteBuf output) throws Exception {
+ protected void encodeWirePacket(WirePacket packet, ByteBuf output) throws Exception {
packet.writeId(output);
packet.writeBytes(output);
}
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java
index 2e126158..95b78616 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java
@@ -160,19 +160,16 @@ public class PipelineProxy implements ChannelPipeline {
}
// We have to call the depreciated methods to properly implement the proxy
- @SuppressWarnings("deprecation")
@Override
public ChannelFuture deregister() {
return pipeline.deregister();
}
- @SuppressWarnings("deprecation")
@Override
public ChannelFuture deregister(ChannelPromise arg0) {
return pipeline.deregister(arg0);
}
- @SuppressWarnings("deprecation")
@Override
public ChannelPipeline fireChannelUnregistered() {
pipeline.fireChannelUnregistered();
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/InterceptWritePacket.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/InterceptWritePacket.java
index cd3e1415..f1fd11b4 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/InterceptWritePacket.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/InterceptWritePacket.java
@@ -53,11 +53,12 @@ public class InterceptWritePacket {
this.modifierRest = new WritePacketModifier(reporter, false);
}
+ // TODO: PacketId should probably do something...
private Class> createProxyClass(int packetId) {
// Construct the proxy object
Enhancer ex = EnhancerFactory.getInstance().createEnhancer();
- // Attempt to share callback filter
+ // Attempt to share callback filter
if (filter == null) {
filter = new CallbackFilter() {
@Override
@@ -87,7 +88,7 @@ public class InterceptWritePacket {
if (proxyClass != null) {
// Check that we found the read method
if (!writePacketIntercepted) {
- reporter.reportWarning(this,
+ reporter.reportWarning(this,
Report.newBuilder(REPORT_CANNOT_FIND_WRITE_PACKET_METHOD).
messageParam(MinecraftReflection.getPacketClass()));
}
@@ -130,7 +131,7 @@ public class InterceptWritePacket {
return generated;
} catch (Exception e) {
- reporter.reportWarning(this,
+ reporter.reportWarning(this,
Report.newBuilder(REPORT_CANNOT_CONSTRUCT_WRITE_PROXY).
messageParam(proxyClass));
return null;
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/LegacyNetworkMarker.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/LegacyNetworkMarker.java
index 4adb0230..a9c41387 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/LegacyNetworkMarker.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/LegacyNetworkMarker.java
@@ -11,8 +11,7 @@ import javax.annotation.Nonnull;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.events.ConnectionSide;
import com.comphenix.protocol.events.NetworkMarker;
-import com.google.common.io.ByteStreams;
-import com.google.common.io.InputSupplier;
+import com.google.common.io.ByteSource;
import com.google.common.primitives.Bytes;
/**
@@ -39,27 +38,26 @@ public class LegacyNetworkMarker extends NetworkMarker {
return ByteBuffer.wrap(Bytes.concat(new byte[] { (byte) type.getLegacyId() }, buffer.array()));
}
- @SuppressWarnings({"unchecked", "rawtypes"})
@Override
protected DataInputStream addHeader(final DataInputStream input, final PacketType type) {
- InputSupplier header = new InputSupplier() {
+ ByteSource header = new ByteSource() {
@Override
- public InputStream getInput() throws IOException {
+ public InputStream openStream() throws IOException {
byte[] data = new byte[] { (byte) type.getLegacyId() };
return new ByteArrayInputStream(data);
}
};
- InputSupplier data = new InputSupplier() {
+ ByteSource data = new ByteSource() {
@Override
- public InputStream getInput() throws IOException {
+ public InputStream openStream() throws IOException {
return input;
}
};
// Combine them into a single stream
try {
- return new DataInputStream(ByteStreams.join((InputSupplier) header, (InputSupplier) data).getInput());
+ return new DataInputStream(ByteSource.concat(header, data).openStream());
} catch (IOException e) {
throw new RuntimeException("Cannot add header.", e);
}
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/NetworkFieldInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/NetworkFieldInjector.java
index fd22a390..db7ca6de 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/NetworkFieldInjector.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/NetworkFieldInjector.java
@@ -2,16 +2,16 @@
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
* Copyright (C) 2012 Kristian S. Stangeland
*
- * This program is free software; you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation; either version 2 of
+ * This program is free software; you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * You should have received a copy of the GNU General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*/
@@ -58,7 +58,7 @@ class NetworkFieldInjector extends PlayerInjector {
// Nothing
}
- // After commit 336a4e00668fd2518c41242755ed6b3bdc3b0e6c (Update CraftBukkit to Minecraft 1.4.4.),
+ // After commit 336a4e00668fd2518c41242755ed6b3bdc3b0e6c (Update CraftBukkit to Minecraft 1.4.4.),
// CraftBukkit stopped redirecting map chunk and map chunk bulk packets to a separate queue.
// Thus, NetworkFieldInjector can safely handle every packet (though not perfectly - some packets
// will be slightly processed).
@@ -77,9 +77,7 @@ class NetworkFieldInjector extends PlayerInjector {
// Determine if we're listening
private IntegerSet sendingFilters;
- public NetworkFieldInjector(ErrorReporter reporter, Player player,
- ListenerInvoker manager, IntegerSet sendingFilters) throws IllegalAccessException {
-
+ public NetworkFieldInjector(ErrorReporter reporter, Player player, ListenerInvoker manager, IntegerSet sendingFilters) {
super(reporter, player, manager);
this.sendingFilters = sendingFilters;
}
@@ -178,6 +176,7 @@ class NetworkFieldInjector extends PlayerInjector {
}
}
+ @Override
@SuppressWarnings("unchecked")
protected void cleanHook() {
// Clean up
diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/NetworkServerInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/NetworkServerInjector.java
index 13993275..cbdaa0e8 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/NetworkServerInjector.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/NetworkServerInjector.java
@@ -2,16 +2,16 @@
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
* Copyright (C) 2012 Kristian S. Stangeland
*
- * This program is free software; you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation; either version 2 of
+ * This program is free software; you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * You should have received a copy of the GNU General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*/
@@ -53,7 +53,7 @@ import com.comphenix.protocol.utility.MinecraftReflection;
import com.comphenix.protocol.utility.MinecraftVersion;
/**
- * Represents a player hook into the NetServerHandler class.
+ * Represents a player hook into the NetServerHandler class.
*
* @author Kristian
*/
@@ -79,10 +79,9 @@ class NetworkServerInjector extends PlayerInjector {
private final ObjectWriter writer = new ObjectWriter();
public NetworkServerInjector(
- ErrorReporter reporter, Player player,
- ListenerInvoker invoker, IntegerSet sendingFilters,
- InjectedServerConnection serverInjection) throws IllegalAccessException {
-
+ ErrorReporter reporter, Player player,
+ ListenerInvoker invoker, IntegerSet sendingFilters,
+ InjectedServerConnection serverInjection) {
super(reporter, player, invoker);
this.sendingFilters = sendingFilters;
this.serverInjection = serverInjection;
@@ -147,7 +146,7 @@ class NetworkServerInjector extends PlayerInjector {
}
throw new RuntimeException(
- "Cannot hook player: Unable to find a valid constructor for the "
+ "Cannot hook player: Unable to find a valid constructor for the "
+ serverHandlerClass.getName() + " object.");
}
}
@@ -177,7 +176,7 @@ class NetworkServerInjector extends PlayerInjector {
};
Callback noOpCallback = NoOp.INSTANCE;
- // Share callback filter - that way, we avoid generating a new class for
+ // Share callback filter - that way, we avoid generating a new class for
// every logged in player.
if (callbackFilter == null) {
callbackFilter = new SendMethodFilter();
@@ -197,7 +196,7 @@ class NetworkServerInjector extends PlayerInjector {
// Use the existing server proxy when we create one
if (proxyInstance != null && proxyInstance != serverHandler) {
- serverInstances = DefaultInstances.fromArray(generator,
+ serverInstances = DefaultInstances.fromArray(generator,
ExistingGenerator.fromObjectArray(new Object[] { proxyInstance }));
} else {
serverInstances = DefaultInstances.fromArray(generator);
@@ -288,7 +287,7 @@ class NetworkServerInjector extends PlayerInjector {
* @param value - the new value.
*/
private void setDisconnect(Object handler, boolean value) {
- // Set it
+ // Set it
try {
// Load the field
if (disconnectField == null) {
@@ -296,7 +295,7 @@ class NetworkServerInjector extends PlayerInjector {
}
FieldUtils.writeField(disconnectField, handler, value);
- } catch (IllegalArgumentException e) {
+ } catch (IllegalArgumentException e) {
// Assume it's the first ...
if (disconnectField == null) {
disconnectField = FuzzyReflection.fromObject(handler).getFieldByType("disconnected", boolean.class);
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 0b4325d4..c74b5f6d 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
@@ -2,16 +2,16 @@
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
* Copyright (C) 2012 Kristian S. Stangeland
*
- * This program is free software; you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation; either version 2 of
+ * This program is free software; you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * You should have received a copy of the GNU General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*/
@@ -62,7 +62,7 @@ public abstract class PlayerInjector implements SocketInjector {
public static final ReportType REPORT_CANNOT_CLOSE_SOCKET = new ReportType("Unable to close socket.");
public static final ReportType REPORT_ACCESS_DENIED_CLOSE_SOCKET = new ReportType("Insufficient permissions. Cannot close socket.");
- public static final ReportType REPORT_DETECTED_CUSTOM_SERVER_HANDLER =
+ public static final ReportType REPORT_DETECTED_CUSTOM_SERVER_HANDLER =
new ReportType("Detected server handler proxy type by another plugin. Conflict may occur!");
public static final ReportType REPORT_CANNOT_PROXY_SERVER_HANDLER = new ReportType("Unable to load server handler from proxy type.");
@@ -128,7 +128,7 @@ public abstract class PlayerInjector implements SocketInjector {
// Previous markers
protected Map