diff --git a/build.gradle b/build.gradle index a8eddf1..8546370 100644 --- a/build.gradle +++ b/build.gradle @@ -9,12 +9,12 @@ buildscript { //Gradle Plugins plugins { - id 'net.neoforged.gradle.userdev' version '7.0.80' id "com.matthewprenger.cursegradle" version "1.4.0" id 'java' id 'idea' id "com.modrinth.minotaur" version "2.+" - id 'com.github.johnrengelman.shadow' version '8.0.0+' + id 'com.github.johnrengelman.shadow' version '8.1.1+' + id 'net.neoforged.gradle.userdev' version '7.0.109' } apply plugin: 'eclipse' @@ -26,7 +26,7 @@ version = "3.0.7" group = "de.erdbeerbaerlp.dcintegration" archivesBaseName = "dcintegration-neoforge" -java.toolchain.languageVersion = JavaLanguageVersion.of(17) +java.toolchain.languageVersion = JavaLanguageVersion.of(21) //Gradle Repositories repositories { @@ -35,7 +35,6 @@ repositories { name = 'sponge' url = 'https://repo.spongepowered.org/maven' } - maven { url "https://nexus.vankka.dev/repository/maven-public/" } maven { url "https://repository.dev.gotan.io/repository/gotan.os/" } maven { url "https://repo.opencollab.dev/maven-snapshots" } maven { url "https://repo.opencollab.dev/maven-releases" } @@ -54,6 +53,8 @@ configurations { embed compileOnly.extendsFrom(embed) } + +sourceSets.main.resources { srcDir 'src/generated/resources' } task release { } @@ -81,7 +82,7 @@ dependencies { } // ========= NeoForge ============= - implementation "net.neoforged:neoforge:20.4.80-beta" + implementation "net.neoforged:neoforge:20.6.48-beta" //Dynmap-API compileOnly('com.github.webbukkit:DynmapCoreAPI:2.5') diff --git a/gradle.properties b/gradle.properties index b398578..4550327 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,10 @@ # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -changelog=Fixed more bugs\nAdded a /discord rawmsg command\nAdded whitelist option for commandlog +changelog=Port to 1.20.6 releaseType = RELEASE -mcVersion = 1.20.4 \ No newline at end of file +mcVersion = 1.20.6 + + +neogradle.subsystems.parchment.minecraftVersion=1.20.6 +neogradle.subsystems.parchment.mappingsVersion=2024.05.01 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 38d6924..e7518b0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -4,4 +4,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists test=0 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index cb5265b..fd1434c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,5 +7,5 @@ pluginManagement { } plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } \ No newline at end of file diff --git a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java index e930edf..3b87f53 100644 --- a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java +++ b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java @@ -1,6 +1,5 @@ package de.erdbeerbaerlp.dcintegration.forge; -import com.mojang.brigadier.StringReader; import com.mojang.brigadier.exceptions.CommandSyntaxException; import dcshadow.dev.vankka.mcdiscordreserializer.discord.DiscordSerializer; import dcshadow.net.kyori.adventure.text.Component; @@ -32,16 +31,13 @@ import net.dv8tion.jda.api.utils.messages.MessageCreateData; import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; -import net.minecraft.commands.arguments.ComponentArgument; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.IEventBus; import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.IExtensionPoint; import net.neoforged.fml.ModList; -import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.FMLDedicatedServerSetupEvent; import net.neoforged.fml.loading.FMLEnvironment; @@ -84,7 +80,6 @@ public class DiscordIntegrationMod { public DiscordIntegrationMod(IEventBus modEventBus) { LOGGER.info("Version is " + VERSION); bstats = new Metrics(9765); - ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> IExtensionPoint.DisplayTest.IGNORESERVERONLY, (a, b) -> true)); try { //Create data directory if missing if (!discordDataDir.exists()) discordDataDir.mkdir(); @@ -373,13 +368,7 @@ public void command(CommandEvent ev) { } catch (CommandSyntaxException e) { final String txt = GsonComponentSerializer.gson().serialize(mcSubCommand.execute(cmdArgs, null)); - source.sendSuccess(() -> { - try { - return ComponentArgument.textComponent().parse(new StringReader(txt)); - } catch (CommandSyntaxException ignored) { - return null; - } - }, false); + source.sendSuccess(() -> net.minecraft.network.chat.Component.Serializer.fromJson(txt, source.registryAccess()), false); } break; @@ -390,32 +379,14 @@ public void command(CommandEvent ev) { final String txt = GsonComponentSerializer.gson().serialize(mcSubCommand.execute(cmdArgs, player.getUUID())); - source.sendSuccess(() -> { - try { - return ComponentArgument.textComponent().parse(new StringReader(txt)); - } catch (CommandSyntaxException ignored) { - return null; - } - }, false); + source.sendSuccess(() -> net.minecraft.network.chat.Component.Serializer.fromJson(txt, source.registryAccess()), false); } else if (source.hasPermission(4)) { final String txt = GsonComponentSerializer.gson().serialize(mcSubCommand.execute(cmdArgs, player.getUUID())); - source.sendSuccess(() -> { - try { - return ComponentArgument.textComponent().parse(new StringReader(txt)); - } catch (CommandSyntaxException ignored) { - return null; - } - }, false); + source.sendSuccess(() -> net.minecraft.network.chat.Component.Serializer.fromJson(txt, source.registryAccess()), false); } else if (DiscordIntegration.INSTANCE.getServerInterface().playerHasPermissions(player.getUUID(), MinecraftPermission.RUN_DISCORD_COMMAND_ADMIN, MinecraftPermission.ADMIN)) { final String txt = GsonComponentSerializer.gson().serialize(mcSubCommand.execute(cmdArgs, player.getUUID())); - source.sendSuccess(() -> { - try { - return ComponentArgument.textComponent().parse(new StringReader(txt)); - } catch (CommandSyntaxException ignored) { - return null; - } - }, false); + source.sendSuccess(() -> net.minecraft.network.chat.Component.Serializer.fromJson(txt, source.registryAccess()), false); } else { source.sendFailure(net.minecraft.network.chat.Component.nullToEmpty(Localization.instance().commands.noPermission)); } @@ -431,25 +402,13 @@ public void command(CommandEvent ev) { if (!mcSubCommand.needsOP()) { final String txt = GsonComponentSerializer.gson().serialize(mcSubCommand.execute(cmdArgs, player.getUUID())); - source.sendSuccess(() -> { - try { - return ComponentArgument.textComponent().parse(new StringReader(txt)); - } catch (CommandSyntaxException ignored) { - return null; - } - }, false); + source.sendSuccess(() -> net.minecraft.network.chat.Component.Serializer.fromJson(txt, source.registryAccess()), false); } else if (source.hasPermission(4)) { final String txt = GsonComponentSerializer.gson().serialize(mcSubCommand.execute(cmdArgs, player.getUUID())); - source.sendSuccess(() -> { - try { - return ComponentArgument.textComponent().parse(new StringReader(txt)); - } catch (CommandSyntaxException ignored) { - return null; - } - }, false); + source.sendSuccess(() -> net.minecraft.network.chat.Component.Serializer.fromJson(txt, source.registryAccess()), false); } else { source.sendFailure(net.minecraft.network.chat.Component.nullToEmpty(Localization.instance().commands.noPermission)); @@ -458,13 +417,7 @@ public void command(CommandEvent ev) { } catch (CommandSyntaxException e) { final String txt = GsonComponentSerializer.gson().serialize(mcSubCommand.execute(cmdArgs, null)); - source.sendSuccess(() -> { - try { - return ComponentArgument.textComponent().parse(new StringReader(txt)); - } catch (CommandSyntaxException ignored) { - return null; - } - }, false); + source.sendSuccess(() -> net.minecraft.network.chat.Component.Serializer.fromJson(txt, source.registryAccess()), false); } break; } @@ -475,7 +428,6 @@ public void command(CommandEvent ev) { } } - @SubscribeEvent public void serverStopping(ServerStoppedEvent ev) { Metrics.MetricsBase.scheduler.shutdownNow(); @@ -529,7 +481,7 @@ public void chat(ServerChatEvent ev) { })) return; GuildMessageChannel channel = INSTANCE.getChannel(Configuration.instance().advanced.chatOutputChannelID); if (channel == null) return; - final String json = net.minecraft.network.chat.Component.Serializer.toJson(ev.getMessage()); + final String json = net.minecraft.network.chat.Component.Serializer.toJson(ev.getMessage(), ev.getPlayer().registryAccess()); final Component comp = GsonComponentSerializer.gson().deserialize(json); if(INSTANCE.callEvent((e)->e.onMinecraftMessage(comp, ev.getPlayer().getUUID()))){ return; @@ -560,7 +512,7 @@ public void chat(ServerChatEvent ev) { INSTANCE.sendMessage(ForgeMessageUtils.formatPlayerName(ev.getPlayer()), ev.getPlayer().getUUID().toString(), new DiscordMessage(embed, text, true), channel); if (!Configuration.instance().compatibility.disableParsingMentionsIngame) { final String editedJson = GsonComponentSerializer.gson().serialize(MessageUtils.mentionsToNames(comp, channel.getGuild())); - ev.setMessage(net.minecraft.network.chat.Component.Serializer.fromJson(editedJson)); + ev.setMessage(net.minecraft.network.chat.Component.Serializer.fromJson(editedJson, ev.getPlayer().registryAccess())); } } diff --git a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/mixin/ItemEnchantmentsMixin.java b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/mixin/ItemEnchantmentsMixin.java new file mode 100644 index 0000000..38d9bd0 --- /dev/null +++ b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/mixin/ItemEnchantmentsMixin.java @@ -0,0 +1,17 @@ +package de.erdbeerbaerlp.dcintegration.forge.mixin; + +import de.erdbeerbaerlp.dcintegration.forge.util.accessors.ShowInTooltipAccessor; +import net.minecraft.world.item.enchantment.ItemEnchantments; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +@Mixin(ItemEnchantments.class) +public class ItemEnchantmentsMixin implements ShowInTooltipAccessor { + @Shadow @Final boolean showInTooltip; + + + public boolean discordIntegrationFabric$showsInTooltip() { + return showInTooltip; + } +} diff --git a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/mixin/MixinPlayerLogin.java b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/mixin/MixinPlayerLogin.java index 511efce..0dbe400 100644 --- a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/mixin/MixinPlayerLogin.java +++ b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/mixin/MixinPlayerLogin.java @@ -1,7 +1,6 @@ package de.erdbeerbaerlp.dcintegration.forge.mixin; import com.mojang.authlib.GameProfile; -import com.mojang.brigadier.StringReader; import dcshadow.net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import de.erdbeerbaerlp.dcintegration.common.DiscordIntegration; import de.erdbeerbaerlp.dcintegration.common.compat.FloodgateUtils; @@ -9,7 +8,6 @@ import de.erdbeerbaerlp.dcintegration.common.storage.Localization; import de.erdbeerbaerlp.dcintegration.common.storage.linking.LinkManager; import de.erdbeerbaerlp.dcintegration.common.util.MinecraftPermission; -import net.minecraft.commands.arguments.ComponentArgument; import net.minecraft.network.chat.Component; import net.minecraft.server.players.PlayerList; import net.neoforged.neoforge.server.ServerLifecycleHooks; @@ -32,7 +30,7 @@ private void canLogin(SocketAddress address, GameProfile profile, CallbackInfoRe if(eventKick != null){ final String jsonComp = GsonComponentSerializer.gson().serialize(eventKick).replace("\\\\n", "\n"); try { - final Component comp = ComponentArgument.textComponent().parse(new StringReader(jsonComp)); + final Component comp = Component.Serializer.fromJson(jsonComp, ServerLifecycleHooks.getCurrentServer().registryAccess()); cir.setReturnValue(comp); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/ForgeMessageUtils.java b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/ForgeMessageUtils.java index 36e987c..934e120 100644 --- a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/ForgeMessageUtils.java +++ b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/ForgeMessageUtils.java @@ -9,22 +9,27 @@ import dcshadow.org.apache.commons.collections4.keyvalue.DefaultMapEntry; import de.erdbeerbaerlp.dcintegration.common.storage.Configuration; import de.erdbeerbaerlp.dcintegration.common.util.MessageUtils; +import de.erdbeerbaerlp.dcintegration.forge.util.accessors.ShowInTooltipAccessor; +import it.unimi.dsi.fastutil.objects.Object2IntMap; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.MessageEmbed; import net.minecraft.ChatFormatting; -import net.minecraft.commands.arguments.ComponentArgument; import net.minecraft.commands.arguments.NbtTagArgument; import net.minecraft.core.DefaultedRegistry; +import net.minecraft.core.Holder; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.DataComponents; import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.ListTag; -import net.minecraft.nbt.StringTag; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.enchantment.EnchantmentHelper; +import net.minecraft.world.item.component.ItemLore; +import net.minecraft.world.item.component.Unbreakable; +import net.minecraft.world.item.enchantment.Enchantment; +import net.minecraft.world.item.enchantment.ItemEnchantments; +import net.neoforged.neoforge.server.ServerLifecycleHooks; import java.util.Arrays; import java.util.Map; @@ -52,7 +57,7 @@ public static MessageEmbed genItemStackEmbedIfAvailable(final Component componen if (!Configuration.instance().forgeSpecific.sendItemInfo) return null; JsonObject json; try { - final JsonElement jsonElement = JsonParser.parseString(Component.Serializer.toJson(component)); + final JsonElement jsonElement = JsonParser.parseString(Component.Serializer.toJson(component, ServerLifecycleHooks.getCurrentServer().registryAccess())); if (jsonElement.isJsonObject()) json = jsonElement.getAsJsonObject(); else return null; @@ -71,50 +76,40 @@ public static MessageEmbed genItemStackEmbedIfAvailable(final Component componen final JsonObject item = hoverEvent.getAsJsonObject("contents").getAsJsonObject(); try { final ItemStack is = new ItemStack(itemreg.get(new ResourceLocation(item.get("id").getAsString()))); - if (item.has("tag")) { - final CompoundTag tag = (CompoundTag) NbtTagArgument.nbtTag().parse(new StringReader(item.get("tag").getAsString())); - is.setTag(tag); - } - final CompoundTag itemTag = is.getOrCreateTag(); + ItemStack.parse(ServerLifecycleHooks.getCurrentServer().registryAccess(), NbtTagArgument.nbtTag().parse(new StringReader(item.getAsString()))); + final DataComponentMap itemTag = is.getComponents(); final EmbedBuilder b = new EmbedBuilder(); - String title = is.hasCustomHoverName() ? is.getDisplayName().getString() : is.getItem().getDescription().getString(); - if (title.isEmpty()) - title = is.getItem().getDescriptionId(); + Component title = itemTag.getOrDefault(DataComponents.CUSTOM_NAME, Component.translatable(is.getItemHolder().getRegisteredName(), is.getDisplayName().getString(), null)); + if (title.toString().isEmpty()) + title = Component.translatable(is.getItemHolder().getRegisteredName()); else - b.setFooter(is.getItem().getDescriptionId()); - b.setTitle(title); + b.setFooter(is.getItemHolder().getRegisteredName().toString()); + b.setTitle(title.getString()); final StringBuilder tooltip = new StringBuilder(); boolean[] flags = new boolean[6]; // Enchantments, Modifiers, Unbreakable, CanDestroy, CanPlace, Other Arrays.fill(flags, false); // Set everything visible - if (itemTag.contains("HideFlags")) { - final int input = (itemTag.getInt("HideFlags")); - for (int i = 0; i < flags.length; i++) { - flags[i] = (input & (1 << i)) != 0; - } - } //Add Enchantments - if (!flags[0]) { - EnchantmentHelper.getEnchantments(is).forEach((ench, lvl) -> { - tooltip.append(ChatFormatting.stripFormatting(ench.getFullname(lvl).getString())).append("\n"); - }); - } - //Add Lores - final ListTag list = itemTag.getCompound("display").getList("Lore", 8); - list.forEach((nbt) -> { - try { - if (nbt instanceof StringTag) { - final Component comp = ComponentArgument.textComponent().parse(new StringReader(nbt.getAsString())); - tooltip.append("_").append(comp.getString()).append("_\n"); + if (itemTag.has(DataComponents.ENCHANTMENTS)) { + final ItemEnchantments e = itemTag.get(DataComponents.ENCHANTMENTS); + if (((ShowInTooltipAccessor) e).discordIntegrationFabric$showsInTooltip()) + for (Object2IntMap.Entry> ench : e.entrySet()) { + tooltip.append(ChatFormatting.stripFormatting(ench.getKey().value().getFullname(e.getLevel(ench.getKey().value())).getString())).append("\n"); } - } catch (CommandSyntaxException e) { - e.printStackTrace(); + } + if(itemTag.has(DataComponents.LORE)) { + final ItemLore l = itemTag.get(DataComponents.LORE); + //Add Lores + for (Component line : l.lines()) { + tooltip.append("_").append(line.getString()).append("_\n"); } - }); + } //Add 'Unbreakable' Tag - if (!flags[2] && itemTag.contains("Unbreakable") && itemTag.getBoolean("Unbreakable")) - tooltip.append("Unbreakable\n"); - + if(itemTag.has(DataComponents.UNBREAKABLE)){ + final Unbreakable unb = itemTag.get(DataComponents.UNBREAKABLE); + if (unb.showInTooltip()) + tooltip.append("Unbreakable\n"); + } b.setDescription(tooltip.toString()); return b.build(); } catch (CommandSyntaxException ignored) { diff --git a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/ForgeServerInterface.java b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/ForgeServerInterface.java index 66aae3b..4b31fc2 100644 --- a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/ForgeServerInterface.java +++ b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/ForgeServerInterface.java @@ -1,6 +1,5 @@ package de.erdbeerbaerlp.dcintegration.forge.util; -import com.mojang.brigadier.StringReader; import com.mojang.brigadier.exceptions.CommandSyntaxException; import dcshadow.com.vdurmont.emoji.EmojiParser; import dcshadow.net.kyori.adventure.text.Component; @@ -27,7 +26,6 @@ import net.dv8tion.jda.api.entities.emoji.EmojiUnion; import net.dv8tion.jda.api.interactions.InteractionHook; import net.dv8tion.jda.api.requests.RestAction; -import net.minecraft.commands.arguments.ComponentArgument; import net.minecraft.network.protocol.game.ClientboundSoundPacket; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvents; @@ -63,7 +61,7 @@ public void sendIngameMessage(Component msg) { if (!DiscordIntegration.INSTANCE.ignoringPlayers.contains(p.getUUID()) && !(LinkManager.isPlayerLinked(p.getUUID()) && LinkManager.getLink(null, p.getUUID()).settings.ignoreDiscordChatIngame)) { final Map.Entry ping = ComponentUtils.parsePing(msg, p.getUUID(), p.getName().getString()); final String jsonComp = GsonComponentSerializer.gson().serialize(ping.getValue()).replace("\\\\n", "\n"); - final net.minecraft.network.chat.Component comp = ComponentArgument.textComponent().parse(new StringReader(jsonComp)); + final net.minecraft.network.chat.Component comp = net.minecraft.network.chat.Component.Serializer.fromJson(jsonComp, ServerLifecycleHooks.getCurrentServer().registryAccess()); p.sendSystemMessage(comp); if (ping.getKey()) { if (LinkManager.isPlayerLinked(p.getUUID()) && LinkManager.getLink(null, p.getUUID()).settings.pingSound) { @@ -74,7 +72,7 @@ public void sendIngameMessage(Component msg) { } //Send to server console too final String jsonComp = GsonComponentSerializer.gson().serialize(msg).replace("\\\\n", "\n"); - final net.minecraft.network.chat.Component comp = ComponentArgument.textComponent().parse(new StringReader(jsonComp)); + final net.minecraft.network.chat.Component comp = net.minecraft.network.chat.Component.Serializer.fromJson(jsonComp, ServerLifecycleHooks.getCurrentServer().registryAccess()); ServerLifecycleHooks.getCurrentServer().sendSystemMessage(comp); } catch (Exception e) { e.printStackTrace(); @@ -149,7 +147,7 @@ private void sendReactionMCMessage(ServerPlayer target, Component msgComp) { return; final String jsonComp = GsonComponentSerializer.gson().serialize(msgComp).replace("\\\\n", "\n"); try { - final net.minecraft.network.chat.Component comp = ComponentArgument.textComponent().parse(new StringReader(jsonComp)); + final net.minecraft.network.chat.Component comp = net.minecraft.network.chat.Component.Serializer.fromJson(jsonComp, target.level().registryAccess()); target.sendSystemMessage(comp); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/accessors/ShowInTooltipAccessor.java b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/accessors/ShowInTooltipAccessor.java new file mode 100644 index 0000000..14e8074 --- /dev/null +++ b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/accessors/ShowInTooltipAccessor.java @@ -0,0 +1,5 @@ +package de.erdbeerbaerlp.dcintegration.forge.util.accessors; + +public interface ShowInTooltipAccessor { + boolean discordIntegrationFabric$showsInTooltip(); +} diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/neoforge.mods.toml similarity index 93% rename from src/main/resources/META-INF/mods.toml rename to src/main/resources/META-INF/neoforge.mods.toml index 866a672..a0e4516 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -20,15 +20,16 @@ authors = "ErdbeerbaerLP" #optional description = ''' This mod links your server chat with a channel on your discord server. ''' +displayTest="IGNORE_SERVER_VERSION" [[dependencies.dcintegration]] modId = "minecraft" mandatory = true -versionRange = "[1.20.4,]" +versionRange = "[1.20.6,]" ordering = "NONE" side = "SERVER" [[dependencies.dcintegration]] modId = "neoforge" mandatory = true -versionRange = "[20.4,)" +versionRange = "[20.6,)" ordering = "NONE" side = "BOTH" \ No newline at end of file diff --git a/src/main/resources/mixins.dcintegration.json b/src/main/resources/mixins.dcintegration.json index 76b56eb..5be064b 100644 --- a/src/main/resources/mixins.dcintegration.json +++ b/src/main/resources/mixins.dcintegration.json @@ -4,6 +4,7 @@ "compatibilityLevel": "JAVA_11", "server": [ "MixinNetHandlerPlayServer", - "MixinPlayerLogin" + "MixinPlayerLogin", + "ItemEnchantmentsMixin" ] } \ No newline at end of file