Skip to content

Commit

Permalink
fix worldguard error
Browse files Browse the repository at this point in the history
  • Loading branch information
matsu1213 committed Jul 30, 2024
1 parent 60ade8d commit 0c9fc94
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
</build>

<repositories>
<repository>
<id>enginehub-maven</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
Expand All @@ -79,10 +83,6 @@
<id>glaremasters</id>
<url>https://repo.glaremasters.me/repository/concuncan/</url>
</repository>
<repository>
<id>enginehub-maven</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -100,13 +100,13 @@
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>6.1.4-SNAPSHOT</version>
<version>7.3.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>6.1.1-SNAPSHOT</version>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.5</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import java.util.Objects;
import java.util.UUID;

import org.bukkit.Bukkit;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldguard.WorldGuard;
import com.sk89q.worldguard.protection.regions.RegionContainer;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
Expand All @@ -26,6 +28,7 @@
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import com.sk89q.worldedit.math.BlockVector3;

import net.azisaba.lgw.core.LeonGunWar;
import net.azisaba.lgw.core.util.SignData;
Expand Down Expand Up @@ -226,8 +229,10 @@ private boolean isEmpty(String[] lines) {
* @return 武器交換掲示板のエリアならtrue、そうでなければfalse
*/
private boolean inTradeBoardRegion(Location loc) {
WorldGuardPlugin wg = (WorldGuardPlugin) Bukkit.getPluginManager().getPlugin("WorldGuard");
ApplicableRegionSet regions = wg.getRegionManager(loc.getWorld()).getApplicableRegions(loc);
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
ApplicableRegionSet regions = container.get(BukkitAdapter.adapt(loc.getWorld())).getApplicableRegions(BlockVector3.at(loc.getX(), loc.getY(), loc.getZ()));

if(regions == null) return false;

for ( ProtectedRegion rg : regions ) {
if ( rg.getId().toLowerCase().startsWith("keiziban") ) {
Expand Down

0 comments on commit 0c9fc94

Please sign in to comment.