Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing verbose for a few checks #1852

Open
wants to merge 6 commits into
base: 2.0
Choose a base branch
from

Conversation

SergioK29
Copy link
Contributor

No description provided.

src/main/java/ac/grim/grimac/checks/impl/crash/CrashA.java Outdated Show resolved Hide resolved
if (flagAndAlert() && shouldModifyPackets() && shouldCancel()) {
double distance = NumberConversions.square(blockPos.getX() - player.x) + NumberConversions.square(blockPos.getY() - player.y) + NumberConversions.square(blockPos.getZ() - player.z);

if (flagAndAlert("against=" + placeAgainst + " type=" + place.getMaterial() + " dist=" + Math.sqrt(distance))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is distance included?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is distance included?

AirLiquidPlace has falsed in the past for me when the player places blocks particularly close to them.

@SamB440 SamB440 added the status: review required The pull request is awaiting review label Dec 4, 2024
@@ -23,7 +24,10 @@ public void onBlockPlace(final BlockPlace place) {
StateType placeAgainst = player.compensatedWorld.getStateTypeAt(blockPos.getX(), blockPos.getY(), blockPos.getZ());

if (placeAgainst.isAir() || Materials.isNoPlaceLiquid(placeAgainst)) { // fail
if (flagAndAlert() && shouldModifyPackets() && shouldCancel()) {
double distance = NumberConversions.square(blockPos.getX() - player.x) + NumberConversions.square(blockPos.getY() - player.y) + NumberConversions.square(blockPos.getZ() - player.z);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't think distance is necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't think distance is necessary

just include it anyways 🙏
AirLiquidPlace has falsed in the past for me when the player places blocks particularly close to them.

@@ -39,7 +39,7 @@ public void onBlockPlace(final BlockPlace place) {
maxReach += Math.hypot(threshold, threshold);

if (min > maxReach * maxReach) { // fail
if (flagAndAlert() && shouldModifyPackets() && shouldCancel()) {
if (flagAndAlert("dist=" + Math.sqrt(min)) && shouldModifyPackets() && shouldCancel()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The amount of decimals shown should be capped

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The amount of decimals shown should be capped

does grim have any easy util methods for this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String.format() is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: review required The pull request is awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants