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

Performance issue #3

Open
ylt opened this issue Sep 14, 2013 · 0 comments
Open

Performance issue #3

ylt opened this issue Sep 14, 2013 · 0 comments
Assignees

Comments

@ylt
Copy link
Owner

ylt commented Sep 14, 2013

Barely a bug, but is an issue that has always existed since first version - but has been worsened since that rewrite that made it modular.

Minecraft simulates pickups every server tick, if it's over a plate, this is where the problem is.. Bukkit itself dispatches an entity-interact event, which our plugin cancels the majority of the time, this happens for EVERY pickup that happens to be over a plate, even the same one..

This means that the plugin can lag the server unnecessarily if there's a lot of activity.

The solution that I'd personally like to implement is to use the interact event just to insert the triggered plate into a list. At this point, we can validate the surrounding blocks to verify that it's valid, THIS reduces the check to the whole chain of events, rather than every individual one.

This list can then be iterated through, on a timer - for each plate: check if it's pressed, if not: remove, else: read the data from the surrounding blocks for that plate (i.e. if it should go into a chest, or be sorted), iterate through pickups above that plate and apply that action.

@ghost ghost assigned ylt Sep 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant