Skip to content

Commit

Permalink
fix: try-catch ProtectionLib#init
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed May 8, 2024
1 parent 3096b54 commit 51037cd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pluginVersion=1.5.4
pluginVersion=1.5.5
36 changes: 27 additions & 9 deletions src/main/java/io/th0rgal/protectionlib/ProtectionLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,33 @@ public class ProtectionLib {

@SuppressWarnings("Convert2MethodRef")
public static void init(JavaPlugin plugin) {
handleCompatibility("WorldGuard", plugin, (m, p) -> new WorldGuardCompat(m, p));
handleCompatibility("Towny", plugin, (m, p) -> new TownyCompat(m, p));
handleCompatibility("Factions", plugin, (m, p) -> new FactionsUuidCompat(m, p));
handleCompatibility("Lands", plugin, (m, p) -> new LandsCompat(m, p));
handleCompatibility("PlotSquared", plugin, (m, p) -> new PlotSquaredCompat(m, p));
handleCompatibility("CrashClaim", plugin, (m, p) -> new CrashClaimCompat(m, p));
handleCompatibility("GriefPrevention", plugin, (m, p) -> new GriefPreventionCompat(m, p));
handleCompatibility("HuskClaims", plugin, (m, p) -> new HuskClaimCompat(m, p));
handleCompatibility("BentoBox", plugin, (m, p) -> new BentoBoxCompat(m, p));
try {
handleCompatibility("WorldGuard", plugin, (m, p) -> new WorldGuardCompat(m, p));
} catch (Exception ignored) {}
try {
handleCompatibility("Towny", plugin, (m, p) -> new TownyCompat(m, p));
} catch (Exception ignored) {}
try {
handleCompatibility("Factions", plugin, (m, p) -> new FactionsUuidCompat(m, p));
} catch (Exception ignored) {}
try {
handleCompatibility("Lands", plugin, (m, p) -> new LandsCompat(m, p));
} catch (Exception ignored) {}
try {
handleCompatibility("PlotSquared", plugin, (m, p) -> new PlotSquaredCompat(m, p));
} catch (Exception ignored) {}
try {
handleCompatibility("CrashClaim", plugin, (m, p) -> new CrashClaimCompat(m, p));
} catch (Exception ignored) {}
try {
handleCompatibility("GriefPrevention", plugin, (m, p) -> new GriefPreventionCompat(m, p));
} catch (Exception ignored) {}
try {
handleCompatibility("HuskClaims", plugin, (m, p) -> new HuskClaimCompat(m, p));
} catch (Exception ignored) {}
try {
handleCompatibility("BentoBox", plugin, (m, p) -> new BentoBoxCompat(m, p));
} catch (Exception ignored) {}
}

public static void setDebug(boolean debug) {
Expand Down

0 comments on commit 51037cd

Please sign in to comment.