update to 1.21.80
This commit is contained in:
@@ -8,7 +8,7 @@ export class BuilderFormBuilder {
|
||||
.title(MenuFormBuilder.menuTitle);
|
||||
for (const optionId of BuilderOptions.getOptionIds()) {
|
||||
const option = BuilderOptions.get(optionId);
|
||||
form.toggle(`${option.displayName} - ${option.description}`, option.isEnabled(player.id));
|
||||
form.toggle(`${option.displayName} - ${option.description}`, { defaultValue: option.isEnabled(player.id) });
|
||||
}
|
||||
form.submitButton('§2Apply');
|
||||
return form;
|
||||
|
||||
@@ -28,7 +28,11 @@ export class Builders {
|
||||
}
|
||||
|
||||
world.afterEvents.playerJoin.subscribe((event) => Builders.onJoin(event.playerId));
|
||||
world.beforeEvents.playerLeave.subscribe((event) => Builders.onLeave(event.player.id));
|
||||
world.beforeEvents.playerLeave.subscribe((event) => {
|
||||
if (!event.player)
|
||||
return;
|
||||
Builders.onLeave(event.player.id);
|
||||
});
|
||||
world.afterEvents.worldLoad.subscribe((event) => {
|
||||
for (const player of world.getAllPlayers()) {
|
||||
Builders.onJoin(player.id);
|
||||
|
||||
@@ -152,7 +152,7 @@ export class InstanceForm {
|
||||
this.instance.setVerifierDistance(5);
|
||||
else
|
||||
this.instance.setVerifierDistance(0);
|
||||
this.instance.setLayer(parseInt(response.formValues[2]));
|
||||
this.instance.setLayer(parseInt(response.formValues[3]));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -40,10 +40,10 @@ export class InstanceFormBuilder {
|
||||
static buildSettings(instance) {
|
||||
return new ModalFormData()
|
||||
.title(MenuFormBuilder.menuTitle)
|
||||
.toggle('Block Validation', { defaultValue: instance.options.verifier.isEnabled, tooltip: 'Shows missing and incorrect block overlay.' })
|
||||
.toggle('Distance-Based Block Validation', { defaultValue: instance.verifier.getTrackPlayerDistance() !== 0, tooltip: 'If enabled, the verifier will only check blocks within a certain distance from the player.' })
|
||||
.label('Use the slider to select the layer. Use 0 for all layers.')
|
||||
.toggle('Block Validation', instance.options.verifier.isEnabled)
|
||||
.toggle('Distance-Based Block Validation', instance.verifier.getTrackPlayerDistance() !== 0)
|
||||
.slider("Layer", 0, instance.getMaxLayer(), 1, instance.getLayer())
|
||||
.slider("Layer", 0, instance.getMaxLayer(), { defaultValue: instance.getLayer(), valueStep: 1 })
|
||||
.submitButton('§2Apply');
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,10 @@ export class MenuForm {
|
||||
const structureId = response.formValues[0];
|
||||
if (structureId === '')
|
||||
return void 0;
|
||||
if (!structureCollection.getWorldStructureIds().includes(structureId)) {
|
||||
this.player.sendMessage(`§cStructure ID '${structureId}' not found. If you're looking for a structure that you put in the structures folder, please restart your world and try again.`);
|
||||
return void 0;
|
||||
}
|
||||
return structureId;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export class MenuFormBuilder {
|
||||
.body('Select an instance:');
|
||||
allInstanceNameForm.button('Builder Settings');
|
||||
structureCollection.getInstanceNames().forEach(instanceName => {
|
||||
allInstanceNameForm.button(`§2${instanceName}`);
|
||||
allInstanceNameForm.button(`${structureCollection.get(instanceName).isEnabled() ? '§2' : '§c'}${instanceName}`);
|
||||
});
|
||||
allInstanceNameForm.button('Create New Instance');
|
||||
return allInstanceNameForm;
|
||||
|
||||
@@ -103,8 +103,11 @@ export class StructureVerifier {
|
||||
} else {
|
||||
for (const job of Object.values(this.#populateJob))
|
||||
system.clearJob(job);
|
||||
for (const player of this.instance.getDimension().getPlayers())
|
||||
for (const player of this.instance.getDimension().getPlayers()) {
|
||||
if (!player)
|
||||
continue;
|
||||
this.#populateJob[player.id] = system.runJob(this.populateActiveLocationsNearPlayer(player));
|
||||
}
|
||||
const checker = system.runInterval(() => {
|
||||
if (this.isLocationPopulationComplete) {
|
||||
system.clearRun(checker);
|
||||
|
||||
Reference in New Issue
Block a user