generated from Fallen-Breath/fabric-mod-template
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added mc tweak
disableF3BEntityFacingVector
and `f3BEntityFacingVec…
…torLength`
- Loading branch information
1 parent
9eb8dc6
commit 0bd621e
Showing
9 changed files
with
238 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...ore/mixins/tweaks/mc_tweaks/disableF3BEntityFacingVector/EntityRenderDispatcherMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
78 changes: 78 additions & 0 deletions
78
...more/mixins/tweaks/mc_tweaks/f3BEntityFacingVectorLength/EntityRenderDispatcherMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters