forked from anegostudios/vssurvivalmod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebug.cs
More file actions
61 lines (50 loc) · 1.96 KB
/
Debug.cs
File metadata and controls
61 lines (50 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Server;
using Vintagestory.GameContent;
namespace Vintagestory.ServerMods
{
/*public class NoNerdPoleSystem : ModSystem
{
public override bool ShouldLoad(EnumAppSide forSide) => forSide == EnumAppSide.Server;
public override void StartServerSide(ICoreServerAPI api)
{
api.Event.CanPlaceOrBreakBlock += (IServerPlayer plr, BlockSelection bs, out string claimant) => {
if (!plr.Entity.Collided) { claimant = "nonerdpoleing"; return false; }
claimant = null; return true;
}
}
}*/
/*public class DebugSystem : ModSystem
{
ICoreAPI api;
public override bool ShouldLoad(EnumAppSide forSide)
{
return true;
}
public override void StartServerSide(ICoreServerAPI api)
{
this.api = api;
// api.ChatCommands.GetOrCreate("debug")
// .BeginSubCommand("anvildebug")
// .WithDescription("Anvil debug info")
// .RequiresPrivilege(Privilege.controlserver)
// .HandleWith(OnAnvilDebug)
// .EndSubCommand();
}
private TextCommandResult OnAnvilDebug(TextCommandCallingArgs args)
{
var player = args.Caller.Player;
if (player.CurrentBlockSelection?.Position != null)
{
BlockEntityAnvil bea = api.World.BlockAccessor.GetBlockEntity(player.CurrentBlockSelection.Position) as BlockEntityAnvil;
if (bea == null)
{
return TextCommandResult.Success("Not looking at an anvil");
}
return TextCommandResult.Success(bea.PrintDebugText());
}
return TextCommandResult.Success();
}
}*/
}