mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Fixed item-dupe bug after teleport
This commit is contained in:
parent
673ec0f122
commit
a6b5adf1dc
@ -64,7 +64,6 @@ public class DPlayer {
|
||||
this.savePlayer = new DSavePlayer(player.getName(), player.getLocation(), player.getInventory().getContents(), player.getInventory().getArmorContents(), player.getLevel(),
|
||||
player.getTotalExperience(), (int) player.getHealth(), player.getFoodLevel(), player.getFireTicks(), player.getGameMode(), player.getActivePotionEffects());
|
||||
|
||||
this.player.teleport(teleport);
|
||||
this.player.getInventory().clear();
|
||||
this.player.getInventory().setArmorContents(null);
|
||||
this.player.setTotalExperience(0);
|
||||
@ -100,6 +99,8 @@ public class DPlayer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.player.teleport(teleport);
|
||||
}
|
||||
|
||||
public void escape() {
|
||||
|
@ -58,7 +58,6 @@ public class DSavePlayer {
|
||||
Player onlinePlayer = p.getServer().getPlayer(this.playerName);
|
||||
if (onlinePlayer != null) {
|
||||
/* Player is online */
|
||||
onlinePlayer.teleport(this.oldLocation);
|
||||
onlinePlayer.getInventory().setContents(this.oldInventory);
|
||||
onlinePlayer.getInventory().setArmorContents(this.oldArmor);
|
||||
onlinePlayer.setTotalExperience(this.oldExp);
|
||||
@ -71,6 +70,8 @@ public class DSavePlayer {
|
||||
onlinePlayer.removePotionEffect(effect.getType());
|
||||
}
|
||||
onlinePlayer.addPotionEffects(this.oldPotionEffects);
|
||||
|
||||
onlinePlayer.teleport(this.oldLocation);
|
||||
} else {
|
||||
/* Player is offline */
|
||||
Player offlinePlayer = p.getOfflinePlayer(this.playerName, this.oldLocation);
|
||||
|
Loading…
Reference in New Issue
Block a user