Removed ability to test dungeon in editmode

This commit is contained in:
Grafe 2013-01-21 00:34:15 +01:00
parent 72296cf08e
commit e808a9fb51
2 changed files with 34 additions and 66 deletions

View File

@ -9,6 +9,7 @@ import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
@ -31,8 +32,7 @@ public class DPlayer {
public Player player; public Player player;
public World world; public World world;
public DPlayer oldDPlayer=null; public boolean isinTestMode=false;
public int isinTestMode=0;
public Location oldLocation; public Location oldLocation;
public ItemStack[] oldInventory; public ItemStack[] oldInventory;
@ -114,10 +114,6 @@ public class DPlayer {
public void leave(){ public void leave(){
remove(this); remove(this);
if(this.oldDPlayer!=null){
this.oldDPlayer.isinTestMode=0;
}
this.player.teleport(this.oldLocation); this.player.teleport(this.oldLocation);
this.player.getInventory().setContents(this.oldInventory); this.player.getInventory().setContents(this.oldInventory);
this.player.getInventory().setArmorContents(this.oldArmor); this.player.getInventory().setArmorContents(this.oldArmor);
@ -144,7 +140,7 @@ public class DPlayer {
} }
//Belohnung //Belohnung
if(this.oldDPlayer==null&&this.isinTestMode!=2){//Nur wenn man nicht am Testen ist if(!this.isinTestMode){//Nur wenn man nicht am Testen ist
if(isFinished){ if(isFinished){
this.addTreasure(); this.addTreasure();
@ -439,7 +435,6 @@ public class DPlayer {
for(DPlayer dplayer:players){ for(DPlayer dplayer:players){
if(!updateSecond){ if(!updateSecond){
//Check in World //Check in World
if(dplayer.isinTestMode!=1){
if(!dplayer.player.getWorld().equals(dplayer.world)){ if(!dplayer.player.getWorld().equals(dplayer.world)){
if(dplayer.isEditing){ if(dplayer.isEditing){
EditWorld eworld=EditWorld.get(dplayer.world); EditWorld eworld=EditWorld.get(dplayer.world);
@ -480,7 +475,6 @@ public class DPlayer {
} }
} }
} }
}
}else{ }else{
//Update Wolf //Update Wolf
if(dplayer.wolf!=null){ if(dplayer.wolf!=null){

View File

@ -39,7 +39,7 @@ public class CMDTest extends DCommand {
}else{ }else{
newDPlayer=new DPlayer(player,dgroup.gworld.world,dgroup.gworld.locLobby, false); newDPlayer=new DPlayer(player,dgroup.gworld.world,dgroup.gworld.locLobby, false);
} }
newDPlayer.isinTestMode=2; newDPlayer.isinTestMode=true;
} }
}else{ }else{
p.msg(player, p.language.get("Error_DungeonNotExist",dungeonname)); p.msg(player, p.language.get("Error_DungeonNotExist",dungeonname));
@ -47,32 +47,6 @@ public class CMDTest extends DCommand {
}else{ }else{
this.displayhelp(player); this.displayhelp(player);
} }
}else if(dplayer.isEditing){
if(args.length>1){
dungeonname=args[1];
}else{
dungeonname=EditWorld.get(dplayer.world).dungeonname;
}
DGroup dgroup=new DGroup(player, dungeonname);
if(dgroup!=null){
if(dgroup.gworld==null){
dgroup.gworld=GameWorld.load(DGroup.get(player).dungeonname);
}
DPlayer newDPlayer;
if(dgroup.gworld.locLobby==null){
newDPlayer=new DPlayer(player,dgroup.gworld.world,dgroup.gworld.world.getSpawnLocation(), false);
}else{
newDPlayer=new DPlayer(player,dgroup.gworld.world,dgroup.gworld.locLobby, false);
}
newDPlayer.oldDPlayer=dplayer;
dplayer.isinTestMode=1;
}
}else{ }else{
p.msg(player, p.language.get("Error_LeaveDungeon")); p.msg(player, p.language.get("Error_LeaveDungeon"));
} }