Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

minecraft-data

Package Overview
Dependencies
Maintainers
1
Versions
311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minecraft-data - npm Package Compare versions

Comparing version 0.14.0 to 0.15.0

.idea/encodings.xml

3

doc/history.md

@@ -0,1 +1,4 @@

## 0.15.0
* make node-minecraft-data browserify compatible
## 0.14.0

@@ -2,0 +5,0 @@ * move to new minecraft-data organization: master branch containing all the versions instead of one branch per version

73

index.js

@@ -1,27 +0,8 @@

var cache={}; // prevent reindexing when requiring multiple time the same version
var loader=require("./loader");
module.exports = function(mcVersion)
module.exports = function(version)
{
var majorVersion=toMajor(mcVersion);
if(majorVersion==null)
return null;
if(cache[majorVersion])
return cache[majorVersion];
var mcData=mcVersionToMcData(majorVersion);
if(mcData==null)
return null;
var nmcData=mcDataToNode(mcData);
cache[majorVersion]=nmcData;
return nmcData;
return loader(version,mcVersionToMcData);
};
function toMajor(mcVersion)
{
var parts=mcVersion.split(".");
if(parts.size<=1)
return null;
mcVersion=parts.slice(0,2).join(".");
return mcVersion;
}
function mcVersionToMcData(mcVersion)

@@ -42,48 +23,2 @@ {

};
}
function mcDataToNode(mcData) {
var indexes=require("./indexes.js")(mcData);
return {
blocks: indexes.blocksById,
blocksByName: indexes.blocksByName,
blocksArray: mcData.blocks,
biomes: indexes.biomesById,
biomesArray: mcData.biomes,
items: indexes.itemsById,
itemsByName: indexes.itemsByName,
itemsArray: mcData.items,
recipes: mcData.recipes,
instruments: indexes.instrumentsById,
instrumentsArray: mcData.instruments,
materials: mcData.materials,
entities: indexes.entitiesById,
entitiesByName: indexes.entitiesByName,
entitiesArray: mcData.entities,
windows: indexes.windowsById,
windowsByName: indexes.windowsByName,
windowsArray: mcData.windows,
protocol: mcData.protocol,
version: mcData.version,
findItemOrBlockById: function (id) {
var item = indexes.itemsById[id];
if (item !== undefined) return item;
return indexes.blocksById[id];
},
findItemOrBlockByName: function (name) {
var item = indexes.itemsByName[name];
if (item !== undefined) return item;
return indexes.blocksByName[name];
}
};
}
}
{
"name": "minecraft-data",
"version": "0.14.0",
"version": "0.15.0",
"description": "Provide easy access to minecraft data in node.js",
"main": "index.js",
"browser":"browser.js",
"scripts": {

@@ -7,0 +8,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc