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

add itemSaver setting. #2107

Merged
merged 2 commits into from
Feb 6, 2021
Merged

add itemSaver setting. #2107

merged 2 commits into from
Feb 6, 2021

Conversation

scorbett123
Copy link
Collaborator

@scorbett123 scorbett123 commented Oct 24, 2020

stops baritone using a item when it gets down to 1 durability.

fixes #997
closes #1354

Signed-off-by: scorbett123 <[email protected]>
@Heleilton
Copy link

Hello, can you explain to me how to install this?

(I don't speak English, so forgive me for the grammar )

@5HT2
Copy link
Contributor

5HT2 commented Oct 25, 2020

@Heleilton
Copy link

how to specifically install this "the top modification".
Reading "https://github.com/cabaletta/baritone/blob/master/SETUP.md" with the google translator does not help at all.
;-( .tears.

sorry i'm a big shit

@5HT2
Copy link
Contributor

5HT2 commented Oct 25, 2020

git clone https://github.com/scorbett123/baritone
cd baritone
git checkout toolSaver
./gradlew build

@Heleilton
Copy link

From what you said I did understand anything lol, I don't understand java, english, and this site.

But I was able to understand that as the modifications have to be done in the source, that is, I understood what should be changed and where it should be changed ("source" .zip), however, how I transform a .zip (source) file into .jar?

If I'm pissing you off, send me to hell. = (

@5HT2
Copy link
Contributor

5HT2 commented Oct 25, 2020

however, how I transform a .zip (source) file into .jar?

I told you how. Run these in a terminal

cd baritone
git checkout toolSaver
./gradlew build

@Heleilton
Copy link

Heleilton commented Oct 25, 2020

I understand. To do this, use the terminal? Is it on this site or is it a specific program?

I've never used google translators so much in my life lol.

Edit:Linux or Windows?

@5HT2
Copy link
Contributor

5HT2 commented Oct 25, 2020

A terminal on Linux. Use gradlew.bat build instead of ./gradlew build on Windows.

@Heleilton
Copy link

I'm doing it, but i have a question, the end result, will it be a mod forge or fabric? I'm using "https://github.com/cabaletta/baritone/releases> v1.6.1> Source code
(zip) "

@5HT2
Copy link
Contributor

5HT2 commented Oct 25, 2020

The Baritone repo is Forge by default.

@Heleilton
Copy link

Heleilton commented Oct 25, 2020

and on this walk, the source I took gave 3 errors

package net.minecraft.init does not exist
cannot find symbol class Vec3i
cannot find symbol class Vec3i

with the original files "settings;toolset" everything works, with the modified error

Copy link

@Heleilton Heleilton left a comment

Choose a reason for hiding this comment

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

failed
:compileApiJava
Settings.java
package net.minecraft.init does not exist
cannot find symbol class Vec3i
cannot find symbol class Vec3i #

////////////////////////
21:29:57: Executing task 'prepareRunClient'...

Task :buildSrc:compileJava UP-TO-DATE
Task :buildSrc:compileGroovy NO-SOURCE
Task :buildSrc:processResources NO-SOURCE
Task :buildSrc:classes UP-TO-DATE
Task :buildSrc:jar UP-TO-DATE
Task :buildSrc:assemble UP-TO-DATE
Task :buildSrc:compileTestJava NO-SOURCE
Task :buildSrc:compileTestGroovy NO-SOURCE
Task :buildSrc:processTestResources NO-SOURCE
Task :buildSrc:testClasses UP-TO-DATE
Task :buildSrc:test NO-SOURCE
Task :buildSrc:check UP-TO-DATE
Task :buildSrc:build UP-TO-DATE

Configure project :
New Dep: com.github.ImpactDevelopment:Vanilla:1.16.2_mapped_snapshot_20200813-1.16.1

Task :compileApiJava FAILED
C:\Users\helei\Desktop\1\src\api\java\baritone\api\Settings.java:24: error: package net.minecraft.init does not exist
import net.minecraft.init.Blocks;
^
C:\Users\helei\Desktop\1\src\api\java\baritone\api\Settings.java:26: error: cannot find symbol
import net.minecraft.util.math.Vec3i;
^
symbol: class Vec3i
location: package net.minecraft.util.math
C:\Users\helei\Desktop\1\src\api\java\baritone\api\Settings.java:808: error: cannot find symbol
public final Setting buildRepeat = new Setting<>(new Vec3i(0, 0, 0));
^
symbol: class Vec3i
location: class Settings
3 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileApiJava'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
1 actionable task: 1 executed
21:29:59: Task execution finished 'prepareRunClient'.
///////////////////////

@scorbett123
Copy link
Collaborator Author

The issue that you are having is that you are trying to use the 1.12 branch (master) and compile to 1.16. This unfortunately doesn't work, if you give me a minute I will compile a version for you.

@scorbett123
Copy link
Collaborator Author

scorbett123 commented Oct 26, 2020

Here you go, inside are all of the different jars.

toolsSaver (2).zip

@Heleilton
Copy link

Heleilton commented Oct 26, 2020

Good morning my friend, it opens(any of the versions within "toolsSaver (2).zip), however when entering a world, either solo, or on a server it crashes *

I believe I was not using the master, I was using >>>
https://github.com/cabaletta/baritone/releases/tag/v1.6.1

Crash report*:
crash-2020-10-26_07.55.27-client.txt

I try 1.16.1; 1.16.2; 1.16.3

@scorbett123
Copy link
Collaborator Author

yea, probably running into #2115.

@Heleilton
Copy link

Why does a single change cause so much trouble?

@5HT2
Copy link
Contributor

5HT2 commented Oct 27, 2020

It doesn't

@ZacSharp
Copy link
Collaborator

ZacSharp commented Oct 27, 2020

The forge build works just fine for me
Did a rebase onto 1.16.2 and some changes because of version differences
dist.zip

@Heleilton
Copy link

The forge build works just fine for me
Did a rebase onto 1.16.2 and some changes because of version differences
dist.zip

Man I love you from the bottom of my heart, your version worked!
Only yours! May the angels bless you kkk.

If you can, to satisfy my curiosity, tell me what you did, I would be even more grateful.

I was unable to compile, much less use what the young man above did.

Valeu negão, tu é o cara, muito obrigado.

@ZacSharp
Copy link
Collaborator

What I did (for Linux and likely also Mac):

  1. get the workspace set up
    • clone the repository of this pull request git clone https://github.com/scorbett123/baritone.git
    • change working directory to the new repository cd baritone
    • switch to the toolsSaver branch git checkout toolsSaver
  2. rebase onto newest 1.16.2
    • add the main baritone repository as a remote git remote add upstream https://github.com/cabaletta/baritone.git
    • get the branch info for upstream git fetch upstream
    • rebase onto 1.16.2 git rebase upstream/1.16.2
    • work through all the conflicts until the rebase is done
  3. fix the build by adjusting some names that changed between 1.12.2 and 1.16.2
  4. build forge distribution ./gradlew build -Pbaritone.forge_build
  5. do some testing to confirm it is working
  6. make a zip and upload it here

@ZacSharp
Copy link
Collaborator

@scorbett123 when testing this I noticed that it still breaks tools whenever they are in slot 0 and there is no other tool on the hotbar because it uses slot 0 as a fallback.

@ZacSharp ZacSharp mentioned this pull request Nov 1, 2020
2 tasks
@5HT2 5HT2 mentioned this pull request Nov 21, 2020
2 tasks
@randomairborne
Copy link

randomairborne commented Nov 22, 2020

I changed the getDamage thing, now it hates the l in value for some reason, which it did already but why it would hate the middle of a word is beyond me.

@randomairborne
Copy link

fixed, compiles but still breaks tools

@scorbett123
Copy link
Collaborator Author

The forge build works just fine for me
Did a rebase onto 1.16.2 and some changes because of version differences
dist.zip

Use this jar then. It works however is slightly outdated.

@recursivetree
Copy link

recursivetree commented Nov 22, 2020

I do not encounter the issue mentioned with slot 0. This pull request should be merged anyways, even if there is a small edgecase bug, because it provides a major advantage to baritone. I found my way here because I required a tool saver

@scorbett123
Copy link
Collaborator Author

@recursivetree The issue has been fixed in my latest commit.

@scorbett123
Copy link
Collaborator Author

closes #1354

@ZacSharp
Copy link
Collaborator

you need to edit that into the initial comment for github to actually link the issue

@Gorex-alt
Copy link

Hi, i was just wondering if this also works with the fabric 1.16.4 version of baritone. I'm new to all of this so following the conversation was quite hard. What I understood was that there was toolsaver for the forge version and that you needed to do something special to integrate it. Even after reading the article in the link mentionned above I could'nt make anything of it.

Can you help me?

@scorbett123
Copy link
Collaborator Author

You would have to build it for fabric, you would probably have to merge it into 1.16 yourself, make sure that you do it onto the 1.16 branch and run it as baritone.fabric_build.

@Gorex-alt
Copy link

Thank you for your fast reply but i have no clue on how to do it. Is there any chance you could do it for me or give me a tutorial?

@scorbett123
Copy link
Collaborator Author

Thank you for your fast reply but i have no clue on how to do it. Is there any chance you could do it for me or give me a tutorial?

I will just do it for you, it is easier for all of us. Give me a bit.

@scorbett123
Copy link
Collaborator Author

baritone-1.6.2.zip
Here you go, I haven't tested it so if it doesn't work just tell me. You will need to unzip this and place the version you want into your mods folder.

@Gorex-alt
Copy link

I have tested it for minecraft version 1.16.4 with golden shovels because of their low durability. out of 6 tests I experienced 1 gamecrash (probably due to my pc running autocad on the background). In all of the tests 3 out of 3 shovels were broken. Is there some commandline i have to enter in game before using to change a setting because i didn't know if i had to.

@scorbett123
Copy link
Collaborator Author

make sure to enable the itemSaver setting.

@Gorex-alt
Copy link

After toggeling the itemsaver setting to true the program still broke all 3 shovels. Is it possible that the program saves the tools when they are at 0 durability? If so is there a way to set a specific durability number at witch it saves the tool?

@scorbett123
Copy link
Collaborator Author

Unfortunately, I don't know what is causing you issue, unless there is some dramatic change from 1.12.2 to 1.16, however as you can see it has worked for others, there isn't a way to choose the health of it stopping using it, try it with another tool, but, yea idk.

@Gorex-alt
Copy link

Alright, anyways big thank you for the help, ur a real hero ;)

@scorbett123
Copy link
Collaborator Author

@leijurv Is there any reason you aren't merging this? It seems to be wanted.

@leijurv leijurv merged commit b32c9f1 into cabaletta:master Feb 6, 2021
@scorbett123
Copy link
Collaborator Author

Thanks

@leijurv
Copy link
Member

leijurv commented Feb 6, 2021

generally fine to ping me if i've missed something (e.g. if no one has raised any issues and it's been a week or two since the last update) :)

@PetyXbron
Copy link

Can I install the itemsaver for Forge 1.16.5?

I saw you posted here zip files with Baritone like dit.zip, toolsSaver.2, baritone-1.6.2 and more but these jar files doesn't worked for me, and some of them was for Fabric, so... not useful for me.
There is my process;

Downloaded the zip files for 1.16.1 and 1.16.2 and I wanted to try it on 1.16.5, so I installed them in my Forge mods folder and I tried commands like #itemsaver or #toolsaver, nothing worked.
Using baritone-api-1.6.1.jar crashed my game. I tried to create new world, but it didn't helped.
So I installed the first file from zip, the baritone-1.6.1.jar didn't worked too, game crashed after joining world/server.

Actually I wanted to install Impact client, but sadly Impact client isn't free for 1.16.5 yet. Let's try the free way without Impact.

I don't know how you are doing this, but can anyone give me the jar file with toolsaver/itemsaver for Forge 1.16.5 please?

Can I just use someway the baritone-api-forge-1.6.3.jar with itemsaver setting? Please?
It's really sad when you're breaking sand with Baritone and then your netherite shovel breaks with efficency IV and mending....

Im really confused, I don't know why Baritone doesn't add these settings officially for all users. They're soo many, so why don't add more? :D
Can anyone help me, or explain it please?

@scorbett123
Copy link
Collaborator Author

It has been merged, so download the latest 1.16 release, at the time out writing this is 1.6.3

@PetyXbron
Copy link

PetyXbron commented Apr 11, 2021

It has been merged, so download the latest 1.16 release, at the time out writing this is 1.6.3

Oh yeahh, cool. Github is a complex thing that I still need to learn to use.
So after the that merge, I will just easily download the latest 1.16.5 version and because it's 'merged' I will get the itemsaver/toolsaver setting in the new version, am I right @scorbett123?

@ZacSharp
Copy link
Collaborator

ZacSharp commented Apr 11, 2021

No, not really. The latest release obviously doesn't contain features newer than the release itself. And in addition it might take a while until a feature is actually ported to the newer mc versions, so the date check only reliably works for master (1.12.2).
In case that hasn't happened for this pr yet, have a look at this: #2107 (comment) (it is slightly outdated though and may break tools in the first hotbar slot)

Did you check it is released @scorbett123? I can't even find where it was merged upwards.

@ghost
Copy link

ghost commented Apr 11, 2021

The latest 1.16 release was on February 5th, this was merged the day after, the only other release after 1.6.3 was 1.2.15 which has this, but there are no 1.16 releases with this unfortunately

@scorbett123
Copy link
Collaborator Author

Wait, sorry just checked the merge date and assumed it was just before

@PetyXbron
Copy link

Bruh... :( so that's why I didn't found it in newest version...

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

Successfully merging this pull request may close these issues.

When pathing/tunneling/mining Don't break tools Item Saver Mode
9 participants