malte-laukoetter / Laborus

a customisable sponge job plugin
https://ore.spongepowered.org/Lergin/Laborus
MIT License
1 stars 3 forks source link

Add CraftItem to Possible actions #8

Open crymates opened 7 years ago

crymates commented 7 years ago

Pls make jobs like Blacksmith possible. Could u add CraftItem to possible actions pls?

malte-laukoetter commented 7 years ago

Sponge currently doesn't have a crafting event so i cannot really work with crafting, but as soon as the spongeapi supports it i will implement them :)

crymates commented 7 years ago

Is it possible to get the devs attention for it? Open an issue on github or so? :) But thx for ur quick answer mate.

malte-laukoetter commented 7 years ago

i just asked on the discord so i can be sure that i haven't overlooked something and will then create an issue if there isn't one already :)

crymates commented 7 years ago

Issue opened?

malte-laukoetter commented 7 years ago

No there is apparently a way to do it but i still need to test it

crymates commented 7 years ago

Same for Enhancing :)

malte-laukoetter commented 7 years ago

https://github.com/SpongePowered/SpongeAPI/issues/1515

crymates commented 7 years ago

Can we block that item's aren't craftable? So that there is no recipe e.g. in crafting table?

malte-laukoetter commented 7 years ago

That's the one thing that is already possible

malte-laukoetter commented 7 years ago

But i don't think i will implement that without the ability to award ep for such actions, for just the blocking of such actions i think another plugin like https://forums.spongepowered.org/t/stackban-v0-2-1-ban-a-variety-of-item-actions/14411

crymates commented 7 years ago

Understand ;)

AsylumDreams commented 7 years ago

Was that a no to implementing the stackban, or crafting as an option?

I'm assumming / hoping just the stackban :p

malte-laukoetter commented 7 years ago

Crafting is still planed and will also include the possibility to block the crafting of certain items, but I will only start implementing it after the issue I linked above is resolved

crymates commented 7 years ago

I think it's possible now. Look at this plugin which now added that item crafting can be blocked now.

https://github.com/Zerthick/ProtectionPerms/releases/tag/v0.6.0

malte-laukoetter commented 7 years ago

Yes that way it should be possible so i will implement it once i found some time for that :)

malte-laukoetter commented 7 years ago

I tested it a bit more and i am able to block the crafting of items but i can't award the crafting reliable without ways to cheat the system, so this still needs some changes in the sponge api :(

AsylumDreams commented 7 years ago

I feel this may come under ways to cheat the system but would not running a command on the instance of craft suffice for this?

Not fully sure what you'd be awarding. Job experience?

malte-laukoetter commented 7 years ago

The problem is that i cannot distinguish between a successful craft (eg. the item is collected from the crafting field) and the abortion of a crafting process (eg. one of the resources is removed from the crafting input) and i so cannot use any of the stuff of the jobsystem (like awarding job experience but also the boni). Due to this fact i also can't do anything with a command because there just isn't a way to be sure the item was crafted...

AsylumDreams commented 7 years ago

Ah. Well I have zero knowledge in the area but I believe there are ways to check where in an inventory is clicked. Does that transfer across to crafting windows? I assume they are read differently.

Approaching it a different way, could checks be run for items disappearing from the inventory alongside a new addition, specifying against item dropping / pick-up? So if 8 iron ingots are lost but an iron chestplate gained, it's an assumption that a craft was performed. Or is this how recipes are done and that's the issue as there just isn't that inventory management yet?

malte-laukoetter commented 7 years ago

The way i tested was the click event but the problem is that it is indistinguishable if a item was crafted or there was a change in the crafting field that has led to the items disappearing from the output slot so i can't be sure that the item was crafted. The way you're suggesting with the disappearing of 8 iron ingots also is way to error-prone and also too much work to do so i don't think that there currently is a way to do this in a way that works good enough so this will need to wait :(

AsylumDreams commented 7 years ago

Thought as much :v

On a potentially related note, have you considered allowing a job to dismantle or reverse craft? I imagine it would involve adding custom recipes limited by a root permission but may be of interest. Not that you don't have enough going on I'm sure :p

malte-laukoetter commented 7 years ago

That might be possible after these pull requests of the SpongeApi are resolved: https://github.com/SpongePowered/SpongeAPI/pull/1449 https://github.com/SpongePowered/SpongeAPI/pull/1419

Stratego89 commented 6 years ago

Was SpongeAPI ever updated to resolve those pull requests? Or rather, is it possible now to add in this- and the other suggested- actions? I did my best at following all of what those links lead to over time and it looks to me like SpongeAPI had the necessary improvements/additions made to it to do so, but I'm not a coder so I can't be sure. I'd really love to see Laborus get more actions added in (also the ore configurations page updated to reflect the fishing action and command boni you added in). Thanks for your time.