ericgrandt / TotalEconomy

All in one economy plugin for Minecraft.
https://ericgrandt.github.io/TotalEconomy/
31 stars 33 forks source link

Jobs not paying out #314

Closed Godlycreations closed 5 years ago

Godlycreations commented 5 years ago

Sponge Version: spongeforge-1.12.2-2768-7.1.4 Forge Version:
Total Economy Version: 1.8.1

Description of issue

I am using all of the default jobs that you have created and have made a few of my own to start combining what players get paid for as they advance in rank and job. However, farming is not paying out for breaking crops, and my explorer job is not collecting any money for breaking any of the crops. Farming was working when I first started using that job, but then stopped paying for wheat, then stopped paying for potatoes, and by the time I reached level 10 farming, it stopped paying out at all. I still collect the salary from each of the job, just no income for using the crops.

Console errors

No console errors are being reported when pick up crops. The only error that I have seen from total economy was when I forgot to use lumberjackset for the jobs. I have corrected that issue with a quick edit. No other console errors are showing up.

Steps to reproduce

Related Configuration Files

Create a Gist (https://gist.github.com/) for each configuration file related to this issue totaleconomy.txt jobs.txt jobsets.txt

Godlycreations commented 5 years ago

After looking at the accounts a little closer, i noticed that the jobs are not leveling up like they are supposed to. For instance, my farmer job is at 7252/5500 exp and I am at level 10. And my miner job is 5791/6600 exp and my job level is 11. I am not sure why the farmer job gained extra experience without going on to the next level, but it might be what is causing the issue I am facing.

Godlycreations commented 5 years ago

I am still playing with this issue and i have found that all plants that do not have the growthtrait attribute work, but the potatoes, wheat, carrots, and such still do not recognize the break

Godlycreations commented 5 years ago

Okay, as I continue to narrow the issue, i noted that after a period of time, it stops counting crops that are harvested in the same place. I went to another farm and started making money by picking the crops there, but when i went back to my farm, it stopped working again.

ericgrandt commented 5 years ago

Interesting. We'll look into this on our end to see what's going on. Thanks for the report.

On Fri, Nov 16, 2018, 1:32 PM Godlycreations <notifications@github.com wrote:

Okay, as I continue to narrow the issue, i noted that after a period of time, it stops counting crops that are harvested in the same place. I went to another farm and started making money by picking the crops there, but when i went back to my farm, it stopped working again.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Erigitic/TotalEconomy/issues/314#issuecomment-439502011, or mute the thread https://github.com/notifications/unsubscribe-auth/ADxeTaizgR-R7AEi6hHanear6nI4kUFpks5uvxKzgaJpZM4Yma3s .

MarkL4YG commented 5 years ago

Could you please elaborate on you setup specifications?

Godlycreations commented 5 years ago

I hope this message finds you well today and I want to thank you for getting back to me on this. Following is a list of mods that I have installed on the server so far. All of these mods are set up and running on the server now. Since my last message, I have made several more changes to the config of jobs and sets in TE and have been trying to get some of my other mods to work with it.

I have not found any difference when farming on claimed land or in random villages in the world, the effect is still the same. I get paid to harvest any age of each crop that has to grow, then after harvesting the area for a time, it stops paying out. So then I have to move onto another area to start getting paid again. I broke the jobs sets apart to see where the issues lie, the only place that I am seeing the problem is with the crops in the plants job set. As for your question on population, there are currently only six players on this server and only four of the players have set a home so far. Of these players, I am the only player that has progressed through all jobs and I am trying to make sure that everything is ready for them as they start progressing through. All four homes have been set in the basic wilderness, /rtp takes players 2,000 to 30,000 blocks away from the spawn area, which is the only area that is set up with protection with an admin claim.

Changing the job sets and jobs did correct the issue with the jobs not leveling correctly. As soon as I changed the farmer job set to gathering and picked my first mushroom, my job level went from 9 to 13. The gathering and plants job sets were put together one item at a time and tested. So the issues are now isolated in the plants job sets for you. Any idea as to why all the plants that require growth are paying out before the plant matures to age 7? I think that might have something to do with the problem.

The other issue that I have, is that I cannot add any of the creatures or items from the MoCreaures or JurassicCraft mods. I was going to make a hunter job with all the new animals from MoCreatures and an archeologist job for digging up fossils any such. But for some reason, TE does not recognize the addition of new logs into the lumberjack job.

I hope that this helps you determine what the issue is and narrow down the debugging for you. I am a former programmer myself and know how much of a pain it can be to find little things like that. So if there is anything else you need to know from me, please let me know. I look forward to hearing back from you again soon.

In your service,

Friend_Of_God

CustomMobSpawner-3.11.4

DrZharks MoCreatures Mod-12.0.5

FastAsyncWorldEdit-sponge112-18.11.08-ba06684-1230-21.5.17

GWMCrates 3.1.13

GWMLibrary 1.3.4

JurassiCraft-1.12.2-2.1.18

LuckPerms-Sponge-4.3.25

Nucleus-1.6.3-S7.1-MC1.12.2-plugin

RankUpper-4.0.2-b14-Universal

TotalEconomy-1.8.1

Vault-1.6.7

griefprevention-1.12.2-4.3.0.662

holograms-3.1.5

journeymap-1.12.2-5.5.2

llibrary-1.7.15-1.12.2

spongeforge-1.12.2-2768-7.1.4

These are the jobs that I have set up:

jobs {

unemployed {

    salary=0

}

lumberjack {

    require {

        job=""

        level=0

        permission="totaleconomy.job.lumberjack"

    }

    salary=5

    sets=[

        lumberjackSet

    ]

}

farmer {

    require {

        job="lumberjack"

        level=10

        permission="totaleconomy.job.farmer"

    }

    salary=5

    sets=[

        plants

    ]

}

warrior {

    require {

        job="farmer"

        level=10

        permission="totaleconomy.job.warrior"

    }

    salary=5

    sets=[

        mobs

    ]

}

miner {

    require {

        job="warrior"

        level=10

        permission="totaleconomy.job.miner"

    }

    salary=5

    sets=[

        ores

    ]

}

fisherman {

    require {

        job="miner"

        level=10

        permission="totaleconomy.job.fisherman"

    }

    salary=5

    sets=[

        fish

    ]

}

explorer {

    require {

        job="fisherman"

        level=10

        permission="totaleconomy.job.explorer"

    }

    salary=7

    sets=[

        gathering,

        lumberjackSet,

        plants,

    ]

}

disciple {

    require {

        job="explorer"

        level=10

        permission="totaleconomy.job.disciple"

    }

    salary=9

    sets=[

        gathering,

        lumberjackSet,

        plants,

        fish,

        ores

    ]

}

apostle {

    require {

        job="disciple"

        level=10

        permission="totaleconomy.job.apostle"

    }

    salary=11

    sets=[

        gathering,

        lumberjackSet,

        plants,

        fish,

        ores,

        mobs

    ]

}

}

salarydelay=3600

And the following is the job sets I am using now with the farming:

plants {

    break {

        "minecraft:beetroots" {

            exp="15"

            growthTrait=age

            money="3.75"

        }

        "minecraft:carrots" {

            exp="15"

            growthTrait=age

            money="3.75"

        }

        "minecraft:cocoa" {

            exp="15"

            growthTrait=age

            money="3.75"

        }

        "minecraft:nether_wart" {

            exp="15"

            growthTrait=age

            money="3.75"

        }

        "minecraft:potatoes" {

            exp="15"

            growthTrait=age

            money="3.75"

        }

        "minecraft:wheat" {

            exp="15"

            growthTrait=age

            money="3.75"

        }

   }

}

gathering {

    break {

        "minecraft:brown_mushroom" {

            exp="7"

            money="1.75"

        }

        "minecraft:cactus" {

            exp="7"

            money="1.75"

        }

        "minecraft:pumpkin" {

            exp="35"

            money="4.75"

        }

        "minecraft:red_flower" {

            exp="7"

            money="2.75"

        }

        "minecraft:red_mushroom" {

            exp="7"

            money="1.75"

        }

        "minecraft:reeds" {

            exp="7"

           money="1.75"

        }

        "minecraft:yellow_flower" {

            exp="7"

            money="2.75"

        }

    }

    place {

        "minecraft:sapling" {

            exp="7"

            money="0.50"

        }

        "minecraft:red_flower" {

            exp="2"

            money="0.50"

        }

        "minecraft:yellow_flower" {

            exp="2"

            money="0.50"

        }

  }

}

Here is the lumberjack job set with the addition of two types of logs from JurassiCraft:

lumberjackSet {

    break {

        "minecraft:log" {

            exp="10"

            money="1.00"

        }

        "minecraft:log2" {

            exp="10"

            money="1.00"

        }

        "jurassicraft:ginkgo_log" {

            exp="10"

            money="1.00"

        }

        " jurassicraft:calamites_log " {

            exp="10"

            money="1.00"

        }

    }

    place {

        "minecraft:sapling" {

            exp="20"

            money="2.50"

        }

        "jurassicraft:ginkgo_sapling" {

            exp="20"

            money="2.50"

        }

        "jurassicraft:calamites_sapling" {

            exp="20"

            money="2.50"

        }

    }

}

From: Magnus Leßmann (aka. mark332) notifications@github.com Sent: Monday, November 19, 2018 11:45 To: Erigitic/TotalEconomy TotalEconomy@noreply.github.com Cc: Godlycreations accounts@godlycreations.com; Author author@noreply.github.com Subject: Re: [Erigitic/TotalEconomy] Jobs not paying out (#314)

Could you please elaborate on you setup specifications?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Erigitic/TotalEconomy/issues/314#issuecomment-439960386 , or mute the thread https://github.com/notifications/unsubscribe-auth/ArAx11DX2VGkzKYDHEtCy7aYnParGJHPks5uwuAggaJpZM4Yma3s . https://github.com/notifications/beacon/ArAx1zrISTaIuNxO29xkpNfj6YhG3Ahwks5uwuAggaJpZM4Yma3s.gif

MarkL4YG commented 5 years ago

Glad to hear that you've made progress in narrowing down the issue.
I will try to answer your questions as good as I can without further testing as I only have time later in the week.


Any idea as to why all the plants that require growth are paying out before the plant matures to age 7?

Yes, that's actually a wanted feature. We retrieve the trait which is responsible for tracking the growth progress and then payout a percentage of that growth. So basically a half-grown wheat will pay out 50% of the reward that has been configured.
This is so we can provide rewards for user-placed crops without creating an exploit where placing and immediately breaking the block provides you with the full reward.


But for some reason, TE does not recognize the addition of new logs into the lumberjack job.

TotalEconomy should work perfectly fine with blocks from mods when the IDs are properly added to the respective job sets. Make sure to enter to fully qualified id of the blocks.
If any mod adds blocks of different kind under the same ID, TE provides the possibility to additionally check a trait in order to define the rewards for it.
As you have re-attached your config files, I may take the time to check if I spot any issues in the configuration. Though I can't say when that will be.


then after harvesting the area for a time, it stops paying out

That actually sounds more like the exploit prevention kicking in, preventing you from earning rewards from blocks that have been placed by yourself.
Normally, the only exemption from this rule are blocks that have a growthTrait defined.
Please check if #306 applies to your case.


Please check the things I've mentioned and report back if that resolved your issue.

Godlycreations commented 5 years ago

Thank you for your reply, I do not see the price reduction with crops of lower ages. It does not matter if I am in a claim or in a random village, I get full price for picking any crop. I tried changing the growthTrait to growth-trait as suggested in post 306 and that gives 0 money and 0 exp.

As for the items that I am referencing from one of the other mods, below are two of the items as described in the advanced tool tips in the game as well as in the stats. There are no variants to these two items and so I did not create any variants for them. Is there something that I am missing?

"jurassicraft:ginkgo_log" { exp="10" money="1.00" } " jurassicraft:calamites_log " { exp="10" money="1.00" }

As for the exploit prevention, I went to a new random village that has not been touched before and harvested all the crops and replanted them. I was paid for each crop that was harvested. After the initial replant, I was not able to get paid for breaking any of the newly planted crops, which is how it should be. I used bone meal on one full planter and did not get paid for any of the crops that were grown with the bone meal, that is acceptable as well. On the second planter, I harvested only the crops that naturally grew to age 7 without getting paid or exp from those. Then I set up 8 individual rows and harvested each at 10 minutes, 20 minutes, 30 minutes, 40 minutes, 50 minutes, 1 hour, 1.5 hours, and 2 hours. There have been no payouts or exp for any of those trials either. At this point it appears that the only time the job pays out, is when the crop has not been touched by a player. I am still running some more timed tests, but I am not expecting any additional results at this point. This issue also appears to be true of sugar cane that was planted by me. When I harvested untouched sugar cane, I got paid and exp, but after planting my own at this test village, no payments or exp are given in those same time frames. All of these tests have been run with my character present in the chunk and active throughout the time frames listed above. I hope this information helps you figure out where the problem is at. I love your mod and how easy it is to set up and use. If there are any other tests or information that I can provide for you, please let me know.

MarkL4YG commented 5 years ago

hmm 🤔 It seems I have to reproduce this in a debugging setup. Could you please attach an archive of your mods, plugins and configurations so I can make sure that I do not set things up differently?

Godlycreations commented 5 years ago

How do I create an archive of these things? Are you just looking for a zip file of these files, or a list of them?

MarkL4YG commented 5 years ago

@Godlycreations just a zip file will do.

Godlycreations commented 5 years ago

Here they are, the only issue is that the mods are too big to upload here. I will put together a list of them for you.

config.zip luckperms.zip

Godlycreations commented 5 years ago

Here is the list of all mods on the server.

list of mods on the server

DaRcCrysys commented 5 years ago

Good afternoon folks! So I ran into this same 'bug' today and have tried to do some extensive testing to see if I could further shed light on anything and came up with the following... although some of it already pointed out, just to note its repeatable.

  1. The only jobs that seem effected are 'breaking' based jobs such as miner, lumberjack and farmer. Fisherman, warrior do not seem to be effected as far as I can tell.
  2. This issue only seems to occur with 'player' placed objects. (i.e. player grown trees, player planted crops, player placed ores). Even moving to new areas, the player placed objects were still effected, but naturally spawned sprites did not seem to be effected (I haven't been able to make a determination if villager re-planed crops were effected... I have a bad habit of murdering them when I move into a new area).
  3. This issue was reproduced across both my product and development instances
  4. I haven't noticed an XP x/y issue where X > Y (i.e. 1300 / 900)
  5. I reloaded a default UNedited copy of the jobsets.conf and jobs.conf
  6. This issue carries across /job reload and a reloaded service instance (/stop and manual load of the instance).
  7. There are no on screen errors, log errors or console errors (this includes no skipped ticks, no info/warning/critical)

Installed: ===Server Core=== Minecraft: 1.12.2 SpongeAPI: 7.1.0-70763aa8 Sponge: 1.12.2-7.1.4 SpongeForge: 1.12.2-2768-7.1.4 Minecraft Forge: 14.23.5.2768

===Plugins=== BuyCraftX LuckPerms-Sponge-4.3.38 Nucleus-1.6.3-57.1-MC1.12.2-plugin TotalEconomy-1.8.1 UniverseGuard-2.17 worledit-sponge-6.1.9-SNAPSHOT-dist

===Mods=== BetterFPS-1.4.8 FastLeafDecay-v14

ericgrandt commented 5 years ago

@DaRcCrysys Thanks for providing us with all of this detailed information. This will help out a ton!

DaRcCrysys commented 5 years ago

@DaRcCrysys Thanks for providing us with all of this detailed information. This will help out a ton!

No problem, we really like the fact that this isn't just a "money" style economy mod, the jobs are really neat, especially since we can mix and match, redesign them etc, the concept is solid and the foundation for future expansion is there! Please let us know if there is anything we can provide/do to further test for other issues, run test builds/patches. I am the lead IT Admin on our team so I am usually around and can provide as much time as needed to help out :). Thanks for taking the time to read through the messages/logs people are sending in and continuing to provide a quality product to servers and packs. Keep up the great work!

Godlycreations commented 5 years ago

I agree with DaRcCrysys’ comments. I am the admin for our server as well, and I am also willing to help with any type of testing on our server. We are a small community at the moment since we are still in the launching phase of this server. Thank you for this economic mod and we see how much this mod can grow. We look forward to continuing to work with you on this, to make it the only mod that servers want to use.

In your service, Godlycreations

MarkL4YG commented 5 years ago

I am really hoping I can reproduce this on thursday. Sadly, I currently lack the time as I'm struggling my way through a paper I have to submit for university ...
Good news is that I'm not planning to go on vacation so I'll have spare time over the holidays.

DaRcCrysys commented 5 years ago

I am really hoping I can reproduce this on thursday. Sadly, I currently lack the time as I'm struggling my way through a paper I have to submit for university ... Good news is that I'm not planning to go on vacation so I'll have spare time over the holidays.

I was actually just talking to our owner about five mins ago noting that I was going to check in to see if there was any news lol, I think your ears were burning! So far, still only the above issues were happening so nothing new to fix :). Good luck with your paper!

Godlycreations commented 5 years ago

I am really hoping I can reproduce this on thursday. Sadly, I currently lack the time as I'm struggling my way through a paper I have to submit for university ... Good news is that I'm not planning to go on vacation so I'll have spare time over the holidays.

I was actually just talking to our owner about five mins ago noting that I was going to check in to see if there was any news lol, I think your ears were burning! So far, still only the above issues were happening so nothing new to fix :). Good luck with your paper!

I have not encountered any other new issues on this end. If there is anything else that we can do to help you, please feel free to ask.

MarkL4YG commented 5 years ago

Hey there, I've now had some time to take a look into this.
Using develop I was able to reproduce rewards always paying out 0 money and exp.
I was able to track down the issue to a line in TEAction.java where a sort of typo is responsible for the issue.
I'll be submitting a fix in a minute.

DaRcCrysys commented 5 years ago

Hey there, I've now had some time to take a look into this. Using develop I was able to reproduce rewards always paying out 0 money and exp. I was able to track down the issue to a line in TEAction.java where a sort of typo is responsible for the issue. I'll be submitting a fix in a minute.

I have to ask the stupid question... I've been browsing around in a very quick manner, looking for the updated jar file. Has it already been posted on the Sponge page etc?

MarkL4YG commented 5 years ago

Hehe ^^
I'm afraid, no. As TotalEconomy is open source software, I was able to submit a pull request with the changes for @Erigitic to review the changes. GitHub has automatically added a reference above your last comment.

Once Eric has approved and merged the changes they are a part of TE. Then, when the next release is built they are included.

If you want to try out the changes ahead of time you've got two options: Ask for a preview build or build one yourself using gradle and a local clone of the respective repository :)

Godlycreations commented 5 years ago

Where can I get a preview build for this? I have been looking for an updated release and have not found one yet.

MarkL4YG commented 5 years ago

You should be able to clone the repository (e.g. downloading the zip archive) and run gradlew.bat build in the project directory.

You'll find the plugin jar below build/libs.
Otherwise, you may message me on Gitter and I'll pass you a jarfile for testing purposes tomorrow.

Godlycreations commented 5 years ago

It took me a bit longer than that, but I managed to figure out how to get Git and Gradle installed and was able to build it from there. I have been testing the mod since then and my players are happy that the farming job is working well now. I am still having problems with the resources from other mods being added into it, but we can live with what we have so far. Thank you all for this great mod.

MarkL4YG commented 5 years ago

@Godlycreations Glad to hear that fix will be working for you!
Can you please describe what your issue is regarding modded blocks? Those should work just as vanilla blocks as long as they're added to the job sets correctly. (Unless the mod author does weird stuff o.c.)

Godlycreations commented 5 years ago

The issue is that in order to get the new logs from the jurassicraft mod, we need to create the saplings in game and then grow them from the sapling. These tress do not spawn naturally in the world. Which means that the totaleconomy mod ignores trees, melon blocks, pumpkins, and sugar cane that is grown by players. So cutting down these trees does not pay out or give exp to players. Melons, pumpkins, and sugar cane that was spawned in the world at creation does pay out as expected. As for the modded blocks that do not get tracked, I have attempted to create a paleontologist job that pays out for digging up fossils in the world. These fossils and gyspum stone are spawned in naturally throughout the world. The gypsum stone works just fine and pays out. the fossils on the other hand have variants that are not getting tracked. meaning that if I use "/give jurassicraft:encased_fossil_0 1 2" I get 1 variant 2 of the encased fossil, it I use "/give jurassicraft:encased_fossil_0 1 4" I get 1 of variant 4 of the encased fossil. But I cannot get the TotalEconomy mod to track these blocks for the jobs. I hope that helps you understand the issues better, if not, please ask and I am happy to give you more if you need it.

MarkL4YG commented 5 years ago

As for the tree issue: That bug is being tracked by us. We just need to find a way to know whether or not to pay the player.
The thing is that simply disabling the exploit prevention would mean a player could place and break the same block over and over getting paid each time the block is broken or placed...

Variants however, are supported by TotalEconomy as they are tracked as "blockTraits" which you can use in the job set configuration to distinguish block with the same ID.