diff --git a/src/main/java/com/cleanroommc/groovyscript/core/mixin/groovy/MetaClassImplMixin.java b/src/main/java/com/cleanroommc/groovyscript/core/mixin/groovy/MetaClassImplMixin.java index 7ef2c8520..c754cca70 100644 --- a/src/main/java/com/cleanroommc/groovyscript/core/mixin/groovy/MetaClassImplMixin.java +++ b/src/main/java/com/cleanroommc/groovyscript/core/mixin/groovy/MetaClassImplMixin.java @@ -58,6 +58,13 @@ public void invokeStaticMissingMethod(Class sender, String methodName, Object } } + @Inject(method = "invokeStaticMissingProperty", at = @At("HEAD"), cancellable = true) + public void invokeStaticMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter, CallbackInfoReturnable cir) { + if (!isGetter) return; + Object o = GroovyScript.getSandbox().getBindings().get(propertyName); + if (o != null) cir.setReturnValue(o); + } + /** * @author brachy * @reason class scripts being unable to use bindings and this method calling closures improperly