Skip to content

Commit

Permalink
Added mc tweak disableF3BEntityFacingVector and `f3BEntityFacingVec…
Browse files Browse the repository at this point in the history
…torLength`
  • Loading branch information
Fallen-Breath committed Jul 20, 2024
1 parent 9eb8dc6 commit 0bd621e
Show file tree
Hide file tree
Showing 9 changed files with 238 additions and 1 deletion.
24 changes: 24 additions & 0 deletions docs/document-en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,17 @@ that it may take up to 60gt for the entity's position / angles to be correctly d
- Default value: `false`


### disableF3BEntityFacingVector

Disable the rendered entity facing vector line when F3 + B is on

See also: option f3BEntityFacingVectorLength

- Category: MC Tweaks
- Type: hotkey togglable boolean (Tweak)
- Default value: *no hotkey*, `false`


### disableHorizonShadingRendering

Prevent the horizon from turning dark when you are nearby the world's bottom y
Expand Down Expand Up @@ -1423,6 +1434,19 @@ when the light level at player's eyes is not the maximum light level
- Default value: *no hotkey*, `false`


### f3BEntityFacingVectorLength

Adjust the length of the rendered entity facing vector line when F3 + B is on

See also: option disableF3BEntityFacingVector

- Category: MC Tweaks
- Type: double (Generic)
- Default value: `2.0`
- Minimum value: `0.0`
- Maximum value: `16.0`


### f3IUseRelatedCoordinate

Use related coordinate "~ ~ ~" in the command copied by F3 + I
Expand Down
24 changes: 24 additions & 0 deletions docs/document-zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,17 @@ schematicBlockPlacement的严格模式
- 默认值: `false`


### 禁用F3+B实体朝向线段渲染 (disableF3BEntityFacingVector)

在启用F3+B实体碰撞箱显示后,禁用渲染代表实体朝向的线段

另见:选项 F3+B实体朝向线段长度

- 分类: MC修改
- 类型: 带热键布尔值 (工具)
- 默认值: *无快捷键*, `false`


### 禁用地平线渲染变暗 (disableHorizonShadingRendering)

阻止地平线在玩家接近世界最低y值时变暗的渲染效果
Expand Down Expand Up @@ -1419,6 +1430,19 @@ schematicBlockPlacement的严格模式
- 默认值: *无快捷键*, `false`


### F3+B实体朝向线段长度 (f3BEntityFacingVectorLength)

在启用F3+B实体碰撞箱显示后,调整代表实体朝向的线段的长度

另见:选项 禁用F3+B实体朝向线段渲染

- 分类: MC修改
- 类型: 实数 (通用)
- 默认值: `2.0`
- 最小值: `0.0`
- 最大值: `16.0`


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

在F3+I复制指令时,使用相对坐标 ~ ~ ~
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Mod Properties
mod_id = tweakermore
mod_name = TweakerMore
mod_version = 3.19.0
mod_version = 3.20.0
maven_group = me.fallenbreath
archives_base_name = tweakermore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ public class TweakerMoreConfigs
@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean DISABLE_ENTITY_RENDER_INTERPOLATION_FORCED_SYNC = newConfigBoolean("disableEntityRenderInterpolationForcedSync", false);

@Config(type = Config.Type.TWEAK, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBooleanHotkeyed DISABLE_F3_B_ENTITY_FACING_VECTOR = newConfigBooleanHotkeyed("disableF3BEntityFacingVector");

@Config(type = Config.Type.DISABLE, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBooleanHotkeyed DISABLE_HORIZON_SHADING_RENDERING = newConfigBooleanHotkeyed("disableHorizonShadingRendering");

Expand Down Expand Up @@ -491,6 +494,9 @@ public class TweakerMoreConfigs
@Config(type = Config.Type.TWEAK, restriction = @Restriction(require = @Condition(ModIds.replay_mod)), category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBooleanHotkeyed FLAWLESS_FRAMES = newConfigBooleanHotkeyed("flawlessFrames");

@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_I_USE_RELATED_COORDINATE = newConfigBoolean("f3IUseRelatedCoordinate", false);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* 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.disableF3BEntityFacingVector;

import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

//#if MC >= 12100
//$$ import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
//$$ import net.minecraft.client.render.VertexConsumer;
//$$ import net.minecraft.client.util.math.MatrixStack;
//$$ import net.minecraft.util.math.Vec3d;
//$$ import org.joml.Vector3f;
//#else
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//#endif

@Mixin(EntityRenderDispatcher.class)
public abstract class EntityRenderDispatcherMixin
{
//#if MC >= 12100
//$$ @WrapWithCondition(
//#else
@Inject(
//#endif
method = "renderHitbox",
at = @At(
value = "INVOKE",
//#if MC >= 12100
//$$ target = "Lnet/minecraft/client/render/entity/EntityRenderDispatcher;drawVector(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lorg/joml/Vector3f;Lnet/minecraft/util/math/Vec3d;I)V",
//#else
target = "Lnet/minecraft/entity/Entity;getRotationVec(F)Lnet/minecraft/util/math/Vec3d;",
//#endif
ordinal = 0
)
//#if MC < 12100
, cancellable = true
//#endif
)
//#if MC >= 12100
//$$ private static boolean f3BDisableFacingVector_cancelCall(MatrixStack matrixStack, VertexConsumer vertexConsumer, Vector3f vector3f, Vec3d vec3d, int i)
//$$ {
//$$ return !TweakerMoreConfigs.DISABLE_F3_B_ENTITY_FACING_VECTOR.getBooleanValue();
//$$ }
//#else

private
//#if MC >= 11700
//$$ static
//#endif
void f3BDisableFacingVector_cancelFollowingStuffs(CallbackInfo ci)
{
if (TweakerMoreConfigs.DISABLE_F3_B_ENTITY_FACING_VECTOR.getBooleanValue())
{
ci.cancel();
}
}

//#endif // if MC >= 12100
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* 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.f3BEntityFacingVectorLength;

import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Slice;

//#if MC >= 12100
//$$ import org.spongepowered.asm.mixin.injection.ModifyArg;
//#else
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
//#endif

@Mixin(EntityRenderDispatcher.class)
public abstract class EntityRenderDispatcherMixin
{
//#if MC >= 12100
//$$ @ModifyArg(
//#else
@ModifyExpressionValue(
//#endif
method = "renderHitbox",
slice = @Slice(
from = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/Entity;getRotationVec(F)Lnet/minecraft/util/math/Vec3d;",
ordinal = 0
)
),
at = @At(
//#if MC >= 12100
//$$ value = "INVOKE",
//$$ target = "Lnet/minecraft/util/math/Vec3d;multiply(D)Lnet/minecraft/util/math/Vec3d;",
//$$ ordinal = 0
//#else
value = "CONSTANT",
args = "doubleValue=2.0d"
//#endif
)
//#if MC < 12100
, require = 3
, allow = 3
//#endif
)
private
//#if MC >= 11700
//$$ static
//#endif
double f3BDisableFacingVector_tweakLength(double len)
{
if (TweakerMoreConfigs.F3_B_ENTITY_FACING_VECTOR_LENGTH.isModified())
{
len = Math.max(0, TweakerMoreConfigs.F3_B_ENTITY_FACING_VECTOR_LENGTH.getDoubleValue());
}
return len;
}
}
11 changes: 11 additions & 0 deletions src/main/resources/assets/tweakermore/lang/en_us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,12 @@ tweakermore:
Always set entity's position / angles directly, when receives position / angles update packets of creatures / vehicles
This may resolve the issue when using carpet mod's /tick [freeze|step] command,
that it may take up to 60gt for the entity's position / angles to be correctly displayed on the client side.
disableF3BEntityFacingVector:
.: disableF3BEntityFacingVector
comment: |-
Disable the rendered entity facing vector line when F3 + B is on
See also: option @option#f3BEntityFacingVectorLength@
pretty_name: Disable F3+B Entity Facing Vector
disableHorizonShadingRendering:
.: disableHorizonShadingRendering
comment: |-
Expand Down Expand Up @@ -565,6 +571,11 @@ tweakermore:
using the logic from replay mod which is used in its rendering tasks
WARNING: Expect client lag spike with enabled
pretty_name: Flawless Frames
f3BEntityFacingVectorLength:
.: f3BEntityFacingVectorLength
comment: |-
Adjust the length of the rendered entity facing vector line when F3 + B is on
See also: option @option#disableF3BEntityFacingVector@
f3IUseRelatedCoordinate:
.: f3IUseRelatedCoordinate
comment: |-
Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/assets/tweakermore/lang/zh_cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,12 @@ tweakermore:
在客户端接收到生物/载具的位置/朝向更新数据包时,总是直接设置该实体的位置/朝向
这可缓解在carpet mod的/tick [freeze|step]操作下,
可能需要等待最长60gt,才能在客户端正确显示实体位置/朝向的问题
disableF3BEntityFacingVector:
.: 禁用F3+B实体朝向线段渲染
comment: |-
在启用F3+B实体碰撞箱显示后,禁用渲染代表实体朝向的线段
另见:选项 @option#f3BEntityFacingVectorLength@
pretty_name: 禁用F3+B实体朝向线段渲染
disableHorizonShadingRendering:
.: 禁用地平线渲染变暗
comment: |-
Expand Down Expand Up @@ -565,6 +571,11 @@ tweakermore:
借用了Replay模组渲染各种任务时所使用的逻辑
警告:这可能会让客户端频繁地卡顿
pretty_name: 无瑕世界渲染
f3BEntityFacingVectorLength:
.: F3+B实体朝向线段长度
comment: |-
在启用F3+B实体碰撞箱显示后,调整代表实体朝向的线段的长度
另见:选项 @option#disableF3BEntityFacingVector@
f3IUseRelatedCoordinate:
.: F3+I使用相对坐标
comment: |-
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/tweakermore.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"tweaks.mc_tweaks.disableEntityRenderInterpolation.BoatEntityMixin",
"tweaks.mc_tweaks.disableEntityRenderInterpolation.LivingEntityMixin",
"tweaks.mc_tweaks.disableEntityRenderInterpolation.WorldRendererMixin",
"tweaks.mc_tweaks.disableF3BEntityFacingVector.EntityRenderDispatcherMixin",
"tweaks.mc_tweaks.disableHorizonShadingRendering.BackgroundRendererMixin",
"tweaks.mc_tweaks.disableLightUpdates.ClientChunkManagerMixin",
"tweaks.mc_tweaks.disableLightUpdates.LightingProviderMixin",
Expand All @@ -113,6 +114,7 @@
"tweaks.mc_tweaks.disableSlimeBlockBouncing.SlimeBlockMixin",
"tweaks.mc_tweaks.disableTiltViewWhenHurt.GameRendererMixin",
"tweaks.mc_tweaks.disableVignetteDarkness.InGameHudMixin",
"tweaks.mc_tweaks.f3BEntityFacingVectorLength.EntityRenderDispatcherMixin",
"tweaks.mc_tweaks.f3IUseRelatedCoordinate.KeyboardMixin",
"tweaks.mc_tweaks.fakeNightVision.GameRendererMixin",
"tweaks.mc_tweaks.fakeNightVision.LivingEntityMixin",
Expand Down

0 comments on commit 0bd621e

Please sign in to comment.