-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely untested!
- Loading branch information
Showing
5 changed files
with
67 additions
and
7 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
27 changes: 27 additions & 0 deletions
27
src/main/java/xyz/srnyx/limitedlives/WorldGuardObjects.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,27 @@ | ||
package xyz.srnyx.limitedlives; | ||
|
||
import com.sk89q.worldedit.bukkit.BukkitAdapter; | ||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin; | ||
import com.sk89q.worldguard.protection.flags.StateFlag; | ||
import com.sk89q.worldguard.protection.regions.RegionContainer; | ||
|
||
import org.bukkit.entity.Player; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
|
||
public class WorldGuardObjects { | ||
@NotNull private final Object instance; | ||
@NotNull private final Object regionContainer; | ||
@NotNull private final Object flag; | ||
|
||
public WorldGuardObjects(@NotNull Object instance, @NotNull Object regionContainer, @NotNull Object flag) { | ||
this.instance = instance; | ||
this.regionContainer = regionContainer; | ||
this.flag = flag; | ||
} | ||
|
||
public boolean test(@NotNull Player player) { | ||
return ((RegionContainer) regionContainer).createQuery().testState(BukkitAdapter.adapt(player.getLocation()), ((WorldGuardPlugin) instance).wrapPlayer(player), (StateFlag) flag); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ api-version: 1.13 | |
|
||
softdepend: | ||
- PlaceholderAPI | ||
- WorldGuard | ||
|
||
commands: | ||
lives: | ||
|