Merge branch 'master' into 1.19.1-dev-new

This commit is contained in:
BruceChen 2022-09-02 11:08:39 +08:00 committed by GitHub
commit 71ecebedce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 2030 additions and 636 deletions

View file

@ -23,6 +23,7 @@ jobs:
echo win-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/win-x64/publish/ >> $GITHUB_ENV echo win-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/win-x64/publish/ >> $GITHUB_ENV
echo linux-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/linux-x64/publish/ >> $GITHUB_ENV echo linux-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/linux-x64/publish/ >> $GITHUB_ENV
echo osx-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/osx-x64/publish/ >> $GITHUB_ENV echo osx-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/osx-x64/publish/ >> $GITHUB_ENV
echo linux-arm64-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/linux-arm64/publish/ >> $GITHUB_ENV
- name: Setup .NET SDK - name: Setup .NET SDK
uses: actions/setup-dotnet@v2.1.0 uses: actions/setup-dotnet@v2.1.0
@ -60,6 +61,13 @@ jobs:
run: zip -qq -r linux.zip * run: zip -qq -r linux.zip *
working-directory: ${{ env.linux-out-path }} working-directory: ${{ env.linux-out-path }}
- name: Build for ARM64 Linux
run: dotnet publish ${{ env.project-path }}.sln -f ${{ env.target-version }} -r linux-arm64 ${{ env.compile-flags }}
- name: Zip ARM64 Linux Build
run: zip -qq -r linux-arm64.zip *
working-directory: ${{ env.linux-arm64-out-path }}
- name: Build for OSX - name: Build for OSX
run: dotnet publish ${{ env.project-path }}.sln -f ${{ env.target-version }} -r osx-x64 ${{ env.compile-flags }} run: dotnet publish ${{ env.project-path }}.sln -f ${{ env.target-version }} -r osx-x64 ${{ env.compile-flags }}
@ -92,6 +100,15 @@ jobs:
assetName: ${{ env.PROJECT }}-linux.zip assetName: ${{ env.PROJECT }}-linux.zip
tag: ${{ format('{0}-{1}', steps.date-release.outputs.time, github.run_number) }} tag: ${{ format('{0}-{1}', steps.date-release.outputs.time, github.run_number) }}
- name: Linux ARM64 Release
uses: tix-factory/release-manager@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
mode: uploadReleaseAsset
filePath: ${{ env.linux-arm64-out-path }}linux-arm64.zip
assetName: ${{ env.PROJECT }}-linux-arm64.zip
tag: ${{ format('{0}-{1}', steps.date-release.outputs.time, github.run_number) }}
- name: OSX Release - name: OSX Release
uses: tix-factory/release-manager@v1 uses: tix-factory/release-manager@v1
with: with:

View file

@ -335,7 +335,7 @@ namespace MinecraftClient.Inventory.ItemPalettes
mappings[319] = ItemType.AcaciaStairs; mappings[319] = ItemType.AcaciaStairs;
mappings[320] = ItemType.DarkOakStairs; mappings[320] = ItemType.DarkOakStairs;
mappings[321] = ItemType.SlimeBlock; mappings[321] = ItemType.SlimeBlock;
mappings[322] = ItemType.GrassPath; mappings[322] = ItemType.DirtPath;
mappings[323] = ItemType.Sunflower; mappings[323] = ItemType.Sunflower;
mappings[324] = ItemType.Lilac; mappings[324] = ItemType.Lilac;
mappings[325] = ItemType.RoseBush; mappings[325] = ItemType.RoseBush;

View file

@ -385,7 +385,7 @@ namespace MinecraftClient.Inventory.ItemPalettes
mappings[369] = ItemType.AcaciaStairs; mappings[369] = ItemType.AcaciaStairs;
mappings[370] = ItemType.DarkOakStairs; mappings[370] = ItemType.DarkOakStairs;
mappings[371] = ItemType.SlimeBlock; mappings[371] = ItemType.SlimeBlock;
mappings[372] = ItemType.GrassPath; mappings[372] = ItemType.DirtPath;
mappings[373] = ItemType.Sunflower; mappings[373] = ItemType.Sunflower;
mappings[374] = ItemType.Lilac; mappings[374] = ItemType.Lilac;
mappings[375] = ItemType.RoseBush; mappings[375] = ItemType.RoseBush;

View file

@ -385,7 +385,7 @@ namespace MinecraftClient.Inventory.ItemPalettes
mappings[369] = ItemType.AcaciaStairs; mappings[369] = ItemType.AcaciaStairs;
mappings[370] = ItemType.DarkOakStairs; mappings[370] = ItemType.DarkOakStairs;
mappings[371] = ItemType.SlimeBlock; mappings[371] = ItemType.SlimeBlock;
mappings[372] = ItemType.GrassPath; mappings[372] = ItemType.DirtPath;
mappings[373] = ItemType.Sunflower; mappings[373] = ItemType.Sunflower;
mappings[374] = ItemType.Lilac; mappings[374] = ItemType.Lilac;
mappings[375] = ItemType.RoseBush; mappings[375] = ItemType.RoseBush;

View file

@ -402,7 +402,7 @@ namespace MinecraftClient.Inventory.ItemPalettes
mappings[390] = ItemType.PackedIce; mappings[390] = ItemType.PackedIce;
mappings[391] = ItemType.AcaciaStairs; mappings[391] = ItemType.AcaciaStairs;
mappings[392] = ItemType.DarkOakStairs; mappings[392] = ItemType.DarkOakStairs;
mappings[393] = ItemType.GrassPath; mappings[393] = ItemType.DirtPath;
mappings[394] = ItemType.Sunflower; mappings[394] = ItemType.Sunflower;
mappings[395] = ItemType.Lilac; mappings[395] = ItemType.Lilac;
mappings[396] = ItemType.RoseBush; mappings[396] = ItemType.RoseBush;

View file

@ -402,7 +402,7 @@ namespace MinecraftClient.Inventory.ItemPalettes
mappings[390] = ItemType.PackedIce; mappings[390] = ItemType.PackedIce;
mappings[391] = ItemType.AcaciaStairs; mappings[391] = ItemType.AcaciaStairs;
mappings[392] = ItemType.DarkOakStairs; mappings[392] = ItemType.DarkOakStairs;
mappings[393] = ItemType.GrassPath; mappings[393] = ItemType.DirtPath;
mappings[394] = ItemType.Sunflower; mappings[394] = ItemType.Sunflower;
mappings[395] = ItemType.Lilac; mappings[395] = ItemType.Lilac;
mappings[396] = ItemType.RoseBush; mappings[396] = ItemType.RoseBush;

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,10 @@
namespace MinecraftClient.Inventory namespace MinecraftClient.Inventory
{ {
/// <summary> /// <summary>
/// For MC version 1.16.2. /// Generated using the --generator flag on the client
/// Generated using ItemPaletteGenerator.
/// Typical steps to handle new item IDs for newer Minecraft versions: /// Typical steps to handle new item IDs for newer Minecraft versions:
/// 1. Generate registries.json using data reporting on Vanilla Minecraft (https://wiki.vg/Data_Generators) /// 1. Generate registries.json using data reporting on Vanilla Minecraft (https://wiki.vg/Data_Generators) or download it from: https://github.com/PixiGeko/Minecraft-generated-data
/// 2. Generate temporary ItemTypeXXX.cs and ItemPaletteXXX.cs using ItemPaletteGenerator.cs /// 2. Generate temporary ItemTypeXXX.cs and ItemPaletteXXX.cs using the --generator flag on the client
/// 3. Perform a diff with existing versions, add missing entries in ItemType.cs and ItemTypeExtensions.cs /// 3. Perform a diff with existing versions, add missing entries in ItemType.cs and ItemTypeExtensions.cs
/// 4. If existing entity IDs were not randomized by Mojang, simply add missing entries to the latest existing ItemPaletteXXX.cs /// 4. If existing entity IDs were not randomized by Mojang, simply add missing entries to the latest existing ItemPaletteXXX.cs
/// 5. If existing entity IDs were randomized, add a new palette as ItemPaletteXXX.cs into the codebase /// 5. If existing entity IDs were randomized, add a new palette as ItemPaletteXXX.cs into the codebase
@ -14,9 +13,10 @@ namespace MinecraftClient.Inventory
{ {
Unknown = -2, // Unsupported item type (Forge mod custom item...) Unknown = -2, // Unsupported item type (Forge mod custom item...)
Null = -1, // Unspecified item type (Used in the network protocol) Null = -1, // Unspecified item type (Used in the network protocol)
AcaciaBoat, AcaciaBoat,
AcaciaButton, AcaciaButton,
AcaciaChestBoat,
AcaciaDoor, AcaciaDoor,
AcaciaFence, AcaciaFence,
AcaciaFenceGate, AcaciaFenceGate,
@ -32,6 +32,7 @@ namespace MinecraftClient.Inventory
AcaciaWood, AcaciaWood,
ActivatorRail, ActivatorRail,
Air, Air,
AllaySpawnEgg,
Allium, Allium,
AmethystBlock, AmethystBlock,
AmethystCluster, AmethystCluster,
@ -69,6 +70,7 @@ namespace MinecraftClient.Inventory
BigDripleaf, BigDripleaf,
BirchBoat, BirchBoat,
BirchButton, BirchButton,
BirchChestBoat,
BirchDoor, BirchDoor,
BirchFence, BirchFence,
BirchFenceGate, BirchFenceGate,
@ -279,6 +281,7 @@ namespace MinecraftClient.Inventory
Dandelion, Dandelion,
DarkOakBoat, DarkOakBoat,
DarkOakButton, DarkOakButton,
DarkOakChestBoat,
DarkOakDoor, DarkOakDoor,
DarkOakFence, DarkOakFence,
DarkOakFenceGate, DarkOakFenceGate,
@ -349,6 +352,8 @@ namespace MinecraftClient.Inventory
DioriteStairs, DioriteStairs,
DioriteWall, DioriteWall,
Dirt, Dirt,
DirtPath,
DiscFragment5,
Dispenser, Dispenser,
DolphinSpawnEgg, DolphinSpawnEgg,
DonkeySpawnEgg, DonkeySpawnEgg,
@ -360,6 +365,7 @@ namespace MinecraftClient.Inventory
DripstoneBlock, DripstoneBlock,
Dropper, Dropper,
DrownedSpawnEgg, DrownedSpawnEgg,
EchoShard,
Egg, Egg,
ElderGuardianSpawnEgg, ElderGuardianSpawnEgg,
Elytra, Elytra,
@ -408,6 +414,8 @@ namespace MinecraftClient.Inventory
FloweringAzalea, FloweringAzalea,
FloweringAzaleaLeaves, FloweringAzaleaLeaves,
FoxSpawnEgg, FoxSpawnEgg,
FrogSpawnEgg,
Frogspawn,
Furnace, Furnace,
FurnaceMinecart, FurnaceMinecart,
GhastSpawnEgg, GhastSpawnEgg,
@ -425,6 +433,7 @@ namespace MinecraftClient.Inventory
GlowSquidSpawnEgg, GlowSquidSpawnEgg,
Glowstone, Glowstone,
GlowstoneDust, GlowstoneDust,
GoatHorn,
GoatSpawnEgg, GoatSpawnEgg,
GoldBlock, GoldBlock,
GoldIngot, GoldIngot,
@ -448,7 +457,6 @@ namespace MinecraftClient.Inventory
GraniteWall, GraniteWall,
Grass, Grass,
GrassBlock, GrassBlock,
GrassPath,
Gravel, Gravel,
GrayBanner, GrayBanner,
GrayBed, GrayBed,
@ -527,6 +535,7 @@ namespace MinecraftClient.Inventory
Jukebox, Jukebox,
JungleBoat, JungleBoat,
JungleButton, JungleButton,
JungleChestBoat,
JungleDoor, JungleDoor,
JungleFence, JungleFence,
JungleFenceGate, JungleFenceGate,
@ -624,6 +633,23 @@ namespace MinecraftClient.Inventory
MagmaBlock, MagmaBlock,
MagmaCream, MagmaCream,
MagmaCubeSpawnEgg, MagmaCubeSpawnEgg,
MangroveBoat,
MangroveButton,
MangroveChestBoat,
MangroveDoor,
MangroveFence,
MangroveFenceGate,
MangroveLeaves,
MangroveLog,
MangrovePlanks,
MangrovePressurePlate,
MangrovePropagule,
MangroveRoots,
MangroveSign,
MangroveSlab,
MangroveStairs,
MangroveTrapdoor,
MangroveWood,
Map, Map,
MediumAmethystBud, MediumAmethystBud,
Melon, Melon,
@ -643,11 +669,18 @@ namespace MinecraftClient.Inventory
MossyStoneBrickStairs, MossyStoneBrickStairs,
MossyStoneBrickWall, MossyStoneBrickWall,
MossyStoneBricks, MossyStoneBricks,
Mud,
MudBrickSlab,
MudBrickStairs,
MudBrickWall,
MudBricks,
MuddyMangroveRoots,
MuleSpawnEgg, MuleSpawnEgg,
MushroomStem, MushroomStem,
MushroomStew, MushroomStew,
MusicDisc11, MusicDisc11,
MusicDisc13, MusicDisc13,
MusicDisc5,
MusicDiscBlocks, MusicDiscBlocks,
MusicDiscCat, MusicDiscCat,
MusicDiscChirp, MusicDiscChirp,
@ -692,6 +725,7 @@ namespace MinecraftClient.Inventory
NoteBlock, NoteBlock,
OakBoat, OakBoat,
OakButton, OakButton,
OakChestBoat,
OakDoor, OakDoor,
OakFence, OakFence,
OakFenceGate, OakFenceGate,
@ -708,6 +742,7 @@ namespace MinecraftClient.Inventory
Observer, Observer,
Obsidian, Obsidian,
OcelotSpawnEgg, OcelotSpawnEgg,
OchreFroglight,
OrangeBanner, OrangeBanner,
OrangeBed, OrangeBed,
OrangeCandle, OrangeCandle,
@ -728,10 +763,12 @@ namespace MinecraftClient.Inventory
OxidizedCutCopperSlab, OxidizedCutCopperSlab,
OxidizedCutCopperStairs, OxidizedCutCopperStairs,
PackedIce, PackedIce,
PackedMud,
Painting, Painting,
PandaSpawnEgg, PandaSpawnEgg,
Paper, Paper,
ParrotSpawnEgg, ParrotSpawnEgg,
PearlescentFroglight,
Peony, Peony,
PetrifiedOakSlab, PetrifiedOakSlab,
PhantomMembrane, PhantomMembrane,
@ -843,6 +880,7 @@ namespace MinecraftClient.Inventory
RawGoldBlock, RawGoldBlock,
RawIron, RawIron,
RawIronBlock, RawIronBlock,
RecoveryCompass,
RedBanner, RedBanner,
RedBed, RedBed,
RedCandle, RedCandle,
@ -873,6 +911,7 @@ namespace MinecraftClient.Inventory
RedstoneLamp, RedstoneLamp,
RedstoneOre, RedstoneOre,
RedstoneTorch, RedstoneTorch,
ReinforcedDeepslate,
Repeater, Repeater,
RepeatingCommandBlock, RepeatingCommandBlock,
RespawnAnchor, RespawnAnchor,
@ -889,7 +928,11 @@ namespace MinecraftClient.Inventory
SandstoneStairs, SandstoneStairs,
SandstoneWall, SandstoneWall,
Scaffolding, Scaffolding,
Sculk,
SculkCatalyst,
SculkSensor, SculkSensor,
SculkShrieker,
SculkVein,
Scute, Scute,
SeaLantern, SeaLantern,
SeaPickle, SeaPickle,
@ -942,6 +985,7 @@ namespace MinecraftClient.Inventory
SporeBlossom, SporeBlossom,
SpruceBoat, SpruceBoat,
SpruceButton, SpruceButton,
SpruceChestBoat,
SpruceDoor, SpruceDoor,
SpruceFence, SpruceFence,
SpruceFenceGate, SpruceFenceGate,
@ -987,6 +1031,8 @@ namespace MinecraftClient.Inventory
StrippedDarkOakWood, StrippedDarkOakWood,
StrippedJungleLog, StrippedJungleLog,
StrippedJungleWood, StrippedJungleWood,
StrippedMangroveLog,
StrippedMangroveWood,
StrippedOakLog, StrippedOakLog,
StrippedOakWood, StrippedOakWood,
StrippedSpruceLog, StrippedSpruceLog,
@ -1000,6 +1046,8 @@ namespace MinecraftClient.Inventory
Sunflower, Sunflower,
SuspiciousStew, SuspiciousStew,
SweetBerries, SweetBerries,
TadpoleBucket,
TadpoleSpawnEgg,
TallGrass, TallGrass,
Target, Target,
Terracotta, Terracotta,
@ -1024,11 +1072,13 @@ namespace MinecraftClient.Inventory
TurtleHelmet, TurtleHelmet,
TurtleSpawnEgg, TurtleSpawnEgg,
TwistingVines, TwistingVines,
VerdantFroglight,
VexSpawnEgg, VexSpawnEgg,
VillagerSpawnEgg, VillagerSpawnEgg,
VindicatorSpawnEgg, VindicatorSpawnEgg,
Vine, Vine,
WanderingTraderSpawnEgg, WanderingTraderSpawnEgg,
WardenSpawnEgg,
WarpedButton, WarpedButton,
WarpedDoor, WarpedDoor,
WarpedFence, WarpedFence,

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace MinecraftClient.Mapping.BlockPalettes namespace MinecraftClient.Mapping.BlockPalettes

View file

@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
namespace MinecraftClient.Mapping.EntityPalettes
{
public class EntityPalette119 : EntityPalette
{
private static Dictionary<int, EntityType> mappings = new Dictionary<int, EntityType>();
static EntityPalette119()
{
mappings[0] = EntityType.Allay;
mappings[1] = EntityType.AreaEffectCloud;
mappings[2] = EntityType.ArmorStand;
mappings[3] = EntityType.Arrow;
mappings[4] = EntityType.Axolotl;
mappings[5] = EntityType.Bat;
mappings[6] = EntityType.Bee;
mappings[7] = EntityType.Blaze;
mappings[8] = EntityType.Boat;
mappings[10] = EntityType.Cat;
mappings[11] = EntityType.CaveSpider;
mappings[9] = EntityType.ChestBoat;
mappings[54] = EntityType.ChestMinecart;
mappings[12] = EntityType.Chicken;
mappings[13] = EntityType.Cod;
mappings[55] = EntityType.CommandBlockMinecart;
mappings[14] = EntityType.Cow;
mappings[15] = EntityType.Creeper;
mappings[16] = EntityType.Dolphin;
mappings[17] = EntityType.Donkey;
mappings[18] = EntityType.DragonFireball;
mappings[19] = EntityType.Drowned;
mappings[93] = EntityType.Egg;
mappings[20] = EntityType.ElderGuardian;
mappings[21] = EntityType.EndCrystal;
mappings[22] = EntityType.EnderDragon;
mappings[94] = EntityType.EnderPearl;
mappings[23] = EntityType.Enderman;
mappings[24] = EntityType.Endermite;
mappings[25] = EntityType.Evoker;
mappings[26] = EntityType.EvokerFangs;
mappings[95] = EntityType.ExperienceBottle;
mappings[27] = EntityType.ExperienceOrb;
mappings[28] = EntityType.EyeOfEnder;
mappings[29] = EntityType.FallingBlock;
mappings[46] = EntityType.Fireball;
mappings[30] = EntityType.FireworkRocket;
mappings[117] = EntityType.FishingBobber;
mappings[31] = EntityType.Fox;
mappings[32] = EntityType.Frog;
mappings[56] = EntityType.FurnaceMinecart;
mappings[33] = EntityType.Ghast;
mappings[34] = EntityType.Giant;
mappings[35] = EntityType.GlowItemFrame;
mappings[36] = EntityType.GlowSquid;
mappings[37] = EntityType.Goat;
mappings[38] = EntityType.Guardian;
mappings[39] = EntityType.Hoglin;
mappings[57] = EntityType.HopperMinecart;
mappings[40] = EntityType.Horse;
mappings[41] = EntityType.Husk;
mappings[42] = EntityType.Illusioner;
mappings[43] = EntityType.IronGolem;
mappings[44] = EntityType.Item;
mappings[45] = EntityType.ItemFrame;
mappings[47] = EntityType.LeashKnot;
mappings[48] = EntityType.LightningBolt;
mappings[49] = EntityType.Llama;
mappings[50] = EntityType.LlamaSpit;
mappings[51] = EntityType.MagmaCube;
mappings[52] = EntityType.Marker;
mappings[53] = EntityType.Minecart;
mappings[61] = EntityType.Mooshroom;
mappings[60] = EntityType.Mule;
mappings[62] = EntityType.Ocelot;
mappings[63] = EntityType.Painting;
mappings[64] = EntityType.Panda;
mappings[65] = EntityType.Parrot;
mappings[66] = EntityType.Phantom;
mappings[67] = EntityType.Pig;
mappings[68] = EntityType.Piglin;
mappings[69] = EntityType.PiglinBrute;
mappings[70] = EntityType.Pillager;
mappings[116] = EntityType.Player;
mappings[71] = EntityType.PolarBear;
mappings[96] = EntityType.Potion;
mappings[73] = EntityType.Pufferfish;
mappings[74] = EntityType.Rabbit;
mappings[75] = EntityType.Ravager;
mappings[76] = EntityType.Salmon;
mappings[77] = EntityType.Sheep;
mappings[78] = EntityType.Shulker;
mappings[79] = EntityType.ShulkerBullet;
mappings[80] = EntityType.Silverfish;
mappings[81] = EntityType.Skeleton;
mappings[82] = EntityType.SkeletonHorse;
mappings[83] = EntityType.Slime;
mappings[84] = EntityType.SmallFireball;
mappings[85] = EntityType.SnowGolem;
mappings[86] = EntityType.Snowball;
mappings[58] = EntityType.SpawnerMinecart;
mappings[87] = EntityType.SpectralArrow;
mappings[88] = EntityType.Spider;
mappings[89] = EntityType.Squid;
mappings[90] = EntityType.Stray;
mappings[91] = EntityType.Strider;
mappings[92] = EntityType.Tadpole;
mappings[72] = EntityType.Tnt;
mappings[59] = EntityType.TntMinecart;
mappings[98] = EntityType.TraderLlama;
mappings[97] = EntityType.Trident;
mappings[99] = EntityType.TropicalFish;
mappings[100] = EntityType.Turtle;
mappings[101] = EntityType.Vex;
mappings[102] = EntityType.Villager;
mappings[103] = EntityType.Vindicator;
mappings[104] = EntityType.WanderingTrader;
mappings[105] = EntityType.Warden;
mappings[106] = EntityType.Witch;
mappings[107] = EntityType.Wither;
mappings[108] = EntityType.WitherSkeleton;
mappings[109] = EntityType.WitherSkull;
mappings[110] = EntityType.Wolf;
mappings[111] = EntityType.Zoglin;
mappings[112] = EntityType.Zombie;
mappings[113] = EntityType.ZombieHorse;
mappings[114] = EntityType.ZombieVillager;
mappings[115] = EntityType.ZombifiedPiglin;
}
protected override Dictionary<int, EntityType> GetDict()
{
return mappings;
}
}
}

View file

@ -4,16 +4,17 @@ namespace MinecraftClient.Mapping
/// Represents Minecraft Entity Types /// Represents Minecraft Entity Types
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Generated from registries.json using EntityPaletteGenerator.cs. /// Generated from registries.json using the --generator flag on the client
/// Typical steps to handle new entity IDs for newer Minecraft versions: /// Typical steps to handle new entity IDs for newer Minecraft versions:
/// 1. Generate registries.json using data reporting on Vanilla Minecraft (https://wiki.vg/Data_Generators) /// 1. Generate registries.json using data reporting on Vanilla Minecraft (https://wiki.vg/Data_Generators) or download it from: https://github.com/PixiGeko/Minecraft-generated-data
/// 2. Generate temporary EntityTypeXXX.cs and EntityPaletteXXX.cs using EntityPaletteGenerator.cs /// 2. Generate temporary EntityTypeXXX.cs and EntityPaletteXXX.cs using the --generator flag on the client
/// 3. Perform a diff with existing versions, add missing entries in EntityType.cs and EntityTypeExtensions.cs /// 3. Perform a diff with existing versions, add missing entries in EntityType.cs and EntityTypeExtensions.cs
/// 4. If existing entity IDs were not randomized by Mojang, simply add missing entries to the latest existing EntityPaletteXXX.cs /// 4. If existing entity IDs were not randomized by Mojang, simply add missing entries to the latest existing EntityPaletteXXX.cs
/// 5. If existing entity IDs were randomized, add a new palette as EntityPaletteXXX.cs into the codebase (worst case) /// 5. If existing entity IDs were randomized, add a new palette as EntityPaletteXXX.cs into the codebase (worst case)
/// </remarks> /// </remarks>
public enum EntityType public enum EntityType
{ {
Allay,
AreaEffectCloud, AreaEffectCloud,
ArmorStand, ArmorStand,
Arrow, Arrow,
@ -24,6 +25,7 @@ namespace MinecraftClient.Mapping
Boat, Boat,
Cat, Cat,
CaveSpider, CaveSpider,
ChestBoat,
ChestMinecart, ChestMinecart,
Chicken, Chicken,
Cod, Cod,
@ -38,9 +40,9 @@ namespace MinecraftClient.Mapping
ElderGuardian, ElderGuardian,
EndCrystal, EndCrystal,
EnderDragon, EnderDragon,
EnderPearl,
Enderman, Enderman,
Endermite, Endermite,
EnderPearl,
Evoker, Evoker,
EvokerFangs, EvokerFangs,
ExperienceBottle, ExperienceBottle,
@ -51,6 +53,7 @@ namespace MinecraftClient.Mapping
FireworkRocket, FireworkRocket,
FishingBobber, FishingBobber,
Fox, Fox,
Frog,
FurnaceMinecart, FurnaceMinecart,
Ghast, Ghast,
Giant, Giant,
@ -99,14 +102,15 @@ namespace MinecraftClient.Mapping
SkeletonHorse, SkeletonHorse,
Slime, Slime,
SmallFireball, SmallFireball,
Snowball,
SnowGolem, SnowGolem,
Snowball,
SpawnerMinecart, SpawnerMinecart,
SpectralArrow, SpectralArrow,
Spider, Spider,
Squid, Squid,
Stray, Stray,
Strider, Strider,
Tadpole,
Tnt, Tnt,
TntMinecart, TntMinecart,
TraderLlama, TraderLlama,
@ -117,6 +121,7 @@ namespace MinecraftClient.Mapping
Villager, Villager,
Vindicator, Vindicator,
WanderingTrader, WanderingTrader,
Warden,
Witch, Witch,
Wither, Wither,
WitherSkeleton, WitherSkeleton,

File diff suppressed because it is too large Load diff

View file

@ -403,13 +403,13 @@ namespace MinecraftClient.Protocol.Handlers
Double entityX = ReadNextDouble(cache); Double entityX = ReadNextDouble(cache);
Double entityY = ReadNextDouble(cache); Double entityY = ReadNextDouble(cache);
Double entityZ = ReadNextDouble(cache); Double entityZ = ReadNextDouble(cache);
byte entityYaw = ReadNextByte(cache);
byte entityPitch = ReadNextByte(cache); byte entityPitch = ReadNextByte(cache);
byte entityYaw = ReadNextByte(cache);
int metadata = -1; int metadata = -1;
if (living) if (living)
{ {
if (protocolversion >= Protocol18Handler.MC_1_18_2_Version) if (protocolversion == Protocol18Handler.MC_1_18_2_Version)
entityYaw = ReadNextByte(cache); entityYaw = ReadNextByte(cache);
else else
entityPitch = ReadNextByte(cache); entityPitch = ReadNextByte(cache);
@ -418,15 +418,17 @@ namespace MinecraftClient.Protocol.Handlers
{ {
if (protocolversion >= Protocol18Handler.MC_1_19_Version) if (protocolversion >= Protocol18Handler.MC_1_19_Version)
{ {
metadata = ReadNextVarInt(cache);
entityYaw = ReadNextByte(cache); entityYaw = ReadNextByte(cache);
metadata = ReadNextVarInt(cache);
} }
else else
metadata = ReadNextInt(cache); metadata = ReadNextInt(cache);
} }
short velocityX = ReadNextShort(cache); short velocityX = ReadNextShort(cache);
short velocityY = ReadNextShort(cache); short velocityY = ReadNextShort(cache);
short velocityZ = ReadNextShort(cache); short velocityZ = ReadNextShort(cache);
return new Entity(entityID, entityType, new Location(entityX, entityY, entityZ), entityYaw, entityPitch, metadata); return new Entity(entityID, entityType, new Location(entityX, entityY, entityZ), entityYaw, entityPitch, metadata);
} }

View file

@ -24,7 +24,7 @@ using MinecraftClient.Protocol.Message;
namespace MinecraftClient.Protocol.Handlers namespace MinecraftClient.Protocol.Handlers
{ {
/// <summary> /// <summary>
/// Implementation for Minecraft 1.7.X+ Protocols /// Implementation for Minecraft 1.8.X+ Protocols
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Typical update steps for implementing protocol changes for a new Minecraft version: /// Typical update steps for implementing protocol changes for a new Minecraft version:
@ -96,20 +96,18 @@ namespace MinecraftClient.Protocol.Handlers
this.packetPalette = new PacketTypeHandler(protocolVersion, forgeInfo != null).GetTypeHandler(); this.packetPalette = new PacketTypeHandler(protocolVersion, forgeInfo != null).GetTypeHandler();
this.log = handler.GetLogger(); this.log = handler.GetLogger();
this.randomGen = RandomNumberGenerator.Create(); this.randomGen = RandomNumberGenerator.Create();
if (handler.GetTerrainEnabled() && protocolVersion > MC_1_18_2_Version)
if (handler.GetTerrainEnabled() && this.protocolVersion > MC_1_19_2_Version)
{ {
log.Error(Translations.Get("extra.terrainandmovement_disabled")); log.Error(Translations.Get("extra.terrainandmovement_disabled"));
handler.SetTerrainEnabled(false); handler.SetTerrainEnabled(false);
} }
if (handler.GetInventoryEnabled() && (this.protocolVersion < MC_1_10_Version || this.protocolVersion > MC_1_18_2_Version)) if (handler.GetInventoryEnabled() && (protocolVersion < MC_1_10_Version || protocolVersion > MC_1_19_Version))
{ {
log.Error(Translations.Get("extra.inventory_disabled")); log.Error(Translations.Get("extra.inventory_disabled"));
handler.SetInventoryEnabled(false); handler.SetInventoryEnabled(false);
} }
if (handler.GetEntityHandlingEnabled() && (protocolVersion < MC_1_10_Version || protocolVersion > MC_1_19_Version))
if (handler.GetEntityHandlingEnabled() && (this.protocolVersion < MC_1_10_Version || this.protocolVersion > MC_1_18_2_Version))
{ {
log.Error(Translations.Get("extra.entity_disabled")); log.Error(Translations.Get("extra.entity_disabled"));
handler.SetEntityHandlingEnabled(false); handler.SetEntityHandlingEnabled(false);
@ -135,23 +133,24 @@ namespace MinecraftClient.Protocol.Handlers
Block.Palette = new Palette112(); Block.Palette = new Palette112();
// Entity palette // Entity palette
if (this.protocolVersion >= MC_1_13_Version) if (protocolVersion >= MC_1_13_Version)
{ {
if (this.protocolVersion > MC_1_18_2_Version && handler.GetEntityHandlingEnabled()) if (protocolVersion > MC_1_19_Version && handler.GetEntityHandlingEnabled())
throw new NotImplementedException(Translations.Get("exception.palette.entity")); throw new NotImplementedException(Translations.Get("exception.palette.entity"));
if (this.protocolVersion >= MC_1_17_Version) if (protocolVersion == MC_1_19_Version)
entityPalette = new EntityPalette119();
else if (protocolVersion >= MC_1_17_Version)
entityPalette = new EntityPalette117(); entityPalette = new EntityPalette117();
else if (this.protocolVersion >= MC_1_16_2_Version) else if (protocolVersion >= MC_1_16_2_Version)
entityPalette = new EntityPalette1162(); entityPalette = new EntityPalette1162();
else if (this.protocolVersion >= MC_1_16_Version) else if (protocolVersion >= MC_1_16_Version)
entityPalette = new EntityPalette1161(); entityPalette = new EntityPalette1161();
else if (this.protocolVersion >= MC_1_15_Version) else if (protocolVersion >= MC_1_15_Version)
entityPalette = new EntityPalette115(); entityPalette = new EntityPalette115();
else if (protocolVersion >= MC_1_14_Version) else if (protocolVersion >= MC_1_14_Version)
entityPalette = new EntityPalette114(); entityPalette = new EntityPalette114();
else else entityPalette = new EntityPalette113();
entityPalette = new EntityPalette113();
} }
else entityPalette = new EntityPalette112(); else entityPalette = new EntityPalette112();
@ -161,14 +160,16 @@ namespace MinecraftClient.Protocol.Handlers
if (protocolVersion > MC_1_19_Version && handler.GetInventoryEnabled()) if (protocolVersion > MC_1_19_Version && handler.GetInventoryEnabled())
throw new NotImplementedException(Translations.Get("exception.palette.item")); throw new NotImplementedException(Translations.Get("exception.palette.item"));
if (protocolVersion >= MC_1_18_1_Version) if (protocolVersion == MC_1_19_Version)
itemPalette = new ItemPalette119();
else if (protocolVersion >= MC_1_18_1_Version)
itemPalette = new ItemPalette118(); itemPalette = new ItemPalette118();
else if (protocolVersion >= MC_1_17_Version) else if (protocolVersion >= MC_1_17_Version)
itemPalette = new ItemPalette117(); itemPalette = new ItemPalette117();
else if (protocolVersion >= MC_1_16_2_Version) else if (protocolVersion >= MC_1_16_2_Version)
itemPalette = new ItemPalette1162(); if (protocolVersion >= MC_1_16_2_Version)
else itemPalette = new ItemPalette1162();
itemPalette = new ItemPalette1161(); else itemPalette = new ItemPalette1161();
} }
else itemPalette = new ItemPalette115(); else itemPalette = new ItemPalette115();
@ -1417,7 +1418,7 @@ namespace MinecraftClient.Protocol.Handlers
healthField = 8; // 1.14 and above healthField = 8; // 1.14 and above
if (protocolVersion >= MC_1_17_Version) if (protocolVersion >= MC_1_17_Version)
healthField = 9; // 1.17 and above healthField = 9; // 1.17 and above
if (protocolVersion > MC_1_18_2_Version) if (protocolVersion > MC_1_19_Version)
throw new NotImplementedException(Translations.Get("exception.palette.healthfield")); throw new NotImplementedException(Translations.Get("exception.palette.healthfield"));
if (metadata.ContainsKey(healthField) && metadata[healthField] != null && metadata[healthField].GetType() == typeof(float)) if (metadata.ContainsKey(healthField) && metadata[healthField] != null && metadata[healthField].GetType() == typeof(float))
@ -1887,7 +1888,7 @@ namespace MinecraftClient.Protocol.Handlers
/// Ping a Minecraft server to get information about the server /// Ping a Minecraft server to get information about the server
/// </summary> /// </summary>
/// <returns>True if ping was successful</returns> /// <returns>True if ping was successful</returns>
public static bool doPing(string host, int port, ref int protocolversion, ref ForgeInfo? forgeInfo) public static bool doPing(string host, int port, ref int protocolVersion, ref ForgeInfo? forgeInfo)
{ {
string version = ""; string version = "";
TcpClient tcp = ProxyHandler.newTcpClient(host, port); TcpClient tcp = ProxyHandler.newTcpClient(host, port);
@ -1939,12 +1940,12 @@ namespace MinecraftClient.Protocol.Handlers
//Retrieve protocol version number for handling this server //Retrieve protocol version number for handling this server
if (versionData.Properties.ContainsKey("protocol")) if (versionData.Properties.ContainsKey("protocol"))
protocolversion = int.Parse(versionData.Properties["protocol"].StringValue); protocolVersion = int.Parse(versionData.Properties["protocol"].StringValue);
// Check for forge on the server. // Check for forge on the server.
Protocol18Forge.ServerInfoCheckForge(jsonData, ref forgeInfo); Protocol18Forge.ServerInfoCheckForge(jsonData, ref forgeInfo);
ConsoleIO.WriteLineFormatted(Translations.Get("mcc.server_protocol", version, protocolversion + (forgeInfo != null ? Translations.Get("mcc.with_forge") : ""))); ConsoleIO.WriteLineFormatted(Translations.Get("mcc.server_protocol", version, protocolVersion + (forgeInfo != null ? Translations.Get("mcc.with_forge") : "")));
return true; return true;
} }