Merge pull request #66 from jtara1/master

HarvesterNPC should spawn a biomass in-place after they die. Fixes #33
This commit is contained in:
Simon Fortier
2018-01-03 19:00:55 -05:00
committed by GitHub
6 changed files with 97 additions and 1 deletions

View File

@@ -3,9 +3,13 @@ package net.simon987.npcplugin;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import net.simon987.server.GameServer;
import net.simon987.server.event.ObjectDeathEvent;
import net.simon987.server.game.Direction;
import net.simon987.server.logging.LogManager;
import org.json.simple.JSONObject;
import java.lang.util.Random;
public class HarvesterNPC extends NonPlayerCharacter {
public static final int ID = 10;
@@ -44,6 +48,12 @@ public class HarvesterNPC extends NonPlayerCharacter {
}
}
@Override
public void onDeadCallback() {
GameServer.INSTANCE.getEventDispatcher().dispatch(
new ObjectDeathEvent((Object)this, ID));
}
@Override
public JSONObject serialise() {
JSONObject json = super.serialise();