Compare commits
6 Commits
old/1.19.3
...
old/1.19.2
Author | SHA1 | Date | |
---|---|---|---|
b4aab1e760 | |||
76d4b1c37e | |||
5ee555e190 | |||
cde690c069 | |||
add2faeaf5 | |||
d97e6df36e |
@@ -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}"
|
||||
|
@@ -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})"
|
||||
@@ -51,10 +51,10 @@ pipeline {
|
||||
projectSlug: "craterlib",
|
||||
projectName: "${projectName}",
|
||||
projectIcon: "${projectIcon}",
|
||||
versionName: "Snapshot 1.0.${BUILD_NUMBER}",
|
||||
version: "1.0.${BUILD_NUMBER}",
|
||||
versionName: "Snapshot 1.1.${BUILD_NUMBER}",
|
||||
version: "1.1.${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}"
|
||||
|
||||
|
@@ -11,11 +11,13 @@ public class MessageBroadcastEvent extends CraterEvent {
|
||||
private final Component component;
|
||||
private final Function<ServerPlayer, Component> function;
|
||||
private final boolean bl;
|
||||
private final String threadName;
|
||||
|
||||
public MessageBroadcastEvent(Component component, Function<ServerPlayer, Component> function, boolean bl) {
|
||||
public MessageBroadcastEvent(Component component, Function<ServerPlayer, Component> function, boolean bl, String threadName) {
|
||||
this.component = component;
|
||||
this.function = function;
|
||||
this.bl = bl;
|
||||
this.threadName = threadName;
|
||||
}
|
||||
|
||||
public Component getComponent() {
|
||||
@@ -30,6 +32,10 @@ public class MessageBroadcastEvent extends CraterEvent {
|
||||
return function;
|
||||
}
|
||||
|
||||
public String getThreadName() {
|
||||
return threadName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCancel() {
|
||||
return false;
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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());
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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 {
|
||||
|
||||
|
@@ -18,10 +18,8 @@ public class PlayerAdvancementsMixin {
|
||||
|
||||
@Inject(method = "award", at = @At(value = "INVOKE", target = "Lnet/minecraft/advancements/AdvancementRewards;grant(Lnet/minecraft/server/level/ServerPlayer;)V", shift = At.Shift.AFTER))
|
||||
private void injectAdvancementEvent(Advancement advancement, String $$1, CallbackInfoReturnable<Boolean> cir) {
|
||||
CraterAdvancementEvent event = new CraterAdvancementEvent(this.player, advancement);
|
||||
|
||||
if (advancement.getDisplay() != null && advancement.getDisplay().shouldAnnounceChat()) {
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
CraterEventBus.INSTANCE.postEvent(new CraterAdvancementEvent(this.player, advancement));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,8 @@ public class PlayerListMixin {
|
||||
|
||||
@Inject(method = "broadcastSystemMessage(Lnet/minecraft/network/chat/Component;Ljava/util/function/Function;Z)V", at = @At("HEAD"))
|
||||
private void injectBroadcastEvent(Component component, Function<ServerPlayer, Component> function, boolean bl, CallbackInfo ci) {
|
||||
MessageBroadcastEvent event = new MessageBroadcastEvent(component, function, bl);
|
||||
String thread = Thread.currentThread().getStackTrace()[3].getClassName();
|
||||
MessageBroadcastEvent event = new MessageBroadcastEvent(component, function, bl, thread);
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
}
|
||||
|
||||
|
@@ -2,24 +2,33 @@ package com.hypherionmc.craterlib.mixin.events;
|
||||
|
||||
import com.hypherionmc.craterlib.api.event.server.CraterServerChatEvent;
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.PlayerChatMessage;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.network.FilteredText;
|
||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(ServerGamePacketListenerImpl.class)
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@Mixin(value = ServerGamePacketListenerImpl.class, priority = Integer.MIN_VALUE)
|
||||
public class ServerGamePacketListenerImplMixin {
|
||||
|
||||
@Shadow
|
||||
public ServerPlayer player;
|
||||
|
||||
@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());
|
||||
@Inject(
|
||||
method = "lambda$handleChat$9",
|
||||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void injectChatEvent(PlayerChatMessage arg, CallbackInfoReturnable<CompletableFuture> ci) {
|
||||
CraterServerChatEvent event = new CraterServerChatEvent(this.player, arg.serverContent().getString(), arg.serverContent());
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
if (event.wasCancelled())
|
||||
ci.cancel();
|
||||
|
@@ -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.*;
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.21",
|
||||
"fabric-api": "*",
|
||||
"minecraft": ">=1.19.3",
|
||||
"minecraft": "1.19.2",
|
||||
"java": ">=17"
|
||||
}
|
||||
}
|
||||
|
@@ -111,8 +111,8 @@ publisher {
|
||||
versionType = "release"
|
||||
changelog = "https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-forge.md"
|
||||
version = "${minecraft_version}-${project.version}"
|
||||
displayName = "[FORGE 1.20.1/2] CraterLib - ${project.version}"
|
||||
gameVersions = ["1.20", "1.20.1"]
|
||||
displayName = "[FORGE 1.19.2] CraterLib - ${project.version}"
|
||||
gameVersions = ["1.19.2"]
|
||||
loaders = ["forge"]
|
||||
artifact = remapJar
|
||||
}
|
@@ -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"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#Project
|
||||
version_major=1
|
||||
version_minor=1
|
||||
version_patch=0
|
||||
version_patch=2
|
||||
project_group=com.hypherionmc.craterlib
|
||||
|
||||
#Mod
|
||||
@@ -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
|
||||
|
Reference in New Issue
Block a user