Update to 1.20.6

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

View File

@ -37,14 +37,7 @@ public class MobListener extends PlexListener
EntityType eggType;
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)
{
@ -56,7 +49,10 @@ public class MobListener extends PlexListener
@EventHandler
public void onEntitySpawn(EntitySpawnEvent event)
{
if (event.isCancelled()) return;
if (event.isCancelled())
{
return;
}
if (event.getEntity().getEntitySpawnReason() == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG)
{
// 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)
public void onEntityClick(PlayerInteractEntityEvent event)
{
if (event.isCancelled()) return;
if (event.isCancelled())
{
return;
}
Material handItem = event.getPlayer().getEquipment().getItem(event.getHand()).getType();
if (event.getRightClicked() instanceof Ageable entity)
{
@ -128,8 +127,14 @@ public class MobListener extends PlexListener
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerInteract(PlayerInteractEvent event)
{
if (event.useItemInHand() == Event.Result.DENY) return;
if (event.useInteractedBlock() == Event.Result.DENY) return;
if (event.useItemInHand() == Event.Result.DENY)
{
return;
}
if (event.useInteractedBlock() == Event.Result.DENY)
{
return;
}
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
{
if (SPAWN_EGGS.contains(event.getMaterial()))

View File

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