Change serv.world to serv.worlds. Added playerPlugins/world.js and moved a lot of stuff from login.js there. Generating multiple worlds works and moving players there works as well. A few issues here and there.

This commit is contained in:
DemiPixel 2015-10-13 23:17:01 -07:00
parent 1917165caf
commit cfa690efb3
2 changed files with 9 additions and 11 deletions

View file

@ -10,7 +10,6 @@ function inject(serv, player)
try { try {
var id = await player.world.getBlockType(referencePosition); var id = await player.world.getBlockType(referencePosition);
var blockAbove = await player.world.getBlockType(referencePosition.clone().add(new vec3(0, 1, 0))); var blockAbove = await player.world.getBlockType(referencePosition.clone().add(new vec3(0, 1, 0)));
if (id == 54) { if (id == 54) {
if (blockAbove) { if (blockAbove) {
return; return;

View file

@ -98,15 +98,15 @@ function inject(serv,player)
function fillTabList() function fillTabList()
{ {
player._writeOthers('player_info',{ player._writeOthers('player_info',{
action: 0, action: 0,
data: [{ data: [{
UUID: player._client.uuid, UUID: player._client.uuid,
name: player.username, name: player.username,
properties: [], properties: [],
gamemode: player.gameMode, gamemode: player.gameMode,
ping: 1 ping: 1
}] }]
}); });
player._client.write('player_info', { player._client.write('player_info', {
action: 0, action: 0,
@ -118,7 +118,6 @@ function inject(serv,player)
ping: 1 ping: 1
})) }))
}); });
} }
function announceJoin() function announceJoin()