mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Update for Java 1.19 and Geyser 2.0.4-SNAPSHOT (#53)
* Update for 1.19 and 2.0.4-SNAPSHOT * Use mod version in Geyser dependency
This commit is contained in:
parent
4b4529c590
commit
2a89eab100
6 changed files with 18 additions and 22 deletions
|
@ -27,7 +27,7 @@ package org.geysermc.platform.fabric.command;
|
|||
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.command.CommandSender;
|
||||
import org.geysermc.geyser.text.ChatColor;
|
||||
|
@ -49,7 +49,7 @@ public class FabricCommandSender implements CommandSender {
|
|||
@Override
|
||||
public void sendMessage(String message) {
|
||||
if (source.getEntity() instanceof ServerPlayerEntity) {
|
||||
((ServerPlayerEntity) source.getEntity()).sendMessage(new LiteralText(message), false);
|
||||
((ServerPlayerEntity) source.getEntity()).sendMessage(Text.literal(message), false);
|
||||
} else {
|
||||
GeyserImpl.getInstance().getLogger().info(ChatColor.toANSI(message + ChatColor.RESET));
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.fabricmc.api.Environment;
|
|||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.integrated.IntegratedServer;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.GameMode;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
import org.geysermc.platform.fabric.GeyserFabricMod;
|
||||
|
@ -58,7 +58,7 @@ public class IntegratedServerMixin implements GeyserServerPortGetter {
|
|||
// Ensure player locale has been loaded, in case it's different from Java system language
|
||||
GeyserLocale.loadGeyserLocale(this.client.options.language);
|
||||
// Give indication that Geyser is loaded
|
||||
this.client.player.sendMessage(new LiteralText(GeyserLocale.getPlayerLocaleString("geyser.core.start",
|
||||
this.client.player.sendMessage(Text.literal(GeyserLocale.getPlayerLocaleString("geyser.core.start",
|
||||
this.client.options.language, "localhost", String.valueOf(this.lanPort))), false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,27 +25,23 @@
|
|||
|
||||
package org.geysermc.platform.fabric.mixin.server;
|
||||
|
||||
import com.mojang.authlib.GameProfileRepository;
|
||||
import com.mojang.authlib.minecraft.MinecraftSessionService;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import net.minecraft.resource.ResourcePackManager;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.SaveLoader;
|
||||
import net.minecraft.server.WorldGenerationProgressListenerFactory;
|
||||
import net.minecraft.server.dedicated.MinecraftDedicatedServer;
|
||||
import net.minecraft.util.UserCache;
|
||||
import net.minecraft.util.ApiServices;
|
||||
import net.minecraft.world.level.storage.LevelStorage;
|
||||
import org.geysermc.platform.fabric.GeyserServerPortGetter;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
import java.net.Proxy;
|
||||
|
||||
@Mixin(MinecraftDedicatedServer.class)
|
||||
public abstract class MinecraftDedicatedServerMixin extends MinecraftServer implements GeyserServerPortGetter {
|
||||
// Constructor to compile
|
||||
public MinecraftDedicatedServerMixin(Thread serverThread, LevelStorage.Session session, ResourcePackManager dataPackManager, SaveLoader saveLoader, Proxy proxy, DataFixer dataFixer, @Nullable MinecraftSessionService sessionService, @Nullable GameProfileRepository gameProfileRepo, @Nullable UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) {
|
||||
super(serverThread, session, dataPackManager, saveLoader, proxy, dataFixer, sessionService, gameProfileRepo, userCache, worldGenerationProgressListenerFactory);
|
||||
public MinecraftDedicatedServerMixin(Thread serverThread, LevelStorage.Session session, ResourcePackManager dataPackManager, SaveLoader saveLoader, Proxy proxy, DataFixer dataFixer, ApiServices apiServices, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) {
|
||||
super(serverThread, session, dataPackManager, saveLoader, proxy, dataFixer, apiServices, worldGenerationProgressListenerFactory);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,6 @@
|
|||
"depends": {
|
||||
"fabricloader": ">=0.11.3",
|
||||
"fabric": "*",
|
||||
"minecraft": ">=1.18.2"
|
||||
"minecraft": ">=1.19"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue