Compare commits

..

38 Commits

Author SHA1 Message Date
Leijurv
24e047c12e v1.8.4 2023-02-18 15:41:19 -08:00
leijurv
5841bd4e36 Merge pull request #3825 from ZacSharp/1.18.2-update
Merge 1.17.1 into 1.18.2
2023-02-12 12:47:28 -08:00
ZacSharp
81e9865067 Merge branch '1.17.1' into 1.18.2 2023-02-04 01:05:31 +01:00
Leijurv
54f6851dd9 Merge pull request #3688 from ZacSharp/1.18.2-update
Merge 1.17.1 into 1.18.2
2022-10-31 12:25:18 -07:00
ZacSharp
98763271a4 Update litematic version check 2022-10-13 23:36:38 +02:00
ZacSharp
063842edc4 Merge branch '1.17.1' into 1.18.2 2022-10-12 18:17:34 +02:00
Leijurv
8b94ac8fca Merge pull request #3640 from scorbett123/fixWaterJump
Fix for infinite loop in water
2022-10-04 13:04:04 -07:00
scorbett123
8f514bd782 Cleaner fix for water jump issue 2022-10-03 21:22:07 +01:00
Leijurv
bf43fd1274 Merge pull request #3601 from scorbett123/patch-6
Update legitMineYLevel for 1.18 +
2022-09-24 14:59:57 -10:00
scorbett123
287addb9fd Fix for infinite loop in water 2022-08-30 18:46:58 +01:00
scorbett123
d1a0f1e3ca Update legitMineYLevel for 1.18 +
Update the legit mine default setting to work at the correct diamond level in 1.18+.
2022-08-08 15:20:41 +02:00
Leijurv
82f184c848 Merge pull request #3488 from ZacSharp/1.18.2-update
Merge 1.17.1 into 1.18.2
2022-06-08 19:03:00 -07:00
ZacSharp
4a042510d8 Merge branch '1.17.1' into 1.18.2 2022-06-03 22:26:24 +02:00
Leijurv
8a0771e5f4 v1.8.3 2022-03-08 14:50:04 -08:00
Leijurv
9c6c977314 Merge pull request #3292 from wagyourtail/1.18.2
1.18.2
2022-03-08 14:47:42 -08:00
Wagyourtail
38c5388e00 forge updated (finally) 2022-03-01 16:36:09 -07:00
Wagyourtail
519a76a171 fix for 1.18.2 2022-02-28 15:29:37 -07:00
Leijurv
b6cc15e9ab v1.8.2 2022-02-02 15:55:22 -08:00
Leijurv
ebb9dd1aaf Merge branch '1.17.1' into 1.18.1 2022-02-02 15:47:50 -08:00
Leijurv
e077995332 v1.8.1 2022-02-02 00:38:06 -08:00
Leijurv
c9ebc0191d Merge branch '1.17.1' into 1.18.1 2022-02-02 00:30:29 -08:00
Leijurv
db0ebeebee Merge branch '1.17.1' into 1.18.1 2022-02-02 00:29:26 -08:00
Leijurv
70dc2a3009 Merge branch '1.17.1' into 1.18.1 2022-02-02 00:25:13 -08:00
Leijurv
696ec6756d Merge pull request #3077 from wagyourtail/1.18
1.18 support
2022-02-02 00:00:05 -08:00
Wagyourtail
697c92ae77 Merge branch '1.17.1' into 1.18 2022-01-20 15:19:49 -07:00
Wagyourtail
c4da682e84 Merge branch '1.17.1' into 1.18
change so rebuilds
2022-01-10 16:58:03 -07:00
Wagyourtail
33ee39dcce fix dripleaf and azalea behavior 2022-01-10 11:28:37 -07:00
Wagyourtail
587c2cc8e2 forge support 2021-12-02 11:13:56 -07:00
Wagyourtail
1c8899ceae 1.18 release
pre.5


pre.6


pre.7


rc.1


1.18 release
2021-11-30 14:06:03 -07:00
Wagyourtail
088009fe4a pre.3 2021-11-17 10:16:07 -07:00
Wagyourtail
90ac6f331e missed a spot 2021-11-16 16:47:37 -07:00
Wagyourtail
e80e4afa48 bump proguard version 2021-11-16 16:41:34 -07:00
Wagyourtail
b73295d180 bump to gradle 7.3, java 17 and 1.18-pre2 2021-11-16 16:30:37 -07:00
Wagyourtail
186a3cb6df shedainel says its fixed 2021-11-12 19:38:46 -07:00
Wagyourtail
b6fba56291 temp comment vanilla/forge 2021-11-12 19:38:46 -07:00
Wagyourtail
f52fee8254 revert this commit when shedaniel fixes arch-loom 2021-11-12 19:38:46 -07:00
Wagyourtail
f1061cfd31 fix baritone only ticking when screen open 2021-11-12 19:38:46 -07:00
Wagyourtail
9a9358bc78 WIP 2021-11-12 19:38:46 -07:00
20 changed files with 96 additions and 79 deletions

View File

@@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '16'
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew

View File

@@ -12,10 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '16'
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew

View File

@@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt update -y
RUN apt install \
openjdk-16-jdk \
openjdk-17-jdk \
--assume-yes
COPY . /code

View File

@@ -31,7 +31,7 @@ import baritone.gradle.task.ProguardTask
def compileType = project.hasProperty("baritone.fabric_build") ? "FABRIC" : project.hasProperty("baritone.forge_build") ? "FORGE" : "OFFICIAL"
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_16
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
compileJava {
options.encoding = "UTF-8" // allow emoji in comments :^)
@@ -95,7 +95,7 @@ dependencies {
mappings loom.layered() {
officialMojangMappings()
//technically optional, but really helpful in dev:
parchment("org.parchmentmc.data:parchment-1.17.1:2021.10.24@zip" as String)
// parchment("org.parchmentmc.data:parchment-1.17.1:2021.10.24@zip" as String)
}
minecraft "com.mojang:minecraft:${project.minecraft_version}"
if (!compileType.equals("FORGE")) {
@@ -179,8 +179,8 @@ if (compileType.equals("OFFICIAL")) {
task proguard(type: ProguardTask) {
url 'https://downloads.sourceforge.net/project/proguard/v7.1.0-beta5/proguard-7.1.0-beta5.zip'
extract 'proguard-7.1.0-beta5/lib/proguard.jar'
url 'https://github.com/Guardsquare/proguard/releases/download/v7.2.0-beta2/proguard-7.2.0-beta2.zip'
extract 'proguard-7.2.0-beta2/lib/proguard.jar'
compType compileType
}

View File

@@ -1,12 +1,12 @@
org.gradle.jvmargs=-Xmx2048M
mod_version=1.7.3
mod_version=1.8.4
maven_group=baritone
archives_base_name=baritone
minecraft_version=1.17.1
forge_version=1.17.1-37.0.69
fabric_version=0.11.6
minecraft_version=1.18.2
forge_version=1.18.2-40.0.0
fabric_version=0.13.1
# # un comment for forge debugging default (as opposed to fabric)
# baritone.forge_build=true

Binary file not shown.

53
gradlew vendored
View File

@@ -1,5 +1,21 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -66,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -109,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
@@ -138,19 +156,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
@@ -159,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

43
gradlew.bat vendored
View File

@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -35,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -45,28 +64,14 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell

View File

@@ -1065,7 +1065,7 @@ public final class Settings {
/**
* What Y level to go to for legit strip mining
*/
public final Setting<Integer> legitMineYLevel = new Setting<>(11);
public final Setting<Integer> legitMineYLevel = new Setting<>(-59);
/**
* Magically see ores that are separated diagonally from existing ores. Basically like mining around the ores that it finds

View File

@@ -29,7 +29,6 @@ import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.ServerPacksSource;
import net.minecraft.server.packs.resources.ReloadableResourceManager;
import net.minecraft.server.packs.resources.SimpleReloadableResourceManager;
import net.minecraft.util.Unit;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
@@ -147,11 +146,11 @@ public final class BlockOptionalMeta {
PackRepository rpl = new PackRepository(PackType.SERVER_DATA, new ServerPacksSource());
rpl.reload();
PackResources thePack = rpl.getAvailablePacks().iterator().next().open();
ReloadableResourceManager resourceManager = new SimpleReloadableResourceManager(PackType.SERVER_DATA);
ReloadableResourceManager resourceManager = new ReloadableResourceManager(PackType.SERVER_DATA);
manager = new LootTables(predicate);
resourceManager.registerReloadListener(manager);
try {
resourceManager.reload(new ThreadPerTaskExecutor(Thread::new), new ThreadPerTaskExecutor(Thread::new), Collections.singletonList(thePack), CompletableFuture.completedFuture(Unit.INSTANCE)).get();
resourceManager.createReload(new ThreadPerTaskExecutor(Thread::new), new ThreadPerTaskExecutor(Thread::new), CompletableFuture.completedFuture(Unit.INSTANCE), Collections.singletonList(thePack)).done().get();
} catch (Exception exception) {
throw new RuntimeException(exception);
}

View File

@@ -64,10 +64,10 @@ public class MixinClientPlayNetHandler {
}*/
@Inject(
method = "handleLevelChunk",
method = "handleLevelChunkWithLight",
at = @At("RETURN")
)
private void postHandleChunkData(ClientboundLevelChunkPacket packetIn, CallbackInfo ci) {
private void postHandleChunkData(ClientboundLevelChunkWithLightPacket packetIn, CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
LocalPlayer player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPacketListener) (Object) this) {

View File

@@ -63,7 +63,7 @@ public class MixinMinecraft {
value = "FIELD",
opcode = Opcodes.GETFIELD,
target = "Lnet/minecraft/client/Minecraft;screen:Lnet/minecraft/client/gui/screens/Screen;",
ordinal = 5,
ordinal = 4,
shift = At.Shift.BY,
by = -3
)

View File

@@ -26,6 +26,6 @@
"depends": {
"fabricloader": ">=0.11.0",
"minecraft": "1.17.x"
"minecraft": "1.18.x"
}
}

View File

@@ -2,7 +2,7 @@
"required": true,
"package": "baritone.launch.mixins",
"refmap": "mixins.baritone.refmap.json",
"compatibilityLevel": "JAVA_16",
"compatibilityLevel": "JAVA_17",
"verbose": false,
"injectors": {
"maxShiftBy": 2

View File

@@ -59,22 +59,22 @@ public class WorldProvider implements IWorldProvider, Helper {
* @param world The world's Registry Data
*/
public final void initWorld(ResourceKey<Level> worldKey, DimensionType world) {
File directory;
File readme;
Path directory;
Path readme;
IntegratedServer integratedServer = mc.getSingleplayerServer();
// If there is an integrated server running (Aka Singleplayer) then do magic to find the world save file
if (mc.hasSingleplayerServer()) {
directory = DimensionType.getStorageFolder(worldKey, integratedServer.getWorldPath(LevelResource.ROOT).toFile());
directory = DimensionType.getStorageFolder(worldKey, integratedServer.getWorldPath(LevelResource.ROOT));
// Gets the "depth" of this directory relative the the game's run directory, 2 is the location of the world
if (directory.toPath().relativize(mc.gameDirectory.toPath()).getNameCount() != 2) {
if (directory.relativize(mc.gameDirectory.toPath()).getNameCount() != 2) {
// subdirectory of the main save directory for this world
directory = directory.getParentFile();
directory = directory.getParent();
}
directory = new File(directory, "baritone");
directory = directory.resolve("baritone");
readme = directory;
} else { // Otherwise, the server must be remote...
String folderName;
@@ -90,12 +90,12 @@ public class WorldProvider implements IWorldProvider, Helper {
if (SystemUtils.IS_OS_WINDOWS) {
folderName = folderName.replace(":", "_");
}
directory = new File(Baritone.getDir(), folderName);
readme = Baritone.getDir();
directory = Baritone.getDir().toPath().resolve(folderName);
readme = Baritone.getDir().toPath();
}
// lol wtf is this baritone folder in my minecraft save?
try (FileOutputStream out = new FileOutputStream(new File(readme, "readme.txt"))) {
try (FileOutputStream out = new FileOutputStream(readme.resolve("readme.txt").toFile())) {
// good thing we have a readme
out.write("https://github.com/cabaletta/baritone\n".getBytes());
} catch (IOException ignored) {}
@@ -115,8 +115,8 @@ public class WorldProvider implements IWorldProvider, Helper {
this.mcWorld = mc.level;
}
public final Path getDimDir(ResourceKey<Level> level, int height, File directory) {
return directory.toPath().resolve(level.location().getNamespace()).resolve(level.location().getPath() + "_" + height);
public final Path getDimDir(ResourceKey<Level> level, int height, Path directory) {
return directory.resolve(level.location().getNamespace()).resolve(level.location().getPath() + "_" + height);
}
public final void closeWorld() {

View File

@@ -147,7 +147,7 @@ public enum WorldScanner implements IWorldScanner {
boolean foundWithinY = false;
for (int y0 : coordinateIterationOrder) {
LevelChunkSection section = chunkInternalStorageArray[y0];
if (section == null || LevelChunkSection.isEmpty(section)) {
if (section == null || section.hasOnlyAir()) {
continue;
}
int yReal = y0 << 4;

View File

@@ -123,7 +123,7 @@ public abstract class Movement implements IMovement, MovementHelper {
public MovementStatus update() {
ctx.player().getAbilities().flying = false;
currentState = updateState(currentState);
if (MovementHelper.isLiquid(ctx, ctx.playerFeet())) {
if (MovementHelper.isLiquid(ctx, ctx.playerFeet()) && ctx.player().position().y < dest.y + 0.6) {
currentState.setInput(Input.JUMP, true);
}
if (ctx.player().isInWall()) {

View File

@@ -71,7 +71,7 @@ public class MovementTraverse extends Movement {
@Override
protected Set<BetterBlockPos> calculateValidPositions() {
return ImmutableSet.of(src, dest);
return ImmutableSet.of(src, dest); // src.above means that we don't get caught in an infinite loop in water
}
public static double cost(CalculationContext context, int x, int y, int z, int destX, int destZ) {
@@ -246,6 +246,7 @@ public class MovementTraverse extends Movement {
if (feet.getY() != dest.getY() && !ladder) {
logDebug("Wrong Y coordinate");
if (feet.getY() < dest.getY()) {
System.out.println("In movement traverse");
return state.setInput(Input.JUMP, true);
}
return state;

View File

@@ -172,7 +172,7 @@ public class BlockStateInterface {
// get the block at x,y,z from this chunk WITHOUT creating a single blockpos object
public static BlockState getFromChunk(LevelChunk chunk, int x, int y, int z) {
LevelChunkSection section = chunk.getSections()[y >> 4];
if (LevelChunkSection.isEmpty(section)) {
if (section.hasOnlyAir()) {
return AIR;
}
return section.getBlockState(x & 15, y & 15, z & 15);

View File

@@ -78,11 +78,10 @@ public enum DefaultSchematicFormats implements ISchematicFormat {
int version = nbt.getInt("Version");
switch (version) {
case 4: //1.12
throw new UnsupportedOperationException("This litematic Version is too old.");
case 5: //1.13-1.17
return new LitematicaSchematic(nbt, false);
throw new UnsupportedOperationException("This litematic Version is too old.");
case 6: //1.18+
throw new UnsupportedOperationException("This litematic Version is too new.");
return new LitematicaSchematic(nbt, false);
default:
throw new UnsupportedOperationException("Unsuported Version of a Litematica Schematic");
}