Class WorldObjectPlacementUtils
Funcs for helping place world objects.
Inheritance
System.Object
WorldObjectPlacementUtils
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
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
Returns
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
Returns
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
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
Returns
Type |
Description |
System.Threading.Tasks.Task<WorldObject> |
|