Skip to content

Commit

Permalink
Add mc tweak f3GSimplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Nov 30, 2024
1 parent a72d602 commit 6a8a0a5
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/document-en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,15 @@ See also: option disableF3BEntityFacingVector
- Maximum value: `16.0`


### f3GSimplify

Disable the yellow / blue lines in the chunk section boundary rendering when F3+G is on

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


### f3IUseRelatedCoordinate

Use related coordinate "~ ~ ~" in the command copied by F3 + I
Expand Down
9 changes: 9 additions & 0 deletions docs/document-zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,15 @@ schematicBlockPlacement的严格模式
- 最大值: `16.0`


### F3+G简化显示 (f3GSimplify)

禁用F3+G的区块边界渲染里的黄色/青色线条,只保留区段/区块的边界线

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


### F3+I使用相对坐标 (f3IUseRelatedCoordinate)

在F3+I复制指令时,使用相对坐标 ~ ~ ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ public class TweakerMoreConfigs
@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigDouble F3_B_ENTITY_FACING_VECTOR_LENGTH = newConfigDouble("f3BEntityFacingVectorLength", 2.0, 0, 16);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean F3_G_SIMPLIFY = newConfigBoolean("f3GSimplify", false);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean F3_I_USE_RELATED_COORDINATE = newConfigBoolean("f3IUseRelatedCoordinate", false);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* This file is part of the TweakerMore project, licensed under the
* GNU Lesser General Public License v3.0
*
* Copyright (C) 2024 Fallen_Breath and contributors
*
* TweakerMore is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TweakerMore is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with TweakerMore. If not, see <https://www.gnu.org/licenses/>.
*/

package me.fallenbreath.tweakermore.mixins.tweaks.mc_tweaks.f3GSimplify;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import net.minecraft.client.render.debug.ChunkBorderDebugRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(ChunkBorderDebugRenderer.class)
public abstract class ChunkBorderDebugRendererMixin
{
@ModifyExpressionValue(
method = "render",
at = {
@At(value = "CONSTANT", args = "intValue=16", ordinal = 0),
@At(value = "CONSTANT", args = "intValue=16", ordinal = 1),
//#if MC >= 11700
//$$ @At(
//$$ value = "INVOKE",
//$$ target = "Lnet/minecraft/client/world/ClientWorld;getTopY()I",
//$$ ordinal = 1
//$$ ),
//#else
@At(value = "CONSTANT", args = "intValue=256", ordinal = 0),
//#endif
}
)
private int f3GSimplify_dontRenderYellowLine(int forLoopUpperLimit)
{
if (TweakerMoreConfigs.F3_G_SIMPLIFY.getBooleanValue())
{
forLoopUpperLimit = -1;
}
return forLoopUpperLimit;
}
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/tweakermore/lang/en_us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@ tweakermore:
comment: |-
Adjust the length of the rendered entity facing vector line when F3 + B is on
See also: option @option#disableF3BEntityFacingVector@
f3GSimplify:
.: f3GSimplify
comment: Disable the yellow / blue lines in the chunk section boundary rendering when F3+G is on
f3IUseRelatedCoordinate:
.: f3IUseRelatedCoordinate
comment: |-
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/tweakermore/lang/zh_cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@ tweakermore:
comment: |-
在启用F3+B实体碰撞箱显示后,调整代表实体朝向的线段的长度
另见:选项 @option#disableF3BEntityFacingVector@
f3GSimplify:
.: F3+G简化显示
comment: 禁用F3+G的区块边界渲染里的黄色/青色线条,只保留区段/区块的边界线
f3IUseRelatedCoordinate:
.: F3+I使用相对坐标
comment: |-
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/tweakermore.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
"util.render.TextHandlerAccessor"
],
"client": [
"tweaks.mc_tweaks.f3GSimplify.ChunkBorderDebugRendererMixin",
"tweaks.mc_tweaks.f3TextScale.DebugHudMixin"
],
"injectors": {
Expand Down

0 comments on commit 6a8a0a5

Please sign in to comment.