get rid of s3
This commit is contained in:
parent
8cd07e8521
commit
ef586df9a6
8 changed files with 86 additions and 86 deletions
|
|
@ -16,8 +16,8 @@ export default class CommandPlugin extends Plugin {
|
|||
this.server = server;
|
||||
this.on("setblock", (player, _mode, _id) => {
|
||||
const world = server.worlds.find((e) => e.name == player.world)!;
|
||||
if (!world.optionalJson?.builders?.includes("*")) {
|
||||
if (!world.optionalJson?.builders?.includes(player.username)) {
|
||||
if (!world.metadata?.builders?.includes("*")) {
|
||||
if (!world.metadata?.builders?.includes(player.username)) {
|
||||
player.message("You are %cnot allowed &fto build in this world!");
|
||||
return true;
|
||||
}
|
||||
|
|
@ -59,8 +59,8 @@ export default class CommandPlugin extends Plugin {
|
|||
{ x: 64, y: 64, z: 64 },
|
||||
player.username,
|
||||
);
|
||||
world.optionalJson.builders = [];
|
||||
world.optionalJson.builders.push(player.username);
|
||||
world.metadata.builders = [];
|
||||
world.metadata.builders.push(player.username);
|
||||
server.worlds.push(world);
|
||||
|
||||
player.message(`&aWorld created!&f Use /g ${player.username}!`);
|
||||
|
|
@ -105,11 +105,11 @@ export default class CommandPlugin extends Plugin {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!world.optionalJson?.builders) world.optionalJson.builders = [];
|
||||
if (!world.metadata?.builders) world.metadata.builders = [];
|
||||
|
||||
if (subcategory == "add") {
|
||||
const username = args[2];
|
||||
world.optionalJson.builders.push(username);
|
||||
world.metadata.builders.push(username);
|
||||
player.message(
|
||||
`&a${username}&f sucesfully added as a builder to world &a${world.name}!`,
|
||||
);
|
||||
|
|
@ -117,13 +117,13 @@ export default class CommandPlugin extends Plugin {
|
|||
} else if (subcategory == "remove") {
|
||||
const username = args[2];
|
||||
|
||||
const before = world.optionalJson.builders.length;
|
||||
const before = world.metadata.builders.length;
|
||||
|
||||
world.optionalJson.builders = world.optionalJson.builders.filter((
|
||||
world.metadata.builders = world.metadata.builders.filter((
|
||||
e: string,
|
||||
) => e !== username);
|
||||
|
||||
const after = world.optionalJson.builders.length;
|
||||
const after = world.metadata.builders.length;
|
||||
|
||||
player.message(
|
||||
`Removed &a${
|
||||
|
|
@ -134,7 +134,7 @@ export default class CommandPlugin extends Plugin {
|
|||
} else if (subcategory == "list") {
|
||||
player.message(
|
||||
`&a${world.name}&f's builders: &a${
|
||||
world.optionalJson.builders.join(", ")
|
||||
world.metadata.builders.join(", ")
|
||||
}`,
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue