Skip to content

Commit

Permalink
1.21.4 THE CREAKING (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tides authored Dec 5, 2024
1 parent dac82a3 commit 75a8a71
Show file tree
Hide file tree
Showing 33 changed files with 36,100 additions and 27,822 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docfx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Update Docs
on:
workflow_dispatch:
push:
branches: [1.*]
branches: [1.21.x]
paths:
- "**/*.cs"
- "**/*.csproj"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nuget-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Nuget
on:
workflow_dispatch:
push:
branches: ["1.*"]
branches: ["1.21.x"]
# Publish semver tags as releases.
tags: ["v*.*.*"]
# don't publish when we change workflow files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ public sealed class TrimMaterialElement

public required string AssetName { get; init; }

public required double ItemModelIndex { get; init; }

public required TrimDescription Description { get; init; }

public Dictionary<string, string>? OverrideArmorMaterials { get; init; }
public Dictionary<string, string>? OverrideArmorAssets { get; init; }
}
2 changes: 1 addition & 1 deletion Obsidian.API/Registry/Codecs/Biomes/BiomeEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public sealed record class BiomeEffect
public string? GrassColorModifier { get; set; }
public string? AmbientSound { get; set; }

public BiomeMusicEffect? Music { get; set; }
public BiomeMusicEffectData[]? Music { get; set; }
public BiomeAdditionSound? AdditionsSound { get; set; }
public BiomeParticle? Particle { get; set; }

Expand Down
7 changes: 7 additions & 0 deletions Obsidian.API/Registry/Codecs/Biomes/BiomeMusicEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ public sealed record class BiomeMusicEffect

public required int MinDelay { get; set; }
}

public sealed record class BiomeMusicEffectData
{
public required BiomeMusicEffect Data { get; set; }

public int Weight { get; set; }
}
51 changes: 26 additions & 25 deletions Obsidian.API/_Enums/Biome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,30 @@ public enum Biome : int
OldGrowthBirchForest = 36,
OldGrowthPineTaiga = 37,
OldGrowthSpruceTaiga = 38,
Plains = 39,
River = 40,
Savanna = 41,
SavannaPlateau = 42,
SmallEndIslands = 43,
SnowyBeach = 44,
SnowyPlains = 45,
SnowySlopes = 46,
SnowyTaiga = 47,
SoulSandValley = 48,
SparseJungle = 49,
StonyPeaks = 50,
StonyShore = 51,
SunflowerPlains = 52,
Swamp = 53,
Taiga = 54,
TheEnd = 55,
TheVoid = 56,
WarmOcean = 57,
WarpedForest = 58,
WindsweptForest = 59,
WindsweptGravellyHills = 60,
WindsweptHills = 61,
WindsweptSavanna = 62,
WoodedBadlands = 63,
PaleGarden = 39,
Plains = 40,
River = 41,
Savanna = 42,
SavannaPlateau = 43,
SmallEndIslands = 44,
SnowyBeach = 45,
SnowyPlains = 46,
SnowySlopes = 47,
SnowyTaiga = 48,
SoulSandValley = 49,
SparseJungle = 50,
StonyPeaks = 51,
StonyShore = 52,
SunflowerPlains = 53,
Swamp = 54,
Taiga = 55,
TheEnd = 56,
TheVoid = 57,
WarmOcean = 58,
WarpedForest = 59,
WindsweptForest = 60,
WindsweptGravellyHills = 61,
WindsweptHills = 62,
WindsweptSavanna = 63,
WoodedBadlands = 64,
}
1 change: 0 additions & 1 deletion Obsidian.API/_Enums/EntityType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public enum EntityType : int
CommandBlockMinecart,
Cow,
Creaking,
CreakingTransient,
Creeper,
DarkOakBoat,
DarkOakChestBoat,
Expand Down
155 changes: 78 additions & 77 deletions Obsidian.API/_Enums/ParticleType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,81 +36,82 @@ public enum ParticleType : int
Flame = 31,
Infested = 32,
CherryLeaves = 33,
SculkSoul = 34,
SculkCharge = 35,
SculkChargePop = 36,
SoulFireFlame = 37,
Soul = 38,
Flash = 39,
HappyVillager = 40,
Composter = 41,
Heart = 42,
InstantEffect = 43,
Item = 44,
Vibration = 45,
Trail = 46,
ItemSlime = 47,
ItemCobweb = 48,
ItemSnowball = 49,
LargeSmoke = 50,
Lava = 51,
Mycelium = 52,
Note = 53,
Poof = 54,
Portal = 55,
Rain = 56,
Smoke = 57,
WhiteSmoke = 58,
Sneeze = 59,
Spit = 60,
SquidInk = 61,
SweepAttack = 62,
TotemOfUndying = 63,
Underwater = 64,
Splash = 65,
Witch = 66,
BubblePop = 67,
CurrentDown = 68,
BubbleColumnUp = 69,
Nautilus = 70,
Dolphin = 71,
CampfireCosySmoke = 72,
CampfireSignalSmoke = 73,
DrippingHoney = 74,
FallingHoney = 75,
LandingHoney = 76,
FallingNectar = 77,
FallingSporeBlossom = 78,
Ash = 79,
CrimsonSpore = 80,
WarpedSpore = 81,
SporeBlossomAir = 82,
DrippingObsidianTear = 83,
FallingObsidianTear = 84,
LandingObsidianTear = 85,
ReversePortal = 86,
WhiteAsh = 87,
SmallFlame = 88,
Snowflake = 89,
DrippingDripstoneLava = 90,
FallingDripstoneLava = 91,
DrippingDripstoneWater = 92,
FallingDripstoneWater = 93,
GlowSquidInk = 94,
Glow = 95,
WaxOn = 96,
WaxOff = 97,
ElectricSpark = 98,
Scrape = 99,
Shriek = 100,
EggCrack = 101,
DustPlume = 102,
TrialSpawnerDetection = 103,
TrialSpawnerDetectionOminous = 104,
VaultConnection = 105,
DustPillar = 106,
OminousSpawning = 107,
RaidOmen = 108,
TrialOmen = 109,
BlockCrumble = 110,
PaleOakLeaves = 34,
SculkSoul = 35,
SculkCharge = 36,
SculkChargePop = 37,
SoulFireFlame = 38,
Soul = 39,
Flash = 40,
HappyVillager = 41,
Composter = 42,
Heart = 43,
InstantEffect = 44,
Item = 45,
Vibration = 46,
Trail = 47,
ItemSlime = 48,
ItemCobweb = 49,
ItemSnowball = 50,
LargeSmoke = 51,
Lava = 52,
Mycelium = 53,
Note = 54,
Poof = 55,
Portal = 56,
Rain = 57,
Smoke = 58,
WhiteSmoke = 59,
Sneeze = 60,
Spit = 61,
SquidInk = 62,
SweepAttack = 63,
TotemOfUndying = 64,
Underwater = 65,
Splash = 66,
Witch = 67,
BubblePop = 68,
CurrentDown = 69,
BubbleColumnUp = 70,
Nautilus = 71,
Dolphin = 72,
CampfireCosySmoke = 73,
CampfireSignalSmoke = 74,
DrippingHoney = 75,
FallingHoney = 76,
LandingHoney = 77,
FallingNectar = 78,
FallingSporeBlossom = 79,
Ash = 80,
CrimsonSpore = 81,
WarpedSpore = 82,
SporeBlossomAir = 83,
DrippingObsidianTear = 84,
FallingObsidianTear = 85,
LandingObsidianTear = 86,
ReversePortal = 87,
WhiteAsh = 88,
SmallFlame = 89,
Snowflake = 90,
DrippingDripstoneLava = 91,
FallingDripstoneLava = 92,
DrippingDripstoneWater = 93,
FallingDripstoneWater = 94,
GlowSquidInk = 95,
Glow = 96,
WaxOn = 97,
WaxOff = 98,
ElectricSpark = 99,
Scrape = 100,
Shriek = 101,
EggCrack = 102,
DustPlume = 103,
TrialSpawnerDetection = 104,
TrialSpawnerDetectionOminous = 105,
VaultConnection = 106,
DustPillar = 107,
OminousSpawning = 108,
RaidOmen = 109,
TrialOmen = 110,
BlockCrumble = 111,
}
5 changes: 4 additions & 1 deletion Obsidian.API/_Enums/ProtocolVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ public enum ProtocolVersion
v1_21_1 = 767,

[Description("1.21.3")]
v1_21_3 = 768
v1_21_3 = 768,

[Description("1.21.4")]
v1_21_4 = 769
}
38 changes: 35 additions & 3 deletions Obsidian.SourceGenerators/Extensions.CodeBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,29 @@ internal static void ParseMonsterLightValue(this CodeBuilder builder, JsonElemen
builder.Append("}, ");
}

internal static void ParseArray(this CodeBuilder builder, JsonElement element, SourceProductionContext ctx, bool isDictionary = false)
{
builder.Append("[");

foreach (var value in element.EnumerateArray())
{
if (value.ValueKind is JsonValueKind.Object)
{
builder.ParseProperty(value, ctx, isDictionary);
continue;
}
else if (value.ValueKind == JsonValueKind.Array)
{
builder.ParseArray(element, ctx, isDictionary);
continue;
}

builder.AppendValueType(value, ctx, isDictionary);
}

builder.Append("], ");
}

internal static void ParseProperty(this CodeBuilder builder, JsonElement element, SourceProductionContext ctx, bool isDictionary = false)
{
builder.Append("new() { ");
Expand All @@ -46,12 +69,16 @@ internal static void ParseProperty(this CodeBuilder builder, JsonElement element
{
foreach (var value in element.EnumerateArray())
{
if (value.ValueKind is JsonValueKind.Object or JsonValueKind.Array)
if (value.ValueKind is JsonValueKind.Object)
{
builder.ParseProperty(value, ctx, isDictionary);
continue;
}

else if (value.ValueKind == JsonValueKind.Array)
{
builder.ParseArray(value, ctx, isDictionary);
continue;
}
builder.AppendValueType(value, ctx, isDictionary);
}
}
Expand All @@ -74,11 +101,16 @@ internal static void ParseProperty(this CodeBuilder builder, JsonElement element
}
}

if (value.ValueKind is JsonValueKind.Object or JsonValueKind.Array)
if (value.ValueKind is JsonValueKind.Object)
{
builder.ParseProperty(value, ctx, isDictionary);
continue;
}
else if (value.ValueKind == JsonValueKind.Array)
{
builder.ParseArray(value, ctx, isDictionary);
continue;
}

builder.AppendValueType(value, ctx, isDictionary);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Obsidian.SourceGenerators.Registry.Models;
using System.Text.Json;
using System.Xml.Linq;

namespace Obsidian.SourceGenerators.Registry;
public partial class RegistryAssetsGenerator
Expand Down Expand Up @@ -95,11 +94,11 @@ private static void GenerateCodecs(Assets assets, SourceProductionContext ctx)

if (value.ValueKind == JsonValueKind.Object)
{
builder.ParseProperty(value, ctx, name == "OverrideArmorMaterials");
builder.ParseProperty(value, ctx, name == "OverrideArmorAssets");
return;
}

builder.AppendValueType(value, ctx, name == "OverrideArmorMaterials");
builder.AppendValueType(value, ctx, name == "OverrideArmorAssets");
}, ctx);

builder.GenerateSimpleCodec(codecs["trim_pattern"].ToArray(), "TrimPattern", "minecraft:trim_pattern", "TrimPatternCodec", ctx);
Expand Down
Loading

0 comments on commit 75a8a71

Please sign in to comment.