aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-11-15 23:13:50 +0100
committerLinnea Gräf <nea@nea.moe>2025-11-15 23:13:50 +0100
commit4d8399ff4d769def62e6a8241327c4f2dac47e71 (patch)
tree703f8651cb680d2583d82c2b1b4aee0911ccb490
parent215178c650d38a4a77fdef6dc8815c07bef29c25 (diff)
downloadFirmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.tar.gz
Firmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.tar.bz2
Firmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.zip
snapshot: main source set compile
-rw-r--r--gradle/libs.versions.toml39
-rw-r--r--src/main/java/moe/nea/firmament/init/ClientPlayerRiser.java75
-rw-r--r--src/main/java/moe/nea/firmament/init/EarlyRiser.java1
-rw-r--r--src/main/java/moe/nea/firmament/init/HandledScreenRiser.java52
-rw-r--r--src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java1
-rw-r--r--src/main/java/moe/nea/firmament/mixins/accessor/AccessorNbtComponent.java12
-rw-r--r--src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java40
-rw-r--r--src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java33
-rw-r--r--src/main/kotlin/apis/UrsaManager.kt2
-rw-r--r--src/main/kotlin/events/FinalizeResourceManagerEvent.kt6
-rw-r--r--src/main/kotlin/features/debug/PowerUserTools.kt3
-rw-r--r--src/main/kotlin/features/debug/SkinPreviews.kt18
-rw-r--r--src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt3
-rw-r--r--src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt6
-rw-r--r--src/main/kotlin/features/inventory/SaveCursorPosition.kt2
-rw-r--r--src/main/kotlin/features/inventory/SlotLocking.kt8
-rw-r--r--src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt53
-rw-r--r--src/main/kotlin/features/inventory/storageoverlay/StorageOverlayCustom.kt43
-rw-r--r--src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt51
-rw-r--r--src/main/kotlin/features/inventory/storageoverlay/StorageOverviewScreen.kt16
-rw-r--r--src/main/kotlin/features/mining/HotmPresets.kt5
-rw-r--r--src/main/kotlin/features/misc/CustomCapes.kt29
-rw-r--r--src/main/kotlin/features/world/TemporaryWaypoints.kt6
-rw-r--r--src/main/kotlin/gui/entity/GuiPlayer.kt44
-rw-r--r--src/main/kotlin/gui/entity/ModifyPlayerSkin.kt76
-rw-r--r--src/main/kotlin/gui/entity/ModifyRiding.kt2
-rw-r--r--src/main/kotlin/keybindings/FirmamentKeyBindings.kt4
-rw-r--r--src/main/kotlin/keybindings/GenericInputButton.kt16
-rw-r--r--src/main/kotlin/repo/RepoModResourcePack.kt5
-rw-r--r--src/main/kotlin/util/FragmentGuiScreen.kt31
-rw-r--r--src/main/kotlin/util/MC.kt1
-rw-r--r--src/main/kotlin/util/ScoreboardUtil.kt2
-rw-r--r--src/main/kotlin/util/SkyblockId.kt3
-rw-r--r--src/main/kotlin/util/customgui/CustomGui.kt15
-rw-r--r--src/main/kotlin/util/mc/CustomRenderPassHelper.kt3
-rw-r--r--src/main/kotlin/util/mc/NbtUtil.kt5
-rw-r--r--src/main/kotlin/util/mc/SkullItemData.kt4
-rw-r--r--src/main/resources/firmament.accesswidener8
38 files changed, 330 insertions, 393 deletions
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 4c18ea7..625f436 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: CC0-1.0
[versions]
-minecraft = "1.21.7"
+minecraft = "1.21.10"
# Update from https://maven.fabricmc.net/net/fabricmc/fabric-language-kotlin/
fabric_kotlin = "1.13.7+kotlin.2.2.21"
@@ -13,44 +13,37 @@ kotlin = "2.2.21"
kotlin_ksp = "2.2.21-2.0.4"
# Update from https://linkie.shedaniel.dev/dependencies?loader=fabric
-yarn = "1.21.7+build.8"
-fabric_loader = "0.16.14"
-fabric_api = "0.129.0+1.21.7"
-architectury = "17.0.6"
-modmenu = "15.0.0-beta.3"
+yarn = "1.21.10+build.2"
+fabric_loader = "0.18.0"
+fabric_api = "0.138.3+1.21.10"
+architectury = "18.0.6"
+modmenu = "16.0.0-rc.1"
# Update from https://maven.architectury.dev/me/shedaniel/RoughlyEnoughItems-fabric/ (but is typically late)
-rei = "19.0.805"
+rei = "20.0.811"
reidev = "33d8900cd6621816680634fcbae2dd07f1cffbd3"
# Update from https://maven.architectury.dev/dev/architectury/loom/dev.architectury.loom.gradle.plugin/
loom = "1.13.457" # TODO: port back to architectury (and) 1.9.424
-# Update from https://modrinth.com/mod/qolify/versions?l=fabric
-qolify = "1.6.0-1.21.1"
-
# Update from https://modrinth.com/mod/sodium/versions?l=fabric
-sodium = "mc1.21.8-0.7.2-fabric"
+sodium = "mc1.21.10-0.7.3-fabric"
# Update from https://modrinth.com/mod/freecam/versions?l=fabric
-freecammod = "1.3.4+mc1.21.6"
-
-# Update from https://modrinth.com/mod/no-chat-reports/versions?l=fabric
-ncr = "Fabric-1.21.7-v2.14.0"
+freecammod = "1.3.5+mc1.21.10"
# Update from https://modrinth.com/mod/female-gender/versions?l=fabric
-femalegender = "4.3.4+1.21.7"
+femalegender = "5.0.0-Beta.2+1.21.10"
# Update from https://modrinth.com/mod/iris/versions?l=fabric
-iris = "1.9.6+1.21.8-fabric"
+iris = "1.9.6+1.21.10-fabric"
shadow = "8.3.8"
-
# Update from https://modrinth.com/mod/not-enough-animations/versions?l=fabric
-notenoughanimations = "JTLkasT1"
+notenoughanimations = "rPkK5la7"
# Update from https://modrinth.com/mod/jade/versions?l=fabric
-jade = "19.0.4+fabric"
+jade = "20.1.0+fabric"
devauth = "1.2.1"
@@ -84,7 +77,7 @@ manninghamMills = "2.4.1"
# Update from https://docs.isxander.dev/yet-another-config-lib/installing-yacl
# Nvm, they just don't update docs: https://modrinth.com/mod/yacl/versions?l=fabric
-yacl = "3.7.1+1.21.6-fabric"
+yacl = "3.8.0+1.21.9-fabric"
# Update from https://maven.shedaniel.me/me/shedaniel/cloth/basic-math/
basicMath = "0.6.1"
@@ -109,7 +102,7 @@ rei_fabric = { module = "me.shedaniel:RoughlyEnoughItems-fabric", version.ref =
rei_dev_api = { module = "com.github.shedaniel.roughlyenoughitems:RoughlyEnoughItems-api", version.ref = "reidev" }
rei_dev_fabric = { module = "com.github.shedaniel.roughlyenoughitems:RoughlyEnoughItems-fabric", version.ref = "reidev" }
-moulconfig = { module = "org.notenoughupdates.moulconfig:modern-1.21.7", version.ref = "moulconfig" }
+moulconfig = { module = "org.notenoughupdates.moulconfig:modern-1.21.10", version.ref = "moulconfig" }
repoparser = { module = "moe.nea:neurepoparser", version.ref = "neurepoparser" }
mixinextras = { module = "io.github.llamalad7:mixinextras-fabric", version.ref = "mixinextras" }
jarvis_api = { module = "moe.nea.jarvis:jarvis-api", version.ref = "jarvis" }
@@ -125,8 +118,6 @@ hotswap = { module = "virtual.github.hotswapagent:hotswap-agent", version.ref =
architectury_fabric = { module = "dev.architectury:architectury-fabric", version.ref = "architectury" }
devauth = { module = "me.djtheredstoner:DevAuth-fabric", version.ref = "devauth" }
modmenu = { module = "maven.modrinth:modmenu", version.ref = "modmenu" }
-qolify = { module = "maven.modrinth:qolify", version.ref = "qolify" }
-ncr = { module = "maven.modrinth:no-chat-reports", version.ref = "ncr" }
sodium = { module = "maven.modrinth:sodium", version.ref = "sodium" }
freecammod = { module = "maven.modrinth:freecam", version.ref = "freecammod" }
femalegender = { module = "maven.modrinth:female-gender", version.ref = "femalegender" }
diff --git a/src/main/java/moe/nea/firmament/init/ClientPlayerRiser.java b/src/main/java/moe/nea/firmament/init/ClientPlayerRiser.java
deleted file mode 100644
index d60e3e7..0000000
--- a/src/main/java/moe/nea/firmament/init/ClientPlayerRiser.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package moe.nea.firmament.init;
-
-import me.shedaniel.mm.api.ClassTinkerers;
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.InsnNode;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.objectweb.asm.tree.VarInsnNode;
-
-import java.lang.reflect.Modifier;
-import java.util.Objects;
-
-public class ClientPlayerRiser extends RiserUtils {
- @IntermediaryName(net.minecraft.entity.player.PlayerEntity.class)
- String PlayerEntity;
- @IntermediaryName(net.minecraft.world.World.class)
- String World;
- String GameProfile = "com.mojang.authlib.GameProfile";
- @IntermediaryName(net.minecraft.util.math.BlockPos.class)
- String BlockPos;
- @IntermediaryName(net.minecraft.client.network.AbstractClientPlayerEntity.class)
- String AbstractClientPlayerEntity;
- String GuiPlayer = "moe.nea.firmament.gui.entity.GuiPlayer";
- // World world, BlockPos pos, float yaw, GameProfile gameProfile
- Type constructorDescriptor = Type.getMethodType(Type.VOID_TYPE, getTypeForClassName(World), getTypeForClassName(BlockPos), Type.FLOAT_TYPE, getTypeForClassName(GameProfile));
-
-
- private void mapClassNode(ClassNode classNode, Type superClass) {
- for (MethodNode method : classNode.methods) {
- if (Objects.equals(method.name, "<init>") && Type.getMethodType(method.desc).equals(constructorDescriptor)) {
- modifyConstructor(method, superClass);
- return;
- }
- }
- var node = new MethodNode(Opcodes.ASM9, "<init>", constructorDescriptor.getDescriptor(), null, null);
- classNode.methods.add(node);
- modifyConstructor(node, superClass);
- }
-
-
- private void modifyConstructor(MethodNode method, Type superClass) {
- method.access = (method.access | Modifier.PUBLIC) & ~Modifier.PRIVATE & ~Modifier.PROTECTED;
- if (method.instructions.size() != 0) return; // Some other mod has already made a constructor here
-
- // World world, BlockPos pos, float yaw, GameProfile gameProfile
- // ALOAD this
- method.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
-
- // ALOAD World
- method.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
-
- // ALOAD BlockPos
- method.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2));
-
- // ALOAD yaw
- method.instructions.add(new VarInsnNode(Opcodes.FLOAD, 3));
-
- // ALOAD gameProfile
- method.instructions.add(new VarInsnNode(Opcodes.ALOAD, 4));
-
- // Call super
- method.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, superClass.getInternalName(), "<init>", constructorDescriptor.getDescriptor(), false));
-
- // Return
- method.instructions.add(new InsnNode(Opcodes.RETURN));
- }
-
- @Override
- public void addTinkerers() {
- ClassTinkerers.addTransformation(AbstractClientPlayerEntity, it -> mapClassNode(it, getTypeForClassName(PlayerEntity)), true);
- ClassTinkerers.addTransformation(GuiPlayer, it -> mapClassNode(it, getTypeForClassName(AbstractClientPlayerEntity)), true);
- }
-}
diff --git a/src/main/java/moe/nea/firmament/init/EarlyRiser.java b/src/main/java/moe/nea/firmament/init/EarlyRiser.java
index 5441255..ae26bd7 100644
--- a/src/main/java/moe/nea/firmament/init/EarlyRiser.java
+++ b/src/main/java/moe/nea/firmament/init/EarlyRiser.java
@@ -4,7 +4,6 @@ package moe.nea.firmament.init;
public class EarlyRiser implements Runnable {
@Override
public void run() {
- new ClientPlayerRiser().addTinkerers();
new HandledScreenRiser().addTinkerers();
new SectionBuilderRiser().addTinkerers();
// TODO: new ItemColorsSodiumRiser().addTinkerers();
diff --git a/src/main/java/moe/nea/firmament/init/HandledScreenRiser.java b/src/main/java/moe/nea/firmament/init/HandledScreenRiser.java
index f7db18c..cb0058d 100644
--- a/src/main/java/moe/nea/firmament/init/HandledScreenRiser.java
+++ b/src/main/java/moe/nea/firmament/init/HandledScreenRiser.java
@@ -3,6 +3,10 @@ package moe.nea.firmament.init;
import me.shedaniel.mm.api.ClassTinkerers;
import net.minecraft.client.gui.Element;
+import net.minecraft.client.gui.screen.Screen;
+import net.minecraft.client.gui.screen.ingame.HandledScreen;
+import net.minecraft.client.input.CharInput;
+import net.minecraft.client.input.KeyInput;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.ClassNode;
@@ -19,23 +23,28 @@ import java.lang.reflect.Modifier;
import java.util.function.Consumer;
public class HandledScreenRiser extends RiserUtils {
- @IntermediaryName(net.minecraft.client.gui.screen.Screen.class)
+ @IntermediaryName(Screen.class)
String Screen;
- @IntermediaryName(net.minecraft.client.gui.screen.ingame.HandledScreen.class)
+ @IntermediaryName(KeyInput.class)
+ String KeyInput;
+ @IntermediaryName(CharInput.class)
+ String CharInput;
+ @IntermediaryName(HandledScreen.class)
String HandledScreen;
Type mouseScrolledDesc = Type.getMethodType(Type.BOOLEAN_TYPE, Type.DOUBLE_TYPE, Type.DOUBLE_TYPE, Type.DOUBLE_TYPE, Type.DOUBLE_TYPE);
- String mouseScrolled = remapper.mapMethodName("intermediary", "net.minecraft.class_364", "method_25401",
- mouseScrolledDesc.getDescriptor());
+ String mouseScrolled = remapper.mapMethodName("intermediary", Intermediary.<Element>className(),
+ Intermediary.methodName(Element::mouseScrolled),
+ mouseScrolledDesc.getDescriptor());
// boolean keyReleased(int keyCode, int scanCode, int modifiers)
- Type keyReleasedDesc = Type.getMethodType(Type.BOOLEAN_TYPE, Type.INT_TYPE, Type.INT_TYPE, Type.INT_TYPE);
+ Type keyReleasedDesc = Type.getMethodType(Type.BOOLEAN_TYPE, getTypeForClassName(KeyInput));
String keyReleased = remapper.mapMethodName("intermediary", Intermediary.<Element>className(),
- Intermediary.methodName(Element::keyReleased),
- keyReleasedDesc.getDescriptor());
+ Intermediary.methodName(Element::keyReleased),
+ keyReleasedDesc.getDescriptor());
// public boolean charTyped(char chr, int modifiers)
- Type charTypedDesc = Type.getMethodType(Type.BOOLEAN_TYPE, Type.CHAR_TYPE, Type.INT_TYPE);
+ Type charTypedDesc = Type.getMethodType(Type.BOOLEAN_TYPE, getTypeForClassName(CharInput));
String charTyped = remapper.mapMethodName("intermediary", Intermediary.<Element>className(),
- Intermediary.methodName(Element::charTyped),
- charTypedDesc.getDescriptor());
+ Intermediary.methodName(Element::charTyped),
+ charTypedDesc.getDescriptor());
@Override
@@ -56,8 +65,8 @@ public class HandledScreenRiser extends RiserUtils {
* @param insertInvoke insert the invokevirtual/invokestatic call
*/
void insertTrueHandler(MethodNode node,
- Consumer<InsnList> insertLoads,
- Consumer<InsnList> insertInvoke) {
+ Consumer<InsnList> insertLoads,
+ Consumer<InsnList> insertInvoke) {
var insns = new InsnList();
insertLoads.accept(insns);
@@ -80,10 +89,8 @@ public class HandledScreenRiser extends RiserUtils {
insns -> {
// ALOAD 0, load this
insns.add(new VarInsnNode(Opcodes.ALOAD, 0));
- // ILOAD 1-3, load args
- insns.add(new VarInsnNode(Opcodes.ILOAD, 1));
- insns.add(new VarInsnNode(Opcodes.ILOAD, 2));
- insns.add(new VarInsnNode(Opcodes.ILOAD, 3));
+ // ALOAD 1, load args
+ insns.add(new VarInsnNode(Opcodes.ALOAD, 1));
});
}
@@ -93,9 +100,8 @@ public class HandledScreenRiser extends RiserUtils {
insns -> {
// ALOAD 0, load this
insns.add(new VarInsnNode(Opcodes.ALOAD, 0));
- // ILOAD 1-2, load args. chars = ints
- insns.add(new VarInsnNode(Opcodes.ILOAD, 1));
- insns.add(new VarInsnNode(Opcodes.ILOAD, 2));
+ // ALOAD 1, load args
+ insns.add(new VarInsnNode(Opcodes.ALOAD, 1));
});
}
@@ -119,7 +125,7 @@ public class HandledScreenRiser extends RiserUtils {
loadArgs.accept(insns);
// INVOKESPECIAL call super method
insns.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, getTypeForClassName(Screen).getInternalName(),
- name, desc.getDescriptor()));
+ name, desc.getDescriptor()));
// IRETURN return int on stack (booleans are int at runtime)
insns.add(new InsnNode(Opcodes.IRETURN));
classNode.methods.add(keyReleasedNode);
@@ -127,9 +133,9 @@ public class HandledScreenRiser extends RiserUtils {
insertTrueHandler(keyReleasedNode, loadArgs, insns -> {
// INVOKEVIRTUAL call custom handler
insns.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL,
- getTypeForClassName(HandledScreen).getInternalName(),
- firmamentName,
- desc.getDescriptor()));
+ getTypeForClassName(HandledScreen).getInternalName(),
+ firmamentName,
+ desc.getDescriptor()));
});
}
diff --git a/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java b/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java
index d4b8c9e..f05eb05 100644
--- a/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java
+++ b/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java
@@ -4,7 +4,6 @@ package moe.nea.firmament.mixins;
import moe.nea.firmament.events.WorldReadyEvent;
import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
diff --git a/src/main/java/moe/nea/firmament/mixins/accessor/AccessorNbtComponent.java b/src/main/java/moe/nea/firmament/mixins/accessor/AccessorNbtComponent.java
new file mode 100644
index 0000000..8ce981c
--- /dev/null
+++ b/src/main/java/moe/nea/firmament/mixins/accessor/AccessorNbtComponent.java
@@ -0,0 +1,12 @@
+package moe.nea.firmament.mixins.accessor;
+
+import net.minecraft.component.type.NbtComponent;
+import net.minecraft.nbt.NbtCompound;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.gen.Accessor;
+
+@Mixin(NbtComponent.class)
+public interface AccessorNbtComponent {
+ @Accessor("nbt")
+ NbtCompound getUnsafeNbt_firmament();
+}
diff --git a/src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java b/src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java
index 9027865..3769ceb 100644
--- a/src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java
+++ b/src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java
@@ -10,9 +10,12 @@ import moe.nea.firmament.keybindings.InputModifiers;
import moe.nea.firmament.util.customgui.CoordRememberingSlot;
import moe.nea.firmament.util.customgui.CustomGui;
import moe.nea.firmament.util.customgui.HasCustomGui;
+import net.minecraft.client.gui.Click;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
+import net.minecraft.client.input.CharInput;
+import net.minecraft.client.input.KeyInput;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.text.Text;
@@ -75,17 +78,17 @@ public class PatchHandledScreen<T extends ScreenHandler> extends Screen implemen
return override != null && override.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
}
- public boolean keyReleased_firmament(int keyCode, int scanCode, int modifiers) {
+ public boolean keyReleased_firmament(KeyInput input) {
if (HandledScreenKeyReleasedEvent.Companion.publish(new HandledScreenKeyReleasedEvent(
(HandledScreen<?>) (Object) this,
- GenericInputAction.key(keyCode, scanCode),
- InputModifiers.of(modifiers))).getCancelled())
+ GenericInputAction.of(input),
+ InputModifiers.of(input))).getCancelled())
return true;
- return override != null && override.keyReleased(keyCode, scanCode, modifiers);
+ return override != null && override.keyReleased(input);
}
- public boolean charTyped_firmament(char chr, int modifiers) {
- return override != null && override.charTyped(chr, modifiers);
+ public boolean charTyped_firmament(CharInput input) {
+ return override != null && override.charTyped(input);
}
@Inject(method = "init", at = @At("TAIL"))
@@ -118,7 +121,9 @@ public class PatchHandledScreen<T extends ScreenHandler> extends Screen implemen
}
@Inject(method = "isClickOutsideBounds", at = @At("HEAD"), cancellable = true)
- public void onIsClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button, CallbackInfoReturnable<Boolean> cir) {
+ public void onIsClickOutsideBounds(
+ double mouseX, double mouseY, int left, int top,
+ CallbackInfoReturnable<Boolean> cir) {
if (override != null) {
cir.setReturnValue(override.isClickOutsideBounds(mouseX, mouseY));
}
@@ -176,28 +181,27 @@ public class PatchHandledScreen<T extends ScreenHandler> extends Screen implemen
@WrapOperation(
method = "mouseClicked",
- at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;mouseClicked(DDI)Z"))
- public boolean overrideMouseClicks(HandledScreen instance, double mouseX, double mouseY, int button,
- Operation<Boolean> original) {
+ at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;mouseClicked(Lnet/minecraft/client/gui/Click;Z)Z"))
+ public boolean overrideMouseClicks(HandledScreen instance, Click click, boolean doubled, Operation<Boolean> original) {
if (override != null) {
- if (override.mouseClick(mouseX, mouseY, button))
+ if (override.mouseClick(click, doubled))
return true;
}
- return original.call(instance, mouseX, mouseY, button);
+ return original.call(instance, click, doubled);
}
@Inject(method = "mouseDragged", at = @At("HEAD"), cancellable = true)
- public void overrideMouseDrags(double mouseX, double mouseY, int button, double deltaX, double deltaY, CallbackInfoReturnable<Boolean> cir) {
+ public void overrideMouseDrags(Click click, double offsetX, double offsetY, CallbackInfoReturnable<Boolean> cir) {
if (override != null) {
- if (override.mouseDragged(mouseX, mouseY, button, deltaX, deltaY))
+ if (override.mouseDragged(click, offsetX, offsetY))
cir.setReturnValue(true);
}
}
@Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true)
- private void overrideKeyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) {
+ private void overrideKeyPressed(KeyInput input, CallbackInfoReturnable<Boolean> cir) {
if (override != null) {
- if (override.keyPressed(keyCode, scanCode, modifiers)) {
+ if (override.keyPressed(input)) {
cir.setReturnValue(true);
}
}
@@ -207,9 +211,9 @@ public class PatchHandledScreen<T extends ScreenHandler> extends Screen implemen
@Inject(
method = "mouseReleased",
at = @At("HEAD"), cancellable = true)
- public void overrideMouseReleases(double mouseX, double mouseY, int button, CallbackInfoReturnable<Boolean> cir) {
+ public void overrideMouseReleases(Click click, CallbackInfoReturnable<Boolean> cir) {
if (override != null) {
- if (override.mouseReleased(mouseX, mouseY, button))
+ if (override.mouseReleased(click))
cir.setReturnValue(true);
}
}
diff --git a/src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java b/src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java
index c9115d2..5d69e96 100644
--- a/src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java
+++ b/src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java
@@ -5,17 +5,20 @@ import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import kotlin.Unit;
import moe.nea.firmament.features.misc.CustomCapes;
+import net.minecraft.client.model.Model;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
+import net.minecraft.client.render.command.ModelCommandRenderer;
+import net.minecraft.client.render.command.OrderedRenderCommandQueue;
import net.minecraft.client.render.entity.feature.CapeFeatureRenderer;
import net.minecraft.client.render.entity.feature.FeatureRenderer;
import net.minecraft.client.render.entity.feature.FeatureRendererContext;
import net.minecraft.client.render.entity.model.BipedEntityModel;
import net.minecraft.client.render.entity.model.PlayerEntityModel;
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
-import net.minecraft.client.util.SkinTextures;
import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.entity.player.SkinTextures;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -26,19 +29,21 @@ public abstract class CustomCapeFeatureRenderer extends FeatureRenderer<PlayerEn
}
@WrapOperation(
- method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/state/PlayerEntityRenderState;FF)V",
- at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/model/BipedEntityModel;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;II)V")
+ method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;ILnet/minecraft/client/render/entity/state/PlayerEntityRenderState;FF)V",
+ at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;submitModel(Lnet/minecraft/client/model/Model;Ljava/lang/Object;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/RenderLayer;IIILnet/minecraft/client/render/command/ModelCommandRenderer$CrumblingOverlayCommand;)V")
)
- private void onRender(BipedEntityModel<PlayerEntityRenderState> instance, MatrixStack matrixStack, VertexConsumer vertexConsumer, int light, int overlay, Operation<Void> original, @Local(argsOnly = true) PlayerEntityRenderState playerEntityRenderState, @Local SkinTextures skinTextures, @Local VertexConsumerProvider vertexConsumerProvider) {
- CustomCapes.render(
- playerEntityRenderState,
- vertexConsumer,
- RenderLayer.getEntitySolid(skinTextures.capeTexture()),
- vertexConsumerProvider,
- matrixStack,
- updatedConsumer -> {
- original.call(instance, matrixStack, updatedConsumer, light, overlay);
- return Unit.INSTANCE;
- });
+ private void onRender(OrderedRenderCommandQueue instance, Model model, Object o, MatrixStack matrixStack, RenderLayer renderLayer, int light, int overlay, int outlineColor, ModelCommandRenderer.CrumblingOverlayCommand crumblingOverlayCommand, Operation<Void> original,
+ @Local(argsOnly = true) PlayerEntityRenderState playerEntityRenderState, @Local SkinTextures skinTextures) {
+ // TODO: 1.21.10 custom capes by pre rendering the texture id. this is more viable on this version i am fairly sure, without clogging up all of the cached image render layers
+// CustomCapes.render(
+// playerEntityRenderState,
+// vertexConsumer,
+// RenderLayer.getEntitySolid(skinTextures.cape().id()),
+// vertexConsumerProvider,
+// matrixStack,
+// updatedConsumer -> {
+// original.call(instance, matrixStack, updatedConsumer, light, overlay, outlineColor);
+// return Unit.INSTANCE;
+// });
}
}
diff --git a/src/main/kotlin/apis/UrsaManager.kt b/src/main/kotlin/apis/UrsaManager.kt
index cee6904..e5d519e 100644
--- a/src/main/kotlin/apis/UrsaManager.kt
+++ b/src/main/kotlin/apis/UrsaManager.kt
@@ -48,7 +48,7 @@ object UrsaManager {
withContext(Dispatchers.IO) {
val mc = MinecraftClient.getInstance()
val serverId = UUID.randomUUID().toString()
- mc.sessionService.joinServer(mc.session.uuidOrNull, mc.session.accessToken, serverId)
+ mc.apiServices.sessionService.joinServer(mc.session.uuidOrNull, mc.session.accessToken, serverId)
request.header("x-ursa-username", mc.session.username)
request.header("x-ursa-serverid", serverId)
}
diff --git a/src/main/kotlin/events/FinalizeResourceManagerEvent.kt b/src/main/kotlin/events/FinalizeResourceManagerEvent.kt
index 12167f8..df1c3eb 100644
--- a/src/main/kotlin/events/FinalizeResourceManagerEvent.kt
+++ b/src/main/kotlin/events/FinalizeResourceManagerEvent.kt
@@ -14,13 +14,13 @@ data class FinalizeResourceManagerEvent(
inline fun registerOnApply(name: String, crossinline function: () -> Unit) {
resourceManager.registerReloader(object : ResourceReloader {
override fun reload(
- synchronizer: ResourceReloader.Synchronizer,
- manager: ResourceManager,
+ store: ResourceReloader.Store,
prepareExecutor: Executor,
+ reloadSynchronizer: ResourceReloader.Synchronizer,
applyExecutor: Executor
): CompletableFuture<Void> {
return CompletableFuture.completedFuture(Unit)
- .thenCompose(synchronizer::whenPrepared)
+ .thenCompose(reloadSynchronizer::whenPrepared)
.thenAcceptAsync({ function() }, applyExecutor)
}
diff --git a/src/main/kotlin/features/debug/PowerUserTools.kt b/src/main/kotlin/features/debug/PowerUserTools.kt
index a549f7e..fc36806 100644
--- a/src/main/kotlin/features/debug/PowerUserTools.kt
+++ b/src/main/kotlin/features/debug/PowerUserTools.kt
@@ -41,6 +41,7 @@ import moe.nea.firmament.util.mc.SNbtFormatter.Companion.toPrettyString
import moe.nea.firmament.util.mc.displayNameAccordingToNbt
import moe.nea.firmament.util.mc.iterableArmorItems
import moe.nea.firmament.util.mc.loreAccordingToNbt