Modding:Adding Block Behavior/ru: Difference between revisions

From Vintage Story Wiki
Created page with "<syntaxhighlight lang="c#"> public override bool OnPlayerInteract(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling) {..."
(Created page with "# Рассчитать новую позицию блока в зависимости от стороны, в которую смотрит игрок # Проверить, м...")
(Created page with "<syntaxhighlight lang="c#"> public override bool OnPlayerInteract(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling) {...")
Line 42: Line 42:
     public override bool OnPlayerInteract(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling)
     public override bool OnPlayerInteract(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling)
     {
     {
         // Find the target position
         // Находим целевую позицию
         BlockPos pos = blockSel.Position.AddCopy(blockSel.Face.GetOpposite());
         BlockPos pos = blockSel.Position.AddCopy(blockSel.Face.GetOpposite());


681

edits