9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-31 04:36:29 +00:00

Add our own region integration!

This commit is contained in:
SamB440
2021-10-09 19:30:54 +01:00
parent 9303177490
commit 8c266b7fd9
12 changed files with 1114 additions and 577 deletions

View File

@@ -8,11 +8,11 @@ import org.bukkit.plugin.java.JavaPlugin;
import java.util.Optional;
public enum IntegrationType {
WORLDGUARD_LEGACY("WorldGuard", "worldguard.WorldGuardLegacyIntegration"),
WORLDGUARD("WorldGuard", "worldguard.WorldGuardIntegration"),
RESIDENCE("Residence", "residence.ResidenceIntegration"),
GRIEFPREVENTION("GriefPrevention", "griefprevention.GriefPreventionIntegration"),
ULTRAREGIONS("UltraRegions", "ultraregions.UltraRegionsIntegration");
ULTRAREGIONS("UltraRegions", "ultraregions.UltraRegionsIntegration"),
RPGREGIONS("RPGRegions", "rpgregions.RPGRegionsIntegration");
private final String plugin;
private final String path;
@@ -25,7 +25,7 @@ public enum IntegrationType {
public Optional<IntegrationManager> get(IRPGRegionsAPI plugin) throws ClassNotFoundException {
if (plugin.getManagers() != null && plugin.getManagers().getIntegrationManager() != null) throw new UnsupportedOperationException("IntegrationManager already loaded");
plugin.getLogger().info("Loading IntegrationManager implementation...");
if (Bukkit.getPluginManager().getPlugin(this.plugin) == null) {
if (!this.plugin.equals("RPGRegions") && Bukkit.getPluginManager().getPlugin(this.plugin) == null) {
return Optional.empty();
}

View File

@@ -11,7 +11,6 @@ import net.islandearth.rpgregions.regenerate.Regenerate;
import net.islandearth.rpgregions.requirements.RegionRequirement;
import net.islandearth.rpgregions.rewards.DiscoveryReward;
import net.islandearth.rpgregions.translation.Translations;
import net.islandearth.rpgregions.utils.XSound;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@@ -85,7 +84,7 @@ public class ConfiguredRegion {
this.id = id;
this.customName = customName;
this.rewards = rewards;
this.sound = XSound.UI_TOAST_CHALLENGE_COMPLETE.parseSound();
this.sound = Sound.UI_TOAST_CHALLENGE_COMPLETE;
Optional<Material> defaultIcon = Optional.of(Material.valueOf(RPGRegionsAPI.getAPI().getConfig().getString("settings.server.gui.default_region_icon")));
this.icon = defaultIcon.map(Enum::name).orElseGet(Material.TOTEM_OF_UNDYING::name);
this.undiscoveredIcon = defaultIcon.map(Enum::name).orElseGet(Material.TOTEM_OF_UNDYING::name);

File diff suppressed because it is too large Load Diff