Open Blayyke opened 6 years ago
@gabizou: Unfortunately, it seems that we can't use EventContextKeys.IGNITER
here, since it only applies to Living
(which PrimedTnt
is not). Should we add it directly to the cause, or make a breaking change in bleeding
?
I'd say make it in the cause.
I am currently running
Issue Description There is no way to track an explosion event's source back to another TNT entity / block. For instance: Say I set off one TNT in the vicinity of another. The second will blow up as normal, however it will not have any references to the first one, only to the player that the first one had.
-- First block that went off through a player ignition CAUSES:: net.minecraft.entity.item.EntityTNTPrimed -- EntityTNTPrimed['Block of TNT'/7386, l='mines', x=-364.68, y=4.00, z=-631.60] SOURCE::net.minecraft.entity.item.EntityTNTPrimed -- EntityTNTPrimed['Block of TNT'/7386, l='mines', x=-364.68, y=4.00, z=-631.60] CONTEXT::Owner - sponge:owner - org.spongepowered.api.entity.living.player.User - SpongeEventContextKey{id=sponge:owner} CONTEXT::net.minecraft.entity.player.EntityPlayerMP -- EntityPlayerMP['xA5'/328, l='mines', x=-362.08, y=4.00, z=-629.56]
-- Block that was blown up by the first CAUSES:: net.minecraft.entity.item.EntityTNTPrimed -- EntityTNTPrimed['Block of TNT'/8831, l='mines', x=-364.64, y=3.76, z=-630.38] SOURCE::net.minecraft.entity.item.EntityTNTPrimed -- EntityTNTPrimed['Block of TNT'/8831, l='mines', x=-364.64, y=3.76, z=-630.38] CONTEXT::Owner - sponge:owner - org.spongepowered.api.entity.living.player.User - SpongeEventContextKey{id=sponge:owner} CONTEXT::net.minecraft.entity.player.EntityPlayerMP -- EntityPlayerMP['xA5'/328, l='mines', x=-360.84, y=4.00, z=-628.59]
The above lines were printed with the following code (to try debugging):