mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-31 19:45:26 +02:00
Wire up party config pt 5 - Actually need to redo how I'm deserializing maps, gonna do that tomorrow
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.gmail.nossr50.party;
|
||||
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.config.hocon.HOCONUtil;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatMode;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.party.*;
|
||||
@@ -28,18 +29,9 @@ public final class PartyManager {
|
||||
private static String partiesFilePath = mcMMO.getFlatFileDirectory() + "parties.yml";
|
||||
private static List<Party> parties = new ArrayList<Party>();
|
||||
private static File partyFile = new File(partiesFilePath);
|
||||
private static HashMap<PartyFeature, Integer> partyFeatureUnlockMap;
|
||||
|
||||
private PartyManager() {}
|
||||
|
||||
/**
|
||||
* Sets the unlock feature map for parties to the currently loaded hash map representation from the User's Config File
|
||||
*/
|
||||
public static void reloadPartyFeatureHashMap()
|
||||
{
|
||||
partyFeatureUnlockMap = mcMMO.getPartyLevelSettings().getPartyFeatureUnlockMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the appropriate unlock level for a party feature
|
||||
* @param partyFeature target party feature
|
||||
@@ -47,7 +39,10 @@ public final class PartyManager {
|
||||
*/
|
||||
public static int getPartyFeatureUnlockLevel(PartyFeature partyFeature)
|
||||
{
|
||||
return partyFeatureUnlockMap.get(partyFeature);
|
||||
if(mcMMO.getConfigManager().getPartyFeatureUnlocks().get(HOCONUtil.serializeENUMName(partyFeature.toString())) == null)
|
||||
return 0;
|
||||
else
|
||||
return mcMMO.getConfigManager().getPartyFeatureUnlocks().get(HOCONUtil.serializeENUMName(partyFeature.toString()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.gmail.nossr50.party;
|
||||
|
||||
import com.gmail.nossr50.config.hocon.HOCONUtil;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainSource;
|
||||
import com.gmail.nossr50.datatypes.party.ItemShareType;
|
||||
@@ -146,10 +147,10 @@ public final class ShareHandler {
|
||||
}
|
||||
|
||||
public static int getItemWeight(Material material) {
|
||||
if(mcMMO.getConfigManager().getConfigParty().getPartyItemShare().getItemShareMap().get(material) == null)
|
||||
if(mcMMO.getConfigManager().getConfigParty().getPartyItemShare().getItemShareMap().get(HOCONUtil.serializeENUMName(material.toString())) == null)
|
||||
return 5;
|
||||
else
|
||||
return mcMMO.getConfigManager().getConfigParty().getPartyItemShare().getItemShareMap().get(material);
|
||||
return mcMMO.getConfigManager().getConfigParty().getPartyItemShare().getItemShareMap().get(HOCONUtil.serializeENUMName(material.toString()));
|
||||
}
|
||||
|
||||
public static XPGainReason getSharedXpGainReason(XPGainReason xpGainReason) {
|
||||
|
Reference in New Issue
Block a user