Modding:Adding Block Behavior/ru: Difference between revisions

From Vintage Story Wiki
Created page with "// Можем ли мы разместить здесь блок?"
No edit summary
(Created page with "// Можем ли мы разместить здесь блок?")
Tags: Mobile edit Mobile web edit
Line 148: Line 148:
         public override bool OnBlockInteractStart(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling)
         public override bool OnBlockInteractStart(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling)
         {
         {
             // Find the target position
             // Найдите позицию цели
             BlockPos pos = blockSel.Position.AddCopy(pull && byPlayer.WorldData.EntityControls.Sneak ? blockSel.Face : blockSel.Face.Opposite, distance);
             BlockPos pos = blockSel.Position.AddCopy(pull && byPlayer.WorldData.EntityControls.Sneak ? blockSel.Face : blockSel.Face.Opposite, distance);


             // Can we place the block there?
             // Можем ли мы разместить здесь блок?
             if (world.BlockAccessor.GetBlock(pos).IsReplacableBy(block))
             if (world.BlockAccessor.GetBlock(pos).IsReplacableBy(block))
             {
             {
Confirmedusers
409

edits