Skip to content

Commit

Permalink
1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Dec 7, 2023
1 parent 21feeb6 commit 4b6652b
Show file tree
Hide file tree
Showing 18 changed files with 251 additions and 22 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ allprojects {
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.17.1+build.32:v2"
//launchImplementation('dev.babbaj:nether-pathfinder:1.3.0')
implementation 'dev.babbaj:nether-pathfinder:1.4.1'
implementation "dev.babbaj:nether-pathfinder:${nether_pathfinder_version}"

implementation 'com.google.code.findbugs:jsr305:3.0.2'
}

unimined.minecraft(sourceSets.main, true) {
Expand All @@ -86,7 +88,7 @@ allprojects {
mappings {
intermediary()
mojmap()
parchment("2023.10.22")
parchment("1.20.2", "2023.10.22")
}
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ dependencies {
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0'
implementation group: 'commons-io', name: 'commons-io', version: '2.7'

implementation group: 'xyz.wagyourtail.unimined', name: 'xyz.wagyourtail.unimined.gradle.plugin', version: '1.0.5'
implementation group: 'xyz.wagyourtail.unimined', name: 'xyz.wagyourtail.unimined.gradle.plugin', version: '1.1.0'
}
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
common sourceSet.output
shadowCommon sourceSet.output
}
include 'dev.babbaj:nether-pathfinder:1.3.0'
include "dev.babbaj:nether-pathfinder:${nether_pathfinder_version}"
}

processResources {
Expand Down
3 changes: 1 addition & 2 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"schemaVersion": 1,
"id": "baritone",
Expand Down Expand Up @@ -26,6 +25,6 @@

"depends": {
"fabricloader": ">=0.14.22",
"minecraft": "1.20.2"
"minecraft": "1.20.4"
}
}
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
common sourceSet.output
shadowCommon sourceSet.output
}
shadowCommon 'dev.babbaj:nether-pathfinder:1.3.0'
shadowCommon "dev.babbaj:nether-pathfinder:${nether_pathfinder_version}"
}

processResources {
Expand Down
2 changes: 1 addition & 1 deletion forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ A Minecraft pathfinder bot.
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.20.2]"
versionRange="[1.20.4]"
ordering="NONE"
side="BOTH"
11 changes: 8 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
org.gradle.jvmargs=-Xmx4G

available_loaders=fabric,forge,tweaker
available_loaders=fabric,forge,neoforge,tweaker

mod_version=1.10.2
maven_group=baritone
archives_base_name=baritone

minecraft_version=1.20.2
forge_version=48.0.1
minecraft_version=1.20.4

forge_version=49.0.3
neoforge_version=0-beta

fabric_version=0.14.22

nether_pathfinder_version=1.4.1
134 changes: 134 additions & 0 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/

import baritone.gradle.task.CreateDistTask
import baritone.gradle.task.ProguardTask

plugins {
id "com.github.johnrengelman.shadow" version "8.0.0"
}

archivesBaseName = archivesBaseName + "-neoforge"

unimined.minecraft {
mappings {
devFallbackNamespace "intermediary"
}

neoForged {
loader project.neoforge_version
mixinConfig ["mixins.baritone.json"]
}

minecraftRemapper.config {
// neoforge adds 1 conflict, where 2 interfaces have a method with the same name on yarn/mojmap,
// but the method has different names in the intermediary mappings.
// this is a conflict because they have a class that extends both interfaces.
// this shouldn't be a problem as long as named mappings don't make the name of those 2 methods different.
ignoreConflicts(true)
}

}

//loom {
// forge {
// mixinConfig 'mixins.baritone.json'
// }
//}

configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
}

dependencies {
// because of multiple sourcesets `common project(":")` doesn't work
for (sourceSet in rootProject.sourceSets) {
if (sourceSet == rootProject.sourceSets.test) continue
if (sourceSet == rootProject.sourceSets.schematica_api) continue
common sourceSet.output
shadowCommon sourceSet.output
}
shadowCommon "dev.babbaj:nether-pathfinder:${nether_pathfinder_version}"
}

processResources {
inputs.property "version", project.version

filesMatching("META-INF/mods.toml") {
expand "version": project.version
}
}

shadowJar {
configurations = [project.configurations.shadowCommon]
archiveClassifier.set "dev-shadow"
}

remapJar {
inputFile.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set null
}

jar {
archiveClassifier.set "dev"

manifest {
attributes(
'MixinConfigs': 'mixins.baritone.json',
"MixinConnector": "baritone.launch.BaritoneMixinConnector",

'Implementation-Title': 'Baritone',
'Implementation-Version': version,
)
}
}

components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}

task proguard(type: ProguardTask) {
url 'https://github.com/Guardsquare/proguard/releases/download/v7.2.1/proguard-7.2.1.zip'
extract 'proguard-7.2.1/lib/proguard.jar'
compType "neoforge"
}

task createDist(type: CreateDistTask, dependsOn: proguard) {
compType "neoforge"
}

build.finalizedBy(createDist)

publishing {
publications {
mavenFabric(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}
18 changes: 18 additions & 0 deletions neoforge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file is part of Baritone.
#
# Baritone is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Baritone is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Baritone. If not, see <https://www.gnu.org/licenses/>.
#

loom.platform=forge
24 changes: 24 additions & 0 deletions neoforge/src/main/java/baritone/launch/BaritoneForgeModXD.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/

package baritone.launch;

import net.neoforged.fml.common.Mod;

@Mod("baritoe")
public class BaritoneForgeModXD {
}
40 changes: 40 additions & 0 deletions neoforge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This is an example mods.toml file. It contains the data relating to the loading mods.
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
# The overall format is standard TOML format, v0.5.0.
# Note that there are a couple of TOML lists in this file.
# Find more information on toml format here: https://github.com/toml-lang/toml
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[1,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
license="https://raw.githubusercontent.com/cabaletta/baritone/1.16.2/LICENSE"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="https://github.com/cabaletta/baritone/issues" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId="baritoe" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="${version}" #mandatory
# A display name for the mod
displayName="Baritone" #mandatory
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="https://github.com/cabaletta/baritone" #optional
# A file name (in the root of the mod JAR) containing a logo for display
#logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
credits="Hat Gamers" #optional
# A text field displayed in the mod UI
authors="leijurv, Brady" #optional
# The description text for the mod (multi line!) (#mandatory)
description='''
A Minecraft pathfinder bot.
'''

[[dependencies.baritoe]]
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.20.4]"
ordering="NONE"
side="BOTH"
6 changes: 6 additions & 0 deletions neoforge/src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"description": "null",
"pack_format": 8
}
}
5 changes: 2 additions & 3 deletions src/launch/java/baritone/launch/mixins/MixinMinecraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ private void postLoadWorld(ClientLevel world, CallbackInfo ci) {
),
slice = @Slice(
from = @At(
value = "FIELD",
opcode = Opcodes.GETFIELD,
target = "Lnet/minecraft/client/Options;renderDebug:Z"
value = "INVOKE",
target = "Lnet/minecraft/client/gui/components/DebugScreenOverlay;showDebugScreen()Z"
),
to = @At(
value = "CONSTANT",
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baritone/command/defaults/SelCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void onRenderPass(RenderEvent event) {
float lineWidth = Baritone.settings().selectionLineWidth.value;
boolean ignoreDepth = Baritone.settings().renderSelectionIgnoreDepth.value;
IRenderer.startLines(color, opacity, lineWidth, ignoreDepth);
IRenderer.emitAABB(event.getModelViewStack(), new AABB(pos1, pos1.offset(1, 1, 1)));
IRenderer.emitAABB(event.getModelViewStack(), new AABB(pos1));
IRenderer.endLines(ignoreDepth);
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/baritone/process/BuilderProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Vec3i;
import net.minecraft.nbt.NbtAccounter;
import net.minecraft.nbt.NbtIo;
import net.minecraft.util.Tuple;
import net.minecraft.world.InteractionHand;
Expand Down Expand Up @@ -222,7 +223,7 @@ public void buildOpenLitematic(int i) {
if (LitematicaHelper.hasLoadedSchematic()) {
String name = LitematicaHelper.getName(i);
try {
LitematicaSchematic schematic1 = new LitematicaSchematic(NbtIo.readCompressed(Files.newInputStream(LitematicaHelper.getSchematicFile(i).toPath())), false);
LitematicaSchematic schematic1 = new LitematicaSchematic(NbtIo.readCompressed(Files.newInputStream(LitematicaHelper.getSchematicFile(i).toPath()), NbtAccounter.unlimitedHeap()), false);
Vec3i correctedOrigin = LitematicaHelper.getCorrectedOrigin(schematic1, i);
ISchematic schematic2 = LitematicaHelper.blackMagicFuckery(schematic1, i);
schematic2 = applyMapArtAndSelection(origin, (IStaticSchematic) schematic2);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baritone/selection/Selection.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Selection(BetterBlockPos pos1, BetterBlockPos pos2) {
max.z - min.z + 1
);

this.aabb = new AABB(this.min, this.max.offset(1, 1, 1));
this.aabb = new AABB(this.min);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/baritone/selection/SelectionRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public static void renderSelections(PoseStack stack, ISelection[] selections) {
IRenderer.glColor(settings.colorSelectionPos1.value, opacity);

for (ISelection selection : selections) {
IRenderer.emitAABB(stack, new AABB(selection.pos1(), selection.pos1().offset(1, 1, 1)));
IRenderer.emitAABB(stack, new AABB(selection.pos1()));
}

IRenderer.glColor(settings.colorSelectionPos2.value, opacity);

for (ISelection selection : selections) {
IRenderer.emitAABB(stack, new AABB(selection.pos2(), selection.pos2().offset(1, 1, 1)));
IRenderer.emitAABB(stack, new AABB(selection.pos2()));
}
}

Expand Down
Loading

0 comments on commit 4b6652b

Please sign in to comment.