Snowiiii / Pumpkin

Empowering everyone to host fast and efficient Minecraft servers.
https://snowiiii.github.io/Pumpkin/
MIT License
3.25k stars 113 forks source link

Add nearby players collision check when trying to place blocks #293

Open Tiiita opened 6 days ago

Tiiita commented 6 days ago

Description

Added a function in world/mod.rs that checks nearby players by a given point and a radius. Using this function I switched the function that gets the nearby players to the new one and chose a radius of 20. So every time a player tries to place a block it searches up players in the radius of 20 blocks and checks the collision with them. If no collision was found it places the block. With that change I also fixed the bug that players could place blocks at their head height and start to swim.

Testing

Tried to place blocks beside or in myself and my 2. account. Both tries worked as expected. Feels like original vanilla minecraft. I also tried to change the game modes and place from different angles.

Checklist