From c4c2adc535d47378b32cce2d0621f339875ba3e6 Mon Sep 17 00:00:00 2001 From: Yeregorix Date: Sat, 11 May 2024 23:38:44 +0200 Subject: [PATCH] Remove mixins error detection --- .../superpiston/SuperPiston.java | 8 ++--- .../impl/internal/InternalServer.java | 30 ----------------- .../mixin/server/MinecraftServerMixin.java | 32 ------------------- src/main/resources/mixins.superpiston.json | 3 +- 4 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 src/main/java/net/smoofyuniverse/superpiston/impl/internal/InternalServer.java delete mode 100644 src/main/java/net/smoofyuniverse/superpiston/mixin/server/MinecraftServerMixin.java diff --git a/src/main/java/net/smoofyuniverse/superpiston/SuperPiston.java b/src/main/java/net/smoofyuniverse/superpiston/SuperPiston.java index c091bee..ec9b173 100644 --- a/src/main/java/net/smoofyuniverse/superpiston/SuperPiston.java +++ b/src/main/java/net/smoofyuniverse/superpiston/SuperPiston.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022 Hugo Dupanloup (Yeregorix) + * Copyright (c) 2018-2024 Hugo Dupanloup (Yeregorix) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,6 @@ import net.smoofyuniverse.superpiston.config.world.WorldConfig; import net.smoofyuniverse.superpiston.config.world.WorldConfig.Resolved; import net.smoofyuniverse.superpiston.event.PistonListener; -import net.smoofyuniverse.superpiston.impl.internal.InternalServer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.spongepowered.api.Game; @@ -123,10 +122,7 @@ public void onRefreshGame(RefreshGameEvent e) { @Listener public void onServerStarted(StartedEngineEvent e) { - if (e.engine() instanceof InternalServer) - LOGGER.info("SuperPiston {} was loaded successfully.", this.container.metadata().version()); - else - LOGGER.error("!!WARNING!! SuperPiston was not loaded correctly. Be sure that the jar file is at the root of your mods folder!"); + LOGGER.info("SuperPiston {} was loaded successfully.", this.container.metadata().version()); } public Resolved getConfig(ServerWorld world) { diff --git a/src/main/java/net/smoofyuniverse/superpiston/impl/internal/InternalServer.java b/src/main/java/net/smoofyuniverse/superpiston/impl/internal/InternalServer.java deleted file mode 100644 index 95a0389..0000000 --- a/src/main/java/net/smoofyuniverse/superpiston/impl/internal/InternalServer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2018-2022 Hugo Dupanloup (Yeregorix) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package net.smoofyuniverse.superpiston.impl.internal; - -/** - * Used as a marker to detect whether mixins were applied correctly - */ -public interface InternalServer { - -} diff --git a/src/main/java/net/smoofyuniverse/superpiston/mixin/server/MinecraftServerMixin.java b/src/main/java/net/smoofyuniverse/superpiston/mixin/server/MinecraftServerMixin.java deleted file mode 100644 index e7d6f94..0000000 --- a/src/main/java/net/smoofyuniverse/superpiston/mixin/server/MinecraftServerMixin.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2018-2022 Hugo Dupanloup (Yeregorix) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package net.smoofyuniverse.superpiston.mixin.server; - -import net.minecraft.server.MinecraftServer; -import net.smoofyuniverse.superpiston.impl.internal.InternalServer; -import org.spongepowered.asm.mixin.Mixin; - -@Mixin(MinecraftServer.class) -public class MinecraftServerMixin implements InternalServer { - -} diff --git a/src/main/resources/mixins.superpiston.json b/src/main/resources/mixins.superpiston.json index 4426a00..6f2ebf7 100644 --- a/src/main/resources/mixins.superpiston.json +++ b/src/main/resources/mixins.superpiston.json @@ -6,8 +6,7 @@ "compatibilityLevel": "JAVA_8", "server": [ "block.PistonBaseBlockMixin", - "block.PistonStructureResolverMixin", - "server.MinecraftServerMixin" + "block.PistonStructureResolverMixin" ], "injectors": { "defaultRequire": 1