Skip to content

Minecraft 1.21.5 support #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2d01b9a
magiclib-better-dev 1.21.5-rc1 (fabric)
Hendrix-Shen Mar 21, 2025
b7f6c37
magiclib-minecraft-api 1.21.5-rc1 (fabric)
Hendrix-Shen Mar 23, 2025
126bc4d
magiclib-malilib-extra 1.21.5-rc1 (fabric)
Hendrix-Shen Mar 23, 2025
632ad0a
magiclib-legacy-compat 1.21.5-rc1
Hendrix-Shen Mar 25, 2025
9cfb3e0
magiclib-better-dev 1.21.5 (fabric)
Hendrix-Shen Mar 26, 2025
d5ccbe7
Update plugin dev.architectury.loom to 1.10-SNAPSHOT
Hendrix-Shen Mar 27, 2025
8befe3e
magiclib-better-dev 1.21.5 (neoforge)
Hendrix-Shen Mar 27, 2025
8bfd597
magiclib-minecraft-api 1.21.5-rc1 -> 1.21.5 (fabric)
Hendrix-Shen Mar 27, 2025
8b39800
magiclib-minecraft-api 1.21.5 (neoforge)
Hendrix-Shen Mar 29, 2025
9ea6e9a
magiclib-malilib-extra 1.21.5-rc1 -> 1.21.5 (fabric)
Hendrix-Shen Mar 29, 2025
cc95b40
magiclib-legacy-compat 1.21.5-rc1 -> 1.21.5
Hendrix-Shen Mar 29, 2025
afcfba1
Remove flag due to Architectury Loom upgrade
Hendrix-Shen Mar 29, 2025
df36f9b
Update dependencies
Hendrix-Shen Mar 29, 2025
fa82feb
neoforge 21.5.2-beta -> 21.5.2-beta
Hendrix-Shen Mar 29, 2025
81700a2
malilib 0.23.999-rc1 -> 0.24.0-sakura.3
Hendrix-Shen Mar 31, 2025
20efdee
malilib 0.24.0-sakura.3 -> 0.24.0-sakura.4
Hendrix-Shen Apr 1, 2025
637a4d2
malilib 0.24.0-sakura.4 -> 0.24.0-sakura.5
Hendrix-Shen Apr 6, 2025
f6199f2
fabric-api 0.119.6+1.21.5 -> 0.119.9+1.21.5
Hendrix-Shen Apr 6, 2025
eb70a2a
Fix crash with MagicTranslation
Hendrix-Shen Apr 9, 2025
bcdc21d
fabric-laoder 0.16.10 -> 0.16.13
Hendrix-Shen Apr 10, 2025
da6138f
Add IAS
Hendrix-Shen Apr 10, 2025
8eccebe
neoforge 21.5.7-beta -> 21.5.30-beta
Hendrix-Shen Apr 10, 2025
5182cc8
malilib 0.24.0-sakura.5 -> 0.24.0-sakura.6
Hendrix-Shen Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ mod.version=0.8

# Dependency Versions
## Fabric Environment
dependencies.fabric_loader_version=0.16.10
dependencies.fabric_loader_version=0.16.13
## Annotation processor
dependencies.lombok_version=1.18.36
## Misc
dependencies.jetbrains_annotations_version=26.0.2

# Gradle Plugins
architectury_loom_version=1.9-SNAPSHOT
architectury_loom_version=1.10-SNAPSHOT
checkstyle_version=10.21.1
grgit_version=5.3.0
preprocessor_version=9d21b33
Expand Down
4 changes: 4 additions & 0 deletions magiclib-better-dev/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ preprocess {
Node mc_12101_fabric = createNode("better-dev-1.21.1-fabric", 1_21_01, "mojang")
Node mc_12103_fabric = createNode("better-dev-1.21.3-fabric", 1_21_03, "mojang")
Node mc_12104_fabric = createNode("better-dev-1.21.4-fabric", 1_21_04, "mojang")
Node mc_12105_fabric = createNode("better-dev-1.21.5-fabric", 1_21_05, "mojang")

mc_11502_fabric.link(mc_11404_fabric, file("versions/mapping-fabric-1.15.2-1.14.4.txt"))
mc_11605_fabric.link(mc_11502_fabric, file("versions/mapping-fabric-1.16.5-1.15.2.txt"))
Expand All @@ -43,6 +44,7 @@ preprocess {
mc_12006_fabric.link(mc_12101_fabric, file("versions/mapping-fabric-1.20.6-1.21.1.txt"))
mc_12101_fabric.link(mc_12103_fabric, file("versions/mapping-fabric-1.21.1-1.21.3.txt"))
mc_12103_fabric.link(mc_12104_fabric, file("versions/mapping-fabric-1.21.3-1.21.4.txt"))
mc_12104_fabric.link(mc_12105_fabric, file("versions/mapping-fabric-1.21.4-1.21.5.txt"))

// Forge
Node mc_11701_forge = createNode("better-dev-1.17.1-forge", 1_17_01, "mojang")
Expand All @@ -59,10 +61,12 @@ preprocess {
Node mc_12101_neoforge = createNode("better-dev-1.21.1-neoforge", 1_21_01, "mojang")
Node mc_12103_neoforge = createNode("better-dev-1.21.3-neoforge", 1_21_03, "mojang")
Node mc_12104_neoforge = createNode("better-dev-1.21.4-neoforge", 1_21_04, "mojang")
Node mc_12105_neoforge = createNode("better-dev-1.21.5-neoforge", 1_21_05, "mojang")

mc_12002_fabric.link(mc_12002_neoforge, file("versions/mapping-1.20.2-fabric-neoforge.txt"))
mc_12006_fabric.link(mc_12006_neoforge, file("versions/mapping-1.20.6-fabric-neoforge.txt"))
mc_12101_fabric.link(mc_12101_neoforge, file("versions/mapping-1.21.1-fabric-neoforge.txt"))
mc_12103_fabric.link(mc_12103_neoforge, file("versions/mapping-1.21.3-fabric-neoforge.txt"))
mc_12104_fabric.link(mc_12104_neoforge, file("versions/mapping-1.21.4-fabric-neoforge.txt"))
mc_12105_fabric.link(mc_12105_neoforge, file("versions/mapping-1.21.5-fabric-neoforge.txt"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package top.hendrixshen.magiclib.mixin.dev.auth;

import org.spongepowered.asm.mixin.Mixin;

import top.hendrixshen.magiclib.api.preprocess.DummyClass;

@Mixin(DummyClass.class)
public class MinecraftMixin {
}
20 changes: 20 additions & 0 deletions magiclib-better-dev/versions/1.21.5-fabric/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependency Versions
dependencies.minecraft_dependency=>=1.21.5- <1.21.6-
dependencies.minecraft_version=1.21.5

# Fabric API 0.119.9+1.21.5
dependencies.api.fabric_version=0.119.9+1.21.5
# Mod Menu 14.0.0-rc.2
# modmenu-14.0.0-rc.2.jar
dependencies.api.modmenu_version=14.0.0-rc.2

# IMBlockerFabric 1.0.24
# imblockerfabric-1.0.24.jar
dependencies.runtime.imblocker_version=1.0.24
# In-Game Account Switcher 9.0.2
# IAS-Fabric-1.21.5-9.0.2.jar
dependencies.runtime.inGameAccountSwitcher_version=96FYffnc

# Publish properties
publish.game_version=1.21.5
publish.dependencies_list=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
accessWidener v2 named
18 changes: 18 additions & 0 deletions magiclib-better-dev/versions/1.21.5-neoforge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dependency Versions
dependencies.neoforge_version=21.5.30-beta
dependencies.minecraft_dependency=1.21.5
dependencies.minecraft_version=1.21.5

# IMBlocker
# TODO
dependencies.runtime.imblocker_version=0
# In-Game Account Switcher 9.0.2
# IAS-NeoForge-1.21.5-9.0.2.jar
dependencies.runtime.inGameAccountSwitcher_version=ldQRqpLN

# Loom Properties
loom.platform=neoforge

# Publish properties
publish.game_version=1.21.5
publish.dependencies_list=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
accessWidener v2 named
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
net.fabricmc.api.EnvType net.neoforged.api.distmarker.Dist
net.fabricmc.api.Environment net.neoforged.api.distmarker.OnlyIn
net.fabricmc.api.EnvType SERVER net.neoforged.api.distmarker.Dist DEDICATED_SERVER
Empty file.
2 changes: 2 additions & 0 deletions magiclib-legacy-compat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ preprocess {
Node mc_12101_fabric = createNode("legacy-1.21.1-fabric", 1_21_01, "mojang")
Node mc_12103_fabric = createNode("legacy-1.21.3-fabric", 1_21_03, "mojang")
Node mc_12104_fabric = createNode("legacy-1.21.4-fabric", 1_21_04, "mojang")
Node mc_12105_fabric = createNode("legacy-1.21.5-fabric", 1_21_05, "mojang")

mc_11502_fabric.link(mc_11404_fabric, file("versions/mapping-1.15.2-1.14.4.txt"))
mc_11605_fabric.link(mc_11502_fabric, file("versions/mapping-1.16.5-1.15.2.txt"))
Expand All @@ -43,4 +44,5 @@ preprocess {
mc_12006_fabric.link(mc_12101_fabric, file("versions/mapping-1.20.6-1.21.1.txt"))
mc_12101_fabric.link(mc_12103_fabric, file("versions/mapping-1.21.1-1.21.3.txt"))
mc_12103_fabric.link(mc_12104_fabric, file("versions/mapping-1.21.3-1.21.4.txt"))
mc_12104_fabric.link(mc_12105_fabric, file("versions/mapping-1.21.4-1.21.5.txt"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,8 @@ public int displayRuleMenu(@NotNull CommandSourceStack source, @NotNull RuleOpti
ComponentUtil.simpleCompat(this.getTranslatedRuleName(source, ruleOption.getName()))
.withStyleCompat(style -> style
.withBold(true)
.withClickEvent(ClickEventCompat.of(ClickEvent.Action.RUN_COMMAND,
String.format("/%s %s", this.identifier, ruleOption.getName())))
.withHoverEvent(HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT,
ComponentUtil.trCompat("magiclib.ui.hover.refresh")
.withClickEvent(ClickEventCompat.runCommand(String.format("/%s %s", this.identifier, ruleOption.getName())))
.withHoverEvent(HoverEventCompat.showTextCompat(ComponentUtil.trCompat("magiclib.ui.hover.refresh")
.withStyleCompat(style1 -> style1.withColor(ChatFormatting.GRAY))))));

String descTranslationKey = String.format("%s.rule.%s.desc", this.identifier, ruleOption.getName());
Expand All @@ -479,10 +477,8 @@ public int displayRuleMenu(@NotNull CommandSourceStack source, @NotNull RuleOpti
ComponentUtil.tr(String.format("%s.category.%s", this.identifier, category)),
ComponentUtil.simple("]")).withStyleCompat(style -> style
.withColor(ChatFormatting.AQUA)
.withClickEvent(ClickEventCompat.of(ClickEvent.Action.RUN_COMMAND,
String.format("/%s list %s", this.identifier, category)))
.withHoverEvent(HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT,
ComponentUtil.trCompat("magiclib.ui.hover.list_all_category", category)))))
.withClickEvent(ClickEventCompat.runCommand(String.format("/%s list %s", this.identifier, category)))
.withHoverEvent(HoverEventCompat.showTextCompat(ComponentUtil.trCompat("magiclib.ui.hover.list_all_category", category)))))
.collect(Collectors.toList())));

if (categories.size() < 2) {
Expand Down Expand Up @@ -512,11 +508,9 @@ public int displayRuleMenu(@NotNull CommandSourceStack source, @NotNull RuleOpti
ruleOption.getDefaultStringValue().equals(option) ? ChatFormatting.DARK_GREEN :
ChatFormatting.YELLOW)
.withClickEvent(ruleOption.getStringValue().equals(option) || this.locked() ? null :
ClickEventCompat.of(ClickEvent.Action.SUGGEST_COMMAND,
String.format("/%s %s %s", this.identifier, ruleOption.getName(), option)))
ClickEventCompat.suggestCommand(String.format("/%s %s %s", this.identifier, ruleOption.getName(), option)))
.withHoverEvent(ruleOption.getStringValue().equals(option) || this.locked() ? null :
HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT,
ComponentUtil.trCompat("magiclib.ui.hover.switch_to", option)))))
HoverEventCompat.showTextCompat(ComponentUtil.trCompat("magiclib.ui.hover.switch_to", option)))))
.collect(Collectors.toList())),
ComponentUtil.simple(" ]").withStyle(style -> style.withColor(ChatFormatting.YELLOW))));
return 1;
Expand All @@ -543,10 +537,9 @@ public int setRule(CommandSourceStack source, @NotNull RuleOption ruleOption, St
ComponentUtil.tr("magiclib.ui.change_permanently"),
ComponentUtil.simple("]")).withStyleCompat(style -> style
.withColor(ChatFormatting.AQUA)
.withClickEvent(ClickEventCompat.of(ClickEvent.Action.RUN_COMMAND,
String.format("/%s setDefault %s %s",
.withClickEvent(ClickEventCompat.runCommand(String.format("/%s setDefault %s %s",
this.identifier, ruleOption.getName(), newValue)))
.withHoverEvent(HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT,
.withHoverEvent(HoverEventCompat.showTextCompat(
ComponentUtil.trCompat("magiclib.ui.hover.change_permanently",
String.format("%s.conf", this.identifier))))))));
return 1;
Expand Down Expand Up @@ -644,8 +637,8 @@ public Collection<List<Component>> getMatchedSettings(@NotNull Collection<RuleOp
for (RuleOption ruleOption : ruleOptions) {
List<MutableComponentCompat> components = Lists.newArrayList();
components.add(ComponentCompat.literalCompat(String.format("- %s", this.getTranslatedRuleName(ruleOption.getName()))).withStyleCompat(style -> style
.withClickEvent(ClickEventCompat.of(ClickEvent.Action.RUN_COMMAND, String.format("/%s %s", this.identifier, ruleOption.getName())))
.withHoverEvent(HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT, ComponentCompat.literalCompat(this.trRuleDesc(ruleOption.getName())).withStyle(style1 -> style1.withColor(ChatFormatting.YELLOW))))));
.withClickEvent(ClickEventCompat.runCommand(String.format("/%s %s", this.identifier, ruleOption.getName())))
.withHoverEvent(HoverEventCompat.showTextCompat(ComponentCompat.literalCompat(this.trRuleDesc(ruleOption.getName())).withStyle(style1 -> style1.withColor(ChatFormatting.YELLOW))))));
components.add(ComponentCompat.literalCompat(" "));
List<String> options = new ArrayList<>(ruleOption.getOptions());

Expand All @@ -657,8 +650,8 @@ public Collection<List<Component>> getMatchedSettings(@NotNull Collection<RuleOp
components.add(ComponentCompat.literalCompat(String.format("[%s]", option)).withStyleCompat(style ->
style.withUnderlined(ruleOption.getStringValue().equals(option))
.withColor(ruleOption.isDefault() ? ChatFormatting.GRAY : ruleOption.getDefaultStringValue().equals(option) ? ChatFormatting.DARK_GREEN : ChatFormatting.YELLOW)
.withClickEvent(ruleOption.getStringValue().equals(option) || this.locked() ? null : ClickEventCompat.of(ClickEvent.Action.SUGGEST_COMMAND, String.format("/%s %s %s", this.identifier, ruleOption.getName(), option)))
.withHoverEvent(ruleOption.getStringValue().equals(option) || this.locked() ? null : HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT, ComponentCompat.literalCompat(this.trUI("hover.switch_to", option))))));
.withClickEvent(ruleOption.getStringValue().equals(option) || this.locked() ? null : ClickEventCompat.suggestCommand(String.format("/%s %s %s", this.identifier, ruleOption.getName(), option)))
.withHoverEvent(ruleOption.getStringValue().equals(option) || this.locked() ? null : HoverEventCompat.showTextCompat(ComponentCompat.literalCompat(this.trUI("hover.switch_to", option))))));
components.add(ComponentCompat.literalCompat(" "));
}

Expand All @@ -678,13 +671,11 @@ public Collection<MutableComponentCompat> getMatchedSettings(CommandSourceStack
List<MutableComponentCompat> components = Lists.newArrayList();
components.add(ComponentUtil.composeCompat("- ",
this.getTranslatedRuleName(source, option.getName())).withStyleCompat(style -> {
style.withClickEvent(ClickEventCompat.of(ClickEvent.Action.RUN_COMMAND,
String.format("/%s %s", this.identifier, option.getName())));
style.withClickEvent(ClickEventCompat.runCommand(String.format("/%s %s", this.identifier, option.getName())));
String descTranslationKey = String.format("%s.rule.%s.desc", this.identifier, option.getName());

if (I18n.exists(descTranslationKey)) {
style.withHoverEvent(HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT,
ComponentUtil.trCompat(descTranslationKey)
style.withHoverEvent(HoverEventCompat.showTextCompat(ComponentUtil.trCompat(descTranslationKey)
.withStyleCompat(style1 -> style1.withColor(ChatFormatting.YELLOW))));
}

Expand All @@ -704,10 +695,9 @@ public Collection<MutableComponentCompat> getMatchedSettings(CommandSourceStack
o.equals(option.getDefaultStringValue()) ? ChatFormatting.DARK_GREEN :
ChatFormatting.YELLOW)
.withClickEvent(o.equals(option.getStringValue()) || this.locked() ? null :
ClickEventCompat.of(ClickEvent.Action.SUGGEST_COMMAND,
String.format("/%s %s %s", this.identifier, option.getName(), o)))
ClickEventCompat.suggestCommand(String.format("/%s %s %s", this.identifier, option.getName(), o)))
.withHoverEvent(o.equals(option.getStringValue()) || this.locked() ? null :
HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT,
HoverEventCompat.showTextCompat(
ComponentUtil.trCompat("magiclib.ui.hover.switch_to", o)))))
.collect(Collectors.toList())));
ret.add(ComponentUtil.joinCompat(ComponentUtil.emptyCompat(), components));
Expand Down Expand Up @@ -748,10 +738,8 @@ private int displayMainMenu(CommandSourceStack source) {
ComponentUtil.tr(String.format("%s.category.%s", this.identifier, category)),
"]").withStyleCompat(style -> style
.withColor(ChatFormatting.AQUA)
.withClickEvent(ClickEventCompat.of(ClickEvent.Action.RUN_COMMAND,
String.format("/%s list %s", this.identifier, category)))
.withHoverEvent(HoverEventCompat.of(HoverEvent.Action.SHOW_TEXT,
ComponentUtil.trCompat("magiclib.ui.hover.list_all_category", category)))));
.withClickEvent(ClickEventCompat.runCommand(String.format("/%s list %s", this.identifier, category)))
.withHoverEvent(HoverEventCompat.showTextCompat(ComponentUtil.trCompat("magiclib.ui.hover.list_all_category", category)))));
}
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package top.hendrixshen.magiclib.event.render.impl;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import com.mojang.math.Matrix4f;

import lombok.Getter;

import top.hendrixshen.magiclib.impl.render.context.RenderGlobal;

@Environment(EnvType.CLIENT)
public class RenderContext {
@Getter
Expand Down Expand Up @@ -43,46 +44,44 @@ public void mulPoseMatrix(Matrix4f matrix4f) {
}

public void enableDepthTest() {
RenderSystem.enableDepthTest();
RenderGlobal.enableDepthTest();
}

public void disableDepthTest() {
RenderSystem.disableDepthTest();
RenderGlobal.disableDepthTest();
}

public void depthMask(boolean mask) {
RenderSystem.depthMask(mask);
RenderGlobal.depthMask(mask);
}

public void enableBlend() {
RenderSystem.enableBlend();
RenderGlobal.enableBlend();
}

//#if MC < 12105
public void blendFunc(GlStateManager.SourceFactor srcFactor, GlStateManager.DestFactor dstFactor) {
RenderSystem.blendFunc(srcFactor, dstFactor);
RenderGlobal.blendFunc(srcFactor, dstFactor);
}
//#endif

public void color4f(float red, float green, float blue, float alpha) {
//#if MC > 11605
//$$ RenderSystem.setShaderColor(red, green, blue, alpha);
//#else
RenderSystem.color4f(red, green, blue, alpha);
//#endif
RenderGlobal.color4f(red, green, blue, alpha);
}

//#if MC < 11904
public void enableTexture() {
RenderSystem.enableTexture();
RenderGlobal.enableTexture();
}
//#endif

//#if MC < 11700
public void enableAlphaTest() {
RenderSystem.enableAlphaTest();
RenderGlobal.enableAlphaTest();
}

public void disableLighting() {
RenderSystem.disableLighting();
RenderGlobal.disableLighting();
}
//#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ public boolean setValue(String optionName, Object value) {
*
* @param configClass Your configuration class.
*/
//#if MC > 12104
//$$ @SuppressWarnings("removal")
//#endif
public void parseConfigClass(@NotNull Class<?> configClass) {
for (Field field : configClass.getDeclaredFields()) {
Config annotation = field.getAnnotation(Config.class);
Expand Down Expand Up @@ -220,6 +223,20 @@ public void parseConfigClass(@NotNull Class<?> configClass) {

((IMagicConfigBase) config).setValueChangedFromJsonCallback(
c -> setFieldValue(field, null, ((ConfigColor) c).getColor()));
//#if MC > 12104
//$$ } else if (configFieldObj instanceof fi.dy.masa.malilib.util.data.Color4f) {
//$$ config = new MagicConfigColor(String.format("%s.config.%s", this.identifier, annotation.category()),
//$$ field.getName(), ((fi.dy.masa.malilib.util.data.Color4f) configFieldObj).toHexString());
//$$ option = new ConfigOption(annotation, config);
//$$
//$$ config.setValueChangeCallback(c -> {
//$$ setFieldValue(field, null, ((ConfigColor) c).getColor());
//$$ option.getValueChangeCallback().accept(option);
//$$ });
//$$
//$$ ((IMagicConfigBase) config).setValueChangedFromJsonCallback(
//$$ c -> setFieldValue(field, null, ((ConfigColor) c).getColor()));
//#endif
} else if (configFieldObj instanceof Double) {
Numeric numeric = field.getAnnotation(Numeric.class);

Expand Down
Loading