mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 05:05:18 +01:00
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:
parent
0de2c3a7b6
commit
e89970b49b
@ -24,8 +24,9 @@ public class LocationTypeAdapter extends TypeAdapter<Location> {
|
|||||||
out.value(location.getX());
|
out.value(location.getX());
|
||||||
out.value(location.getY());
|
out.value(location.getY());
|
||||||
out.value(location.getZ());
|
out.value(location.getZ());
|
||||||
out.value(location.getYaw());
|
// This is required for 1.19-1.19.2 compatibility.
|
||||||
out.value(location.getPitch());
|
out.value((double) location.getYaw());
|
||||||
|
out.value((double) location.getPitch());
|
||||||
out.endArray();
|
out.endArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,11 +70,7 @@ public class EntityInteractListener extends FlagListener {
|
|||||||
{
|
{
|
||||||
this.checkIsland(e, p, l, Flags.FURNACE);
|
this.checkIsland(e, p, l, Flags.FURNACE);
|
||||||
}
|
}
|
||||||
else if (!ServerCompatibility.getInstance().isVersion(
|
else if (e.getPlayer().isSneaking() && e.getRightClicked() instanceof ChestBoat)
|
||||||
ServerCompatibility.ServerVersion.V1_18,
|
|
||||||
ServerCompatibility.ServerVersion.V1_18_1,
|
|
||||||
ServerCompatibility.ServerVersion.V1_18_2) &&
|
|
||||||
e.getPlayer().isSneaking() && e.getRightClicked() instanceof ChestBoat)
|
|
||||||
{
|
{
|
||||||
// Access to chest boat since 1.19
|
// Access to chest boat since 1.19
|
||||||
this.checkIsland(e, p, l, Flags.CHEST);
|
this.checkIsland(e, p, l, Flags.CHEST);
|
||||||
@ -96,11 +92,7 @@ public class EntityInteractListener extends FlagListener {
|
|||||||
this.checkIsland(e, p, l, Flags.NAME_TAG);
|
this.checkIsland(e, p, l, Flags.NAME_TAG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!ServerCompatibility.getInstance().isVersion(
|
else if (e.getRightClicked() instanceof Allay)
|
||||||
ServerCompatibility.ServerVersion.V1_18,
|
|
||||||
ServerCompatibility.ServerVersion.V1_18_1,
|
|
||||||
ServerCompatibility.ServerVersion.V1_18_2) &&
|
|
||||||
e.getRightClicked() instanceof Allay)
|
|
||||||
{
|
{
|
||||||
// Allay item giving/taking
|
// Allay item giving/taking
|
||||||
this.checkIsland(e, p, l, Flags.ALLAY);
|
this.checkIsland(e, p, l, Flags.ALLAY);
|
||||||
|
@ -54,10 +54,7 @@ public class InventoryListener extends FlagListener
|
|||||||
// Prevent opening animal inventories.
|
// Prevent opening animal inventories.
|
||||||
this.checkIsland(event, player, event.getInventory().getLocation(), Flags.MOUNT_INVENTORY);
|
this.checkIsland(event, player, event.getInventory().getLocation(), Flags.MOUNT_INVENTORY);
|
||||||
}
|
}
|
||||||
else if (!ServerCompatibility.getInstance().isVersion(ServerCompatibility.ServerVersion.V1_18,
|
else if (inventoryHolder instanceof ChestBoat)
|
||||||
ServerCompatibility.ServerVersion.V1_18_1,
|
|
||||||
ServerCompatibility.ServerVersion.V1_18_2) &&
|
|
||||||
inventoryHolder instanceof ChestBoat)
|
|
||||||
{
|
{
|
||||||
// Prevent opening chest inventories
|
// Prevent opening chest inventories
|
||||||
this.checkIsland(event, player, event.getInventory().getLocation(), Flags.CHEST);
|
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);
|
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) &&
|
else if (inventoryHolder instanceof ChestBoat)
|
||||||
inventoryHolder instanceof ChestBoat)
|
|
||||||
{
|
{
|
||||||
// TODO: 1.19 added chest boat. Remove compatibility check when 1.18 is dropped.
|
// TODO: 1.19 added chest boat. Remove compatibility check when 1.18 is dropped.
|
||||||
this.checkIsland(e, player, e.getInventory().getLocation(), Flags.CHEST);
|
this.checkIsland(e, player, e.getInventory().getLocation(), Flags.CHEST);
|
||||||
|
@ -35,14 +35,6 @@ public class SculkSensorListener extends FlagListener
|
|||||||
return;
|
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 &&
|
if (event.getBlock().getType() == Material.SCULK_SENSOR &&
|
||||||
event.getEntity() != null &&
|
event.getEntity() != null &&
|
||||||
event.getEntity() instanceof Player player)
|
event.getEntity() instanceof Player player)
|
||||||
|
@ -35,14 +35,6 @@ public class SculkShriekerListener extends FlagListener
|
|||||||
return;
|
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 &&
|
if (event.getBlock().getType() == Material.SCULK_SHRIEKER &&
|
||||||
event.getEntity() != null &&
|
event.getEntity() != null &&
|
||||||
event.getEntity() instanceof Player player)
|
event.getEntity() instanceof Player player)
|
||||||
|
@ -357,20 +357,10 @@ public class Util {
|
|||||||
// Bat extends Mob
|
// Bat extends Mob
|
||||||
// Most of passive mobs extends Animals
|
// 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 ||
|
return entity instanceof Animals || entity instanceof IronGolem || entity instanceof Snowman ||
|
||||||
entity instanceof WaterMob && !(entity instanceof PufferFish) || entity instanceof Bat ||
|
entity instanceof WaterMob && !(entity instanceof PufferFish) || entity instanceof Bat ||
|
||||||
entity instanceof Allay;
|
entity instanceof Allay;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PaperLib methods for addons to call
|
* PaperLib methods for addons to call
|
||||||
|
@ -189,15 +189,15 @@ public class ServerCompatibility {
|
|||||||
/**
|
/**
|
||||||
* @since 1.19.0
|
* @since 1.19.0
|
||||||
*/
|
*/
|
||||||
V1_18(Compatibility.SUPPORTED),
|
V1_18(Compatibility.INCOMPATIBLE),
|
||||||
/**
|
/**
|
||||||
* @since 1.19.0
|
* @since 1.19.0
|
||||||
*/
|
*/
|
||||||
V1_18_1(Compatibility.SUPPORTED),
|
V1_18_1(Compatibility.INCOMPATIBLE),
|
||||||
/**
|
/**
|
||||||
* @since 1.20.1
|
* @since 1.20.1
|
||||||
*/
|
*/
|
||||||
V1_18_2(Compatibility.SUPPORTED),
|
V1_18_2(Compatibility.INCOMPATIBLE),
|
||||||
/**
|
/**
|
||||||
* @since 1.21.0
|
* @since 1.21.0
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user