Skip to content

Commit

Permalink
option rename: add the "box" word to some shulker box item options
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Mar 13, 2024
1 parent 4a76b36 commit 41d4766
Show file tree
Hide file tree
Showing 23 changed files with 92 additions and 90 deletions.
File renamed without changes
22 changes: 11 additions & 11 deletions docs/document-en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ Set to "Game tick" to keep vanilla behavior
- Available options: `MSPT (vanilla)`, `Average MSPT per second`, `Maximum MSPT per second`, `Average MSPT per minute`, `Maximum MSPT per minute`


### shulkerItemContentHint
### shulkerBoxItemContentHint

Show a hint of content of shulker box item at the lower-left corner of the shulker box

Expand All @@ -1640,12 +1640,12 @@ if the shulker box is neither completely full nor empty
- Type: boolean (Generic)
- Default value: `false`

![shulkerItemContentHint](assets/shulkerItemContentHint.png)
![shulkerBoxItemContentHint](assets/shulkerBoxItemContentHint.png)


### shulkerItemContentHintScale
### shulkerBoxItemContentHintScale

The scale of the hint stuffs in option shulkerItemContentHint
The scale of the hint stuffs in option shulkerBoxItemContentHint

- Category: MC Tweaks
- Type: double (Generic)
Expand All @@ -1654,29 +1654,29 @@ The scale of the hint stuffs in option shulkerItemContentHint
- Maximum value: `1.0`


### shulkerTooltipEnchantmentHint
### shulkerBoxTooltipEnchantmentHint

Display enchantments of items in the tooltip of shulker box items

- Category: MC Tweaks
- Type: boolean (Generic)
- Default value: `false`

![shulkerTooltipEnchantmentHint](assets/shulkerTooltipEnchantmentHint-en_us.png)
![shulkerBoxTooltipEnchantmentHint](assets/shulkerBoxTooltipEnchantmentHint-en_us.png)


### shulkerTooltipFillLevelHint
### shulkerBoxTooltipFillLevelHint

Display content fill level in first line of the tooltip of shulker box items

- Category: MC Tweaks
- Type: boolean (Generic)
- Default value: `false`

![shulkerTooltipFillLevelHint](assets/shulkerTooltipFillLevelHint-en_us.png)
![shulkerBoxTooltipFillLevelHint](assets/shulkerBoxTooltipFillLevelHint-en_us.png)


### shulkerTooltipHintLengthLimit
### shulkerBoxTooltipHintLengthLimit

The text length limit used during displaying extra information of items in the tooltip of shulker box items

Expand All @@ -1689,15 +1689,15 @@ When exceed, remaining information will be folded
- Maximum value: `600`


### shulkerTooltipPotionInfoHint
### shulkerBoxTooltipPotionInfoHint

Display potion information of items in the tooltip of shulker box items

- Category: MC Tweaks
- Type: boolean (Generic)
- Default value: `false`

![shulkerTooltipPotionInfoHint](assets/shulkerTooltipPotionInfoHint-en_us.png)
![shulkerBoxTooltipPotionInfoHint](assets/shulkerBoxTooltipPotionInfoHint-en_us.png)


### signEditScreenCancelButton
Expand Down
20 changes: 10 additions & 10 deletions docs/document-zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ Format error: 修复使用原版聊天缩放设置来缩放聊天信息HUD中的
- 可用选项: `MSPT (原版)`, `每秒MSPT平均值`, `每秒MSPT最大值`, `每分钟MSPT平均值`, `每分钟MSPT最大值`


### 潜影盒物品内容提示 (shulkerItemContentHint)
### 潜影盒物品内容提示 (shulkerBoxItemContentHint)

在渲染潜影盒物品时,在潜影盒的左下角显示一个盒中内容的提示

Expand All @@ -1636,10 +1636,10 @@ Format error: 修复使用原版聊天缩放设置来缩放聊天信息HUD中的
- 类型: 布尔值 (通用)
- 默认值: `false`

![shulkerItemContentHint](assets/shulkerItemContentHint.png)
![shulkerBoxItemContentHint](assets/shulkerBoxItemContentHint.png)


### 潜影盒物品内容提示-缩放 (shulkerItemContentHintScale)
### 潜影盒物品内容提示-缩放 (shulkerBoxItemContentHintScale)

选项潜影盒物品内容提示内容提示的缩放比例

Expand All @@ -1650,29 +1650,29 @@ Format error: 修复使用原版聊天缩放设置来缩放聊天信息HUD中的
- 最大值: `1.0`


### 潜影盒物品附魔提示 (shulkerTooltipEnchantmentHint)
### 潜影盒物品附魔提示 (shulkerBoxTooltipEnchantmentHint)

在潜影盒物品的工具提示中显示物品的附魔

- 分类: MC修改
- 类型: 布尔值 (通用)
- 默认值: `false`

![shulkerTooltipEnchantmentHint](assets/shulkerTooltipEnchantmentHint-zh_cn.png)
![shulkerBoxTooltipEnchantmentHint](assets/shulkerBoxTooltipEnchantmentHint-zh_cn.png)


### 潜影盒物品填充率提示 (shulkerTooltipFillLevelHint)
### 潜影盒物品填充率提示 (shulkerBoxTooltipFillLevelHint)

在潜影盒物品工具提示的第一行显示其内容物填充率

- 分类: MC修改
- 类型: 布尔值 (通用)
- 默认值: `false`

![shulkerTooltipFillLevelHint](assets/shulkerTooltipFillLevelHint-zh_cn.png)
![shulkerBoxTooltipFillLevelHint](assets/shulkerBoxTooltipFillLevelHint-zh_cn.png)


### 潜影盒物品提示长度限制 (shulkerTooltipHintLengthLimit)
### 潜影盒物品提示长度限制 (shulkerBoxTooltipHintLengthLimit)

在显示潜影盒工具提示中的额外信息时,文本长度的限制

Expand All @@ -1685,15 +1685,15 @@ Format error: 修复使用原版聊天缩放设置来缩放聊天信息HUD中的
- 最大值: `600`


### 潜影盒物品药水提示 (shulkerTooltipPotionInfoHint)
### 潜影盒物品药水提示 (shulkerBoxTooltipPotionInfoHint)

在潜影盒物品的工具提示中显示物品提供的药水效果

- 分类: MC修改
- 类型: 布尔值 (通用)
- 默认值: `false`

![shulkerTooltipPotionInfoHint](assets/shulkerTooltipPotionInfoHint-zh_cn.png)
![shulkerBoxTooltipPotionInfoHint](assets/shulkerBoxTooltipPotionInfoHint-zh_cn.png)


### 告示牌编辑界面取消按钮 (signEditScreenCancelButton)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,22 +525,22 @@ public class TweakerMoreConfigs
public static final TweakerMoreConfigDouble SCOREBOARD_SIDE_BAR_SCALE = newConfigDouble("scoreboardSideBarScale", 1, 0.001, 2);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean SHULKER_ITEM_CONTENT_HINT = newConfigBoolean("shulkerItemContentHint", false);
public static final TweakerMoreConfigBoolean SHULKER_BOX_ITEM_CONTENT_HINT = newConfigBoolean("shulkerBoxItemContentHint", false);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigDouble SHULKER_ITEM_CONTENT_HINT_SCALE = newConfigDouble("shulkerItemContentHintScale", 0.5, 0.01, 1);
public static final TweakerMoreConfigDouble SHULKER_BOX_ITEM_CONTENT_HINT_SCALE = newConfigDouble("shulkerBoxItemContentHintScale", 0.5, 0.01, 1);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean SHULKER_TOOLTIP_ENCHANTMENT_HINT = newConfigBoolean("shulkerTooltipEnchantmentHint", false);
public static final TweakerMoreConfigBoolean SHULKER_BOX_TOOLTIP_ENCHANTMENT_HINT = newConfigBoolean("shulkerBoxTooltipEnchantmentHint", false);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean SHULKER_TOOLTIP_FILL_LEVEL_HINT = newConfigBoolean("shulkerTooltipFillLevelHint", false);
public static final TweakerMoreConfigBoolean SHULKER_BOX_TOOLTIP_FILL_LEVEL_HINT = newConfigBoolean("shulkerBoxTooltipFillLevelHint", false);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigInteger SHULKER_TOOLTIP_HINT_LENGTH_LIMIT = newConfigInteger("shulkerTooltipHintLengthLimit", 120, 0, 600);
public static final TweakerMoreConfigInteger SHULKER_BOX_TOOLTIP_HINT_LENGTH_LIMIT = newConfigInteger("shulkerBoxTooltipHintLengthLimit", 120, 0, 600);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean SHULKER_TOOLTIP_POTION_INFO_HINT = newConfigBoolean("shulkerTooltipPotionInfoHint", false);
public static final TweakerMoreConfigBoolean SHULKER_BOX_TOOLTIP_POTION_INFO_HINT = newConfigBoolean("shulkerBoxTooltipPotionInfoHint", false);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean SIGN_MULTILINE_PASTE_SUPPORT = newConfigBoolean("signMultilinePasteSupport", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ public class ConfigRenameMigration
newName = newName.substring(0, 1).toLowerCase() + newName.substring(1);
map.put(oldName, newName);
});

// v3.17: add the "box" word to some shulker box item options
Lists.newArrayList(
"shulkerItemContentHint",
"shulkerItemContentHintScale",
"shulkerTooltipEnchantmentHint",
"shulkerTooltipFillLevelHint",
"shulkerTooltipHintLengthLimit",
"shulkerTooltipPotionInfoHint"
).forEach(oldName -> {
String newName = oldName.replaceFirst("^shulker", "shulkerBox");
map.put(oldName, newName);
});
});

public static Optional<String> oldToNew(String oldConfigName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with TweakerMore. If not, see <https://www.gnu.org/licenses/>.
*/

package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerItemContentHint;
package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxItemContentHint;

import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import me.fallenbreath.tweakermore.util.InventoryUtil;
Expand All @@ -28,7 +28,7 @@

import java.util.Optional;

public class ShulkerItemContentHintCommon
public class ShulkerBoxItemContentHintCommon
{
public static class Info
{
Expand All @@ -43,11 +43,11 @@ public static Info prepareInformation(ItemStack itemStack)
{
Info info = new Info();
info.enabled = false;
if (!TweakerMoreConfigs.SHULKER_ITEM_CONTENT_HINT.getBooleanValue())
if (!TweakerMoreConfigs.SHULKER_BOX_ITEM_CONTENT_HINT.getBooleanValue())
{
return info;
}
if (ShulkerItemContentHintRenderer.isRendering.get()) // no hint if it's rendering our hint item
if (ShulkerBoxItemContentHintRenderer.isRendering.get()) // no hint if it's rendering our hint item
{
return info;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ else if (!(ItemStack.areItemsEqual(stack, std) && ItemStack.areTagsEqual(stack,
}

info.stack = std;
info.scale = TweakerMoreConfigs.SHULKER_ITEM_CONTENT_HINT_SCALE.getDoubleValue();
info.scale = TweakerMoreConfigs.SHULKER_BOX_ITEM_CONTENT_HINT_SCALE.getDoubleValue();
if (info.scale <= 0)
{
return info;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with TweakerMore. If not, see <https://www.gnu.org/licenses/>.
*/

package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerItemContentHint;
package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxItemContentHint;

import me.fallenbreath.tweakermore.util.render.ColorHolder;
import me.fallenbreath.tweakermore.util.render.context.RenderContext;
Expand Down Expand Up @@ -49,7 +49,7 @@
//$$ import com.mojang.blaze3d.platform.GlStateManager;
//#endif

public class ShulkerItemContentHintRenderer
public class ShulkerBoxItemContentHintRenderer
{
// the display width of an item slot
private static final int SLOT_WIDTH = 16;
Expand All @@ -67,7 +67,7 @@ public static void render(
ItemStack itemStack, int x, int y
)
{
ShulkerItemContentHintCommon.Info info = ShulkerItemContentHintCommon.prepareInformation(itemStack);
ShulkerBoxItemContentHintCommon.Info info = ShulkerBoxItemContentHintCommon.prepareInformation(itemStack);
if (!info.enabled)
{
return;
Expand Down Expand Up @@ -150,7 +150,7 @@ private static void renderMiniItem(
//#else
ItemRenderer itemRenderer,
//#endif
ShulkerItemContentHintCommon.Info info, int x, int y)
ShulkerBoxItemContentHintCommon.Info info, int x, int y)
{
isRendering.set(true);

Expand Down Expand Up @@ -199,7 +199,7 @@ private static void renderQuestionMark(
//#if MC >= 11500
MatrixStack textMatrixStack,
//#endif
double zOffset, ShulkerItemContentHintCommon.Info info, int x, int y
double zOffset, ShulkerBoxItemContentHintCommon.Info info, int x, int y
)
{
String text = "...";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
* along with TweakerMore. If not, see <https://www.gnu.org/licenses/>.
*/

package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerTooltipHints;
package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxTooltipHints;

import com.google.common.collect.ImmutableList;
import fi.dy.masa.malilib.util.InventoryUtils;
import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerTooltipHints.builder.PotionHintBuilder;
import me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerTooltipHints.builder.EnchantmentHintBuilder;
import me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerTooltipHints.builder.AbstractHintBuilder;
import me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxTooltipHints.builder.PotionHintBuilder;
import me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxTooltipHints.builder.EnchantmentHintBuilder;
import me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxTooltipHints.builder.AbstractHintBuilder;
import me.fallenbreath.tweakermore.util.InventoryUtil;
import me.fallenbreath.tweakermore.util.Messenger;
import net.minecraft.client.MinecraftClient;
Expand All @@ -43,7 +43,7 @@
//$$ import net.minecraft.text.MutableText;
//#endif

public class ShulkerToolTipEnhancer
public class ShulkerBoxToolTipEnhancer
{
private static final List<AbstractHintBuilder> HINT_BUILDERS = ImmutableList.of(
new EnchantmentHintBuilder(),
Expand All @@ -67,7 +67,7 @@ public static void appendContentHints(

public static void applyFillLevelHint(ItemStack skulker, List<Text> tooltip)
{
if (TweakerMoreConfigs.SHULKER_TOOLTIP_FILL_LEVEL_HINT.getBooleanValue() && tooltip.size() > 0)
if (TweakerMoreConfigs.SHULKER_BOX_TOOLTIP_FILL_LEVEL_HINT.getBooleanValue() && tooltip.size() > 0)
{
int slotAmount = InventoryUtil.getInventorySlotAmount(skulker);
if (slotAmount == -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with TweakerMore. If not, see <https://www.gnu.org/licenses/>.
*/

package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerTooltipHints.builder;
package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxTooltipHints.builder;

import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import me.fallenbreath.tweakermore.util.Messenger;
Expand Down Expand Up @@ -52,7 +52,7 @@ protected static BaseText buildSegments(List<Text> texts)
}
BaseText extraText = getDivider();

int maxLength = TweakerMoreConfigs.SHULKER_TOOLTIP_HINT_LENGTH_LIMIT.getIntegerValue();
int maxLength = TweakerMoreConfigs.SHULKER_BOX_TOOLTIP_HINT_LENGTH_LIMIT.getIntegerValue();
TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
int idx;
for (idx = 0; idx < amount; idx++)
Expand All @@ -69,7 +69,7 @@ protected static BaseText buildSegments(List<Text> texts)
}
if (idx < amount)
{
extraText.append(Messenger.formatting(Messenger.tr("tweakermore.impl.shulkerTooltipHintBuilder.more", amount - idx), Formatting.GRAY));
extraText.append(Messenger.formatting(Messenger.tr("tweakermore.impl.shulkerBoxTooltipHintBuilder.more", amount - idx), Formatting.GRAY));
}

return extraText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with TweakerMore. If not, see <https://www.gnu.org/licenses/>.
*/

package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerTooltipHints.builder;
package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxTooltipHints.builder;

import com.google.common.collect.Lists;
import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
Expand All @@ -37,7 +37,7 @@ public class EnchantmentHintBuilder extends AbstractHintBuilder
@Nullable
public BaseText build(ItemStack itemStack)
{
if (TweakerMoreConfigs.SHULKER_TOOLTIP_ENCHANTMENT_HINT.getBooleanValue())
if (TweakerMoreConfigs.SHULKER_BOX_TOOLTIP_ENCHANTMENT_HINT.getBooleanValue())
{
List<Text> enchantmentTexts = Lists.newArrayList();
ListTag enchantmentTag = itemStack.getItem() instanceof EnchantedBookItem ? EnchantedBookItem.getEnchantmentTag(itemStack) : itemStack.getEnchantments();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with TweakerMore. If not, see <https://www.gnu.org/licenses/>.
*/

package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerTooltipHints.builder;
package me.fallenbreath.tweakermore.impl.mc_tweaks.shulkerBoxTooltipHints.builder;

import com.google.common.collect.Lists;
import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
Expand All @@ -37,7 +37,7 @@ public class PotionHintBuilder extends AbstractHintBuilder
@Nullable
public BaseText build(ItemStack itemStack)
{
if (TweakerMoreConfigs.SHULKER_TOOLTIP_POTION_INFO_HINT.getBooleanValue())
if (TweakerMoreConfigs.SHULKER_BOX_TOOLTIP_POTION_INFO_HINT.getBooleanValue())
{
Item item = itemStack.getItem();
float ratio = getPotionDurationRatio(item);
Expand Down
Loading

0 comments on commit 41d4766

Please sign in to comment.