mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Upgrade GetLookingBlock
This commit is contained in:
parent
ba6a954f45
commit
4aa6c1c99f
11 changed files with 213 additions and 74 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using MinecraftClient.Mapping;
|
||||
|
||||
|
|
@ -17,7 +18,20 @@ namespace MinecraftClient.Commands
|
|||
if (handler.GetTerrainEnabled())
|
||||
{
|
||||
string[] args = getArgs(command);
|
||||
if (args.Length == 1)
|
||||
if (args.Length == 0)
|
||||
{
|
||||
const double maxDistance = 8.0;
|
||||
(bool hasBlock, Location target, Block block) = RaycastHelper.RaycastBlock(handler, maxDistance, false);
|
||||
if (!hasBlock)
|
||||
return Translations.Get("cmd.look.noinspection", maxDistance);
|
||||
else
|
||||
{
|
||||
Location current = handler.GetCurrentLocation(), target_center = target.ToCenter();
|
||||
return Translations.Get("cmd.look.inspection", block.Type, target.X, target.Y, target.Z,
|
||||
current.Distance(target_center), current.EyesLocation().Distance(target_center));
|
||||
}
|
||||
}
|
||||
else if (args.Length == 1)
|
||||
{
|
||||
string dirStr = getArg(command).Trim().ToLower();
|
||||
Direction direction;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue