Remove 1.18.2 from supported version list. (#2074)

* Remove 1.18.2 from supported version list.

1.18.2 support was removed with changes in commit 056cff4b6f

Also, mark 1.19, 1.19.1 and 1.19.2 as incompatible. It happens because of GSon library changes that prevents bentobox compiled with Spigot 1.19.3 to run on older versions.

* Fixes GSON crashes introduced by migrating to 1.19.3 api.
This commit is contained in:
BONNe 2023-01-06 18:29:37 +02:00 committed by GitHub
parent 0de2c3a7b6
commit e89970b49b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 50 deletions

View File

@ -24,8 +24,9 @@ public class LocationTypeAdapter extends TypeAdapter<Location> {
out.value(location.getX());
out.value(location.getY());
out.value(location.getZ());
out.value(location.getYaw());
out.value(location.getPitch());
// This is required for 1.19-1.19.2 compatibility.
out.value((double) location.getYaw());
out.value((double) location.getPitch());
out.endArray();
}

View File

@ -70,11 +70,7 @@ public class EntityInteractListener extends FlagListener {
{
this.checkIsland(e, p, l, Flags.FURNACE);
}
else if (!ServerCompatibility.getInstance().isVersion(
ServerCompatibility.ServerVersion.V1_18,
ServerCompatibility.ServerVersion.V1_18_1,
ServerCompatibility.ServerVersion.V1_18_2) &&
e.getPlayer().isSneaking() && e.getRightClicked() instanceof ChestBoat)
else if (e.getPlayer().isSneaking() && e.getRightClicked() instanceof ChestBoat)
{
// Access to chest boat since 1.19
this.checkIsland(e, p, l, Flags.CHEST);
@ -96,11 +92,7 @@ public class EntityInteractListener extends FlagListener {
this.checkIsland(e, p, l, Flags.NAME_TAG);
}
}
else if (!ServerCompatibility.getInstance().isVersion(
ServerCompatibility.ServerVersion.V1_18,
ServerCompatibility.ServerVersion.V1_18_1,
ServerCompatibility.ServerVersion.V1_18_2) &&
e.getRightClicked() instanceof Allay)
else if (e.getRightClicked() instanceof Allay)
{
// Allay item giving/taking
this.checkIsland(e, p, l, Flags.ALLAY);

View File

@ -54,10 +54,7 @@ public class InventoryListener extends FlagListener
// Prevent opening animal inventories.
this.checkIsland(event, player, event.getInventory().getLocation(), Flags.MOUNT_INVENTORY);
}
else if (!ServerCompatibility.getInstance().isVersion(ServerCompatibility.ServerVersion.V1_18,
ServerCompatibility.ServerVersion.V1_18_1,
ServerCompatibility.ServerVersion.V1_18_2) &&
inventoryHolder instanceof ChestBoat)
else if (inventoryHolder instanceof ChestBoat)
{
// Prevent opening chest inventories
this.checkIsland(event, player, event.getInventory().getLocation(), Flags.CHEST);
@ -132,8 +129,7 @@ public class InventoryListener extends FlagListener
{
this.checkIsland(e, player, e.getInventory().getLocation(), Flags.CHEST);
}
else if (!ServerCompatibility.getInstance().isVersion(ServerCompatibility.ServerVersion.V1_18, ServerCompatibility.ServerVersion.V1_18_1, ServerCompatibility.ServerVersion.V1_18_2) &&
inventoryHolder instanceof ChestBoat)
else if (inventoryHolder instanceof ChestBoat)
{
// TODO: 1.19 added chest boat. Remove compatibility check when 1.18 is dropped.
this.checkIsland(e, player, e.getInventory().getLocation(), Flags.CHEST);

View File

@ -35,14 +35,6 @@ public class SculkSensorListener extends FlagListener
return;
}
if (ServerCompatibility.getInstance().isVersion(ServerCompatibility.ServerVersion.V1_18,
ServerCompatibility.ServerVersion.V1_18_1,
ServerCompatibility.ServerVersion.V1_18_2))
{
// TODO: 1.18 compatibility exit
return;
}
if (event.getBlock().getType() == Material.SCULK_SENSOR &&
event.getEntity() != null &&
event.getEntity() instanceof Player player)

View File

@ -35,14 +35,6 @@ public class SculkShriekerListener extends FlagListener
return;
}
if (ServerCompatibility.getInstance().isVersion(ServerCompatibility.ServerVersion.V1_18,
ServerCompatibility.ServerVersion.V1_18_1,
ServerCompatibility.ServerVersion.V1_18_2))
{
// TODO: 1.18 compatibility exit
return;
}
if (event.getBlock().getType() == Material.SCULK_SHRIEKER &&
event.getEntity() != null &&
event.getEntity() instanceof Player player)

View File

@ -357,19 +357,9 @@ public class Util {
// Bat extends Mob
// Most of passive mobs extends Animals
if (ServerCompatibility.getInstance().isVersion(ServerCompatibility.ServerVersion.V1_18,
ServerCompatibility.ServerVersion.V1_18_1,
ServerCompatibility.ServerVersion.V1_18_2))
{
return entity instanceof Animals || entity instanceof IronGolem || entity instanceof Snowman ||
entity instanceof WaterMob && !(entity instanceof PufferFish) || entity instanceof Bat;
}
else
{
return entity instanceof Animals || entity instanceof IronGolem || entity instanceof Snowman ||
entity instanceof WaterMob && !(entity instanceof PufferFish) || entity instanceof Bat ||
entity instanceof Allay;
}
return entity instanceof Animals || entity instanceof IronGolem || entity instanceof Snowman ||
entity instanceof WaterMob && !(entity instanceof PufferFish) || entity instanceof Bat ||
entity instanceof Allay;
}
/*

View File

@ -189,15 +189,15 @@ public class ServerCompatibility {
/**
* @since 1.19.0
*/
V1_18(Compatibility.SUPPORTED),
V1_18(Compatibility.INCOMPATIBLE),
/**
* @since 1.19.0
*/
V1_18_1(Compatibility.SUPPORTED),
V1_18_1(Compatibility.INCOMPATIBLE),
/**
* @since 1.20.1
*/
V1_18_2(Compatibility.SUPPORTED),
V1_18_2(Compatibility.INCOMPATIBLE),
/**
* @since 1.21.0
*/