Skip to content

Commit

Permalink
Add server environment
Browse files Browse the repository at this point in the history
  • Loading branch information
MacaylaMarvelous81 committed Aug 4, 2024
1 parent c1671d2 commit 1c72eed
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ml.unbreakinggold.datapackinstaller.mixin;
package ml.unbreakinggold.datapackinstaller.mixin.client;

import ml.unbreakinggold.datapackinstaller.client.DatapackInstallerClient;
import net.minecraft.client.gui.screen.world.CreateWorldScreen;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ml.unbreakinggold.datapackinstaller.mixin;
package ml.unbreakinggold.datapackinstaller.mixin.client;

import ml.unbreakinggold.datapackinstaller.client.DatapackInstallerClient;
import ml.unbreakinggold.datapackinstaller.mixin.MinecraftServerAccessor;
import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.pack.PackScreen;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package ml.unbreakinggold.datapackinstaller.mixin.server;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.server.Main;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(Main.class)
@Environment(EnvType.SERVER)
public class ServerMainMixin {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package ml.unbreakinggold.datapackinstaller.server;

import net.fabricmc.api.DedicatedServerModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

@Environment(EnvType.SERVER)
public class DatapackInstallerServer implements DedicatedServerModInitializer {
@Override
public void onInitializeServer() {
}
}
9 changes: 6 additions & 3 deletions src/main/resources/DatapackInstaller.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
"MinecraftServerAccessor"
],
"client": [
"CreateWorldScreenMixin",
"GameMenuScreenMixin"
"client.CreateWorldScreenMixin",
"client.GameMenuScreenMixin"
],
"injectors": {
"defaultRequire": 1
}
},
"server": [
"server.ServerMainMixin"
]
}
3 changes: 3 additions & 0 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"entrypoints": {
"client": [
"ml.unbreakinggold.datapackinstaller.client.DatapackInstallerClient"
],
"server": [
"ml.unbreakinggold.datapackinstaller.server.DatapackInstallerServer"
]
},
"mixins": [
Expand Down

0 comments on commit 1c72eed

Please sign in to comment.