[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") { stage("Notify Discord") {
steps { steps {
discordSend webhookURL: env.FDD_WH_ADMIN, 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, link: env.BUILD_URL,
result: 'SUCCESS', result: 'SUCCESS',
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})" description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})"
@@ -38,7 +38,7 @@ pipeline {
deleteDir() deleteDir()
discordSend webhookURL: env.FDD_WH_ADMIN, 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, link: env.BUILD_URL,
result: currentBuild.currentResult, result: currentBuild.currentResult,
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})\nStatus: ${currentBuild.currentResult}" description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})\nStatus: ${currentBuild.currentResult}"

View File

@@ -13,7 +13,7 @@ pipeline {
stage("Notify Discord") { stage("Notify Discord") {
steps { steps {
discordSend webhookURL: env.SSS_WEBHOOK, 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, link: env.BUILD_URL,
result: 'SUCCESS', result: 'SUCCESS',
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})" description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})"
@@ -54,7 +54,7 @@ pipeline {
versionName: "Snapshot 1.0.${BUILD_NUMBER}", versionName: "Snapshot 1.0.${BUILD_NUMBER}",
version: "1.0.${BUILD_NUMBER}", version: "1.0.${BUILD_NUMBER}",
modLoaders: "forge|fabric|quilt", modLoaders: "forge|fabric|quilt",
minecraftVersions: "1.19.3|1.19.4", minecraftVersions: "1.19.2",
failWebhook: env.SSS_WEBHOOK, failWebhook: env.SSS_WEBHOOK,
publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}" 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.hypherionmc.craterlib.core.config.annotations.Tooltip;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.*; import com.mojang.blaze3d.vertex.*;
import com.mojang.math.Matrix4f;
import me.hypherionmc.moonconfig.core.conversion.SpecComment; import me.hypherionmc.moonconfig.core.conversion.SpecComment;
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.Font; import net.minecraft.client.gui.Font;
@@ -19,7 +20,6 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.joml.Matrix4f;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Modifier; 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) { 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); super.render(minecraft, font, x, y, width, height, matrices, mouseX, mouseY, delta);
int i = (widget instanceof EditBox ? 1 : 0); int i = (widget instanceof EditBox ? 1 : 0);
widget.setX(x + width - 200 - resetButtonOffset + i); widget.x = (x + width - 200 - resetButtonOffset + i);
widget.setY(y + i + 1); widget.y = (y + i + 1);
widget.render(matrices, mouseX, mouseY, delta); 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 class BaseWidget<T> extends Option<T> {
public static final int resetButtonOffset = 48; 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 hideReset = false;
private boolean isSubConfig = false; private boolean isSubConfig = false;
@@ -51,8 +51,8 @@ public class BaseWidget<T> extends Option<T> {
text.withStyle(ChatFormatting.GRAY); text.withStyle(ChatFormatting.GRAY);
} }
font.draw(matrices, text, x, y, 0xFFFFFF); font.draw(matrices, text, x, y, 0xFFFFFF);
resetButton.setX(x + width - 46); resetButton.x = (x + width - 46);
resetButton.setY(y + 1); resetButton.y = (y + 1);
resetButton.active = isNotDefault(); resetButton.active = isNotDefault();
if (!hideReset) { if (!hideReset) {
resetButton.render(matrices, mouseX, mouseY, delta); resetButton.render(matrices, mouseX, mouseY, delta);

View File

@@ -34,11 +34,6 @@ public class InternalConfigButton extends AbstractButton {
super.render(poseStack, i, j, f); super.render(poseStack, i, j, f);
} }
@Override
protected void updateWidgetNarration(NarrationElementOutput narrationElementOutput) {
narrationElementOutput.add(NarratedElementType.USAGE, getMessage());
}
@Override @Override
public void onPress() { public void onPress() {
if (cancel) { 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.AbstractContainerEventHandler;
import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;

View File

@@ -23,7 +23,7 @@ public class SubConfigWidget<T> extends AbstractConfigWidget<T, Button> {
this.subConfig = subConfig; this.subConfig = subConfig;
this.screen = screen; 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 @Override

View File

@@ -18,7 +18,7 @@ public class ToggleButton<T> extends AbstractConfigWidget<T, Button> {
public ToggleButton(List<T> options, Function<T, Component> toComponent) { public ToggleButton(List<T> options, Function<T, Component> toComponent) {
this.options = options; this.options = options;
this.toComponent = toComponent; 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 @Override

View File

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

View File

@@ -19,7 +19,7 @@ public class ServerGamePacketListenerImplMixin {
@Inject(method = "broadcastChatMessage", at = @At("HEAD"), cancellable = true) @Inject(method = "broadcastChatMessage", at = @At("HEAD"), cancellable = true)
private void injectChatEvent(PlayerChatMessage chatMessage, CallbackInfo ci) { 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); CraterEventBus.INSTANCE.postEvent(event);
if (event.wasCancelled()) if (event.wasCancelled())
ci.cancel(); ci.cancel();

View File

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

View File

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

View File

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

View File

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

View File

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