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 "<syntaxhighlight lang="c#"> public override bool OnPlayerInteract(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling) {...")
(Created page with "// Можем ли мы разместить блок там? if (world.BlockAccessor.GetBlock(pos).IsReplacableBy(block)) { // Remove the block at the cur...")
Line 45: Line 45:
         BlockPos pos = blockSel.Position.AddCopy(blockSel.Face.GetOpposite());
         BlockPos pos = blockSel.Position.AddCopy(blockSel.Face.GetOpposite());


         // Can we place the block there?
         // Можем ли мы разместить блок там?
        if (world.BlockAccessor.GetBlock(pos).IsReplacableBy(block))
if (world.BlockAccessor.GetBlock(pos).IsReplacableBy(block))
         {
         {
             // Remove the block at the current position and place it at the target position
             // Remove the block at the current position and place it at the target position
681

edits