Skip to content

feat: Enhance DataSpell - #1097

Open
DragonsAscent wants to merge 5 commits into
TheComputerGeek2:mainfrom
DragonsAscent:main
Open

feat: Enhance DataSpell#1097
DragonsAscent wants to merge 5 commits into
TheComputerGeek2:mainfrom
DragonsAscent:main

Conversation

@DragonsAscent

Copy link
Copy Markdown
Collaborator

Support for targeting both entities and locations:

  • DataSpell now implements TargetedLocationSpell and can cast spells at both entities and locations.
  • Added logic to cast to check for an entity target first, then fall back to a block location target if no entity is found.

Copilot AI lite review requested due to automatic review settings August 23, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A data-element key mismatch in DataLocation (location.light.block vs existing location.light.blocks) can break existing configurations when switching from entity to location targeting.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds location-target support to DataSpell so it can populate variables from either an entity target (preferred) or a targeted block location when no entity is found.

Changes:

  • Introduced DataLocation to expose Location -> String data extractors (biome, block data/type, light, coords, world, etc.).
  • Updated DataSpell to implement TargetedLocationSpell and to fall back from entity targeting to block-location targeting.
  • Refactored DataSpell to resolve the configured data-element key at cast-time and share variable-setting logic via a helper.
File summaries
File Description
core/src/main/java/com/nisovin/magicspells/util/data/DataLocation.java New location data-element registry for DataSpell location targeting.
core/src/main/java/com/nisovin/magicspells/spells/targeted/DataSpell.java Adds dual targeting (entity first, then block location) and applies either entity/location data to a variable.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread core/src/main/java/com/nisovin/magicspells/util/data/DataLocation.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/targeted/DataSpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/util/data/DataLocation.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/util/data/DataLocation.java Outdated
@JasperLorelai

Copy link
Copy Markdown
Collaborator

Since this is an atomic PR (self-contained), you don't need to clear up history because we can merge with squash.

DragonsAscent and others added 4 commits August 24, 2026 01:59
…aSpell.java

Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
…aSpell.java

Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
…ion.java

Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
…ion.java

Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants