It seems like it was already almost doing what you wanted. Your edit made it do almost the opposite.
It was selecting the most damaged tool, not the tool with the least durability.
You will want to replace
`candidateStack.getItemDamage() > replacementStack.getItemDamage()`
with
`candidateStack.getMaxDamage() - candidateStack.getItemDamage() < replacementStack.getMaxDamage() - replacementStack.getItemDamage()`
Thanks for the answer. This did work for armor! But it did not work for tools on the toolbar, which leaves me dumbfounded. Any further ideas?
I would really appreciate having my lowest durability tools be used first rather than the highest ones. I downloaded the source code and looked deep into it, but I cannot seem to change this. I have tried altering line 124 of InvTweaksHandlerAutoRefill.java (changed the > operator to <) but that doesn´t do the job. After changing that, I saved and compiled using gradle as instructed, then replaced the mod .jar file at my .minecraft/mods folder.
Is there any part I got wrong? Does anyone have any idea how to achieve this?
Wow, I am impressed, I must say! Congratulations on your final project!
I won't actually use it, but I have some experience to share.
Some personal jibber jabber:
I am on the 3rd year of my Engineering graduation and have just last semester learned Digital Electronics. Had I known this project a few months ago (had it also existed) it would have made my life much easier!
Some 5 years ago, still at High School, I was really into redstone and ended up learning quite a bit about the subject, in the end having built by myself a 4 bit adder with a 7 segment display, all by hand (using nothing more than a mod that made XNOR gates into a single block). Thus, when I was lectured digital electronics I was already much ahead in knowledge than the rest of my class and still had difficulty learning HDL (we learned Verilog as well). I managed to do some coding but I never really got a solid grasp of the logic behind it, who's to say how much my colleagues suffered learning it.
Conclusion
My point is, as you said, HDL isn't quite like other programming languages, and Minecraft is a very powerful tool. I dream of a future in which it shall be a mainstream teaching method, and also in which your mod shall have a great impact on the life of engineers all over the globe. What a wonderful idea you had! I actually mentioned to my colleagues that digital circuits could be so easily taught with Minecraft, but I was thinking of gates and latches (which many people already find hard to understand). You took it a step further! Where did you get the inspiration? Were you suddenly struck by the idea on rainy afternoon?
I think you did an amazing work. I can't even begin to comprehend how one would code this as a mod. Kudos to you. I really hope it gets the recognition it deserves and doesn't get thrown into oblivion!
scoreboard players set <player> <objective> <score>
So the order of <player> and <objective> is incorrect in your command. Not only that, what is the [item = 1] supposed to do? From what I know, item is not a possible argument for a target selector, and there should be no space between the argument, the equal sign and the number (e.g. [x=27], not [x = 27]).
This was posted 1 year, 9 months, 11 days from today. The reported fact was a bug, but it has been fixed. I see you are new to the forum, so please take care when you post to see if the threads aren't old
Necro much? But it depends. I don't understand about computers, however as has been said above, you can make more complex programs with more RAM, though this gives you greater delays.
0
Thanks for the answer. This did work for armor! But it did not work for tools on the toolbar, which leaves me dumbfounded. Any further ideas?
0
I need some programming help.
I would really appreciate having my lowest durability tools be used first rather than the highest ones. I downloaded the source code and looked deep into it, but I cannot seem to change this. I have tried altering line 124 of InvTweaksHandlerAutoRefill.java (changed the > operator to <) but that doesn´t do the job. After changing that, I saved and compiled using gradle as instructed, then replaced the mod .jar file at my .minecraft/mods folder.
Is there any part I got wrong? Does anyone have any idea how to achieve this?
0
Wow, I am impressed, I must say! Congratulations on your final project!
I won't actually use it, but I have some experience to share.
Some personal jibber jabber:
I am on the 3rd year of my Engineering graduation and have just last semester learned Digital Electronics. Had I known this project a few months ago (had it also existed) it would have made my life much easier!
Some 5 years ago, still at High School, I was really into redstone and ended up learning quite a bit about the subject, in the end having built by myself a 4 bit adder with a 7 segment display, all by hand (using nothing more than a mod that made XNOR gates into a single block). Thus, when I was lectured digital electronics I was already much ahead in knowledge than the rest of my class and still had difficulty learning HDL (we learned Verilog as well). I managed to do some coding but I never really got a solid grasp of the logic behind it, who's to say how much my colleagues suffered learning it.
Conclusion
My point is, as you said, HDL isn't quite like other programming languages, and Minecraft is a very powerful tool. I dream of a future in which it shall be a mainstream teaching method, and also in which your mod shall have a great impact on the life of engineers all over the globe. What a wonderful idea you had! I actually mentioned to my colleagues that digital circuits could be so easily taught with Minecraft, but I was thinking of gates and latches (which many people already find hard to understand). You took it a step further! Where did you get the inspiration? Were you suddenly struck by the idea on rainy afternoon?
I think you did an amazing work. I can't even begin to comprehend how one would code this as a mod. Kudos to you. I really hope it gets the recognition it deserves and doesn't get thrown into oblivion!
0
So the order of <player> and <objective> is incorrect in your command. Not only that, what is the [item = 1] supposed to do? From what I know, item is not a possible argument for a target selector, and there should be no space between the argument, the equal sign and the number (e.g. [x=27], not [x = 27]).
If you want you can read on the wiki: http://www.minecraft...Block#Arguments
http://www.minecraft...mmand_reference
Edit: Ninja'd
But anyways, is stone an objective?
0
0
For example, you want to get the player rid of Smooth Sandstone (24:2):
Then, to give the new item, use the give command:
For example, you want him to have a diamond sword:
In both cases, to make sure the command affects a specified player, have it stand the closest to the command block.
0
0
What?? Didn't you read what anyone else said?!
Magix and Ralath0n pointed you in the right direction.
0
0
0
0
0
0
Read second post
2
.... but seriously... haven't you got any kind of proof?