Skip to content

Commit

Permalink
Allow moving the head lol
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed May 27, 2024
1 parent 7ebb0fe commit 0aad11e
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.GameType;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.NamespacedKey;
import org.bukkit.*;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.block.Block;
Expand Down Expand Up @@ -342,7 +339,9 @@ public void moveEvent(PlayerMoveEvent e) {
if (e.getTo().getBlock().isCollidable() &&
!((blacklist && !ConditionExecutor.testBlock(blockCondition, e.getTo().getBlock())) || (!blacklist && ConditionExecutor.testBlock(blockCondition, e.getTo().getBlock())))) {
e.setCancelled(true);
e.setTo(e.getFrom());
Location toSet = e.getFrom();
toSet.setDirection(e.getTo().getDirection());
e.setTo(toSet);
}
}
}
Expand Down

0 comments on commit 0aad11e

Please sign in to comment.