From 5e629eb525380ecb6702589140ed65b2c88a8d8f Mon Sep 17 00:00:00 2001 From: ChenCMD Date: Tue, 8 Mar 2022 06:24:03 +0900 Subject: [PATCH] :memo: Update README --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README_ja.md | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 756fbab..8693484 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,11 @@ This extension provides several useful features for Datapack development. - [Creating a datapack template](#creating-a-datapack-template) - [Copy resourcePath](#copy-resourcepath) - [Quick file creation](#quick-file-creation) + - [Batch input of multiple lines](#batch-input-of-multiple-lines) + - [Strings](#strings) + - [Datapack tag](#datapack-tag) + - [Consecutive values](#consecutive-values) + - [Expression](#expression) - [Converting formulas to score operation](#converting-formulas-to-score-operation) - [Recommendations](#recommendations) - [Special Thanks](#special-thanks) @@ -70,6 +75,53 @@ You can create a file with the contents described by describing it. ![gif](https://raw.githubusercontent.com/ChenCMD/MC-Datapack-Utility/master/images/createFile.gif) +## Batch input of multiple lines + +Having trouble describing multiple lines with some regularity? + +Press `Alt + Shift + D -> Alt + Shift + M`. +This function allows you to generate multiple lines at the cursor position by simply answering a few questions. + +Depending on your choice, the method of replacing the `%r` in the first question will change. Here are the types + +### Strings + +Replace `%r` with any string. +The input string is interpreted line by line and replaced. + +Note that this substitution method behaves differently depending on the number of cursors. + +#### Difference in behavior when generating depending on the number of cursors + +| Behavior with a single cursor | Behavior with multiple cursors | +| :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Generate as many input lines as there are starting with the cursor line | If the number of input lines and the number of cursors are different:
input content is generated at each location
If the number of input lines and the number of cursors are the same:
input content is generated one line at a time in the order of cursor placement. | + +### Datapack tag + +Replace `%r` with the data pack tag `values`. + +Note that this substitution method behaves differently depending on the number of cursors. + +#### Difference in behavior when generating depending on the number of cursors + +| Behavior with a single cursor | Behavior with multiple cursors | +| :------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Generate as many tag elements as there are, starting with the cursor line | If the number of tag elements and the cursor are different:
a tag element is generated at each location
If the number of tag elements and the cursor are the same:
a tag element is generated one line at a time in the order in which the cursor is placed. | + +### Consecutive values + +Replace `%r` with a constant, continuous value. + +Note: If the `Length to pad the value at the beginning` is `-1`, no prefill is performed. + +### Expression + +Replace `%r` with the value calculated from the expression. +`Math.min(,)`, `Math.floor()`, etc. are available. + +Note: If the `Length to pad the value at the beginning` is `-1`, no prefill is performed. + ## Converting formulas to score operation Too much trouble creating a formula in the scoreboard players operation? diff --git a/README_ja.md b/README_ja.md index e29e0c0..a83089f 100644 --- a/README_ja.md +++ b/README_ja.md @@ -77,7 +77,7 @@ MC Datapack UtilityはVSCode Marketplaceからインストールすることが ## 複数行の一括入力 -何らかの規則性のある複数行を記述するのが面倒? +規則性を持った複数行を記述するのが面倒? `Alt + Shift + D -> Alt + Shift + M`を押しましょう。 この機能を使うと、いくつかの質問に答えるだけで複数行をカーソルの位置に生成することができます。