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

remove unnecessary verbose in CrashD #1861

Open
wants to merge 1 commit into
base: 2.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/main/java/ac/grim/grimac/checks/impl/crash/CrashD.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientClickWindow;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerOpenWindow;

@CheckData(name = "CrashD", experimental = false)
@CheckData(name = "CrashD")
public class CrashD extends Check implements PacketCheck {

public CrashD(GrimPlayer playerData) {
super(playerData);
}
Expand All @@ -35,13 +34,10 @@ public void onPacketSend(final PacketSendEvent event) {
@Override
public void onPacketReceive(final PacketReceiveEvent event) {
if (event.getPacketType() == PacketType.Play.Client.CLICK_WINDOW && isSupportedVersion()) {
WrapperPlayClientClickWindow click = new WrapperPlayClientClickWindow(event);
int clickType = click.getWindowClickType().ordinal();
int button = click.getButton();
int windowId = click.getWindowId();
int windowId = new WrapperPlayClientClickWindow(event).getWindowId();

if (type == MenuType.LECTERN && windowId > 0 && windowId == lecternId) {
if (flagAndAlert("clickType=" + clickType + " button=" + button)) {
if (flagAndAlert()) {
event.setCancelled(true);
player.onPacketCancel();
}
Expand All @@ -52,5 +48,4 @@ public void onPacketReceive(final PacketReceiveEvent event) {
private boolean isSupportedVersion() {
return PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_1_14);
}

}