mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-19 06:21:08 +00:00
Merge pull request #188 from PrismarineJS/greenkeeper-update-all
Update all dependencies 🌴
This commit is contained in:
commit
f503411858
5 changed files with 46 additions and 27 deletions
|
|
@ -1,5 +1,3 @@
|
|||
notify:
|
||||
webhooks:
|
||||
# A list of hook hashes, containing the url field
|
||||
# gitter hook
|
||||
- url: https://webhooks.gitter.im/e/9ebf3297ec153cdb0d0b
|
||||
machine:
|
||||
node:
|
||||
version: 4
|
||||
|
|
@ -3,8 +3,8 @@ var gulp = require('gulp');
|
|||
var plumber = require('gulp-plumber');
|
||||
var babel = require('gulp-babel');
|
||||
var options = {
|
||||
stage: 0, // Dat ES7 goodness
|
||||
optional: ["runtime"]
|
||||
presets: ['babel-preset-stage-0','es2015'],
|
||||
plugins:['transform-runtime']
|
||||
};
|
||||
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
|
|
|
|||
23
package.json
23
package.json
|
|
@ -21,13 +21,16 @@
|
|||
"licenses": {
|
||||
"type": "MIT"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-runtime": "^5.4.4",
|
||||
"babel-runtime": "^6.5.0",
|
||||
"diamond-square": "0.0.0",
|
||||
"emit-then": "^1.0.2",
|
||||
"emit-then": "^2.0.0",
|
||||
"event-promise": "^0.0.1",
|
||||
"flatmap": "^0.0.3",
|
||||
"minecraft-data": "^0.7.0",
|
||||
"minecraft-data": "^0.19.1",
|
||||
"minecraft-protocol": "^0.16.6",
|
||||
"mkdirp": "^0.5.1",
|
||||
"moment": "^2.10.6",
|
||||
|
|
@ -42,10 +45,10 @@
|
|||
"prismarine-windows": "^0.0.0",
|
||||
"prismarine-world": "^0.5.4",
|
||||
"prismarine-world-sync": "^0.1.0",
|
||||
"random-seed": "^0.2.0",
|
||||
"random-seed": "^0.3.0",
|
||||
"range": "^0.0.3",
|
||||
"request-promise": "^0.4.3",
|
||||
"requireindex": "~1.0.0",
|
||||
"request-promise": "^2.0.0",
|
||||
"requireindex": "~1.1.0",
|
||||
"spiralloop": "^1.0.2",
|
||||
"vec3": "^0.1.3"
|
||||
},
|
||||
|
|
@ -58,11 +61,13 @@
|
|||
"url": "http://github.com/PrismarineJS/flying-squid/issues"
|
||||
},
|
||||
"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",
|
||||
"doctoc": "^0.15.0",
|
||||
"doctoc": "^1.0.0",
|
||||
"gulp": "^3.8.11",
|
||||
"gulp-babel": "^5.1.0",
|
||||
"gulp-babel": "^6.1.2",
|
||||
"gulp-plumber": "^1.0.1",
|
||||
"gulp-sourcemaps": "^1.3.0",
|
||||
"longjohn": "^0.2.8",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
const version = require("flying-squid").version;
|
||||
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 path = require('path');
|
||||
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}) => {
|
||||
const object = serv.initEntity('object', type, world, position.scaled(32).floored());
|
||||
object.name=objectsById[type].name;
|
||||
object.data = data;
|
||||
object.velocity = velocity.scaled(32).floored();
|
||||
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=[]}={}) => {
|
||||
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.pitch = pitch;
|
||||
mob.headPitch = headPitch;
|
||||
|
|
@ -121,7 +123,10 @@ module.exports.player=function(player,serv){
|
|||
player.chat("No entity named "+name);
|
||||
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)
|
||||
});
|
||||
}
|
||||
|
|
@ -145,10 +150,16 @@ module.exports.player=function(player,serv){
|
|||
return;
|
||||
}
|
||||
let s=Math.floor(Math.sqrt(number));
|
||||
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), {
|
||||
velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10)
|
||||
for(let i=0;i<number;i++) {
|
||||
if(entity.type=="mob")
|
||||
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);
|
||||
},
|
||||
action(entityTypes) {
|
||||
entityTypes.map(entity =>
|
||||
serv.spawnMob(entity.id, player.world, player.position.scaled(1/32), {
|
||||
entityTypes.map(entity => {
|
||||
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)
|
||||
});
|
||||
})
|
||||
.reduce((prec,entity) => {
|
||||
if(prec!=null)
|
||||
prec.attach(entity);
|
||||
|
|
|
|||
|
|
@ -62,8 +62,9 @@ async function findBorder(world,{line,direction},directionV)
|
|||
top=positiveOrder(top,direction);
|
||||
|
||||
|
||||
if(direction.y!=0)
|
||||
[bottom,left,right,top]=[left,bottom,top,right];
|
||||
if(direction.y!=0) {
|
||||
[bottom, left, right, top] = [left, bottom, top, right];
|
||||
}
|
||||
|
||||
[bottom,top]=directionV.y<0 ? [top,bottom] : [bottom,top];
|
||||
const horDir=direction.x!=0 || directionV.x!=0 ? 'x' :'z';
|
||||
|
|
|
|||
Loading…
Reference in a new issue