Skip to content

Commit c8a1abc

Browse files
committed
Update to WorldGuard 6.0.0
1 parent fcb5df8 commit c8a1abc

File tree

7 files changed

+21
-20
lines changed

7 files changed

+21
-20
lines changed

WorldEdit-5.6.3.jar

-922 KB
Binary file not shown.

WorldEdit-6.0.0-SNAPSHOT.jar

1.46 MB
Binary file not shown.

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@
6565
<dependency>
6666
<groupId>org.bukkit</groupId>
6767
<artifactId>bukkit</artifactId>
68-
<version>1.7.9-R0.2</version>
68+
<version>1.7.10-R0.1-SNAPSHOT</version>
6969
</dependency>
7070
<dependency>
7171
<groupId>com.sk89q</groupId>
7272
<artifactId>WorldGuard</artifactId>
73-
<version>5.9</version>
73+
<version>6.0.0-SNAPSHOT</version>
7474
<scope>system</scope>
75-
<systemPath>${project.basedir}/worldguard-5.9.jar</systemPath>
75+
<systemPath>${project.basedir}/worldguard-6.0.0-SNAPSHOT.jar</systemPath>
7676
</dependency>
7777
<dependency>
7878
<groupId>com.sk89q</groupId>
7979
<artifactId>WorldEdit</artifactId>
80-
<version>5.6.3</version>
80+
<version>6.0.0-SNAPSHOT</version>
8181
<scope>system</scope>
82-
<systemPath>${project.basedir}/WorldEdit-5.6.3.jar</systemPath>
82+
<systemPath>${project.basedir}/WorldEdit-6.0.0-SNAPSHOT.jar</systemPath>
8383
</dependency>
8484
<dependency>
8585
<groupId>com.sk89q</groupId>

src/main/java/org/dynmap/worldguard/DynmapWorldGuardPlugin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import com.sk89q.worldguard.protection.managers.RegionManager;
3636
import com.sk89q.worldguard.protection.regions.ProtectedPolygonalRegion;
3737
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
38+
import com.sk89q.worldguard.protection.regions.RegionType;
3839

3940
public class DynmapWorldGuardPlugin extends JavaPlugin {
4041
private static Logger log;
@@ -211,11 +212,11 @@ private void handleRegion(World world, ProtectedRegion region, Map<String, AreaM
211212
/* Handle areas */
212213
if(isVisible(region.getId(), world.getName())) {
213214
String id = region.getId();
214-
String tn = region.getTypeName();
215+
RegionType tn = region.getType();
215216
BlockVector l0 = region.getMinimumPoint();
216217
BlockVector l1 = region.getMaximumPoint();
217218

218-
if(tn.equalsIgnoreCase("cuboid")) { /* Cubiod region? */
219+
if(tn == RegionType.CUBOID) { /* Cubiod region? */
219220
/* Make outline */
220221
x = new double[4];
221222
z = new double[4];
@@ -224,7 +225,7 @@ private void handleRegion(World world, ProtectedRegion region, Map<String, AreaM
224225
x[2] = l1.getX() + 1.0; z[2] = l1.getZ()+1.0;
225226
x[3] = l1.getX() + 1.0; z[3] = l0.getZ();
226227
}
227-
else if(tn.equalsIgnoreCase("polygon")) {
228+
else if(tn == RegionType.POLYGON) {
228229
ProtectedPolygonalRegion ppr = (ProtectedPolygonalRegion)region;
229230
List<BlockVector2D> points = ppr.getPoints();
230231
x = new double[points.size()];
@@ -324,7 +325,6 @@ public void run() {
324325
}
325326

326327
private class OurServerListener implements Listener {
327-
@SuppressWarnings("unused")
328328
@EventHandler(priority=EventPriority.MONITOR)
329329
public void onPluginEnable(PluginEnableEvent event) {
330330
Plugin p = event.getPlugin();

src/main/java/org/dynmap/worldguard/MetricsLite.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.bukkit.configuration.file.YamlConfiguration;
3434
import org.bukkit.plugin.Plugin;
3535
import org.bukkit.plugin.PluginDescriptionFile;
36+
import org.bukkit.scheduler.BukkitTask;
3637

3738
import java.io.BufferedReader;
3839
import java.io.File;
@@ -97,7 +98,7 @@ public class MetricsLite {
9798
/**
9899
* Id of the scheduled task
99100
*/
100-
private volatile int taskId = -1;
101+
private volatile BukkitTask taskId = null;
101102

102103
public MetricsLite(Plugin plugin) throws IOException {
103104
if (plugin == null) {
@@ -139,12 +140,12 @@ public boolean start() {
139140
}
140141

141142
// Is metrics already running?
142-
if (taskId >= 0) {
143+
if (taskId != null) {
143144
return true;
144145
}
145146

146147
// Begin hitting the server with glorious data
147-
taskId = plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() {
148+
taskId = plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
148149

149150
private boolean firstPost = true;
150151

@@ -153,9 +154,9 @@ public void run() {
153154
// This has to be synchronized or it can collide with the disable method.
154155
synchronized (optOutLock) {
155156
// Disable Task, if it is running and the server owner decided to opt-out
156-
if (isOptOut() && taskId > 0) {
157-
plugin.getServer().getScheduler().cancelTask(taskId);
158-
taskId = -1;
157+
if (isOptOut() && (taskId != null)) {
158+
taskId.cancel();
159+
taskId = null;
159160
}
160161
}
161162

@@ -213,7 +214,7 @@ public void enable() throws IOException {
213214
}
214215

215216
// Enable Task, if it is not running
216-
if (taskId < 0) {
217+
if (taskId == null) {
217218
start();
218219
}
219220
}
@@ -234,9 +235,9 @@ public void disable() throws IOException {
234235
}
235236

236237
// Disable Task, if it is running
237-
if (taskId > 0) {
238-
this.plugin.getServer().getScheduler().cancelTask(taskId);
239-
taskId = -1;
238+
if (taskId != null) {
239+
taskId.cancel();
240+
taskId = null;
240241
}
241242
}
242243
}
@@ -270,7 +271,7 @@ private void postPlugin(boolean isPing) throws IOException {
270271
data.append(encode("guid")).append('=').append(encode(guid));
271272
encodeDataPair(data, "version", description.getVersion());
272273
encodeDataPair(data, "server", Bukkit.getVersion());
273-
encodeDataPair(data, "players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length));
274+
encodeDataPair(data, "players", Integer.toString(Bukkit.getServer().getOnlinePlayers().size()));
274275
encodeDataPair(data, "revision", String.valueOf(REVISION));
275276

276277
// If we're pinging, append it

worldguard-5.9.jar

-325 KB
Binary file not shown.

worldguard-6.0.0-SNAPSHOT.jar

939 KB
Binary file not shown.

0 commit comments

Comments
 (0)