Material counter and cleanup
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { world } from '@minecraft/server';
|
||||
import { Structure } from './Structure';
|
||||
|
||||
class StructureCollection {
|
||||
@@ -9,8 +8,9 @@ class StructureCollection {
|
||||
}
|
||||
|
||||
add(name) {
|
||||
const struct = world.structureManager.get(name);
|
||||
this.#structures[name] = new Structure(name, struct);
|
||||
const structure = new Structure(name);
|
||||
this.#structures[name] = structure;
|
||||
return structure;
|
||||
}
|
||||
|
||||
get(name) {
|
||||
@@ -26,14 +26,6 @@ class StructureCollection {
|
||||
struct.remove();
|
||||
delete this.#structures[name];
|
||||
}
|
||||
|
||||
place(name, dimensionId, location) {
|
||||
const struct = this.get(name);
|
||||
if (!struct) {
|
||||
throw new Error(`Structure ${name} not found.`);
|
||||
}
|
||||
struct.place(dimensionId, location);
|
||||
}
|
||||
}
|
||||
|
||||
export const structureCollection = new StructureCollection();
|
||||
Reference in New Issue
Block a user