* fix: eggs, snowballs, and babies
* chore: warnings and clippy
* fix: switch to RwLock<ItemStack>
* fix: now using has_hit to prevent stack overflow
* fix: updated clippy
* refactor: check is_projectile in projectile mod instead
---------
Signed-off-by: RB007 <36972202+RoosterBooster007@users.noreply.github.com>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
- pass Player instead of Entity as damage source so get_player() works
- creative mode: spawn break particles, play sound, remove without drops
- add spawn_break_particles method (TODO: use oak plank block particles)
implements the minecraft:potion_contents data component which was causing
server crashes when players clicked on potions or tipped arrows in creative
mode
fixes#1309
* feat: add /spawnpoint command with cross-dimension respawn
- implement /spawnpoint command to set player spawn points
- add force flag to bypass bed/respawn anchor checks
- support cross-dimension respawn (e.g., die in nether, respawn in overworld)
- fix respawn teleport by sending position packet after chunks load
* chore: retrigger ci
* refactor: improve respawn point API based on review feedback
- rename get_respawn_point to calculate_respawn_point for clarity
- add CalculatedRespawnPoint struct to replace tuple return type
- remove packet sending from calculate function (caller handles it)
- document force flag behavior in function docs
- fix lock held across await points in respawn logic
* fix: implement proper bed/anchor respawn position finding
- remove duplicate send_abilities_update in respawn_player
- implement vanilla-like spawn position finding for beds
- implement spawn position finding for respawn anchors with charge decrement
- add find_respawn_pos validation (floor check, collision check, invalid spawn tag)
- validate forced spawn positions are safe
- add fixme comments for world spawn calculation (see #1381)
* feat: implement /setidletimeout command
adds the /setidletimeout <minutes> command that sets the player idle
timeout. setting to 0 disables the timeout.
* feat: implement idle timeout kick logic
track player actions and kick idle players after the timeout set by
/setidletimeout. matches vanilla behavior:
- check idle timeout every tick
- only reset timer on actual movement
- reset timer on chat, commands, interactions, slot changes, etc.
* fix: nether portals
* fix: add world border checks and match vanilla portal behavior
* feat: add region-based POI storage for nether portal linking
Implemented Point of Interest system for fast portal lookups:
- region-based NBT storage matching vanilla format
- sections keyed by Y coordinate within per-chunk data
- auto-registration on portal creation/destruction
- used by portal search to avoid scanning all blocks
Note: this POI implementation covers nether portals only.
The full POI system still needs significant work for:
- villager job sites
- beds, bells, beehives
- ticket/occupation system
- auto-scanning chunks for POI blocks
- distance tracker for pathfinding
Vanilla POI reference: net/minecraft/world/poi/
* feat: add entity position preservation and collision avoidance for portals
- preserve entity position relative to portal when teleporting
- add collision avoidance to find safe spawn positions
- add source portal tracking for accurate exit position calculation
- fix clippy pedantic warnings across portal and border code
* feat: add yaw rotation and vehicle teleportation for portals
- rotate entity yaw 90° when portal axis changes between dimensions
- prevent passengers from teleporting independently (wait for vehicle)
- teleport all passengers along with vehicle through portals
* fix: handle nested passengers recursively for portal teleportation
passengers of passengers (e.g., player riding a pig riding a minecart)
are now teleported correctly through portals
* style: apply cargo fmt and allow too_many_lines for portal search
find_safe_location exceeds 100 lines but splitting it would reduce
readability - the portal search algorithm flows naturally as one unit
* feat: use MCA format for POI storage for vanilla compatibility
Change POI storage to vanilla-compatible .mca region format. This allows
proper portal linking when importing existing vanilla worlds, as Pumpkin
can now read portals registered by vanilla.
* fix: remove local cargo config that breaks CI
* fix: correct portal direction calculations and dimension chunk loading
- fix portal direction to match vanilla: z-axis uses south (not north)
- fix perpendicular direction to match vanilla's rotateyc1ockwise()
- fix fallback clearing dimensions to match vanilla (3x2x4 blocks)
- store world reference in chunkmanager, updated on dimension change
- use chunkmanager's world for chunk loading instead of entity.world
this fixes players spawning inside blocks and seeing wrong terrain
(overworld blocks in nether) after portal teleportation.
* fix: portal neighbor update logic and remove_player return value
- fix impossible condition in portal neighbor update (was always false)
- fix remove_player to return the removed player instead of none
* fix: update entity.world to arcswap for dimension teleportation
entity.world was an immutable arc<world> that was never updated after
dimension teleportation. when a player teleported to the nether,
chunkmanager.world was updated but entity.world still pointed to the
overworld. this caused tick_block_collisions() to read blocks from the
wrong dimension, preventing return portal detection.
changed entity.world from arc<world> to arcswap<world> to allow atomic
updates when changing dimensions. added set_world() method and updated
teleport_world() to call it after dimension changes.
* fix: reset chunk batch state on dimension change
when changing dimensions, the chunk batch state was not being reset.
this caused slow chunk loading if the player was in a throttled state
before teleporting, as the server would wait for acknowledgments for
chunks that no longer exist in the new dimension.
now resets batches_sent_since_ack to Initial in change_world() so
chunks can be sent immediately after dimension change.
Its works, but block state ids are currently not mapped, meaning that when using the current default world gen the client mostly will disconnect due to a not found block state id, vanilla version compatible worlds should work
when a player first joins with creative or spectator mode, their abilities
(flying, invulnerability, creative mode flag) were not being set, this caused
blocks to not display properly and flying to be disabled until switching
gamemodes
now calls set_for_gamemode() during player::new() to match vanilla
fixes#1367
* fix: button, lever, and grindstone placement use working direction function
* chore: clippy and formatting
* refactor: passing final_face is much simpler