From 98f175239da1a7871913ccace88dfdb09b8f1d67 Mon Sep 17 00:00:00 2001 From: Arnaud Lier Date: Sun, 5 Jun 2022 16:19:30 +0200 Subject: [PATCH 1/2] Adds ModMenu `library` badge. This allows to filter library mods in [ModMenu](https://github.com/TerraformersMC/ModMenu/wiki/API#badges). --- src/main/resources/fabric.mod.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 365b6f1..6cb3f4c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,5 +29,10 @@ "depends": { }, "suggests": { + }, + "custom": { + "modmenu": { + "badges": [ "library" ] + } } } From 8056b455af7437bcf9270d2b06987b37a1e1adb5 Mon Sep 17 00:00:00 2001 From: PTOM76 Date: Tue, 12 Jul 2022 15:30:52 +0900 Subject: [PATCH 2/2] Port to 1.19 --- build.gradle | 5 ++++- gradle.properties | 10 +++++----- .../mixin/PlayerAdvancementTrackerMixin.java | 2 +- .../fakeplayerapi/mixin/ServerPlayerEntityMixin.java | 2 +- .../server/FakePlayerAdvancementTracker.java | 2 +- .../fakeplayerapi/server/FakePlayerBuilder.java | 10 ++++++---- .../server/FakeServerPlayNetworkHandler.java | 2 +- .../fakeplayerapi/server/FakeServerPlayer.java | 6 ++++-- .../fakeplayerapi/server/FakeServerPlayerFactory.java | 4 +++- .../fakeplayerapi/server/FakeServerStatHandler.java | 2 +- src/main/resources/fabric.mod.json | 5 ----- 11 files changed, 27 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 1a865bf..69bd8a7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.10-SNAPSHOT' + id 'fabric-loom' version '0.12-SNAPSHOT' id 'maven-publish' } @@ -79,6 +79,8 @@ publishing { // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { + // Temporary response + /* maven { url "https://maven.cafeteria.dev/releases" credentials { @@ -89,5 +91,6 @@ publishing { basic(BasicAuthentication) } } + */ } } diff --git a/gradle.properties b/gradle.properties index e014866..a951368 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.18 -yarn_mappings=1.18+build.1 -loader_version=0.12.8 +minecraft_version=1.19 +yarn_mappings=1.19+build.4 +loader_version=0.14.8 #Fabric api -fabric_version=0.44.0+1.18 +fabric_version=0.57.0+1.19 # Mod Properties -mod_version = 0.3.0 +mod_version = 0.4.0 maven_group = dev.cafeteria archives_base_name = fakeplayerapi diff --git a/src/main/java/dev/cafeteria/fakeplayerapi/mixin/PlayerAdvancementTrackerMixin.java b/src/main/java/dev/cafeteria/fakeplayerapi/mixin/PlayerAdvancementTrackerMixin.java index 0900198..331adf4 100644 --- a/src/main/java/dev/cafeteria/fakeplayerapi/mixin/PlayerAdvancementTrackerMixin.java +++ b/src/main/java/dev/cafeteria/fakeplayerapi/mixin/PlayerAdvancementTrackerMixin.java @@ -16,4 +16,4 @@ public class PlayerAdvancementTrackerMixin { private void fakeplayerapi_cancelLoad(ServerAdvancementLoader advancementLoader, CallbackInfo ci) { if ((Object) this instanceof FakePlayerAdvancementTracker) ci.cancel(); } -} +} \ No newline at end of file diff --git a/src/main/java/dev/cafeteria/fakeplayerapi/mixin/ServerPlayerEntityMixin.java b/src/main/java/dev/cafeteria/fakeplayerapi/mixin/ServerPlayerEntityMixin.java index 6caa8b5..ab86d50 100644 --- a/src/main/java/dev/cafeteria/fakeplayerapi/mixin/ServerPlayerEntityMixin.java +++ b/src/main/java/dev/cafeteria/fakeplayerapi/mixin/ServerPlayerEntityMixin.java @@ -16,4 +16,4 @@ public class ServerPlayerEntityMixin { @Shadow @Final @Mutable private PlayerAdvancementTracker advancementTracker; -} +} \ No newline at end of file diff --git a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakePlayerAdvancementTracker.java b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakePlayerAdvancementTracker.java index f38831c..ad1ecda 100644 --- a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakePlayerAdvancementTracker.java +++ b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakePlayerAdvancementTracker.java @@ -52,4 +52,4 @@ public void setDisplayTab(@Nullable Advancement advancement) { public AdvancementProgress getProgress(Advancement advancement) { return new AdvancementProgress(); } -} +} \ No newline at end of file diff --git a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakePlayerBuilder.java b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakePlayerBuilder.java index fc36f5b..8730907 100644 --- a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakePlayerBuilder.java +++ b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakePlayerBuilder.java @@ -1,9 +1,11 @@ package dev.cafeteria.fakeplayerapi.server; import com.mojang.authlib.GameProfile; +import net.minecraft.network.encryption.PlayerPublicKey; import net.minecraft.server.MinecraftServer; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.Identifier; +import org.jetbrains.annotations.Nullable; import java.util.UUID; @@ -30,11 +32,11 @@ public Identifier getId() { return builderId; } - public FakeServerPlayer create(MinecraftServer server, ServerWorld world, GameProfile profile) { - return factory.create(this, server, world, profile); + public FakeServerPlayer create(MinecraftServer server, ServerWorld world, GameProfile profile, @Nullable PlayerPublicKey publicKey) { + return factory.create(this, server, world, profile, publicKey); } - public FakeServerPlayer create(MinecraftServer server, ServerWorld world, String name) { - return factory.create(this, server, world, new GameProfile(UUID.randomUUID(), name)); + public FakeServerPlayer create(MinecraftServer server, ServerWorld world, String name, @Nullable PlayerPublicKey publicKey) { + return factory.create(this, server, world, new GameProfile(UUID.randomUUID(), name), publicKey); } } diff --git a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayNetworkHandler.java b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayNetworkHandler.java index 9ae0dfe..327eec5 100644 --- a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayNetworkHandler.java +++ b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayNetworkHandler.java @@ -235,4 +235,4 @@ public void tick() { @Override public void disconnect(Text reason) { } -} +} \ No newline at end of file diff --git a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayer.java b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayer.java index 5fd6de2..fd5b9b9 100644 --- a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayer.java +++ b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayer.java @@ -3,16 +3,18 @@ import com.mojang.authlib.GameProfile; import dev.cafeteria.fakeplayerapi.mixin.ServerPlayerEntityAccessor; import net.minecraft.entity.LivingEntity; +import net.minecraft.network.encryption.PlayerPublicKey; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; +import org.jetbrains.annotations.Nullable; public class FakeServerPlayer extends ServerPlayerEntity { private final FakePlayerBuilder builder; - protected FakeServerPlayer(FakePlayerBuilder builder, MinecraftServer server, ServerWorld world, GameProfile profile) { - super(server, world, profile); + protected FakeServerPlayer(FakePlayerBuilder builder, MinecraftServer server, ServerWorld world, GameProfile profile, @Nullable PlayerPublicKey publicKey) { + super(server, world, profile, publicKey); this.builder = builder; this.networkHandler = new FakeServerPlayNetworkHandler(server, FakeClientConnection.SERVER_FAKE_CONNECTION, this); diff --git a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayerFactory.java b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayerFactory.java index abd52e7..4794da7 100644 --- a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayerFactory.java +++ b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerPlayerFactory.java @@ -1,12 +1,14 @@ package dev.cafeteria.fakeplayerapi.server; import com.mojang.authlib.GameProfile; +import net.minecraft.network.encryption.PlayerPublicKey; import net.minecraft.server.MinecraftServer; import net.minecraft.server.world.ServerWorld; +import org.jetbrains.annotations.Nullable; public interface FakeServerPlayerFactory { FakeServerPlayerFactory DEFAULT = FakeServerPlayer::new; - FakeServerPlayer create(FakePlayerBuilder builder, MinecraftServer server, ServerWorld world, GameProfile profile); + FakeServerPlayer create(FakePlayerBuilder builder, MinecraftServer server, ServerWorld world, GameProfile profile, @Nullable PlayerPublicKey publicKey); } diff --git a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerStatHandler.java b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerStatHandler.java index 9d2f627..4ccea4e 100644 --- a/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerStatHandler.java +++ b/src/main/java/dev/cafeteria/fakeplayerapi/server/FakeServerStatHandler.java @@ -47,4 +47,4 @@ public int getStat(StatType type, T stat) { public int getStat(Stat stat) { return 0; } -} +} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 6cb3f4c..365b6f1 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,10 +29,5 @@ "depends": { }, "suggests": { - }, - "custom": { - "modmenu": { - "badges": [ "library" ] - } } }