本文整理匯總了Java中org.rev317.min.accessors.Client類的典型用法代碼示例。如果您正苦於以下問題:Java Client類的具體用法?Java Client怎麽用?Java Client使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Client類屬於org.rev317.min.accessors包,在下文中一共展示了Client類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPlayers
import org.rev317.min.accessors.Client; //導入依賴的package包/類
/**
* Gets all players except local player
*
* @param filter
*
* @return all players
*/
public static final Player[] getPlayers(final Filter<Player> filter) {
final Client client = Loader.getClient();
ArrayList<Player> playerList = new ArrayList<>();
final org.rev317.min.accessors.Player[] accPlayers = client.getPlayers();
for (int i = 0; i < accPlayers.length; i++) {
if (accPlayers[i] == null) {
continue;
}
final Player player = new Player(accPlayers[i], i);
if (filter.accept(player)) {
playerList.add(player);
}
}
return playerList.toArray(new Player[playerList.size()]);
}
示例2: getNpcs
import org.rev317.min.accessors.Client; //導入依賴的package包/類
/**
* Gets all Npcs except local Npc
*
* @param filter
*
* @return all Npcs
*/
public static final Npc[] getNpcs(final Filter<Npc> filter) {
final Client client = Loader.getClient();
ArrayList<Npc> npcList = new ArrayList<>();
final org.rev317.min.accessors.Npc[] accNpcs = client.getNpcs();
for (int i = 0; i < accNpcs.length; i++) {
if (accNpcs[i] == null) {
continue;
}
final Npc npc = new Npc(accNpcs[i], i);
if (filter.accept(npc)) {
npcList.add(npc);
}
}
return npcList.toArray(new Npc[npcList.size()]);
}
示例3: intercept
import org.rev317.min.accessors.Client; //導入依賴的package包/類
public static void intercept(int index) {
int outputIndex = 0;
Client client = Loader.getClient();
int action1 = client.getMenuAction1()[index];
int action2 = client.getMenuAction2()[index];
int action3 = client.getMenuAction3()[index];
int action4 = 0;
int actionId = client.getMenuActionId()[index];
if (DActions.debugActions()) {
if (Game.hasAction4()) {
action4 = client.getMenuAction4()[index];
System.out.println(String.format(outputs[0][outputIndex], index, action1, action2, action3, action4, actionId));
} else {
System.out.println(String.format(outputs[1][outputIndex], index, action1, action2, action3, actionId));
}
}
final GameActionEvent actionEvent = new GameActionEvent(actionId, action1, action2, action3, action4, index);
ScriptEngine.getInstance().dispatch(actionEvent);
}
示例4: sendAction
import org.rev317.min.accessors.Client; //導入依賴的package包/類
/**
* Sends an action to the client
*
* @param action
* @param cmd1
* @param cmd2
* @param cmd3
* @param cmd4
* @param index
*/
public static void sendAction(int action, int cmd1, int cmd2, int cmd3, int cmd4, int index) {
Client client = Loader.getClient();
client.getMenuAction1()[index] = cmd1;
client.getMenuAction2()[index] = cmd2;
client.getMenuAction3()[index] = cmd3;
if (Game.hasAction4()) {
client.getMenuAction4()[index] = cmd4;
}
client.getMenuActionId()[index] = action;
client.doAction(index);
}
示例5: getClient
import org.rev317.min.accessors.Client; //導入依賴的package包/類
public static Client getClient() {
return (Client) Context.getInstance().getClient();
}