Skip to content

Commit

Permalink
Simplify hook
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Dec 24, 2023
1 parent f4868f7 commit 9f116e7
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/main/java/world/bentobox/bentobox/hooks/SlimefunHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;

import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import world.bentobox.bentobox.api.hooks.Hook;

Expand All @@ -15,35 +12,21 @@
*/
public class SlimefunHook extends Hook {

private Slimefun sfPlugin;

public SlimefunHook() {
super("Slimefun", Material.SLIME_BLOCK);
}

@Override
public boolean hook() {
// See if Slimefun is around
sfPlugin = (Slimefun) Bukkit.getPluginManager().getPlugin("SlimeFun");
return sfPlugin != null;
return Bukkit.getPluginManager().getPlugin("SlimeFun") != null;
}

@Override
public String getFailureCause() {
return ""; // No errors
}

public void clearAllBlockInfoAtChunk(World world, int x, int z, boolean destroy) {
if (!BlockStorage.isWorldLoaded(world)) {
return; // Not sure if this is needed.
}
BlockStorage.clearAllBlockInfoAtChunk(world, x, z, destroy);
}

public void clearBlockInfo(Block b, boolean destroy) {
BlockStorage.clearBlockInfo(b, destroy);
}

public void clearBlockInfo(Location location, boolean destroy) {
BlockStorage.clearBlockInfo(location, destroy);
}
Expand Down

0 comments on commit 9f116e7

Please sign in to comment.