Update to latest releases of Chunky(Border) (fixes #55)

This commit is contained in:
Phoenix616 2023-01-16 17:06:16 +01:00
parent 29f709a73e
commit 548d873790
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0
2 changed files with 10 additions and 12 deletions

View File

@ -11,10 +11,6 @@
<artifactId>chunkyborder</artifactId>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>codemc</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
@ -23,14 +19,14 @@
<dependencies>
<dependency>
<groupId>org.popcraft</groupId>
<artifactId>chunkyborder</artifactId>
<version>1.0.43</version>
<artifactId>chunkyborder-bukkit</artifactId>
<version>1.1.42</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.popcraft</groupId>
<artifactId>chunky-bukkit</artifactId>
<version>1.2.93</version>
<version>1.3.52</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -9,10 +9,12 @@ import org.popcraft.chunkyborder.BorderData;
import org.popcraft.chunkyborder.ChunkyBorder;
public class ChunkyBorderHook implements WorldborderHook {
private final ChunkyBorder plugin;
private final Plugin plugin;
private final ChunkyBorder chunkyBorder;
public ChunkyBorderHook() {
this.plugin = (ChunkyBorder) Bukkit.getPluginManager().getPlugin("ChunkyBorder");
this.plugin = Bukkit.getPluginManager().getPlugin("ChunkyBorder");
chunkyBorder = plugin.getServer().getServicesManager().getRegistration(ChunkyBorder.class).getProvider();
}
@Override
@ -22,19 +24,19 @@ public class ChunkyBorderHook implements WorldborderHook {
@Override
public Location getCenter(World world) {
BorderData borderData = plugin.getBorders().get(world.getName());
BorderData borderData = chunkyBorder.getBorders().get(world.getName());
return new Location(world, borderData.getCenterX(),0D,borderData.getCenterZ());
}
@Override
public double getBorderRadius(World world) {
BorderData borderData = plugin.getBorders().get(world.getName());
BorderData borderData = chunkyBorder.getBorders().get(world.getName());
return borderData.getRadiusX();
}
@Override
public boolean isInsideBorder(Location location) {
BorderData borderData = plugin.getBorders().get(location.getWorld().getName());
BorderData borderData = chunkyBorder.getBorders().get(location.getWorld().getName());
return borderData.getBorder().isBounding(location.getBlockX(),location.getBlockZ());
}