Skip to content

Commit

Permalink
Merge pull request #1681 from ManInMyVan/fix/rotationplace/spectator-…
Browse files Browse the repository at this point in the history
…mode

fix RotationPlace falses in spectator mode
  • Loading branch information
SamB440 authored Aug 24, 2024
2 parents a38e4bd + e35845c commit b72fafa
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import ac.grim.grimac.utils.nmsutil.ReachUtils;
import com.github.retrooper.packetevents.protocol.attribute.Attributes;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.protocol.player.GameMode;
import com.github.retrooper.packetevents.protocol.world.BlockFace;
import com.github.retrooper.packetevents.protocol.world.states.type.StateTypes;
import com.github.retrooper.packetevents.util.Vector3d;
Expand All @@ -33,6 +34,7 @@ public RotationPlace(GrimPlayer player) {
@Override
public void onBlockPlace(final BlockPlace place) {
if (place.getMaterial() == StateTypes.SCAFFOLDING) return;
if (player.gamemode == GameMode.SPECTATOR) return; // you don't send flying packets when spectating entities
if (flagBuffer > 0 && !didRayTraceHit(place)) {
ignorePost = true;
// If the player hit and has flagged this check recently
Expand All @@ -46,6 +48,7 @@ public void onBlockPlace(final BlockPlace place) {
@Override
public void onPostFlyingBlockPlace(BlockPlace place) {
if (place.getMaterial() == StateTypes.SCAFFOLDING) return;
if (player.gamemode == GameMode.SPECTATOR) return; // you don't send flying packets when spectating entities

// Don't flag twice
if (ignorePost) {
Expand Down

0 comments on commit b72fafa

Please sign in to comment.