aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle.kts1
-rw-r--r--src/main/kotlin/util/SkyblockId.kt22
-rw-r--r--src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceBlockHitSoundPatch.java3
-rw-r--r--translations/extra.json6
4 files changed, 27 insertions, 5 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 377cf07..3a72ed0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -126,6 +126,7 @@ fun innerJarsOf(name: String, dependency: Dependency): Provider<FileTree> {
val collectTranslations by tasks.registering(CollectTranslations::class) {
this.baseTranslations.from(file("translations/en_us.json"))
+ this.baseTranslations.from(file("translations/extra.json"))
this.classes.from(sourceSets.main.get().kotlin.classesDirectory)
}
diff --git a/src/main/kotlin/util/SkyblockId.kt b/src/main/kotlin/util/SkyblockId.kt
index 0ccdcac..7d8c96c 100644
--- a/src/main/kotlin/util/SkyblockId.kt
+++ b/src/main/kotlin/util/SkyblockId.kt
@@ -29,8 +29,8 @@ import moe.nea.firmament.util.json.DashlessUUIDSerializer
/**
* A SkyBlock item id, as used by the NEU repo.
- * This is not exactly the format used by HyPixel, but is mostly the same.
- * Usually this id splits an id used by HyPixel into more sub items. For example `PET` becomes `$PET_ID;$PET_RARITY`,
+ * This is not exactly the format used by Hypixel, but is mostly the same.
+ * Usually this id splits an id used by Hypixel into more sub items. For example `PET` becomes `$PET_ID;$PET_RARITY`,
* with those values extracted from other metadata.
*/
@JvmInline
@@ -54,7 +54,7 @@ value class SkyblockId(val neuItem: String) : Comparable<SkyblockId> {
}
/**
- * A bazaar stock item id, as returned by the HyPixel bazaar api endpoint.
+ * A bazaar stock item id, as returned by the Hypixel bazaar api endpoint.
* These are not equivalent to the in-game ids, or the NEU repo ids, and in fact, do not refer to items, but instead
* to bazaar stocks. The main difference from [SkyblockId]s is concerning enchanted books. There are probably more,
* but for now this holds.
@@ -226,7 +226,21 @@ val ItemStack.skyBlockId: SkyblockId?
}
}
- // TODO: PARTY_HAT_CRAB{,_ANIMATED,_SLOTH}
+ "PARTY_HAT_SLOTH", "PARTY_HAT_CRAB", "PARTY_HAT_CRAB_ANIMATED" -> {
+ val partyHatEmoji = extraAttributes.getString("party_hat_emoji").getOrNull()
+ val partyHatYear = extraAttributes.getInt("party_hat_year").getOrNull()
+ val partyHatColor = extraAttributes.getString("party_hat_color").getOrNull()
+ when {
+ partyHatEmoji != null -> SkyblockId("PARTY_HAT_SLOTH_${partyHatEmoji.uppercase()}")
+ partyHatYear == 2022 -> SkyblockId("PARTY_HAT_CRAB_${partyHatColor?.uppercase()}_ANIMATED")
+ else -> SkyblockId("PARTY_HAT_CRAB_${partyHatColor?.uppercase()}")
+ }
+ }
+
+ "BALLOON_HAT_2024" -> {
+ SkyblockId("BALLOON_HAT_2024_${extraAttributes.getString("party_hat_color").getOrNull()?.uppercase()}")
+ }
+
else -> {
SkyblockId(id)
}
diff --git a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceBlockHitSoundPatch.java b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceBlockHitSoundPatch.java
index f9a1d0d..95e7dce 100644
--- a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceBlockHitSoundPatch.java
+++ b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceBlockHitSoundPatch.java
@@ -16,7 +16,8 @@ import org.spongepowered.asm.mixin.injection.At;
@Mixin(ClientPlayerInteractionManager.class)
public class ReplaceBlockHitSoundPatch {
- @WrapOperation(method = "updateBlockBreakingProgress", at = @At(value = "NEW", target = "(Lnet/minecraft/sound/SoundEvent;Lnet/minecraft/sound/SoundCategory;FFLnet/minecraft/util/math/random/Random;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/client/sound/PositionedSoundInstance;"))
+ @WrapOperation(method = "updateBlockBreakingProgress",
+ at = @At(value = "NEW", target = "(Lnet/minecraft/sound/SoundEvent;Lnet/minecraft/sound/SoundCategory;FFLnet/minecraft/util/math/random/Random;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/client/sound/PositionedSoundInstance;"))
private PositionedSoundInstance replaceSound(
SoundEvent sound, SoundCategory category, float volume, float pitch,
Random random, BlockPos pos, Operation<PositionedSoundInstance> original,
diff --git a/translations/extra.json b/translations/extra.json
new file mode 100644
index 0000000..cb21fc9
--- /dev/null
+++ b/translations/extra.json
@@ -0,0 +1,6 @@
+{
+ // These are require by jade, but i don't think they are actually rendered in game.
+ // Jade throws exceptions if they are not present however.
+ "config.jade.plugin_firmament.toolprovider": "Firmament Tool Provider",
+ "config.jade.plugin_firmament.custom_mining_hardness": "Firmament Mining Hardness"
+}