some codestyle application

This commit is contained in:
dordsor21
2021-09-08 16:39:43 +01:00
parent dc11b74020
commit 195a13a23c
92 changed files with 465 additions and 291 deletions

View File

@ -68,9 +68,11 @@ class Int2BaseBlockMap extends AbstractInt2ObjectMap<BaseBlock> {
}
private final Int2IntMap commonMap = new Int2IntOpenHashMap(64, 0.9f);
{
commonMap.defaultReturnValue(BlockStateIdAccess.invalidId());
}
private final Int2ObjectMap<BaseBlock> uncommonMap = new Int2ObjectOpenHashMap<>(1, 0.75f);
@Override

View File

@ -68,7 +68,12 @@ class AnnotatedSubscriberFinder implements SubscriberFindingStrategy {
throw new IllegalArgumentException("Method " + method + " failed to unreflect.", e);
}
EventHandler handler = new MethodHandleEventHandler(annotation.priority(), listener, handle, method.getName());
EventHandler handler = new MethodHandleEventHandler(
annotation.priority(),
listener,
handle,
method.getName()
);
methodsInListener.put(eventType, handler);
}
}

View File

@ -36,7 +36,7 @@ public class MethodEventHandler extends EventHandler {
* Create a new event handler.
*
* @param priority the priority
* @param method the method
* @param method the method
*/
public MethodEventHandler(Priority priority, Object object, Method method) {
super(priority);
@ -83,4 +83,5 @@ public class MethodEventHandler extends EventHandler {
result = 31 * result + method.hashCode();
return result;
}
}

View File

@ -32,10 +32,10 @@ public class MethodHandleEventHandler extends EventHandler {
/**
* Create a new event handler that uses MethodHandles to dispatch.
*
* @param priority the priority
* @param object The object to invoke it on
* @param priority the priority
* @param object The object to invoke it on
* @param methodHandle The handle to invoke
* @param methodName The name of the method (for equality checks)
* @param methodName The name of the method (for equality checks)
*/
protected MethodHandleEventHandler(Priority priority, Object object, MethodHandle methodHandle, String methodName) {
super(priority);
@ -79,4 +79,5 @@ public class MethodHandleEventHandler extends EventHandler {
return Objects.equals(object, that.object);
}
}