Skip to content

Commit c29edf7

Browse files
committed
Fix Deprecations from WorldEdit 7.3.0
1 parent da3c81a commit c29edf7

23 files changed

+113
-119
lines changed

worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/BukkitWorldGuardPlatform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public ProtectedRegion getSpawnProtection(World world) {
266266
if (radius > 0) {
267267
BlockVector3 spawnLoc = BukkitAdapter.asBlockVector(bWorld.getSpawnLocation());
268268
return new ProtectedCuboidRegion("__spawn_protection__",
269-
spawnLoc.subtract(radius, 0, radius).withY(world.getMinimumPoint().getY()),
269+
spawnLoc.subtract(radius, 0, radius).withY(world.getMinimumPoint().y()),
270270
spawnLoc.add(radius, 0, radius).withY(world.getMaxY()));
271271
}
272272
}

worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardEntityListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ public void onExplosionPrime(ExplosionPrimeEvent event) {
586586
event.setCancelled(true);
587587
return;
588588
}
589-
} else if (event.getEntityType() == EntityType.PRIMED_TNT
590-
|| event.getEntityType() == EntityType.MINECART_TNT) {
589+
} else if (event.getEntityType() == EntityType.TNT
590+
|| event.getEntityType() == EntityType.TNT_MINECART) {
591591
if (wcfg.blockTNTExplosions) {
592592
event.setCancelled(true);
593593
return;

worldguard-core/src/main/java/com/sk89q/worldguard/blacklist/logger/DatabaseHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ private void logEvent(EventType eventType, @Nullable LocalPlayer player, BlockVe
9595
stmt.setString(1, eventType.name());
9696
stmt.setString(2, worldName);
9797
stmt.setString(3, player != null ? player.getName() : "");
98-
stmt.setInt(4, pos.getBlockX());
99-
stmt.setInt(5, pos.getBlockY());
100-
stmt.setInt(6, pos.getBlockZ());
98+
stmt.setInt(4, pos.x());
99+
stmt.setInt(5, pos.y());
100+
stmt.setInt(6, pos.z());
101101
stmt.setString(7, item);
102102
stmt.setInt(8, (int)(System.currentTimeMillis() / 1000));
103103
stmt.setString(9, comment);

worldguard-core/src/main/java/com/sk89q/worldguard/blacklist/logger/FileHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private void log(@Nullable LocalPlayer player, String message, String comment) {
221221
* @return The position's coordinates in human-readable form
222222
*/
223223
private String getCoordinates(BlockVector3 pos) {
224-
return "@" + pos.getBlockX() + "," + pos.getBlockY() + "," + pos.getBlockZ();
224+
return "@" + pos.x() + "," + pos.y() + "," + pos.z();
225225
}
226226

227227
private void logEvent(BlacklistEvent event, String text, Target target, BlockVector3 pos, String comment) {

worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/FlagHelperBox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ private void appendRegistryFlagValue(TextComponent.Builder builder, RegistryFlag
378378
if (currVal == null) {
379379
currVal = getInheritedValue(region, flag);
380380
}
381-
String display = currVal == null ? regName : currVal.getId();
381+
String display = currVal == null ? regName : currVal.id();
382382
appendValueText(builder, flag, display, null);
383383
}
384384

worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionCommandsBase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ protected static ProtectedRegion checkRegionFromSelection(Actor actor, String id
308308
// Detect the type of region from WorldEdit
309309
if (selection instanceof Polygonal2DRegion) {
310310
Polygonal2DRegion polySel = (Polygonal2DRegion) selection;
311-
int minY = polySel.getMinimumPoint().getBlockY();
312-
int maxY = polySel.getMaximumPoint().getBlockY();
311+
int minY = polySel.getMinimumPoint().y();
312+
int maxY = polySel.getMaximumPoint().y();
313313
return new ProtectedPolygonalRegion(id, polySel.getPoints(), minY, maxY);
314314
} else if (selection instanceof CuboidRegion) {
315315
BlockVector3 min = selection.getMinimumPoint();
@@ -348,7 +348,7 @@ protected static void warnAboutDimensions(Actor sender, ProtectedRegion region)
348348
if (region instanceof GlobalProtectedRegion) {
349349
return;
350350
}
351-
int height = region.getMaximumPoint().getBlockY() - region.getMinimumPoint().getBlockY();
351+
int height = region.getMaximumPoint().y() - region.getMinimumPoint().y();
352352
if (height <= 2) {
353353
sender.printDebug("(Warning: The height of the region was " + (height + 1) + " block(s).)");
354354
}

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/EntityTypeFlag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ public EntityType unmarshal(@Nullable Object o) {
5757

5858
@Override
5959
public Object marshal(EntityType o) {
60-
return o.getId();
60+
return o.id();
6161
}
6262
}

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/GameModeTypeFlag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ public GameMode unmarshal(@Nullable Object o) {
5757

5858
@Override
5959
public Object marshal(GameMode o) {
60-
return o.getId();
60+
return o.id();
6161
}
6262
}

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/LocationFlag.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ public Object marshal(Location o) {
137137
return null;
138138
}
139139
}
140-
vec.put("x", position.getX());
141-
vec.put("y", position.getY());
142-
vec.put("z", position.getZ());
140+
vec.put("x", position.x());
141+
vec.put("y", position.y());
142+
vec.put("z", position.z());
143143
vec.put("yaw", o.getYaw());
144144
vec.put("pitch", o.getPitch());
145145
return vec;

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/RegistryFlag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ public T unmarshal(@Nullable Object o) {
6161

6262
@Override
6363
public Object marshal(T o) {
64-
return o.getId();
64+
return o.id();
6565
}
6666
}

0 commit comments

Comments
 (0)