Show / Hide Table of Contents

Class WorldObjectPlacementUtils

Funcs for helping place world objects.

Inheritance
System.Object
WorldObjectPlacementUtils
Namespace: Eco.Gameplay.Placement
Assembly: Eco.Gameplay.dll
Syntax
public static class WorldObjectPlacementUtils : Object

Methods

FinishPlacement(User, WorldObject)

Do notices for a finished placed world object. If an item doesnt create with 'ShouldCreate' flag, it needs to do this expliclty! Otherwise, it happens automaticall.

Declaration
public static void FinishPlacement(User user, WorldObject obj)
Parameters
Type Name Description
User user
WorldObject obj

IsValidPlacement(IPlaceableItem, Vector3, Quaternion, WorldObject)

Same as IsValidPlacement except that this version ignores the occupied block positions. Use this if it's not necessary to know what are the occupied blocks.

Declaration
public static Result IsValidPlacement(IPlaceableItem item, Vector3 position, Quaternion rotation, WorldObject attachingTo)
Parameters
Type Name Description
IPlaceableItem item
System.Numerics.Vector3 position
Quaternion rotation
WorldObject attachingTo
Returns
Type Description
Result

IsValidPlacement(IPlaceableItem, Vector3, Quaternion, WorldObject, out List<Vector3i>)

Given a world object, a position and a rotation, check if it's a valid placement position for the world object. occupiedBlockPositions is a list that will be filled inside this function, containing every block position that is already occupied by an object.

Declaration
public static Result IsValidPlacement(IPlaceableItem item, Vector3 position, Quaternion rotation, WorldObject attachingTo, out List<Vector3i> occupiedBlockPositions)
Parameters
Type Name Description
IPlaceableItem item
System.Numerics.Vector3 position
Quaternion rotation
WorldObject attachingTo
System.Collections.Generic.List<Vector3i> occupiedBlockPositions
Returns
Type Description
Result

TryPlaceWorldObject(GameActionPack, Player, IPlaceableItem, ItemStack, Vector3, Quaternion, WorldObject)

Do the steps for placing a world object from an IPlaceable.

Declaration
public static Task<Func<WorldObject>> TryPlaceWorldObject(GameActionPack pack, Player player, IPlaceableItem item, ItemStack containingStack, Vector3 pos, Quaternion rot, WorldObject attachedToWorldObject)
Parameters
Type Name Description
GameActionPack pack
Player player
IPlaceableItem item
ItemStack containingStack

Reduces this stack if it succeeds, if set.

System.Numerics.Vector3 pos
Quaternion rot
WorldObject attachedToWorldObject
Returns
Type Description
System.Threading.Tasks.Task<System.Func<WorldObject>>

TryPlaceWorldObjectNow(Player, IPlaceableItem, ItemStack, Vector3, Quaternion, Int32)

Do the steps for placing a world object from an IPlaceable.

Declaration
public static Task<WorldObject> TryPlaceWorldObjectNow(Player player, IPlaceableItem item, ItemStack containingStack, Vector3 pos, Quaternion rot, int placeOnSurfaceOfObjectID)
Parameters
Type Name Description
Player player
IPlaceableItem item
ItemStack containingStack
System.Numerics.Vector3 pos
Quaternion rot
System.Int32 placeOnSurfaceOfObjectID
Returns
Type Description
System.Threading.Tasks.Task<WorldObject>
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾