Modding:Adding Block Behavior/es: Difference between revisions

From Vintage Story Wiki
Created page with "Lo siguiente que tenemos que cambiar es el propio método interact, para que se encargue de las propiedades de distancia y accionar... <syntaxhighlight lang="c#"> public override bool OnPlayerInteract(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling) { BlockPos pos = blockSel.Position.AddCopy(pull && byPlayer.WorldData.EntityControls.Sneak ? blockSel.Face : blockSel.Face.GetOpposite(), distance);..."
(Created page with "<syntaxhighlight lang="c#"> distance = properties["distance"].AsInt(1); pull = properties["pull"].AsBool(false); </syntaxhighlight>")
(Created page with "Lo siguiente que tenemos que cambiar es el propio método interact, para que se encargue de las propiedades de distancia y accionar... <syntaxhighlight lang="c#"> public override bool OnPlayerInteract(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, ref EnumHandling handling) { BlockPos pos = blockSel.Position.AddCopy(pull && byPlayer.WorldData.EntityControls.Sneak ? blockSel.Face : blockSel.Face.GetOpposite(), distance);...")
Line 143: Line 143:
----
----


The next thing we need to change is the interact method itself, so that it takes care of the distance and the pull properties ...
Lo siguiente que tenemos que cambiar es el propio método interact, para que se encargue de las propiedades de distancia y accionar...
<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
         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)
Confirmedusers
9,523

edits