Skip to content

Commit

Permalink
feature: add vehicle as target for moved wrongly disabled. (disab…
Browse files Browse the repository at this point in the history
…ler.move_wrongly_disabler)
  • Loading branch information
sakurawald committed Jan 3, 2025
1 parent ee6f1b4 commit 7a351ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/chapters/module/disabler/disabler.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Disable \tbf{player moved too quickly} and \tbf{vehicle moved too quickly}.

\LevelThree{move\_wronlgy\_disabler}
Disable \tbf{player moved wrongly}.
Disable \tbf{player moved wrongly} and \tbf{vehicle moved wrongly}.

\begin{warn}{The movement anti-cheat inside vanilla minecraft is bad}
Inside the vanilla minecraft server, there is a checker used to check if the player moves correctly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(ServerPlayNetworkHandler.class)
public abstract class ServerPlayNetworkHandlerMixin {
Expand All @@ -24,4 +26,9 @@ public boolean disablePlayerMovedWrongly(boolean original) {
return true;
}

@ModifyConstant(method = "onVehicleMove", constant = @Constant(doubleValue = 0.0625, ordinal = 1))
public double disableVehicleMovedWrongly(double original) {
return Double.MAX_VALUE;
}

}

0 comments on commit 7a351ca

Please sign in to comment.