aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament/mixins
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins')
-rw-r--r--src/main/java/moe/nea/firmament/mixins/AppendRepoAsResourcePack.java33
-rw-r--r--src/main/java/moe/nea/firmament/mixins/accessor/AccessorAbstractClientPlayerEntity.java18
2 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/AppendRepoAsResourcePack.java b/src/main/java/moe/nea/firmament/mixins/AppendRepoAsResourcePack.java
new file mode 100644
index 0000000..729b9b8
--- /dev/null
+++ b/src/main/java/moe/nea/firmament/mixins/AppendRepoAsResourcePack.java
@@ -0,0 +1,33 @@
+/*
+ * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+package moe.nea.firmament.mixins;
+
+import moe.nea.firmament.repo.RepoModResourcePack;
+import net.fabricmc.fabric.api.resource.ModResourcePack;
+import net.fabricmc.fabric.impl.resource.loader.ModResourcePackUtil;
+import net.minecraft.resource.ResourceType;
+import org.jetbrains.annotations.Nullable;
+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;
+
+import java.util.List;
+
+@Mixin(ModResourcePackUtil.class)
+public class AppendRepoAsResourcePack {
+ @Inject(method = "appendModResourcePacks", at = @At("TAIL"))
+ private static void onAppendModResourcePack(
+ List<ModResourcePack> packs,
+ ResourceType type,
+ @Nullable String subPath,
+ CallbackInfo ci
+ ) {
+ RepoModResourcePack.Companion.append(packs);
+ }
+
+}
diff --git a/src/main/java/moe/nea/firmament/mixins/accessor/AccessorAbstractClientPlayerEntity.java b/src/main/java/moe/nea/firmament/mixins/accessor/AccessorAbstractClientPlayerEntity.java
new file mode 100644
index 0000000..efa4a56
--- /dev/null
+++ b/src/main/java/moe/nea/firmament/mixins/accessor/AccessorAbstractClientPlayerEntity.java
@@ -0,0 +1,18 @@
+/*
+ * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+package moe.nea.firmament.mixins.accessor;
+
+import net.minecraft.client.network.AbstractClientPlayerEntity;
+import net.minecraft.client.network.PlayerListEntry;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.gen.Accessor;
+
+@Mixin(AbstractClientPlayerEntity.class)
+public interface AccessorAbstractClientPlayerEntity {
+ @Accessor("playerListEntry")
+ void setPlayerListEntry_firmament(PlayerListEntry playerListEntry);
+}