Skip to content

Commit

Permalink
Merge pull request #2 from deathcap/fixes
Browse files Browse the repository at this point in the history
Fix parsing longs and strings
  • Loading branch information
Max Ogden committed Mar 16, 2014
2 parents 09935c7 + c720b82 commit a6d5184
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var dataview = require('jDataView');
var dataview = require('jdataview');

// Generated by CoffeeScript 1.6.2
(function(global) {
Expand Down Expand Up @@ -193,7 +193,7 @@ var dataview = require('jDataView');
}

TAG_Long.prototype.read = function() {
return this.reader.getFloat64();
return this.reader.getInt64();
};

return TAG_Long;
Expand Down Expand Up @@ -324,6 +324,7 @@ var dataview = require('jDataView');
this.getInt32 = __bind(this.getInt32, this);
this.getInt16 = __bind(this.getInt16, this);
this.getFloat64 = __bind(this.getFloat64, this);
this.getInt64 = __bind(this.getInt64, this);
this.getFloat32 = __bind(this.getFloat32, this);
this.getInt8 = __bind(this.getInt8, this);
this.getUint8 = __bind(this.getUint8, this);
Expand Down Expand Up @@ -352,6 +353,11 @@ var dataview = require('jDataView');
return this.dataview.getFloat64.call(this.dataview);
};

NBTReader.prototype.getInt64 = function() {
return this.dataview.getInt64.call(this.dataview);
};


NBTReader.prototype.getInt16 = function() {
return this.dataview.getInt16.call(this.dataview);
};
Expand All @@ -361,7 +367,7 @@ var dataview = require('jDataView');
};

NBTReader.prototype.getString = function(length) {
return this.dataview.getString.call(this.dataview, length);
return this.dataview.getString.call(this.dataview, length, undefined, 'utf8');
};

NBTReader.prototype.read = function(typespec) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "named binary tag (minecraft) parser in pure js",
"main": "index.js",
"scripts": {},
"repository": "",
"repository": "https://github.com/maxogden/minecraft-nbt",
"author": "Jason Livesay <ithkuil@gmail.com>, Max Ogden <max@maxogden.com>",
"license": "BSD",
"dependencies": {
"jDataView": "~1.1.0"
"jdataview": "^2.4.5"
}
}

0 comments on commit a6d5184

Please sign in to comment.