Skip to content

Commit

Permalink
Add Freecam support on Forge/NeoForge. Fix #443
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Jun 7, 2024
1 parent e2f4481 commit 81c5124
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
4 changes: 3 additions & 1 deletion gradle-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ replacements:
breaks: ', "FastAnim": "*"'
fabric_dependencies: "
modCompileOnly 'maven.modrinth:playeranimator:1.0.2-rc1+1.20-fabric'\n
modCompileOnly 'maven.modrinth:freecam:1.1.6-mc1.19'\n
modCompileOnly 'maven.modrinth:freecam:mYKA10cM'\n
"
forge_dependencies: "
modCompileOnly 'maven.modrinth:playeranimator:1.0.2-rc1+1.20-forge'\n
modCompileOnly 'maven.modrinth:freecam:tXR5Jx3F'\n
"
neoforge_dependencies: "
modCompileOnly 'maven.modrinth:playeranimator:1.0.2-rc1+1.20-forge'\n
modCompileOnly 'maven.modrinth:freecam:DrSgHrTu'\n
"
enabledFlags:
- autopublish
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//#if FABRIC
package dev.tr7zw.firstperson.modsupport;

import dev.tr7zw.firstperson.api.ActivationHandler;
Expand All @@ -16,5 +15,4 @@ public boolean preventFirstperson() {
return Freecam.isEnabled();
}

}
//#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@
public class ModSupportLoader {

public static void loadSupport() {
// spotless:off
//#if FABRIC
try {
if (ModLoaderUtil.isModLoaded("freecam")) {
FirstPersonAPI.registerPlayerHandler(new FreecamSupport());
FirstPersonBase.LOGGER.info("Freecam support loaded.");
}
} catch (Throwable ex) {
FirstPersonBase.LOGGER.warn("Error during initialization of mod support.", ex);
}
//#endif
//spotless:on
try {
if (ModLoaderUtil.isModLoaded("freecam")) {
FirstPersonAPI.registerPlayerHandler(new FreecamSupport());
FirstPersonBase.LOGGER.info("Freecam support loaded.");
}
} catch (Throwable ex) {
FirstPersonBase.LOGGER.warn("Error during initialization of mod support.", ex);
}
}

}

0 comments on commit 81c5124

Please sign in to comment.