Fix compat for the original battlegear 2 (#1992)

* Fix compat for the original battlegear 2

* oops
This commit is contained in:
ah-OOG-ah authored and GitHub committed 2026-08-07 15:54:59 -04:00
1 parent 18fe05eda8
commit 413df76ad4
2 files changed
+11 -9

No files matched your search

@@ -46,7 +46,6 @@ public class ModStatus {
isChunkAPILoaded = Loader.isModLoaded("chunkapi");
isXaerosMinimapLoaded = Loader.isModLoaded("XaeroMinimap");
isHoloInventoryLoaded = Loader.isModLoaded("holoinventory");
isBattlegearLoaded = Loader.isModLoaded("battlegear2");
isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft");
isThaumicHorizonsLoaded = Loader.isModLoaded("ThaumicHorizons");
isBaublesLoaded = Loader.isModLoaded("Baubles");
@@ -58,12 +57,16 @@ public class ModStatus {
isHoloInventoryLoaded = Loader.isModLoaded("holoinventory");
isBOPLoaded = Loader.isModLoaded("BiomesOPlenty");
// remove compat with original release of BG2
if (isBattlegearLoaded){
isBattlegearLoaded = new DefaultArtifactVersion("1.2.0")
.compareTo(
LoadControllerHelper.getOwningMod(Battlegear.class).getProcessedVersion()
) <= 0;
// Angelica's compat relies on GTNH extensions, so this should only be true for NH Battlegear2, 1.2.0+
if (Loader.isModLoaded("battlegear2")) {
// Don't ask me why battlegear2 reports as 1.7.10, I don't know
final var OG_BG2_VER = new DefaultArtifactVersion("1.7.10");
final var NH_BG2_VER = new DefaultArtifactVersion("1.2.0");
@SuppressWarnings("DataFlowIssue")
var battlegearVersion = LoadControllerHelper.getOwningMod(Battlegear.class).getProcessedVersion();
// We can be sure the NH version will never be 1.7.10, because that garbage got archived.
isBattlegearLoaded = battlegearVersion.compareTo(OG_BG2_VER) != 0 && battlegearVersion.compareTo(NH_BG2_VER) >= 0;
}
isNEIDMetadataExtended = false;
@@ -620,8 +620,7 @@ public class DynamicLights {
if (offhand != null) {
luminance = Math.max(luminance, getLuminanceFromItemStack(offhand));
}
}
else if (ModStatus.isBackhandLoaded){
} else if (ModStatus.isBackhandLoaded){
final ItemStack offhand = BackhandReflectionCompat.getOffhandItem(player);
if (offhand != null) {
luminance = Math.max(luminance, getLuminanceFromItemStack(offhand));