mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-10-31 01:03:44 +01:00 
			
		
		
		
	Fixed bug with Ice Fishing which allowed players to break protected blocks
Fixes #2074
This commit is contained in:
		| @@ -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); | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 TfT_02
					TfT_02