Skip to content

Commit

Permalink
Snapshot 23w18a support
Browse files Browse the repository at this point in the history
  • Loading branch information
DarwinBaker committed May 4, 2023
1 parent 4686f24 commit f3ff5fc
Show file tree
Hide file tree
Showing 92 changed files with 1,143 additions and 135 deletions.
128 changes: 122 additions & 6 deletions AATool/AATool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<Compile Include="Data\Categories\HalfDeaths.cs" />
<Compile Include="Data\Categories\AllDeaths.cs" />
<Compile Include="Data\Categories\AllBlocks.cs" />
<Compile Include="Data\Categories\AllSmithingTemplates.cs" />
<Compile Include="Data\Categories\MonstersHunted.cs" />
<Compile Include="Data\Categories\AllAchievements.cs" />
<Compile Include="Data\Categories\AllAdvancements.cs" />
Expand All @@ -117,9 +118,15 @@
<Compile Include="Data\Categories\SingleAdvancement.cs" />
<Compile Include="Data\Cell.cs" />
<Compile Include="Data\Credits.cs" />
<Compile Include="Data\Objectives\ArmorTrimCriterion.cs" />
<Compile Include="Data\Objectives\Complex\EnderPearls.cs" />
<Compile Include="Data\Objectives\Complex\Netherite.cs" />
<Compile Include="Data\Objectives\Complex\SnifferEgg.cs" />
<Compile Include="Data\Objectives\Complex\NetheriteUpgrade.cs" />
<Compile Include="Data\Objectives\Complex\PotteryShards.cs" />
<Compile Include="Data\Objectives\Complex\Pufferfish.cs" />
<Compile Include="Data\Objectives\Complex\ArmorTrims.cs" />
<Compile Include="Data\Objectives\Complex\WaxOnOff.cs" />
<Compile Include="Data\Objectives\Complex\TridentAdvancements.cs" />
<Compile Include="Data\Objectives\MultipartObjective.cs" />
<Compile Include="Data\Objectives\Complex\Animals.cs" />
Expand Down Expand Up @@ -231,6 +238,7 @@
<Compile Include="UI\Badges\RankBadge.cs" />
<Compile Include="UI\Badges\HundredThousandBadge.cs" />
<Compile Include="UI\Badges\HalfHeartHardcoreBadge.cs" />
<Compile Include="UI\Controls\UIArmorTrimCriterion.cs" />
<Compile Include="UI\Controls\UICoordinateGrid.cs" />
<Compile Include="UI\Controls\UIObjectiveControl.cs" />
<Compile Include="UI\Controls\UIAchievementTree.cs" />
Expand Down Expand Up @@ -522,12 +530,24 @@
<Content Include="assets\objectives\1.20 Snapshot\advancements\nether.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\objectives\1.20 Snapshot\trims.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\objectives\1.20 Snapshot\blocks.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\objectives\1.20 Snapshot\potions.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\ab_guide\all_heads_1.20%244x4x30.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\ab_guide\all_suspicious_blocks%242x2x30.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\ab_guide\frogspawn.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\ab_guide\grass_and_fern%242x2x30.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -816,16 +836,16 @@
<Content Include="assets\sprites\blocks\bamboo\bamboo_trapdoor^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\bamboo\chiseled_bookshelf^32.png">
<Content Include="assets\sprites\blocks\special\chiseled_bookshelf^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\bamboo\chiseled_bookshelf^48.png">
<Content Include="assets\sprites\blocks\special\chiseled_bookshelf^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\bamboo\chiseled_bookshelf_full^32.png">
<Content Include="assets\sprites\blocks\special\chiseled_bookshelf_full^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\bamboo\chiseled_bookshelf_full^48.png">
<Content Include="assets\sprites\blocks\special\chiseled_bookshelf_full^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\bamboo\stripped_bamboo_block^32.png">
Expand Down Expand Up @@ -2742,7 +2762,7 @@
<Content Include="assets\sprites\blocks\sculk\sculk^32%2432x32x2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\sculk\calibrated_sculk_sensor^48%24152x24x1.png">
<Content Include="assets\sprites\blocks\sculk\calibrated_sculk_sensor^48%2416x16x1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\sculk\sculk_sensor_block^48%2496x24x1.25.png">
Expand Down Expand Up @@ -2823,6 +2843,30 @@
<Content Include="assets\sprites\blocks\cherry\cherry_button^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\advancements\adventure\chiseled_bookshelf^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\advancements\adventure\chiseled_bookshelf^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\advancements\adventure\craft_decorated_pot^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\advancements\adventure\craft_decorated_pot^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\advancements\adventure\salvage_sherd.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\advancements\husbandry\obtain_sniffer_egg.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\advancements\husbandry\feed_snifflet.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\advancements\husbandry\plant_any_sniffer_seed.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\badges\glow\badge_rank_netherite_glow~1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -2907,7 +2951,7 @@
<Content Include="assets\sprites\global\criteria\animals\sniffer.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\biomes\cherry_grove.png">
<Content Include="assets\sprites\global\criteria\biomes\1.20\cherry_grove.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\mobs\silverfish^48.png">
Expand All @@ -2922,6 +2966,57 @@
<Content Include="assets\sprites\global\criteria\mobs\wither^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\upgrade_netherite.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_host.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_coast.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_wild.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_shaper.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_eye.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_sentry.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_raiser.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_dune.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_snout.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_silence.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_wayfinder.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_spire.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_tide.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_ward.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_rib.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\trims\trim_vex.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\glow\glint%24825.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -3348,6 +3443,12 @@
<Content Include="assets\sprites\global\gui\icons\day_night_arrow.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\gui\icons\smithing_unapplied.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\gui\icons\smithing_applied.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\gui\moon\moon_1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -3483,6 +3584,9 @@
<Content Include="assets\sprites\global\items\bee_nest_pickup^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\items\pottery_shard.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\items\cauldron^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -6984,6 +7088,9 @@
<Content Include="assets\templates\control_block_tile.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\templates\control_armor_trim_criterion.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\templates\control_run_overview.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand All @@ -7005,6 +7112,9 @@
<Content Include="assets\views\adventuring_time\1.16\main.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\views\adventuring_time\1.20 Snapshot\main.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\views\adventuring_time\1.19\main.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -7110,6 +7220,12 @@
<Content Include="assets\views\all_portals\overlay.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\views\all_smithing_templates\1.20 Snapshot\main.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\views\all_smithing_templates\overlay.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\views\other\multiboard.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
8 changes: 6 additions & 2 deletions AATool/Configuration/PinnedObjectiveSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class PinnedObjectiveSet
public static readonly List<string> AllAA = new (){
"EGap", "Trident", "NautilusShells", "WitherSkulls",
"AncientDebris", "GoldBlocks", "Bees",
"Cats", "Foods", "Animals", "Monsters", "Biomes", "Cauldrons"
"Cats", "Foods", "Animals", "Monsters", "Biomes", "Cauldrons", "ArmorTrims"
};

public static readonly List<string> AllAB = new (){
Expand All @@ -37,6 +37,8 @@ public static List<string> GetAllAvailable()

if (Version.TryParse(Tracker.CurrentVersion, out Version current))
{
if (current < new Version("1.20"))
available.Remove("ArmorTrims");
if (current < new Version("1.19"))
available.Remove("SculkBlocks");
if (current != new Version("1.17"))
Expand All @@ -45,6 +47,8 @@ public static List<string> GetAllAvailable()
available.Remove("DeepslateEmerald");
if (current < new Version("1.16"))
available.Remove("AncientDebris");
if (current < new Version("1.15"))
available.Remove("Bees");
if (current < new Version("1.14"))
available.Remove("Cats");
if (current < new Version("1.13"))
Expand All @@ -64,7 +68,7 @@ public static List<string> GetAllAvailable()
[JsonProperty]
public Dictionary<string, List<string>> Pinned = new () {
{ "All Advancements 1.20 Snapshot", new () {
"AncientDebris", "WitherSkulls", "NautilusShells", "Trident", "EGap",
"AncientDebris", "WitherSkulls", "NautilusShells", "Trident", "EGap", "ArmorTrims",
}},
{ "All Advancements 1.19", new () {
"AncientDebris", "WitherSkulls", "NautilusShells", "Trident", "EGap",
Expand Down
1 change: 1 addition & 0 deletions AATool/Data/Categories/AdventuringTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class AdventuringTime : SingleAdvancement
private const string Id = "minecraft:adventure/adventuring_time";

public static readonly List<string> SupportedVersions = new () {
"1.20 Snapshot",
"1.19",
"1.18",
"1.16",
Expand Down
51 changes: 51 additions & 0 deletions AATool/Data/Categories/AllSmithingTemplates.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System.Collections.Generic;
using System.Xml;
using AATool.Data.Objectives;
using AATool.Data.Objectives.Complex;
using AATool.Utilities;

namespace AATool.Data.Categories
{
public class AllSmithingTemplates : SingleAdvancement
{
private const string Id = "custom:all_smithing_templates";

public static readonly List<string> SupportedVersions = new () {
"1.20 Snapshot",
};

public override IEnumerable<string> GetSupportedVersions() => SupportedVersions;
public override int GetCompletedCount() => this.RecipesObtained;

public int RecipesObtained { get; private set; }

public AllSmithingTemplates() : base()
{
this.Name = "All Smithing Templates";
this.Acronym = "AST";
this.Objective = "Templates";
this.Action = "Obtained";
}

public override void LoadObjectives()
{
Tracker.Advancements.RefreshObjectives();
Tracker.Advancements.TryGet(Id, out Advancement allSmithingTemplates);
this.Requirement = allSmithingTemplates;
}

public override void Update()
{
base.Update();
RecipesObtained = 0;
if (this.Requirement?.Criteria is not CriteriaSet trims)
return;

foreach (ArmorTrimCriterion criterion in trims.All.Values)
{
if (criterion.Obtained)
RecipesObtained++;
}
}
}
}
6 changes: 6 additions & 0 deletions AATool/Data/Objectives/AdvancementManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public virtual void RefreshObjectives()
if (Tracker.Category is AllAchievements)
return;

if (Tracker.Category is AllSmithingTemplates)
{
this.ParseFile(Paths.System.ArmorTrimsFile);
return;
}

//try to get list of all advancement objective files
bool filesExist = Paths.TryGetAllFiles(Paths.System.AdvancementsFolder, "*.xml",
SearchOption.TopDirectoryOnly, out IEnumerable<string> files);
Expand Down
37 changes: 37 additions & 0 deletions AATool/Data/Objectives/ArmorTrimCriterion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using AATool.Data.Progress;
using AATool.Utilities;

namespace AATool.Data.Objectives
{
internal class ArmorTrimCriterion : Criterion
{
public string Recipe { get; private set; }
public bool Obtained { get; private set; }
public bool Applied => base.CompletedByDesignated();

public override bool CompletedByDesignated() => this.Obtained || base.CompletedByDesignated();
public override bool IsComplete() => this.Obtained || this.Applied;

private string plainName;

public ArmorTrimCriterion(XmlNode node, Advancement advancement) : base(node, advancement)
{
this.Recipe = XmlObject.Attribute(node, "recipe", string.Empty);
this.plainName = this.Name;
}

public override void UpdateState(ProgressState progress)
{
base.UpdateState(progress);
Obtained = progress.Recipes.ContainsKey(this.Recipe);
//this.Name = Applied ? $"{this.plainName} (Applied)" : this.plainName;
//progress.Recipes.TryGetValue();
}
}
}
Loading

0 comments on commit f3ff5fc

Please sign in to comment.