mirror of
https://github.com/koloml/vs-manual-cartography.git
synced 2026-06-23 18:22:21 +00:00
This commit adds dummy compass item wich will just send the angle into the chat when you click RMB on it.
20 lines
495 B
C#
20 lines
495 B
C#
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));
|
|
}
|
|
} |