Reduce EntranceListener work and per-player state

Aperta
#78 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
backend

Direzione di ricerca

Find EntranceListener and its movement handling, playerStoreStatus, and the shared attributes map; then read the existing listener tests and event registration. Check how PlayerMoveEvent exposes block changes and how quit events are handled. Done means head-only movement triggers no store lookups, quit removes UUID state, and messages for two players use their own stores, with tests covering all three.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement java

Problem

EntranceListener does more work than it needs to on every player movement:

  • It runs on every PlayerMoveEvent, including when a player only turns their head, and checks every store each time.
  • playerStoreStatus is keyed by Player and never cleared, so entries build up as players leave.
  • It shares one attributes map across all players, so a custom goodbye message using {store} can name another player's store.

Scope

  • Return early unless the player moved to a different block.
  • Key by UUID and remove entries on PlayerQuitEvent.
  • Keep the store for each player, so messages use the right one.

Done when

  • Turning in place does no store lookups.
  • Tests cover head-only movement, quitting, and two players in different stores.
Lingua principale
Java
Stelle
1
Fork
0
Merge medio
2h 35m
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di BrendonButler/Shops

Tutte le issue di BrendonButler/Shops

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.