1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2021-05-03 15:22:13 +02:00
parent 399359ae25
commit 7b615a66f2
2 changed files with 11 additions and 0 deletions

View File

@ -53,6 +53,7 @@
* Fixed #2937
* Fixed #3007
* Fixed #3012
* Fixed #3013
## Release Candidate 22 (18 Apr 2021)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#22

View File

@ -2,12 +2,14 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners;
import javax.annotation.Nonnull;
import org.bukkit.block.Block;
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.block.BlockPlaceEvent;
import io.github.thebusybiscuit.slimefun4.api.events.ExplosiveToolBreakBlocksEvent;
import io.github.thebusybiscuit.slimefun4.api.network.Network;
import io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
@ -39,4 +41,12 @@ public class NetworkListener implements Listener {
public void onBlockPlace(BlockPlaceEvent e) {
manager.updateAllNetworks(e.getBlock().getLocation());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onExplosiveToolUse(ExplosiveToolBreakBlocksEvent e) {
// Fixes #3013 - Also update networks when using an explosive tool
for (Block b : e.getAdditionalBlocks()) {
manager.updateAllNetworks(b.getLocation());
}
}
}