Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat authored Sep 8, 2024
1 parent 569b0fb commit fe681b1
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,18 @@ function loader (registryOrVersion) {
console.log('fromNotch', arguments)
if (registry.type === 'pc') {
if (registry.supportFeature('itemsWithComponents')) { // 1.20.5+
console.trace('fromNotch itemsWithComponents')
if (networkItem.itemCount === 0) return null
const item = new Item(networkItem.itemId, networkItem.itemCount, null, null, true)
item.components = networkItem.components
item.removedComponents = networkItem.removeComponents
return item
} else if (registry.supportFeature('itemSerializationWillOnlyUsePresent')) {
console.trace('fromNotch itemSerializationWillOnlyUsePresent')
if (networkItem.present === false) return null
return new Item(networkItem.itemId, networkItem.itemCount, networkItem.nbtData, null, true)
} else if (registry.supportFeature('itemSerializationAllowsPresent')) {
console.trace('fromNotch itemSerializationAllowsPresent')
if (networkItem.itemId === -1 || networkItem.present === false) return null
return new Item(networkItem.itemId, networkItem.itemCount, networkItem.nbtData, null, true)
} else if (registry.supportFeature('itemSerializationUsesBlockId')) {
console.trace('fromNotch itemSerializationUsesBlockId')
if (networkItem.blockId === -1) return null
return new Item(networkItem.blockId, networkItem.itemCount, networkItem.itemDamage, networkItem.nbtData, null, true)
} else {
Expand Down

0 comments on commit fe681b1

Please sign in to comment.