Skip to content

Commit

Permalink
revert fabric branch to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
burdoto committed Oct 25, 2024
1 parent 0fe75f3 commit 64eddf7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ loom {

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
minecraft "com.mojang:minecraft:${project.minecraft_version_fabric}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import net.kyori.adventure.util.TriState;
import net.minecraft.server.MinecraftServer;
import net.minecraft.text.Text;
import net.minecraft.text.TextCodecs;
import org.comroid.api.func.util.Command;
import org.comroid.api.java.StackTraceUtils;
import org.comroid.api.tree.LifeCycle;
Expand All @@ -35,11 +34,6 @@ public class BanModFabric extends SubMod$Fabric implements BanMod, ModInitialize
StackTraceUtils.EXTRA_FILTER_NAMES.add("com.ampznetwork");
}

public static Text component2text(net.kyori.adventure.text.Component component) {
var json = GsonComponentSerializer.gson().serializeToTree(component);
return TextCodecs.STRINGIFIED_CODEC.parse(JsonOps.INSTANCE, json).getOrThrow(JsonParseException::new);
}

private final FabricEventDispatch eventDispatch = new FabricEventDispatch(this);
private BanModConfig config = Config.createAndLoad(BanModConfig.class);
private MinecraftServer server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.ampznetwork.libmod.fabric.LibModFabric;
import lombok.Value;
import net.fabricmc.fabric.api.message.v1.ServerMessageEvents;
import net.fabricmc.fabric.api.networking.v1.LoginPacketSender;
import net.fabricmc.fabric.api.networking.v1.PacketSender;
import net.fabricmc.fabric.api.networking.v1.ServerLoginConnectionEvents;
import net.fabricmc.fabric.api.networking.v1.ServerLoginNetworking;
import net.minecraft.network.message.MessageType;
Expand Down Expand Up @@ -40,7 +40,7 @@ public FabricEventDispatch(BanMod banMod) {

@Override
public void onLoginStart(
ServerLoginNetworkHandler handler, MinecraftServer server, LoginPacketSender sender, ServerLoginNetworking.LoginSynchronizer synchronizer
ServerLoginNetworkHandler handler, MinecraftServer server, PacketSender sender, ServerLoginNetworking.LoginSynchronizer synchronizer
) {
try {
// thank you fabric devs for this very useful and reasonable method
Expand Down Expand Up @@ -79,7 +79,7 @@ public boolean allowChatMessage(SignedMessage message, ServerPlayerEntity sender
var maySend = !result.isMuted();
if (!maySend)
BanMod.Resources.notify(mod, playerId, Punishment.Mute, result, (id, msg) -> {
var serialize = mod.as(BanModFabric.class).assertion().component2text(msg);
var serialize = LibModFabric.component2text(msg);
sender.sendMessage(serialize);
});
return maySend;
Expand Down

0 comments on commit 64eddf7

Please sign in to comment.