mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-07 04:00:46 +00:00
Remove babel and unused dependencies
This commit is contained in:
parent
1f4084d079
commit
711a484b72
5 changed files with 17 additions and 72 deletions
48
gulpfile.js
48
gulpfile.js
|
|
@ -1,48 +0,0 @@
|
||||||
var gulp = require('gulp');
|
|
||||||
|
|
||||||
var plumber = require('gulp-plumber');
|
|
||||||
var babel = require('gulp-babel');
|
|
||||||
var options = {
|
|
||||||
presets: ['babel-preset-stage-0','es2015'],
|
|
||||||
plugins:['transform-runtime']
|
|
||||||
};
|
|
||||||
|
|
||||||
var sourcemaps = require('gulp-sourcemaps');
|
|
||||||
|
|
||||||
gulp.task('compile', function() {
|
|
||||||
return gulp
|
|
||||||
.src('src/**/*.js')
|
|
||||||
.pipe(plumber({
|
|
||||||
errorHandler: function(err) {
|
|
||||||
console.error(err.stack);
|
|
||||||
this.emit('end');
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
.pipe(sourcemaps.init())
|
|
||||||
.pipe(babel(options))
|
|
||||||
.pipe(plumber.stop())
|
|
||||||
.pipe(sourcemaps.write('maps/'))
|
|
||||||
.pipe(gulp.dest('dist/'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('compileTest', function() {
|
|
||||||
return gulp
|
|
||||||
.src('test/**/*.js')
|
|
||||||
.pipe(plumber({
|
|
||||||
errorHandler: function(err) {
|
|
||||||
console.error(err.stack);
|
|
||||||
this.emit('end');
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
.pipe(sourcemaps.init())
|
|
||||||
.pipe(babel(options))
|
|
||||||
.pipe(plumber.stop())
|
|
||||||
.pipe(sourcemaps.write('maps/'))
|
|
||||||
.pipe(gulp.dest('distTest/'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('watch', function() {
|
|
||||||
return gulp.watch('src/**/*.js', ['compile']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('default', ['compile','compileTest']);
|
|
||||||
2
index.js
2
index.js
|
|
@ -1 +1 @@
|
||||||
module.exports = require('./dist/index.js');
|
module.exports = require('./src/index.js');
|
||||||
|
|
|
||||||
21
package.json
21
package.json
|
|
@ -3,7 +3,7 @@
|
||||||
"description": "A minecraft server written in node.js",
|
"description": "A minecraft server written in node.js",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "mhsjlw <mhsjlw@aol.com>",
|
"author": "mhsjlw <mhsjlw@users.noreply.github.com>",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
"name": "rom1504",
|
"name": "rom1504",
|
||||||
|
|
@ -11,10 +11,10 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"bin": {
|
"bin": {
|
||||||
"flying-squid": "./app.js"
|
"flying-squid": "app.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublish": "gulp && require-self",
|
"prepare": "require-self",
|
||||||
"test": "mocha --reporter spec distTest"
|
"test": "mocha --reporter spec distTest"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|
@ -22,10 +22,9 @@
|
||||||
"type": "MIT"
|
"type": "MIT"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4"
|
"node": ">=8"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-runtime": "^6.5.0",
|
|
||||||
"diamond-square": "1.0.0",
|
"diamond-square": "1.0.0",
|
||||||
"emit-then": "^2.0.0",
|
"emit-then": "^2.0.0",
|
||||||
"event-promise": "^0.0.1",
|
"event-promise": "^0.0.1",
|
||||||
|
|
@ -34,10 +33,7 @@
|
||||||
"minecraft-protocol": "^1.0.0",
|
"minecraft-protocol": "^1.0.0",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"moment": "^2.10.6",
|
"moment": "^2.10.6",
|
||||||
"node-dir": "^0.1.9",
|
|
||||||
"node-promise-es6": "^0.3.0",
|
|
||||||
"node-uuid": "^1.4.3",
|
"node-uuid": "^1.4.3",
|
||||||
"prismarine-block": "^1.0.1",
|
|
||||||
"prismarine-chunk": "^1.0.1",
|
"prismarine-chunk": "^1.0.1",
|
||||||
"prismarine-entity": "^0.2.0",
|
"prismarine-entity": "^0.2.0",
|
||||||
"prismarine-item": "^1.0.1",
|
"prismarine-item": "^1.0.1",
|
||||||
|
|
@ -46,6 +42,7 @@
|
||||||
"prismarine-world": "^2.0.0",
|
"prismarine-world": "^2.0.0",
|
||||||
"random-seed": "^0.3.0",
|
"random-seed": "^0.3.0",
|
||||||
"range": "^0.0.3",
|
"range": "^0.0.3",
|
||||||
|
"request": "^2.83.0",
|
||||||
"request-promise": "^4.1.0",
|
"request-promise": "^4.1.0",
|
||||||
"requireindex": "~1.1.0",
|
"requireindex": "~1.1.0",
|
||||||
"spiralloop": "^1.0.2",
|
"spiralloop": "^1.0.2",
|
||||||
|
|
@ -60,15 +57,7 @@
|
||||||
"url": "http://github.com/PrismarineJS/flying-squid/issues"
|
"url": "http://github.com/PrismarineJS/flying-squid/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"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": "^1.0.0",
|
|
||||||
"gulp": "^3.8.11",
|
|
||||||
"gulp-babel": "^6.1.2",
|
|
||||||
"gulp-plumber": "^1.0.1",
|
|
||||||
"gulp-sourcemaps": "^2.0.0",
|
|
||||||
"longjohn": "^0.2.8",
|
"longjohn": "^0.2.8",
|
||||||
"mineflayer": "^1.7.5",
|
"mineflayer": "^1.7.5",
|
||||||
"mocha": "^3.0.0",
|
"mocha": "^3.0.0",
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
const Behavior = require("flying-squid").Behavior;
|
const Behavior = require("flying-squid").Behavior;
|
||||||
|
|
||||||
module.exports.server = function(serv) {
|
module.exports.server = function(serv) {
|
||||||
serv.behavior = new Behavior(serv);
|
serv.behavior = Behavior(serv);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.entity = function (entity) {
|
module.exports.entity = function (entity) {
|
||||||
entity.behavior = new Behavior(entity);
|
entity.behavior = Behavior(entity);
|
||||||
};
|
};
|
||||||
|
|
@ -3,8 +3,12 @@ const spiralloop = require('spiralloop');
|
||||||
const World = require('prismarine-world')(require("../version"));
|
const World = require('prismarine-world')(require("../version"));
|
||||||
|
|
||||||
const generations=require("flying-squid").generations;
|
const generations=require("flying-squid").generations;
|
||||||
import {fs} from 'node-promise-es6';
|
const { promisify } = require('util');
|
||||||
import {level} from 'prismarine-provider-anvil';
|
const fs = require('fs');
|
||||||
|
const { level } = require('prismarine-provider-anvil');
|
||||||
|
|
||||||
|
const fsStat = promisify(fs.stat);
|
||||||
|
const fsMkdir = promisify(fs.mkdir);
|
||||||
|
|
||||||
module.exports.server=async function(serv,{worldFolder,generation={"name":"diamond_square","options":{"worldHeight":80}}}={}) {
|
module.exports.server=async function(serv,{worldFolder,generation={"name":"diamond_square","options":{"worldHeight":80}}}={}) {
|
||||||
const newSeed=generation.options.seed || Math.floor(Math.random()*Math.pow(2, 31));
|
const newSeed=generation.options.seed || Math.floor(Math.random()*Math.pow(2, 31));
|
||||||
|
|
@ -13,10 +17,10 @@ module.exports.server=async function(serv,{worldFolder,generation={"name":"diamo
|
||||||
if(worldFolder) {
|
if(worldFolder) {
|
||||||
regionFolder = worldFolder + "/region";
|
regionFolder = worldFolder + "/region";
|
||||||
try {
|
try {
|
||||||
const stats = await fs.stat(regionFolder);
|
const stats = await fsStat(regionFolder);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
await fs.mkdir(regionFolder);
|
await fsMkdir(regionFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue