Modding:Adding Block Behavior/ru: Difference between revisions

From Vintage Story Wiki
(Created page with "// Можем ли мы разместить блок там? if (world.BlockAccessor.GetBlock(pos).IsReplacableBy(block)) { // Remove the block at the cur...")
(Created page with "// Сообщаем игровому движку о других действиях блока, которые мы обрабатывали при взаимодействи...")
Line 53: Line 53:
         }
         }


         // Notify the game engine other block behaviors that we handled the players interaction with the block.
         // Сообщаем игровому движку о других действиях блока, которые мы обрабатывали при взаимодействии игроков с блоком.
         // If we would not set the handling field the player would still be able to place blocks if he has them in hands.
         // Если бы мы не установили поле обработки, игрок все равно мог бы размещать блоки, если бы он держал их в руках.
        handling = EnumHandling.PreventDefault;
handling = EnumHandling.PreventDefault;
         return true;
         return true;
    }
}
</syntaxhighlight>
</syntaxhighlight>