Temporary Spigot bug fix

This commit is contained in:
nossr50 2020-07-03 13:14:33 -07:00
parent 2fc1ba44d8
commit f05c4121d2
3 changed files with 19 additions and 5 deletions

View File

@ -1,6 +1,10 @@
Version 2.1.132
A fix is in place to prevent an exploit from working that is due to a yet to be patched Spigot server software bug
Fixed a NPE that could happen when players swapped items from their hotbar
NOTE: The exploit was not described on purpose, please update.
I reported the bug to Spigot, so hopefully it will be patched in the near future.
Version 2.1.131
New permission node 'mcmmo.ability.repair.netheriterepair' which is included in the mcmmo.defaults permission package

View File

@ -462,7 +462,13 @@ public class Config extends AutoUpdateConfigLoader {
/*
* SKILL SETTINGS
*/
public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { return config.getBoolean("Bonus_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) {
//TODO: Temporary measure to fix an exploit caused by a yet to be fixed Spigot bug (as of 7/3/2020)
if(material.toString().contains("LILY_PAD"))
return false;
return config.getBoolean("Bonus_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_"));
}
public boolean getDoubleDropsDisabled(PrimarySkillType skill) {
String skillName = StringUtils.getCapitalized(skill.toString());

View File

@ -206,16 +206,20 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
public boolean hasCombatXP(EntityType entity) {return config.contains("Experience_Values.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); }
/* Materials */
public int getXp(PrimarySkillType skill, Material data)
public int getXp(PrimarySkillType skill, Material material)
{
//TODO: Temporary measure to fix an exploit caused by a yet to be fixed Spigot bug (as of 7/3/2020)
if(material.toString().contains("LILY_PAD"))
return 0;
String baseString = "Experience_Values." + StringUtils.getCapitalized(skill.toString()) + ".";
String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data);
String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(material);
if (config.contains(explicitString))
return config.getInt(explicitString);
String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(data);
String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(material);
if (config.contains(friendlyString))
return config.getInt(friendlyString);
String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(data);
String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(material);
if (config.contains(wildcardString))
return config.getInt(wildcardString);
return 0;