-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete slimefun chunks/blocks when island is deleted. (#2247)
- Loading branch information
1 parent
96499f3
commit 86d8d14
Showing
5 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/world/bentobox/bentobox/hooks/SlimefunHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package world.bentobox.bentobox.hooks; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.Location; | ||
import org.bukkit.Material; | ||
|
||
import me.mrCookieSlime.Slimefun.api.BlockStorage; | ||
import world.bentobox.bentobox.api.hooks.Hook; | ||
|
||
/** | ||
* Hook to enable slimefun blocks to be deleted when islands are deleted. | ||
*/ | ||
public class SlimefunHook extends Hook { | ||
|
||
public SlimefunHook() { | ||
super("Slimefun", Material.SLIME_BLOCK); | ||
} | ||
|
||
@Override | ||
public boolean hook() { | ||
// See if Slimefun is around | ||
return Bukkit.getPluginManager().getPlugin("SlimeFun") != null; | ||
} | ||
|
||
@Override | ||
public String getFailureCause() { | ||
return ""; // No errors | ||
} | ||
|
||
public void clearBlockInfo(Location location, boolean destroy) { | ||
BlockStorage.clearBlockInfo(location, destroy); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters