mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fixed bug with Ice Fishing which allowed players to break protected blocks
Fixes #2074
This commit is contained in:
parent
0f8312dd5e
commit
c19d3fd068
@ -53,6 +53,7 @@ Version 1.4.06-dev
|
||||
= Fixed bug where the chance of a successful Gracefull Roll was twice as high as displayed
|
||||
= Fixed bug where lucky perks where not working
|
||||
= Fixed bug with Ice Fishing on a single block of ice
|
||||
= Fixed bug with Ice Fishing which allowed players to break ice in protected areas
|
||||
= Fixed a small bug with mob healthbars and bosses, such as EnderDragons and Withers
|
||||
! Changed Spout notification tiers to be stored in SpoutConfig instead of AdvancedConfig
|
||||
! Changed Berserk to add items to inventory rather than denying pickup
|
||||
|
@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
@ -192,6 +193,13 @@ public class PlayerListener implements Listener {
|
||||
Block block = event.getPlayer().getTargetBlock(null, 100);
|
||||
|
||||
if (fishingManager.canIceFish(block)) {
|
||||
BlockBreakEvent blockBreakEvent = new BlockBreakEvent(block, player);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(blockBreakEvent);
|
||||
|
||||
if (blockBreakEvent.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
fishingManager.iceFishing(hook, block);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user