Fixing merge conflicts

This commit is contained in:
nossr50 2019-04-03 17:25:18 -07:00
commit 8991c2bf2c
15 changed files with 710 additions and 642 deletions

View File

@ -151,6 +151,11 @@ Version 2.2.0
Added API method to check if player parties are size capped Added API method to check if player parties are size capped
Added API method to grab the level cap of a skill by its PrimarySkillType ENUM definition Added API method to grab the level cap of a skill by its PrimarySkillType ENUM definition
Added API method to check if a skill was being level capped Added API method to check if a skill was being level capped
Version 2.1.33
Renamed "Skills.Acrobatics.Prevent_AFK_Leveling" to "ExploitFix.Acrobatics"
ExploitFix.Acrobatics when set to false allows gaining XP in Acrobatics freely with no anti-grind measures
NOTE: The anti-grinding/exploit stuff is fully configurable in update 2.2 coming soon, this hotfix is to hold you over until that update comes out.
Version 2.1.32 Version 2.1.32
Completely removed Fireworks from mcMMO because they lag Completely removed Fireworks from mcMMO because they lag
Added 'General.AprilFoolsEvent' setting to config.yml to turn off April Fools Added 'General.AprilFoolsEvent' setting to config.yml to turn off April Fools

View File

@ -424,7 +424,6 @@ public abstract class Config implements VersionedConfig, Unload {
{ {
return userRootNode.getNode(path).getInt(); return userRootNode.getNode(path).getInt();
} }
/** /**
* Grabs a double from the specified node * Grabs a double from the specified node
* @param path * @param path

View File

@ -226,6 +226,9 @@ public class ExperienceConfig extends ConfigValidated {
return getBooleanValue(EXPLOIT_FIX, ENDERMAN_ENDERMITE_FARMS); return getBooleanValue(EXPLOIT_FIX, ENDERMAN_ENDERMITE_FARMS);
} }
/* public boolean isFishingExploitingPrevented() { return config.getBoolean("ExploitFix.Fishing", true); }
public boolean isAcrobaticsExploitingPrevented() { return config.getBoolean("ExploitFix.Acrobatics", true); }*/
/* Curve settings */ /* Curve settings */
public FormulaType getFormulaType() { public FormulaType getFormulaType() {
return FormulaType.getFormulaType(getStringValue(EXPERIENCE_FORMULA, CURVE)); return FormulaType.getFormulaType(getStringValue(EXPERIENCE_FORMULA, CURVE));

View File

@ -276,6 +276,10 @@ public class Roll extends AcrobaticsSubSkill {
* @return true if exploits are detected, false otherwise * @return true if exploits are detected, false otherwise
*/ */
private boolean isExploiting(Player player) { private boolean isExploiting(Player player) {
if (!mcMMO.getConfigManager().getConfigExploitPrevention().getConfigSectionExploitAcrobatics().isPreventAcrobaticsAbuse()) {
return false;
}
if (player.getInventory().getItemInMainHand().getType() == Material.ENDER_PEARL || player.isInsideVehicle()) { if (player.getInventory().getItemInMainHand().getType() == Material.ENDER_PEARL || player.isInsideVehicle()) {
return true; return true;
} }

View File

@ -121,6 +121,44 @@ public class BlockListener implements Listener {
} }
} }
/*@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockDropItemEvent(BlockDropItemEvent event)
{
for(Item item : event.getItems())
{
ItemStack is = new ItemStack(item.getItemStack());
if(event.getBlock().getMetadata(mcMMO.doubleDrops).size() > 0)
{
List<MetadataValue> metadataValue = event.getBlock().getMetadata(mcMMO.doubleDrops);
BonusDrops bonusDrops = (BonusDrops) metadataValue.get(0);
Collection<ItemStack> potentialDrops = (Collection<ItemStack>) bonusDrops.value();
if(potentialDrops.contains(is))
{
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
}
event.getBlock().removeMetadata(mcMMO.doubleDrops, plugin);
} else {
if(event.getBlock().getMetadata(mcMMO.tripleDrops).size() > 0) {
List<MetadataValue> metadataValue = event.getBlock().getMetadata(mcMMO.tripleDrops);
BonusDrops bonusDrops = (BonusDrops) metadataValue.get(0);
Collection<ItemStack> potentialDrops = (Collection<ItemStack>) bonusDrops.value();
if (potentialDrops.contains(is)) {
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
}
event.getBlock().removeMetadata(mcMMO.tripleDrops, plugin);
}
}
}
}*/
/** /**
* Monitor BlockPistonExtend events. * Monitor BlockPistonExtend events.
* *

View File

@ -103,8 +103,6 @@ public class mcMMO extends JavaPlugin {
public final static String disarmedItemKey = "mcMMO: Disarmed Item"; public final static String disarmedItemKey = "mcMMO: Disarmed Item";
public final static String playerDataKey = "mcMMO: Player Data"; public final static String playerDataKey = "mcMMO: Player Data";
public final static String greenThumbDataKey = "mcMMO: Green Thumb"; public final static String greenThumbDataKey = "mcMMO: Green Thumb";
public final static String doubleDropKey = "mcMMO: Double Drop";
public final static String tripleDropKey = "mcMMO: Triple Drop";
public final static String databaseCommandKey = "mcMMO: Processing Database Command"; public final static String databaseCommandKey = "mcMMO: Processing Database Command";
public final static String bredMetadataKey = "mcMMO: Bred Animal"; public final static String bredMetadataKey = "mcMMO: Bred Animal";

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.skills.acrobatics; package com.gmail.nossr50.skills.acrobatics;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
@ -32,6 +33,9 @@ public class AcrobaticsManager extends SkillManager {
public boolean canGainRollXP() public boolean canGainRollXP()
{ {
if(!ExperienceConfig.getInstance().isAcrobaticsExploitingPrevented())
return true;
if(System.currentTimeMillis() >= rollXPCooldown) if(System.currentTimeMillis() >= rollXPCooldown)
{ {
rollXPCooldown = System.currentTimeMillis() + rollXPInterval; rollXPCooldown = System.currentTimeMillis() + rollXPInterval;

View File

@ -67,7 +67,7 @@ public class Herbalism {
dropAmount++; dropAmount++;
if(herbalismManager.checkDoubleDrop(target.getState())) if(herbalismManager.checkDoubleDrop(target.getState()))
BlockUtils.markBlocksForBonusDrops(target.getState(), triple); BlockUtils.markDropsAsBonus(target.getState(), triple);
} }
for (BlockFace blockFace : new BlockFace[] { BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST ,BlockFace.WEST}) for (BlockFace blockFace : new BlockFace[] { BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST ,BlockFace.WEST})
@ -110,7 +110,7 @@ public class Herbalism {
dropAmount++; dropAmount++;
if(herbalismManager.checkDoubleDrop(relativeBlock.getState())) if(herbalismManager.checkDoubleDrop(relativeBlock.getState()))
BlockUtils.markBlocksForBonusDrops(relativeBlock.getState(), triple); BlockUtils.markDropsAsBonus(relativeBlock.getState(), triple);
} }
} }
} }
@ -142,7 +142,7 @@ public class Herbalism {
amount += 1; amount += 1;
if(herbalismManager.checkDoubleDrop(relativeUpBlock.getState())) if(herbalismManager.checkDoubleDrop(relativeUpBlock.getState()))
BlockUtils.markBlocksForBonusDrops(relativeUpBlock.getState(), triple); BlockUtils.markDropsAsBonus(relativeUpBlock.getState(), triple);
} }

View File

@ -163,7 +163,7 @@ public class HerbalismManager extends SkillManager {
} else { } else {
/* MARK SINGLE BLOCK CROP FOR DOUBLE DROP */ /* MARK SINGLE BLOCK CROP FOR DOUBLE DROP */
if(checkDoubleDrop(blockState)) if(checkDoubleDrop(blockState))
BlockUtils.markBlocksForBonusDrops(blockState, greenTerra); BlockUtils.markDropsAsBonus(blockState, greenTerra);
} }
if (Permissions.greenThumbPlant(player, material)) { if (Permissions.greenThumbPlant(player, material)) {

View File

@ -92,7 +92,7 @@ public class MiningManager extends SkillManager {
//TODO: Make this readable //TODO: Make this readable
if (RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS, true)) { if (RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS, true)) {
BlockUtils.markBlocksForBonusDrops(blockState, mcMMOPlayer.getAbilityMode(skill.getAbility())); BlockUtils.markDropsAsBonus(blockState, mcMMOPlayer.getAbilityMode(skill.getAbility()));
} }
} }

View File

@ -23,12 +23,12 @@ public final class BlockUtils {
* @param blockState target blockstate * @param blockState target blockstate
* @param triple marks the block to give triple drops * @param triple marks the block to give triple drops
*/ */
public static void markBlocksForBonusDrops(BlockState blockState, boolean triple) public static void markDropsAsBonus(BlockState blockState, boolean triple)
{ {
if(triple) if(triple)
blockState.setMetadata(mcMMO.tripleDropKey, mcMMO.metadataValue); blockState.setMetadata(mcMMO.tripleDrops, mcMMO.metadataValue);
else else
blockState.setMetadata(mcMMO.doubleDropKey, mcMMO.metadataValue); blockState.setMetadata(mcMMO.doubleDrops, mcMMO.metadataValue);
} }
/** /**

View File

@ -380,4 +380,4 @@
// PluginCommand command = mcMMO.p.getCommand("mcfools"); // PluginCommand command = mcMMO.p.getCommand("mcfools");
// command.setExecutor(new AprilCommand()); // command.setExecutor(new AprilCommand());
// } // }
//} //}

View File

@ -311,8 +311,6 @@ Skills:
Acrobatics: Acrobatics:
Enabled_For_PVP: true Enabled_For_PVP: true
Enabled_For_PVE: true Enabled_For_PVE: true
Prevent_AFK_Leveling: true
Max_Tries_At_Same_Location: 3
Prevent_Dodge_Lightning: false Prevent_Dodge_Lightning: false
# Prevent earning Acrobatics XP a few seconds after teleporting # Prevent earning Acrobatics XP a few seconds after teleporting
XP_After_Teleport_Cooldown: 5 XP_After_Teleport_Cooldown: 5

View File

@ -25,6 +25,7 @@ ExploitFix:
# Prevent many exploits related to fishing # Prevent many exploits related to fishing
Fishing: true Fishing: true
EndermanEndermiteFarms: true EndermanEndermiteFarms: true
Acrobatics: true
Experience_Bars: Experience_Bars:
# Turn this to false if you wanna disable XP bars # Turn this to false if you wanna disable XP bars
Enable: true Enable: true

File diff suppressed because it is too large Load Diff