From ed90c8c6a3356e6e8c6f27cca3836b365402142f Mon Sep 17 00:00:00 2001 From: Victor Kohler <16297430+CaelTheColher@users.noreply.github.com> Date: Wed, 15 Jun 2022 04:10:50 -0300 Subject: [PATCH] Bump version to 1.4.2 Fix compatibility issue with Bobby Fix Mod Menu config screen being wrong --- gradle.properties | 4 ++-- src/main/kotlin/me/cael/capes/Capes.kt | 3 +++ .../me/cael/capes/compatibility/ModMenuCompatibility.kt | 4 ++-- src/main/kotlin/me/cael/capes/handler/PlayerHandler.kt | 3 +-- src/main/kotlin/me/cael/capes/utils/FakePlayer.kt | 7 +++++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index 13b26e8..9bd4f76 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,14 +5,14 @@ org.gradle.jvmargs=-Xmx2G # Check these on https://fabricmc.net/versions.html minecraft_version=1.19 yarn_mappings=1.19+build.1 - loader_version=0.14.6 + loader_version=0.14.7 #Fabric api fabric_version=0.55.2+1.19 loom_version=0.12-SNAPSHOT # Mod Properties - mod_version = 1.4.1+1.19 + mod_version = 1.4.2+1.19 maven_group = me.cael archives_base_name = capes diff --git a/src/main/kotlin/me/cael/capes/Capes.kt b/src/main/kotlin/me/cael/capes/Capes.kt index e419c1a..a444baa 100644 --- a/src/main/kotlin/me/cael/capes/Capes.kt +++ b/src/main/kotlin/me/cael/capes/Capes.kt @@ -15,6 +15,7 @@ import net.minecraft.text.HoverEvent import net.minecraft.text.Style import net.minecraft.text.Text import net.minecraft.util.Formatting +import net.minecraft.util.Identifier object Capes : ClientModInitializer { @@ -72,4 +73,6 @@ object Capes : ClientModInitializer { return text } + fun identifier(id: String) = Identifier("capes", id) + } \ No newline at end of file diff --git a/src/main/kotlin/me/cael/capes/compatibility/ModMenuCompatibility.kt b/src/main/kotlin/me/cael/capes/compatibility/ModMenuCompatibility.kt index 4239a41..5b52e7a 100644 --- a/src/main/kotlin/me/cael/capes/compatibility/ModMenuCompatibility.kt +++ b/src/main/kotlin/me/cael/capes/compatibility/ModMenuCompatibility.kt @@ -2,11 +2,11 @@ package me.cael.capes.compatibility import com.terraformersmc.modmenu.api.ConfigScreenFactory import com.terraformersmc.modmenu.api.ModMenuApi -import me.cael.capes.menu.MainMenu +import me.cael.capes.menu.SelectorMenu import net.minecraft.client.MinecraftClient class ModMenuCompatibility : ModMenuApi { override fun getModConfigScreenFactory() = ConfigScreenFactory { - MainMenu(it, MinecraftClient.getInstance().options) + SelectorMenu(it, MinecraftClient.getInstance().options) } } \ No newline at end of file diff --git a/src/main/kotlin/me/cael/capes/handler/PlayerHandler.kt b/src/main/kotlin/me/cael/capes/handler/PlayerHandler.kt index 66f8bff..42c8bb4 100644 --- a/src/main/kotlin/me/cael/capes/handler/PlayerHandler.kt +++ b/src/main/kotlin/me/cael/capes/handler/PlayerHandler.kt @@ -7,6 +7,7 @@ import com.mojang.authlib.GameProfile import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap import me.cael.capes.CapeType import me.cael.capes.Capes +import me.cael.capes.Capes.identifier import me.cael.capes.handler.data.MCMData import me.cael.capes.handler.data.WynntilsData import net.minecraft.client.MinecraftClient @@ -197,6 +198,4 @@ class PlayerHandler(var profile: GameProfile) { return animatedCape } - fun identifier(id: String) = Identifier("capes", id) - } \ No newline at end of file diff --git a/src/main/kotlin/me/cael/capes/utils/FakePlayer.kt b/src/main/kotlin/me/cael/capes/utils/FakePlayer.kt index 394bd82..426d267 100644 --- a/src/main/kotlin/me/cael/capes/utils/FakePlayer.kt +++ b/src/main/kotlin/me/cael/capes/utils/FakePlayer.kt @@ -2,6 +2,7 @@ package me.cael.capes.utils import com.google.common.collect.Maps import com.mojang.authlib.minecraft.MinecraftProfileTexture +import me.cael.capes.Capes import me.cael.capes.handler.PlayerHandler import net.minecraft.client.MinecraftClient import net.minecraft.client.network.ClientPlayNetworkHandler @@ -17,7 +18,10 @@ import net.minecraft.network.ClientConnection import net.minecraft.network.NetworkSide import net.minecraft.util.Identifier import net.minecraft.util.registry.BuiltinRegistries +import net.minecraft.util.registry.Registry +import net.minecraft.util.registry.RegistryKey import net.minecraft.world.Difficulty +import net.minecraft.world.World import net.minecraft.world.dimension.DimensionTypes import java.util.* @@ -63,7 +67,6 @@ object FakePlayer : ClientPlayerEntity(MinecraftClient.getInstance(), val d = this.x - capeX val e = this.y - capeY val f = this.z - capeZ - val g = 10.0 if (d > 10.0) { capeX = this.x prevCapeX = capeX @@ -108,5 +111,5 @@ object FakePlayer : ClientPlayerEntity(MinecraftClient.getInstance(), } object FakeNetworkHandler : ClientPlayNetworkHandler(MinecraftClient.getInstance(), null, ClientConnection(NetworkSide.CLIENTBOUND), MinecraftClient.getInstance().session.profile, MinecraftClient.getInstance().createTelemetrySender()) - object FakeWorld : ClientWorld(FakeNetworkHandler, Properties(Difficulty.EASY, false, true), null, BuiltinRegistries.DIMENSION_TYPE.entryOf(DimensionTypes.OVERWORLD), 0, 0, null, null, false, 0L) + object FakeWorld : ClientWorld(FakeNetworkHandler, Properties(Difficulty.EASY, false, true), RegistryKey.of(Registry.WORLD_KEY, Capes.identifier("fakeworld")), BuiltinRegistries.DIMENSION_TYPE.entryOf(DimensionTypes.OVERWORLD), 0, 0, null, null, false, 0L) }