ForTheCrown / FTC

ForTheCrown SMP's plugin code
https://www.forthecrown.net/docs/
3 stars 1 forks source link

Donator Armorstands #19

Closed ForTheWout closed 1 year ago

ForTheWout commented 1 year ago

The armorstands in Hazelguard that display recent donators are a bit shite. They work with command blocks. The webstore actually spawns a redstone block to activate them lol Whenever a player buys something in the webstore, a command is executed that destroys the oldest donator-armorstand (n.5 in picture below), moves the existing armorstands one spot (1->2, 2->3, 3->4, 4->5) and places a new one in the beginning (n.1) (kind of like a fixed size queue). Problem: When a player buys multiple packages at once (e.g. x3 player heads), this process is executed 3 times at once. Meaning it spawns 3 armorstands and tries to move the existing ones 3 times. But since it happens all at once, it fails miserably; it places them all at spot 1 and fails to move the others.

Image

Fix:

Can also use a script, whatever would be easier. The command should ideally be able to handle two different players buying something at the same time, but the odds of this happening are so small that it's not a huge problem if this isn't considered.

JulieWoolie commented 1 year ago

/scripts run donator_display/update.js args=<player name|UUID>,<color name>