Skip to content

Commit

Permalink
Support for MC 1.20.1 data version
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinSRG committed Jun 24, 2023
1 parent f2e060b commit f3f902e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ call cmake -DCMAKE_BUILD_TYPE=Release -A x64 -Ssrc -Brelease

call cmake --build release --config Release

call zip -r release/ImageToMapMC-1.3.2-Windows-x64.zip release/Release
call zip -r release/ImageToMapMC-1.3.3-Windows-x64.zip release/Release
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ cmake --build release --config Release

rm -rf release/bin || true

rm -rf release/ImageToMapMC-1.3.2-linux-x64.tar.gz || true
rm -rf release/ImageToMapMC-1.3.3-linux-x64.tar.gz || true

mkdir release/bin

cp release/mcmap release/bin/mcmap
cp release/mcmap-gui release/bin/mcmap-gui

tar -cvzf release/ImageToMapMC-1.3.2-linux-x64.tar.gz release/bin
tar -cvzf release/ImageToMapMC-1.3.3-linux-x64.tar.gz release/bin

echo "DONE: Created release ImageToMapMC-1.3.2-linux-x64.tar.gz"
echo "DONE: Created release ImageToMapMC-1.3.3-linux-x64.tar.gz"
2 changes: 1 addition & 1 deletion build32.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ call cmake -DCMAKE_BUILD_TYPE=Release -A Win32 -Ssrc -Brelease32

call cmake --build release32 --config Release

call zip -r release32/ImageToMapMC-1.3.2-Windows-Win32.zip release32/Release
call zip -r release32/ImageToMapMC-1.3.3-Windows-Win32.zip release32/Release
9 changes: 9 additions & 0 deletions src/minecraft/mc_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ minecraft::McVersion minecraft::getVersionFromText(std::string versionStr)
return McVersion::MC_1_19;
}

if (versionStr.substr(0, 4).compare("1.20") == 0)
{
return McVersion::MC_1_20;
}

if (versionStr.compare("last") == 0)
{
return MC_LAST_VERSION;
Expand Down Expand Up @@ -99,6 +104,8 @@ std::string minecraft::versionToString(minecraft::McVersion version)
return std::string("1.18.2");
case McVersion::MC_1_19:
return std::string("1.19.4");
case McVersion::MC_1_20:
return std::string("1.20.1");
default:
return std::string("???");
}
Expand All @@ -124,6 +131,8 @@ int minecraft::versionToDataVersion(minecraft::McVersion version)
return 2975;
case McVersion::MC_1_19:
return 3337;
case McVersion::MC_1_20:
return 3465;
default:
return 1343;
}
Expand Down
3 changes: 2 additions & 1 deletion src/minecraft/mc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma once

#define MC_LAST_VERSION (minecraft::McVersion::MC_1_19)
#define MC_LAST_VERSION (minecraft::McVersion::MC_1_20)

#include <string>

Expand All @@ -45,6 +45,7 @@ namespace minecraft
MC_1_17 = 17,
MC_1_18 = 18,
MC_1_19 = 19,
MC_1_20 = 20,
};

/**
Expand Down
3 changes: 2 additions & 1 deletion src/wx/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ MainWindow::MainWindow() : wxFrame(NULL, wxID_ANY, string("Minecraft Map Art Too

// Version
wxMenu *menuVersion = new wxMenu();
menuVersion->AppendRadioItem(getIdForVersionMenu(McVersion::MC_1_19), "&1.19.4", "Version: 1.19.4")->Check(true);
menuVersion->AppendRadioItem(getIdForVersionMenu(McVersion::MC_1_20), "&1.20.1", "Version: 1.20.1")->Check(true);
menuVersion->AppendRadioItem(getIdForVersionMenu(McVersion::MC_1_19), "&1.19.4", "Version: 1.19.4");
menuVersion->AppendRadioItem(getIdForVersionMenu(McVersion::MC_1_18), "&1.18.2", "Version: 1.18.2");
menuVersion->AppendRadioItem(getIdForVersionMenu(McVersion::MC_1_17), "&1.17.1", "Version: 1.17.1");
menuVersion->AppendRadioItem(getIdForVersionMenu(McVersion::MC_1_16), "&1.16.5", "Version: 1.16.5");
Expand Down
2 changes: 1 addition & 1 deletion wix/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<!-- Use * to generate product ID on every build -->
<Product Id="*" Name="ImageToMapMC" Version="1.3.2.0" Language="1033" Manufacturer="AgustinSRG" UpgradeCode="1a73ad10-cffe-462a-ab4e-aefc9a2bd53b">
<Product Id="*" Name="ImageToMapMC" Version="1.3.3.0" Language="1033" Manufacturer="AgustinSRG" UpgradeCode="1a73ad10-cffe-462a-ab4e-aefc9a2bd53b">

<Package Compressed="yes" InstallScope="perMachine" Manufacturer="AgustinSRG" Description="Converts images to Minecraft maps." Platform="x64" />

Expand Down
2 changes: 1 addition & 1 deletion wix/make-wix-installer.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ call candle -ext WixUIExtension -ext WixUtilExtension -arch x64 "HeatFile.wxs" -

call candle -ext WixUIExtension -ext WixUtilExtension -arch x64 "Product.wxs" -o "Product.wixobj"

call light "Product.wixobj" -spdb "HeatFile.wixobj" -b ImageToMapMC -o "ImageToMapMC-1.3.2-x64.msi" -ext WixUIExtension -ext WixUtilExtension
call light "Product.wixobj" -spdb "HeatFile.wixobj" -b ImageToMapMC -o "ImageToMapMC-1.3.3-x64.msi" -ext WixUIExtension -ext WixUtilExtension

0 comments on commit f3f902e

Please sign in to comment.