[SPIGOT-7577] WindCharge#explode() doesn't discard Created: 27/Jan/24  Updated: 25/Dec/24  Resolved: 03/Feb/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Shane Bee Assignee: Doc
Resolution: Fixed Votes: 0
Labels: None

Version: CraftBukkit version 4029-Spigot-c198da2-3337018
Guidelines Read: Yes

 Description   

I noticed in the code for WindCharge#explode():
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftWindCharge.java#12

That the entity is not discarded.
Reviewing the NMS code, when MC uses explode() they also use the discard() method.

Suggestions:
(either would be good)
1) add the discard method within the CraftBukkit explode method
2) Make note in the javadoc that the entity is NOT discarded and you will have to manually do it yourself.

Sorry, I don't have test code to provide, I was testing this in a Skript based environment.



 Comments   
Comment by Doc [ 28/Jan/24 ]

Based in NMS where finally all cases call the discard (on hit block call directly and by entity is handled in Fireball calling a onHit generic method) then i make a PR for call discard when call the manual explode method.

PR: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1351/overview

Comment by Doc [ 27/Jan/24 ]

Maybe can add a method explode(boolean remove) for that and keep the explode() like a explode(false) for keep the current behaviour

Generated at Sat Dec 13 22:24:57 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.