Skip to content

Commit

Permalink
Another new color
Browse files Browse the repository at this point in the history
  • Loading branch information
tryashtar committed Apr 21, 2021
1 parent 07d6e2c commit e823560
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
29 changes: 26 additions & 3 deletions Image Map 3/JavaDefinitions/JavaVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ public override IEnumerable<Color> GetBaseColors()
}

// 21w15a+
public class Java1p17Version : AbstractJavaVersion
public class Java1p17SnapshotVersion : AbstractJavaVersion
{
public static Java1p17Version Instance = new Java1p17Version();
private Java1p17Version() { }
public static Java1p17SnapshotVersion Instance = new Java1p17SnapshotVersion();
private Java1p17SnapshotVersion() { }

public override NbtCompound CreateMapItem(byte slot, long mapid) => Java1p14Version.Instance.CreateMapItem(slot, mapid);
public override NbtCompound CreateMapCompound(long mapid, byte[] colors) => Java1p16Version.Instance.CreateMapCompound(mapid, colors);
Expand All @@ -448,6 +448,29 @@ public override IEnumerable<Color> GetBaseColors()
return old_colors.Concat(new_colors);
}

public override string ToString() => "21w15a";
}

// 21w16a+
public class Java1p17Version : AbstractJavaVersion
{
public static Java1p17Version Instance = new Java1p17Version();
private Java1p17Version() { }

public override NbtCompound CreateMapItem(byte slot, long mapid) => Java1p14Version.Instance.CreateMapItem(slot, mapid);
public override NbtCompound CreateMapCompound(long mapid, byte[] colors) => Java1p16Version.Instance.CreateMapCompound(mapid, colors);

public override IEnumerable<Color> GetAlternateColors(Color color) => Java1p8Version.Instance.GetAlternateColors(color);
public override IEnumerable<Color> GetBaseColors()
{
var old_colors = Java1p17SnapshotVersion.Instance.GetBaseColors();
var new_colors = FixShading(new List<Color>
{
Color.FromArgb(127, 167, 150)
});
return old_colors.Concat(new_colors);
}

public override string ToString() => "1.17+";
}
}
4 changes: 3 additions & 1 deletion Image Map 3/JavaDefinitions/JavaWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ private static IJavaVersion DetermineVersionFromLevelDat(NbtCompound leveldat)
var dataversion = leveldat["DataVersion"];
if (dataversion is NbtInt intversion)
{
if (intversion.Value >= 2709)
if (intversion.Value >= 2711)
return Java1p17Version.Instance;
if (intversion.Value >= 2709)
return Java1p17SnapshotVersion.Instance;
if (intversion.Value >= 2562) // 1.16 pre-6
return Java1p16Version.Instance;
if (intversion.Value >= 1128) // 17w17a
Expand Down
1 change: 1 addition & 0 deletions Image Map 3/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ private static void CreateSupportedColorsImage()
Java1p8Version.Instance,
Java1p12Version.Instance,
Java1p16Version.Instance,
Java1p17SnapshotVersion.Instance,
Java1p17Version.Instance,
};
foreach (var version in versions)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,7 @@ Beta 1.8+
<img src="https://i.imgur.com/lLU3Dyc.png" height=48>&nbsp;
1.16 pre-6+
<img src="https://i.imgur.com/groRMjk.png" height=48>&nbsp;
21w15a (1.17)+
21w15a
<img src="https://i.imgur.com/WW3wsiG.png" height=48>&nbsp;
21w16a (1.17)+
<img src="https://i.imgur.com/EA39eVT.png" height=48>&nbsp;

0 comments on commit e823560

Please sign in to comment.