Archiviert
13
0
Dieser Commit ist enthalten in:
Dan Mulloy 2015-06-17 15:08:58 -04:00
Ursprung bba1054f97
Commit 273b470140
26 geänderte Dateien mit 142 neuen und 67 gelöschten Zeilen

Datei anzeigen

@ -321,7 +321,6 @@ public class CommandFilter extends CommandBase {
* @param event - the event.
* @param handler - failure handler.
* @return TRUE if we should, FALSE otherwise.
* @throws ScriptException If one of the filters failed.
*/
public boolean filterEvent(PacketEvent event, FilterFailedHandler handler) {
for (Iterator<Filter> it = filters.iterator(); it.hasNext(); ) {

Datei anzeigen

@ -209,6 +209,7 @@ public class AsyncListenerHandler {
* close a specific worker is less efficient than stopping an arbitrary worker.
* <p>
* <b>Warning</b>: Never call the run() method in the main thread.
* @return The listener loop
*/
public AsyncRunnable getListenerLoop() {
return new AsyncRunnable() {

Datei anzeigen

@ -401,6 +401,7 @@ public class AsyncMarker implements Serializable, Comparable<AsyncMarker> {
/**
* Determine if Minecraft allows asynchronous processing of this packet.
* @param event - packet event
* @return TRUE if it does, FALSE otherwise.
* @throws FieldAccessException If determining fails for some reasaon
*/

Datei anzeigen

@ -139,6 +139,7 @@ public abstract class AbstractIntervalTree<TKey extends Comparable<TKey>, TValue
* Removes every interval that intersects with the given range.
* @param lowerBound - lowest value to remove.
* @param upperBound - highest value to remove.
* @return Intervals that were removed
*/
public Set<Entry> remove(TKey lowerBound, TKey upperBound) {
return remove(lowerBound, upperBound, false);

Datei anzeigen

@ -339,6 +339,7 @@ public abstract class NetworkMarker {
* <p>
* It's safe to modify the input stream.
* @throws IOException If integer reading fails
* @return An input stream without the header
*/
protected abstract DataInputStream skipHeader(DataInputStream input) throws IOException;

Datei anzeigen

@ -443,9 +443,10 @@ public abstract class PlayerInjector implements SocketInjector {
/**
* Retrieves the current net handler for this player.
* @boolean refresh - Whether or not to refresh
* @param refresh - Whether or not to refresh
* @return Current net handler.
* @throws IllegalAccessException Unable to find or retrieve net handler.
* @return The current net handler for this player
*/
protected Object getNetHandler(boolean refresh) throws IllegalAccessException {
// What a mess
@ -564,7 +565,7 @@ public abstract class PlayerInjector implements SocketInjector {
/**
* Determine if this inject method can even be attempted.
* @param GamePhase - Game phase
* @param state - Game phase
* @return TRUE if can be attempted, though possibly with failure, FALSE otherwise.
*/
public abstract boolean canInject(GamePhase state);

Datei anzeigen

@ -109,6 +109,9 @@ public class SpigotPacketInjector implements SpigotPacketListener {
/**
* Create a new spigot injector.
* @param reporter - error reporter
* @param invoker - listener invoker
* @param server - server
*/
public SpigotPacketInjector(ErrorReporter reporter, ListenerInvoker invoker, Server server) {
this.reporter = reporter;

Datei anzeigen

@ -157,7 +157,7 @@ public final class StructureCompiler {
/**
* Lookup the current class loader for any previously generated classes before we attempt to generate something.
* @param <TKey> Type
* @param <TField> Type
* @param source - the structure modifier to look up.
* @return TRUE if we successfully found a previously generated class, FALSE otherwise.
*/
@ -192,6 +192,7 @@ public final class StructureCompiler {
* <p>
* WARNING: Do NOT call this method in the main thread. Compiling may easily take 10 ms, which is already
* over 1/4 of a tick (50 ms). Let the background thread automatically compile the structure modifiers instead.
* @param <TField> Type
* @param source - structure modifier to compile.
* @return A compiled structure modifier.
*/

Datei anzeigen

@ -133,7 +133,6 @@ public class HexDumper {
* Append the hex dump of the given data to the string builder, using the current formatting settings.
* @param appendable - appendable source.
* @param data - the data to dump.
* @param length - the number of bytes to dump.
* @throws IOException Any underlying IO exception.
*/
public void appendTo(Appendable appendable, byte[] data) throws IOException {

Datei anzeigen

@ -61,7 +61,7 @@ public class SafeCacheBuilder<K, V> {
*
* @throws IllegalArgumentException if {@code concurrencyLevel} is
* nonpositive
* @throws IllegalStateExeption if a concurrency level was already set
* @throws IllegalStateException if a concurrency level was already set
*/
public SafeCacheBuilder<K, V> concurrencyLevel(int concurrencyLevel) {
builder.concurrencyLevel(concurrencyLevel);
@ -121,6 +121,8 @@ public class SafeCacheBuilder<K, V> {
* @param duration the length of time after an entry is created that it
* should be automatically removed
* @param unit the unit that {@code duration} is expressed in
* @return This for chaining
*
* @throws IllegalArgumentException if {@code duration} is negative
* @throws IllegalStateException if the time to live or time to idle was
* already set
@ -138,6 +140,9 @@ public class SafeCacheBuilder<K, V> {
* the need for expensive resizing operations later, but setting this value
* unnecessarily high wastes memory.
*
* @param initialCapacity - initial capacity
* @return This for chaining
*
* @throws IllegalArgumentException if {@code initialCapacity} is negative
* @throws IllegalStateException if an initial capacity was already set
*/
@ -162,6 +167,8 @@ public class SafeCacheBuilder<K, V> {
* without a code change.
*
* @param size the maximum size of the cache
* @return This for chaining
*
* @throws IllegalArgumentException if {@code size} is negative
* @throws IllegalStateException if a maximum size was already set
*/
@ -202,6 +209,9 @@ public class SafeCacheBuilder<K, V> {
* incompatible with the listener, you will likely experience a
* {@link ClassCastException} at some <i>undefined</i> point in the future.
*
* @param listener - removal listener
* @return This for chaining
*
* @throws IllegalStateException if a removal listener was already set
*/
@SuppressWarnings("unchecked")
@ -219,6 +229,9 @@ public class SafeCacheBuilder<K, V> {
* which have been configured with {@link #expireAfterWrite} or
* {@link #expireAfterAccess}.
*
* @param ticker - ticker
* @return This for chaining
*
* @throws IllegalStateException if a ticker was already set
*/
public SafeCacheBuilder<K, V> ticker(Ticker ticker) {
@ -242,6 +255,8 @@ public class SafeCacheBuilder<K, V> {
* <b>Note:</b> when this method is used, the resulting cache will use
* identity ({@code ==}) comparison to determine equality of values.
*
* @return This for chaining
*
* @throws IllegalStateException if the value strength was already set
*/
public SafeCacheBuilder<K, V> softValues() {
@ -257,6 +272,8 @@ public class SafeCacheBuilder<K, V> {
* <b>Warning:</b> when this method is used, the resulting cache will use
* identity ({@code ==}) comparison to determine equality of keys.
*
* @return This for chaining
*
* @throws IllegalStateException if the key strength was already set
*/
public SafeCacheBuilder<K, V> weakKeys() {
@ -277,6 +294,8 @@ public class SafeCacheBuilder<K, V> {
* <b>Note:</b> when this method is used, the resulting cache will use
* identity ({@code ==}) comparison to determine equality of values.
*
* @return This for chaining
*
* @throws IllegalStateException if the value strength was already set
*/
public SafeCacheBuilder<K, V> weakValues() {

Datei anzeigen

@ -50,6 +50,9 @@ public class BlockPosition {
/**
* Construct an immutable 3D vector.
* @param x - x coordinate
* @param y - y coordinate
* @param z - z coordinate
*/
public BlockPosition(int x, int y, int z) {
this.x = x;

Datei anzeigen

@ -210,6 +210,8 @@ public class BukkitConverters {
/**
* Retrieve an equivalent converter for a map of generic keys and primitive values.
* @param <T> Key type
* @param <U> Value type
* @param genericKeyType - the generic key type.
* @param keyConverter - an equivalent converter for the generic type.
* @return An equivalent converter.
@ -264,6 +266,7 @@ public class BukkitConverters {
/**
* Retrieve an equivalent converter for a list of generic items.
* @param <T> Type
* @param genericItemType - the generic item type.
* @param itemConverter - an equivalent converter for the generic type.
* @return An equivalent converter.
@ -320,6 +323,7 @@ public class BukkitConverters {
/**
* Retrieve an equivalent converter for an array of generic items.
* @param <T> Type
* <p>
* The array is wrapped in a list.
* @param genericItemType - the generic item type.
@ -878,6 +882,7 @@ public class BukkitConverters {
/**
* Wraps a given equivalent converter in NULL checks, ensuring that such values are ignored.
* @param <TType> Type
* @param delegate - the underlying equivalent converter.
* @return A equivalent converter that ignores NULL values.
*/

Datei anzeigen

@ -51,6 +51,9 @@ public class ChunkPosition {
/**
* Construct an immutable 3D vector.
* @param x - x coordinate
* @param y - y coordinate
* @param z - z coordinate
*/
public ChunkPosition(int x, int y, int z) {
this.x = x;

Datei anzeigen

@ -51,6 +51,7 @@ public class TroveWrapper {
*/
public static ReadOnlyFieldAccessor wrapMapField(final FieldAccessor accessor, final Function<Integer, Integer> noEntryTransform) {
return new ReadOnlyFieldAccessor() {
@Override
public Object get(Object instance) {
Object troveMap = accessor.get(instance);
@ -59,6 +60,7 @@ public class TroveWrapper {
TroveWrapper.transformNoEntryValue(troveMap, noEntryTransform);
return getDecoratedMap(troveMap);
}
@Override
public Field getField() {
return accessor.getField();
}
@ -72,9 +74,11 @@ public class TroveWrapper {
*/
public static ReadOnlyFieldAccessor wrapSetField(final FieldAccessor accessor) {
return new ReadOnlyFieldAccessor() {
@Override
public Object get(Object instance) {
return getDecoratedSet(accessor.get(instance));
}
@Override
public Field getField() {
return accessor.getField();
}
@ -88,9 +92,11 @@ public class TroveWrapper {
*/
public static ReadOnlyFieldAccessor wrapListField(final FieldAccessor accessor) {
return new ReadOnlyFieldAccessor() {
@Override
public Object get(Object instance) {
return getDecoratedList(accessor.get(instance));
}
@Override
public Field getField() {
return accessor.getField();
}
@ -99,6 +105,8 @@ public class TroveWrapper {
/**
* Retrieve a Java wrapper for the corresponding Trove map.
* @param <TKey> Key type
* @param <TValue> Value type
* @param troveMap - the trove map to wrap.
* @return The wrapped GNU Trove map.
* @throws IllegalStateException If GNU Trove cannot be found in the class map.
@ -113,6 +121,7 @@ public class TroveWrapper {
/**
* Retrieve a Java wrapper for the corresponding Trove set.
* @param <TValue> Type
* @param troveSet - the trove set to wrap.
* @return The wrapped GNU Trove set.
* @throws IllegalStateException If GNU Trove cannot be found in the class map.
@ -127,6 +136,7 @@ public class TroveWrapper {
/**
* Retrieve a Java wrapper for the corresponding Trove list.
* @param <TValue> Type
* @param troveList - the trove list to wrap.
* @return The wrapped GNU Trove list.
* @throws IllegalStateException If GNU Trove cannot be found in the class map.

Datei anzeigen

@ -128,6 +128,7 @@ public class WrappedAttribute extends AbstractWrapper {
/**
* Determine if the attribute has a given attribute modifier, identified by UUID.
* @param id - the id to check for.
* @return TRUE if it does, FALSE otherwise.
*/
public boolean hasModifier(UUID id) {

Datei anzeigen

@ -322,6 +322,7 @@ public class WrappedDataWatcher extends AbstractWrapper implements Iterable<Wrap
/**
* Retrieve the ID of a given type, if it's allowed to be watched.
* @param clazz - Class to check for.
* @return The ID, or NULL if it cannot be watched.
* @throws FieldAccessException If we cannot initialize the reflection machinery.
*/
@ -609,7 +610,8 @@ public class WrappedDataWatcher extends AbstractWrapper implements Iterable<Wrap
* @param newValue - the new watched value.
* @param secondary - optional secondary value.
* @param update - whether or not to refresh every listening client.
* @throws FieldAccessException Cannot read underlying field.
* @param type - custom type.
* @throws FieldAccessException If we cannot read the underlying field.
*/
public void setObject(int index, Object newValue, Object secondary, boolean update, CustomType type) throws FieldAccessException {
Object created = type.newInstance(newValue, secondary);

Datei anzeigen

@ -148,6 +148,7 @@ public class WrappedGameProfile extends AbstractWrapper {
* Construct a wrapper around an existing game profile.
*
* @param handle - the underlying profile, or NULL.
* @return A wrapper around an existing game profile.
*/
public static WrappedGameProfile fromHandle(Object handle) {
if (handle == null)

Datei anzeigen

@ -445,6 +445,7 @@ public class WrappedServerPing extends AbstractWrapper {
/**
* Retrieve a compressed image from an image.
* @param image - the image.
* @return A compressed image from an image.
* @throws IOException If we were unable to compress the image.
*/
public static CompressedImage fromPng(RenderedImage image) throws IOException {

Datei anzeigen

@ -184,7 +184,6 @@ public class WrappedWatchableObject extends AbstractWrapper {
/**
* Retrieve the type ID of a watchable object.
* <p>
* <table border=1>
* <caption>Type to Value</caption>
* <tbody>

Datei anzeigen

@ -84,6 +84,7 @@ public abstract class ConvertedMap<Key, VInner, VOuter> extends AbstractConverte
/**
* Convert a value from the inner map to the outer visible map.
* @param key - unused value.
* @param inner - the inner value.
* @return The outer value.
*/
@ -93,6 +94,7 @@ public abstract class ConvertedMap<Key, VInner, VOuter> extends AbstractConverte
/**
* Convert a value from the outer map to the internal inner map.
* @param key - unused value.
* @param outer - the outer value.
* @return The inner value.
*/
@ -161,6 +163,7 @@ public abstract class ConvertedMap<Key, VInner, VOuter> extends AbstractConverte
*
* @return a string representation of this map
*/
@Override
public String toString() {
Iterator<Entry<Key, VOuter>> i = entrySet().iterator();
if (!i.hasNext())

Datei anzeigen

@ -37,6 +37,7 @@ public interface NbtCompound extends NbtBase<Map<String, NbtBase<?>>>, Iterable<
/**
* Retrieve the value of a given entry.
* @param <T> Type
* @param key - key of the entry to retrieve.
* @return The value of this entry, or NULL if not found.
*/
@ -52,6 +53,7 @@ public interface NbtCompound extends NbtBase<Map<String, NbtBase<?>>>, Iterable<
/**
* Set a entry based on its name.
* @param <T> Type
* @param entry - entry with a name and value.
* @return This compound, for chaining.
* @throws IllegalArgumentException If entry is NULL.
@ -302,6 +304,7 @@ public interface NbtCompound extends NbtBase<Map<String, NbtBase<?>>>, Iterable<
/**
* Retrieve the NBT list value of an entry identified by a given key.
* @param <T> Type
* @param key - the key of the entry.
* @return The NBT list value of the entry.
* @throws IllegalArgumentException If the key doesn't exist.
@ -310,6 +313,7 @@ public interface NbtCompound extends NbtBase<Map<String, NbtBase<?>>>, Iterable<
/**
* Retrieve a NBT list value by its key, or create a new list if it doesn't exist.
* @param <T> Type
* @param key - the key of the entry to find or create.
* @return The compound value that was retrieved or just created.
*/
@ -317,6 +321,7 @@ public interface NbtCompound extends NbtBase<Map<String, NbtBase<?>>>, Iterable<
/**
* Associate a NBT list with the given key.
* @param <T> Type
* @param list - the list value.
* @return This current compound, for chaining.
*/
@ -324,6 +329,7 @@ public interface NbtCompound extends NbtBase<Map<String, NbtBase<?>>>, Iterable<
/**
* Associate a new NBT list with the given key.
* @param <T> Type
* @param key - the key and name of the new NBT list.
* @param list - the list of NBT elements.
* @return This current compound, for chaining.
@ -332,6 +338,7 @@ public interface NbtCompound extends NbtBase<Map<String, NbtBase<?>>>, Iterable<
/**
* Remove the NBT element that is associated with the given key.
* @param <T> Type
* @param key - the key of the element to remove.
* @return The removed element, or NULL if no such element was found.
*/

Datei anzeigen

@ -94,6 +94,8 @@ public class NbtFactory {
* Get a NBT wrapper from a NBT base.
* <p>
* This may clone the content if the NbtBase is not a NbtWrapper.
*
* @param <T> Type
* @param base - the base class.
* @return A NBT wrapper.
*/
@ -282,6 +284,7 @@ public class NbtFactory {
* Initialize a NBT wrapper.
* <p>
* Use {@link #fromNMS(Object, String)} instead.
* @param <T> Type
* @param handle - the underlying net.minecraft.server object to wrap.
* @return A NBT wrapper.
*/
@ -301,6 +304,7 @@ public class NbtFactory {
/**
* Initialize a NBT wrapper with a name.
* @param <T> Type
* @param name - the name of the tag, or NULL if not valid.
* @param handle - the underlying net.minecraft.server object to wrap.
* @return A NBT wrapper.
@ -460,6 +464,7 @@ public class NbtFactory {
/**
* Create a new NBT wrapper from a given type.
* @param <T> Type
* @param type - the NBT type.
* @param name - the name of the NBT tag.
* @return The new wrapped NBT tag.
@ -539,6 +544,7 @@ public class NbtFactory {
/**
* Create a new NBT wrapper from a given type.
* @param <T> Type
* @param type - the NBT type.
* @param name - the name of the NBT tag.
* @param value - the value of the new tag.
@ -555,6 +561,7 @@ public class NbtFactory {
/**
* Create a new NBT wrapper from a given type.
* @param <T> Type
* @param type - type of the NBT value.
* @param name - the name of the NBT tag.
* @param value - the value of the new tag.

Datei anzeigen

@ -46,7 +46,7 @@ public interface NbtList<TType> extends NbtBase<List<NbtBase<TType>>>, Iterable<
/**
* Add a NBT list or NBT compound to the list.
* @param element
* @param element Element to add
*/
public abstract void add(NbtBase<TType> element);

Datei anzeigen

@ -102,6 +102,7 @@ public class NbtBinarySerializer {
/**
* Load an NBT tag from a stream.
* @param <TType> Type
* @param source - the input stream.
* @return An NBT tag.
*/

Datei anzeigen

@ -69,6 +69,7 @@ public class NbtConfigurationSerializer {
/**
* Write the content of a NBT tag to a configuration section.
* @param <TType> Type
* @param value - the NBT tag to write.
* @param destination - the destination section.
*/
@ -168,6 +169,7 @@ public class NbtConfigurationSerializer {
/**
* Read a NBT tag from a root configuration.
* @param <TType> Type
* @param root - configuration that contains the NBT tag.
* @param nodeName - name of the NBT tag.
* @return The read NBT tag.
@ -189,6 +191,7 @@ public class NbtConfigurationSerializer {
/**
* Read a NBT compound from a root configuration.
* @param <T> Type
* @param root - configuration that contains the NBT compound.
* @param nodeName - name of the NBT compound.
* @return The read NBT compound.

Datei anzeigen

@ -48,6 +48,7 @@ public class NbtTextSerializer {
/**
* Serialize a NBT tag to a base-64 encoded string.
* @param <TType> Type
* @param value - the NBT tag to serialize.
* @return The NBT tag in base-64 form.
*/
@ -63,6 +64,7 @@ public class NbtTextSerializer {
/**
* Deserialize a NBT tag from a base-64 encoded string.
* @param <TType> Type
* @param input - the base-64 string.
* @return The NBT tag contained in the string.
* @throws IOException If we are unable to parse the input.
@ -87,6 +89,7 @@ public class NbtTextSerializer {
/**
* Deserialize a NBT list from a base-64 encoded string.
* @param <T> Type
* @param input - the base-64 string.
* @return The NBT tag contained in the string.
* @throws IOException If we are unable to parse the input.