This commit is contained in:
James Seibel
2023-09-02 20:18:05 -05:00
4 changed files with 18 additions and 4 deletions
@@ -122,7 +122,14 @@ public class ModrinthGetter
public static String getLatestIDForVersion(String mcVer)
{
return mcVerToReleaseID.get(mcVer).get(0);
try
{
return mcVerToReleaseID.get(mcVer).get(0);
}
catch (Exception e)
{
return null;
}
}
public static String getLatestNameForVersion(String mcVer)
{
@@ -57,9 +57,11 @@ public class SelfUpdater
*/
public static boolean onStart()
{
LOGGER.info("Checking for DH update");
// Some init stuff
// We use sha1 to check the version as our versioning system is different to the one on modrinth
if (!ModrinthGetter.init()) return false;
if (!ModrinthGetter.init())
return false;
String jarSha = "";
try
{
@@ -71,6 +73,11 @@ public class SelfUpdater
return false;
}
String mcVersion = SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion();
if (!ModrinthGetter.mcVersions.contains(mcVersion))
{
LOGGER.warn("Minecraft version ["+ mcVersion +"] is not findable on Modrinth, only findable versions are ["+ ModrinthGetter.mcVersions.toString() +"]");
return false;
}
// Check the sha's of both our stuff
if (jarSha.equals(ModrinthGetter.getLatestShaForVersion(mcVersion)))
@@ -264,7 +264,7 @@ public class RenderUtil
return false; //Level is not ready yet.
}
if (MC_RENDER.playerHasBlindnessEffect())
if (MC_RENDER.playerHasBlindingEffect())
{
// if the player is blind, don't render LODs,
// and don't change minecraft's fog
@@ -49,7 +49,7 @@ public interface IMinecraftRenderWrapper extends IBindable
DhBlockPos getCameraBlockPosition();
boolean playerHasBlindnessEffect();
boolean playerHasBlindingEffect();
Vec3d getCameraExactPosition();