Search in sources :

Example 1 with FireworkExplosionEvent

use of com.lying.variousoddities.api.event.FireworkExplosionEvent in project VariousOddities by Lyinginbedmon.

the class FireworkRocketEntityMixin method onFireworkBlast.

@Inject(method = "func_213893_k", at = @At("HEAD"))
public void onFireworkBlast(CallbackInfo callbackInfo) {
    ItemStack stack = this.getDataManager().get(FIREWORK_ITEM);
    CompoundNBT stackData = !stack.isEmpty() ? stack.getChildTag("Fireworks") : null;
    MinecraftForge.EVENT_BUS.post(new FireworkExplosionEvent(this.world, this.getPosX(), this.getPosY(), this.getPosZ(), stackData));
}
Also used : FireworkExplosionEvent(com.lying.variousoddities.api.event.FireworkExplosionEvent) CompoundNBT(net.minecraft.nbt.CompoundNBT) ItemStack(net.minecraft.item.ItemStack) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

FireworkExplosionEvent (com.lying.variousoddities.api.event.FireworkExplosionEvent)1 ItemStack (net.minecraft.item.ItemStack)1 CompoundNBT (net.minecraft.nbt.CompoundNBT)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1