Firmament icon indicating copy to clipboard operation
Firmament copied to clipboard

Scorpius in election box incorrectly highlighted as a special rarity item

Open lunaynx opened this issue 5 months ago • 6 comments

Firmament Version

3.4.0+mc1.21.5

Bug Description

Image
NBT Data
{
	components: {
		"minecraft:custom_data": {
		},
		"minecraft:custom_name": {
			extra: [
				{
					color: "light_purple",
					text: "Scorpius"
				}
			],
			italic: 0b,
			text: ""
		},
		"minecraft:lore": [
			{
				extra: [
					{
						color: "dark_gray",
						text: "Year 433 "
					},
					{
						color: "dark_gray",
						text: "Special Candidate"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "light_purple",
						text: "This is a SPECIAL candidate!"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: "It rarely appears!"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						strikethrough: 1b,
						text: "--------------------------"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "light_purple",
						text: "Bribe"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "gray",
						text: "If Scorpius wins and you voted"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "gray",
						text: "for him, Mayor Scorpius will offer"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "gray",
						text: "you "
					},
					{
						color: "gold",
						text: "500,000 coins "
					},
					{
						color: "gray",
						text: "as a token of"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "gray",
						text: "gratitude."
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "light_purple",
						text: "Darker Auctions"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "gray",
						text: "Scorpius will intrude in Dark"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "gray",
						text: "Auctions, increasing the amount of"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "gray",
						text: "rounds to 7 and offering special"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "gray",
						text: "items."
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						strikethrough: 1b,
						text: "--------------------------"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "dark_gray",
						text: "You may change your vote at any"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "time until the election ends!"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "yellow",
						text: "Click to vote for Scorpius!"
					}
				],
				italic: 0b,
				text: ""
			}
		],
		"minecraft:profile": {
			id: [I;
				-2081141833,
				1610625666,
				-1208191859,
				-1044483963
			],
			properties: [
				{
					name: "textures",
					signature: "rf8qD3+t2XVrPcyhIbDVD+d7+waVy8EGbJkPw7jQEMUXdScU7kgtiALlHHoFqtw2yF/8H72nXCcq31YG5ddeWS1fPw9aHMFsALmj68YJU/k7keHn11g5Mie4TaFguabfY6opNsacg446GuJqQfFRobnYH+m4QAJBVpaDvs4XzPKxakWKt6s/lcggdpetI1Co1kx3A/cIN9Vp8auGe14XrNjsKsXL7OT7MgnrhmTUa8TSdutgQUk6NrIlkQx9a2WFHLyeuF3K04bLBKvwdfQur2PXoBrjM/iBftY5PFcIqaBYUwl0aZPAOYe1oBbqsRG3Dur6/CeudViNwxYMHsH3Ll+NwsYzThBqP+YhBFjYGl03zaJQ6o6WdXD1ylIWP0s/L/Wrh3gRGalsL2s3iCEnE4+ges2nJwfOoV/xHs3yURd4nRT9INJx4X4D7KHr6XDE4tef4UVL1yHXoMcdDkRfFhEx9DOtFjWtZqAGIdMAunj/fyZTLpxWj0q01MF40KP8M38d2HutN78YkEQmktxmCsQJ6kPOipYEP+vPYKntYA1A/GtHGf0m05p5GoWE0DQDjWKeQ6FQPtpDSahCWN/UJmJ2H3FsAEeCDUSME01MUYgYsFpZ1r+CuqI+aKNjKeNZhg4INxwMm2XjCG10jSK7c82Hc6tFTRV3sg3nSou66sA=",
					value: "ewogICJ0aW1lc3RhbXAiIDogMTU5Nzc4MTc1NzIxOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGYyNmZhMGM0NzUzNmU3OGUzMzcyNTdkODk4YWY4YjFlYmM4N2MwODk0NTAzMzc1MjM0MDM1ZmYyYzdlZjhmMCIKICAgIH0KICB9Cn0="
				}
			]
		}
	},
	count: 1,
	id: "minecraft:player_head"
}

Minecraft Log


lunaynx avatar Jul 21 '25 21:07 lunaynx

Same with a Chocolate Factory item being highlighted as an epic rarity item:

Image
NBT Data
{
	components: {
		"minecraft:custom_data": {
		},
		"minecraft:custom_name": {
			extra: [
				{
					color: "gold",
					text: "Chocolate Factory III"
				}
			],
			italic: 0b,
			text: ""
		},
		"minecraft:lore": [
			{
				extra: [
					{
						color: "gray",
						text: "Chocolate Production Multiplier: "
					},
					{
						color: "gold",
						text: "1.25x"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: "Max Rabbit Rarity: "
					},
					{
						bold: 1b,
						color: "dark_purple",
						text: "EPIC"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: "Max Chocolate: "
					},
					{
						color: "gold",
						text: "4B"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: "Max Employee: "
					},
					{
						color: "gray",
						text: "[160"
					},
					{
						color: "gray",
						text: "] "
					},
					{
						color: "dark_purple",
						text: "Manager"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: "Max "
					},
					{
						color: "red",
						text: "Rabbit Hitman "
					},
					{
						color: "gray",
						text: "Slots: "
					},
					{
						color: "gold",
						text: "18"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						strikethrough: 1b,
						text: "-----------------"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						bold: 1b,
						color: "light_purple",
						text: "PRESTIGE "
					},
					{
						color: "dark_gray",
						text: "➜ "
					},
					{
						color: "gold",
						text: "Chocolate Factory IV"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "red",
						text: "Resets Chocolate Factory progress."
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "red",
						text: "Resets Chocolate."
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "gray",
						text: "Chocolate Production Multiplier: "
					},
					{
						color: "dark_gray",
						text: "1.25 ➜ "
					},
					{
						color: "gold",
						text: "1.5x"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "gray",
						text: "Max Rabbit Rarity: "
					},
					{
						bold: 1b,
						color: "dark_gray",
						text: "EPIC "
					},
					{
						color: "dark_gray",
						text: "➜ "
					},
					{
						bold: 1b,
						color: "gold",
						text: "LEGENDARY"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "gray",
						text: "Max Chocolate: "
					},
					{
						color: "dark_gray",
						text: "4B ➜ "
					},
					{
						color: "gold",
						text: "10B"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "gray",
						text: "Max Employee: "
					},
					{
						color: "dark_gray",
						text: "[160] ➜ "
					},
					{
						color: "gray",
						text: "[180"
					},
					{
						color: "gray",
						text: "] "
					},
					{
						color: "gold",
						text: "Director"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "red",
						text: "Rabbit Hitman "
					},
					{
						color: "gray",
						text: "Slots: "
					},
					{
						color: "dark_gray",
						text: "18 ➜ "
					},
					{
						color: "gold",
						text: "22"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "red",
						text: "Rabbit Hitman "
					},
					{
						color: "gray",
						text: "progress is kept."
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "green",
						text: "Hoppity's Collection "
					},
					{
						color: "gray",
						text: "progress is kept."
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "green",
						text: "Rabbit Barn "
					},
					{
						color: "gray",
						text: "progress is kept."
					}
				],
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "dark_gray",
						text: "▶ "
					},
					{
						color: "aqua",
						text: "+25 SkyBlock XP"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: "Chocolate this Prestige: "
					},
					{
						color: "gold",
						text: "964,469,861"
					}
				],
				italic: 0b,
				text: ""
			},
			{
				italic: 0b,
				text: ""
			},
			{
				extra: [
					{
						color: "gray",
						text: ""
					},
					{
						color: "red",
						text: "Requires 4B Chocolate this Prestige!"
					}
				],
				italic: 0b,
				text: ""
			}
		]
	},
	count: 1,
	id: "minecraft:dropper"
}

lunaynx avatar Jul 21 '25 22:07 lunaynx

okay but they are special and epic respectively. i dont really see this is a bug, rather i see it as a bonus feature (especially for the chocolate factory).

lineargraph avatar Jul 23 '25 18:07 lineargraph

I mean, okay, just because it may happen to make some sense in these cases, it's still just a quirk of the parsing and should not be the default behavior, or at the very least should have an opt-out.

lunaynx avatar Jul 23 '25 18:07 lunaynx

no it is not a quirk of the parsing. finding any mention of rarity was specifically intended. given that there is no defined guarantees on the structure of itemstack metadata including lore there is no "quirkless" way of parsing the rarity of an item. there may be more narrowly defined ways of parsing the rarity – such as only respecting the last line of the lore – but making a call about what should or should not be default behaviour is your idiosyncrasy, not an objective opinion.

lineargraph avatar Jul 24 '25 15:07 lineargraph

You can obviously decide on what the default behavior should be in your mod, that's why I suggested it to at least be configurable as an alternative, but those items objectively do not have those rarities, and I can't think of a single case where parsing the last line wouldn't be sufficient. I don't see other mods struggling with this.

While right now you may be lucky and no item truly breaks your logic, I could very easily see Hypixel adding an item one day that mentions one or more rarities in its lore and is not the first mentioned rarity itself. So far, things like Griffin Upgrade Stones happen to coincide with the rarities of the items themselves.

lunaynx avatar Jul 24 '25 15:07 lunaynx

the rarities typically line up. if hypixel adds a cohort of items that consistently cause confusion i will probably reconsider this, but so far it almost always works out and adds more correct information than a narrow algorithm would.

lineargraph avatar Jul 24 '25 15:07 lineargraph