Rosewood-Development / RoseStacker

A next-generation stacker plugin for Spigot and Paper servers
Other
137 stars 35 forks source link

Villager Trade Stacking [Suggestion] #72

Open nicholasveronico opened 1 year ago

nicholasveronico commented 1 year ago

One of the worst entities to have an abundance of loaded with many players online is villagers. A large number of villagers loaded is normally caused by many loaded villager trading halls. Stacking villagers usually cannot fix this, as trades of individual villagers must be present. My proposed solution is villager trade stacking. The following explanation assumes that all of this is possible code-wise. If there's something that cannot be done, please let me know.

Option 1. Stacking Villagers and their trades based on the profession This option accounts for the texture of the villager being different due to different professions. If the villagers are stacked based on their profession, the texture of the villager is not a problem.

The idea is to stack villagers, and their trades will be added to the bottom of the list of the trades of the villager stack. For example, if Villager 1 has the following trades: 7 emeralds --> iron leggings, lava bucket -->1 emerald and villager 2 has the following trades: 5 emeralds --> bell, 1 diamond --> 1 emerald, stacking villager 2 with villager 1 will make the stack's trade menu be the following:

Unstacking the villagers will assign the corresponding trades to the unstacked villagers. The problematic aspect of this is how to handle villager curing (for discounts.)

To cure a villager, you must do the following:

  1. Turn the villager into a zombie villager by having a zombie kill the villager
  2. If the villager turns into a zombie villager, splash a weakness potion on the zombie villager and feed it a golden apple

Once the zombie villager turns back into a villager, the villager will give you discounts on the same trades it offered prior to zombification (if the trades have been locked in, i.e., the player has traded with the villager once.) My thought was if a zombie "kills" a villager from the stack, it will remove the bottom-most villager's trades from the stack GUI, and it will spawn a zombie villager (saving the trades of the villager that just died in this zombie villager.) Once the zombie villager turns back into a villager, it will queue that villager to be restacked, and their discounted trades will be added to the bottom of the villager stack.

Option 2. Stacking Villagers and their trades all in the same villager This option functions the same as the above, but the only issue I would see here is there being a problem with what texture the villager would have. Perhaps, it could have the texture of the villager on top of the stack, but that might be confusing to players. However, I would recommend disallowing the stacking of villagers with no profession if this option is enabled.

Please let me know what you think.

PukPukov commented 2 weeks ago

Or just lobotomize-villagers in purpur.yml