Skip to content

Commit

Permalink
fix: closes #950
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Oct 19, 2024
1 parent ee1ebf0 commit 2233a35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.xzavier0722.mc.plugin.slimefun4.storage.controller;

import city.norain.slimefun4.utils.InventoryUtil;
import com.xzavier0722.mc.plugin.slimefun4.storage.adapter.IDataSourceAdapter;
import com.xzavier0722.mc.plugin.slimefun4.storage.callback.IAsyncReadCallback;
import com.xzavier0722.mc.plugin.slimefun4.storage.common.DataScope;
Expand Down Expand Up @@ -189,7 +188,7 @@ public void removeBlock(Location l) {

var menu = removed.getBlockMenu();
if (menu != null) {
InventoryUtil.closeInventory(menu.toInventory());
menu.lock();
}

if (Slimefun.getRegistry().getTickerBlocks().contains(removed.getSfId())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import javax.annotation.ParametersAreNonnullByDefault;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand All @@ -40,6 +41,14 @@ public ExplosionsListener(@Nonnull Slimefun plugin) {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityExplode(EntityExplodeEvent e) {
/**
* Wind charge **doesn't** break block but spigot still give us break list,
* so we just ignore it.
*/
if (e.getEntityType() == EntityType.WIND_CHARGE) {
return;
}

removeResistantBlocks(e.blockList().iterator());
}

Expand Down

0 comments on commit 2233a35

Please sign in to comment.