mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Fix gamemode not being reset if !keepInventory; resolves #491
This commit is contained in:
parent
bc459caac1
commit
808f5a03aa
@ -337,6 +337,7 @@ public class DGlobalPlayer implements PlayerWrapper {
|
||||
private void reset(Location tpLoc, boolean keepInventory) {
|
||||
try {
|
||||
PlayerUtil.secureTeleport(player, tpLoc);
|
||||
player.setGameMode(data.getOldGameMode());
|
||||
if (!keepInventory) {
|
||||
while (data.getOldInventory().size() > 36) {
|
||||
data.getOldInventory().remove(36);
|
||||
@ -355,7 +356,6 @@ public class DGlobalPlayer implements PlayerWrapper {
|
||||
player.setHealth(player.getMaxHealth());
|
||||
}
|
||||
player.setFoodLevel(data.getOldFoodLevel());
|
||||
player.setGameMode(data.getOldGameMode());
|
||||
player.setFireTicks(data.getOldFireTicks());
|
||||
for (PotionEffect effect : player.getActivePotionEffects()) {
|
||||
player.removePotionEffect(effect.getType());
|
||||
|
Loading…
Reference in New Issue
Block a user