mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Code cleaning
Most notable change: Remove redundant type parameters and replaced with <>. This is a small step to bring us closer to upstream parity.
This commit is contained in:
@ -43,7 +43,7 @@ public class Metrics {
|
||||
/**
|
||||
* All of the custom graphs to submit to metrics.
|
||||
*/
|
||||
private final Set<Graph> graphs = Collections.synchronizedSet(new HashSet<Graph>());
|
||||
private final Set<Graph> graphs = Collections.synchronizedSet(new HashSet<>());
|
||||
/**
|
||||
* Unique server id.
|
||||
*/
|
||||
@ -581,4 +581,4 @@ public class Metrics {
|
||||
return plotter.name.equals(this.name) && plotter.getValue() == getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ final class JsonString implements JsonRepresentedObject, ConfigurationSerializab
|
||||
}
|
||||
|
||||
public Map<String, Object> serialize() {
|
||||
HashMap<String, Object> theSingleValue = new HashMap<String, Object>();
|
||||
HashMap<String, Object> theSingleValue = new HashMap<>();
|
||||
theSingleValue.put("stringValue", _value);
|
||||
return theSingleValue;
|
||||
}
|
||||
|
@ -177,12 +177,12 @@ public final class Reflection {
|
||||
*/
|
||||
public synchronized static Method getMethod(Class<?> clazz, String name, Class<?>... args) {
|
||||
if (!_loadedMethods.containsKey(clazz)) {
|
||||
_loadedMethods.put(clazz, new HashMap<String, Map<ArrayWrapper<Class<?>>, Method>>());
|
||||
_loadedMethods.put(clazz, new HashMap<>());
|
||||
}
|
||||
|
||||
Map<String, Map<ArrayWrapper<Class<?>>, Method>> loadedMethodNames = _loadedMethods.get(clazz);
|
||||
if (!loadedMethodNames.containsKey(name)) {
|
||||
loadedMethodNames.put(name, new HashMap<ArrayWrapper<Class<?>>, Method>());
|
||||
loadedMethodNames.put(name, new HashMap<>());
|
||||
}
|
||||
|
||||
Map<ArrayWrapper<Class<?>>, Method> loadedSignatures = loadedMethodNames.get(name);
|
||||
|
@ -72,7 +72,7 @@ public class BukkitImageListener implements Listener {
|
||||
String name = player.getName().toLowerCase();
|
||||
if (!event.getMessage().toLowerCase().contains(name)) {
|
||||
ArrayDeque<String> buffered = fp.getMeta("CFIBufferedMessages");
|
||||
if (buffered == null) fp.setMeta("CFIBufferedMessaged", buffered = new ArrayDeque<String>());
|
||||
if (buffered == null) fp.setMeta("CFIBufferedMessaged", buffered = new ArrayDeque<>());
|
||||
String full = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage());
|
||||
buffered.add(full);
|
||||
iter.remove();
|
||||
@ -280,4 +280,4 @@ public class BukkitImageListener implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class ItemUtil {
|
||||
if (nativeTag != null) return (CompoundTag) nativeTag;
|
||||
}
|
||||
Tag nativeTag = BukkitQueue_0.toNative(nmsTag);
|
||||
map.put(nmsTag.hashCode(), new WeakReference<Tag>(nativeTag));
|
||||
map.put(nmsTag.hashCode(), new WeakReference<>(nativeTag));
|
||||
return null;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
|
@ -154,7 +154,7 @@ public class BukkitQueue_All extends BukkitQueue_0<ChunkSnapshot, ChunkSnapshot,
|
||||
Object nmsChunk = methodGetHandleChunk.invoke(chunk);
|
||||
boolean mustSave = saveChunks && (boolean) methodNeedsSaving.invoke(nmsChunk, false);
|
||||
chunk.unload(mustSave, false);
|
||||
if (unloaded == null) unloaded = new ArrayDeque<Chunk>();
|
||||
if (unloaded == null) unloaded = new ArrayDeque<>();
|
||||
unloaded.add(chunk);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user