Skip to content

Commit

Permalink
style: rename BadPacketsW to BadPacketsV
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayouuuu committed Apr 16, 2024
1 parent e74f494 commit 2858cb9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.item.ItemStack;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientInteractEntity;

@CheckData(name = "BadPacketsW", experimental = true)
public class BadPacketsW extends Check implements PacketCheck {
public BadPacketsW(GrimPlayer player) {
@CheckData(name = "BadPacketsV", experimental = true)
public class BadPacketsV extends Check implements PacketCheck {
public BadPacketsV(GrimPlayer player) {
super(player);
}

@Override
public void onPacketReceive(PacketReceiveEvent event) {
if (player.getClientVersion().isOlderThan(ClientVersion.V_1_9)) return;
if (event.getPacketType() == PacketType.Play.Client.INTERACT_ENTITY) {
WrapperPlayClientInteractEntity interactEntity = new WrapperPlayClientInteractEntity(event);
if (interactEntity.getAction() != WrapperPlayClientInteractEntity.InteractAction.ATTACK) return;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ac/grim/grimac/manager/CheckManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public CheckManager(GrimPlayer player) {
.put(BadPacketsS.class, new BadPacketsS(player))
.put(BadPacketsT.class, new BadPacketsT(player))
.put(BadPacketsU.class, new BadPacketsU(player))
.put(BadPacketsW.class, new BadPacketsW(player))
.put(BadPacketsV.class, new BadPacketsV(player))
.put(FastBreak.class, new FastBreak(player))
.put(TransactionOrder.class, new TransactionOrder(player))
.put(NoSlowB.class, new NoSlowB(player))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void markPlayerSlotAsChanged(int clicked) {
}

public ItemStack getItemInHand(InteractionHand hand) {
return hand == InteractionHand.MAIN_HAND ? getByEquipmentType(EquipmentType.MAINHAND) : getByEquipmentType(EquipmentType.OFFHAND);
return hand == InteractionHand.MAIN_HAND ? getHeldItem() : getOffHand();
}

private void markServerForChangingSlot(int clicked, int windowID) {
Expand Down

0 comments on commit 2858cb9

Please sign in to comment.