Merge remote-tracking branch 'origin/main' into dev
This commit is contained in:
@@ -41,18 +41,19 @@ class BlockInfo {
|
||||
static getBlockMessage(block) {
|
||||
if (!block)
|
||||
return { translate: 'construct.blockinfo.unknown' };
|
||||
const message = { rawtext: [{ text: '§a' }, { translate: block.type.id }]};
|
||||
const message = { rawtext: [{ text: '§a' }, { translate: block.localizationKey }] };
|
||||
const states = block.getAllStates();
|
||||
if (Object.keys(states).length > 0)
|
||||
message.rawtext.push({ text: `\n§7${this.getFormattedStates(states)}` });
|
||||
if (block.isWaterlogged)
|
||||
if (block.isWaterlogged) {
|
||||
message.rawtext.push({ rawtext: [
|
||||
{ text: '\n§7' },
|
||||
{ translate: 'construct.blockinfo.waterlogged' }
|
||||
]});
|
||||
] });
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
static getFormattedStates(states) {
|
||||
return Object.entries(states).map(([key, value]) => `§7${key}: §3${value}`).join('\n');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ActionFormData, ModalFormData } from '@minecraft/server-ui';
|
||||
import { MenuFormBuilder } from '../MenuFormBuilder';
|
||||
import { StructureVerifier } from '../Verifier/StructureVerifier';
|
||||
import { StructureStatistics } from '../Structure/StructureStatistics';
|
||||
import { EntityComponentTypes, TicksPerSecond } from '@minecraft/server';
|
||||
import {EntityComponentTypes, TicksPerSecond, world} from '@minecraft/server';
|
||||
|
||||
export class InstanceFormBuilder {
|
||||
static structureVerifier;
|
||||
@@ -15,10 +15,15 @@ export class InstanceFormBuilder {
|
||||
{ translate: 'construct.instance.menu.body', with: [instance.getName(), instance.getStructureId()] }
|
||||
]};
|
||||
if (instance.hasLocation())
|
||||
body.rawtext.push(...[
|
||||
{ text: '\n' },
|
||||
{ translate: 'construct.instance.menu.location', with: [String(location.location.x), String(location.location.y), String(location.location.z), location.dimensionId] }
|
||||
]);
|
||||
body.rawtext.push(...[
|
||||
{ text: '\n' },
|
||||
{ translate: 'construct.instance.menu.location', with: { rawtext: [
|
||||
{ text:String(location.location.x) },
|
||||
{ text:String(location.location.y) },
|
||||
{ text:String(location.location.z) },
|
||||
{ translate:world.getDimension(location.dimensionId).localizationKey }
|
||||
]} }
|
||||
]);
|
||||
form.body(body);
|
||||
options.forEach(option => {
|
||||
form.button({ translate: option });
|
||||
@@ -29,7 +34,7 @@ export class InstanceFormBuilder {
|
||||
static buildRenameInstance(currentName) {
|
||||
return new ModalFormData()
|
||||
.title(MenuFormBuilder.menuTitle)
|
||||
.textField({ translate: 'construct.isntance.menu.rename' }, currentName)
|
||||
.textField({ translate: 'construct.instance.menu.rename' }, currentName)
|
||||
.submitButton({ translate: 'construct.menu.instance.button.rename' });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user