add jslint globals comment
This commit is contained in:
parent
1f122cb2cb
commit
fec318c2a4
1 changed files with 4 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
/*global nashorn, require, Packages, module*/
|
||||||
var ItemType = Packages.net.canarymod.api.inventory.ItemType;
|
var ItemType = Packages.net.canarymod.api.inventory.ItemType;
|
||||||
var Canary = Packages.net.canarymod.Canary;
|
var Canary = Packages.net.canarymod.Canary;
|
||||||
var itemFactory = Canary.factory().itemFactory;
|
var itemFactory = Canary.factory().itemFactory;
|
||||||
|
@ -35,13 +36,14 @@ if (nashorn){
|
||||||
*/
|
*/
|
||||||
var itemTypeClass = require('nashorn-type')(ItemType);
|
var itemTypeClass = require('nashorn-type')(ItemType);
|
||||||
var materials = itemTypeClass.getDeclaredFields();
|
var materials = itemTypeClass.getDeclaredFields();
|
||||||
|
var name;
|
||||||
for (var i = 0;i < materials.length; i++ ){
|
for (var i = 0;i < materials.length; i++ ){
|
||||||
|
|
||||||
if (materials[i].type != itemTypeClass) {
|
if (materials[i].type != itemTypeClass) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var materialField = materials[i];
|
var materialField = materials[i];
|
||||||
var name = (''+materialField.name);
|
name = (''+materialField.name);
|
||||||
name = name.replace(/^(.)/,function(a){
|
name = name.replace(/^(.)/,function(a){
|
||||||
return a.toLowerCase();
|
return a.toLowerCase();
|
||||||
});
|
});
|
||||||
|
@ -57,7 +59,7 @@ if (nashorn){
|
||||||
if (!(ItemType[field] instanceof ItemType)){
|
if (!(ItemType[field] instanceof ItemType)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var name = (''+field).replace(/^(.)/,function(a){
|
name = (''+field).replace(/^(.)/,function(a){
|
||||||
return a.toLowerCase();
|
return a.toLowerCase();
|
||||||
});
|
});
|
||||||
items[name] = getMaterialHandler(ItemType[field]);
|
items[name] = getMaterialHandler(ItemType[field]);
|
||||||
|
|
Reference in a new issue