Compare commits

...

7 Commits

Author SHA1 Message Date
Leijurv
d1a55c43e1 v1.9.2 2023-03-14 18:26:48 -07:00
Leijurv
63e3dfc9b8 1.19.4 2023-03-14 18:20:27 -07:00
leijurv
6db376c02e Merge pull request #3876 from wagyourtail/1.19/1.19.4
1.19.4
2023-03-14 18:19:57 -07:00
Wagyourtail
a1e797ab53 rc3 2023-03-13 15:47:54 -07:00
Wagyourtail
fe64f1fd8a 1.19.4-rc1 2023-03-09 10:17:54 -07:00
leijurv
7a5c4f1f03 Merge pull request #3843 from wagyourtail/1.19/fix/1.19.3-fixdistnames
fix dist names to match previous versions
2023-02-18 16:08:45 -08:00
Wagyourtail
787644181a fix dist names to match previous versions 2023-02-18 16:59:39 -07:00
13 changed files with 59 additions and 36 deletions

View File

@@ -19,6 +19,8 @@ package baritone.gradle.task;
import org.gradle.api.DefaultTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.TaskAction;
import java.io.File;
import java.io.IOException;
@@ -49,14 +51,35 @@ class BaritoneGradleTask extends DefaultTask {
ARTIFACT_STANDALONE = "%s-standalone-%s.jar";
protected String artifactName, artifactVersion;
protected final Path
protected Path
artifactPath,
artifactUnoptimizedPath, artifactApiPath, artifactStandalonePath, // these are different for forge builds
proguardOut;
@Input
@Optional
protected String compType = null;
public String getCompType() {
return compType;
}
public void setCompType(String compType) {
this.compType = compType;
}
public BaritoneGradleTask() {
this.artifactName = getProject().getProperties().get("archivesBaseName").toString();
this.artifactVersion = getProject().getVersion().toString();
this.artifactName = getProject().getRootProject().getProperties().get("archives_base_name").toString();
}
public void doFirst() {
if (compType != null) {
this.artifactVersion = compType + "-" + getProject().getVersion();
} else {
this.artifactVersion = getProject().getVersion().toString();
}
this.artifactPath = this.getBuildFile(formatVersion(ARTIFACT_STANDARD));
@@ -99,4 +122,8 @@ class BaritoneGradleTask extends DefaultTask {
protected Path getBuildFile(String file) {
return getRelativeFile("libs/" + file);
}
protected String addCompTypeFirst(String string) {
return compType == null ? string : compType + "-" + string;
}
}

View File

@@ -41,6 +41,7 @@ public class CreateDistTask extends BaritoneGradleTask {
@TaskAction
protected void exec() throws Exception {
super.doFirst();
super.verifyArtifacts();
// Define the distribution file paths

View File

@@ -63,15 +63,9 @@ public class ProguardTask extends BaritoneGradleTask {
return extract;
}
@Input
private String compType;
public String getCompType() {
return compType;
}
@TaskAction
protected void exec() throws Exception {
super.doFirst();
super.verifyArtifacts();
// "Haha brady why don't you make separate tasks"
@@ -253,7 +247,7 @@ public class ProguardTask extends BaritoneGradleTask {
Files.createDirectories(this.getRootRelativeFile(PROGUARD_MAPPING_DIR));
List<String> api = new ArrayList<>(template);
api.add(2, "-printmapping " + new File(this.getRootRelativeFile(PROGUARD_MAPPING_DIR).toFile(), "mappings-" + compType + "-api.txt"));
api.add(2, "-printmapping " + new File(this.getRootRelativeFile(PROGUARD_MAPPING_DIR).toFile(), "mappings-" + addCompTypeFirst("api.txt")));
// API config doesn't require any changes from the changes that we made to the template
Files.write(getTemporaryFile(compType+PROGUARD_API_CONFIG), api);
@@ -261,7 +255,7 @@ public class ProguardTask extends BaritoneGradleTask {
// For the Standalone config, don't keep the API package
List<String> standalone = new ArrayList<>(template);
standalone.removeIf(s -> s.contains("# this is the keep api"));
standalone.add(2, "-printmapping " + new File(this.getRootRelativeFile(PROGUARD_MAPPING_DIR).toFile(), "mappings-" + compType + "-standalone.txt"));
standalone.add(2, "-printmapping " + new File(this.getRootRelativeFile(PROGUARD_MAPPING_DIR).toFile(), "mappings-" + addCompTypeFirst("standalone.txt")));
Files.write(getTemporaryFile(compType+PROGUARD_STANDALONE_CONFIG), standalone);
}
@@ -294,11 +288,6 @@ public class ProguardTask extends BaritoneGradleTask {
public void setExtract(String extract) {
this.extract = extract;
}
public void setCompType(String compType) {
this.compType = compType;
}
private void runProguard(Path config) throws Exception {
// Delete the existing proguard output file. Proguard probably handles this already, but why not do it ourselves
if (Files.exists(this.proguardOut)) {

View File

@@ -22,7 +22,7 @@ plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
}
archivesBaseName = archivesBaseName + "-" + project.name
archivesBaseName = archivesBaseName + "-fabric"
minecraft {
fabric()
@@ -79,10 +79,12 @@ components.java {
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 "FABRIC"
compType "fabric"
}
task createDist(type: CreateDistTask, dependsOn: proguard)
task createDist(type: CreateDistTask, dependsOn: proguard) {
compType "fabric"
}
build.finalizedBy(createDist)

View File

@@ -26,6 +26,6 @@
"depends": {
"fabricloader": ">=0.11.0",
"minecraft": "1.19.3"
"minecraft": "1.19.4"
}
}
}

View File

@@ -22,7 +22,7 @@ plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
}
archivesBaseName = archivesBaseName + "-" + project.name
archivesBaseName = archivesBaseName + "-forge"
minecraft {
forge {
@@ -98,10 +98,12 @@ components.java {
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 "FORGE"
compType "forge"
}
task createDist(type: CreateDistTask, dependsOn: proguard)
task createDist(type: CreateDistTask, dependsOn: proguard) {
compType "forge"
}
build.finalizedBy(createDist)

View File

@@ -1,9 +1,9 @@
org.gradle.jvmargs=-Xmx4G
mod_version=1.9.1
mod_version=1.9.2
maven_group=baritone
archives_base_name=baritone
minecraft_version=1.19.3
minecraft_version=1.19.4
forge_version=1.19.3-44.0.1
fabric_version=0.14.11

View File

@@ -43,8 +43,8 @@ rootProject.name = 'baritone'
include("tweaker")
if (System.getProperty("Baritone.enabled_platforms") == null) {
System.setProperty("Baritone.enabled_platforms", "fabric,forge")
// System.setProperty("Baritone.enabled_platforms", "fabric")
// System.setProperty("Baritone.enabled_platforms", "fabric,forge")
System.setProperty("Baritone.enabled_platforms", "fabric")
}
for (platform in System.getProperty("Baritone.enabled_platforms").split(",")) {
include(platform)

View File

@@ -24,6 +24,7 @@ import baritone.api.pathing.goals.GoalComposite;
import baritone.api.process.IFarmProcess;
import baritone.api.process.PathingCommand;
import baritone.api.process.PathingCommandType;
import baritone.api.utils.BetterBlockPos;
import baritone.api.utils.RayTraceUtils;
import baritone.api.utils.Rotation;
import baritone.api.utils.RotationUtils;
@@ -306,7 +307,7 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro
ItemEntity ei = (ItemEntity) entity;
if (PICKUP_DROPPED.contains(ei.getItem().getItem())) {
// +0.1 because of farmland's 0.9375 dummy height lol
goalz.add(new GoalBlock(new BlockPos(entity.position().x, entity.position().y + 0.1, entity.position().z)));
goalz.add(new GoalBlock(new BetterBlockPos(entity.position().x, entity.position().y + 0.1, entity.position().z)));
}
}
}

View File

@@ -25,6 +25,7 @@ import baritone.api.pathing.goals.GoalXZ;
import baritone.api.process.IFollowProcess;
import baritone.api.process.PathingCommand;
import baritone.api.process.PathingCommandType;
import baritone.api.utils.BetterBlockPos;
import baritone.utils.BaritoneProcessHelper;
import java.util.List;
import java.util.function.Predicate;
@@ -59,7 +60,7 @@ public final class FollowProcess extends BaritoneProcessHelper implements IFollo
pos = following.blockPosition();
} else {
GoalXZ g = GoalXZ.fromDirection(following.position(), Baritone.settings().followOffsetDirection.value, Baritone.settings().followOffsetDistance.value);
pos = new BlockPos(g.getX(), following.position().y, g.getZ());
pos = new BetterBlockPos(g.getX(), following.position().y, g.getZ());
}
return new GoalNear(pos, Baritone.settings().followRadius.value);
}

View File

@@ -27,6 +27,7 @@ import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
@@ -133,7 +134,7 @@ public class GuiClick extends Screen implements Helper {
//TODO: check
IRenderer.glColor(Color.RED, 0.4F);
RenderSystem.lineWidth(Baritone.settings().pathRenderLineWidthPixels.value);
RenderSystem.disableTexture();
RenderSystem.setShader(GameRenderer::getPositionColorShader);
RenderSystem.depthMask(false);
RenderSystem.disableDepthTest();
BetterBlockPos a = new BetterBlockPos(currentMouseOver);
@@ -142,7 +143,6 @@ public class GuiClick extends Screen implements Helper {
RenderSystem.enableDepthTest();
RenderSystem.depthMask(true);
RenderSystem.enableTexture();
RenderSystem.disableBlend();
}
}

View File

@@ -24,6 +24,8 @@ import baritone.utils.accessor.IEntityRenderManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.*;
import java.awt.*;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.world.phys.AABB;
import org.joml.Matrix4f;
@@ -48,10 +50,10 @@ public interface IRenderer {
static void startLines(Color color, float alpha, float lineWidth, boolean ignoreDepth) {
RenderSystem.enableBlend();
RenderSystem.setShader(GameRenderer::getPositionColorShader);
RenderSystem.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
glColor(color, alpha);
RenderSystem.lineWidth(lineWidth);
RenderSystem.disableTexture();
RenderSystem.depthMask(false);
if (ignoreDepth) {
@@ -69,7 +71,6 @@ public interface IRenderer {
}
RenderSystem.depthMask(true);
RenderSystem.enableTexture();
RenderSystem.disableBlend();
}

View File

@@ -97,7 +97,6 @@ jar {
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 "OFFICIAL"
}
task createDist(type: CreateDistTask, dependsOn: proguard)