mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 13:14:44 +02:00
Refactoring the oopsies
This commit is contained in:
@ -25,7 +25,7 @@ public class AlchemyManager extends SkillManager {
|
||||
}
|
||||
|
||||
public List<ItemStack> getIngredients() {
|
||||
return PotionMainConfig.getInstance().getIngredients(getTier());
|
||||
return PotionConfig.getInstance().getIngredients(getTier());
|
||||
}
|
||||
|
||||
public String getIngredientList() {
|
||||
|
@ -34,7 +34,7 @@ public final class AlchemyPotionBrewer {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (getChildPotion(PotionMainConfig.getInstance().getPotion(contents[i]), contents[Alchemy.INGREDIENT_SLOT]) != null) {
|
||||
if (getChildPotion(PotionConfig.getInstance().getPotion(contents[i]), contents[Alchemy.INGREDIENT_SLOT]) != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -92,7 +92,7 @@ public final class AlchemyPotionBrewer {
|
||||
}
|
||||
|
||||
private static List<ItemStack> getValidIngredients(Player player) {
|
||||
return PotionMainConfig.getInstance().getIngredients((player == null || !Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CONCOCTIONS)) ? 1 : UserManager.getPlayer(player).getAlchemyManager().getTier());
|
||||
return PotionConfig.getInstance().getIngredients((player == null || !Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CONCOCTIONS)) ? 1 : UserManager.getPlayer(player).getAlchemyManager().getTier());
|
||||
}
|
||||
|
||||
public static void finishBrewing(BlockState brewingStand, Player player, boolean forced) {
|
||||
@ -112,11 +112,11 @@ public final class AlchemyPotionBrewer {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ItemStack item = inventory.getItem(i);
|
||||
|
||||
if (isEmpty(item) || item.getType() == Material.GLASS_BOTTLE || !PotionMainConfig.getInstance().isValidPotion(item)) {
|
||||
if (isEmpty(item) || item.getType() == Material.GLASS_BOTTLE || !PotionConfig.getInstance().isValidPotion(item)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
AlchemyPotion input = PotionMainConfig.getInstance().getPotion(item);
|
||||
AlchemyPotion input = PotionConfig.getInstance().getPotion(item);
|
||||
AlchemyPotion output = input.getChild(ingredient);
|
||||
|
||||
inputList.add(input);
|
||||
|
@ -18,8 +18,8 @@ public class Excavation {
|
||||
*/
|
||||
protected static List<ExcavationTreasure> getTreasures(BlockState blockState) {
|
||||
String friendly = StringUtils.getFriendlyConfigBlockDataString(blockState.getBlockData());
|
||||
if (TreasureMainConfig.getInstance().excavationMap.containsKey(friendly))
|
||||
return TreasureMainConfig.getInstance().excavationMap.get(friendly);
|
||||
if (TreasureConfig.getInstance().excavationMap.containsKey(friendly))
|
||||
return TreasureConfig.getInstance().excavationMap.get(friendly);
|
||||
return new ArrayList<ExcavationTreasure>();
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,8 @@ public final class Fishing {
|
||||
* @return possibleDrops List of ItemStack that can be dropped
|
||||
*/
|
||||
protected static List<ShakeTreasure> findPossibleDrops(LivingEntity target) {
|
||||
if (TreasureMainConfig.getInstance().shakeMap.containsKey(target.getType()))
|
||||
return TreasureMainConfig.getInstance().shakeMap.get(target.getType());
|
||||
if (TreasureConfig.getInstance().shakeMap.containsKey(target.getType()))
|
||||
return TreasureConfig.getInstance().shakeMap.get(target.getType());
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ public class FishingManager extends SkillManager {
|
||||
break;
|
||||
|
||||
case BEDROCK:
|
||||
if (TreasureMainConfig.getInstance().getInventoryStealEnabled()) {
|
||||
if (TreasureConfig.getInstance().getInventoryStealEnabled()) {
|
||||
PlayerInventory inventory = targetPlayer.getInventory();
|
||||
int length = inventory.getContents().length;
|
||||
int slot = Misc.getRandom().nextInt(length);
|
||||
@ -377,7 +377,7 @@ public class FishingManager extends SkillManager {
|
||||
break;
|
||||
}
|
||||
|
||||
if (TreasureMainConfig.getInstance().getInventoryStealStacks()) {
|
||||
if (TreasureConfig.getInstance().getInventoryStealStacks()) {
|
||||
inventory.setItem(slot, null);
|
||||
}
|
||||
else {
|
||||
@ -445,7 +445,7 @@ public class FishingManager extends SkillManager {
|
||||
FishingTreasure treasure = null;
|
||||
|
||||
for (Rarity rarity : Rarity.values()) {
|
||||
double dropRate = TreasureMainConfig.getInstance().getItemDropRate(getLootTier(), rarity);
|
||||
double dropRate = TreasureConfig.getInstance().getItemDropRate(getLootTier(), rarity);
|
||||
|
||||
if (diceRoll <= dropRate) {
|
||||
/*if (rarity == Rarity.TRAP) {
|
||||
@ -453,7 +453,7 @@ public class FishingManager extends SkillManager {
|
||||
break;
|
||||
}*/
|
||||
|
||||
List<FishingTreasure> fishingTreasures = TreasureMainConfig.getInstance().fishingRewards.get(rarity);
|
||||
List<FishingTreasure> fishingTreasures = TreasureConfig.getInstance().fishingRewards.get(rarity);
|
||||
|
||||
if (fishingTreasures.isEmpty()) {
|
||||
return null;
|
||||
@ -504,7 +504,7 @@ public class FishingManager extends SkillManager {
|
||||
continue;
|
||||
}
|
||||
|
||||
double dropRate = TreasureMainConfig.getInstance().getEnchantmentDropRate(getLootTier(), rarity);
|
||||
double dropRate = TreasureConfig.getInstance().getEnchantmentDropRate(getLootTier(), rarity);
|
||||
|
||||
if (diceRoll <= dropRate) {
|
||||
// Make sure enchanted books always get some kind of enchantment. --hoorigan
|
||||
@ -512,7 +512,7 @@ public class FishingManager extends SkillManager {
|
||||
diceRoll = dropRate + 1;
|
||||
continue;
|
||||
}
|
||||
fishingEnchantments = TreasureMainConfig.getInstance().fishingEnchantments.get(rarity);
|
||||
fishingEnchantments = TreasureConfig.getInstance().fishingEnchantments.get(rarity);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -212,9 +212,9 @@ public class HerbalismManager extends SkillManager {
|
||||
}
|
||||
|
||||
String friendly = StringUtils.getFriendlyConfigBlockDataString(blockState.getBlockData());
|
||||
if (!TreasureMainConfig.getInstance().hylianMap.containsKey(friendly))
|
||||
if (!TreasureConfig.getInstance().hylianMap.containsKey(friendly))
|
||||
return false;
|
||||
List<HylianTreasure> treasures = TreasureMainConfig.getInstance().hylianMap.get(friendly);
|
||||
List<HylianTreasure> treasures = TreasureConfig.getInstance().hylianMap.get(friendly);
|
||||
|
||||
Player player = getPlayer();
|
||||
|
||||
|
Reference in New Issue
Block a user