PrismarineJS / node-minecraft-assets

Provide minecraft assets in node.js
17 stars 13 forks source link

[Bug Report] Dupe hopper in 1.20.2 textureContent will be replaced by one. #32

Open EnchStudio opened 4 months ago

EnchStudio commented 4 months ago

i wanna get hopper item (like it in hotbar), but returned a hopper outside texture. because of textureContent.json have 2 name: hopper/

EnchStudio commented 4 months ago

i tried use this indexer.js

module.exports.buildIndexFromArray = function (array, fieldToIndex) {
  if (array === undefined) { return undefined }
  return array.reduce(function (index, element) {
    if (!index.hasOwnProperty(element[fieldToIndex])) {
      index[element[fieldToIndex]] = element
    }
    return index
  }, {})
}

and work good for me