runelite-api: export collision data

This commit is contained in:
WooxSolo
2018-04-28 11:31:07 -04:00
committed by Adam
parent f845cf26c2
commit 4b46be6eac
4 changed files with 85 additions and 1 deletions

View File

@@ -413,4 +413,6 @@ public interface Client extends GameEngine
void setAttackersHidden(boolean state);
void setProjectilesHidden(boolean state);
CollisionData[] getCollisionMaps();
}

View File

@@ -0,0 +1,30 @@
/*
* Copyright (c) 2018, Woox <https://github.com/wooxsolo>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api;
public interface CollisionData
{
int[][] getFlags();
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright (c) 2018, Woox <https://github.com/wooxsolo>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api;
public final class CollisionDataFlag
{
public static final int BLOCK_MOVEMENT_NORTH_WEST = 0x1;
public static final int BLOCK_MOVEMENT_NORTH = 0x2;
public static final int BLOCK_MOVEMENT_NORTH_EAST = 0x4;
public static final int BLOCK_MOVEMENT_EAST = 0x8;
public static final int BLOCK_MOVEMENT_SOUTH_EAST = 0x10;
public static final int BLOCK_MOVEMENT_SOUTH = 0x20;
public static final int BLOCK_MOVEMENT_SOUTH_WEST = 0x40;
public static final int BLOCK_MOVEMENT_WEST = 0x80;
public static final int BLOCK_MOVEMENT_OBJECT = 0x100;
public static final int BLOCK_MOVEMENT_FLOOR_DECORATION = 0x40000;
public static final int BLOCK_MOVEMENT_FLOOR = 0x200000; // Eg. water
public static final int BLOCK_MOVEMENT_FULL =
BLOCK_MOVEMENT_OBJECT |
BLOCK_MOVEMENT_FLOOR_DECORATION |
BLOCK_MOVEMENT_FLOOR;
public static final int BLOCK_LINE_OF_SIGHT_NORTH = BLOCK_MOVEMENT_NORTH << 9; // 0x400
public static final int BLOCK_LINE_OF_SIGHT_EAST = BLOCK_MOVEMENT_EAST << 9; // 0x1000
public static final int BLOCK_LINE_OF_SIGHT_SOUTH = BLOCK_MOVEMENT_SOUTH << 9; // 0x4000
public static final int BLOCK_LINE_OF_SIGHT_WEST = BLOCK_MOVEMENT_WEST << 9; // 0x10000
public static final int BLOCK_LINE_OF_SIGHT_FULL = 0x20000;
}

View File

@@ -24,9 +24,10 @@
*/
package net.runelite.rs.api;
import net.runelite.api.CollisionData;
import net.runelite.mapping.Import;
public interface RSCollisionData
public interface RSCollisionData extends CollisionData
{
@Import("flags")
int[][] getFlags();