aboutsummaryrefslogtreecommitdiff
path: root/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin
diff options
context:
space:
mode:
Diffstat (limited to 'spark-fabric/src/main/java/me/lucko/spark/fabric/mixin')
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftClientMixin.java52
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftServerMixin.java53
2 files changed, 0 insertions, 105 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftClientMixin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftClientMixin.java
deleted file mode 100644
index ae7ef5f..0000000
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftClientMixin.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of spark.
- *
- * Copyright (c) lucko (Luck) <luck@lucko.me>
- * Copyright (c) contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package me.lucko.spark.fabric.mixin;
-
-import me.lucko.spark.fabric.FabricSparkGameHooks;
-import me.lucko.spark.fabric.FabricSparkMod;
-import me.lucko.spark.fabric.plugin.FabricClientSparkPlugin;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.util.NonBlockingThreadExecutor;
-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.CallbackInfo;
-
-@Mixin(MinecraftClient.class)
-public abstract class MinecraftClientMixin extends NonBlockingThreadExecutor<Runnable> {
-
- public MinecraftClientMixin(String string_1) {
- super(string_1);
- }
-
- // Inject at when menu pops up
- @Inject(method = "init()V", at = @At(value = "INVOKE",
- target = "Lnet/minecraft/client/gui/screen/SplashScreen;method_18819(Lnet/minecraft/client/MinecraftClient;)V"))
- public void onInit(CallbackInfo ci) {
- FabricClientSparkPlugin.register(FabricSparkMod.getMod(), (MinecraftClient) (Object) this);
- }
-
- @Inject(method = "tick()V", at = @At("RETURN"))
- public void onTick(CallbackInfo ci) {
- FabricSparkGameHooks.INSTANCE.tickClientCounters();
- }
-
-}
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftServerMixin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftServerMixin.java
deleted file mode 100644
index 4e3a0ab..0000000
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftServerMixin.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of spark.
- *
- * Copyright (c) lucko (Luck) <luck@lucko.me>
- * Copyright (c) contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package me.lucko.spark.fabric.mixin;
-
-import me.lucko.spark.fabric.FabricSparkGameHooks;
-import me.lucko.spark.fabric.FabricSparkMod;
-import me.lucko.spark.fabric.plugin.FabricServerSparkPlugin;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.server.ServerTask;
-import net.minecraft.util.NonBlockingThreadExecutor;
-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.CallbackInfo;
-
-@Mixin(MinecraftServer.class)
-public abstract class MinecraftServerMixin extends NonBlockingThreadExecutor<ServerTask> {
-
- public MinecraftServerMixin(String string_1) {
- super(string_1);
- }
-
- // Inject before set favicon call
- @Inject(method = "run()V",
- at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;setFavicon(Lnet/minecraft/server/ServerMetadata;)V"))
- public void onRun(CallbackInfo ci) {
- FabricServerSparkPlugin.register(FabricSparkMod.getMod(), (MinecraftServer) (Object) this);
- }
-
- @Inject(method = "tick(Ljava/util/function/BooleanSupplier;)V", at = @At("RETURN"))
- public void onTick(CallbackInfo ci) {
- FabricSparkGameHooks.INSTANCE.tickServerCounters();
- }
-
-}