Package dev.twilite.game.wrapper
Class World
java.lang.Object
dev.twilite.game.wrapper.World
Loaded game world/scene wrapper.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWorld(dev.twilite.game.internal.memory.RSWorld memory) Wraps a native world provider. -
Method Summary
Modifier and TypeMethodDescriptionarea()Returns the loaded world area.int[]Returns all collision flags.intReturns the collision flag at the specified Map coord.intcollisionFlag(int mapX, int mapY) Returns the collision flag at a map-local coordinate.int[]Returns collision flags for the current floor, indexed bymapY * width + mapX.voiddirectHeading(Heading heading) Directs your sailing to the specifiedHeadingvoiddirectWalk(int x, int y) Sets the next walk target in map-local coordinates.voiddirectWalk(Coord coord) Sets the next walk target to the supplied world coordinate.effects()Returns a lazy view of active spot effects.entities()Returns a lazy view of transmitted world entities.entity(int id) Returns a transmitted world entity by id.intfloor()Returns the current floor.Returns active hint arrows.intid()Returns the world id.Returns the local player.npc(int index) Returns an NPC by index.npcs()Returns a lazy view of loaded NPCs.objects()Returns all scene objects on the current floor.objects(int layer) Returns scene objects on this world's current floor whose layer matches the provided bitmask.origin()Returns the absolute origin of this loaded world area.player(int index) Returns a player by index.players()Returns a lazy view of loaded players.Returns active projectiles.size()Returns the loaded world area size.Returns tile items on the current floor.tileItems(int floor) Returns tile items on a floor.Returns tile items at a map-local coordinate.
-
Field Details
-
ROOT
public static final int ROOT- See Also:
-
-
Constructor Details
-
World
public World(dev.twilite.game.internal.memory.RSWorld memory) Wraps a native world provider.
-
-
Method Details
-
id
public int id()Returns the world id. -
origin
Returns the absolute origin of this loaded world area. -
floor
public int floor()Returns the current floor. -
size
Returns the loaded world area size. -
area
Returns the loaded world area. -
directWalk
public void directWalk(int x, int y) Sets the next walk target in map-local coordinates. -
directWalk
Sets the next walk target to the supplied world coordinate.Template coordinates are converted back to their loaded instance coordinate when available. This writes directly to the client's next-walk target and does not pathfind.
-
directHeading
Directs your sailing to the specifiedHeading -
collision
Returns the collision flag at the specified Map coord. -
collision
public int[] collision()Returns all collision flags. Indexing is as follows: `flags[mapY * world.size().width() + mapX]` -
localPlayer
Returns the local player. -
player
Returns a player by index. -
players
Returns a lazy view of loaded players. -
npc
Returns an NPC by index. -
npcs
Returns a lazy view of loaded NPCs. -
effects
Returns a lazy view of active spot effects. -
entity
Returns a transmitted world entity by id. -
entities
Returns a lazy view of transmitted world entities. -
tileItems
Returns tile items on the current floor. -
tileItems
Returns tile items on a floor. -
tileItems
Returns tile items at a map-local coordinate. -
projectiles
Returns active projectiles. -
hintArrows
Returns active hint arrows. -
collisionFlag
public int collisionFlag(int mapX, int mapY) Returns the collision flag at a map-local coordinate. -
collisionFlags
public int[] collisionFlags()Returns collision flags for the current floor, indexed bymapY * width + mapX. -
objects
Returns all scene objects on the current floor. -
objects
Returns scene objects on this world's current floor whose layer matches the provided bitmask. Example:objects(SceneObject.WALL | SceneObject.WALL_DECOR). UseSceneObject.ALLto include every object layer.
-