-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(SavePlayerDeck): saves the player's deck to dunga dunga #9
Conversation
c319e2a
to
12d80fa
Compare
remove debug logs remove debug logs use NBT data to determine if the item is a deck or a card
12d80fa
to
a5c877a
Compare
@@ -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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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() = |
There was a problem hiding this comment.
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.
trackedout/agronet-fabric#14 needs to merge first