forked from GrimAnticheat/Grim
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for entities that players can hit through blocking reach/attack r…
…ay trace
- Loading branch information
Showing
6 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/main/java/ac/grim/grimac/utils/data/packetentity/PacketEntityArmorStand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package ac.grim.grimac.utils.data.packetentity; | ||
|
||
import ac.grim.grimac.player.GrimPlayer; | ||
import com.github.retrooper.packetevents.protocol.entity.type.EntityType; | ||
|
||
import java.util.UUID; | ||
|
||
public class PacketEntityArmorStand extends PacketEntity { | ||
|
||
public static final int MARKER_FLAG = 16; | ||
|
||
boolean isMarker; | ||
|
||
public PacketEntityArmorStand(GrimPlayer player, UUID uuid, EntityType type, double x, double y, double z, int extraData) { | ||
super(player, uuid, type, x, y, z); | ||
isMarker = (extraData & MARKER_FLAG) != 0; | ||
} | ||
|
||
@Override | ||
public boolean canHit() { | ||
return !isMarker; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/ac/grim/grimac/utils/data/packetentity/PacketEntityArrow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ac.grim.grimac.utils.data.packetentity; | ||
|
||
import ac.grim.grimac.player.GrimPlayer; | ||
import com.github.retrooper.packetevents.protocol.entity.type.EntityType; | ||
|
||
import java.util.UUID; | ||
|
||
public class PacketEntityArrow extends PacketEntity { | ||
|
||
public PacketEntityArrow(GrimPlayer player, UUID uuid, EntityType type, double x, double y, double z) { | ||
super(player, uuid, type, x, y, z); | ||
} | ||
|
||
@Override | ||
public boolean canHit() { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters