rebelmythik / antivillagerlag Goto Github PK
View Code? Open in Web Editor NEWA way to remove the performance impact of trading halls without sacrificing other villager farms
License: GNU General Public License v3.0
A way to remove the performance impact of trading halls without sacrificing other villager farms
License: GNU General Public License v3.0
Describe the bug
A clear and concise description of what the bug is.
Nametag getting used during cooldown
Server Info
Server Version (Ex. 1.18.2):
1.18.2
Type of Server Software (Ex. Paper):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Nametag not being used
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
It would be great if this plugin could work automatically with workstation + radius without a player having to invoke the command.
Meaning it will check if a villager is close to a workstation and then automatically optimize.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A lot of my players like to have villagers wandering their town, because it give a little bit of life and activity to their towns, but it lags the server very badly to have unoptimized villagers.
Describe the solution you'd like
A clear and concise description of what you want to happen.
I was wondering if you could add an option to the configuration that disables all of the worst issues of the villager AI, but allows them to still wander around. Have an option to turn this off in the config too, if it ends up being the straw that breaks the camel's back in that it still causes lag for the server, but then if it doesn't cause lag, it could be enabled on a case by case basis for each server and their owner and players to decide.
Additional context
Add any other context or screenshots about the feature request here.
Thanks for your work on this issue. The plugin has really resolved a lot of issues with lag for many servers. You're brilliant, and wonderful.
Is your feature request related to a problem? Please describe.
I'm not a huge fan of always seeing optimize, the default name, over every villager's head. It would be a nice feature if you could add a tag instead, and have the same effect as giving a villager a specific name.
Describe the solution you'd like
Adding Tags to villagers is a little tedious, but via commands you can call /tag @e[type=villager] add noAI
Describe the bug
The Villager dosent refill and the nametags disaper when you use them.
Server Info
Paper 1.20.2
Type of Server Software (Ex. Paper):
Paper
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Is your feature request related to a problem? Please describe.
On our vanilla server, one of the complaints I've encountered when brining up this plugin is that players will be able to lobotomize villagers and use this to easily move them in their dumb state, which of course is not vanilla.
Describe the solution you'd like
I would like a configurable distance, where the origin point of a lobotomized villager is saved, and if it has deviated from that origin point by the distance configured it strips the nametag and reverts it to a vanilla villager with AI.
Additional context
Requiring standing on a certain block is an option, but not an ideal one as we're looking for easy conversion of existing halls and to make it easy for new players to come back and optimize later if they didn't know about it when they made their halls. We don't want to enforce use of this plugin, but encourage it and allow people who do use it to have halls that bypass our villager limit rules.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
a option
BlockThatDisables:
to have multiple block to disable the villager
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
Villagers can't re-roll when under Optimize, which is the entire point of the plugin I fully understand, but I have a small solution that might be neat to see configurable.
Describe the solution you'd like
Possibly a command such as /rollvillager or /roll or something similar, or a certain item you can use to immediately re-roll the villager and randomize its trades. This would be disable-able in the config for players who don't want it.
Additional context
My server uses a custom enchanting system that adds a ton of new enchantments to the game, so people use tons and tons of villagers to get them in a reasonable way. The process to get the villagers typically involves re-rolling librarians until they give the deal you want. This command might remove some of the work needed to get them, so maybe a configurable exp cost, or item cost to use the command, or something similar.
Is your feature request related to a problem? Please describe.
Players often do not want to lose their comfort for the sake of server performance, so let's make them
Describe the solution you'd like
Prevent trading with villagers without disabling AI for them
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Not knowing when the next cooldown is
Describe the solution you'd like
A clear and concise description of what you want to happen.
Chat message with time until next restock
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When players have villagers in pens if there is any kind of difficulty in pathfinding to a bed it causes high tick times. This is with 4 villagers.
Describe the solution you'd like
Disable villager sleeping.
This is just to keep track of features requested / worked on
Players can easily toggle all of their villagers within configured max radius or permission based
Not working code: https://paste.vanillaplus.net/roqajumota.java
Working SchedulerUtils code: https://paste.vanillaplus.net/geciravamu.java
Remember to set plugin in onenable
Is your feature request related to a problem? Please describe.
No.
Describe the solution you'd like
Numerous server plugin projects are starting to support Folia, as its growing popularity and performance-centric nature are intriguing to many operators. These operators are interested in migrating to Folia to enhance metrics like MSPT, TPS, and the overall player experience.
AntiVillagerLag serves as a fundamental tool for operators tackling these very issues - MSPT, TPS, and the general player experience. I believe there is a significant opportunity for positive synergy if Folia and AntiVillagerLag are used in tandem.
The requested solution/feature is to add explicit Folia support to AntiVillagerLag.
Is your feature request related to a problem? Please describe.
Title explains it well, prices never return to normal once a player has traded with a villager a lot causing prices to go up.
Describe the solution you'd like
The vanilla behavior of prices increases lowering after the villager has restocked their trades for the day.
Describe the bug
When I remove the plugin and restart the server, villagers still appear to have their AI disabled and won't restock.
Server Info
Server Version (Ex. 1.18.2): 1.20.1
Type of Server Software (Ex. Paper): Purpur
To Reproduce
Steps to reproduce the behavior:
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Make both name tags or block option toggleable
Describe the solution you'd like
A clear and concise description of what you want to happen.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Additional context
Add any other context or screenshots about the feature request here.
add a flag/label to not enable AI for Villagers not deactivated by AVL
fixes core issue of #8
maybe also add a disclaimer in plugin description about possible issues with NPC plugins
Is your feature request related to a problem? Please describe.
Nope, definitely not related to a problem :)
Describe the solution you'd like
I would love for the plugin to be a little more transparent. The way I imagine this is by sending the player that tries to trade a message in chat and also temporarily preventing them from trading with villagers that aren't named Optimize or whatever name you picked.
So in chronological order:
Player right clicks villager that isn't named Optimize
Trading is cancelled and instead they get a message that tells them "Please make sure to rename your villagers to 'Optimize' if you only use them for trading!"
Now you're granted a 1 minute (configurable duration) to trade with them without the message happening again
Player right clicks villager that is named Optimize
They can trade without any messages or cancels
What the config could look like for this
MessagingFeature:
enabled: false #Lets you toggle this feature in general and is false by default
message: "Please make sure to rename your villagers to 'Optimize' if you only use them for trading!"
cooldown: 60000 #in milliseconds
Server: 1.19.2
Software: Purpur #1784
The bug I'm getting is that villagers don't reset their trades. It happens a few weeks ago but since few of my users have this active, it was not noticeable.
Console error:
[18:36:55 ERROR]: Could not pass event PlayerInteractEntityEvent to AntiVillagerLag v2.1.1
java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 78
at java.lang.String.checkBoundsBeginEnd(String.java:4601) ~[?:?]
at java.lang.String.substring(String.java:2704) ~[?:?]
at rebelmythik.antivillagerlag.utils.VillagerUtilities.replaceText(VillagerUtilities.java:59) ~[AntiVillagerLag-2.1.1.jar:?]
at rebelmythik.antivillagerlag.events.RestockVillager.restockMessage(RestockVillager.java:35) ~[AntiVillagerLag-2.1.1.jar:?]
at rebelmythik.antivillagerlag.events.RestockVillager.call(RestockVillager.java:94) ~[AntiVillagerLag-2.1.1.jar:?]
at rebelmythik.antivillagerlag.events.EventListenerHandler.rightClick(EventListenerHandler.java:101) ~[AntiVillagerLag-2.1.1.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor56.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:git-Purpur-1784]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl$6.performInteraction(ServerGamePacketListenerImpl.java:3006) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl$6.a(ServerGamePacketListenerImpl.java:3063) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundInteractPacket$InteractionAction.dispatch(ServerboundInteractPacket.java:131) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundInteractPacket.dispatch(ServerboundInteractPacket.java:80) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleInteract(ServerGamePacketListenerImpl.java:2998) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundInteractPacket.handle(ServerboundInteractPacket.java:67) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundInteractPacket.handle(ServerboundInteractPacket.java:12) ~[?:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:51) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.19.2.jar:git-Purpur-1784]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1388) ~[purpur-1.19.2.jar:git-Purpur-1784]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[purpur-1.19.2.jar:git-Purpur-1784]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1365) ~[purpur-1.19.2.jar:git-Purpur-1784]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1358) ~[purpur-1.19.2.jar:git-Purpur-1784]
at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:114) ~[?:?]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1492) ~[purpur-1.19.2.jar:git-Purpur-1784]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[purpur-1.19.2.jar:git-Purpur-1784]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1784]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Describe the bug
When converting a (NoAI, Optimize) villager to a zombie and cure the villager Their (NoAI, Optimize) tag still exist but when using a name tag to rename them they doesn't turn back to normal
Server Info
Server Version: 1.19.2
Type of Server Software (Ex. Paper): Purpur (b1819)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
They regain their AI when nametag after converting back from zombie villager
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Server Info
Server Version 1.19.2 paper
allow the villager to be pushed by water and players, this would be very useful if players want to move the villager
Describe the bug
A clear and concise description of what the bug is.
Server Info
Server Version: 1.19
Type of Server Software: Paper
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect both changing the villagers names and changing what block is under them to change them to no AI.
Additional context
Here is my current config file:
NameThatDisables: stillager
# This needs to be a valid block ID to work.
BlockThatDisables: EMERALD_BLOCK
# Please do the time in ticks or it will break the plugin. There is 24,000 ticks in a single day.
# See https://minecraft.fandom.com/wiki/Daylight_cycle for more info
RestockTimes:
time1: 1000
time2: 5000
time3: 9000
time4: 13000
# This time is in seconds. This cooldown for renaming is to prevent possible abuse
# of people repeatedly disabling ai and re-enabling it to get double trades. I would keep this
# at the minimum time of 10 minutes or 600 seconds due anything less allowing for the double trades to happen.
cooldown: 600
# The maximum radius in blocks the /avloptimize command can search
RadiusLimit: 50
toggleableoptions:
# If set to true, nametags will be used instead of being infinite.
usenametags: false
# One of these following options needs to be true for the plugin to work.
# This will allow nametags to disable and renable the Villager AI.
userenaming: true
# This will allow a block to disable and renable the Villager AI.
useblocks: true
messages:
no-permission: '&cYou don''t have permission to use this command.'
reload-message: '&aPlugin successfully reloaded.'
cooldown-message: '&cYou can rename the villager again in %avlminutes% minutes and
%avlseconds% seconds.'
cooldown-block-message: '&cYou can toggle this villager''s AI again in %avlminutes%
minutes and %avlseconds% seconds.'
cooldown-levelup-message: '&cThe villager is currently leveling up! You can use
the villager again in %avlseconds% seconds.'
next-restock: '&cThe next restock for the villager will be in %avlrestockmin% minutes
and %avlrestocksec% seconds.'
correct-usage: '&cCorrect Usage is /avloptimize <radius>'
radius-limit: '&cThe radius you tried is to big. Radius limit is 50 blocks.'
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Additional context
Add any other context or screenshots about the feature request here.
Describe the bug
Restocks don't work on server version 1.20.4, the timer/cooldown stays at max time.
Server Info
Purpur 1.20.4
Type of Server Software (Ex. Paper):
To Reproduce
Title says it all
Expected behavior
Restocking works.
Screenshots
Additional context
closing inventory of a wandering trader results in the plug-in trying to cast it to a Villager, which results in a error.
Result:
ugly error in console but no other bad effects
Fix:
add a check if inventory belongs to a wandering trader before casting, or handle exception?
forgot to handle cooldown correctly, fix is coming
Describe the bug
Villagers aren't un-optimizing when you name them something else.
Server Info
Server Version (Ex. 1.18.2): 1.20.4
Type of Server Software (Ex. Paper):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Villager should regain its normal AI, including the ability to be re-infected.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
Currently re-enabling AI happens as a toggle due to the absence of a condition, e.g. renamed something other than configured name, standing on a block other than configured blocks.
Describe the solution you'd like
Add the ability to re-enable AI by naming a configured name or standing on a configured block.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Same effect of when a villager is named.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Additional context
Add any other context or screenshots about the feature request here.
Ai Not toggling properly.
most likely due to AVL tag
Describe the bug
We are starting to use this, and it works flawless, except, those Villagers considered as NPC with EliteMobs plugin. And since they use a unique name instead of the Disabled one, all goes randomly.
So instead of going deeper on API, enabling some worlds where the Villager IA can be enabled or disabled will be nice.
Server Info
1.19
Type of Server Software (Ex. Paper):
To Reproduce
Expected behavior
Only villagers from the main world should be have the behavior flag (on/off)
Screenshots
Dont have any right now.
Additional context
Nothing else
Describe the bug
I have no idea what triggered this event/error, it suddenly just showed up in our console.
Server Info
git-purpur-1726 (MC: 1.19)
Additional context
https://bin.bloom.host/ayanuguyem.css
Describe the bug
If you give the Villager a Job interact with him and then remove his job table he won't lose his job.
Server Info
Server Version (Ex. 1.18.2): 1.19.0
Type of Server Software (Ex. Paper): Paper Spigot
To Reproduce
Steps to reproduce the behavior:
Expected behavior
He should lose his Job and be an unoptimized villager again
Screenshots
https://cdn.discordapp.com/attachments/990400054193954839/1096920188609376336/2023-04-16_00-08-43.mp4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.