Skip to content

Performance issue #3

@ylt

Description

@ylt

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions