Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

Commit ba93b10

Browse files
committed
Add method to determine if the proxy is a static object proxy or not
1 parent 55c5cc0 commit ba93b10

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main/java/me/theminecoder/minecraft/nmsproxy/NMSProxy.java

+2
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ public interface NMSProxy {
1515
*/
1616
Object getProxyHandle();
1717

18+
boolean isProxyStatic();
19+
1820
}

src/main/java/me/theminecoder/minecraft/nmsproxy/proxy/NMSProxyInvocationHandler.java

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
4444
return proxyProvider.getStaticNMSObject((Class<? extends NMSProxy>) proxy.getClass().getInterfaces()[0]);
4545
}
4646

47+
if(method.getName().equals("isProxyStatic")) {
48+
return handle == null;
49+
}
50+
4751
if (method.isDefault()) {
4852
final Class<?> declaringClass = method.getDeclaringClass();
4953
boolean extraClass = false;

0 commit comments

Comments
 (0)