Skip to content

Commit 828b6c7

Browse files
committed
Merge branch 'master' into mc-update
# Conflicts: # src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayerEntityMixin.java
2 parents 55dc1d2 + 8875fa6 commit 828b6c7

File tree

15 files changed

+358
-256
lines changed

15 files changed

+358
-256
lines changed

src/main/java/meteordevelopment/meteorclient/commands/commands/FovCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public FovCommand() {
1818

1919
@Override
2020
public void build(LiteralArgumentBuilder<CommandSource> builder) {
21-
builder.then(argument("fov", IntegerArgumentType.integer(0, 180)).executes(context -> {
21+
builder.then(argument("fov", IntegerArgumentType.integer(1, 180)).executes(context -> {
2222
((ISimpleOption) (Object) mc.options.getFov()).meteor$set(context.getArgument("fov", Integer.class));
2323
return SINGLE_SUCCESS;
2424
}));

src/main/java/meteordevelopment/meteorclient/mixin/BlockMixin.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@
99
import meteordevelopment.meteorclient.systems.modules.Modules;
1010
import meteordevelopment.meteorclient.systems.modules.movement.NoSlow;
1111
import meteordevelopment.meteorclient.systems.modules.movement.Slippy;
12-
import meteordevelopment.meteorclient.systems.modules.render.Xray;
1312
import net.minecraft.block.AbstractBlock;
1413
import net.minecraft.block.Block;
15-
import net.minecraft.block.BlockState;
1614
import net.minecraft.block.Blocks;
1715
import net.minecraft.item.ItemConvertible;
18-
import net.minecraft.util.math.Direction;
1916
import org.spongepowered.asm.mixin.Mixin;
2017
import org.spongepowered.asm.mixin.injection.At;
2118

@@ -25,17 +22,6 @@ public BlockMixin(Settings settings) {
2522
super(settings);
2623
}
2724

28-
@ModifyReturnValue(method = "shouldDrawSide", at = @At("RETURN"))
29-
private static boolean onShouldDrawSide(boolean original, BlockState state, BlockState otherState, Direction side) {
30-
Xray xray = Modules.get().get(Xray.class);
31-
32-
if (xray.isActive()) {
33-
return xray.modifyDrawSide(state, otherState, side, original);
34-
}
35-
36-
return original;
37-
}
38-
3925
@ModifyReturnValue(method = "getSlipperiness", at = @At("RETURN"))
4026
public float getSlipperiness(float original) {
4127
// For some retarded reason Tweakeroo calls this method before meteor is initialized

src/main/java/meteordevelopment/meteorclient/mixin/BlockModelRendererMixin.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55

66
package meteordevelopment.meteorclient.mixin;
77

8+
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
9+
import meteordevelopment.meteorclient.systems.modules.Modules;
810
import meteordevelopment.meteorclient.systems.modules.render.Xray;
911
import net.minecraft.block.BlockState;
1012
import net.minecraft.client.render.VertexConsumer;
1113
import net.minecraft.client.render.block.BlockModelRenderer;
1214
import net.minecraft.client.render.model.BlockModelPart;
1315
import net.minecraft.client.util.math.MatrixStack;
1416
import net.minecraft.util.math.BlockPos;
17+
import net.minecraft.util.math.Direction;
1518
import net.minecraft.world.BlockRenderView;
1619
import org.spongepowered.asm.mixin.Mixin;
1720
import org.spongepowered.asm.mixin.Unique;
@@ -41,4 +44,15 @@ private void modifyXrayAlpha(final Args args) {
4144
final int alpha = alphas.get();
4245
args.set(6, alpha == -1 ? args.get(6) : alpha / 255f);
4346
}
47+
48+
@ModifyReturnValue(method = "shouldDrawFace", at = @At("RETURN"))
49+
private static boolean modifyShouldDrawFace(boolean original, BlockRenderView world, BlockState state, boolean cull, Direction side, BlockPos pos) {
50+
Xray xray = Modules.get().get(Xray.class);
51+
52+
if (xray.isActive()) {
53+
return xray.modifyDrawSide(state, world, pos.offset(side.getOpposite()), side, original); // thanks mojang
54+
}
55+
56+
return original;
57+
}
4458
}

src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayerEntityMixin.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import net.minecraft.client.network.AbstractClientPlayerEntity;
2121
import net.minecraft.client.network.ClientPlayerEntity;
2222
import net.minecraft.client.world.ClientWorld;
23+
import net.minecraft.util.PlayerInput;
2324
import org.spongepowered.asm.mixin.Mixin;
2425
import org.spongepowered.asm.mixin.Shadow;
2526
import org.spongepowered.asm.mixin.injection.At;
@@ -80,6 +81,22 @@ private float onHunger(float constant) {
8081
return constant;
8182
}
8283

84+
@ModifyExpressionValue(method = "tick", at = @At(value = "FIELD", target = "Lnet/minecraft/client/input/Input;playerInput:Lnet/minecraft/util/PlayerInput;"))
85+
private PlayerInput isSneaking(PlayerInput original) {
86+
if (Modules.get().get(Sneak.class).doPacket() || Modules.get().get(NoSlow.class).airStrict()) {
87+
return new PlayerInput(
88+
original.forward(),
89+
original.backward(),
90+
original.left(),
91+
original.right(),
92+
original.jump(),
93+
true,
94+
original.sprint()
95+
);
96+
}
97+
return original;
98+
}
99+
83100
@Inject(method = "tickMovement", at = @At("HEAD"))
84101
private void preTickMovement(CallbackInfo ci) {
85102
MeteorClient.EVENT_BUS.post(PlayerTickMovementEvent.get());

src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumBlockOcclusionCacheMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private void onInit(CallbackInfo info) {
3232
@ModifyReturnValue(method = "shouldDrawSide", at = @At("RETURN"))
3333
private boolean shouldDrawSide(boolean original, BlockState state, BlockView view, BlockPos pos, Direction facing) {
3434
if (xray.isActive()) {
35-
return xray.modifyDrawSide(state, view.getBlockState(pos.offset(facing)), facing, original);
35+
return xray.modifyDrawSide(state, view, pos, facing, original);
3636
}
3737

3838
return original;

0 commit comments

Comments
 (0)