From b7f6f3b900b9db084055ef69ca4c5703ece30463 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 27 Apr 2024 11:55:27 -0500 Subject: [PATCH] Remove (hopefully) unused MixinThreadingDetector --- .../server/unsafe/MixinThreadingDetector.java | 60 ------------------- .../DistantHorizons.fabric.mixins.json | 1 - .../server/unsafe/MixinThreadingDetector.java | 59 ------------------ .../DistantHorizons.forge.mixins.json | 1 - .../server/unsafe/MixinThreadingDetector.java | 59 ------------------ .../DistantHorizons.neoforge.mixins.json | 1 - 6 files changed, 181 deletions(-) delete mode 100644 fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/unsafe/MixinThreadingDetector.java delete mode 100644 forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/unsafe/MixinThreadingDetector.java delete mode 100644 neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/server/unsafe/MixinThreadingDetector.java diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/unsafe/MixinThreadingDetector.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/unsafe/MixinThreadingDetector.java deleted file mode 100644 index 24641322f..000000000 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/unsafe/MixinThreadingDetector.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the Distant Horizons mod - * licensed under the GNU LGPL v3 License. - * - * Copyright (C) 2020-2023 James Seibel - * - * This program 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, version 3. - * - * This program 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 this program. If not, see . - */ - -package com.seibel.distanthorizons.fabric.mixins.server.unsafe; - -import org.spongepowered.asm.mixin.Mixin; - -//FIXME: Is this still needed? -#if MC_VER >= MC_1_18_2 - -import net.minecraft.util.ThreadingDetector; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.concurrent.Semaphore; - -/** - * Why does this exist? But okay! (Will be probably removed when the experimental generator is done) - * FIXME: Recheck this - */ -@Mixin(ThreadingDetector.class) -public class MixinThreadingDetector -{ - @Mutable - @Shadow - private Semaphore lock; - - @Inject(method = "", at = @At("RETURN")) - private void setSemaphore(CallbackInfo ci) - { - this.lock = new Semaphore(2); - } - -} -#else - -import net.minecraft.server.level.ServerLevel; - -@Mixin(ServerLevel.class) -public class MixinThreadingDetector { } //FIXME: Is there some way to make this file just not be added? -#endif diff --git a/fabric/src/main/resources/DistantHorizons.fabric.mixins.json b/fabric/src/main/resources/DistantHorizons.fabric.mixins.json index ffde1f7c4..90f0add34 100644 --- a/fabric/src/main/resources/DistantHorizons.fabric.mixins.json +++ b/fabric/src/main/resources/DistantHorizons.fabric.mixins.json @@ -3,7 +3,6 @@ "minVersion": "0.8", "package": "com.seibel.distanthorizons.fabric.mixins", "mixins": [ - "server.unsafe.MixinThreadingDetector", "server.MixinChunkGenerator", "server.MixinChunkMap", "server.MixinUtilBackgroundThread" diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/unsafe/MixinThreadingDetector.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/unsafe/MixinThreadingDetector.java deleted file mode 100644 index 2cb73c02c..000000000 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/unsafe/MixinThreadingDetector.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of the Distant Horizons mod - * licensed under the GNU LGPL v3 License. - * - * Copyright (C) 2020-2023 James Seibel - * - * This program 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, version 3. - * - * This program 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 this program. If not, see . - */ - -package com.seibel.distanthorizons.forge.mixins.server.unsafe; - -import org.spongepowered.asm.mixin.Mixin; -#if MC_VER >= MC_1_18_2 - -import net.minecraft.util.ThreadingDetector; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.concurrent.Semaphore; - -/** - * Why does this exist? But okay! (Will be probably removed when the experimental generator is done) - * FIXME: Recheck this // STILL check this - */ -@Mixin(ThreadingDetector.class) -public class MixinThreadingDetector -{ - @Mutable - @Shadow - private Semaphore lock; - - @Inject(method = "", at = @At("RETURN")) - private void setSemaphore(CallbackInfo ci) - { - this.lock = new Semaphore(2); - } - -} - -#else - -import net.minecraft.world.level.chunk.ChunkGenerator; - -@Mixin(ChunkGenerator.class) -public class MixinThreadingDetector { } -#endif \ No newline at end of file diff --git a/forge/src/main/resources/DistantHorizons.forge.mixins.json b/forge/src/main/resources/DistantHorizons.forge.mixins.json index c7326a9e4..e0f4d1feb 100644 --- a/forge/src/main/resources/DistantHorizons.forge.mixins.json +++ b/forge/src/main/resources/DistantHorizons.forge.mixins.json @@ -3,7 +3,6 @@ "minVersion": "0.8", "package": "com.seibel.distanthorizons.forge.mixins", "mixins": [ - "server.unsafe.MixinThreadingDetector", "server.MixinUtilBackgroundThread", "server.MixinChunkGenerator", "server.MixinTFChunkGenerator" diff --git a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/server/unsafe/MixinThreadingDetector.java b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/server/unsafe/MixinThreadingDetector.java deleted file mode 100644 index d65854393..000000000 --- a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/server/unsafe/MixinThreadingDetector.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of the Distant Horizons mod - * licensed under the GNU LGPL v3 License. - * - * Copyright (C) 2020-2023 James Seibel - * - * This program 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, version 3. - * - * This program 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 this program. If not, see . - */ - -package com.seibel.distanthorizons.neoforge.mixins.server.unsafe; - -import org.spongepowered.asm.mixin.Mixin; -#if MC_VER >= MC_1_18_2 - -import net.minecraft.util.ThreadingDetector; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.concurrent.Semaphore; - -/** - * Why does this exist? But okay! (Will be probably removed when the experimental generator is done) - * FIXME: Recheck this // STILL check this - */ -@Mixin(ThreadingDetector.class) -public class MixinThreadingDetector -{ - @Mutable - @Shadow - private Semaphore lock; - - @Inject(method = "", at = @At("RETURN")) - private void setSemaphore(CallbackInfo ci) - { - this.lock = new Semaphore(2); - } - -} - -#else - -import net.minecraft.world.level.chunk.ChunkGenerator; - -@Mixin(ChunkGenerator.class) -public class MixinThreadingDetector { } -#endif \ No newline at end of file diff --git a/neoforge/src/main/resources/DistantHorizons.neoforge.mixins.json b/neoforge/src/main/resources/DistantHorizons.neoforge.mixins.json index cb6ae0a35..296dc1e4d 100644 --- a/neoforge/src/main/resources/DistantHorizons.neoforge.mixins.json +++ b/neoforge/src/main/resources/DistantHorizons.neoforge.mixins.json @@ -3,7 +3,6 @@ "minVersion": "0.8", "package": "com.seibel.distanthorizons.neoforge.mixins", "mixins": [ - "server.unsafe.MixinThreadingDetector", "server.MixinUtilBackgroundThread", "server.MixinChunkGenerator", "server.MixinTFChunkGenerator"