cir) {
+ if (AmsServerSettings.sharedVillagerDiscounts && filter.test(MAJOR_POSITIVE)) {
+ GetValueForInvoker targetReputation = (GetValueForInvoker)entityReputation.get(target);
+ int otherRepertory = 0;
+ if (targetReputation != null) { otherRepertory = targetReputation._getValueFor(vgt -> filter.test(vgt) && !vgt.equals(MAJOR_POSITIVE)); }
+ int majorPositiveRepertory = entityReputation.values().stream().mapToInt(r -> ((GetValueForInvoker) r)._getValueFor(vgt -> vgt.equals(MAJOR_POSITIVE))).sum();
+ cir.setReturnValue(otherRepertory + Math.min(majorPositiveRepertory, MAJOR_POSITIVE.maxValue * MAJOR_POSITIVE.multiplier));
+ }
+ }
+}
diff --git a/src/main/java/club/mcams/carpet/settings/AmsRuleCategory.java b/src/main/java/club/mcams/carpet/settings/AmsRuleCategory.java
index 7af9bd21..1e553c1b 100644
--- a/src/main/java/club/mcams/carpet/settings/AmsRuleCategory.java
+++ b/src/main/java/club/mcams/carpet/settings/AmsRuleCategory.java
@@ -1,41 +1,41 @@
-/*
- * This file is part of the Carpet AMS Addition project, licensed under the
- * GNU Lesser General Public License v3.0
- *
- * Copyright (C) 2023 A Minecraft Server and contributors
- *
- * Carpet AMS Addition is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Carpet AMS Addition is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Carpet AMS Addition. If not, see .
- */
-
-package club.mcams.carpet.settings;
-
-@SuppressWarnings("unused")
-public class AmsRuleCategory {
- public static final String AMS = "AMS";
- public static final String CRAFTING = "crafting";
- public static final String AMS_MOVABLE = "AMS_movable";
- public static final String AMS_CHUNKLOADER = "AMS_chunkLoader";
-//==================================================================
- public static final String BUGFIX = "bugfix";
- public static final String SURVIVAL = "survival";
- public static final String CREATIVE = "creative";
- public static final String EXPERIMENTAL = "experimental";
- public static final String OPTIMIZATION = "optimization";
- public static final String FEATURE = "feature";
- public static final String COMMAND = "command";
- public static final String TNT = "tnt";
- public static final String DISPENSER = "dispenser";
- public static final String SCARPET = "scarpet";
- public static final String CLIENT = "client";
-}
+/*
+ * This file is part of the Carpet AMS Addition project, licensed under the
+ * GNU Lesser General Public License v3.0
+ *
+ * Copyright (C) 2023 A Minecraft Server and contributors
+ *
+ * Carpet AMS Addition is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Carpet AMS Addition is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Carpet AMS Addition. If not, see .
+ */
+
+package club.mcams.carpet.settings;
+
+@SuppressWarnings("unused")
+public class AmsRuleCategory {
+ public static final String AMS = "AMS";
+ public static final String CRAFTING = "crafting";
+ public static final String AMS_MOVABLE = "AMS_movable";
+ public static final String AMS_CHUNKLOADER = "AMS_chunkLoader";
+//==================================================================
+ public static final String BUGFIX = "bugfix";
+ public static final String SURVIVAL = "survival";
+ public static final String CREATIVE = "creative";
+ public static final String EXPERIMENTAL = "experimental";
+ public static final String OPTIMIZATION = "optimization";
+ public static final String FEATURE = "feature";
+ public static final String COMMAND = "command";
+ public static final String TNT = "tnt";
+ public static final String DISPENSER = "dispenser";
+ public static final String SCARPET = "scarpet";
+ public static final String CLIENT = "client";
+}
diff --git a/src/main/java/club/mcams/carpet/util/AutoMixinAuditExecutor/AutoMixinAuditExecutor.java b/src/main/java/club/mcams/carpet/util/AutoMixinAuditExecutor/AutoMixinAuditExecutor.java
index adff66e4..e1239da0 100644
--- a/src/main/java/club/mcams/carpet/util/AutoMixinAuditExecutor/AutoMixinAuditExecutor.java
+++ b/src/main/java/club/mcams/carpet/util/AutoMixinAuditExecutor/AutoMixinAuditExecutor.java
@@ -1,38 +1,38 @@
-/*
- * This file is part of the Carpet AMS Addition project, licensed under the
- * GNU Lesser General Public License v3.0
- *
- * Copyright (C) 2023 A Minecraft Server and contributors
- *
- * Carpet AMS Addition is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Carpet AMS Addition is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Carpet AMS Addition. If not, see .
- */
-
-package club.mcams.carpet.util.AutoMixinAuditExecutor;
-
-import club.mcams.carpet.AmsServer;
-import club.mcams.carpet.util.MixinUtil;
-
-import net.fabricmc.loader.api.FabricLoader;
-
-public class AutoMixinAuditExecutor {
- private static final String KEYWORD_PROPERTY = "carpetamsaddition.mixin_audit";
- public static void run() {
- if (FabricLoader.getInstance().isDevelopmentEnvironment() && "true".equals(System.getProperty(KEYWORD_PROPERTY))) {
- AmsServer.LOGGER.info("Triggered auto mixin audit");
- boolean ok = MixinUtil.audit(null);
- AmsServer.LOGGER.info("Mixin audit result: " + (ok ? "successful" : "failed"));
- System.exit(ok ? 0 : 1);
- }
- }
+/*
+ * This file is part of the Carpet AMS Addition project, licensed under the
+ * GNU Lesser General Public License v3.0
+ *
+ * Copyright (C) 2023 A Minecraft Server and contributors
+ *
+ * Carpet AMS Addition is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Carpet AMS Addition is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Carpet AMS Addition. If not, see .
+ */
+
+package club.mcams.carpet.util.AutoMixinAuditExecutor;
+
+import club.mcams.carpet.AmsServer;
+import club.mcams.carpet.util.MixinUtil;
+
+import net.fabricmc.loader.api.FabricLoader;
+
+public class AutoMixinAuditExecutor {
+ private static final String KEYWORD_PROPERTY = "carpetamsaddition.mixin_audit";
+ public static void run() {
+ if (FabricLoader.getInstance().isDevelopmentEnvironment() && "true".equals(System.getProperty(KEYWORD_PROPERTY))) {
+ AmsServer.LOGGER.info("Triggered auto mixin audit");
+ boolean ok = MixinUtil.audit(null);
+ AmsServer.LOGGER.info("Mixin audit result: " + (ok ? "successful" : "failed"));
+ System.exit(ok ? 0 : 1);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/main/java/club/mcams/carpet/util/CommandHelper.java b/src/main/java/club/mcams/carpet/util/CommandHelper.java
index e5aab34c..57a1620f 100644
--- a/src/main/java/club/mcams/carpet/util/CommandHelper.java
+++ b/src/main/java/club/mcams/carpet/util/CommandHelper.java
@@ -1,56 +1,56 @@
-/*
- * This file is part of the Carpet AMS Addition project, licensed under the
- * GNU Lesser General Public License v3.0
- *
- * Copyright (C) 2023 A Minecraft Server and contributors
- *
- * Carpet AMS Addition is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Carpet AMS Addition is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Carpet AMS Addition. If not, see .
- */
-
-package club.mcams.carpet.util;
-
-import net.minecraft.command.CommandSource;
-
-/**
- * From gnembon's carpet mod lol
- *
- * A few helpful methods to work with settings and commands.
- *
- * This is not any kind of API, but it's unlikely to change
- */
-public final class CommandHelper {
- private CommandHelper() {
- }
-
- /**
- * Whether the given source has enough permission level to run a command that requires the given commandLevel
- */
- public static boolean canUseCommand(CommandSource source, Object commandLevel) {
- if (commandLevel instanceof Boolean) return (Boolean) commandLevel;
- String commandLevelString = commandLevel.toString();
- switch (commandLevelString) {
- case "true": return true;
- case "false": return false;
- case "ops": return source.hasPermissionLevel(2); // typical for other cheaty commands
- case "0":
- case "1":
- case "2":
- case "3":
- case "4":
- return source.hasPermissionLevel(Integer.parseInt(commandLevelString));
- default:
- return false;
- }
- }
-}
+/*
+ * This file is part of the Carpet AMS Addition project, licensed under the
+ * GNU Lesser General Public License v3.0
+ *
+ * Copyright (C) 2023 A Minecraft Server and contributors
+ *
+ * Carpet AMS Addition is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Carpet AMS Addition is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Carpet AMS Addition. If not, see .
+ */
+
+package club.mcams.carpet.util;
+
+import net.minecraft.command.CommandSource;
+
+/**
+ * From gnembon's carpet mod lol
+ *
+ * A few helpful methods to work with settings and commands.
+ *
+ * This is not any kind of API, but it's unlikely to change
+ */
+public final class CommandHelper {
+ private CommandHelper() {
+ }
+
+ /**
+ * Whether the given source has enough permission level to run a command that requires the given commandLevel
+ */
+ public static boolean canUseCommand(CommandSource source, Object commandLevel) {
+ if (commandLevel instanceof Boolean) return (Boolean) commandLevel;
+ String commandLevelString = commandLevel.toString();
+ switch (commandLevelString) {
+ case "true": return true;
+ case "false": return false;
+ case "ops": return source.hasPermissionLevel(2); // typical for other cheaty commands
+ case "0":
+ case "1":
+ case "2":
+ case "3":
+ case "4":
+ return source.hasPermissionLevel(Integer.parseInt(commandLevelString));
+ default:
+ return false;
+ }
+ }
+}
diff --git a/src/main/java/club/mcams/carpet/util/Logging.java b/src/main/java/club/mcams/carpet/util/Logging.java
index a4820134..1a9c96f0 100644
--- a/src/main/java/club/mcams/carpet/util/Logging.java
+++ b/src/main/java/club/mcams/carpet/util/Logging.java
@@ -1,95 +1,95 @@
-/*
- * This file is part of the Carpet AMS Addition project, licensed under the
- * GNU Lesser General Public License v3.0
- *
- * Copyright (C) 2023 A Minecraft Server and contributors
- *
- * Carpet AMS Addition is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Carpet AMS Addition is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Carpet AMS Addition. If not, see .
- */
-
-package club.mcams.carpet.util;
-
-import club.mcams.carpet.AmsServer;
-
-import java.util.Collections;
-import java.util.IdentityHashMap;
-import java.util.Set;
-
-public class Logging {
- public static void logStackTrace(Throwable e) {
- Set dejaVu = Collections.newSetFromMap(new IdentityHashMap<>());
- dejaVu.add(e);
-
- // Print our stack trace
- AmsServer.LOGGER.error(e);
- StackTraceElement[] trace = e.getStackTrace();
- for (StackTraceElement traceElement : trace) {
- AmsServer.LOGGER.error("\tat " + traceElement);
- }
-
- // Print suppressed exceptions, if any
- for (Throwable se : e.getSuppressed()) {
- logEnclosedStackTrace(se, trace, "Suppressed: ", "\t", dejaVu);
- }
-
- // Print cause, if any
- Throwable ourCause = e.getCause();
- if (ourCause != null) {
- logEnclosedStackTrace(ourCause, trace, "Caused by: ", "", dejaVu);
- }
- }
-
- private static void logEnclosedStackTrace(
- Throwable e,
- StackTraceElement[] enclosingTrace,
- String caption,
- String prefix,
- Set dejaVu
- ) {
- if (dejaVu.contains(e)) {
- AmsServer.LOGGER.error(prefix + caption + "[CIRCULAR REFERENCE: " + e + "]");
- } else {
- dejaVu.add(e);
- // Compute number of frames in common between e and enclosing trace
- StackTraceElement[] trace = e.getStackTrace();
- int m = trace.length - 1;
- int n = enclosingTrace.length - 1;
- while (m >= 0 && n >= 0 && trace[m].equals(enclosingTrace[n])) {
- m--;
- n--;
- }
- int framesInCommon = trace.length - 1 - m;
-
- // Print our stack trace
- AmsServer.LOGGER.error(prefix + caption + e);
- for (int i = 0; i <= m; i++) {
- AmsServer.LOGGER.error(prefix + "\tat " + trace[i]);
- }
- if (framesInCommon != 0) {
- AmsServer.LOGGER.error(prefix + "\t... " + framesInCommon + " more");
- }
-
- // Print suppressed exceptions, if any
- for (Throwable se : e.getSuppressed()) {
- logEnclosedStackTrace(se, trace, "Suppressed: ", prefix + "\t", dejaVu);
- }
-
- // Print cause, if any
- Throwable ourCause = e.getCause();
- if (ourCause != null) {
- logEnclosedStackTrace(ourCause, trace, "Caused by: ", prefix, dejaVu);
- }
- }
- }
-}
+/*
+ * This file is part of the Carpet AMS Addition project, licensed under the
+ * GNU Lesser General Public License v3.0
+ *
+ * Copyright (C) 2023 A Minecraft Server and contributors
+ *
+ * Carpet AMS Addition is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Carpet AMS Addition is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Carpet AMS Addition. If not, see .
+ */
+
+package club.mcams.carpet.util;
+
+import club.mcams.carpet.AmsServer;
+
+import java.util.Collections;
+import java.util.IdentityHashMap;
+import java.util.Set;
+
+public class Logging {
+ public static void logStackTrace(Throwable e) {
+ Set dejaVu = Collections.newSetFromMap(new IdentityHashMap<>());
+ dejaVu.add(e);
+
+ // Print our stack trace
+ AmsServer.LOGGER.error(e);
+ StackTraceElement[] trace = e.getStackTrace();
+ for (StackTraceElement traceElement : trace) {
+ AmsServer.LOGGER.error("\tat " + traceElement);
+ }
+
+ // Print suppressed exceptions, if any
+ for (Throwable se : e.getSuppressed()) {
+ logEnclosedStackTrace(se, trace, "Suppressed: ", "\t", dejaVu);
+ }
+
+ // Print cause, if any
+ Throwable ourCause = e.getCause();
+ if (ourCause != null) {
+ logEnclosedStackTrace(ourCause, trace, "Caused by: ", "", dejaVu);
+ }
+ }
+
+ private static void logEnclosedStackTrace(
+ Throwable e,
+ StackTraceElement[] enclosingTrace,
+ String caption,
+ String prefix,
+ Set dejaVu
+ ) {
+ if (dejaVu.contains(e)) {
+ AmsServer.LOGGER.error(prefix + caption + "[CIRCULAR REFERENCE: " + e + "]");
+ } else {
+ dejaVu.add(e);
+ // Compute number of frames in common between e and enclosing trace
+ StackTraceElement[] trace = e.getStackTrace();
+ int m = trace.length - 1;
+ int n = enclosingTrace.length - 1;
+ while (m >= 0 && n >= 0 && trace[m].equals(enclosingTrace[n])) {
+ m--;
+ n--;
+ }
+ int framesInCommon = trace.length - 1 - m;
+
+ // Print our stack trace
+ AmsServer.LOGGER.error(prefix + caption + e);
+ for (int i = 0; i <= m; i++) {
+ AmsServer.LOGGER.error(prefix + "\tat " + trace[i]);
+ }
+ if (framesInCommon != 0) {
+ AmsServer.LOGGER.error(prefix + "\t... " + framesInCommon + " more");
+ }
+
+ // Print suppressed exceptions, if any
+ for (Throwable se : e.getSuppressed()) {
+ logEnclosedStackTrace(se, trace, "Suppressed: ", prefix + "\t", dejaVu);
+ }
+
+ // Print cause, if any
+ Throwable ourCause = e.getCause();
+ if (ourCause != null) {
+ logEnclosedStackTrace(ourCause, trace, "Caused by: ", prefix, dejaVu);
+ }
+ }
+ }
+}
diff --git a/src/main/java/club/mcams/carpet/util/Messenger.java b/src/main/java/club/mcams/carpet/util/Messenger.java
index 6ceeee06..4a7151f6 100644
--- a/src/main/java/club/mcams/carpet/util/Messenger.java
+++ b/src/main/java/club/mcams/carpet/util/Messenger.java
@@ -1,253 +1,253 @@
-/*
- * This file is part of the Carpet AMS Addition project, licensed under the
- * GNU Lesser General Public License v3.0
- *
- * Copyright (C) 2023 A Minecraft Server and contributors
- *
- * Carpet AMS Addition is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Carpet AMS Addition is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Carpet AMS Addition. If not, see .
- */
-
-package club.mcams.carpet.util;
-
-import club.mcams.carpet.mixin.translations.StyleAccessor;
-import club.mcams.carpet.translations.AMSTranslations;
-import club.mcams.carpet.translations.Translator;
-import club.mcams.carpet.util.compat.DimensionWrapper;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityType;
-import net.minecraft.server.command.ServerCommandSource;
-import net.minecraft.server.network.ServerPlayerEntity;
-import net.minecraft.text.*;
-import net.minecraft.util.Formatting;
-import net.minecraft.util.math.ChunkPos;
-import net.minecraft.util.math.Vec3d;
-import net.minecraft.util.math.Vec3i;
-
-import com.google.common.collect.ImmutableMap;
-
-import org.jetbrains.annotations.Nullable;
-
-//#if MC>=11900
-//$$ import java.util.function.Supplier;
-//#endif
-
-
-/**
- * Reference: Carpet TIS Addition
- */
-public class Messenger {
- private static final Translator translator = new Translator("util");
-
- // Compound Text
- public static BaseText c(Object... fields) {
- //#if MC>=11900
- //$$ return (MutableText) carpet.utils.Messenger.c(fields);
- //#else
- return carpet.utils.Messenger.c(fields);
- //#endif
- }
-
- // Simple Text
- public static BaseText s(Object text) {
- //#if MC>=11900
- //$$ return Text.literal(text.toString());
- //#else
- return new LiteralText(text.toString());
- //#endif
- }
-
- // Simple Text with carpet style
- public static BaseText s(Object text, String carpetStyle) {
- return formatting(s(text), carpetStyle);
- }
-
- // Simple Text with formatting
- public static BaseText s(Object text, Formatting textFormatting) {
- return formatting(s(text), textFormatting);
- }
-
- // Fancy Text
- public static BaseText fancy(String carpetStyle, BaseText displayText, BaseText hoverText, ClickEvent clickEvent) {
- BaseText text = copy(displayText);
- if (carpetStyle != null) {
- text.setStyle(parseCarpetStyle(carpetStyle));
- }
- if (hoverText != null) {
- hover(text, hoverText);
- }
- if (clickEvent != null) {
- click(text, clickEvent);
- }
- return text;
- }
-
- public static BaseText fancy(BaseText displayText, BaseText hoverText, ClickEvent clickEvent) {
- return fancy(null, displayText, hoverText, clickEvent);
- }
-
- // Translation Text
- public static BaseText tr(String key, Object... args) {
- //#if MC>=11900
- //$$ return Text.translatable(key, args);
- //#else
- return new TranslatableText(key, args);
- //#endif
- }
-
- public static BaseText copy(BaseText text) {
- return (BaseText) text.shallowCopy();
- }
-
- public static void tell(ServerCommandSource source, BaseText text) {
- Entity entity = source.getEntity();
- text = entity instanceof ServerPlayerEntity ?
- AMSTranslations.translate(text, (ServerPlayerEntity) entity) :
- AMSTranslations.translate(text);
- //#if MC>=12000
- //$$ source.sendFeedback((Supplier) text, false);
- //#else
- source.sendFeedback(text, false);
- //#endif
- }
-
- public static BaseText formatting(BaseText text, Formatting... formattings) {
- text.formatted(formattings);
- return text;
- }
-
- public static BaseText formatting(BaseText text, String carpetStyle) {
- Style textStyle = text.getStyle();
- StyleAccessor parsedStyle = (StyleAccessor) parseCarpetStyle(carpetStyle);
- textStyle = textStyle.withColor(parsedStyle.getColorField());
- textStyle = textStyle.withBold(parsedStyle.getBoldField());
- textStyle = textStyle.withItalic(parsedStyle.getItalicField());
- ((StyleAccessor) textStyle).setUnderlinedField(parsedStyle.getUnderlineField());
- ((StyleAccessor) textStyle).setStrikethroughField(parsedStyle.getStrikethroughField());
- ((StyleAccessor) textStyle).setObfuscatedField(parsedStyle.getObfuscatedField());
- return style(text, textStyle);
- }
-
- public static BaseText style(BaseText text, Style style) {
- text.setStyle(style);
- return text;
- }
-
- public static BaseText click(BaseText text, ClickEvent clickEvent) {
- style(text, text.getStyle().withClickEvent(clickEvent));
- return text;
- }
-
- public static BaseText hover(BaseText text, HoverEvent hoverEvent) {
- style(text, text.getStyle().withHoverEvent(hoverEvent));
- return text;
- }
-
- public static BaseText hover(BaseText text, BaseText hoverText) {
- return hover(text, new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverText));
- }
-
- public static BaseText entity(String style, Entity entity) {
- BaseText entityBaseName = (BaseText) entity.getType().getName();
- BaseText entityDisplayName = (BaseText) entity.getName();
- BaseText hoverText = Messenger.c(
- translator.tr("entity_type", entityBaseName, s(EntityType.getId(entity.getType()).toString())), newLine(),
- getTeleportHint(entityDisplayName)
- );
- return fancy(style, entityDisplayName, hoverText, new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, TextUtil.tp(entity)));
- }
-
- private static BaseText getTeleportHint(BaseText dest) {
- return translator.tr("teleport_hint", dest);
- }
-
- public static BaseText newLine() {
- return s("\n");
- }
-
- private static final ImmutableMap DIMENSION_NAME = ImmutableMap.of(
- DimensionWrapper.OVERWORLD, tr("createWorld.customize.preset.overworld"),
- DimensionWrapper.THE_NETHER, tr("advancements.nether.root.title"),
- DimensionWrapper.THE_END, tr("advancements.end.root.title")
- );
-
- public static BaseText dimension(DimensionWrapper dim) {
- BaseText dimText = DIMENSION_NAME.get(dim);
- return dimText != null ? copy(dimText) : Messenger.s(dim.getIdentifierString());
- }
-
- private static BaseText __coord(String style, @Nullable DimensionWrapper dim, String posStr, String command) {
- BaseText hoverText = Messenger.s("");
- hoverText.append(getTeleportHint(Messenger.s(posStr)));
- if (dim != null) {
- hoverText.append("\n");
- hoverText.append(translator.tr("teleport_hint.dimension"));
- hoverText.append(": ");
- hoverText.append(dimension(dim));
- }
- return fancy(style, Messenger.s(posStr), hoverText, new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command));
- }
-
- public static BaseText coord(String style, Vec3d pos, DimensionWrapper dim) {
- return __coord(style, dim, TextUtil.coord(pos), TextUtil.tp(pos, dim));
- }
-
- public static BaseText coord(String style, Vec3i pos, DimensionWrapper dim) {
- return __coord(style, dim, TextUtil.coord(pos), TextUtil.tp(pos, dim));
- }
-
- public static BaseText coord(String style, ChunkPos pos, DimensionWrapper dim) {
- return __coord(style, dim, TextUtil.coord(pos), TextUtil.tp(pos, dim));
- }
-
- public static BaseText coord(String style, Vec3d pos) {
- return __coord(style, null, TextUtil.coord(pos), TextUtil.tp(pos));
- }
-
- public static BaseText coord(String style, Vec3i pos) {
- return __coord(style, null, TextUtil.coord(pos), TextUtil.tp(pos));
- }
-
- public static BaseText coord(String style, ChunkPos pos) {
- return __coord(style, null, TextUtil.coord(pos), TextUtil.tp(pos));
- }
-
- public static BaseText coord(Vec3d pos, DimensionWrapper dim) {
- return coord(null, pos, dim);
- }
-
- public static BaseText coord(Vec3i pos, DimensionWrapper dim) {
- return coord(null, pos, dim);
- }
-
- public static BaseText coord(ChunkPos pos, DimensionWrapper dim) {
- return coord(null, pos, dim);
- }
-
- public static BaseText coord(Vec3d pos) {
- return coord(null, pos);
- }
-
- public static BaseText coord(Vec3i pos) {
- return coord(null, pos);
- }
-
- public static BaseText coord(ChunkPos pos) {
- return coord(null, pos);
- }
-
- public static Style parseCarpetStyle(String style) {
- return carpet.utils.Messenger.parseStyle(style);
- }
-}
+/*
+ * This file is part of the Carpet AMS Addition project, licensed under the
+ * GNU Lesser General Public License v3.0
+ *
+ * Copyright (C) 2023 A Minecraft Server and contributors
+ *
+ * Carpet AMS Addition is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Carpet AMS Addition is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Carpet AMS Addition. If not, see .
+ */
+
+package club.mcams.carpet.util;
+
+import club.mcams.carpet.mixin.translations.StyleAccessor;
+import club.mcams.carpet.translations.AMSTranslations;
+import club.mcams.carpet.translations.Translator;
+import club.mcams.carpet.util.compat.DimensionWrapper;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityType;
+import net.minecraft.server.command.ServerCommandSource;
+import net.minecraft.server.network.ServerPlayerEntity;
+import net.minecraft.text.*;
+import net.minecraft.util.Formatting;
+import net.minecraft.util.math.ChunkPos;
+import net.minecraft.util.math.Vec3d;
+import net.minecraft.util.math.Vec3i;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.jetbrains.annotations.Nullable;
+
+//#if MC>=11900
+//$$ import java.util.function.Supplier;
+//#endif
+
+
+/**
+ * Reference: Carpet TIS Addition
+ */
+public class Messenger {
+ private static final Translator translator = new Translator("util");
+
+ // Compound Text
+ public static BaseText c(Object... fields) {
+ //#if MC>=11900
+ //$$ return (MutableText) carpet.utils.Messenger.c(fields);
+ //#else
+ return carpet.utils.Messenger.c(fields);
+ //#endif
+ }
+
+ // Simple Text
+ public static BaseText s(Object text) {
+ //#if MC>=11900
+ //$$ return Text.literal(text.toString());
+ //#else
+ return new LiteralText(text.toString());
+ //#endif
+ }
+
+ // Simple Text with carpet style
+ public static BaseText s(Object text, String carpetStyle) {
+ return formatting(s(text), carpetStyle);
+ }
+
+ // Simple Text with formatting
+ public static BaseText s(Object text, Formatting textFormatting) {
+ return formatting(s(text), textFormatting);
+ }
+
+ // Fancy Text
+ public static BaseText fancy(String carpetStyle, BaseText displayText, BaseText hoverText, ClickEvent clickEvent) {
+ BaseText text = copy(displayText);
+ if (carpetStyle != null) {
+ text.setStyle(parseCarpetStyle(carpetStyle));
+ }
+ if (hoverText != null) {
+ hover(text, hoverText);
+ }
+ if (clickEvent != null) {
+ click(text, clickEvent);
+ }
+ return text;
+ }
+
+ public static BaseText fancy(BaseText displayText, BaseText hoverText, ClickEvent clickEvent) {
+ return fancy(null, displayText, hoverText, clickEvent);
+ }
+
+ // Translation Text
+ public static BaseText tr(String key, Object... args) {
+ //#if MC>=11900
+ //$$ return Text.translatable(key, args);
+ //#else
+ return new TranslatableText(key, args);
+ //#endif
+ }
+
+ public static BaseText copy(BaseText text) {
+ return (BaseText) text.shallowCopy();
+ }
+
+ public static void tell(ServerCommandSource source, BaseText text) {
+ Entity entity = source.getEntity();
+ text = entity instanceof ServerPlayerEntity ?
+ AMSTranslations.translate(text, (ServerPlayerEntity) entity) :
+ AMSTranslations.translate(text);
+ //#if MC>=12000
+ //$$ source.sendFeedback((Supplier) text, false);
+ //#else
+ source.sendFeedback(text, false);
+ //#endif
+ }
+
+ public static BaseText formatting(BaseText text, Formatting... formattings) {
+ text.formatted(formattings);
+ return text;
+ }
+
+ public static BaseText formatting(BaseText text, String carpetStyle) {
+ Style textStyle = text.getStyle();
+ StyleAccessor parsedStyle = (StyleAccessor) parseCarpetStyle(carpetStyle);
+ textStyle = textStyle.withColor(parsedStyle.getColorField());
+ textStyle = textStyle.withBold(parsedStyle.getBoldField());
+ textStyle = textStyle.withItalic(parsedStyle.getItalicField());
+ ((StyleAccessor) textStyle).setUnderlinedField(parsedStyle.getUnderlineField());
+ ((StyleAccessor) textStyle).setStrikethroughField(parsedStyle.getStrikethroughField());
+ ((StyleAccessor) textStyle).setObfuscatedField(parsedStyle.getObfuscatedField());
+ return style(text, textStyle);
+ }
+
+ public static BaseText style(BaseText text, Style style) {
+ text.setStyle(style);
+ return text;
+ }
+
+ public static BaseText click(BaseText text, ClickEvent clickEvent) {
+ style(text, text.getStyle().withClickEvent(clickEvent));
+ return text;
+ }
+
+ public static BaseText hover(BaseText text, HoverEvent hoverEvent) {
+ style(text, text.getStyle().withHoverEvent(hoverEvent));
+ return text;
+ }
+
+ public static BaseText hover(BaseText text, BaseText hoverText) {
+ return hover(text, new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverText));
+ }
+
+ public static BaseText entity(String style, Entity entity) {
+ BaseText entityBaseName = (BaseText) entity.getType().getName();
+ BaseText entityDisplayName = (BaseText) entity.getName();
+ BaseText hoverText = Messenger.c(
+ translator.tr("entity_type", entityBaseName, s(EntityType.getId(entity.getType()).toString())), newLine(),
+ getTeleportHint(entityDisplayName)
+ );
+ return fancy(style, entityDisplayName, hoverText, new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, TextUtil.tp(entity)));
+ }
+
+ private static BaseText getTeleportHint(BaseText dest) {
+ return translator.tr("teleport_hint", dest);
+ }
+
+ public static BaseText newLine() {
+ return s("\n");
+ }
+
+ private static final ImmutableMap DIMENSION_NAME = ImmutableMap.of(
+ DimensionWrapper.OVERWORLD, tr("createWorld.customize.preset.overworld"),
+ DimensionWrapper.THE_NETHER, tr("advancements.nether.root.title"),
+ DimensionWrapper.THE_END, tr("advancements.end.root.title")
+ );
+
+ public static BaseText dimension(DimensionWrapper dim) {
+ BaseText dimText = DIMENSION_NAME.get(dim);
+ return dimText != null ? copy(dimText) : Messenger.s(dim.getIdentifierString());
+ }
+
+ private static BaseText __coord(String style, @Nullable DimensionWrapper dim, String posStr, String command) {
+ BaseText hoverText = Messenger.s("");
+ hoverText.append(getTeleportHint(Messenger.s(posStr)));
+ if (dim != null) {
+ hoverText.append("\n");
+ hoverText.append(translator.tr("teleport_hint.dimension"));
+ hoverText.append(": ");
+ hoverText.append(dimension(dim));
+ }
+ return fancy(style, Messenger.s(posStr), hoverText, new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command));
+ }
+
+ public static BaseText coord(String style, Vec3d pos, DimensionWrapper dim) {
+ return __coord(style, dim, TextUtil.coord(pos), TextUtil.tp(pos, dim));
+ }
+
+ public static BaseText coord(String style, Vec3i pos, DimensionWrapper dim) {
+ return __coord(style, dim, TextUtil.coord(pos), TextUtil.tp(pos, dim));
+ }
+
+ public static BaseText coord(String style, ChunkPos pos, DimensionWrapper dim) {
+ return __coord(style, dim, TextUtil.coord(pos), TextUtil.tp(pos, dim));
+ }
+
+ public static BaseText coord(String style, Vec3d pos) {
+ return __coord(style, null, TextUtil.coord(pos), TextUtil.tp(pos));
+ }
+
+ public static BaseText coord(String style, Vec3i pos) {
+ return __coord(style, null, TextUtil.coord(pos), TextUtil.tp(pos));
+ }
+
+ public static BaseText coord(String style, ChunkPos pos) {
+ return __coord(style, null, TextUtil.coord(pos), TextUtil.tp(pos));
+ }
+
+ public static BaseText coord(Vec3d pos, DimensionWrapper dim) {
+ return coord(null, pos, dim);
+ }
+
+ public static BaseText coord(Vec3i pos, DimensionWrapper dim) {
+ return coord(null, pos, dim);
+ }
+
+ public static BaseText coord(ChunkPos pos, DimensionWrapper dim) {
+ return coord(null, pos, dim);
+ }
+
+ public static BaseText coord(Vec3d pos) {
+ return coord(null, pos);
+ }
+
+ public static BaseText coord(Vec3i pos) {
+ return coord(null, pos);
+ }
+
+ public static BaseText coord(ChunkPos pos) {
+ return coord(null, pos);
+ }
+
+ public static Style parseCarpetStyle(String style) {
+ return carpet.utils.Messenger.parseStyle(style);
+ }
+}
diff --git a/src/main/java/club/mcams/carpet/util/MixinUtil.java b/src/main/java/club/mcams/carpet/util/MixinUtil.java
index 58e58770..238470d9 100644
--- a/src/main/java/club/mcams/carpet/util/MixinUtil.java
+++ b/src/main/java/club/mcams/carpet/util/MixinUtil.java
@@ -1,50 +1,50 @@
-/*
- * This file is part of the Carpet AMS Addition project, licensed under the
- * GNU Lesser General Public License v3.0
- *
- * Copyright (C) 2023 A Minecraft Server and contributors
- *
- * Carpet AMS Addition is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Carpet AMS Addition is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Carpet AMS Addition. If not, see .
- */
-
-package club.mcams.carpet.util;
-
-import club.mcams.carpet.AmsServer;
-import static club.mcams.carpet.util.Messenger.*;
-
-import net.minecraft.server.command.ServerCommandSource;
-import net.minecraft.text.BaseText;
-
-import org.jetbrains.annotations.Nullable;
-import org.spongepowered.asm.mixin.MixinEnvironment;
-
-public class MixinUtil {
- public static boolean audit(@Nullable ServerCommandSource source) {
- boolean ok;
- BaseText response;
- try {
- MixinEnvironment.getCurrentEnvironment().audit();
- response = s("Mixin environment audited successfully");
- ok = true;
- } catch (Exception e) {
- AmsServer.LOGGER.error("Error when auditing mixin", e);
- response = Messenger.s(String.format("Mixin environment auditing failed, check console for more information (%s)", e));
- ok = false;
- }
- if (source != null) {
- Messenger.tell(source, response);
- }
- return ok;
- }
+/*
+ * This file is part of the Carpet AMS Addition project, licensed under the
+ * GNU Lesser General Public License v3.0
+ *
+ * Copyright (C) 2023 A Minecraft Server and contributors
+ *
+ * Carpet AMS Addition is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Carpet AMS Addition is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Carpet AMS Addition. If not, see .
+ */
+
+package club.mcams.carpet.util;
+
+import club.mcams.carpet.AmsServer;
+import static club.mcams.carpet.util.Messenger.*;
+
+import net.minecraft.server.command.ServerCommandSource;
+import net.minecraft.text.BaseText;
+
+import org.jetbrains.annotations.Nullable;
+import org.spongepowered.asm.mixin.MixinEnvironment;
+
+public class MixinUtil {
+ public static boolean audit(@Nullable ServerCommandSource source) {
+ boolean ok;
+ BaseText response;
+ try {
+ MixinEnvironment.getCurrentEnvironment().audit();
+ response = s("Mixin environment audited successfully");
+ ok = true;
+ } catch (Exception e) {
+ AmsServer.LOGGER.error("Error when auditing mixin", e);
+ response = Messenger.s(String.format("Mixin environment auditing failed, check console for more information (%s)", e));
+ ok = false;
+ }
+ if (source != null) {
+ Messenger.tell(source, response);
+ }
+ return ok;
+ }
}
\ No newline at end of file
diff --git a/src/main/java/club/mcams/carpet/util/recipes/CraftingRule.java b/src/main/java/club/mcams/carpet/util/recipes/CraftingRule.java
index e8e316a6..2b7f1141 100644
--- a/src/main/java/club/mcams/carpet/util/recipes/CraftingRule.java
+++ b/src/main/java/club/mcams/carpet/util/recipes/CraftingRule.java
@@ -1,37 +1,37 @@
-/*
- * This file is part of the Carpet AMS Addition project, licensed under the
- * GNU Lesser General Public License v3.0
- *
- * Copyright (C) 2023 A Minecraft Server and contributors
- *
- * Carpet AMS Addition is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Carpet AMS Addition is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Carpet AMS Addition. If not, see .
- */
-
-package club.mcams.carpet.util.recipes;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface CraftingRule {
-
- String name() default "";
-
- String[] recipes();
-
- String recipeNamespace() default "ams";
-}
+/*
+ * This file is part of the Carpet AMS Addition project, licensed under the
+ * GNU Lesser General Public License v3.0
+ *
+ * Copyright (C) 2023 A Minecraft Server and contributors
+ *
+ * Carpet AMS Addition is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Carpet AMS Addition is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Carpet AMS Addition. If not, see .
+ */
+
+package club.mcams.carpet.util.recipes;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface CraftingRule {
+
+ String name() default "";
+
+ String[] recipes();
+
+ String recipeNamespace() default "ams";
+}
diff --git a/src/main/resources/amscarpet.mixins.json b/src/main/resources/amscarpet.mixins.json
index bd83b6a2..36f7261f 100644
--- a/src/main/resources/amscarpet.mixins.json
+++ b/src/main/resources/amscarpet.mixins.json
@@ -1,56 +1,56 @@
-{
- "required": true,
- "minVersion": "0.8",
- "package": "club.mcams.carpet.mixin",
- "compatibilityLevel": "JAVA_8",
- "mixins": [
- "carpet.SettingsManagerMixin",
- "interaction.ThreadedAnvilChunkStorageMixin",
- "rule.antiFireTotem_itemAntiExplosion.ItemEntityMixin",
- "rule.bambooCollisionBoxDisable.BambooBlockMixin",
- "rule.bambooModelNoOffset.BambooBlockMixin",
- "rule.blockChunkLoader.BellBlockMixin",
- "rule.blockChunkLoader.NoteBlockMixin",
- "rule.blockChunkLoader.PistonBlockMixin",
- "rule.blowUpEverything.GetBlastResistanceMixin",
- "rule.boneBlockUpdateSuppressor.NeighborUpdateMixin",
- "rule.creativeOneHitKill.EntityAccessorMixin",
- "rule.creativeOneHitKill.PlayerEntityMixin",
- "rule.creativeShulkerBoxDropsDisable.ShulkerBoxBlockMixin",
- "rule.extinguishedCampfire_campfireSmokeParticleDisabled.GetPlacementStateMixin",
- "rule.fakePeace.AbstractBlockStateMixin",
- "rule.infiniteTrades.MerchantEntityMixin",
- "rule.largeEnderChest.EnderChestBlockMixin",
- "rule.largeEnderChest.PlayerEntityMixin",
- "rule.largeEnderChest.SimpleInventoryAccessor",
- "rule.movableBlocks.PistonBlockMixin",
- "rule.netherWaterPlacement.DimensionTypeMixin",
- "rule.optimizedDragonRespawn.BlockPatternTestTransformInvoker",
- "rule.optimizedDragonRespawn.EnderDragonFightMixin",
- "rule.safeFlight_safeVoid_invulnerable.ServerPlayerEntityMixin",
- "rule.scheduledRandomTick.AbstractPlantPartBlockMixin",
- "rule.scheduledRandomTick.BambooBlockMixin",
- "rule.scheduledRandomTick.CactusBlockMixin",
- "rule.scheduledRandomTick.ChorusFlowerBlockMixin",
- "rule.scheduledRandomTick.SugarCaneBlockMixin",
- "rule.sharedVillagerDiscounts.GetValueForInvoker",
- "rule.sharedVillagerDiscounts.VillagerGossipsMixin",
- "rule.softBlock.AbstractBlockStateMixin",
- "rule.superBow.InfinityEnchantmentMixin",
- "rule.weakBlocks.CollectBlocksAndDamageEntitiesMixin",
- "setting.ParsedRuleAccessor",
- "setting.SettingsManagerAccessor",
- "translations.ClientSettingsC2SPacketAccessor",
- "translations.HUDControllerMixin",
- "translations.LoggerMixin",
- "translations.ServerPlayerEntityMixin",
- "translations.StyleAccessor",
- "translations.TranslatableTextAccessor",
- "translations.TranslatableTextMixin"
- ],
- "client": [],
- "server": [],
- "injectors": {
- "defaultRequire": 1
- }
-}
+{
+ "required": true,
+ "minVersion": "0.8",
+ "package": "club.mcams.carpet.mixin",
+ "compatibilityLevel": "JAVA_8",
+ "mixins": [
+ "carpet.SettingsManagerMixin",
+ "interaction.ThreadedAnvilChunkStorageMixin",
+ "rule.antiFireTotem_itemAntiExplosion.ItemEntityMixin",
+ "rule.bambooCollisionBoxDisable.BambooBlockMixin",
+ "rule.bambooModelNoOffset.BambooBlockMixin",
+ "rule.blockChunkLoader.BellBlockMixin",
+ "rule.blockChunkLoader.NoteBlockMixin",
+ "rule.blockChunkLoader.PistonBlockMixin",
+ "rule.blowUpEverything.GetBlastResistanceMixin",
+ "rule.boneBlockUpdateSuppressor.NeighborUpdateMixin",
+ "rule.creativeOneHitKill.EntityAccessorMixin",
+ "rule.creativeOneHitKill.PlayerEntityMixin",
+ "rule.creativeShulkerBoxDropsDisable.ShulkerBoxBlockMixin",
+ "rule.extinguishedCampfire_campfireSmokeParticleDisabled.GetPlacementStateMixin",
+ "rule.fakePeace.AbstractBlockStateMixin",
+ "rule.infiniteTrades.MerchantEntityMixin",
+ "rule.largeEnderChest.EnderChestBlockMixin",
+ "rule.largeEnderChest.PlayerEntityMixin",
+ "rule.largeEnderChest.SimpleInventoryAccessor",
+ "rule.movableBlocks.PistonBlockMixin",
+ "rule.netherWaterPlacement.DimensionTypeMixin",
+ "rule.optimizedDragonRespawn.BlockPatternTestTransformInvoker",
+ "rule.optimizedDragonRespawn.EnderDragonFightMixin",
+ "rule.safeFlight_safeVoid_invulnerable.ServerPlayerEntityMixin",
+ "rule.scheduledRandomTick.AbstractPlantPartBlockMixin",
+ "rule.scheduledRandomTick.BambooBlockMixin",
+ "rule.scheduledRandomTick.CactusBlockMixin",
+ "rule.scheduledRandomTick.ChorusFlowerBlockMixin",
+ "rule.scheduledRandomTick.SugarCaneBlockMixin",
+ "rule.sharedVillagerDiscounts.GetValueForInvoker",
+ "rule.sharedVillagerDiscounts.VillagerGossipsMixin",
+ "rule.softBlock.AbstractBlockStateMixin",
+ "rule.superBow.InfinityEnchantmentMixin",
+ "rule.weakBlocks.CollectBlocksAndDamageEntitiesMixin",
+ "setting.ParsedRuleAccessor",
+ "setting.SettingsManagerAccessor",
+ "translations.ClientSettingsC2SPacketAccessor",
+ "translations.HUDControllerMixin",
+ "translations.LoggerMixin",
+ "translations.ServerPlayerEntityMixin",
+ "translations.StyleAccessor",
+ "translations.TranslatableTextAccessor",
+ "translations.TranslatableTextMixin"
+ ],
+ "client": [],
+ "server": [],
+ "injectors": {
+ "defaultRequire": 1
+ }
+}
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index 04c0c8cd..a1b1520f 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -1,31 +1,31 @@
-{
- "schemaVersion": 1,
- "id": "${id}",
- "version": "${version}",
- "name": "${name}",
- "description": "一个简陋的,东拼西凑的,及其不原版的Carpet拓展。",
- "authors": [
- "1024_byteeeee",
- "WenDavid",
- "···"
- ],
- "contact": {
- "homepage": "https://mcams.club/",
- "sources": "https://mcams.club/"
- },
- "license": "LGPL-3.0",
- "icon": "assets/carpetamsaddition/icon.png",
- "environment": "*",
- "entrypoints": {
- "main": [
- "club.mcams.carpet.AmsServerMod"
- ]
- },
- "mixins": [
- "amscarpet.mixins.json"
- ],
- "depends": {
- "minecraft": "${minecraft_dependency}",
- "carpet": "${carpet_dependency}"
- }
-}
+{
+ "schemaVersion": 1,
+ "id": "${id}",
+ "version": "${version}",
+ "name": "${name}",
+ "description": "一个简陋的,东拼西凑的,及其不原版的Carpet拓展。",
+ "authors": [
+ "1024_byteeeee",
+ "WenDavid",
+ "···"
+ ],
+ "contact": {
+ "homepage": "https://mcams.club/",
+ "sources": "https://mcams.club/"
+ },
+ "license": "LGPL-3.0",
+ "icon": "assets/carpetamsaddition/icon.png",
+ "environment": "*",
+ "entrypoints": {
+ "main": [
+ "club.mcams.carpet.AmsServerMod"
+ ]
+ },
+ "mixins": [
+ "amscarpet.mixins.json"
+ ],
+ "depends": {
+ "minecraft": "${minecraft_dependency}",
+ "carpet": "${carpet_dependency}"
+ }
+}
diff --git a/versions/1.16.5/gradle.properties b/versions/1.16.5/gradle.properties
index 6946e275..7a9f59da 100644
--- a/versions/1.16.5/gradle.properties
+++ b/versions/1.16.5/gradle.properties
@@ -1,17 +1,16 @@
-# Fabric Properties
-# check these on https://fabricmc.net/versions.html?&version=1.16.5
-minecraft_version = 1.16.5
-yarn_mappings = 1.16.5+build.10
-
-# Fabric Mod Metadata
-carpet_dependency = >=1.4.38
-minecraft_dependency = 1.16.5
-
-# Build Infomation
-game_versions = 1.16.4\n1.16.5
-
-# Mod Dependency
-# check available versions on maven for the given minecraft version you are using
-# https://masa.dy.fi/maven/carpet/fabric-carpet/
-carpet_core_version = 1.16.5-1.4.44+v210714
-
+# Fabric Properties
+# check these on https://fabricmc.net/versions.html?&version=1.16.5
+minecraft_version = 1.16.5
+yarn_mappings = 1.16.5+build.10
+
+# Fabric Mod Metadata
+carpet_dependency = >=1.4.38
+minecraft_dependency = 1.16.5
+
+# Build Infomation
+game_versions = 1.16.4\n1.16.5
+
+# Mod Dependency
+# check available versions on maven for the given minecraft version you are using
+# https://masa.dy.fi/maven/carpet/fabric-carpet/
+carpet_core_version = 1.16.5-1.4.44+v210714
\ No newline at end of file
diff --git a/versions/1.17.1/gradle.properties b/versions/1.17.1/gradle.properties
index ebb5efec..8fe970a5 100644
--- a/versions/1.17.1/gradle.properties
+++ b/versions/1.17.1/gradle.properties
@@ -1,17 +1,16 @@
-# Fabric Properties
-# check these on https://fabricmc.net/versions.html?&version=1.17.1
-minecraft_version = 1.17.1
-yarn_mappings = 1.17.1+build.65
-
-# Fabric Mod Metadata
-carpet_dependency = >=1.4.56
-minecraft_dependency = 1.17.1
-
-# Build Infomation
-game_versions = 1.17.1
-
-# Mod Dependency
-# check available versions on maven for the given minecraft version you are using
-# https://masa.dy.fi/maven/carpet/fabric-carpet/
-carpet_core_version = 1.17.1-1.4.57+v220119
-
+# Fabric Properties
+# check these on https://fabricmc.net/versions.html?&version=1.17.1
+minecraft_version = 1.17.1
+yarn_mappings = 1.17.1+build.65
+
+# Fabric Mod Metadata
+carpet_dependency = >=1.4.56
+minecraft_dependency = 1.17.1
+
+# Build Infomation
+game_versions = 1.17.1
+
+# Mod Dependency
+# check available versions on maven for the given minecraft version you are using
+# https://masa.dy.fi/maven/carpet/fabric-carpet/
+carpet_core_version = 1.17.1-1.4.57+v220119
\ No newline at end of file
diff --git a/versions/1.18.2/gradle.properties b/versions/1.18.2/gradle.properties
index 3ed3710b..23c11c3a 100644
--- a/versions/1.18.2/gradle.properties
+++ b/versions/1.18.2/gradle.properties
@@ -1,17 +1,16 @@
-# Fabric Properties
-# check these on https://fabricmc.net/versions.html?&version=1.18.2
-minecraft_version = 1.18.2
-yarn_mappings = 1.18.2+build.4
-
-# Fabric Mod Metadata
-carpet_dependency = >=1.4.56
-minecraft_dependency = 1.18.2
-
-# Build Infomation
-game_versions = 1.18.2
-
-# Mod Dependency
-# check available versions on maven for the given minecraft version you are using
-# https://masa.dy.fi/maven/carpet/fabric-carpet/
-carpet_core_version = 1.18.2-1.4.69+v220331
-
+# Fabric Properties
+# check these on https://fabricmc.net/versions.html?&version=1.18.2
+minecraft_version = 1.18.2
+yarn_mappings = 1.18.2+build.4
+
+# Fabric Mod Metadata
+carpet_dependency = >=1.4.56
+minecraft_dependency = 1.18.2
+
+# Build Infomation
+game_versions = 1.18.2
+
+# Mod Dependency
+# check available versions on maven for the given minecraft version you are using
+# https://masa.dy.fi/maven/carpet/fabric-carpet/
+carpet_core_version = 1.18.2-1.4.69+v220331
\ No newline at end of file
diff --git a/versions/mapping-1.17-1.16.txt b/versions/mapping-1.17-1.16.txt
index 53320842..b7c13af0 100644
--- a/versions/mapping-1.17-1.16.txt
+++ b/versions/mapping-1.17-1.16.txt
@@ -1,3 +1,3 @@
-com.google.gson.JsonParser parseReader() com.google.gson.JsonParser parse()
-
+com.google.gson.JsonParser parseReader() com.google.gson.JsonParser parse()
+
net.minecraft.server.command.ReloadCommand tryReloadDataPacks() method_29480()
\ No newline at end of file
diff --git a/versions/mapping-1.18-1.17.txt b/versions/mapping-1.18-1.17.txt
index 8af389f7..de5fc359 100644
--- a/versions/mapping-1.18-1.17.txt
+++ b/versions/mapping-1.18-1.17.txt
@@ -1,6 +1,6 @@
-net.minecraft.world.tick.OrderedTick net.minecraft.world.ScheduledTick
-net.minecraft.world.tick.OrderedTick type() net.minecraft.world.ScheduledTick getObject()
-block() net.minecraft.server.world.BlockEvent getBlock()
-data() net.minecraft.server.world.BlockEvent getData()
-pos() net.minecraft.server.world.BlockEvent getPos()
+net.minecraft.world.tick.OrderedTick net.minecraft.world.ScheduledTick
+net.minecraft.world.tick.OrderedTick type() net.minecraft.world.ScheduledTick getObject()
+block() net.minecraft.server.world.BlockEvent getBlock()
+data() net.minecraft.server.world.BlockEvent getData()
+pos() net.minecraft.server.world.BlockEvent getPos()
type() net.minecraft.server.world.BlockEvent getType()
\ No newline at end of file
diff --git a/versions/mapping-1.18-1.19.txt b/versions/mapping-1.18-1.19.txt
index c91d642e..89e82322 100644
--- a/versions/mapping-1.18-1.19.txt
+++ b/versions/mapping-1.18-1.19.txt
@@ -1,12 +1,12 @@
-carpet.settings.ParsedRule carpet.api.settings.CarpetRule
-carpet.settings.ParsedRule get() carpet.api.settings.CarpetRule value()
-carpet.settings.RuleCategory carpet.api.settings.RuleCategory
-carpet.settings.SettingsManager carpet.api.settings.SettingsManager
-carpet.settings.Validator carpet.api.settings.Validator
-carpet.api.settings.SettingsManager getRule() carpet.api.settings.SettingsManager getCarpetRule()
-carpet.CarpetServer.settingsManager addRuleObserver() carpet.api.settings.SettingsManager registerRuleObserver()
-
-carpet.script.bundled.BundledModule carpet.script.Module
-
-net.minecraft.text.BaseText net.minecraft.text.MutableText
+carpet.settings.ParsedRule carpet.api.settings.CarpetRule
+carpet.settings.ParsedRule get() carpet.api.settings.CarpetRule value()
+carpet.settings.RuleCategory carpet.api.settings.RuleCategory
+carpet.settings.SettingsManager carpet.api.settings.SettingsManager
+carpet.settings.Validator carpet.api.settings.Validator
+carpet.api.settings.SettingsManager getRule() carpet.api.settings.SettingsManager getCarpetRule()
+carpet.CarpetServer.settingsManager addRuleObserver() carpet.api.settings.SettingsManager registerRuleObserver()
+
+carpet.script.bundled.BundledModule carpet.script.Module
+
+net.minecraft.text.BaseText net.minecraft.text.MutableText
net.minecraft.world.dimension.DimensionType isUltrawarm() ultrawarm()
\ No newline at end of file