Port to 1.20.2
This commit is contained in:
@@ -3,26 +3,26 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
[versions]
|
||||
minecraft = "1.20"
|
||||
fabric_loader = "0.14.21"
|
||||
fabric_api = "0.83.0+1.20"
|
||||
minecraft = "1.20.2"
|
||||
fabric_loader = "0.14.22"
|
||||
fabric_api = "0.89.2+1.20.2"
|
||||
fabric_kotlin = "1.9.4+kotlin.1.8.21"
|
||||
yarn = "1.20+build.1"
|
||||
libgui = "8.0.1+1.20"
|
||||
rei = "12.0.622"
|
||||
yarn = "1.20.2+build.1"
|
||||
libgui = "8.1.0+1.20.2"
|
||||
rei = "13.0.655"
|
||||
devauth = "1.0.0"
|
||||
modmenu = "7.0.0"
|
||||
modmenu = "7.2.2"
|
||||
ktor = "2.3.0"
|
||||
dbus_java = "4.2.1"
|
||||
architectury = "9.0.7"
|
||||
architectury = "10.0.7"
|
||||
neurepoparser = "1.3.1"
|
||||
qolify = "1.3.0-1.20"
|
||||
qolify = "1.3.0-1.20.2"
|
||||
citresewn = "1.1.3+1.20"
|
||||
hotswap_agent = "1.4.2-SNAPSHOT"
|
||||
sodium = "mc1.20-0.4.10"
|
||||
sodium = "mc1.20.2-0.5.3"
|
||||
freecammod = "1.2.0-mc1.20"
|
||||
ncr = "Fabric-1.20-v2.2.0"
|
||||
mixinextras = "0.2.0-beta.9"
|
||||
mixinextras = "0.2.0-rc.5"
|
||||
jarvis = "1.1.1"
|
||||
nealisp = "1.0.0"
|
||||
|
||||
@@ -38,7 +38,7 @@ repoparser = { module = "moe.nea:neurepoparser", version.ref = "neurepoparser" }
|
||||
dbus_java_core = { module = "com.github.hypfvieh:dbus-java-core", version.ref = "dbus_java" }
|
||||
dbus_java_unixsocket = { module = "com.github.hypfvieh:dbus-java-transport-native-unixsocket", version.ref = "dbus_java" }
|
||||
libgui = { module = "io.github.cottonmc:LibGui", version.ref = "libgui" }
|
||||
mixinextras = { module = "com.github.llamalad7.mixinextras:mixinextras-fabric", version.ref = "mixinextras" }
|
||||
mixinextras = { module = "io.github.llamalad7:mixinextras-fabric", version.ref = "mixinextras" }
|
||||
jarvis_api = { module = "moe.nea.jarvis:jarvis-api", version.ref = "jarvis" }
|
||||
jarvis_fabric = { module = "moe.nea.jarvis:jarvis-fabric", version.ref = "jarvis" }
|
||||
nealisp = { module = "moe.nea:nealisp", version.ref = "nealisp" }
|
||||
@@ -60,11 +60,11 @@ dbus = ["dbus_java_core", "dbus_java_unixsocket"]
|
||||
runtime_required = ["architectury_fabric", "rei_fabric"]
|
||||
runtime_optional = [
|
||||
"devauth",
|
||||
"freecammod",
|
||||
# "freecammod",
|
||||
"sodium",
|
||||
"qolify",
|
||||
# "citresewn",
|
||||
"ncr",
|
||||
# "ncr",
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package moe.nea.firmament.mixins;
|
||||
|
||||
import moe.nea.firmament.events.OutgoingPacketEvent;
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ClientCommonNetworkHandler.class)
|
||||
public class MixinClientCommonNetworkHandler {
|
||||
@Inject(method = "sendPacket(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true)
|
||||
public void onSendPacket(Packet<?> packet, CallbackInfo ci) {
|
||||
if (OutgoingPacketEvent.Companion.publish(new OutgoingPacketEvent(packet)).getCancelled()) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,11 +29,4 @@ public class MixinClientPacketHandler {
|
||||
packet.isLongDistance()
|
||||
));
|
||||
}
|
||||
|
||||
@Inject(method = "sendPacket(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true)
|
||||
public void onSendPacket(Packet<?> packet, CallbackInfo ci) {
|
||||
if (OutgoingPacketEvent.Companion.publish(new OutgoingPacketEvent(packet)).getCancelled()) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package moe.nea.firmament.mixins;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(PlayerInventory.class)
|
||||
public class MixinPlayerInventory {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package moe.nea.firmament.mixins;
|
||||
|
||||
import moe.nea.firmament.features.fixes.Fixes;
|
||||
import net.minecraft.client.network.PlayerListEntry;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
|
||||
@Mixin(PlayerListEntry.class)
|
||||
public class MixinPlayerListEntry {
|
||||
@ModifyArg(method = "loadTextures", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/PlayerSkinProvider;loadSkin(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/texture/PlayerSkinProvider$SkinTextureAvailableCallback;Z)V"))
|
||||
public boolean shouldBeSecure(boolean originalSecure) {
|
||||
if (Fixes.TConfig.INSTANCE.getFixUnsignedPlayerSkins()) {
|
||||
return false;
|
||||
}
|
||||
return originalSecure;
|
||||
}
|
||||
}
|
||||
33
src/main/java/moe/nea/firmament/mixins/MixinProperty.java
Normal file
33
src/main/java/moe/nea/firmament/mixins/MixinProperty.java
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package moe.nea.firmament.mixins;
|
||||
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import moe.nea.firmament.features.fixes.Fixes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
||||
@Mixin(value = Property.class, remap = false)
|
||||
public class MixinProperty {
|
||||
@Inject(method = "isSignatureValid", cancellable = true, at = @At("HEAD"), remap = false)
|
||||
public void onValidateSignature(PublicKey publicKey, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (Fixes.TConfig.INSTANCE.getFixUnsignedPlayerSkins()) {
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "hasSignature", cancellable = true, at = @At("HEAD"), remap = false)
|
||||
public void onHasSignature(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (Fixes.TConfig.INSTANCE.getFixUnsignedPlayerSkins()) {
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package moe.nea.firmament.mixins;
|
||||
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo;
|
||||
import moe.nea.firmament.features.fixes.Fixes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(value = YggdrasilServicesKeyInfo.class, remap = false)
|
||||
public class MixinYggdrasilServicesKeyInfo {
|
||||
@Inject(method = "validateProperty", at = @At("HEAD"), cancellable = true, remap = false)
|
||||
public void validate(Property property, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (Fixes.TConfig.INSTANCE.getFixUnsignedPlayerSkins()) {
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,21 +7,24 @@
|
||||
package moe.nea.firmament.mixins.devenv;
|
||||
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.packet.CustomPayload;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.slf4j.Logger;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Mixin(ClientPlayNetworkHandler.class)
|
||||
public class DisableCommonPacketWarnings {
|
||||
|
||||
@Redirect(method = "onCustomPayload", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V", remap = false))
|
||||
public void onCustomPacket(Logger instance, String s, Object o) {
|
||||
if (!Objects.equals(o, Identifier.of("badlion", "mods"))) {
|
||||
instance.warn(s, o);
|
||||
@Inject(method = "method_52801", at = @At("HEAD"))
|
||||
public void onCustomPacketError(CustomPayload customPayload, CallbackInfo ci) {
|
||||
if (Objects.equals(customPayload.id(), Identifier.of("badlion", "mods"))) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ object UrsaManager {
|
||||
withContext(Dispatchers.IO) {
|
||||
val mc = MinecraftClient.getInstance()
|
||||
val serverId = UUID.randomUUID().toString()
|
||||
mc.sessionService.joinServer(mc.session.profile, mc.session.accessToken, serverId)
|
||||
header("x-ursa-username", mc.session.profile.name)
|
||||
mc.sessionService.joinServer(mc.session.uuidOrNull, mc.session.accessToken, serverId)
|
||||
header("x-ursa-username", mc.session.username)
|
||||
header("x-ursa-serverid", serverId)
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -102,9 +102,14 @@ class StorageOverlayScreen() : Screen(Text.empty()) {
|
||||
return page.inventory?.rows?.let { it * 19 + MC.font.fontHeight + 2 } ?: 60
|
||||
}
|
||||
|
||||
override fun mouseScrolled(mouseX: Double, mouseY: Double, amount: Double): Boolean {
|
||||
override fun mouseScrolled(
|
||||
mouseX: Double,
|
||||
mouseY: Double,
|
||||
horizontalAmount: Double,
|
||||
verticalAmount: Double
|
||||
): Boolean {
|
||||
scroll =
|
||||
(scroll + amount * StorageOverlay.config.scrollSpeed *
|
||||
(scroll + horizontalAmount * StorageOverlay.config.scrollSpeed *
|
||||
(if (StorageOverlay.config.inverseScroll) 1 else -1)).toInt()
|
||||
.coerceAtMost(lastRenderedHeight - height + 2 * StorageOverlay.config.margin).coerceAtLeast(0)
|
||||
return true
|
||||
|
||||
@@ -13,7 +13,11 @@ import io.github.moulberry.repo.NEURepositoryException
|
||||
import io.github.moulberry.repo.data.NEUItem
|
||||
import io.github.moulberry.repo.data.NEURecipe
|
||||
import io.github.moulberry.repo.data.Rarity
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
|
||||
import kotlinx.coroutines.launch
|
||||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.network.packet.s2c.play.SynchronizeRecipesS2CPacket
|
||||
import net.minecraft.text.Text
|
||||
import moe.nea.firmament.Firmament
|
||||
import moe.nea.firmament.Firmament.logger
|
||||
import moe.nea.firmament.gui.config.ManagedConfig
|
||||
@@ -21,10 +25,6 @@ import moe.nea.firmament.hud.ProgressBar
|
||||
import moe.nea.firmament.rei.PetData
|
||||
import moe.nea.firmament.util.MinecraftDispatcher
|
||||
import moe.nea.firmament.util.SkyblockId
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
|
||||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.network.packet.s2c.play.SynchronizeRecipesS2CPacket
|
||||
import net.minecraft.text.Text
|
||||
|
||||
object RepoManager {
|
||||
object Config : ManagedConfig("repo") {
|
||||
@@ -54,9 +54,11 @@ object RepoManager {
|
||||
|
||||
var recentlyFailedToUpdateItemList = false
|
||||
|
||||
val progressBar = ProgressBar("", null, 0).also {
|
||||
val progressBar by lazy {
|
||||
ProgressBar("", null, 0).also {
|
||||
it.setSize(180, 22)
|
||||
}
|
||||
}
|
||||
|
||||
val neuRepo: NEURepository = NEURepository.of(RepoDownloadManager.repoSavedLocation).apply {
|
||||
registerReloadListener(ItemCache)
|
||||
|
||||
@@ -8,6 +8,7 @@ package moe.nea.firmament.util
|
||||
|
||||
import java.util.Optional
|
||||
import net.minecraft.scoreboard.Scoreboard
|
||||
import net.minecraft.scoreboard.ScoreboardDisplaySlot
|
||||
import net.minecraft.scoreboard.Team
|
||||
import net.minecraft.text.StringVisitable
|
||||
import net.minecraft.text.Style
|
||||
@@ -16,7 +17,7 @@ import net.minecraft.util.Formatting
|
||||
|
||||
fun getScoreboardLines(): List<Text> {
|
||||
val scoreboard = MC.player?.scoreboard ?: return listOf()
|
||||
val activeObjective = scoreboard.getObjectiveForSlot(Scoreboard.SIDEBAR_DISPLAY_SLOT_ID) ?: return listOf()
|
||||
val activeObjective = scoreboard.getObjectiveForSlot(ScoreboardDisplaySlot.SIDEBAR) ?: return listOf()
|
||||
return scoreboard.getAllPlayerScores(activeObjective).reversed().take(15).map {
|
||||
val team = scoreboard.getPlayerTeam(it.playerName)
|
||||
Team.decorateName(team, Text.literal(it.playerName))
|
||||
|
||||
@@ -4,3 +4,4 @@ accessible class net/minecraft/client/render/RenderLayer$MultiPhaseParameters
|
||||
accessible class net/minecraft/client/font/TextRenderer$Drawer
|
||||
accessible class net/minecraft/client/render/model/ModelLoader$BakerImpl
|
||||
accessible method net/minecraft/client/render/model/ModelLoader$BakerImpl <init> (Lnet/minecraft/client/render/model/ModelLoader;Ljava/util/function/BiFunction;Lnet/minecraft/util/Identifier;)V
|
||||
accessible field net/minecraft/client/texture/PlayerSkinProvider TEXTURES Ljava/lang/String;
|
||||
|
||||
Reference in New Issue
Block a user