booksaw / BetterTeams

Create teams to fight to be the best (Minecraft Plugin)
https://www.spigotmc.org/resources/better-teams.17129/
MIT License
66 stars 45 forks source link

[BUG] com.booksaw.betterTeams.events.ChestManagement.onHopper() takes too much resources #641

Open JericNisperos opened 1 month ago

JericNisperos commented 1 month ago

What is the bug?

It seems that even if we disabled the claim chest, Hopper is still being checked which causes the server to lag extensively.

Expected Behaviour

If claim-chests are disabled, it should also disable this process.

How to Reproduce

The plugin was installed and immediately disabled the claiming of chests by setting the permission: betterteams.admin.chest.disable to true. Also disabled the permissions: betterteams.admin.chest.claim and betterteams.chest.claim to false.

Error message

It's not considered as an error but rather a process from the server.

BetterTeams (v4.9.4) Server thread17.40% com.booksaw.betterTeams.events.ChestManagement.onHopper()17.38% com.booksaw.betterTeams.Team.getClaimingTeam()16.58% com.booksaw.betterTeams.team.TeamManager.getClaimingTeam()16.58% org.bukkit.block.DoubleChest.getLeftSide()12.41% org.bukkit.craftbukkit.inventory.CraftInventory.getHolder()12.41% net.minecraft.world.level.block.entity.BlockEntity.getOwner()12.41% net.minecraft.world.level.block.entity.BlockEntity.getOwner()12.41% org.bukkit.craftbukkit.block.CraftBlock.getState()12.41% org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState()12.41% org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState()12.40% org.bukkit.craftbukkit.block.CraftBlockStates$BlockEntityStateFactory.createBlockState()12.40% org.bukkit.craftbukkit.block.CraftBlockStates$BlockEntityStateFactory.createBlockState()12.40% org.bukkit.craftbukkit.block.CraftBlockStates$BlockEntityStateFactory.createBlockState()12.40% org.bukkit.craftbukkit.block.CraftBlockStates$$Lambda.0x00007f619d62dbd0.apply()12.40% org.bukkit.craftbukkit.block.CraftChest.()12.40% org.bukkit.craftbukkit.block.CraftLootable.()12.40% org.bukkit.craftbukkit.block.CraftContainer.()12.40% org.bukkit.craftbukkit.block.CraftBlockEntityState.()12.40% org.bukkit.craftbukkit.block.CraftBlockEntityState.createSnapshot()12.40% net.minecraft.world.level.block.entity.BlockEntity.loadStatic()10.60% image

Output of /teama version

image

Additional Information

This was posted from Discord but Booksaw requested to create this bug report: https://discord.com/channels/295271438112522241/1265291473788866676

Thank you, Booksaw!

JericNisperos commented 1 month ago

Discord: Cyanice (cyaniceblitz)

booksaw commented 1 month ago

Question asked in Discord channel, but repeating here for consistency: @Cyanice Ive had a further look, and if the /team chest command is disabled, it should totally disable all events related to chest claims. Have you disabled the full command (check ⁠faq for further info)

JericNisperos commented 1 month ago

Yes, this was disabled from permission. I also took the time to check the files manually and confirmed that there are no claims from chests.

image

booksaw commented 1 month ago

Yes, it has to be disabled fully in the teampermissions.yaml file so the command is entirely disabled, in that file find the chest value and set enabled to false