當前位置: 首頁>>代碼示例>>Java>>正文


Java Loader類代碼示例

本文整理匯總了Java中org.rev317.min.Loader的典型用法代碼示例。如果您正苦於以下問題:Java Loader類的具體用法?Java Loader怎麽用?Java Loader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Loader類屬於org.rev317.min包,在下文中一共展示了Loader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getGroundItems

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Gets all loaded GroundItems within an radius of 52 Tiles.
 *
 * @return GroundItem array
 */
public final static GroundItem[] getGroundItems(
        final Filter<GroundItem> filter) {
    if (client == null) {
        client = Loader.getClient();
    }
    final ArrayList<GroundItem> items = new ArrayList<>();
    for (int x = 0; x < 104; x++) {
        for (int y = 0; y < 104; y++) {
            final GroundItem[] groundItemsAtTile = getGroundItemsAt(x, y);
            if (groundItemsAtTile != null) {
                for (final GroundItem item : groundItemsAtTile) {
                    if (filter.accept(item)) {
                        items.add(item);
                    }
                }
            }
        }
    }

    return items.toArray(new GroundItem[items.size()]);
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:27,代碼來源:GroundItems.java

示例2: getPlayers

import org.rev317.min.Loader; //導入依賴的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()]);
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:24,代碼來源:Players.java

示例3: getNpcs

import org.rev317.min.Loader; //導入依賴的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()]);
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:24,代碼來源:Npcs.java

示例4: getSceneObjectAtTile

import org.rev317.min.Loader; //導入依賴的package包/類
private static SceneObject getSceneObjectAtTile(int x, int y) {
    Ground sceneTile = Loader.getClient().getScene().getGroundArray()[Game.getPlane()][x][y];
    if (sceneTile == null) {
        return null;
    }

    final SceneObjectTile[] interactiveObjects = sceneTile.getInteractiveObjects();
    if (interactiveObjects != null) {
        for (final SceneObjectTile interactiveObject : interactiveObjects) {
            if (interactiveObject != null) {
                return new SceneObject(interactiveObject, SceneObject.TYPE_INTERACTIVE);
            }
        }
    }

    SceneObjectTile sceneObjectTile = sceneTile.getWallObject();
    if (sceneObjectTile != null) {
        return new SceneObject(sceneObjectTile, SceneObject.TYPE_WALL);
    }

    return null;
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:23,代碼來源:SceneObjects.java

示例5: getInteractingCharacter

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Returns the character this character is interacting with
 *
 * @return interacting character
 */
public final Character getInteractingCharacter() {
    int index = this.accessor.getInteractingEntity();
    if (index != -1 && index < 32768) {
        org.rev317.min.accessors.Npc npc = Loader.getClient().getNpcs()[index];
        return (npc != null) ? new Npc(npc, index) : null;
    } else if (index >= 32768) {
        index -= 32768;
        try {
            org.rev317.min.accessors.Player player = Loader.getClient().getPlayers()[index];
            return (player != null) ? new Player(player, index) : null;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return null;
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:22,代碼來源:Character.java

示例6: intercept

import org.rev317.min.Loader; //導入依賴的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);
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:22,代碼來源:MenuAction.java

示例7: getInteractingCharacter

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Returns the character this character is interacting with
 *
 * @return interacting character
 */
public final Character getInteractingCharacter() {
    int index = this.accessor.getInteractingEntity();
    if (index != -1 && index < 32768) {
        return new Npc(Loader.getClient().getNpcs()[index], index);
    } else if (index >= 32768) {
        index -= 32768;
        try {
            if (Loader.getClient().getPlayers()[index] == null) {
                return Players.getMyPlayer();
            }
            return new Player(Loader.getClient().getPlayers()[index], index);
        } catch (Throwable t) {
            return Players.getMyPlayer();
        }
    }

    return null;
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-Dreamscape,代碼行數:24,代碼來源:Character.java

示例8: getGroundItemsAt

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Gets GroundItems at a specific tile using x and y location.
 *
 * @param x - local region x
 * @param y - local region y
 *
 * @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
 */
public static final GroundItem[] getGroundItemsAt(final int x, final int y) {
    try {
        if (client == null) {
            client = Loader.getClient();
        }

        final Deque deque = client.getGroundItems()[Game.getPlane()][x][y];
        if (deque == null) {
            return null;
        }

        ArrayList<GroundItem> list    = new ArrayList<>();
        final Node            holder  = deque.getHead();
        Node                  curNode = holder.getNext();
        while (curNode != null && curNode != holder
                && curNode != deque.getHead()) {
            final org.rev317.min.accessors.Item groundItem = (org.rev317.min.accessors.Item) curNode;
            list.add(new GroundItem(groundItem, x, y));
            curNode = curNode.getNext();
        }

        return list.toArray(new GroundItem[list.size()]);
    } catch (Exception e) {
        e.printStackTrace();
    }

    return null;
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:37,代碼來源:GroundItems.java

示例9: hasAction4

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Determines whether this client has action 4 hooked
 *
 * @return <code>true</code> if action 4 is hooked
 */
public static boolean hasAction4() {
    try {
        Loader.getClient().getMenuAction4();
        return true;
    } catch (AbstractMethodError e) {
        return false;
    }
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:14,代碼來源:Game.java

示例10: confirmedDropClient

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Drops the client and returns if the game is logged out or not
 *
 * @return True if game is logged out, false if not
 */
public static boolean confirmedDropClient() {
    Loader.getClient().dropClient();
    Time.sleep(new SleepCondition() {
        @Override
        public boolean isValid() {
            return !isLoggedIn();
        }
    }, 2500);

    return !isLoggedIn();
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:17,代碼來源:Game.java

示例11: sendAction

import org.rev317.min.Loader; //導入依賴的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);
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:24,代碼來源:Menu.java

示例12: walkTo

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Walks from tile to tile
 *
 * @param from Tile to Walk From.
 * @param to   Tile to Walk To.
 */
public static void walkTo(Tile from, Tile to) {
    if (Context.getInstance().getServerProviderInfo().getServerName().equalsIgnoreCase("pkhonor")) {
        Loader.getClient().walkToPKH(false, false, 0, 0, 0, 0, from.getLocation().getRegionY(), 0, 0, to.getRegionY(), from.getLocation().getRegionX(), true, to.getRegionX());
    } else {
        Loader.getClient().walkTo(0, 0, 0, 0, from.getRegionY(), 0, 0, to.getRegionY(), from.getRegionX(), true, to.getRegionX());
    }
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:14,代碼來源:Walking.java

示例13: getBankItemIDs

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Gets all bank item ids in bank
 *
 * @return bank items
 */
public static int[] getBankItemIDs() {
    if (!isOpen()) {
        return null;
    }

    return Loader.getClient().getInterfaceCache()[settings.get("item_interface_id")].getItems();
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:13,代碼來源:Bank.java

示例14: getBankStacks

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Gets all stack sizes in bank
 *
 * @return stack sizes
 */
public static int[] getBankStacks() {
    if (!isOpen()) {
        return null;
    }

    return Loader.getClient().getInterfaceCache()[settings.get("item_interface_id")].getStackSizes();
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-PkHonor,代碼行數:13,代碼來源:Bank.java

示例15: getBankItemIDs

import org.rev317.min.Loader; //導入依賴的package包/類
/**
 * Gets all bank item ids in bank
 *
 * @return bank items
 */
public static int[] getBankItemIDs() {
    if (!isOpen()) {
        return null;
    }

    return Loader.getClient().getInterfaceCache()[Settings.getActionByName("item_interface_id")].getItems();
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified,代碼行數:13,代碼來源:Bank.java


注:本文中的org.rev317.min.Loader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。