Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML spawners only trigger once a player has moved an additional block after entering the player-region #1017

Open
Cazadorian opened this issue Jun 30, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Cazadorian
Copy link
Contributor

Currently XML spawners have a spawner-region and a player-region. If a player is within the player-region the spawner is supposed to spawn an item/splash potion within the spawn-region. Currently however PGM seemingly fails to detect players having entered the player-region until they move an additional block in any direction, even one out of the region. Three video examples of this behaviour are below and testing on both a localhost running the current latest PGM version and OCC's mapdev server result in the same behaviour.

Example 1, the player region in this example is a 1x1 rectangle, which makes Y level irrelevant to the player being inside. Despite that though jumping within it allows the spawner to activate as the player has moved a block vertically, and it stays activated once the player lands as they are still within the region.

Example 2, the player region in this example is a 3x3 cuboid around the central pressure plate. Walking from one block within the region to another block within the region causes the spawner to detect the player and then activate itself. Jumping also functions like example 1. Exiting the region causes the spawner to properly deactivate itself however.

Example 3, same as example 1 but with item spawners instead of splash potion spawners to demonstrate it occurs with both.

@Pablete1234 Pablete1234 added the bug Something isn't working label Jul 7, 2022
@Pablete1234
Copy link
Member

I answered to this on discord, but the TLDR is that spawners are using their own tracking of player which checks, on move event, if the region contains the player. This is broken in more ways than described here, like dying won't make you stop triggering the spawner.

The control point PlayerTracker should be reused in spawners because the functionality is the same: keeping a list of players in a region updated, and it already takes into account all the ways you may enter or leave a region (eg: dying makes you leave the region)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants