Merge pull request 'bug/7-dedicated_server_loading_client_classes' (#8) from bug/7-dedicated_server_loading_client_classes into 1.20.1
Reviewed-on: https://gitea.local.micle.dev/minecraft-mods/xp_tools/pulls/8
This commit is contained in:
@ -8,6 +8,8 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.AddReloadListenerEvent;
|
||||
import net.minecraftforge.event.server.ServerStartedEvent;
|
||||
@ -83,11 +85,13 @@ public class Proxy implements IProxy {
|
||||
private static void postSetup(FMLLoadCompleteEvent event) {}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public Player getClientPlayer() {
|
||||
return Minecraft.getInstance().player;
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public Level getClientLevel() {
|
||||
return Minecraft.getInstance().level;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ displayName = "${mod_name}"
|
||||
#logoFile="xp_tools.png"
|
||||
#credits=""
|
||||
authors = "${mod_authors}"
|
||||
#displayTest="MATCH_VERSION" # MATCH_VERSION, IGNORE_SERVER_VERSION (server only), IGNORE_ALL_VERSION (client only), NONE (IExtensionPoint.DisplayTest)
|
||||
displayTest="IGNORE_SERVER_VERSION" # MATCH_VERSION, IGNORE_SERVER_VERSION (server only), IGNORE_ALL_VERSION (client only), NONE (IExtensionPoint.DisplayTest)
|
||||
description = '''${mod_description}'''
|
||||
|
||||
[[dependencies."${mod_id}"]]
|
||||
|
Reference in New Issue
Block a user