From 07f6b730be768fba21958d9faa8ea480c955ea44 Mon Sep 17 00:00:00 2001 From: Frank Baumann Date: Tue, 2 Oct 2012 19:55:20 +0200 Subject: [PATCH] Error fix --- .../com/dre/dungeonsxl/game/MobSpawner.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/DungeonsXL/src/com/dre/dungeonsxl/game/MobSpawner.java b/DungeonsXL/src/com/dre/dungeonsxl/game/MobSpawner.java index dbe9e647..19000c9e 100644 --- a/DungeonsXL/src/com/dre/dungeonsxl/game/MobSpawner.java +++ b/DungeonsXL/src/com/dre/dungeonsxl/game/MobSpawner.java @@ -36,24 +36,26 @@ public class MobSpawner { World world=this.block.getWorld(); for(Player player:world.getPlayers()){ - if(player.getLocation().distance(this.block.getLocation())0){ - new DMob(mob,live,GameWorld.get(world)); - } - - if(ammount!=-1){ - if(ammount>1){ - ammount--; - }else{ - mobspawners.remove(this); + if(player.getWorld()!=world){ + if(player.getLocation().distance(this.block.getLocation())0){ + new DMob(mob,live,GameWorld.get(world)); } + + if(ammount!=-1){ + if(ammount>1){ + ammount--; + }else{ + mobspawners.remove(this); + } + } + this.interval=this.maxinterval; } - this.interval=this.maxinterval; + this.interval--; + return; } - this.interval--; - return; } }