mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +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(),
|
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());
|
player.getTotalExperience(), (int) player.getHealth(), player.getFoodLevel(), player.getFireTicks(), player.getGameMode(), player.getActivePotionEffects());
|
||||||
|
|
||||||
this.player.teleport(teleport);
|
|
||||||
this.player.getInventory().clear();
|
this.player.getInventory().clear();
|
||||||
this.player.getInventory().setArmorContents(null);
|
this.player.getInventory().setArmorContents(null);
|
||||||
this.player.setTotalExperience(0);
|
this.player.setTotalExperience(0);
|
||||||
@ -100,6 +99,8 @@ public class DPlayer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.player.teleport(teleport);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void escape() {
|
public void escape() {
|
||||||
|
@ -58,7 +58,6 @@ public class DSavePlayer {
|
|||||||
Player onlinePlayer = p.getServer().getPlayer(this.playerName);
|
Player onlinePlayer = p.getServer().getPlayer(this.playerName);
|
||||||
if (onlinePlayer != null) {
|
if (onlinePlayer != null) {
|
||||||
/* Player is online */
|
/* Player is online */
|
||||||
onlinePlayer.teleport(this.oldLocation);
|
|
||||||
onlinePlayer.getInventory().setContents(this.oldInventory);
|
onlinePlayer.getInventory().setContents(this.oldInventory);
|
||||||
onlinePlayer.getInventory().setArmorContents(this.oldArmor);
|
onlinePlayer.getInventory().setArmorContents(this.oldArmor);
|
||||||
onlinePlayer.setTotalExperience(this.oldExp);
|
onlinePlayer.setTotalExperience(this.oldExp);
|
||||||
@ -71,6 +70,8 @@ public class DSavePlayer {
|
|||||||
onlinePlayer.removePotionEffect(effect.getType());
|
onlinePlayer.removePotionEffect(effect.getType());
|
||||||
}
|
}
|
||||||
onlinePlayer.addPotionEffects(this.oldPotionEffects);
|
onlinePlayer.addPotionEffects(this.oldPotionEffects);
|
||||||
|
|
||||||
|
onlinePlayer.teleport(this.oldLocation);
|
||||||
} else {
|
} else {
|
||||||
/* Player is offline */
|
/* Player is offline */
|
||||||
Player offlinePlayer = p.getOfflinePlayer(this.playerName, this.oldLocation);
|
Player offlinePlayer = p.getOfflinePlayer(this.playerName, this.oldLocation);
|
||||||
|
Loading…
Reference in New Issue
Block a user