MCPcopy Create free account
hub / github.com/boxbeam/RedLib / invoke

Method invoke

src/redempt/redlib/misc/EntityPersistor.java:50–65  ·  view source on GitHub ↗
(Object proxy, Method method, Object[] args)

Source from the content-addressed store, hash-verified

48 private T instance = entity;
49
50 @Override
51 public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
52 if (!instance.isValid()) {
53 T replace = (T) Bukkit.getEntity(instance.getUniqueId());
54 if (replace != null) {
55 instance = replace;
56 }
57 }
58 if (method.getName().equals("equals") && method.getParameters().length == 1 && method.getParameters()[0].getName().equals("Object")) {
59 if (args[0] instanceof Entity) {
60 return ((Entity) args[0]).getUniqueId().equals(instance.getUniqueId());
61 }
62 return false;
63 }
64 return method.invoke(instance, args);
65 }
66
67 });
68 }

Callers 5

invokeDeserializeMethod · 0.80
wrapMethod · 0.80
callStaticMethodMethod · 0.80
callMethodMethod · 0.80
instantiateMethod · 0.80

Calls 2

equalsMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected