-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set grief prevention as soft dependency again
- Loading branch information
1 parent
31ae2ea
commit 29cdcca
Showing
7 changed files
with
68 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package me.aleksilassila.islands; | ||
|
||
import me.ryanhamshire.GriefPrevention.ClaimsMode; | ||
import me.ryanhamshire.GriefPrevention.GriefPrevention; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.World; | ||
|
||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
public class GPWrapper { | ||
public static boolean enabled = false; | ||
public static GriefPrevention gp; | ||
|
||
private static Islands islands; | ||
|
||
public static void initialise() { | ||
islands = Islands.instance; | ||
enabled = islands.getConfig().getBoolean("enableIslandProtection", true); | ||
if (!enabled) return; | ||
if (Bukkit.getPluginManager().getPlugin("GriefPrevention") == null) { | ||
islands.getLogger().severe("No GriefPrevention found. Island protection disabled."); | ||
enabled = false; | ||
} else { | ||
gp = (GriefPrevention) Bukkit.getPluginManager().getPlugin("GriefPrevention"); | ||
} | ||
|
||
if (enabled && islands.getConfig().getBoolean("overrideGriefPreventionWorlds")) { | ||
ConcurrentHashMap<World, ClaimsMode> modes = gp.config_claims_worldModes; | ||
|
||
modes.put(Islands.islandsWorld, ClaimsMode.SurvivalRequiringClaims); | ||
|
||
if (Islands.wildernessWorld != null) | ||
modes.put(Islands.wildernessWorld, ClaimsMode.Survival); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.