Update to 1.20.6

This commit is contained in:
Telesphoreo 2024-06-15 13:41:34 -05:00
parent c7225246fa
commit e759dc2269
4 changed files with 22 additions and 17 deletions

View File

@ -42,7 +42,7 @@ subprojects {
} }
java { java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) toolchain.languageVersion.set(JavaLanguageVersion.of(21))
} }
tasks { tasks {

View File

@ -22,8 +22,7 @@ dependencies {
library("com.zaxxer:HikariCP:5.1.0") library("com.zaxxer:HikariCP:5.1.0")
library("org.apache.maven.resolver:maven-resolver-transport-http:1.9.20") library("org.apache.maven.resolver:maven-resolver-transport-http:1.9.20")
library("org.jetbrains:annotations:24.1.0") library("org.jetbrains:annotations:24.1.0")
compileOnly("dev.folia:folia-api:1.20.6-R0.1-SNAPSHOT")
compileOnly("dev.folia:folia-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") { compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") {
exclude("org.bukkit", "bukkit") exclude("org.bukkit", "bukkit")
} }
@ -50,7 +49,7 @@ paper {
loader = "dev.plex.PlexLibraryManager" loader = "dev.plex.PlexLibraryManager"
website = "https://plex.us.org" website = "https://plex.us.org"
authors = listOf("Telesphoreo", "taahanis", "supernt") authors = listOf("Telesphoreo", "taahanis", "supernt")
apiVersion = "1.19" apiVersion = "1.20.5"
foliaSupported = true foliaSupported = true
generateLibrariesJson = true generateLibrariesJson = true
// Load BukkitTelnet and LibsDisguises before Plex so the modules register properly // Load BukkitTelnet and LibsDisguises before Plex so the modules register properly

View File

@ -36,16 +36,9 @@ public class MobListener extends PlexListener
{ {
EntityType eggType; EntityType eggType;
try try
{
if (mat == Material.MOOSHROOM_SPAWN_EGG)
{
eggType = EntityType.MUSHROOM_COW;
}
else
{ {
eggType = EntityType.valueOf(mat.name().substring(0, mat.name().length() - 10)); eggType = EntityType.valueOf(mat.name().substring(0, mat.name().length() - 10));
} }
}
catch (IllegalArgumentException ignored) catch (IllegalArgumentException ignored)
{ {
return null; return null;
@ -56,7 +49,10 @@ public class MobListener extends PlexListener
@EventHandler @EventHandler
public void onEntitySpawn(EntitySpawnEvent event) public void onEntitySpawn(EntitySpawnEvent event)
{ {
if (event.isCancelled()) return; if (event.isCancelled())
{
return;
}
if (event.getEntity().getEntitySpawnReason() == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) if (event.getEntity().getEntitySpawnReason() == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG)
{ {
// for the future, we can instead filter and restrict nbt tags right here. // for the future, we can instead filter and restrict nbt tags right here.
@ -106,7 +102,10 @@ public class MobListener extends PlexListener
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onEntityClick(PlayerInteractEntityEvent event) public void onEntityClick(PlayerInteractEntityEvent event)
{ {
if (event.isCancelled()) return; if (event.isCancelled())
{
return;
}
Material handItem = event.getPlayer().getEquipment().getItem(event.getHand()).getType(); Material handItem = event.getPlayer().getEquipment().getItem(event.getHand()).getType();
if (event.getRightClicked() instanceof Ageable entity) if (event.getRightClicked() instanceof Ageable entity)
{ {
@ -128,8 +127,14 @@ public class MobListener extends PlexListener
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onPlayerInteract(PlayerInteractEvent event) public void onPlayerInteract(PlayerInteractEvent event)
{ {
if (event.useItemInHand() == Event.Result.DENY) return; if (event.useItemInHand() == Event.Result.DENY)
if (event.useInteractedBlock() == Event.Result.DENY) return; {
return;
}
if (event.useInteractedBlock() == Event.Result.DENY)
{
return;
}
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
{ {
if (SPAWN_EGGS.contains(event.getMaterial())) if (SPAWN_EGGS.contains(event.getMaterial()))

View File

@ -34,6 +34,7 @@ public class ServerListener extends PlexListener
{ {
event.motd(PlexUtils.mmDeserialize(baseMotd.trim())); event.motd(PlexUtils.mmDeserialize(baseMotd.trim()));
} }
/* - Broken on 1.20.6
if (plugin.config.contains("server.sample")) if (plugin.config.contains("server.sample"))
{ {
List<String> samples = plugin.config.getStringList("server.sample"); List<String> samples = plugin.config.getStringList("server.sample");
@ -42,6 +43,6 @@ public class ServerListener extends PlexListener
event.getPlayerSample().clear(); event.getPlayerSample().clear();
event.getPlayerSample().addAll(samples.stream().map(string -> string.replace("&", "§")).map(Bukkit::createProfile).toList()); event.getPlayerSample().addAll(samples.stream().map(string -> string.replace("&", "§")).map(Bukkit::createProfile).toList());
} }
} }*/
} }
} }