Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(SavePlayerDeck): saves the player's deck to dunga dunga #9

Conversation

CaseyMichael
Copy link
Contributor

@CaseyMichael CaseyMichael commented Jan 6, 2024

trackedout/agronet-fabric#14 needs to merge first

@CaseyMichael CaseyMichael requested a review from 4Ply January 6, 2024 22:56
@CaseyMichael CaseyMichael force-pushed the 4-citadel-support-modification-of-players-deck-whilst-in-lobby-server branch from c319e2a to 12d80fa Compare January 6, 2024 22:57
remove debug logs

remove debug logs

use NBT data to determine if the item is a deck or a card
@CaseyMichael CaseyMichael force-pushed the 4-citadel-support-modification-of-players-deck-whilst-in-lobby-server branch from 12d80fa to a5c877a Compare January 7, 2024 21:00
@@ -115,8 +115,7 @@ class GiveShulkerCommand(
val nameJson = "{\"color\":\"${it.colour}\",\"text\":\"${it.displayName}\"}"
tag.set(nameJson, "display", "Name")
tag.set("{\"color\":\"${it.colour}\",\"OriginalName\":\"${nameJson}\"}", "display", "NameFormat");
// NameFormat: {color: "gray", OriginalName: '{"color":"gray","text":"✲ Moment of Clarity ✲"}',
// ModifiedName: '{"color":"gray","text":"✲ Moment of Clarity ✲"}'}
tag.set(it.key, TAG_CARD_KEY)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added card key so that we can use this to determine if an item is a decked out card

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might break in-game hopper filters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call i'll back out this change

@@ -18,4 +21,7 @@ fun CommandSender.sendGreyMessage(message: String) {
this.sendMessage(Component.text().color(NamedTextColor.GRAY).content(message).build())
}

fun ItemStack.isDeckedOutShulker() = this.type == Material.CYAN_SHULKER_BOX // TODO: Validate using NBT data; validate that this player owns it
fun ItemStack.isDeckedOutShulker() =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a lot of investigation into NBT data on shulkers I learned that when you place & break a shuler the NBT data gets removed and so the only way we can determine if the shulker box is ours is using the name lookup. This also means we loose any tags like the ownerID and stuff that was put on their originally.

I also tried to add "Lore" text to the name with the ownerID but that didn't seem to work.

@4Ply 4Ply merged commit 99f57ec into main Jan 15, 2024
0 of 4 checks passed
@4Ply 4Ply deleted the 4-citadel-support-modification-of-players-deck-whilst-in-lobby-server branch January 15, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants