-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- You can have any positive odd radius of chunkbuster now
- Water doesn't flow into cleared chunks (for real now) - Added worldguard hook if you're not using factions - New config entry for the worldguard hook - Fixed console nullpointer error with inventories - Version values updated to 1.0.2
- Loading branch information
Showing
10 changed files
with
213 additions
and
86 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
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
24 changes: 24 additions & 0 deletions
24
src/main/java/xyz/biscut/chunkbuster/hooks/WorldGuardHook.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,24 @@ | ||
package xyz.biscut.chunkbuster.hooks; | ||
|
||
import com.sk89q.worldguard.LocalPlayer; | ||
import com.sk89q.worldguard.bukkit.RegionContainer; | ||
import com.sk89q.worldguard.bukkit.RegionQuery; | ||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin; | ||
import com.sk89q.worldguard.protection.ApplicableRegionSet; | ||
import com.sk89q.worldguard.protection.flags.DefaultFlag; | ||
import com.sk89q.worldguard.protection.flags.StateFlag; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.Location; | ||
import org.bukkit.entity.Player; | ||
|
||
public class WorldGuardHook { | ||
|
||
public boolean checkLocationBreakFlag(Location loc, Player p) { | ||
WorldGuardPlugin worldGuardPlugin = (WorldGuardPlugin)Bukkit.getServer().getPluginManager().getPlugin("WorldGuard"); | ||
RegionContainer container = worldGuardPlugin.getRegionContainer(); | ||
RegionQuery query = container.createQuery(); | ||
ApplicableRegionSet set = query.getApplicableRegions(loc); | ||
LocalPlayer localPlayer = worldGuardPlugin.wrapPlayer(p); | ||
return set.queryState(localPlayer, DefaultFlag.BLOCK_BREAK) == StateFlag.State.ALLOW; | ||
} | ||
} |
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
Oops, something went wrong.