refactor: alpha hmr
This commit is contained in:
parent
a7c121bae8
commit
35d77efc4c
|
@ -58,6 +58,9 @@ export default async (room, latus) => {
|
|||
[0, 0, w, h],
|
||||
Plains.children[1].matrix,
|
||||
);
|
||||
if (Object.keys(room.layer(3).entities).length > 0) {
|
||||
return;
|
||||
}
|
||||
for (let y = 0; y < 64; ++y) {
|
||||
for (let x = 0; x < 64; ++x) {
|
||||
let v = noise(Vector.scale([x, y], 5), seed);
|
||||
|
|
|
@ -7,6 +7,11 @@ import UniverseInput from './packets/decorators/universe-input';
|
|||
|
||||
export default {
|
||||
hooks: {
|
||||
'@latus/core/hmr': (path, latus) => {
|
||||
if ('@humus/universe/server' === path) {
|
||||
alpha(latus.get('%universe').room('players/cha0s/index.room.json'), latus);
|
||||
}
|
||||
},
|
||||
'@latus/core/server/up': async (latus) => {
|
||||
const {root} = latus.get('@humus/universe');
|
||||
const {running} = latus.get('@humus/universe/server');
|
||||
|
@ -20,7 +25,6 @@ export default {
|
|||
try {
|
||||
const {Universe} = latus.get('%resources');
|
||||
const universe = await Universe.load({extends: `/universe/${running}/index.universe.json`});
|
||||
// alpha gen
|
||||
alpha(universe.room('players/cha0s/index.room.json'), latus);
|
||||
latus.set('%universe', universe);
|
||||
universe.start();
|
||||
|
|
Loading…
Reference in New Issue
Block a user