mirror of
https://github.com/koloml/vs-manual-cartography.git
synced 2026-06-23 18:22:21 +00:00
Initial commit from Vintage Story mod template
This commit adds dummy compass item wich will just send the angle into the chat when you click RMB on it.
This commit is contained in:
20
ManualCartography/Items/ItemCompass.cs
Normal file
20
ManualCartography/Items/ItemCompass.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Vintagestory.API.Client;
|
||||
using Vintagestory.API.Common;
|
||||
|
||||
namespace ManualCartography.Items;
|
||||
|
||||
public class ItemCompass : Item
|
||||
{
|
||||
public override void OnHeldInteractStart(
|
||||
ItemSlot slot,
|
||||
EntityAgent byEntity,
|
||||
BlockSelection blockSel,
|
||||
EntitySelection entitySel,
|
||||
bool firstEvent,
|
||||
ref EnumHandHandling handling
|
||||
)
|
||||
{
|
||||
(api as ICoreClientAPI)?.TriggerChatMessage("Yaw: " + (byEntity.Pos.Yaw * 180 / Math.PI));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user