Skip to content

Commit

Permalink
fix: check version when handle wind charge
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Jan 7, 2025
1 parent 5d6f623 commit f7ab813
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.ParametersAreNullableByDefault;
import lombok.ToString;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import org.bukkit.Location;
import org.bukkit.inventory.ItemStack;

@ToString
public class SlimefunBlockData extends ASlimefunDataContainer {
private final Location location;
private volatile BlockMenu menu;
Expand Down Expand Up @@ -75,15 +77,4 @@ void setBlockMenu(BlockMenu blockMenu) {

return re;
}

@Override
public String toString() {
return "SlimefunBlockData [sfId="
+ getSfId()
+ ", location="
+ location
+ ", isPendingRemove="
+ isPendingRemove()
+ "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.xzavier0722.mc.plugin.slimefun4.storage.callback.IAsyncReadCallback;
import com.xzavier0722.mc.plugin.slimefun4.storage.controller.SlimefunBlockData;
import com.xzavier0722.mc.plugin.slimefun4.storage.util.StorageCacheUtils;
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.core.attributes.WitherProof;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
Expand Down Expand Up @@ -45,7 +46,8 @@ 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) {
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)
&& e.getEntityType() == EntityType.WIND_CHARGE) {
return;
}

Expand Down

0 comments on commit f7ab813

Please sign in to comment.