package net.wizardsoflua.lua.classes.common;

import static com.google.common.base.Preconditions.checkNotNull;

import net.wizardsoflua.lua.classes.ProxyingLuaClass;

public abstract class LuaInstanceProxy<D> extends DelegatingProxy<D> {
  protected final ProxyingLuaClass<?, ?> luaClass;
  protected D delegate;

  public LuaInstanceProxy(ProxyingLuaClass<?, ?> luaClass, D delegate) {
    super(luaClass.getClassLoader(), luaClass.getMetaTable(), delegate);
    this.luaClass = checkNotNull(luaClass, "luaClass == null!");
    this.delegate = checkNotNull(delegate, "delegate==null!");
  }

  public ProxyingLuaClass<?, ?> getLuaClass() {
    return luaClass;
  }
}

@@ -285,32 +285,8 @@
 ass;
-%0A  protected D delegate;
 %0A%0A  
@@ -498,71 +498,8 @@
 %22);%0A
-    this.delegate = checkNotNull(delegate, %22delegate==null!%22);%0A
   %7D%0A

Fix player duplication bug