package openperipheral.integration.thermalexpansion;

import java.util.Locale;

import openperipheral.api.*;
import cofh.api.tileentity.ISecureTile;
import cofh.api.tileentity.ISecureTile.AccessMode;

public class AdapterSecureTile implements IPeripheralAdapter {

	@Override
	public Class<?> getTargetClass() {
		return ISecureTile.class;
	}

	@LuaMethod(description = "Gets the owner of the machine.", returnType = LuaType.STRING)
	public String getOwnerName(ISecureTile tile) {
		return tile.getOwnerName();
	}

	@LuaMethod(description = "Is this username allowed to access the machine.", returnType = LuaType.BOOLEAN, args = {
			@Arg(name = "username", description = "The username to check for", type = LuaType.STRING)
	})
	public boolean canPlayerAccess(ISecureTile tile, String name) {
		return tile.canPlayerAccess(name);
	}

	@LuaMethod(description = "Gets the AccessMode of this machine.", returnType = LuaType.STRING)
	public String getAccess(ISecureTile tile) {
		return tile.getAccess().name();
	}

	@LuaMethod(description = "Sets the AccessMode of this machine.", returnType = LuaType.BOOLEAN, args = {
			@Arg(name = "accessMode", description = "The access mode you wish to set (can be PUBLIC,RESTRICTED or PRIVATE)", type = LuaType.STRING)
	})
	public boolean setAccess(ISecureTile tile, String access) {
		try {
			AccessMode mode = AccessMode.valueOf(access.toUpperCase(Locale.ENGLISH));
			return tile.setAccess(mode);
		} catch (IllegalArgumentException e) {}
		return false;
	}
}

@@ -1009,493 +1009,7 @@
 %09%7D%0A%0A
-%09@LuaMethod(description = %22Sets the AccessMode of this machine.%22, returnType = LuaType.BOOLEAN, args = %7B%0A%09%09%09@Arg(name = %22accessMode%22, description = %22The access mode you wish to set (can be PUBLIC,RESTRICTED or PRIVATE)%22, type = LuaType.STRING)%0A%09%7D)%0A%09public boolean setAccess(ISecureTile tile, String access) %7B%0A%09%09try %7B%0A%09%09%09AccessMode mode = AccessMode.valueOf(access.toUpperCase(Locale.ENGLISH));%0A%09%09%09return tile.setAccess(mode);%0A%09%09%7D catch (IllegalArgumentException e) %7B%7D%0A%09%09return false;%0A%09%7D
 %0A%7D%0A

Remove setAccess from TE Strongboxes