1package com.runehive.util.parser.impl;
3import com.google.gson.JsonObject;
4import com.runehive.game.world.entity.mob.Direction;
5import com.runehive.game.world.entity.mob.Mob;
6import com.runehive.game.world.entity.mob.npc.Npc;
7import com.runehive.game.world.position.Position;
8import com.runehive.util.parser.GsonParser;
9import org.jire.runehiveps.OldToNew;
19 super(
"def/npc/npc_spawns");
23 protected void parse(JsonObject data) {
24 int id = data.get(
"id").getAsInt();
25 boolean convertId =
true;
26 if (data.has(
"convert-id")) {
27 convertId = data.get(
"convert-id").getAsBoolean();
39 if (data.has(
"radius")) {
40 radius = data.get(
"radius").getAsInt();
43 if (data.has(
"instance")) {
44 instance = data.get(
"instance").getAsInt();
46 new Npc(
id, position, radius, instance, facing).
register();
static final int DEFAULT_INSTANCE
Represents a non-player character in the in-game world.
void register()
Registers an entity to the World.
Represents a single tile on the game world.
GsonParser(String path)
Creates a new GsonParser.
transient Gson builder
The Gson object.
void parse(JsonObject data)
The method allows a user to modify the data as its being parsed.
Represents the enumerated directions an entity can walk or face.