mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 21:56:47 +01:00
add McMMOPlayerMasterAnglerEvent and ability to cancel it if desired
This commit is contained in:
parent
4cb3d3181b
commit
86d7e8c1c1
@ -0,0 +1,14 @@
|
|||||||
|
package com.gmail.nossr50.events.skills.fishing;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
public class McMMOPlayerMasterAnglerEvent extends McMMOPlayerFishingEvent {
|
||||||
|
|
||||||
|
public McMMOPlayerMasterAnglerEvent(@NotNull McMMOPlayer mcMMOPlayer) {
|
||||||
|
super(mcMMOPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -10,6 +10,7 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
|||||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||||
import com.gmail.nossr50.datatypes.treasure.*;
|
import com.gmail.nossr50.datatypes.treasure.*;
|
||||||
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent;
|
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent;
|
||||||
|
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerMasterAnglerEvent;
|
||||||
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent;
|
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
@ -253,6 +254,13 @@ public class FishingManager extends SkillManager {
|
|||||||
* @param fishHook target fish hook
|
* @param fishHook target fish hook
|
||||||
*/
|
*/
|
||||||
public void processMasterAngler(@NotNull FishHook fishHook, int lureLevel) {
|
public void processMasterAngler(@NotNull FishHook fishHook, int lureLevel) {
|
||||||
|
McMMOPlayerMasterAnglerEvent event = new McMMOPlayerMasterAnglerEvent(mmoPlayer);
|
||||||
|
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MasterAnglerCompatibilityLayer masterAnglerCompatibilityLayer = (MasterAnglerCompatibilityLayer) mcMMO.getCompatibilityManager().getMasterAnglerCompatibilityLayer();
|
MasterAnglerCompatibilityLayer masterAnglerCompatibilityLayer = (MasterAnglerCompatibilityLayer) mcMMO.getCompatibilityManager().getMasterAnglerCompatibilityLayer();
|
||||||
|
|
||||||
if (masterAnglerCompatibilityLayer != null) {
|
if (masterAnglerCompatibilityLayer != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user