simon987 / Much-Assembly-Required

Assembly programming game
GNU General Public License v3.0
930 stars 87 forks source link

Vault dimension creation problem #161

Closed simon987 closed 6 years ago

simon987 commented 6 years ago

I assume that it happens when lastLayerWorlds.size() is 0

Stack trace:

Exception in thread "Thread-10" java.lang.IllegalArgumentException: bound must be positive
    at java.util.Random.nextInt(Random.java:388)
    at net.simon987.npcplugin.VaultDimension.<init>(VaultDimension.java:140)
    at net.simon987.npcplugin.VaultDoor.initialize(VaultDoor.java:159)
    at net.simon987.npcplugin.event.WorldCreationListener.handle(WorldCreationListener.java:136)
    at net.simon987.server.event.GameEventDispatcher.dispatch(GameEventDispatcher.java:33)
    at net.simon987.server.game.world.WorldGenerator.generateWorld(WorldGenerator.java:188)
    at net.simon987.server.game.GameUniverse.createWorld(GameUniverse.java:167)
    at net.simon987.server.game.GameUniverse.getWorld(GameUniverse.java:109)
    at net.simon987.server.game.objects.GameObject.incrementLocation(GameObject.java:66)
    at net.simon987.npcplugin.NonPlayerCharacter.gotoWorld(NonPlayerCharacter.java:154)
    at net.simon987.npcplugin.HarvestTask.tick(HarvestTask.java:98)
    at net.simon987.npcplugin.HarvesterNPC.update(HarvesterNPC.java:43)
    at net.simon987.server.game.world.World.update(World.java:183)
    at net.simon987.server.GameServer.tick(GameServer.java:192)
    at net.simon987.server.GameServer.run(GameServer.java:144)
    at java.lang.Thread.run(Thread.java:748)