Open Emirlol opened 4 weeks ago
It seems that this pr just continually adds to the list of carpets without checking if it was already in the list? The list should be changed to a set, (AVLTreeSet should be better in this case as this is look-up intensive.) Also set contains should be checked before calling
checkForCarpet
.
CARPET_LOCATIONS
is an ObjectArraySet
, so it already does the contains
check within its add
method.
As for using an AVLTreeSet
, sure, that's easy to change.
CARPET_LOCATIONS
is anObjectArraySet
, so it already does thecontains
check within itsadd
method. As for using anAVLTreeSet
, sure, that's easy to change.
Oh, sorry. I read it as ObjectArrayList
for some reason. Then my comment about AVLTreeSet
is not needed.
Oh, sorry. I read it as
ObjectArrayList
for some reason. Then my comment aboutAVLTreeSet
is not needed.
Oops too late xd
Oops too late xd
On the bright side, we can handle millions of carpets now...
I'm not sure how well an AVLTreeSet will handle iteration over millions of carpets per frame, though.
And I just noticed that light gray carpet is used for sneaky lighting in various places outside of tungsten ore veins. Idk what we should do for these false positives. It probably doesn't matter since they are indeed unbreakable carpets, but still.
Renders a colored box around nearby carpets within mithril ore veins in dwarven mines. It can be toggled on and off, and the color is configurable. Uses up about 0.30% of tick time for scanning & rendering while in dwarven mines. Didn't test outside but it should be much less, probably not even worth mentioning as it's just a boolean if check on each tick.