Merge pull request #188 from PrismarineJS/greenkeeper-update-all

Update all dependencies 🌴
This commit is contained in:
Romain Beaumont 2016-02-12 14:09:48 +01:00
commit f503411858
5 changed files with 46 additions and 27 deletions

View file

@ -1,5 +1,3 @@
notify: machine:
webhooks: node:
# A list of hook hashes, containing the url field version: 4
# gitter hook
- url: https://webhooks.gitter.im/e/9ebf3297ec153cdb0d0b

View file

@ -3,8 +3,8 @@ var gulp = require('gulp');
var plumber = require('gulp-plumber'); var plumber = require('gulp-plumber');
var babel = require('gulp-babel'); var babel = require('gulp-babel');
var options = { var options = {
stage: 0, // Dat ES7 goodness presets: ['babel-preset-stage-0','es2015'],
optional: ["runtime"] plugins:['transform-runtime']
}; };
var sourcemaps = require('gulp-sourcemaps'); var sourcemaps = require('gulp-sourcemaps');

View file

@ -21,13 +21,16 @@
"licenses": { "licenses": {
"type": "MIT" "type": "MIT"
}, },
"engines": {
"node": ">=4"
},
"dependencies": { "dependencies": {
"babel-runtime": "^5.4.4", "babel-runtime": "^6.5.0",
"diamond-square": "0.0.0", "diamond-square": "0.0.0",
"emit-then": "^1.0.2", "emit-then": "^2.0.0",
"event-promise": "^0.0.1", "event-promise": "^0.0.1",
"flatmap": "^0.0.3", "flatmap": "^0.0.3",
"minecraft-data": "^0.7.0", "minecraft-data": "^0.19.1",
"minecraft-protocol": "^0.16.6", "minecraft-protocol": "^0.16.6",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"moment": "^2.10.6", "moment": "^2.10.6",
@ -42,10 +45,10 @@
"prismarine-windows": "^0.0.0", "prismarine-windows": "^0.0.0",
"prismarine-world": "^0.5.4", "prismarine-world": "^0.5.4",
"prismarine-world-sync": "^0.1.0", "prismarine-world-sync": "^0.1.0",
"random-seed": "^0.2.0", "random-seed": "^0.3.0",
"range": "^0.0.3", "range": "^0.0.3",
"request-promise": "^0.4.3", "request-promise": "^2.0.0",
"requireindex": "~1.0.0", "requireindex": "~1.1.0",
"spiralloop": "^1.0.2", "spiralloop": "^1.0.2",
"vec3": "^0.1.3" "vec3": "^0.1.3"
}, },
@ -58,11 +61,13 @@
"url": "http://github.com/PrismarineJS/flying-squid/issues" "url": "http://github.com/PrismarineJS/flying-squid/issues"
}, },
"devDependencies": { "devDependencies": {
"babel": "^5.8.23", "babel-plugin-transform-runtime": "^6.5.0",
"babel-preset-es2015": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
"chai": "^3.2.0", "chai": "^3.2.0",
"doctoc": "^0.15.0", "doctoc": "^1.0.0",
"gulp": "^3.8.11", "gulp": "^3.8.11",
"gulp-babel": "^5.1.0", "gulp-babel": "^6.1.2",
"gulp-plumber": "^1.0.1", "gulp-plumber": "^1.0.1",
"gulp-sourcemaps": "^1.3.0", "gulp-sourcemaps": "^1.3.0",
"longjohn": "^0.2.8", "longjohn": "^0.2.8",

View file

@ -1,6 +1,7 @@
const version = require("flying-squid").version; const version = require("flying-squid").version;
const entitiesByName=require("minecraft-data")(version).entitiesByName; const entitiesByName=require("minecraft-data")(version).entitiesByName;
const entitiesById=require("minecraft-data")(version).entities; const mobsById=require("minecraft-data")(version).mobs;
const objectsById=require("minecraft-data")(version).objects;
const Entity = require("prismarine-entity"); const Entity = require("prismarine-entity");
const path = require('path'); const path = require('path');
const requireIndex = require('requireindex'); const requireIndex = require('requireindex');
@ -28,6 +29,7 @@ module.exports.server=function(serv,options) {
serv.spawnObject = (type, world, position, {pitch=0,yaw=0,velocity=new Vec3(0,0,0),data=1,itemId,itemDamage=0,pickupTime=undefined,deathTime=undefined}) => { serv.spawnObject = (type, world, position, {pitch=0,yaw=0,velocity=new Vec3(0,0,0),data=1,itemId,itemDamage=0,pickupTime=undefined,deathTime=undefined}) => {
const object = serv.initEntity('object', type, world, position.scaled(32).floored()); const object = serv.initEntity('object', type, world, position.scaled(32).floored());
object.name=objectsById[type].name;
object.data = data; object.data = data;
object.velocity = velocity.scaled(32).floored(); object.velocity = velocity.scaled(32).floored();
object.pitch = pitch; object.pitch = pitch;
@ -46,7 +48,7 @@ module.exports.server=function(serv,options) {
serv.spawnMob = (type, world, position, {pitch=0,yaw=0,headPitch=0,velocity=new Vec3(0,0,0),metadata=[]}={}) => { serv.spawnMob = (type, world, position, {pitch=0,yaw=0,headPitch=0,velocity=new Vec3(0,0,0),metadata=[]}={}) => {
const mob = serv.initEntity('mob', type, world, position.scaled(32).floored()); const mob = serv.initEntity('mob', type, world, position.scaled(32).floored());
mob.name=entitiesById[type].name; mob.name=mobsById[type].name;
mob.velocity = velocity.scaled(32).floored(); mob.velocity = velocity.scaled(32).floored();
mob.pitch = pitch; mob.pitch = pitch;
mob.headPitch = headPitch; mob.headPitch = headPitch;
@ -121,7 +123,10 @@ module.exports.player=function(player,serv){
player.chat("No entity named "+name); player.chat("No entity named "+name);
return; return;
} }
serv.spawnMob(entity.id, player.world, player.position.scaled(1/32), { if(entity.type=="mob") serv.spawnMob(entity.id, player.world, player.position.scaled(1/32), {
velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10)
});
else if(entity.type=="object") serv.spawnObject(entity.id, player.world, player.position.scaled(1/32), {
velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10) velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10)
}); });
} }
@ -145,10 +150,16 @@ module.exports.player=function(player,serv){
return; return;
} }
let s=Math.floor(Math.sqrt(number)); let s=Math.floor(Math.sqrt(number));
for(let i=0;i<number;i++) for(let i=0;i<number;i++) {
serv.spawnMob(entity.id, player.world, player.position.scaled(1/32).offset(Math.floor(i/s*10),0,i%s*10), { if(entity.type=="mob")
velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10) serv.spawnMob(entity.id, player.world, player.position.scaled(1 / 32).offset(Math.floor(i / s * 10), 0, i % s * 10), {
velocity: Vec3((Math.random() - 0.5) * 10, Math.random() * 10 + 10, (Math.random() - 0.5) * 10)
}); });
else if(entity.type=="object")
serv.spawnObject(entity.id, player.world, player.position.scaled(1 / 32).offset(Math.floor(i / s * 10), 0, i % s * 10), {
velocity: Vec3((Math.random() - 0.5) * 10, Math.random() * 10 + 10, (Math.random() - 0.5) * 10)
});
}
} }
}); });
@ -166,10 +177,14 @@ module.exports.player=function(player,serv){
.filter(entity => !!entity); .filter(entity => !!entity);
}, },
action(entityTypes) { action(entityTypes) {
entityTypes.map(entity => entityTypes.map(entity => {
serv.spawnMob(entity.id, player.world, player.position.scaled(1/32), { if(entity.type=="mob") serv.spawnMob(entity.id, player.world, player.position.scaled(1/32), {
velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10) velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10)
})) });
else if(entity.type=="object") serv.spawnObject(entity.id, player.world, player.position.scaled(1/32), {
velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10)
});
})
.reduce((prec,entity) => { .reduce((prec,entity) => {
if(prec!=null) if(prec!=null)
prec.attach(entity); prec.attach(entity);

View file

@ -62,8 +62,9 @@ async function findBorder(world,{line,direction},directionV)
top=positiveOrder(top,direction); top=positiveOrder(top,direction);
if(direction.y!=0) if(direction.y!=0) {
[bottom,left,right,top]=[left,bottom,top,right]; [bottom, left, right, top] = [left, bottom, top, right];
}
[bottom,top]=directionV.y<0 ? [top,bottom] : [bottom,top]; [bottom,top]=directionV.y<0 ? [top,bottom] : [bottom,top];
const horDir=direction.x!=0 || directionV.x!=0 ? 'x' :'z'; const horDir=direction.x!=0 || directionV.x!=0 ? 'x' :'z';