Fixed WorldGuard antigrief integration
This commit is contained in:
@@ -24,7 +24,7 @@ class AntigriefWorldGuard : AntigriefWrapper {
|
|||||||
val localPlayer: LocalPlayer = WorldGuardPlugin.inst().wrapPlayer(player)
|
val localPlayer: LocalPlayer = WorldGuardPlugin.inst().wrapPlayer(player)
|
||||||
val container: RegionContainer = WorldGuard.getInstance().platform.regionContainer
|
val container: RegionContainer = WorldGuard.getInstance().platform.regionContainer
|
||||||
val query: RegionQuery = container.createQuery()
|
val query: RegionQuery = container.createQuery()
|
||||||
return if (!query.testBuild(
|
return if (!query.testState(
|
||||||
BukkitAdapter.adapt(block.location),
|
BukkitAdapter.adapt(block.location),
|
||||||
localPlayer,
|
localPlayer,
|
||||||
Flags.BLOCK_BREAK
|
Flags.BLOCK_BREAK
|
||||||
@@ -46,7 +46,7 @@ class AntigriefWorldGuard : AntigriefWrapper {
|
|||||||
val query: RegionQuery = container.createQuery()
|
val query: RegionQuery = container.createQuery()
|
||||||
val world = location.world
|
val world = location.world
|
||||||
Validate.notNull(world, "World cannot be null!")
|
Validate.notNull(world, "World cannot be null!")
|
||||||
return if (!query.testBuild(BukkitAdapter.adapt(location), localPlayer, Flags.TNT)) {
|
return if (!query.testState(BukkitAdapter.adapt(location), localPlayer, Flags.TNT)) {
|
||||||
WorldGuard.getInstance().platform.sessionManager.hasBypass(
|
WorldGuard.getInstance().platform.sessionManager.hasBypass(
|
||||||
localPlayer,
|
localPlayer,
|
||||||
BukkitAdapter.adapt(world)
|
BukkitAdapter.adapt(world)
|
||||||
@@ -61,7 +61,7 @@ class AntigriefWorldGuard : AntigriefWrapper {
|
|||||||
val localPlayer: LocalPlayer = WorldGuardPlugin.inst().wrapPlayer(player)
|
val localPlayer: LocalPlayer = WorldGuardPlugin.inst().wrapPlayer(player)
|
||||||
val container: RegionContainer = WorldGuard.getInstance().platform.regionContainer
|
val container: RegionContainer = WorldGuard.getInstance().platform.regionContainer
|
||||||
val query: RegionQuery = container.createQuery()
|
val query: RegionQuery = container.createQuery()
|
||||||
return if (!query.testBuild(
|
return if (!query.testState(
|
||||||
BukkitAdapter.adapt(block.location),
|
BukkitAdapter.adapt(block.location),
|
||||||
localPlayer,
|
localPlayer,
|
||||||
Flags.BLOCK_PLACE
|
Flags.BLOCK_PLACE
|
||||||
@@ -88,7 +88,7 @@ class AntigriefWorldGuard : AntigriefWrapper {
|
|||||||
else -> return true
|
else -> return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return if (!query.testBuild(BukkitAdapter.adapt(victim.location), localPlayer, flag)) {
|
return if (!query.testState(BukkitAdapter.adapt(victim.location), localPlayer, flag)) {
|
||||||
WorldGuard.getInstance().platform.sessionManager.hasBypass(
|
WorldGuard.getInstance().platform.sessionManager.hasBypass(
|
||||||
localPlayer,
|
localPlayer,
|
||||||
BukkitAdapter.adapt(player.world)
|
BukkitAdapter.adapt(player.world)
|
||||||
@@ -104,7 +104,7 @@ class AntigriefWorldGuard : AntigriefWrapper {
|
|||||||
val query: RegionQuery = container.createQuery()
|
val query: RegionQuery = container.createQuery()
|
||||||
val world = location.world
|
val world = location.world
|
||||||
Validate.notNull(world, "World cannot be null!")
|
Validate.notNull(world, "World cannot be null!")
|
||||||
return if (!query.testBuild(BukkitAdapter.adapt(location), localPlayer, Flags.ITEM_PICKUP)) {
|
return if (!query.testState(BukkitAdapter.adapt(location), localPlayer, Flags.ITEM_PICKUP)) {
|
||||||
WorldGuard.getInstance().platform.sessionManager.hasBypass(
|
WorldGuard.getInstance().platform.sessionManager.hasBypass(
|
||||||
localPlayer,
|
localPlayer,
|
||||||
BukkitAdapter.adapt(world)
|
BukkitAdapter.adapt(world)
|
||||||
|
|||||||
Reference in New Issue
Block a user