mirror of
https://github.com/CPTProgrammer/ChatPlus.git
synced 2026-05-05 17:51:00 +08:00
Add support for Minecraft 26.1
- Since Dynmap has not yet been updated to be compatible with Minecraft 26.1, the compatibility Mixins for Dynmap are currently not enabled for this version.
This commit is contained in:
parent
edaf3115bb
commit
43e582fbe6
@ -11,7 +11,7 @@ maven_group=cn.revaria.chatplus
|
|||||||
archives_base_name=chat-plus
|
archives_base_name=chat-plus
|
||||||
|
|
||||||
# Minecraft
|
# Minecraft
|
||||||
minecraft_version=1.21
|
minecraft_version=26.1
|
||||||
|
|
||||||
# Override Fabric API version for local testing (runClient/runServer)
|
# Override Fabric API version for local testing (runClient/runServer)
|
||||||
#test_fabric_api_version=
|
#test_fabric_api_version=
|
||||||
|
|||||||
24
properties/26.1.properties
Normal file
24
properties/26.1.properties
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
java_version=25
|
||||||
|
|
||||||
|
# Fabric Loom
|
||||||
|
# - For Minecraft versions <26.1: enable remap
|
||||||
|
# - For Minecraft versions >=26.1: disable remap
|
||||||
|
fabric_loom_remap=false
|
||||||
|
|
||||||
|
# Fabric Properties
|
||||||
|
# check these on https://fabricmc.net/develop
|
||||||
|
fabric_loader_version=0.19.1
|
||||||
|
min_fabric_loader_version=
|
||||||
|
fabric_api_version=0.144.0
|
||||||
|
# Fabric API mod ID conventions:
|
||||||
|
# - For Minecraft versions <1.19.2: use "fabric"
|
||||||
|
# - For Minecraft versions >=1.19.2: use "fabric-api"
|
||||||
|
# Ref: https://wiki.fabricmc.net/tutorial:setup
|
||||||
|
fabric_api_mod_id=fabric-api
|
||||||
|
|
||||||
|
# Mod Compatibility
|
||||||
|
! Dynmap 3.8
|
||||||
|
mod_dynmap_version=4UHHD4t6
|
||||||
|
! Styled Chat 2.12.0-pre.1+26.1
|
||||||
|
mod_styled_chat_version=2.12.0-pre.1+26.1
|
||||||
|
mod_styled_chat_placeholder_api_version=3.0.0-beta.2+26.1
|
||||||
@ -34,6 +34,10 @@ import static cn.revaria.chatplus.util.TextStyleFormatter.applyStyle;
|
|||||||
"org.dynmap.fabric_1_21_9_10.DynmapPlugin$ChatHandler",
|
"org.dynmap.fabric_1_21_9_10.DynmapPlugin$ChatHandler",
|
||||||
"org.dynmap.fabric_1_21_11.DynmapPlugin$ChatHandler",
|
"org.dynmap.fabric_1_21_11.DynmapPlugin$ChatHandler",
|
||||||
}
|
}
|
||||||
|
#elif MC_VER <= MC_26_1
|
||||||
|
// TODO: Since Dynmap has not yet been updated to be compatible with Minecraft 26.1,
|
||||||
|
// the compatibility Mixins for Dynmap are currently not enabled for this version.
|
||||||
|
{}
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
public abstract class DynmapMixin {
|
public abstract class DynmapMixin {
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
package cn.revaria.chatplus.mixin.compat;
|
package cn.revaria.chatplus.mixin.compat;
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_21
|
||||||
import eu.pb4.placeholders.api.PlaceholderContext;
|
import eu.pb4.placeholders.api.PlaceholderContext;
|
||||||
|
#else
|
||||||
|
import eu.pb4.placeholders.api.ServerPlaceholderContext;
|
||||||
|
#endif
|
||||||
|
|
||||||
import eu.pb4.styledchat.StyledChatUtils;
|
import eu.pb4.styledchat.StyledChatUtils;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
@ -14,8 +19,19 @@ import static cn.revaria.chatplus.util.TextStyleFormatter.applyStyle;
|
|||||||
@Pseudo
|
@Pseudo
|
||||||
@Mixin(StyledChatUtils.class)
|
@Mixin(StyledChatUtils.class)
|
||||||
public abstract class StyledChatMixin {
|
public abstract class StyledChatMixin {
|
||||||
@Inject(method = "formatFor(Leu/pb4/placeholders/api/PlaceholderContext;Ljava/lang/String;)Lnet/minecraft/network/chat/Component;", at = @At("RETURN"), cancellable = true)
|
@Inject(method =
|
||||||
private static void modifyText(PlaceholderContext context, String input, CallbackInfoReturnable<Component> cir) {
|
#if MC_VER <= MC_1_21
|
||||||
cir.setReturnValue(applyStyle(cir.getReturnValue(), context.player()));
|
"formatFor(Leu/pb4/placeholders/api/PlaceholderContext;Ljava/lang/String;)Lnet/minecraft/network/chat/Component;"
|
||||||
|
#else
|
||||||
|
"formatFor(Leu/pb4/placeholders/api/ServerPlaceholderContext;Ljava/lang/String;)Lnet/minecraft/network/chat/Component;"
|
||||||
|
#endif,
|
||||||
|
at = @At("RETURN"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
private static void modifyText(
|
||||||
|
#if MC_VER <= MC_1_21 PlaceholderContext #else ServerPlaceholderContext #endif context,
|
||||||
|
String input, CallbackInfoReturnable<Component> cir
|
||||||
|
) {
|
||||||
|
cir.setReturnValue(applyStyle(cir.getReturnValue(), context.#if MC_VER <= MC_1_21 player() #else serverPlayer() #endif));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user