diff --git a/README.MD b/README.MD
deleted file mode 100644
index 66986f4..0000000
--- a/README.MD
+++ /dev/null
@@ -1,3 +0,0 @@
-- 这个版本不推出了 Forge 搞心态的玩意
-- 映射出点问题 我还不会修
-- 详情请见 [EnchantmentDoNotConflictForge](src%2Fmain%2Fjava%2Fcom%2Fmingliqiye%2Fminecraft%2Fenchantment%2Fconflict%2FEnchantmentDoNotConflictForge.java)
diff --git a/build.gradle b/build.gradle
index 9485b84..a6628ac 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,7 +19,7 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(21)
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
mappings channel: mapping_channel, version: mapping_version
-
+ reobf = false
copyIdeResources = true
runs {
client {
diff --git a/gradle.properties b/gradle.properties
index 37b6df5..c859b60 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,12 +1,12 @@
org.gradle.jvmargs=-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=1024m
systemProp.file.encoding=UTF-8
-minecraft_version=1.20.6
-minecraft_version_range=[1.20.6]
-forge_version=50.2.0
-forge_version_range=[50,)
-loader_version_range=[50,)
+minecraft_version=1.21
+minecraft_version_range=[1.21,1.22)
+forge_version=51.0.0
+forge_version_range=[51,)
+loader_version_range=[51,)
mapping_channel=official
-mapping_version=1.20.6
+mapping_version=1.21
mod_id=enchantmentdoesnotconflict
mod_name=EnchantmentDoNotConflictForge
mod_license=Apache License 2.0
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/EnchantmentDoNotConflictForge.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/EnchantmentDoNotConflictForge.java
index 1c0d2f5..ea6e6c1 100644
--- a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/EnchantmentDoNotConflictForge.java
+++ b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/EnchantmentDoNotConflictForge.java
@@ -2,42 +2,24 @@ package com.mingliqiye.minecraft.enchantment.conflict;
import com.mingliqiye.minecraft.enchantment.conflict.config.ModConfig;
import com.mingliqiye.minecraft.enchantment.conflict.network.ChannelHander;
-import com.mingliqiye.minecraft.enchantment.conflict.network.message.ConfigMessage;
import com.mojang.logging.LogUtils;
-import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerEvent;
-import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.ModContainer;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.slf4j.Logger;
-/**
- * 有没有大佬能够修复该版本的问题
- * 开发环境可以运行 生产环境报错映射出错 FriendlyByteBuf::writeUtf(String s,int i)
- * @see ConfigMessage
- * @see FriendlyByteBuf
- * @deprecated
- */
@Mod(EnchantmentDoNotConflictForge.MODID)
public class EnchantmentDoNotConflictForge {
public static final String MODID = "enchantmentdoesnotconflict";
private static final Logger LOGGER = LogUtils.getLogger();
- public EnchantmentDoNotConflictForge(IEventBus modEventBus, ModContainer container) {
- container.addConfig(
- new net.minecraftforge.fml.config.ModConfig(net.minecraftforge.fml.config.ModConfig.Type.COMMON,
- ModConfig.SPEC, container));
- modEventBus.addListener(this::commonSetup);
- MinecraftForge.EVENT_BUS.addListener(this::onPlayerLogin);
- }
-
public EnchantmentDoNotConflictForge(FMLJavaModLoadingContext context) {
- this(context.getModEventBus(), context.getContainer());
+ context.getModEventBus().addListener(this::commonSetup);
+ MinecraftForge.EVENT_BUS.addListener(this::onPlayerLogin);
}
public void commonSetup(FMLCommonSetupEvent event) {
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/config/ModConfig.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/config/ModConfig.java
index e4b3ba7..e089b8c 100644
--- a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/config/ModConfig.java
+++ b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/config/ModConfig.java
@@ -1,91 +1,85 @@
package com.mingliqiye.minecraft.enchantment.conflict.config;
-import net.minecraftforge.common.ForgeConfigSpec;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.reflect.TypeToken;
+import com.mingliqiye.minecraft.enchantment.conflict.EnchantmentDoNotConflictForge;
+import com.mojang.logging.LogUtils;
+import net.minecraftforge.fml.loading.FMLPaths;
+import org.slf4j.Logger;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Type;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
public class ModConfig {
- private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
- public static final ForgeConfigSpec.BooleanValue AllowDamageEnchantment =
- BUILDER.define("AllowDamageEnchantment", true);
- public static final ForgeConfigSpec.BooleanValue AllowInfinityEnchantment =
- BUILDER.define("AllowInfinityEnchantment", true);
- public static final ForgeConfigSpec.BooleanValue AllowPiercingEnchantment =
- BUILDER.define("AllowPiercingEnchantment", true);
- public static final ForgeConfigSpec.BooleanValue AllowProtectionEnchantment =
- BUILDER.define("AllowProtectionEnchantment", true);
- public static final ForgeConfigSpec SPEC = BUILDER.build();
+ private final static Path CONFIG_PATH = FMLPaths.CONFIGDIR.get().resolve(EnchantmentDoNotConflictForge.MODID +
+ ".json");
+ private static final Gson GSON = new GsonBuilder().setPrettyPrinting().serializeNulls().create();
+ public static final Type TYPE = new TypeToken>>() {
+ }.getType();
+ private static Map> instance;
+ private static final Logger LOGGER = LogUtils.getLogger();
- private static ConfigItem instance;
-
- public static ConfigItem getInstance() {
- return instance;
- }
-
- public static void setInstance(ConfigItem ins) {
- instance = ins;
+ public ModConfig() {
}
- public static void load() {
- instance = new ConfigItem(AllowDamageEnchantment.get(), AllowInfinityEnchantment.get(),
- AllowPiercingEnchantment.get(), AllowProtectionEnchantment.get());
+ public static Map> getInstance() {
+ return ModConfig.instance;
}
- public static class ConfigItem {
- private boolean allowDamageEnchantment;
- private boolean allowInfinityEnchantment;
- private boolean allowPiercingEnchantment;
- private boolean allowProtectionEnchantment;
+ public static void reload() {
+ load();
+ }
- ConfigItem() {
+ public static void setInstance(Map> instance) {
+ ModConfig.instance = instance;
+ }
+
+ public static Map> load() {
+ try {
+ if (Files.exists(CONFIG_PATH)) {
+ return GSON.fromJson(Files.newBufferedReader(CONFIG_PATH), TYPE);
+ }
+ } catch (IOException e) {
+ LOGGER.error(e.getMessage(),e);
}
+ Map> modConfig = getDefData();
+ setInstance(modConfig);
+ save();
+ return modConfig;
+ }
- ConfigItem(boolean a, boolean b, boolean c, boolean d) {
- this.allowDamageEnchantment = a;
- this.allowInfinityEnchantment = b;
- this.allowPiercingEnchantment = c;
- this.allowProtectionEnchantment = d;
-
+ public static void save() {
+ try {
+ Files.writeString(CONFIG_PATH, GSON.toJson(instance));
+ } catch (IOException e) {
+ LOGGER.error(e.getMessage(),e);
}
+ }
- public boolean isAllowDamageEnchantment() {
- return allowDamageEnchantment;
- }
-
- public void setAllowDamageEnchantment(boolean allowDamageEnchantment) {
- this.allowDamageEnchantment = allowDamageEnchantment;
- }
-
- public boolean isAllowInfinityEnchantment() {
- return allowInfinityEnchantment;
- }
-
- public void setAllowInfinityEnchantment(boolean allowInfinityEnchantment) {
- this.allowInfinityEnchantment = allowInfinityEnchantment;
- }
-
- public boolean isAllowPiercingEnchantment() {
- return allowPiercingEnchantment;
- }
-
- public void setAllowPiercingEnchantment(boolean allowPiercingEnchantment) {
- this.allowPiercingEnchantment = allowPiercingEnchantment;
- }
-
- public boolean isAllowProtectionEnchantment() {
- return allowProtectionEnchantment;
- }
-
- public void setAllowProtectionEnchantment(boolean allowProtectionEnchantment) {
- this.allowProtectionEnchantment = allowProtectionEnchantment;
- }
- public String toString() {
- return this.getClass().getName() + "(" + "allowDamageEnchantment" +
- "=" + allowDamageEnchantment + "," +
- "allowInfinityEnchantment" + "=" + allowInfinityEnchantment +
- "," + "allowPiercingEnchantment" + "=" +
- allowPiercingEnchantment + "," +
- "allowProtectionEnchantment" + "=" +
- allowProtectionEnchantment + ")";
+ public static Map> getDefData() {
+ try {
+ InputStream inputStream = ModConfig.class.getResourceAsStream(
+ "/assets/enchantmentdoesnotconflict" + "/EnchantmentDoNotConflict.json");
+ if (inputStream != null) {
+ try (InputStreamReader reader = new InputStreamReader(inputStream)) {
+ return GSON.fromJson(reader, TYPE);
+ }
+ } else {
+ throw new RuntimeException("resources 文件内 没有 EnchantmentDoNotConflict.json?");
+ }
+ } catch (RuntimeException | IOException e) {
+ LOGGER.error(e.getMessage(), e);
+ throw new RuntimeException(e);
}
}
}
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/enchantment/AddAllowEnchantmentFunInf.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/enchantment/AddAllowEnchantmentFunInf.java
new file mode 100644
index 0000000..a2c635b
--- /dev/null
+++ b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/enchantment/AddAllowEnchantmentFunInf.java
@@ -0,0 +1,9 @@
+package com.mingliqiye.minecraft.enchantment.conflict.enchantment;
+
+import java.util.List;
+import java.util.Map;
+
+@FunctionalInterface
+public interface AddAllowEnchantmentFunInf {
+ Map> call();
+}
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/enchantment/Enchantment.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/enchantment/Enchantment.java
new file mode 100644
index 0000000..5526cab
--- /dev/null
+++ b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/enchantment/Enchantment.java
@@ -0,0 +1,76 @@
+package com.mingliqiye.minecraft.enchantment.conflict.enchantment;
+import com.mingliqiye.minecraft.enchantment.conflict.EnchantmentDoNotConflictForge;
+import com.mingliqiye.minecraft.enchantment.conflict.config.ModConfig;
+import com.mojang.logging.LogUtils;
+import org.slf4j.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class Enchantment {
+ private static final Logger LOGGER = LogUtils.getLogger();
+ private final String id;
+ private final String father;
+ private final static List allowEnchantmentFunInfs = new ArrayList<>();
+
+ public static void registerAllowEnchantment(AddAllowEnchantmentFunInf fun) {
+ allowEnchantmentFunInfs.add(fun);
+ }
+
+ public static void reload() {
+ ModConfig.reload();
+ allowEnchantmentFunInfs.forEach(e -> {
+ Map> conf = ModConfig.getInstance();
+ conf.putAll(e.call());
+ ModConfig.setInstance(conf);
+ });
+ //sendToAllPlayers();
+ LOGGER.info("reload {} Ok Entity: \n{}", EnchantmentDoNotConflictForge.MODID, ModConfig.getInstance());
+ }
+
+ public Enchantment(String id, String father) {
+ this.id = id;
+ this.father = father;
+ }
+
+ public static List ofId(String id, Map> listMap) {
+ final List enchantmentList = new ArrayList<>();
+ for (String i : listMap.keySet()) {
+ if (listMap.get(i).contains(id)) {
+ enchantmentList.add(new Enchantment(id, i));
+ }
+ }
+ return enchantmentList;
+ }
+
+ public static Boolean canBeCombined(String enchantmentA, String enchantmentB) {
+ if (enchantmentA.equals(enchantmentB)) {
+ return true;
+ }
+ Map> config = ModConfig.getInstance();
+ List groupsA = ofId(enchantmentA, config);
+ List groupsB = ofId(enchantmentB, config);
+
+ if (groupsA.isEmpty() && groupsB.isEmpty()) {
+ return null;
+ }
+
+ for (Enchantment groupA : groupsA) {
+ for (Enchantment groupB : groupsB) {
+ if (groupA.getFather().equals(groupB.getFather())) {
+ return true;
+ }
+ }
+ }
+ return null;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getFather() {
+ return father;
+ }
+}
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ArrowInfiniteEnchantmentMixin.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ArrowInfiniteEnchantmentMixin.java
deleted file mode 100644
index 5f4e7e1..0000000
--- a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ArrowInfiniteEnchantmentMixin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.mingliqiye.minecraft.enchantment.conflict.mixin;
-
-import com.mingliqiye.minecraft.enchantment.conflict.config.ModConfig;
-import net.minecraft.world.item.enchantment.ArrowInfiniteEnchantment;
-import net.minecraft.world.item.enchantment.Enchantment;
-import net.minecraft.world.item.enchantment.MendingEnchantment;
-import org.jetbrains.annotations.NotNull;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-@Mixin(ArrowInfiniteEnchantment.class)
-public abstract class ArrowInfiniteEnchantmentMixin {
-
- @Inject(method = "checkCompatibility", at = @At("HEAD"), cancellable = true)
- private void canAccept(
- @NotNull Enchantment enchantment,
- @NotNull CallbackInfoReturnable cir
- ) {
- if (enchantment instanceof MendingEnchantment) {
- cir.setReturnValue(ModConfig.getInstance().isAllowInfinityEnchantment());
- }
- }
-}
-
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ArrowPiercingEnchantmentMixin.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ArrowPiercingEnchantmentMixin.java
deleted file mode 100644
index c459316..0000000
--- a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ArrowPiercingEnchantmentMixin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.mingliqiye.minecraft.enchantment.conflict.mixin;
-
-
-import com.mingliqiye.minecraft.enchantment.conflict.config.ModConfig;
-import net.minecraft.world.item.enchantment.ArrowPiercingEnchantment;
-import net.minecraft.world.item.enchantment.Enchantment;
-import net.minecraft.world.item.enchantment.Enchantments;
-import org.jetbrains.annotations.NotNull;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-@Mixin(ArrowPiercingEnchantment.class)
-public abstract class ArrowPiercingEnchantmentMixin {
-
- @Inject(method = "checkCompatibility", at = @At("HEAD"), cancellable = true)
- private void canAccept(
- @NotNull Enchantment enchantment,
- @NotNull CallbackInfoReturnable cir
- ) {
- if (enchantment == Enchantments.MULTISHOT) {
- cir.setReturnValue(ModConfig.getInstance().isAllowPiercingEnchantment());
- }
- }
-}
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/DamageEnchantmentMixin.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/DamageEnchantmentMixin.java
deleted file mode 100644
index 07a45aa..0000000
--- a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/DamageEnchantmentMixin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.mingliqiye.minecraft.enchantment.conflict.mixin;
-
-
-import com.mingliqiye.minecraft.enchantment.conflict.config.ModConfig;
-import net.minecraft.world.item.enchantment.DamageEnchantment;
-import net.minecraft.world.item.enchantment.Enchantment;
-import org.jetbrains.annotations.NotNull;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-@Mixin(DamageEnchantment.class)
-public abstract class DamageEnchantmentMixin {
-
- @Inject(method = "checkCompatibility", at = @At("HEAD"), cancellable = true)
- private void canAccept(
- @NotNull Enchantment enchantment,
- @NotNull CallbackInfoReturnable cir
- ) {
- if (enchantment instanceof DamageEnchantment) {
- cir.setReturnValue(ModConfig.getInstance().isAllowDamageEnchantment());
- }
- }
-
-}
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/EnchantmentMixin.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/EnchantmentMixin.java
new file mode 100644
index 0000000..93a4a89
--- /dev/null
+++ b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/EnchantmentMixin.java
@@ -0,0 +1,25 @@
+package com.mingliqiye.minecraft.enchantment.conflict.mixin;
+
+import com.mingliqiye.minecraft.enchantment.conflict.enchantment.Enchantment;
+import net.minecraft.core.Holder;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+@Mixin(net.minecraft.world.item.enchantment.Enchantment.class)
+public abstract class EnchantmentMixin {
+
+
+ @Inject(method = "areCompatible", at = @At("HEAD"), cancellable = true)
+ private static void canBeCombined(
+ Holder first,
+ Holder second, CallbackInfoReturnable cir
+ ) {
+ Boolean cbc = Enchantment.canBeCombined(first.getRegisteredName(), second.getRegisteredName());
+ if (cbc == null) {
+ return;
+ }
+ cir.setReturnValue(cbc);
+ }
+}
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ProtectionEnchantmentMixin.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ProtectionEnchantmentMixin.java
deleted file mode 100644
index 8414b5f..0000000
--- a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/mixin/ProtectionEnchantmentMixin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.mingliqiye.minecraft.enchantment.conflict.mixin;
-
-
-import com.mingliqiye.minecraft.enchantment.conflict.config.ModConfig;
-import net.minecraft.world.item.enchantment.Enchantment;
-import net.minecraft.world.item.enchantment.ProtectionEnchantment;
-import org.jetbrains.annotations.NotNull;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-@Mixin(ProtectionEnchantment.class)
-public abstract class ProtectionEnchantmentMixin {
-
- @Inject(method = "checkCompatibility", at = @At("HEAD"), cancellable = true)
-
- private void onCheckCompatibility(
- @NotNull Enchantment enchantment,
- @NotNull CallbackInfoReturnable cir
- ) {
- if (enchantment instanceof ProtectionEnchantment) {
- cir.setReturnValue(ModConfig.getInstance().isAllowProtectionEnchantment());
- }
- }
-}
diff --git a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/network/message/ConfigMessage.java b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/network/message/ConfigMessage.java
index 8fec5c1..0396315 100644
--- a/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/network/message/ConfigMessage.java
+++ b/src/main/java/com/mingliqiye/minecraft/enchantment/conflict/network/message/ConfigMessage.java
@@ -9,13 +9,15 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.event.network.CustomPayloadEvent;
import net.minecraftforge.network.NetworkDirection;
import net.minecraftforge.network.PacketDistributor;
-import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
+import java.util.List;
+import java.util.Map;
+
import static com.mingliqiye.minecraft.enchantment.conflict.network.ChannelHander.CONFIG_CHANNEL_INSTANCE;
import static com.mingliqiye.minecraft.enchantment.conflict.network.ChannelHander.CONFIG_SYNC;
-public record ConfigMessage(ModConfig.ConfigItem data) {
+public record ConfigMessage(Map> data) {
private static final Logger LOGGER = LogUtils.getLogger();
private static final Gson GSON = new Gson();
@@ -25,19 +27,16 @@ public record ConfigMessage(ModConfig.ConfigItem data) {
.decoder(ConfigMessage::decode).encoder(ConfigMessage::encode).consumerMainThread(ConfigMessage::handle).add();
}
- /**
- * @deprecated
- */
public static void encode(ConfigMessage configMessage, FriendlyByteBuf byteBuf) {
byteBuf.writeUtf(GSON.toJson(configMessage.data),32767);
}
public static ConfigMessage decode(FriendlyByteBuf byteBuf) {
- return new ConfigMessage(GSON.fromJson(byteBuf.readUtf(), ModConfig.ConfigItem.class));
+ return new ConfigMessage(GSON.fromJson(byteBuf.readUtf(), ModConfig.TYPE));
}
public static void send(ServerPlayer player) {
- ModConfig.ConfigItem configItem = ModConfig.getInstance();
+ Map> configItem = ModConfig.getInstance();
CONFIG_CHANNEL_INSTANCE.send(new ConfigMessage(configItem),PacketDistributor.PLAYER.with(player));
LOGGER.info("Send Server Config {} to {} data={}", EnchantmentDoNotConflictForge.MODID,
player.getDisplayName().getString(), configItem);
diff --git a/src/main/resources/assets/enchantmentdoesnotconflict/EnchantmentDoNotConflict.json b/src/main/resources/assets/enchantmentdoesnotconflict/EnchantmentDoNotConflict.json
new file mode 100644
index 0000000..a307151
--- /dev/null
+++ b/src/main/resources/assets/enchantmentdoesnotconflict/EnchantmentDoNotConflict.json
@@ -0,0 +1,23 @@
+{
+ "minecraft:damageEnchantment": [
+ "minecraft:sharpness",
+ "minecraft:smite",
+ "minecraft:bane_of_arthropods",
+ "minecraft:density",
+ "minecraft:breach"
+ ],
+ "minecraft:infinityEnchantment": [
+ "minecraft:infinity",
+ "minecraft:mending"
+ ],
+ "minecraft:piercingEnchantment": [
+ "minecraft:piercing",
+ "minecraft:multishot"
+ ],
+ "minecraft:protectionEnchantment": [
+ "minecraft:protection",
+ "minecraft:fire_protection",
+ "minecraft:blast_protection",
+ "minecraft:projectile_protection"
+ ]
+}
diff --git a/src/main/resources/enchantmentdoesnotconflict.mixins.json b/src/main/resources/enchantmentdoesnotconflict.mixins.json
index fd65809..369865c 100644
--- a/src/main/resources/enchantmentdoesnotconflict.mixins.json
+++ b/src/main/resources/enchantmentdoesnotconflict.mixins.json
@@ -4,10 +4,7 @@
"refmap": "enchantmentdoesnotconflict.mixins.refmap.json",
"compatibilityLevel": "JAVA_17",
"mixins": [
- "ArrowInfiniteEnchantmentMixin",
- "ArrowPiercingEnchantmentMixin",
- "DamageEnchantmentMixin",
- "ProtectionEnchantmentMixin"
+ "EnchantmentMixin"
],
"injectors": {
"defaultRequire": 1