Skip to content

Commit 8542942

Browse files
committed
adjust version check
1 parent 2ee3f91 commit 8542942

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -433,14 +433,15 @@ public void setFoodLevel(final @NonNull PlotPlayer<?> player, @NonNegative final
433433
@Override
434434
public @NonNull Set<com.sk89q.worldedit.world.entity.EntityType> getTypesInCategory(final @NonNull String category) {
435435
final Collection<Class<?>> allowedInterfaces = new HashSet<>();
436+
final int[] version = PlotSquared.platform().serverVersion();
436437
switch (category) {
437438
case "animal" -> {
438439
allowedInterfaces.add(IronGolem.class);
439440
allowedInterfaces.add(Snowman.class);
440441
allowedInterfaces.add(Animals.class);
441442
allowedInterfaces.add(WaterMob.class);
442443
allowedInterfaces.add(Ambient.class);
443-
if (PlotSquared.platform().serverVersion()[1] >= 19) {
444+
if (version[1] >= 19) {
444445
allowedInterfaces.add(Allay.class);
445446
}
446447
}
@@ -472,8 +473,7 @@ public void setFoodLevel(final @NonNull PlotPlayer<?> player, @NonNegative final
472473
}
473474
case "player" -> allowedInterfaces.add(Player.class);
474475
case "interaction" -> {
475-
final int[] version = PlotSquared.platform().serverVersion();
476-
if (version[1] >= 19 && version[2] >= 4) {
476+
if ((version[1] > 19) || (version[1] == 19 && version[2] >= 4)) {
477477
allowedInterfaces.add(Interaction.class);
478478
}
479479
}

0 commit comments

Comments
 (0)