mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-30 21:07:48 +01:00
Fix fisherman getting paid for fish even if mcMMO fishing protection kicks in (#1081)
* Disable Fisherman pay if mcMMO fishing protections are enabled - replace mcMMO dependency with the latest one (contains necessary classes) - copy exploit protection check to fishing payment event
This commit is contained in:
parent
95169f00ab
commit
ff87470088
BIN
libs/mcMMO-2.1.175-SNAPSHOT.jar
Normal file
BIN
libs/mcMMO-2.1.175-SNAPSHOT.jar
Normal file
Binary file not shown.
Binary file not shown.
4
pom.xml
4
pom.xml
@ -25,9 +25,9 @@
|
||||
<dependency>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.1.2</version>
|
||||
<version>2.1.175-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/mcMMO2.1.2.jar</systemPath>
|
||||
<systemPath>${basedir}/libs/mcMMO-2.1.175-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
<!-- Vault -->
|
||||
<dependency>
|
||||
|
@ -28,6 +28,10 @@ import com.gamingmesh.jobs.container.blockOwnerShip.BlockOwnerShip;
|
||||
import com.gamingmesh.jobs.container.blockOwnerShip.BlockOwnerShip.ownershipFeedback;
|
||||
import com.gamingmesh.jobs.hooks.HookManager;
|
||||
import com.gamingmesh.jobs.hooks.JobsHook;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -490,6 +494,17 @@ public class JobsPaymentListener implements Listener {
|
||||
return;
|
||||
|
||||
if (event.getState() == PlayerFishEvent.State.CAUGHT_FISH && event.getCaught() instanceof Item) {
|
||||
// check is mcMMO enabled
|
||||
if (JobsHook.mcMMO.isEnabled()) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
// check is the fishing being exploited. If yes, prevent payment.
|
||||
if (mcMMOPlayer != null && ExperienceConfig.getInstance().isFishingExploitingPrevented()
|
||||
&& mcMMOPlayer.getFishingManager().isExploitingFishing(event.getHook().getLocation().toVector())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Jobs.action(Jobs.getPlayerManager().getJobsPlayer(player),
|
||||
new ItemActionInfo(((Item) event.getCaught()).getItemStack(), ActionType.FISH));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user