aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/features
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-07-05 22:17:02 +0200
committerLinnea Gräf <nea@nea.moe>2024-07-05 22:17:02 +0200
commit3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7 (patch)
treeb383c2c584a96b93c46d1dae3efcd3c6571e3d05 /src/main/kotlin/moe/nea/firmament/features
parent5ee4b8d925eb12e068038a1fd2e1f35cdd8ef87e (diff)
downloadFirmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.tar.gz
Firmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.tar.bz2
Firmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.zip
Port to 1.21
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/features')
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/inventory/ItemRarityCosmetics.kt2
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt4
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/inventory/buttons/InventoryButton.kt2
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt2
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt2
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/texturepack/CustomModelOverrideParser.kt4
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt16
7 files changed, 17 insertions, 15 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/ItemRarityCosmetics.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/ItemRarityCosmetics.kt
index de37748..0ed5c9a 100644
--- a/src/main/kotlin/moe/nea/firmament/features/inventory/ItemRarityCosmetics.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/inventory/ItemRarityCosmetics.kt
@@ -68,7 +68,7 @@ object ItemRarityCosmetics : FirmamentFeature {
x, y,
0,
16, 16,
- MC.guiAtlasManager.getSprite(Identifier("firmament:item_rarity_background")),
+ MC.guiAtlasManager.getSprite(Identifier.of("firmament:item_rarity_background")),
r, g, b, 1F
)
}
diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt
index b0fb57b..70b887c 100644
--- a/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt
@@ -190,10 +190,10 @@ object SlotLocking : FirmamentFeature {
MC.guiAtlasManager.getSprite(
when {
isSlotLocked ->
- (Identifier("firmament:slot_locked"))
+ (Identifier.of("firmament:slot_locked"))
isUUIDLocked ->
- (Identifier("firmament:uuid_locked"))
+ (Identifier.of("firmament:uuid_locked"))
else ->
error("unreachable")
diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/buttons/InventoryButton.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/buttons/InventoryButton.kt
index 5ff1768..51993af 100644
--- a/src/main/kotlin/moe/nea/firmament/features/inventory/buttons/InventoryButton.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/inventory/buttons/InventoryButton.kt
@@ -42,7 +42,7 @@ data class InventoryButton(
0,
dimensions.width,
dimensions.height,
- MC.guiAtlasManager.getSprite(Identifier("firmament:inventory_button_background"))
+ MC.guiAtlasManager.getSprite(Identifier.of("firmament:inventory_button_background"))
)
context.drawItem(getItem(), 1, 1)
}
diff --git a/src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt b/src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt
index 8e62172..33bf578 100644
--- a/src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt
@@ -172,7 +172,7 @@ object PickaxeAbility : FirmamentFeature {
event.context.matrices.translate(MC.window.scaledWidth / 2F, MC.window.scaledHeight / 2F, 0F)
event.context.matrices.scale(TConfig.cooldownScale.toFloat(), TConfig.cooldownScale.toFloat(), 1F)
RenderCircleProgress.renderCircle(
- event.context, Identifier("firmament", "textures/gui/circle.png"),
+ event.context, Identifier.of("firmament", "textures/gui/circle.png"),
getCooldownPercentage(ability.name, ability.cooldown).toFloat(),
0f, 1f, 0f, 1f
)
diff --git a/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt b/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt
index 147697b..24aa6ef 100644
--- a/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt
@@ -117,7 +117,7 @@ object CustomGlobalTextures : SinglePreparationResourceReloader<CustomGlobalText
.mapNotNull {
val key = it.key
val guiClassResource =
- manager.getResource(Identifier(key.namespace, "filters/screen/${key.path}.json"))
+ manager.getResource(Identifier.of(key.namespace, "filters/screen/${key.path}.json"))
.getOrNull()
?: return@mapNotNull runNull {
logger.error("Failed to locate screen filter at $key")
diff --git a/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomModelOverrideParser.kt b/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomModelOverrideParser.kt
index 458f8ff..4ae73e8 100644
--- a/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomModelOverrideParser.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomModelOverrideParser.kt
@@ -34,7 +34,7 @@ object CustomModelOverrideParser {
fun registerPredicateParser(name: String, parser: FirmamentModelPredicateParser) {
- predicateParsers[Identifier("firmament", name)] = parser
+ predicateParsers[Identifier.of("firmament", name)] = parser
}
init {
@@ -59,7 +59,7 @@ object CustomModelOverrideParser {
val parsedPredicates = mutableListOf<FirmamentModelPredicate>()
for (predicateName in predicates.keySet()) {
if (!predicateName.startsWith("firmament:")) continue
- val identifier = Identifier(predicateName)
+ val identifier = Identifier.of(predicateName)
val parser = predicateParsers[identifier] ?: return neverPredicate
val parsedPredicate = parser.parse(predicates[predicateName]) ?: return neverPredicate
parsedPredicates.add(parsedPredicate)
diff --git a/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt b/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt
index 82989e4..f37e3ea 100644
--- a/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt
@@ -9,7 +9,6 @@ package moe.nea.firmament.features.texturepack
import com.mojang.authlib.minecraft.MinecraftProfileTexture
import com.mojang.authlib.properties.Property
-import net.fabricmc.fabric.api.entity.event.v1.EntityElytraEvents.Custom
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
import net.minecraft.block.SkullBlock
import net.minecraft.client.MinecraftClient
@@ -62,10 +61,13 @@ object CustomSkyBlockTextures : FirmamentFeature {
.endsWith(".json")
}
for (identifier in resources.keys) {
- val modelId = ModelIdentifier("firmskyblock",
- identifier.path.substring("models/item/".length,
- identifier.path.length - ".json".length),
- "inventory")
+ val modelId = ModelIdentifier.ofInventoryVariant(
+ Identifier.of(
+ "firmskyblock",
+ identifier.path.substring(
+ "models/item/".length,
+ identifier.path.length - ".json".length),
+ ))
event.addModel(modelId)
}
}
@@ -74,7 +76,7 @@ object CustomSkyBlockTextures : FirmamentFeature {
fun onCustomModelId(it: CustomItemModelEvent) {
if (!TConfig.enabled) return
val id = it.itemStack.skyBlockId ?: return
- it.overrideModel = ModelIdentifier("firmskyblock", id.identifier.path, "inventory")
+ it.overrideModel = ModelIdentifier.ofInventoryVariant(Identifier.of("firmskyblock", id.identifier.path))
}
private val skullTextureCache = mutableMapOf<IdentityCharacteristics<ProfileComponent>, Any>()
@@ -92,7 +94,7 @@ object CustomSkyBlockTextures : FirmamentFeature {
fun getSkullTexture(profile: ProfileComponent): Identifier? {
val id = getSkullId(profile.properties["textures"].firstOrNull() ?: return null) ?: return null
- return Identifier("firmskyblock", "textures/placedskull/$id.png")
+ return Identifier.of("firmskyblock", "textures/placedskull/$id.png")
}
fun modifySkullTexture(