translation complete but not tested

This commit is contained in:
ForestOfLight
2025-12-12 16:38:26 -08:00
Unverified
parent 50f542220d
commit dcc9704078
15 changed files with 168 additions and 89 deletions
+5 -6
View File
@@ -1,16 +1,15 @@
import { BuilderOption } from '../classes/Builder/BuilderOption';
import { BlockPermutation, EntityComponentTypes, EquipmentSlot, GameMode, ItemStack, system, world } from '@minecraft/server';
import { structureCollection } from '../classes/Structure/StructureCollection';
import { bannedBlocks, bannedToValidBlockMap, whitelistedBlockStates, resetToBlockStates, bannedDimensionBlocks,
blockIdToItemStackMap } from '../data';
import { bannedBlocks, bannedToValidBlockMap, whitelistedBlockStates, resetToBlockStates, bannedDimensionBlocks, blockIdToItemStackMap } from '../data';
import { fetchMatchingItemSlot, placeBlock } from '../utils';
import { Builders } from '../classes/Builder/Builders';
const builderOption = new BuilderOption({
identifier: 'easyPlace',
displayName: 'Easy Place',
description: 'Always place the correct structure block.',
howToUse: "Hold the Easy Place item in your offhand and place blocks in a structure to have them be corrected automatically.",
displayName: { translate: 'construct.option.easyplace.name' },
description: { translate: 'construct.option.easyplace.description' },
howToUse: { translate: 'construct.option.easyplace.howto' },
onEnableCallback: (playerId) => giveActionItem(playerId),
onDisableCallback: (playerId) => removeActionItem(playerId)
});
@@ -83,7 +82,7 @@ function shouldPreventAction(player, structureBlock) {
function preventAction(event, player) {
event.cancel = true;
system.run(() => {
player.onScreenDisplay.setActionBar('§cAction prevented by Easy Place.');
player.onScreenDisplay.setActionBar({ translate: 'construct.option.easyplace.actionprevented' });
});
}
+5 -5
View File
@@ -8,15 +8,15 @@ import { Builders } from '../classes/Builder/Builders';
import { Vector } from '../lib/Vector';
const locationsPlacedLastTick = new Set();
const PLAYER_COLLISION_BOX = { width: 0.6, height: 1.8 };
const ACTION_ITEM = 'construct:easy_place';
const PLAYER_COLLISION_BOX = { width: 0.6, height: 1.8 };
const runnerByPlayer = {};
const builderOption = new BuilderOption({
identifier: 'fastEasyPlace',
displayName: 'Fast Easy Place',
description: 'Place correct structure blocks just by clicking on them.',
howToUse: "Hold the Easy Place item in your main hand and use it on missing blocks in a structure to place them.",
displayName: { translate: 'construct.option.fasteasyplace.name' },
description: { translate: 'construct.option.fasteasyplace.description' },
howToUse: { translate: 'construct.option.fasteasyplace.howto' },
onEnableCallback: (playerId) => giveActionItem(playerId),
onDisableCallback: (playerId) => removeActionItem(playerId)
});
@@ -99,7 +99,7 @@ function processEasyPlace(player) {
function preventAction(event, player) {
event.cancel = true;
system.run(() => {
player.onScreenDisplay.setActionBar('§cAction prevented by Easy Place.');
player.onScreenDisplay.setActionBar({ translate: 'construct.option.easyplace.actionprevented' });
});
}
+9 -10
View File
@@ -6,9 +6,9 @@ import { structureCollection } from '../classes/Structure/StructureCollection';
const builderOption = new BuilderOption({
identifier: 'materialGrabber',
displayName: 'Material Grabber',
description: 'Pulls structure items from inventories.',
howToUse: "Interact with inventories using the Material Grabber item to pull structure items from them.",
displayName: { translate: 'construct.option.materialgrabber.name' },
description: { translate: 'construct.option.materialgrabber.description' },
howToUse: { translate: 'construct.option.materialgrabber.howto' },
onEnableCallback: (playerId) => giveActionItem(playerId),
onDisableCallback: (playerId) => removeActionItem(playerId)
});
@@ -113,13 +113,12 @@ function ignoreAlreadyGathered(materials, playerContainer) {
}
function sendTransferMessage(player, transferCount) {
if (transferCount === 0) {
player.onScreenDisplay.setActionBar('§7Grabbed 0 items.');
} else if (transferCount === 1) {
player.onScreenDisplay.setActionBar('§aGrabbed 1 item.');
} else {
player.onScreenDisplay.setActionBar(`§aGrabbed ${transferCount} item(s).`);
}
if (transferCount === 0)
player.onScreenDisplay.setActionBar({ translate: 'construct.option.materialgrabber.grabbed.zero' });
else if (transferCount === 1)
player.onScreenDisplay.setActionBar({ translate: 'construct.option.materialgrabber.grabbed.one' });
else
player.onScreenDisplay.setActionBar({ translate: 'construct.option.materialgrabber.grabbed.many', with: [String(transferCount)] });
}
function tryTransferToPlayer(slot, playerContainer, materials) {