Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish the BlockData caching in Bukkit
- Loading branch information
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more efficient way to do it than converting it to a string? (or is that less expensive than one might immediately expect)
fdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Miclebrick Not unless Bukkit becomes a decent API
fdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does worldedit have constants for block state internal IDs? If so you could map it by internal ID instead of string
fdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worldedit doesn’t, no. Theoretically it could, I guess. I’ll see how slow this is, seeing as string hash lookups are ridiculously fast.
fdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more a question of how expensive
block.getAsString()
is I guessfdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s not a Bukkit method, it should be fairly fast - worst case I can easily cache that as it can never change as it’s immutable
fdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah just not sure how fast it is, it might be worth checking
fdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s literally some basic string concatenation so it should be very fast
fdb9d77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh 😛