Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vaultsOnlyInTowns & maxTown/NationVaults configuration options #2

Merged
merged 4 commits into from
Oct 9, 2022

Conversation

GroobleDierne
Copy link
Contributor

@GroobleDierne GroobleDierne commented Oct 1, 2022

Port of nikosgram/gringotts#98

  • Option vaults_only_in_towns to force player to put nations and towns vaults in town claims, it can be any town. Defaults to false.

  • Options max_town_vaults & max_nation_vaults to limit the number of vaults per nations and towns. Defaults to -1 = no limit.

It keeps track of the number of vaults via the MetaData API of Towny which allows storing per town/nation variables.

@GroobleDierne
Copy link
Contributor Author

It's normally ready to be merged, let me know if something is wrong.
While I'm here, I have some other things to discuss with you 😉:
We can't access the maven packages of Gringotts because Github makes it private even if your repository is public, the workaround if found is to provide people with an access token that has read-only access to your maven packages (you can see what I did here) or you can host your packages for free on Jitpack.

Also, I noticed that Gringotts is causing the server to freeze when someone is trying to claim a chunk, according to the thread dumps it appends because Gringotts is trying to retrieve OfflinePlayers by their name which checks against Mojang if the account is valid. See below for the thread dump.
I wasn't able to test with the latest version of Gringotts because I needed this PR for my server, now that it's done I will try to see if this problem is still occurring and try to fix it in that case.

Thanks for your time 😄

[12:58:02] [Server thread/INFO]: Eomelius issued server command: /t claim
[12:58:12] [Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH  - git-Purpur-1708 (MC: 1.19) ---
[12:58:12] [Watchdog Thread/ERROR]: The server has not responded for 10 seconds! Creating thread dump
[12:58:12] [Watchdog Thread/ERROR]: ------------------------------
[12:58:12] [Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Purpur!):
[12:58:12] [Watchdog Thread/ERROR]: ------------------------------
[12:58:12] [Watchdog Thread/ERROR]: Current Thread: Server thread
[12:58:12] [Watchdog Thread/ERROR]: 	PID: 26 | Suspended: false | Native: false | State: TIMED_WAITING
[12:58:12] [Watchdog Thread/ERROR]: 	Stack:
[12:58:12] [Watchdog Thread/ERROR]: 		java.base@17.0.4/java.lang.Thread.sleep(Native Method)
[12:58:12] [Watchdog Thread/ERROR]: 		com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository.findProfilesByNames(YggdrasilGameProfileRepository.java:93)
[12:58:12] [Watchdog Thread/ERROR]: 		com.destroystokyo.paper.profile.PaperGameProfileRepository.findProfilesByNames(PaperGameProfileRepository.java:44)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.players.GameProfileCache.lookupGameProfile(GameProfileCache.java:110)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.players.GameProfileCache.get(GameProfileCache.java:181)
[12:58:12] [Watchdog Thread/ERROR]: 		org.bukkit.craftbukkit.v1_19_R1.CraftServer.getOfflinePlayer(CraftServer.java:1864)
[12:58:12] [Watchdog Thread/ERROR]: 		org.bukkit.Bukkit.getOfflinePlayer(Bukkit.java:1239)
[12:58:12] [Watchdog Thread/ERROR]: 		gringotts-2.12.3.jar//org.gestern.gringotts.api.impl.VaultConnector.getBalance(VaultConnector.java:102)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.object.economy.adapter.VaultEconomyAdapter.getBalance(VaultEconomyAdapter.java:33)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.TownyEconomyHandler.getBalance(TownyEconomyHandler.java:144)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.TownyEconomyHandler.hasEnough(TownyEconomyHandler.java:156)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.object.economy.Account.canPayFromHoldings(Account.java:199)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.object.economy.BankAccount.subtractMoney(BankAccount.java:92)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.object.economy.Account.withdraw(Account.java:91)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.command.TownCommand.parseTownClaimCommand(TownCommand.java:3703)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.command.TownCommand.parseTownCommand(TownCommand.java:751)
[12:58:12] [Watchdog Thread/ERROR]: 		towny-0.98.3.11.jar//com.palmergames.bukkit.towny.command.TownCommand.onCommand(TownCommand.java:561)
[12:58:12] [Watchdog Thread/ERROR]: 		org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[12:58:12] [Watchdog Thread/ERROR]: 		org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168)
[12:58:12] [Watchdog Thread/ERROR]: 		org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:940)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2459)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$19(ServerGamePacketListenerImpl.java:2230)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.network.PlayerConnection$$Lambda$12273/0x0000000802e95438.run(Unknown Source)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.TickTask.run(TickTask.java:18)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1385)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.d(MinecraftServer.java:183)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1362)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1355)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1333)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1218)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:307)
[12:58:12] [Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer$$Lambda$4436/0x000000080153fab8.run(Unknown Source)
[12:58:12] [Watchdog Thread/ERROR]: 		java.base@17.0.4/java.lang.Thread.run(Thread.java:833)

@GroobleDierne GroobleDierne marked this pull request as ready for review October 1, 2022 20:41
Copy link
Owner

@nikosgram nikosgram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants