Skip to content

Commit 2cdb66b

Browse files
AngeschossenJikoo
andauthored
Update LandsAPI (#24)
* Remove deprecated method * Remove completeableFuture * Initialize LandsIntegration class * Initialize LandsIntegration class * LandsAPI is available via JitPack * Back to tabs Co-authored-by: Angeschossen <!FlashLight2018> Co-authored-by: Jikoo <jikoo.games@gmail.com>
1 parent 8722776 commit 2cdb66b

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

pom.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,10 @@
144144
<systemPath>${project.basedir}/premium/Residence.jar</systemPath>
145145
</dependency>
146146
<dependency>
147-
<groupId>me.angeschossen</groupId>
148-
<artifactId>Lands</artifactId>
149-
<version>4.3.1.2</version>
150-
<scope>system</scope>
151-
<systemPath>${project.basedir}/premium/Lands.jar</systemPath>
147+
<groupId>com.github.angeschossen</groupId>
148+
<artifactId>LandsAPI</artifactId>
149+
<version>4.9.3</version>
150+
<scope>provided</scope>
152151
</dependency>
153152
<dependency>
154153
<groupId>com.songoda</groupId>
Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package com.github.jikoo.regionerator.hooks;
22

33
import com.github.jikoo.regionerator.Regionerator;
4-
import java.util.concurrent.ExecutionException;
54
import me.angeschossen.lands.api.integration.LandsIntegration;
6-
import me.angeschossen.lands.api.land.LandWorld;
75
import org.bukkit.World;
6+
import org.jetbrains.annotations.NotNull;
87

98
/**
109
* PluginHook for <a href=https://www.spigotmc.org/resources/lands.53313/>Lands</a>.
@@ -26,31 +25,21 @@ public boolean isHookUsable() {
2625

2726
@Override
2827
public boolean isChunkProtected(World chunkWorld, int chunkX, int chunkZ) {
29-
LandWorld landWorld = getLandsAPI().getLandWorld(chunkWorld.getName());
30-
31-
if (landWorld == null) {
32-
return false;
33-
}
28+
return getLandsAPI().isClaimed(chunkWorld, chunkX, chunkZ);
29+
}
3430

35-
try {
36-
return landsAPI.isClaimed(chunkWorld.getName(), chunkX, chunkZ).get();
37-
} catch (InterruptedException | ExecutionException | ClassCastException e) {
38-
e.printStackTrace();
39-
return true;
40-
}
31+
@Override
32+
public boolean isAsyncCapable() {
33+
return true;
4134
}
4235

36+
@NotNull
4337
private LandsIntegration getLandsAPI() {
4438
if (landsAPI == null) {
45-
landsAPI = new LandsIntegration(Regionerator.getPlugin(Regionerator.class), false);
46-
landsAPI.initialize();
39+
landsAPI = new LandsIntegration(Regionerator.getPlugin(Regionerator.class));
4740
}
48-
return landsAPI;
49-
}
5041

51-
@Override
52-
public boolean isAsyncCapable() {
53-
return true;
42+
return landsAPI;
5443
}
5544

5645
}

0 commit comments

Comments
 (0)