From 3d95f9250ae6d0cde79a6f57529bdb8c8285ad00 Mon Sep 17 00:00:00 2001 From: Kosma Moczek Date: Thu, 25 Nov 2021 19:33:41 +0100 Subject: [PATCH] fabric-1.18: remap and update to 1.18-rc1+build.1 --- fabric-1.18/build.gradle | 6 +++--- fabric-1.18/gradle.properties | 18 ++++++++++-------- .../org/dynmap/fabric_1_18/DynmapPlugin.java | 2 +- .../org/dynmap/fabric_1_18/FabricPlayer.java | 2 +- .../org/dynmap/fabric_1_18/FabricServer.java | 6 +++--- fabric-1.18/src/main/resources/fabric.mod.json | 6 +++--- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/fabric-1.18/build.gradle b/fabric-1.18/build.gradle index e396ec7a..824a9af0 100644 --- a/fabric-1.18/build.gradle +++ b/fabric-1.18/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.8-SNAPSHOT' + classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.10-SNAPSHOT' } } apply plugin: 'fabric-loom' @@ -15,8 +15,8 @@ loom { } } -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name version = parent.version diff --git a/fabric-1.18/gradle.properties b/fabric-1.18/gradle.properties index 185a372c..ec1b3af2 100644 --- a/fabric-1.18/gradle.properties +++ b/fabric-1.18/gradle.properties @@ -1,12 +1,14 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G -# Fabric Properties -# check these on https://fabricmc.net/use -minecraft_version=1.17.1 -yarn_mappings=1.17.1+build.1 -loader_version=0.11.6 + # Mod Properties archives_base_name=Dynmap -# Dependencies -# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api -fabric_version=0.36.1+1.17 + +# Fabric Properties +# check these on https://fabricmc.net/versions.html +minecraft_version=1.18-rc1 +yarn_mappings=1.18-rc1+build.1 +loader_version=0.12.5 + +#Fabric api +fabric_version=0.43.1+1.18 diff --git a/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/DynmapPlugin.java b/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/DynmapPlugin.java index 7c8c5d5e..cf05521f 100644 --- a/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/DynmapPlugin.java +++ b/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/DynmapPlugin.java @@ -310,7 +310,7 @@ public class DynmapPlugin { } // TODO: Consider whether cheats are enabled for integrated server - return server.isSinglePlayer() && player.equalsIgnoreCase(server.getUserName()); + return server.isSingleplayer() && player.equalsIgnoreCase(server.getSinglePlayerName()); } boolean hasPerm(PlayerEntity psender, String permission) { diff --git a/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/FabricPlayer.java b/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/FabricPlayer.java index f2673939..539a2fea 100644 --- a/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/FabricPlayer.java +++ b/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/FabricPlayer.java @@ -100,7 +100,7 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer { } Vec3d pos = player.getPos(); - return FabricAdapter.toDynmapLocation(plugin, player.getServerWorld(), pos.getX(), pos.getY(), pos.getZ()); + return FabricAdapter.toDynmapLocation(plugin, player.getWorld(), pos.getX(), pos.getY(), pos.getZ()); } @Override diff --git a/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/FabricServer.java b/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/FabricServer.java index 11f7f031..49b861d0 100644 --- a/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/FabricServer.java +++ b/fabric-1.18/src/main/java/org/dynmap/fabric_1_18/FabricServer.java @@ -181,7 +181,7 @@ public class FabricServer extends DynmapServerInterface { @Override public String getServerName() { String sn; - if (server.isSinglePlayer()) + if (server.isSingleplayer()) sn = "Integrated"; else sn = server.getServerIp(); @@ -308,7 +308,7 @@ public class FabricServer extends DynmapServerInterface { @Override public void broadcastMessage(String msg) { Text component = new LiteralText(msg); - server.getPlayerManager().broadcastChatMessage(component, MessageType.SYSTEM, Util.NIL_UUID); + server.getPlayerManager().broadcast(component, MessageType.SYSTEM, Util.NIL_UUID); Log.info(stripChatColor(msg)); } @@ -548,7 +548,7 @@ public class FabricServer extends DynmapServerInterface { @Override public String getServerIP() { - if (server.isSinglePlayer()) + if (server.isSingleplayer()) return "0.0.0.0"; else return server.getServerIp(); diff --git a/fabric-1.18/src/main/resources/fabric.mod.json b/fabric-1.18/src/main/resources/fabric.mod.json index b45ac449..5215624c 100644 --- a/fabric-1.18/src/main/resources/fabric.mod.json +++ b/fabric-1.18/src/main/resources/fabric.mod.json @@ -26,8 +26,8 @@ ], "depends": { - "fabricloader": ">=0.7.4", - "fabric": ">=0.17.0", - "minecraft": "1.17.1" + "fabricloader": ">=0.12.5", + "fabric": ">=0.43.1", + "minecraft": "1.18-rc.1" } }