mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-13 14:50:25 -04:00
a few small changes to make the code better
This commit is contained in:
parent
f3a653ef1c
commit
b2b53c9343
14 changed files with 40 additions and 47 deletions
examples
|
@ -55,7 +55,7 @@ if(process.argv.length < 5) {
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
process.argv.forEach(function(val, index, array) {
|
||||
process.argv.forEach(function(val) {
|
||||
if(val == "-h") {
|
||||
print_help();
|
||||
process.exit(0);
|
||||
|
@ -167,9 +167,9 @@ function parseChat(chatObj, parentState) {
|
|||
|
||||
chat += color(util.format.apply(this, args), getColorize(parentState));
|
||||
}
|
||||
for(var i in chatObj.extra) {
|
||||
chatObj.extra.forEach(function(i) {
|
||||
chat += parseChat(chatObj.extra[i], parentState);
|
||||
}
|
||||
});
|
||||
return chat;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ if(process.argv.length < 4) {
|
|||
printHelpAndExit(1);
|
||||
}
|
||||
|
||||
process.argv.forEach(function(val, index, array) {
|
||||
process.argv.forEach(function(val) {
|
||||
if(val == "-h") {
|
||||
printHelpAndExit(0);
|
||||
}
|
||||
|
@ -175,8 +175,8 @@ srv.on('login', function(client) {
|
|||
function shouldDump(name, direction) {
|
||||
if(matches(printNameBlacklist[name])) return false;
|
||||
if(printAllNames) return true;
|
||||
if(matches(printNameWhitelist[name])) return true;
|
||||
return false;
|
||||
return matches(printNameWhitelist[name]);
|
||||
|
||||
function matches(result) {
|
||||
return result != null && result.indexOf(direction) !== -1;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
var mc = require('minecraft-protocol');
|
||||
var states = mc.states;
|
||||
|
||||
var options = {
|
||||
motd: 'Vox Industries',
|
||||
'max-players': 127,
|
||||
port: 25565,
|
||||
'online-mode': false,
|
||||
'online-mode': false
|
||||
};
|
||||
|
||||
var server = mc.createServer(options);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var mc = require('minecraft-protocol');
|
||||
|
||||
var options = {
|
||||
'online-mode': true,
|
||||
'online-mode': true
|
||||
};
|
||||
|
||||
var server = mc.createServer(options);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue