Trading Cards Resource Pack

Trading Cards Resource Pack

196 Downloads

[Idea Suggestion] Use CustomModelData nbt instead of card display names

sarhatabaot opened this issue ยท 9 comments

commented

Describe your idea
Use the custommodeldata available in my fork instead of relying on card titles.
This will allow the resource pack to work even if people changed their card titles. (i.e, different language or something other than [Card])

In general we use NBT data, see https://github.com/sarhatabaot/TradingCards/blob/master/tradingcards-api/src/main/java/net/tinetwork/tradingcards/api/utils/NbtUtils.java for all the info.

Aside from custommodeldata, we also store the card name, series, rarity, if it's shiny & if it's a card in nbt data.
On decks we store the deck number & if it's a deck.

Additional context

cards:
  common:
    zombie:
      display-name: 'Zombie'
      series: 'default'
      type: 'Monster'
      has-shiny-version: true
      info: 'none'
      # if vault is enabled, how much this card is worth. set to 0 to not allow buying.
      # Unless specified we will use the prices from rarities.
      buy-price: 100.0
      sell-price: 50.0
      Custom-Model-Data: 3200001
...
commented

This is excellent. With Xen's version, I had to use lore text to identify a real card. Otherwise, players could rename paper into real-looking cards at an anvil.

commented

Question: Do you have a defined reference for what cards have which custom model data number?

I checked here, but it doesn't have the new format yet.
https://github.com/sarhatabaot/TradingCards/blob/master/tradingcards-plugin/src/main/resources/cards/cards.yml

commented

Since the shiny effect is handled by the plugin, this would further reduce the effort for making new CIT files.
Question 2: are 'isCard' and 'isDeck' Boolean?
Question 3: Would it be 'nbt.NbtUtils.isCard' or just 'nbt.isCard'?

Review CIT properties in gist: https://gist.github.com/isaaclepes/5fdb4ac0d2af24f50bf00eb480b89f25

commented

Q1: I haven't updated the card model data in the default file yet. We could start from Custom-Model-Data: 3200001 on zombie and go forward from there.
Q2: isCard & isDeck are boolean
Q3: It should be just nbt.isCard - we will have to test it.

commented

Instead of starting with Zombie, I alphabetized the list of cards for which there is a model in the pack and assigned ids to each.
Hopefully this will help you as well.

https://gist.github.com/isaaclepes/8ead7db807b5c310c7e9af610eb683b3

commented

Here is a new gist with the card definitions complete, except sorting into rarities. I will work on organizing them into rarity categories.

https://gist.github.com/isaaclepes/2d0b280e74d4a1a59736bb05852125a9

commented

Complete cards.yml with these changes
https://gist.github.com/isaaclepes/790486b22f30519eac4ca5125617f2fd
I followed the original rarities and then added the new cards in where they seemed to fit. Xen should have looked at the in-game rarities for help, as some of the 'common' cards were not 'common' mobs, etc.

commented

Both gists have been updated to reflect new cards

commented