Rocologo / BagOfGold

Economy plugin for Minecraft Servers
13 stars 6 forks source link

How could I make CMI`s money to be BagOfGold? #145

Closed MuYuehe closed 1 year ago

MuYuehe commented 1 year ago

sorry, I cant found a way to do this.

Rocologo commented 1 year ago

I dont know CMI that well. But since CMI uses Vault and CMI is not an economy plugin, it should work out of the box.

Install both plugins. Enable debug mode using "/Bag debug" and check the debug information in the server console, when you start your server.

Rocologo commented 1 year ago

Ohh I just saw this

image

This means that CMI can act as a economy plugin like Bagofgold and you cant have two. So if you want to use Bagofgold, you will have to disable CMI economy. Like if you were using any other economy plugin.

Rocologo commented 1 year ago

So you should NOT use the recompiled VAULT and NOT use the injector.

MuYuehe commented 1 year ago

ok, I will try later. by the way, I found that CustomItemsLib integrates CMI. I don't know what it does

Rocologo commented 1 year ago

CustomItemsLIb is my Library using some of the features in CMI. Like the Hologram and its message system.

MuYuehe commented 1 year ago

I close the CMI eco and use back vault not recompiled. but I cant pick this bagofgold. image

Rocologo commented 1 year ago

enable debug mode and check the server console, when you walk into the bag

Rocologo commented 1 year ago

What is that number [04:43] maybe this is your problem?

It must be a plugin which I have never tried.

MuYuehe commented 1 year ago

There is no output on the console. That [04:43] is used to display the time when the drop disappears. It should not be caused by it. use-bagofgold-as-an-economy-plugin: true Do i need to set this to false?

Rocologo commented 1 year ago

If there is no output something must be wrong with the start up. Please check the debug information. Or try to show me your serverlog using pastebin.com

MuYuehe commented 1 year ago

https://pastebin.com/6McfAtGB

image This is what I ran on a test server, I only loaded 4 plugins: BagOfGod, CustomItemLib, ProtocolLib and Vault.

Rocologo commented 1 year ago

These lines are not normal

1. [21:41:29] [Server thread/INFO]: [BagOfGold][Debug] onInventoryCloseEvent: Adjusting Player Balance to Amount of BagOfGold in Inventory: PlayerBalance: {player: Name:valuuntu, WorldGrp:default, GameMode:SURVIVAL, Balance: 0.0(+0.0), BankBalance: 0.0(+0.0)} 2. [21:41:29] [Server thread/INFO]: [BagOfGold][Debug] there was no difference

This means that another plugin is calling the InventoryCloseEvent all the time.

You will need to find this plugin.

But it also means that Bagofgold is loaded and you should be able to pick up bags

Try to drop a fresh new bag and see if you can pick it up. Check the console for messages

/bag money drop 10

Sendt fra Samsung Galaxy S10+

-------- Oprindelig besked -------- Fra: MuYuehe @.> Dato: 14.08.2023 15.46 (GMT+01:00) Til: Rocologo/BagOfGold @.> Cc: Rocologo @.>, Comment @.> Emne: Re: [Rocologo/BagOfGold] How could I make CMI`s money to be BagOfGold? (Issue #145)

https://pastebin.com/6McfAtGB

— Reply to this email directly, view it on GitHubhttps://github.com/Rocologo/BagOfGold/issues/145#issuecomment-1677347902, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHWEBLMPKGT4BC4VD5Z7ILXVIT4DANCNFSM6AAAAAA3PT6Q2Y. You are receiving this because you commented.Message ID: @.***>

MuYuehe commented 1 year ago

image

But I seem to find the plugin that triggers the . UltraSetHome But it's just a home management plugin

Rocologo commented 1 year ago

1) it's probably the plugin which adds some numbers to the bag name. This causes the bag not to be recognized as a bagofgold. I have not seen this before so I think this is the problem.

2) maybe this can be fixed if you know which plugin adds the number. But I can fix this today or tomorrow.

The home management plugin should not call InventoryCloseEvent that often. Only when needed. This could cause lag for all other plugin which uses this event.

MuYuehe commented 1 year ago

Sorry, it was too late for me yesterday. This is a test I did today with a completely new server. As you can see on the picture, there are only these few plugins. However onInventoryCloseEvent is still fired because I open the backpack Then turn it off. So I don't think it has something to do with other plugins. image and when I using /bag money drop [player] <amount>, the console output : [BagOfGold] mTranslationTable has not key: bagofgold.moneydrop [BagOfGold] BagOfGold could not find key: bagofgold.moneydrop

MuYuehe commented 1 year ago

Looks like using essentialsX is the best way. Maybe I can ditch CMI, after all my server is still in development for now.

by the way: The Deposit Everything action will get a player's head. image

Rocologo commented 1 year ago

I still dont understand why you cant pick up the bags. Thats VERY strange. Are you building SpigotMC using Buildtools? or how do you get your server jar file?

Rocologo commented 1 year ago

I have made a "clean" server install many time to check if everything works.

Rocologo commented 1 year ago

One thing you could test is to remove ProtocolLib.jar and then start your server. If you the give yourself a bag using "/bag money give playername 100" and point at the bag in the inventory, this should show you some "hidden" lores, which is used to identify the bag. Take a screenshot of the Lores so I can see if the look as expected.

MuYuehe commented 1 year ago

Ok, I will try a new server start again, my server packages and plugins are downloaded from the official website. I only use three packages: BagOfGold, Vault and CustomItemsLib, and I will not modify any other values. I will record a video and send you the server console output.

MuYuehe commented 1 year ago

https://pastebin.com/uiuJh16K http://alist.muyuehe.top/ image

Rocologo commented 1 year ago

Ohhh I just saw the message about that you have no Permission and the I realized that you dont have a Permission plugin.

You will need to add a Permission plugin. I use PermissionEx : https://www.spigotmc.org/resources/permissionsex.108323/

But you can use anyone which is compliant with Vault. My guess is that this is your core problem. I have NEVER tested my plugins without a Permission plugin :-)

Rocologo commented 1 year ago

And you will need to setup Permissions for all your plugins.

MuYuehe commented 1 year ago

I started the server again and set myself as OP. OP has all permissions, but still can't pick it up.

Rocologo commented 1 year ago

Like I said I have never tested my plugins without a Permission plugin :-)

You will need a permission plugin anyway before you let other people into your server. It would be crazy to do thatr without a Permission plugin.

Rocologo commented 1 year ago

And by the the way: OP only have the permissions that the plugin-developer gives the OP player. You cant be sure this system works its not meant to be used on servers with public access

Rocologo commented 1 year ago

I will of cause see if this can be fixed, but it will take some time to do the development and testing.

MuYuehe commented 1 year ago

Yes, I agree with you. Actually, I have switched CMI to EssentialsX on my production server, and it works fine with BagOfGold now. For me, I have OCD in some aspects, When I find a good plug-in, I will start to build around it. The BagOfGold plug-in is very clever in terms of economic construction. I like your approach very much. Although CMI also wants to give good plug-ins, but I still discarded it. Overall, thank you very much for this plugin and for your patient reply. But allow me to ask one last question: I don't know how compatible BagOfGold is with Shopkeepers, but I see testing is in progress and I'm using Shopkeepers at the same time. Here is the error I get when I use it: https://pastebin.com/3AfVpFEC It happened when I put the bag of gold in the price column of shopkeepers. I don't know if this error belongs to BagOfGold

Rocologo commented 1 year ago

1) You should be able to use CMI together with BagOfGold. I have tested this many times. At least with CMI Holograms and messages. 2) BagOfGold should work with Shopkeepers, but this is one of the newer featues and it seems that you have found a bug. :-( Are you able to explain (in details) what I should to do reproduce this error? If you can explain this I can fix the bug. It looks like you are clicking on an empty slot or something? How does the inventory (The shop) look like?

MuYuehe commented 1 year ago

This error occurs when I open the shopkeepers gui, click on the bag of gold and put it in the slot. CMI doesn't work well with EssentialsX

Rocologo commented 1 year ago

Do you open the Shopkeeper GUI to edit the content or as a player how wants to buy/sell/trade?

MuYuehe commented 1 year ago

Oh, sorry, I forgot that there are two guis, it happened when I opened the edit Gui

Rocologo commented 1 year ago

Yes, thats why I asked for details :-D

Rocologo commented 1 year ago

CMI doesn't work well with EssentialsX

Okay. It have of cause not tested all combinations. This is an extremely big job.

MuYuehe commented 1 year ago

CMI doesn't work well with EssentialsX

Okay. It have of cause not tested all combinations. This is an extremely big job.

Yes, plugins that provide core functions like these are difficult to use together, and it is a very large workload for those who maintain them to be compatible

Rocologo commented 1 year ago

Exactly. Most of the new bugs which is found are because another developer has changed something in his plugin, which affects mine.