mojang order of things

This commit is contained in:
gnembon committed 2020-06-04 22:35:03 -03:00
1 parent 6c01ae6807
commit 4e9a1aa39d
5 files changed
+56 -17

No files matched your search

@@ -0,0 +1,18 @@
package carpet.mixins;
import carpet.CarpetServer;
import net.minecraft.client.main.Main;
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(Main.class)
public class Main_clientCoreMixin
{
@Inject(method = "main", at = @At("HEAD"))
private static void onServerStarted(String[] args, CallbackInfo ci)
{
CarpetServer.onGameStarted();
}
}
@@ -0,0 +1,18 @@
package carpet.mixins;
import carpet.CarpetServer;
import net.minecraft.server.Main;
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(Main.class)
public class Main_serverCoreMixin
{
@Inject(method = "main", at = @At("HEAD"))
private static void onServerStarted(String[] args, CallbackInfo ci)
{
CarpetServer.onGameStarted();
}
}
@@ -14,12 +14,12 @@ public class MinecraftClientMixin
{
//to inject right before
// this.tickWorlds(booleanSupplier_1);
@Inject(method = "run", at = @At(value = "HEAD")
)
private void onInit(CallbackInfo ci) {
//CM start game hook
CarpetServer.onGameStarted();
}
//@Inject(method = "run", at = @At(value = "HEAD")
//)
//private void onInit(CallbackInfo ci) {
// //CM start game hook
// CarpetServer.onGameStarted();
//}
@Inject(method = "disconnect(Lnet/minecraft/client/gui/screen/Screen;)V", at = @At("HEAD"))
private void onCloseGame(Screen screen, CallbackInfo ci)
@@ -12,14 +12,14 @@ public class MinecraftDedicatedServerMixin
{
//to inject right before
// this.tickWorlds(booleanSupplier_1);
@Inject(method = "setupServer", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/dedicated/MinecraftDedicatedServer;loadWorld()V",
shift = At.Shift.BEFORE
))
private void onSetupServer(CallbackInfoReturnable<Boolean> cir) {
//CM start game hook
CarpetServer.onGameStarted();
}
//@Inject(method = "setupServer", at = @At(
// value = "INVOKE",
// target = "Lnet/minecraft/server/dedicated/MinecraftDedicatedServer;loadWorld()V",
// shift = At.Shift.BEFORE
//))
//private void onSetupServer(CallbackInfoReturnable<Boolean> cir) {
// //CM start game hook
// CarpetServer.onGameStarted();
//
//}
}
+4 -1
View File
@@ -3,7 +3,9 @@
"refmap": "fabric-carpet-refmap.json",
"package": "carpet.mixins",
"compatibilityLevel": "JAVA_8",
"mixins": [ "SpawnHelperInnerMixin",
"mixins": [
"Main_serverCoreMixin",
"SpawnHelperInnerMixin",
"CommandManagerMixin",
"ServerPlayNetworkHandlerMixin",
@@ -170,6 +172,7 @@
],
"client": [
"Main_clientCoreMixin",
"RenderTickCounter_tickSpeedMixin",
"MinecraftClientMixin",
"MinecraftClient_pausedShakeMixin",