mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Better way to do locale strings there.
This commit is contained in:
		@@ -2,7 +2,9 @@ package com.gmail.nossr50.datatypes.party;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import org.bukkit.inventory.ItemStack;
 | 
					import org.bukkit.inventory.ItemStack;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.gmail.nossr50.locale.LocaleLoader;
 | 
				
			||||||
import com.gmail.nossr50.util.ItemUtils;
 | 
					import com.gmail.nossr50.util.ItemUtils;
 | 
				
			||||||
 | 
					import com.gmail.nossr50.util.StringUtils;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public enum ItemShareType {
 | 
					public enum ItemShareType {
 | 
				
			||||||
    LOOT,
 | 
					    LOOT,
 | 
				
			||||||
@@ -30,4 +32,8 @@ public enum ItemShareType {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return null;
 | 
					        return null;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public String getLocaleString() {
 | 
				
			||||||
 | 
					        return LocaleLoader.getString("Party.ItemShare.Category." + StringUtils.getCapitalized(this.toString()));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,6 @@ import java.util.List;
 | 
				
			|||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.gmail.nossr50.mcMMO;
 | 
					import com.gmail.nossr50.mcMMO;
 | 
				
			||||||
import com.gmail.nossr50.locale.LocaleLoader;
 | 
					 | 
				
			||||||
import com.gmail.nossr50.party.ShareHandler.ShareMode;
 | 
					import com.gmail.nossr50.party.ShareHandler.ShareMode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class Party {
 | 
					public class Party {
 | 
				
			||||||
@@ -88,24 +87,10 @@ public class Party {
 | 
				
			|||||||
    public List<String> getItemShareCategories() {
 | 
					    public List<String> getItemShareCategories() {
 | 
				
			||||||
        List<String> shareCategories = new ArrayList<String>();
 | 
					        List<String> shareCategories = new ArrayList<String>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (shareLootDrops) {
 | 
					        for (ItemShareType shareType : ItemShareType.values()) {
 | 
				
			||||||
            shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Loot"));
 | 
					            if (sharingDrops(shareType)) {
 | 
				
			||||||
 | 
					                shareCategories.add(shareType.getLocaleString());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (shareMiningDrops) {
 | 
					 | 
				
			||||||
            shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Mining"));
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (shareHerbalismDrops) {
 | 
					 | 
				
			||||||
            shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Herbalism"));
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (shareWoodcuttingDrops) {
 | 
					 | 
				
			||||||
            shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Woodcutting"));
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (shareMiscDrops) {
 | 
					 | 
				
			||||||
            shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Misc"));
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return shareCategories;
 | 
					        return shareCategories;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user