generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
55 additions
and
25 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...mixin/client/ClientPlayerEntityMixin.java → ...ient/network/ClientPlayerEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
.../src/client/java/dev/hugeblank/bouquet/mixin/server/integrated/IntegratedServerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package dev.hugeblank.bouquet.mixin.server.integrated; | ||
|
||
import dev.hugeblank.bouquet.api.lib.DefaultEventsLib; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.integrated.IntegratedServer; | ||
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.CallbackInfoReturnable; | ||
|
||
@Mixin(IntegratedServer.class) | ||
public class IntegratedServerMixin { | ||
@Inject(at = @At("TAIL"), method = "setupServer") | ||
private void init(CallbackInfoReturnable<Boolean> cir) { | ||
DefaultEventsLib.SERVER_START.invoker().onServerStart((MinecraftServer) (Object) this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 1 addition & 16 deletions
17
bouquet/src/main/java/dev/hugeblank/bouquet/mixin/server/MinecraftServerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,19 @@ | ||
package dev.hugeblank.bouquet.mixin.server; | ||
|
||
import com.mojang.datafixers.DataFixer; | ||
import dev.hugeblank.bouquet.api.lib.DefaultEventsLib; | ||
import net.minecraft.registry.DynamicRegistryManager; | ||
import net.minecraft.resource.ResourcePackManager; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.SaveLoader; | ||
import net.minecraft.server.WorldGenerationProgressListenerFactory; | ||
import net.minecraft.util.ApiServices; | ||
import net.minecraft.world.level.storage.LevelStorage; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
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.net.Proxy; | ||
import java.util.function.BooleanSupplier; | ||
|
||
@Mixin(MinecraftServer.class) | ||
public abstract class MinecraftServerMixin { | ||
@Shadow public abstract DynamicRegistryManager.Immutable getRegistryManager(); | ||
|
||
@Inject(at = @At("TAIL"), method = "<init>") | ||
private void init(Thread serverThread, LevelStorage.Session session, ResourcePackManager dataPackManager, SaveLoader saveLoader, Proxy proxy, DataFixer dataFixer, ApiServices apiServices, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory, CallbackInfo ci) { | ||
// TODO: Server start event | ||
} | ||
|
||
@Inject(at = @At("TAIL"), method = "tick") | ||
private void tick(BooleanSupplier shouldKeepTicking, CallbackInfo ci) { | ||
DefaultEventsLib.TICK.invoker().onServerTick(); | ||
DefaultEventsLib.SERVER_TICK.invoker().onServerTick((MinecraftServer) (Object) this); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
bouquet/src/main/java/dev/hugeblank/bouquet/mixin/server/MinecraftServerSubclassMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package dev.hugeblank.bouquet.mixin.server; | ||
|
||
import dev.hugeblank.bouquet.api.lib.DefaultEventsLib; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.dedicated.MinecraftDedicatedServer; | ||
import net.minecraft.test.TestServer; | ||
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.CallbackInfoReturnable; | ||
|
||
@Mixin(value = {MinecraftDedicatedServer.class, TestServer.class}) | ||
public class MinecraftServerSubclassMixin { | ||
@Inject(at = @At("TAIL"), method = "setupServer") | ||
private void init(CallbackInfoReturnable<Boolean> cir) { | ||
DefaultEventsLib.SERVER_START.invoker().onServerStart((MinecraftServer) (Object) this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters