Package dan200.computercraft.api.lua

Examples of dan200.computercraft.api.lua.ILuaObject


    ClassMethodsList<IObjectMethodExecutor> adapted = manager.getAdapterClass(target.getClass());
    return wrap(adapted, target);
  }

  public static ILuaObject wrap(final ClassMethodsList<IObjectMethodExecutor> adapted, final Object target) {
    return new ILuaObject() {

      @Override
      public String[] getMethodNames() {
        return adapted.methodNames;
      }
View Full Code Here


      throw e.rethrow();
    } catch (Throwable e) {
      String methodName = wrapped.methodNames[index];
      Log.log(Level.DEBUG, e, "Unwrapped error during method %s(%d) execution on peripheral %s, args: %s",
          methodName, index, type, Arrays.toString(arguments));
      throw new LuaException("Internal error. Check logs for info");
    }
  }
View Full Code Here

    Throwable cause = getCause();
    return cause != null? getMessageForThrowable(cause) : "internal error";
  }

  public LuaException rethrow() throws LuaException {
    throw new LuaException(getMessage());
  }
View Full Code Here

  @Override
  public IPeripheral getPeripheral(TileEntity tile, int side) {
    if (tile == null) return null;

    IPeripheral peripheral = created.get(tile);

    if (peripheral == null) {
      peripheral = super.getPeripheral(tile, side);
      created.put(tile, peripheral);
    }
View Full Code Here

    @Override
    public void addInformation(World world, int x, int y, int z, List<String> infoList){
        infoList.add("blockTracker.info.peripheral.title");
        infoList.add("blockTracker.info.peripheral.availableMethods");
        IPeripheral peripheral = ((IPeripheralProvider)world.getBlock(x, y, z)).getPeripheral(world, x, y, z, 0);
        if(peripheral != null) {
            for(String method : peripheral.getMethodNames()) {
                infoList.add("-" + method);
            }
        }
    }
View Full Code Here

TOP

Related Classes of dan200.computercraft.api.lua.ILuaObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.