mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
fix: resolve entity tracking, container interaction, and enchantment mapping issues for 1.21
- SpawnEntity packet handler now registers non-player entities via OnSpawnEntity for protocol >= 1.20.2 (previously only players were tracked, causing 'entity near' to find nothing) - PlaceBlock gains lookAtBlock option that sends a position/rotation update before the block placement packet, fixing containers not opening via useblock - Enchantment registry IDs are now dynamically parsed from server RegistryData (minecraft:enchantment), fixing incorrect enchantment name display in 1.21 - AttributeModifiersComponent uses base SubComponent type to avoid InvalidCastException when parsing 1.21-specific attribute subcomponents Made-with: Cursor
This commit is contained in:
parent
7609832976
commit
896263acc8
5 changed files with 98 additions and 10 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using Brigadier.NET;
|
||||
using Brigadier.NET;
|
||||
using Brigadier.NET.Builder;
|
||||
using MinecraftClient.CommandHandler;
|
||||
using MinecraftClient.Mapping;
|
||||
|
|
@ -48,7 +48,7 @@ namespace MinecraftClient.Commands
|
|||
Location current = handler.GetCurrentLocation();
|
||||
block = block.ToAbsolute(current).ToFloor();
|
||||
Location blockCenter = block.ToCenter();
|
||||
bool res = handler.PlaceBlock(block, Direction.Down);
|
||||
bool res = handler.PlaceBlock(block, Direction.Down, lookAtBlock: true);
|
||||
return r.SetAndReturn(string.Format(Translations.cmd_useblock_use, blockCenter.X, blockCenter.Y, blockCenter.Z, res ? "succeeded" : "failed"), res);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue