Made BukkitEntity keep a weak ref to the entity and cleaned up code.

This commit is contained in:
sk89q
2014-07-18 11:43:18 -07:00
parent 781fc31d6f
commit 70f05c950a
6 changed files with 52 additions and 163 deletions

View File

@ -46,6 +46,11 @@ import java.util.List;
*/
public class NullWorld extends AbstractWorld {
private static final NullWorld INSTANCE = new NullWorld();
protected NullWorld() {
}
@Override
public String getName() {
return "null";
@ -120,4 +125,14 @@ public class NullWorld extends AbstractWorld {
public Entity createEntity(Location location, BaseEntity entity) {
return null;
}
/**
* Return an instance of this null world.
*
* @return a null world
*/
public static NullWorld getInstance() {
return INSTANCE;
}
}