[CHORE] Backport from 1.20.3

This commit is contained in:
2024-01-02 00:38:06 +02:00
parent ee80626bf7
commit d97e6df36e
16 changed files with 29 additions and 31 deletions

View File

@@ -9,7 +9,7 @@ pipeline {
stage("Notify Discord") {
steps {
discordSend webhookURL: env.FDD_WH_ADMIN,
title: "Deploy Started: CraterLib 1.19.3/4 Deploy #${BUILD_NUMBER}",
title: "Deploy Started: CraterLib 1.19.2 Deploy #${BUILD_NUMBER}",
link: env.BUILD_URL,
result: 'SUCCESS',
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})"
@@ -38,7 +38,7 @@ pipeline {
deleteDir()
discordSend webhookURL: env.FDD_WH_ADMIN,
title: "CraterLib 1.19.3/4 Deploy #${BUILD_NUMBER}",
title: "CraterLib 1.19.2 Deploy #${BUILD_NUMBER}",
link: env.BUILD_URL,
result: currentBuild.currentResult,
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})\nStatus: ${currentBuild.currentResult}"

View File

@@ -13,7 +13,7 @@ pipeline {
stage("Notify Discord") {
steps {
discordSend webhookURL: env.SSS_WEBHOOK,
title: "Deploy Started: ${projectName} 1.19.3/4 Deploy #${BUILD_NUMBER}",
title: "Deploy Started: ${projectName} 1.19.2 Deploy #${BUILD_NUMBER}",
link: env.BUILD_URL,
result: 'SUCCESS',
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})"
@@ -54,7 +54,7 @@ pipeline {
versionName: "Snapshot 1.0.${BUILD_NUMBER}",
version: "1.0.${BUILD_NUMBER}",
modLoaders: "forge|fabric|quilt",
minecraftVersions: "1.19.3|1.19.4",
minecraftVersions: "1.19.2",
failWebhook: env.SSS_WEBHOOK,
publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}"

View File

@@ -8,6 +8,7 @@ import com.hypherionmc.craterlib.core.config.annotations.SubConfig;
import com.hypherionmc.craterlib.core.config.annotations.Tooltip;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.*;
import com.mojang.math.Matrix4f;
import me.hypherionmc.moonconfig.core.conversion.SpecComment;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.Font;
@@ -19,7 +20,6 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.joml.Matrix4f;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

View File

@@ -20,8 +20,8 @@ public class AbstractConfigWidget<T, W extends AbstractWidget> extends BaseWidge
public void render(Minecraft minecraft, Font font, int x, int y, int width, int height, PoseStack matrices, int mouseX, int mouseY, float delta) {
super.render(minecraft, font, x, y, width, height, matrices, mouseX, mouseY, delta);
int i = (widget instanceof EditBox ? 1 : 0);
widget.setX(x + width - 200 - resetButtonOffset + i);
widget.setY(y + i + 1);
widget.x = (x + width - 200 - resetButtonOffset + i);
widget.y = (y + i + 1);
widget.render(matrices, mouseX, mouseY, delta);
}
}

View File

@@ -16,7 +16,7 @@ import net.minecraft.network.chat.TextColor;
public class BaseWidget<T> extends Option<T> {
public static final int resetButtonOffset = 48;
private final Button resetButton = addChild(Button.builder(Component.literal("Reset"), this::onResetPressed).size(46, 20).build());
private final Button resetButton = addChild(new Button(0, 0, 46, 20, Component.literal("Reset"), this::onResetPressed));
private boolean hideReset = false;
private boolean isSubConfig = false;
@@ -51,8 +51,8 @@ public class BaseWidget<T> extends Option<T> {
text.withStyle(ChatFormatting.GRAY);
}
font.draw(matrices, text, x, y, 0xFFFFFF);
resetButton.setX(x + width - 46);
resetButton.setY(y + 1);
resetButton.x = (x + width - 46);
resetButton.y = (y + 1);
resetButton.active = isNotDefault();
if (!hideReset) {
resetButton.render(matrices, mouseX, mouseY, delta);

View File

@@ -34,11 +34,6 @@ public class InternalConfigButton extends AbstractButton {
super.render(poseStack, i, j, f);
}
@Override
protected void updateWidgetNarration(NarrationElementOutput narrationElementOutput) {
narrationElementOutput.add(NarratedElementType.USAGE, getMessage());
}
@Override
public void onPress() {
if (cancel) {
@@ -49,4 +44,8 @@ public class InternalConfigButton extends AbstractButton {
}
@Override
public void updateNarration(NarrationElementOutput narrationElementOutput) {
narrationElementOutput.add(NarratedElementType.USAGE, getMessage());
}
}

View File

@@ -6,8 +6,8 @@ import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

View File

@@ -23,7 +23,7 @@ public class SubConfigWidget<T> extends AbstractConfigWidget<T, Button> {
this.subConfig = subConfig;
this.screen = screen;
this.widget = addChild(Button.builder(Component.translatable("t.clc.opensubconfig"), this::openSubConfig).size(200, buttonHeight).build());
this.widget = addChild(new Button(0, 0, 200, buttonHeight, Component.translatable("t.clc.opensubconfig"), this::openSubConfig));
}
@Override

View File

@@ -18,7 +18,7 @@ public class ToggleButton<T> extends AbstractConfigWidget<T, Button> {
public ToggleButton(List<T> options, Function<T, Component> toComponent) {
this.options = options;
this.toComponent = toComponent;
this.widget = addChild(Button.builder(Component.empty(), this::switchNext).size(buttonWidth, buttonHeight).build());
this.widget = addChild(new Button(0, 0, buttonWidth, buttonHeight, Component.empty(), this::switchNext));
}
@Override

View File

@@ -9,7 +9,6 @@ import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
import java.util.UUID;
import java.util.function.Supplier;
public class AbstractFakePlayer extends CommandSourceStack {

View File

@@ -19,7 +19,7 @@ public class ServerGamePacketListenerImplMixin {
@Inject(method = "broadcastChatMessage", at = @At("HEAD"), cancellable = true)
private void injectChatEvent(PlayerChatMessage chatMessage, CallbackInfo ci) {
CraterServerChatEvent event = new CraterServerChatEvent(this.player, chatMessage.decoratedContent().getString(), chatMessage.decoratedContent());
CraterServerChatEvent event = new CraterServerChatEvent(this.player, chatMessage.serverContent().getString(), chatMessage.serverContent());
CraterEventBus.INSTANCE.postEvent(event);
if (event.wasCancelled())
ci.cancel();

View File

@@ -1,9 +1,9 @@
package com.hypherionmc.craterlib.util;
import com.mojang.math.Vector4f;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.DyeColor;
import org.joml.Vector4f;
import java.awt.*;

View File

@@ -116,8 +116,8 @@ publisher {
versionType = "release"
changelog = "https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-fabric.md"
version = "${minecraft_version}-${project.version}"
displayName = "[FABRIC/QUILT 1.19.3/4] CraterLib - ${project.version}"
gameVersions = ["1.19.3", "1.19.4"]
displayName = "[FABRIC/QUILT 1.19.2] CraterLib - ${project.version}"
gameVersions = ["1.19.2"]
loaders = ["fabric", "quilt"]
artifact = remapJar

View File

@@ -33,7 +33,7 @@
"depends": {
"fabricloader": ">=0.14.21",
"fabric-api": "*",
"minecraft": ">=1.19.3",
"minecraft": "1.19.2",
"java": ">=17"
}
}

View File

@@ -1,5 +1,5 @@
modLoader = "javafml"
loaderVersion = "[44,)"
loaderVersion = "[43,)"
license = "MIT"
issueTrackerURL = "https://github.com/firstdarkdev/craterLib/issues"
@@ -19,13 +19,13 @@ displayTest = "MATCH_VERSION"
[[dependencies.${mod_id}]]
modId = "forge"
mandatory = true
versionRange = "[44,)"
versionRange = "[43,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.${mod_id}]]
modId = "minecraft"
mandatory = true
versionRange = "[1.19.3,1.20)"
versionRange = "[1.19.2,1.19.3)"
ordering = "NONE"
side = "BOTH"

View File

@@ -10,17 +10,17 @@ mod_id=craterlib
mod_name=CraterLib
# Shared
minecraft_version=1.19.3
minecraft_version=1.19.2
# Fabric
fabric_api=0.76.0+1.19.2
fabric_loader=0.14.21
fabric_api=0.76.1+1.19.3
# Forge
forge_version=44.1.0
forge_version=43.2.0
# Dependencies
mod_menu_version=5.1.0-beta.4
mod_menu_version=4.2.0-beta.2
moon_config=1.0.9
# Publishing