mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed requested changes in the review. Except: Container (TODO)
This commit is contained in:
parent
3ea109b330
commit
9d3357eeee
8 changed files with 1809 additions and 1799 deletions
|
|
@ -1115,6 +1115,6 @@ namespace MinecraftClient.Inventory
|
|||
ZombieHorseSpawnEgg,
|
||||
ZombieSpawnEgg,
|
||||
ZombieVillagerSpawnEgg,
|
||||
ZombifiedPiglinSpawnEgg
|
||||
ZombifiedPiglinSpawnEgg,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace MinecraftClient.Mapping.BlockPalettes
|
|||
/// <param name="blocksJsonFile">path to blocks.json</param>
|
||||
/// <remarks>java -cp minecraft_server.jar net.minecraft.data.Main --reports</remarks>
|
||||
/// <returns>state => block name mappings</returns>
|
||||
public static void GenerateBlockPallete(string blocksJsonFile)
|
||||
public static void GenerateBlockPalette(string blocksJsonFile)
|
||||
{
|
||||
BlockPaletteGenerator.JsonToClass(blocksJsonFile, "Palette", "Material");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,26 +24,34 @@ namespace MinecraftClient.Mapping
|
|||
Boat,
|
||||
Cat,
|
||||
CaveSpider,
|
||||
ChestMinecart,
|
||||
Chicken,
|
||||
Cod,
|
||||
CommandBlockMinecart,
|
||||
Cow,
|
||||
Creeper,
|
||||
Dolphin,
|
||||
Donkey,
|
||||
DragonFireball,
|
||||
Drowned,
|
||||
Egg,
|
||||
ElderGuardian,
|
||||
EndCrystal,
|
||||
EnderDragon,
|
||||
Enderman,
|
||||
Endermite,
|
||||
EnderPearl,
|
||||
Evoker,
|
||||
EvokerFangs,
|
||||
ExperienceBottle,
|
||||
ExperienceOrb,
|
||||
EyeOfEnder,
|
||||
FallingBlock,
|
||||
Fireball,
|
||||
FireworkRocket,
|
||||
FishingBobber,
|
||||
Fox,
|
||||
FurnaceMinecart,
|
||||
Ghast,
|
||||
Giant,
|
||||
GlowItemFrame,
|
||||
|
|
@ -51,13 +59,13 @@ namespace MinecraftClient.Mapping
|
|||
Goat,
|
||||
Guardian,
|
||||
Hoglin,
|
||||
HopperMinecart,
|
||||
Horse,
|
||||
Husk,
|
||||
Illusioner,
|
||||
IronGolem,
|
||||
Item,
|
||||
ItemFrame,
|
||||
Fireball,
|
||||
LeashKnot,
|
||||
LightningBolt,
|
||||
Llama,
|
||||
|
|
@ -65,14 +73,8 @@ namespace MinecraftClient.Mapping
|
|||
MagmaCube,
|
||||
Marker,
|
||||
Minecart,
|
||||
ChestMinecart,
|
||||
CommandBlockMinecart,
|
||||
FurnaceMinecart,
|
||||
HopperMinecart,
|
||||
SpawnerMinecart,
|
||||
TntMinecart,
|
||||
Mule,
|
||||
Mooshroom,
|
||||
Mule,
|
||||
Ocelot,
|
||||
Painting,
|
||||
Panda,
|
||||
|
|
@ -82,8 +84,9 @@ namespace MinecraftClient.Mapping
|
|||
Piglin,
|
||||
PiglinBrute,
|
||||
Pillager,
|
||||
Player,
|
||||
PolarBear,
|
||||
Tnt,
|
||||
Potion,
|
||||
Pufferfish,
|
||||
Rabbit,
|
||||
Ravager,
|
||||
|
|
@ -96,19 +99,18 @@ namespace MinecraftClient.Mapping
|
|||
SkeletonHorse,
|
||||
Slime,
|
||||
SmallFireball,
|
||||
SnowGolem,
|
||||
Snowball,
|
||||
SnowGolem,
|
||||
SpawnerMinecart,
|
||||
SpectralArrow,
|
||||
Spider,
|
||||
Squid,
|
||||
Stray,
|
||||
Strider,
|
||||
Egg,
|
||||
EnderPearl,
|
||||
ExperienceBottle,
|
||||
Potion,
|
||||
Trident,
|
||||
Tnt,
|
||||
TntMinecart,
|
||||
TraderLlama,
|
||||
Trident,
|
||||
TropicalFish,
|
||||
Turtle,
|
||||
Vex,
|
||||
|
|
@ -125,7 +127,5 @@ namespace MinecraftClient.Mapping
|
|||
ZombieHorse,
|
||||
ZombieVillager,
|
||||
ZombifiedPiglin,
|
||||
Player,
|
||||
FishingBobber,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -42,12 +42,9 @@ namespace MinecraftClient.Mapping
|
|||
Material.BrownGlazedTerracotta,
|
||||
Material.BrownShulkerBox,
|
||||
Material.BrownTerracotta,
|
||||
Material.Cauldron,
|
||||
Material.WaterCauldron,
|
||||
Material.LavaCauldron,
|
||||
Material.PowderSnowCauldron,
|
||||
Material.Chain,
|
||||
Material.Calcite,
|
||||
Material.Cauldron,
|
||||
Material.Chain,
|
||||
Material.ChippedAnvil,
|
||||
Material.ChiseledDeepslate,
|
||||
Material.ChiseledNetherBricks,
|
||||
|
|
@ -58,10 +55,10 @@ namespace MinecraftClient.Mapping
|
|||
Material.ChiseledStoneBricks,
|
||||
Material.CoalBlock,
|
||||
Material.CoalOre,
|
||||
Material.CobbledDeepslate,
|
||||
Material.CobbledDeepslateSlab,
|
||||
Material.CobbledDeepslateStairs,
|
||||
Material.CobbledDeepslateWall,
|
||||
Material.CobbledDeepslate,
|
||||
Material.Cobblestone,
|
||||
Material.CobblestoneSlab,
|
||||
Material.CobblestoneStairs,
|
||||
|
|
@ -88,20 +85,20 @@ namespace MinecraftClient.Mapping
|
|||
Material.Deepslate,
|
||||
Material.DeepslateBrickSlab,
|
||||
Material.DeepslateBrickStairs,
|
||||
Material.DeepslateBricks,
|
||||
Material.DeepslateBrickWall,
|
||||
Material.DeepslateBricks,
|
||||
Material.DeepslateCoalOre,
|
||||
Material.DeepslateTileSlab,
|
||||
Material.DeepslateTileStairs,
|
||||
Material.DeepslateTiles,
|
||||
Material.DeepslateTileWall,
|
||||
Material.DeepslateTiles,
|
||||
Material.DetectorRail,
|
||||
Material.Diorite,
|
||||
Material.DioriteSlab,
|
||||
Material.DioriteStairs,
|
||||
Material.DioriteWall,
|
||||
Material.DripstoneBlock,
|
||||
Material.Dispenser,
|
||||
Material.DripstoneBlock,
|
||||
Material.Dropper,
|
||||
Material.EnchantingTable,
|
||||
Material.EndRod,
|
||||
|
|
@ -135,6 +132,7 @@ namespace MinecraftClient.Mapping
|
|||
Material.IronDoor,
|
||||
Material.IronTrapdoor,
|
||||
Material.Lantern,
|
||||
Material.LavaCauldron,
|
||||
Material.LightBlueConcrete,
|
||||
Material.LightBlueGlazedTerracotta,
|
||||
Material.LightBlueShulkerBox,
|
||||
|
|
@ -203,6 +201,7 @@ namespace MinecraftClient.Mapping
|
|||
Material.PolishedGranite,
|
||||
Material.PolishedGraniteSlab,
|
||||
Material.PolishedGraniteStairs,
|
||||
Material.PowderSnowCauldron,
|
||||
Material.PoweredRail,
|
||||
Material.Prismarine,
|
||||
Material.PrismarineBrickSlab,
|
||||
|
|
@ -271,6 +270,7 @@ namespace MinecraftClient.Mapping
|
|||
Material.Terracotta,
|
||||
Material.Tuff,
|
||||
Material.WarpedNylium,
|
||||
Material.WaterCauldron,
|
||||
Material.WhiteConcrete,
|
||||
Material.WhiteGlazedTerracotta,
|
||||
Material.WhiteShulkerBox,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ using MinecraftClient.WinAPI;
|
|||
namespace MinecraftClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Minecraft Console Client by the MCC Team (c) 2012-2021.
|
||||
/// Minecraft Console Client by the MCC Team (c) 2012-2022.
|
||||
/// Allows to connect to any Minecraft server, send and receive text, automated scripts.
|
||||
/// This source code is released under the CDDL 1.0 License.
|
||||
/// </summary>
|
||||
|
|
@ -129,12 +129,14 @@ namespace MinecraftClient
|
|||
string argName = argParts[0].Trim();
|
||||
string argValue = argParts[1].Replace("\"", "").Trim();
|
||||
|
||||
if(argName == "data-path") {
|
||||
if (argName == "data-path")
|
||||
{
|
||||
Console.WriteLine(dataPath);
|
||||
dataPath = argValue;
|
||||
}
|
||||
|
||||
if(argName == "data-generator") {
|
||||
if (argName == "data-generator")
|
||||
{
|
||||
dataGenerator = argValue;
|
||||
}
|
||||
}
|
||||
|
|
@ -143,24 +145,24 @@ namespace MinecraftClient
|
|||
if (string.IsNullOrEmpty(dataGenerator) || !(dataGenerator.ToLower().Equals("entity") || dataGenerator.ToLower().Equals("item") || dataGenerator.ToLower().Equals("block")))
|
||||
{
|
||||
Console.WriteLine(Translations.Get("error.generator.invalid"));
|
||||
Console.WriteLine(Translations.Get("error.usage") + " MinecraftClient.exe --data-generator=<entity|item|block>");
|
||||
Console.WriteLine(Translations.Get("error.usage") + " MinecraftClient.exe --data-generator=<entity|item|block> --data-path=\"<path to resources.json>\"");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(dataPath))
|
||||
{
|
||||
Console.WriteLine(Translations.Get("error.missing.argument", "--data-path"));
|
||||
Console.WriteLine(Translations.Get("error.usage") + " MinecraftClient.exe --generate-entity-pallete --data-path=\"<path to resources.json>\"");
|
||||
Console.WriteLine(Translations.Get("error.usage") + " MinecraftClient.exe --data-generator=<entity|item|block> --data-path=\"<path to resources.json>\"");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!File.Exists(dataPath))
|
||||
if (!File.Exists(dataPath))
|
||||
{
|
||||
Console.WriteLine(Translations.Get("error.generator.path", dataPath));
|
||||
return;
|
||||
}
|
||||
|
||||
if(!dataPath.EndsWith(".json"))
|
||||
if (!dataPath.EndsWith(".json"))
|
||||
{
|
||||
Console.WriteLine(Translations.Get("error.generator.json", dataPath));
|
||||
return;
|
||||
|
|
@ -179,7 +181,7 @@ namespace MinecraftClient
|
|||
break;
|
||||
|
||||
case "block":
|
||||
BlockPaletteGenerator.GenerateBlockPallete(dataPath);
|
||||
BlockPaletteGenerator.GenerateBlockPalette(dataPath);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,19 +88,19 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
this.packetPalette = new PacketTypeHandler(protocolVersion, forgeInfo != null).GetTypeHandler();
|
||||
this.log = handler.GetLogger();
|
||||
|
||||
if (handler.GetTerrainEnabled() && protocolversion > MC1181Version)
|
||||
if (handler.GetTerrainEnabled() && protocolversion > MC1182Version)
|
||||
{
|
||||
log.Error(Translations.Get("extra.terrainandmovement_disabled"));
|
||||
handler.SetTerrainEnabled(false);
|
||||
}
|
||||
|
||||
if (handler.GetInventoryEnabled() && (protocolversion < MC110Version || protocolversion > MC1181Version))
|
||||
if (handler.GetInventoryEnabled() && (protocolversion < MC110Version || protocolversion > MC1182Version))
|
||||
{
|
||||
log.Error(Translations.Get("extra.inventory_disabled"));
|
||||
handler.SetInventoryEnabled(false);
|
||||
}
|
||||
|
||||
if (handler.GetEntityHandlingEnabled() && (protocolversion < MC110Version || protocolversion > MC1181Version))
|
||||
if (handler.GetEntityHandlingEnabled() && (protocolversion < MC110Version || protocolversion > MC1182Version))
|
||||
{
|
||||
log.Error(Translations.Get("extra.entity_disabled"));
|
||||
handler.SetEntityHandlingEnabled(false);
|
||||
|
|
@ -109,9 +109,9 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
// Block palette
|
||||
if (protocolversion >= MC113Version)
|
||||
{
|
||||
if (protocolVersion > MC1181Version && handler.GetTerrainEnabled())
|
||||
if (protocolVersion > MC1182Version && handler.GetTerrainEnabled())
|
||||
throw new NotImplementedException(Translations.Get("exception.palette.block"));
|
||||
if (protocolVersion == MC1181Version)
|
||||
if (protocolVersion >= MC1181Version)
|
||||
Block.Palette = new Palette117();
|
||||
else if (protocolVersion >= MC116Version)
|
||||
Block.Palette = new Palette116();
|
||||
|
|
@ -126,7 +126,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
// Entity palette
|
||||
if (protocolversion >= MC113Version)
|
||||
{
|
||||
if (protocolversion > MC1181Version && handler.GetEntityHandlingEnabled())
|
||||
if (protocolversion > MC1182Version && handler.GetEntityHandlingEnabled())
|
||||
throw new NotImplementedException(Translations.Get("exception.palette.entity"));
|
||||
if (protocolversion >= MC117Version)
|
||||
entityPalette = new EntityPalette117();
|
||||
|
|
@ -145,9 +145,9 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
// Item palette
|
||||
if (protocolversion >= MC1162Version)
|
||||
{
|
||||
if (protocolversion > MC1181Version && handler.GetInventoryEnabled())
|
||||
if (protocolversion > MC1182Version && handler.GetInventoryEnabled())
|
||||
throw new NotImplementedException(Translations.Get("exception.palette.item"));
|
||||
if (protocolversion == MC1181Version)
|
||||
if (protocolversion >= MC1181Version)
|
||||
itemPalette = new ItemPalette118();
|
||||
else if (protocolversion >= MC117Version)
|
||||
itemPalette = new ItemPalette117();
|
||||
|
|
@ -444,7 +444,8 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
int compressedDataSize = dataTypes.ReadNextInt(packetData);
|
||||
byte[] compressed = dataTypes.ReadData(compressedDataSize, packetData);
|
||||
byte[] decompressed = ZlibUtils.Decompress(compressed);
|
||||
new Task(() => {
|
||||
new Task(() =>
|
||||
{
|
||||
pTerrain.ProcessChunkColumnData(chunkX, chunkZ, chunkMask, addBitmap, currentDimension == 0, chunksContinuous, currentDimension, new Queue<byte>(decompressed));
|
||||
}).Start();
|
||||
}
|
||||
|
|
@ -470,7 +471,8 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
else dataTypes.ReadData(1024 * 4, packetData); // Biomes - 1.15 and above
|
||||
}
|
||||
int dataSize = dataTypes.ReadNextVarInt(packetData);
|
||||
new Task(() => {
|
||||
new Task(() =>
|
||||
{
|
||||
pTerrain.ProcessChunkColumnData(chunkX, chunkZ, chunkMask, 0, false, chunksContinuous, currentDimension, packetData);
|
||||
}).Start();
|
||||
}
|
||||
|
|
@ -837,7 +839,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
|
||||
int stateId = -1;
|
||||
|
||||
if(protocolversion >= MC1181Version)
|
||||
if (protocolversion >= MC1181Version)
|
||||
stateId = dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
int elements = dataTypes.ReadNextVarInt(packetData);
|
||||
|
|
@ -858,7 +860,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
|
||||
int stateId = -1;
|
||||
|
||||
if(protocolversion >= MC1181Version)
|
||||
if (protocolversion >= MC1181Version)
|
||||
stateId = dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
short slotID = dataTypes.ReadNextShort(packetData);
|
||||
|
|
@ -984,7 +986,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
case PacketTypesIn.DestroyEntity:
|
||||
if (handler.GetEntityHandlingEnabled())
|
||||
{
|
||||
handler.OnDestroyEntities(new [] { dataTypes.ReadNextVarInt(packetData) });
|
||||
handler.OnDestroyEntities(new[] { dataTypes.ReadNextVarInt(packetData) });
|
||||
}
|
||||
break;
|
||||
case PacketTypesIn.EntityPosition:
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ mcc.with_forge=, with Forge
|
|||
mcc.handshake=§8Handshake successful. (Server ID: {0})
|
||||
mcc.realms_available=You have access to the following Realms worlds
|
||||
mcc.realms_join=Use realms:<index> as server IP to join a Realms world
|
||||
|
||||
mcc.generator.generating=Generating {0} palette using the dataset: {1}
|
||||
mcc.generator.done=Succesfully generated {0} palette using the dataset: {1}
|
||||
|
||||
[debug]
|
||||
# Messages from MCC Debug Mode
|
||||
|
|
@ -92,6 +93,11 @@ error.realms.access_denied=This Realms world does not exist or access was denied
|
|||
error.realms.server_unavailable=Realms server may require some time to start up. Please retry again later.
|
||||
error.realms.server_id=Invalid or unknown Realms server ID.
|
||||
error.realms.disabled=Trying to join a Realms world but Realms support is disabled in config
|
||||
error.missing.argument=You are missing argument {0}
|
||||
error.usage=Usage:
|
||||
error.generator.invalid=Invalid usage of the generator command!
|
||||
error.generator.path=Invalid data path provided! (The path either does not exists or you have made a typo)
|
||||
error.generator.json=The provided path must be a path to a file that is in .json format!
|
||||
|
||||
[internal command]
|
||||
# MCC internal help command
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue