Fixed an almost 6 year old bug involving salvage materials smh

Updated the new ExperienceAPI methods to check for level ups
This commit is contained in:
nossr50 2019-02-02 07:15:12 -08:00
parent 14e5998aa0
commit 84b3cfc309
5 changed files with 47 additions and 6 deletions

View File

@ -7,6 +7,7 @@ Key:
! Change
- Removal
Version 2.1.7
Fixed an almost 6 year old bug where Salvage materials did not have a defined material count so they defaulted to 2 (which could lead to shovels giving back more diamonds than normal)
(API) Added addXpFromBlocks to ExperienceAPI to help make adding XP for a player easier
(API) Added addXpFromBlocksBySkill to ExperienceAPI to help make adding XP for a player easier
(API) Added addXpFromBlock to ExperienceAPI to help make adding XP for a player easier

View File

@ -1026,7 +1026,7 @@ public final class ExperienceAPI {
{
if(ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0)
{
mcMMOPlayer.addXp(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()));
mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF);
}
}
}
@ -1044,7 +1044,7 @@ public final class ExperienceAPI {
{
if(ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0)
{
mcMMOPlayer.addXp(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()));
mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF);
}
}
}
@ -1060,7 +1060,7 @@ public final class ExperienceAPI {
{
if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0)
{
mcMMOPlayer.addXp(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()));
mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF);
}
}
}
@ -1075,7 +1075,7 @@ public final class ExperienceAPI {
{
if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0)
{
mcMMOPlayer.addXp(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()));
mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF);
}
}

View File

@ -125,7 +125,7 @@ public class SalvageConfig extends ConfigLoader {
int maximumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), salvageMaterial, salvageMetadata) : config.getInt("Salvageables." + key + ".MaximumQuantity", 2));
if (maximumQuantity <= 0 && itemMaterial != null) {
maximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", 2);
maximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", 1);
}
int configMaximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", -1);

View File

@ -455,7 +455,6 @@ Skills:
# MaxBonusLevel: On this level, the chance to cause Gore will be <ChanceMax>
ChanceMax: 100.0
MaxBonusLevel: 100
# BleedTicks: Determines the length of the bleeding effect
# Modifier: Damage will get multiplied by this modifier
Modifier: 2.0
FastFoodService:

View File

@ -49,18 +49,23 @@ Salvageables:
WOODEN_SWORD:
MinimumLevel: 0
XpMultiplier: .25
MaximumQuantity: 2
WOODEN_SHOVEL:
MinimumLevel: 0
XpMultiplier: .16
MaximumQuantity: 1
WOODEN_PICKAXE:
MinimumLevel: 0
XpMultiplier: .5
MaximumQuantity: 3
WOODEN_AXE:
MinimumLevel: 0
XpMultiplier: .5
MaximumQuantity: 2
WOODEN_HOE:
MinimumLevel: 0
XpMultiplier: .25
MaximumQuantity: 2
#
# Stone salvageables
###
@ -68,18 +73,23 @@ Salvageables:
STONE_SWORD:
MinimumLevel: 0
XpMultiplier: .25
MaximumQuantity: 2
STONE_SHOVEL:
MinimumLevel: 0
XpMultiplier: .16
MaximumQuantity: 1
STONE_PICKAXE:
MinimumLevel: 0
XpMultiplier: .5
MaximumQuantity: 3
STONE_AXE:
MinimumLevel: 0
XpMultiplier: .5
MaximumQuantity: 2
STONE_HOE:
MinimumLevel: 0
XpMultiplier: .25
MaximumQuantity: 2
#
# Iron salvageables
###
@ -87,18 +97,23 @@ Salvageables:
IRON_SWORD:
MinimumLevel: 0
XpMultiplier: .5
MaximumQuantity: 2
IRON_SHOVEL:
MinimumLevel: 0
XpMultiplier: .3
MaximumQuantity: 1
IRON_PICKAXE:
MinimumLevel: 0
XpMultiplier: 1
MaximumQuantity: 3
IRON_AXE:
MinimumLevel: 0
XpMultiplier: 1
MaximumQuantity: 2
IRON_HOE:
MinimumLevel: 0
XpMultiplier: .5
MaximumQuantity: 2
SHEARS:
MinimumLevel: 0
XpMultiplier: .5
@ -109,15 +124,19 @@ Salvageables:
IRON_HELMET:
MinimumLevel: 0
XpMultiplier: 2
MaximumQuantity: 5
IRON_CHESTPLATE:
MinimumLevel: 0
XpMultiplier: 2
MaximumQuantity: 8
IRON_LEGGINGS:
MinimumLevel: 0
XpMultiplier: 2
MaximumQuantity: 7
IRON_BOOTS:
MinimumLevel: 0
XpMultiplier: 2
MaximumQuantity: 4
#
# Gold salvageables
###
@ -125,31 +144,40 @@ Salvageables:
GOLDEN_SWORD:
MinimumLevel: 0
XpMultiplier: 4
MaximumQuantity: 2
GOLDEN_SHOVEL:
MinimumLevel: 0
XpMultiplier: 2.6
MaximumQuantity: 1
GOLDEN_PICKAXE:
MinimumLevel: 0
XpMultiplier: 8
MaximumQuantity: 3
GOLDEN_AXE:
MinimumLevel: 0
XpMultiplier: 8
MaximumQuantity: 2
GOLDEN_HOE:
MinimumLevel: 0
XpMultiplier: 4
MaximumQuantity: 2
# Armor
GOLDEN_HELMET:
MinimumLevel: 0
XpMultiplier: 4
MaximumQuantity: 5
GOLDEN_CHESTPLATE:
MinimumLevel: 0
XpMultiplier: 4
MaximumQuantity: 8
GOLDEN_LEGGINGS:
MinimumLevel: 0
XpMultiplier: 4
MaximumQuantity: 7
GOLDEN_BOOTS:
MinimumLevel: 0
XpMultiplier: 4
MaximumQuantity: 4
#
# Diamond salvageables
###
@ -157,31 +185,40 @@ Salvageables:
DIAMOND_SWORD:
MinimumLevel: 50
XpMultiplier: .5
MaximumQuantity: 2
DIAMOND_SHOVEL:
MinimumLevel: 50
XpMultiplier: .3
MaximumQuantity: 1
DIAMOND_PICKAXE:
MinimumLevel: 50
XpMultiplier: 1
MaximumQuantity: 3
DIAMOND_AXE:
MinimumLevel: 50
XpMultiplier: 1
MaximumQuantity: 2
DIAMOND_HOE:
MinimumLevel: 50
XpMultiplier: .5
MaximumQuantity: 2
# Armor
DIAMOND_HELMET:
MinimumLevel: 50
XpMultiplier: 6
MaximumQuantity: 5
DIAMOND_CHESTPLATE:
MinimumLevel: 50
XpMultiplier: 6
MaximumQuantity: 8
DIAMOND_LEGGINGS:
MinimumLevel: 50
XpMultiplier: 6
MaximumQuantity: 7
DIAMOND_BOOTS:
MinimumLevel: 50
XpMultiplier: 6
MaximumQuantity: 4
#
# Leather salvageables
###
@ -189,15 +226,19 @@ Salvageables:
LEATHER_HELMET:
MinimumLevel: 0
XpMultiplier: 1
MaximumQuantity: 5
LEATHER_CHESTPLATE:
MinimumLevel: 0
XpMultiplier: 1
MaximumQuantity: 8
LEATHER_LEGGINGS:
MinimumLevel: 0
XpMultiplier: 1
MaximumQuantity: 7
LEATHER_BOOTS:
MinimumLevel: 0
XpMultiplier: 1
MaximumQuantity: 4
#
# String salvageables
###