remove /spawn and /spawnObject, fix #175

This commit is contained in:
Romain Beaumont 2016-03-14 15:46:31 +01:00
parent a17f47c9e9
commit bccfc5d10c

View file

@ -74,44 +74,6 @@ module.exports.server=function(serv,options) {
module.exports.player=function(player,serv){
player.commands.add({
base: 'spawn',
info: 'Spawn a mob',
usage: '/spawn <entity_id>',
op: true,
parse(str) {
const results=str.match(/(\d+)/);
if (!results) return false;
return {
id: parseInt(results[1])
}
},
action({id}) {
serv.spawnMob(id, player.world, player.position.scaled(1/32), {
velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10)
});
}
});
player.commands.add({
base: 'spawnObject',
info: 'Spawn an object',
usage: '/spawnObject <entity_id>',
op: true,
parse(str) {
const results=str.match(/(\d+)/);
if (!results) return false;
return {
id: parseInt(results[1])
}
},
action({id}) {
serv.spawnObject(id, player.world, player.position.scaled(1/32), {
velocity: Vec3((Math.random() - 0.5) * 10, Math.random()*10 + 10, (Math.random() - 0.5) * 10)
});
}
});
player.commands.add({
base: 'summon',
info: 'Summon an entity',