Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Major TPS Lag with ArmorStandEditor plugin #594

Open
DarkChromaMC opened this issue Oct 1, 2024 · 1 comment
Open

[Bug]: Major TPS Lag with ArmorStandEditor plugin #594

DarkChromaMC opened this issue Oct 1, 2024 · 1 comment
Labels
bug Something isn't working BUG-0: Pending Investigation BUGS/ISSUES Pending Investigation help wanted Extra attention is needed

Comments

@DarkChromaMC
Copy link

Expected behavior

Smooth container interactions without TPS lag, even with many shulker boxes.

Observed/Actual behavior

Heavy TPS lag occurs when opening or closing a container with multiple shulker boxes.

Steps/models to reproduce

  • Run Purpur 1.21.1 with ArmorStandEditor v1.21-47 enabled.
  • Place a container (e.g., chest) and fill it with 50+ shulker boxes. (Schematic of the barrel I used is provided OR hotbar.nbt file)

chest.schem.zip
hotbar.nbt.zip

Plugin list

ArmorStandEditor 1.21-47

Plugin Version

1.21-47

Server Version

Purpur 1.21.1 (latest - build 2315)

Other

Enabling ArmorStandEditor causes significant TPS drops when players open or close containers holding lots of shulker boxes. Without the plugin, performance remains fully stable under the same conditions.

Please address this issue to ensure optimal server performance. Let me know if more information is needed. Thank you!

Video provided to demonstrate:
https://youtu.be/VhPIgemfSso

Spark profile:
https://spark.lucko.me/tlGZaWamK5

@DarkChromaMC DarkChromaMC added bug Something isn't working BUG-0: Pending Investigation BUGS/ISSUES Pending Investigation labels Oct 1, 2024
@Wolfieheart Wolfieheart added the help wanted Extra attention is needed label Oct 3, 2024
@Wolfieheart
Copy link
Owner

Wolfieheart commented Oct 3, 2024

Looking at the code in question and the 2 TPS threads for ArmorStandEditor....

I dont see how ASE could cause the TPS drop immediately (might be cause it is 8AM CEST on 3/10 and im still waking up), as the code in question runs as follows:

void onPlayerMenuSelect(InventoryClickEvent e) {
if (e.getInventory().getHolder() == null) return;
if (!(e.getInventory().getHolder() instanceof ASEHolder)) return;
if (e.getInventory().getHolder() == menuHolder) {
e.setCancelled(true);
ItemStack item = e.getCurrentItem();
if (item != null && item.hasItemMeta()) {
Player player = (Player) e.getWhoClicked();
String command = item.getItemMeta().getPersistentDataContainer().get(plugin.getIconKey(), PersistentDataType.STRING);
if (command != null) {
player.performCommand(command);
return;
}
}
}
if (e.getInventory().getHolder() == equipmentHolder) {
ItemStack item = e.getCurrentItem();
if (item == null) return;
if (item.getItemMeta() == null) return;
if (item.getItemMeta().getPersistentDataContainer().has(plugin.getIconKey(), PersistentDataType.STRING)) {
e.setCancelled(true);
}
}
if (e.getInventory().getHolder() == presetHolder) {
e.setCancelled(true);
ItemStack item = e.getCurrentItem();
if (item != null && item.hasItemMeta()) {
Player player = (Player) e.getWhoClicked();
String itemName = item.getItemMeta().getDisplayName();
PlayerEditor pe = players.get(player.getUniqueId());
pe.presetPoseMenu.handlePresetPose(itemName, player);
}
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
void onPlayerMenuClose(InventoryCloseEvent e) {
if (e.getInventory().getHolder() == null) return;
if (!(e.getInventory().getHolder() instanceof ASEHolder)) return;
if (e.getInventory().getHolder() == equipmentHolder) {
PlayerEditor pe = players.get(e.getPlayer().getUniqueId());
pe.equipMenu.equipArmorstand();
}
}

Unless there it is not liking the entity.getInventory.GetHolder(); which runs from PlayerEditorManager to the specific menus which themselves are new instances of https://github.com/Wolfieheart/ArmorStandEditor/blob/master/src/main/java/io/github/rypofalem/armorstandeditor/menu/ASEHolder.java

Plus a question or two:

  • Has this been like this as of late? - IE in 1.19, 1.18 or 1.17 - as if it has then I wonder if this has been an issue since the beginning (before I took it over a developer). Thank you for reporting this in any case, but I am skeptical that this has been an issue for a fair bit.
  • Is this with the default config?
  • Does this happen outside of the Dev Server when there is an ArmorStand in the world being used or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working BUG-0: Pending Investigation BUGS/ISSUES Pending Investigation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants