From 61b03bcdbbce4cfb73c956fb8207ca2acd4d2824 Mon Sep 17 00:00:00 2001 From: Kosma Moczek Date: Thu, 19 May 2022 17:20:21 +0200 Subject: [PATCH] fabric-1.19: migrateMappings to 1.19-pre1+build.1 --- fabric-1.19/gradle.properties | 8 ++++---- .../main/java/org/dynmap/fabric_1_19/DynmapPlugin.java | 2 +- .../java/org/dynmap/fabric_1_19/FabricCommandSender.java | 4 ++-- .../main/java/org/dynmap/fabric_1_19/FabricPlayer.java | 8 ++++---- .../main/java/org/dynmap/fabric_1_19/FabricServer.java | 6 +++--- .../fabric_1_19/mixin/ServerPlayNetworkHandlerMixin.java | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/fabric-1.19/gradle.properties b/fabric-1.19/gradle.properties index bdb66d3a..b2366258 100644 --- a/fabric-1.19/gradle.properties +++ b/fabric-1.19/gradle.properties @@ -1,4 +1,4 @@ -minecraft_version=1.18.2 -yarn_mappings=1.18.2+build.1 -loader_version=0.13.3 -fabric_version=0.47.8+1.18.2 +minecraft_version=1.19-pre1 +yarn_mappings=1.19-pre1+build.1 +loader_version=0.14.5 +fabric_version=0.52.4+1.19 diff --git a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/DynmapPlugin.java b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/DynmapPlugin.java index 280f6923..fc122cd8 100644 --- a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/DynmapPlugin.java +++ b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/DynmapPlugin.java @@ -527,7 +527,7 @@ public class DynmapPlugin { // getPlayer throws a CommandSyntaxException, so getEntity and instanceof for safety if (commandSource.getEntity() instanceof ServerPlayerEntity) { - psender = commandSource.getPlayer(); + psender = commandSource.getPlayerOrThrow(); } if (psender != null) { diff --git a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricCommandSender.java b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricCommandSender.java index 29769a68..b73af70c 100644 --- a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricCommandSender.java +++ b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricCommandSender.java @@ -1,7 +1,7 @@ package org.dynmap.fabric_1_19; import net.minecraft.server.command.ServerCommandSource; -import net.minecraft.text.LiteralText; +import net.minecraft.text.LiteralTextContent; import net.minecraft.text.Text; import org.dynmap.common.DynmapCommandSender; @@ -25,7 +25,7 @@ public class FabricCommandSender implements DynmapCommandSender { @Override public void sendMessage(String msg) { if (sender != null) { - Text ichatcomponent = new LiteralText(msg); + Text ichatcomponent = new LiteralTextContent(msg); sender.sendFeedback(ichatcomponent, false); } } diff --git a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java index 535ee4a5..0986adfc 100644 --- a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java +++ b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java @@ -12,7 +12,7 @@ import net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket; import net.minecraft.network.packet.s2c.play.TitleS2CPacket; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.LiteralText; +import net.minecraft.text.LiteralTextContent; import net.minecraft.text.Text; import net.minecraft.util.Util; import net.minecraft.util.math.Vec3d; @@ -188,7 +188,7 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer { @Override public void sendMessage(String msg) { - Text ichatcomponent = new LiteralText(msg); + Text ichatcomponent = new LiteralTextContent(msg); player.sendSystemMessage(ichatcomponent, Util.NIL_UUID); } @@ -239,12 +239,12 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer { TitleFadeS2CPacket times = new TitleFadeS2CPacket(fadeInTicks, stayTicks, fadeOutTicks); player.networkHandler.sendPacket(times); if (title != null) { - TitleS2CPacket titlepkt = new TitleS2CPacket(new LiteralText(title)); + TitleS2CPacket titlepkt = new TitleS2CPacket(new LiteralTextContent(title)); player.networkHandler.sendPacket(titlepkt); } if (subtitle != null) { - SubtitleS2CPacket subtitlepkt = new SubtitleS2CPacket(new LiteralText(subtitle)); + SubtitleS2CPacket subtitlepkt = new SubtitleS2CPacket(new LiteralTextContent(subtitle)); player.networkHandler.sendPacket(subtitlepkt); } } diff --git a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricServer.java b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricServer.java index 769821cf..8e9e5401 100644 --- a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricServer.java +++ b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricServer.java @@ -12,7 +12,7 @@ import net.minecraft.server.BannedPlayerList; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PlayerManager; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.LiteralText; +import net.minecraft.text.LiteralTextContent; import net.minecraft.text.Text; import net.minecraft.util.UserCache; import net.minecraft.util.Util; @@ -272,7 +272,7 @@ public class FabricServer extends DynmapServerInterface { case SIGN_CHANGE: BlockEvents.SIGN_CHANGE_EVENT.register((world, pos, lines, material, player) -> { plugin.core.processSignChange("fabric", FabricWorld.getWorldName(plugin, world), - pos.getX(), pos.getY(), pos.getZ(), lines, player.getName().asString()); + pos.getX(), pos.getY(), pos.getZ(), lines, player.getName().getContent()); }); break; @@ -292,7 +292,7 @@ public class FabricServer extends DynmapServerInterface { @Override public void broadcastMessage(String msg) { - Text component = new LiteralText(msg); + Text component = new LiteralTextContent(msg); server.getPlayerManager().broadcast(component, MessageType.SYSTEM, Util.NIL_UUID); Log.info(stripChatColor(msg)); } diff --git a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/mixin/ServerPlayNetworkHandlerMixin.java b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/mixin/ServerPlayNetworkHandlerMixin.java index 4fda22fc..19c027a9 100644 --- a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/mixin/ServerPlayNetworkHandlerMixin.java +++ b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/mixin/ServerPlayNetworkHandlerMixin.java @@ -8,7 +8,7 @@ import net.minecraft.server.filter.TextStream; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.text.LiteralText; +import net.minecraft.text.LiteralTextContent; import net.minecraft.util.math.BlockPos; import java.util.List; @@ -61,6 +61,6 @@ public abstract class ServerPlayNetworkHandlerMixin { // Put the (possibly updated) texts in the sign. Ignore filtering (is this OK?). for (int i=0; i