prismarine-item
Advanced tools
Comparing version 1.8.0 to 1.9.0
/// <reference types="node" /> | ||
import { Tag, TagType } from 'prismarine-nbt' | ||
declare class Item { | ||
@@ -9,3 +11,3 @@ constructor(type: number, count: number, metadata?: number, nbt?: object); | ||
metadata: number; | ||
nbt: Buffer | null; | ||
nbt: Tags[TagType] | null; | ||
name: string; | ||
@@ -12,0 +14,0 @@ displayName: string; |
@@ -73,5 +73,8 @@ const nbt = require('prismarine-nbt') | ||
static fromNotch (item) { | ||
if (mcData.isNewerOrEqualTo('1.13')) { | ||
if (mcData.isNewerOrEqualTo('1.14')) { | ||
if (item.present === false) return null | ||
return new Item(item.itemId, item.itemCount, item.nbtData) | ||
} else if (mcData.isNewerOrEqualTo('1.13')) { | ||
if (item.itemId === -1) return null | ||
return new Item(item.itemId, item.itemCount, item.nbtData) | ||
} else { | ||
@@ -78,0 +81,0 @@ if (item.blockId === -1) return null |
{ | ||
"name": "prismarine-item", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "Represent a minecraft item with its associated data", | ||
@@ -21,5 +21,5 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@types/node": "^14.0.1", | ||
"@types/node": "^15.0.1", | ||
"jest": "^26.1.0", | ||
"minecraft-data": "2.79.0", | ||
"minecraft-data": "^2.79.0", | ||
"standard": "^16.0.1" | ||
@@ -26,0 +26,0 @@ }, |
@@ -93,2 +93,8 @@ # prismarine-item | ||
## 1.9.0 | ||
* Revise typings (thanks @extremeheat) | ||
* Revise deps (thanks @rom1504) | ||
* Correctly identify null items in MC 1.13 (thanks @u9g) | ||
## 1.8.0 | ||
@@ -95,0 +101,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64121
11
961
151