Fixing merge conflicts

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

View File

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

View File

@ -226,6 +226,9 @@ public class ExperienceConfig extends ConfigValidated {
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 */
public FormulaType getFormulaType() {
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
*/
private boolean isExploiting(Player player) {
if (!mcMMO.getConfigManager().getConfigExploitPrevention().getConfigSectionExploitAcrobatics().isPreventAcrobaticsAbuse()) {
return false;
}
if (player.getInventory().getItemInMainHand().getType() == Material.ENDER_PEARL || player.isInsideVehicle()) {
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.
*

View File

@ -103,8 +103,6 @@ public class mcMMO extends JavaPlugin {
public final static String disarmedItemKey = "mcMMO: Disarmed Item";
public final static String playerDataKey = "mcMMO: Player Data";
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 bredMetadataKey = "mcMMO: Bred Animal";

View File

@ -1,5 +1,6 @@
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.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
@ -32,6 +33,9 @@ public class AcrobaticsManager extends SkillManager {
public boolean canGainRollXP()
{
if(!ExperienceConfig.getInstance().isAcrobaticsExploitingPrevented())
return true;
if(System.currentTimeMillis() >= rollXPCooldown)
{
rollXPCooldown = System.currentTimeMillis() + rollXPInterval;

View File

@ -67,7 +67,7 @@ public class Herbalism {
dropAmount++;
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})
@ -110,7 +110,7 @@ public class Herbalism {
dropAmount++;
if(herbalismManager.checkDoubleDrop(relativeBlock.getState()))
BlockUtils.markBlocksForBonusDrops(relativeBlock.getState(), triple);
BlockUtils.markDropsAsBonus(relativeBlock.getState(), triple);
}
}
}
@ -142,7 +142,7 @@ public class Herbalism {
amount += 1;
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 {
/* MARK SINGLE BLOCK CROP FOR DOUBLE DROP */
if(checkDoubleDrop(blockState))
BlockUtils.markBlocksForBonusDrops(blockState, greenTerra);
BlockUtils.markDropsAsBonus(blockState, greenTerra);
}
if (Permissions.greenThumbPlant(player, material)) {

View File

@ -92,7 +92,7 @@ public class MiningManager extends SkillManager {
//TODO: Make this readable
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 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)
blockState.setMetadata(mcMMO.tripleDropKey, mcMMO.metadataValue);
blockState.setMetadata(mcMMO.tripleDrops, mcMMO.metadataValue);
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");
// command.setExecutor(new AprilCommand());
// }
//}
//}

View File

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

View File

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

File diff suppressed because it is too large Load Diff