//! This file is auto-generated by `xtask`. Do not edit manually.
#![allow(clippy::all)]
use crate::event::EventContext;
use crate::types;
impl<'a> EventContext<'a, types::ChatEvent> {
    ///Sets the `message` for this event.
    pub fn set_message(&mut self, message: impl Into<Option<String>>) {
        let mutation = types::ChatMutation {
            message: message.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::Chat(mutation));
    }
}
impl<'a> EventContext<'a, types::BlockBreakEvent> {
    ///Sets the `drops` for this event.
    pub fn set_drops(&mut self, drops: impl Into<Option<types::ItemStackList>>) {
        let mutation = types::BlockBreakMutation {
            drops: drops.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::BlockBreak(mutation));
    }
    ///Sets the `xp` for this event.
    pub fn set_xp(&mut self, xp: impl Into<Option<i32>>) {
        let mutation = types::BlockBreakMutation {
            xp: xp.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::BlockBreak(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerFoodLossEvent> {
    ///Sets the `to` for this event.
    pub fn set_to(&mut self, to: impl Into<Option<i32>>) {
        let mutation = types::PlayerFoodLossMutation {
            to: to.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerFoodLoss(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerHealEvent> {
    ///Sets the `amount` for this event.
    pub fn set_amount(&mut self, amount: impl Into<Option<f64>>) {
        let mutation = types::PlayerHealMutation {
            amount: amount.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerHeal(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerHurtEvent> {
    ///Sets the `damage` for this event.
    pub fn set_damage(&mut self, damage: impl Into<Option<f64>>) {
        let mutation = types::PlayerHurtMutation {
            damage: damage.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerHurt(mutation));
    }
    ///Sets the `attack_immunity_ms` for this event.
    pub fn set_attack_immunity_ms(&mut self, attack_immunity_ms: impl Into<Option<i64>>) {
        let mutation = types::PlayerHurtMutation {
            attack_immunity_ms: attack_immunity_ms.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerHurt(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerDeathEvent> {
    ///Sets the `keep_inventory` for this event.
    pub fn set_keep_inventory(&mut self, keep_inventory: impl Into<Option<bool>>) {
        let mutation = types::PlayerDeathMutation {
            keep_inventory: keep_inventory.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerDeath(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerRespawnEvent> {
    ///Sets the `position` for this event.
    pub fn set_position(&mut self, position: impl Into<Option<types::Vec3>>) {
        let mutation = types::PlayerRespawnMutation {
            position: position.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerRespawn(mutation));
    }
    ///Sets the `world` for this event.
    pub fn set_world(&mut self, world: impl Into<Option<types::WorldRef>>) {
        let mutation = types::PlayerRespawnMutation {
            world: world.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerRespawn(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerAttackEntityEvent> {
    ///Sets the `force` for this event.
    pub fn set_force(&mut self, force: impl Into<Option<f64>>) {
        let mutation = types::PlayerAttackEntityMutation {
            force: force.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerAttackEntity(mutation));
    }
    ///Sets the `height` for this event.
    pub fn set_height(&mut self, height: impl Into<Option<f64>>) {
        let mutation = types::PlayerAttackEntityMutation {
            height: height.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerAttackEntity(mutation));
    }
    ///Sets the `critical` for this event.
    pub fn set_critical(&mut self, critical: impl Into<Option<bool>>) {
        let mutation = types::PlayerAttackEntityMutation {
            critical: critical.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerAttackEntity(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerExperienceGainEvent> {
    ///Sets the `amount` for this event.
    pub fn set_amount(&mut self, amount: impl Into<Option<i32>>) {
        let mutation = types::PlayerExperienceGainMutation {
            amount: amount.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerExperienceGain(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerLecternPageTurnEvent> {
    ///Sets the `new_page` for this event.
    pub fn set_new_page(&mut self, new_page: impl Into<Option<i32>>) {
        let mutation = types::PlayerLecternPageTurnMutation {
            new_page: new_page.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerLecternPageTurn(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerItemPickupEvent> {
    ///Sets the `item` for this event.
    pub fn set_item(&mut self, item: impl Into<Option<types::ItemStack>>) {
        let mutation = types::PlayerItemPickupMutation {
            item: item.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerItemPickup(mutation));
    }
}
impl<'a> EventContext<'a, types::PlayerTransferEvent> {
    ///Sets the `address` for this event.
    pub fn set_address(&mut self, address: impl Into<Option<types::Address>>) {
        let mutation = types::PlayerTransferMutation {
            address: address.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::PlayerTransfer(mutation));
    }
}
impl<'a> EventContext<'a, types::WorldExplosionEvent> {
    ///Sets the `entity_uuids` for this event.
    pub fn set_entity_uuids(&mut self, entity_uuids: impl Into<Option<types::StringList>>) {
        let mutation = types::WorldExplosionMutation {
            entity_uuids: entity_uuids.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::WorldExplosion(mutation));
    }
    ///Sets the `blocks` for this event.
    pub fn set_blocks(&mut self, blocks: impl Into<Option<types::BlockPosList>>) {
        let mutation = types::WorldExplosionMutation {
            blocks: blocks.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::WorldExplosion(mutation));
    }
    ///Sets the `item_drop_chance` for this event.
    pub fn set_item_drop_chance(&mut self, item_drop_chance: impl Into<Option<f64>>) {
        let mutation = types::WorldExplosionMutation {
            item_drop_chance: item_drop_chance.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::WorldExplosion(mutation));
    }
    ///Sets the `spawn_fire` for this event.
    pub fn set_spawn_fire(&mut self, spawn_fire: impl Into<Option<bool>>) {
        let mutation = types::WorldExplosionMutation {
            spawn_fire: spawn_fire.into(),
            ..Default::default()
        };
        self.set_mutation(types::EventResultUpdate::WorldExplosion(mutation));
    }
}
