public void restorePlayerData() {
        p.getEquipment().clear();//clear equipment, without this it doesn't remove items
        p.getInventory().setContents(inventory);
        p.setExp(exp);
        p.getInventory().setBoots(boots);
        p.getInventory().setLeggings(leggins);
        p.getInventory().setChestplate(chestplate);
        p.getInventory().setHelmet(helmet);
        p.setExhaustion(exhausion);
        p.setFoodLevel(20);
        p.setHealth(p.getMaxHealth());
        p.removePotionEffect(PotionEffectType.INVISIBILITY);
        p.addPotionEffects(potions);
        p.setGameMode(gm);
        p.setAllowFlight(flyAllowed);
        p.setFlying(fly);
        if(m.getSpawn() != null) {
            p.teleport(m.getSpawn().add(0, 1, 0));//Teleport player to dodgeball spawn
        } else if(m.mm.getGlobalSpawn() != null && m.mm.getGlobalSpawn().getWorldObj() != null) {
            p.teleport(m.mm.getGlobalSpawn().getLocation().add(0, 1, 0));//teleport player to dodgeball global spawn if exists
        } else {
            p.teleport(loc);//teleport player to saved location
        }
    }