Save / load party itemshare category states.

Closes #1336
This commit is contained in:
TfT_02 2013-08-07 00:38:17 +02:00
parent d8bbe459b9
commit 9fb4e0988b
2 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,7 @@ Version 1.4.07-dev
= Fixed a bug where teleport location was never reset if warmup was set to 0 for Chimera Wing.
! Improved profile saving
! Updated localization files
! Party item share category states are now saved when the server shuts down.
Version 1.4.06
+ Added "Ice Fishing" ability to Fishing

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import com.gmail.nossr50.datatypes.party.ItemShareType;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
@ -415,6 +416,10 @@ public final class PartyManager {
party.setXpShareMode(ShareMode.getShareMode(partiesFile.getString(partyName + ".ExpShareMode", "NONE")));
party.setItemShareMode(ShareMode.getShareMode(partiesFile.getString(partyName + ".ItemShareMode", "NONE")));
for (ItemShareType itemShareType : ItemShareType.values()) {
party.setSharingDrops(itemShareType, partiesFile.getBoolean(partyName + ".ItemShareType." + itemShareType.toString(), true));
}
List<String> memberNames = partiesFile.getStringList(partyName + ".Members");
LinkedHashSet<String> members = party.getMembers();
@ -445,6 +450,10 @@ public final class PartyManager {
partiesFile.set(partyName + ".ExpShareMode", party.getXpShareMode().toString());
partiesFile.set(partyName + ".ItemShareMode", party.getItemShareMode().toString());
for (ItemShareType itemShareType : ItemShareType.values()) {
partiesFile.set(partyName + ".ItemShareType." + itemShareType.toString(), party.sharingDrops(itemShareType));
}
List<String> memberNames = new ArrayList<String>();
for (String member : party.getMembers()) {