mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-11-23 18:45:17 +01:00
Merge branch 'develop' of https://github.com/BentoBoxWorld/Level.git
into develop
This commit is contained in:
commit
cdd4366a2a
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@ -11,21 +11,22 @@ jobs:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: 17
|
||||
- name: Cache SonarCloud packages
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
key: ${{ runner.os }}-sonar
|
||||
restore-keys: ${{ runner.os }}-sonar
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
|
2
pom.xml
2
pom.xml
@ -237,7 +237,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>UltimateStacker</artifactId>
|
||||
<version>2.3.3</version>
|
||||
<version>2.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -126,32 +126,42 @@ public class Level extends Addon {
|
||||
// Check if WildStackers is enabled on the server
|
||||
// I only added support for counting blocks into the island level
|
||||
// Someone else can PR if they want spawners added to the Leveling system :)
|
||||
stackersEnabled = Bukkit.getPluginManager().isPluginEnabled("WildStacker");
|
||||
if (stackersEnabled) {
|
||||
log("Hooked into WildStackers.");
|
||||
}
|
||||
// Check if AdvancedChests is enabled on the server
|
||||
Plugin advChest = Bukkit.getPluginManager().getPlugin("AdvancedChests");
|
||||
advChestEnabled = advChest != null;
|
||||
if (advChestEnabled) {
|
||||
// Check version
|
||||
if (compareVersions(advChest.getDescription().getVersion(), "23.0") > 0) {
|
||||
log("Hooked into AdvancedChests.");
|
||||
} else {
|
||||
logError("Could not hook into AdvancedChests " + advChest.getDescription().getVersion() + " - requires version 23.0 or later");
|
||||
advChestEnabled = false;
|
||||
if ( !settings.getDisabledPluginHooks().contains("WildStacker") ) {
|
||||
stackersEnabled = Bukkit.getPluginManager().isPluginEnabled("WildStacker");
|
||||
if (stackersEnabled) {
|
||||
log("Hooked into WildStackers.");
|
||||
}
|
||||
}
|
||||
|
||||
// Check if AdvancedChests is enabled on the server
|
||||
if ( !settings.getDisabledPluginHooks().contains("AdvancedChests") ) {
|
||||
Plugin advChest = Bukkit.getPluginManager().getPlugin("AdvancedChests");
|
||||
advChestEnabled = advChest != null;
|
||||
if (advChestEnabled) {
|
||||
// Check version
|
||||
if (compareVersions(advChest.getDescription().getVersion(), "23.0") > 0) {
|
||||
log("Hooked into AdvancedChests.");
|
||||
} else {
|
||||
logError("Could not hook into AdvancedChests " + advChest.getDescription().getVersion() + " - requires version 23.0 or later");
|
||||
advChestEnabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if RoseStackers is enabled
|
||||
roseStackersEnabled = Bukkit.getPluginManager().isPluginEnabled("RoseStacker");
|
||||
if (roseStackersEnabled) {
|
||||
log("Hooked into RoseStackers.");
|
||||
if ( !settings.getDisabledPluginHooks().contains("RoseStacker") ) {
|
||||
roseStackersEnabled = Bukkit.getPluginManager().isPluginEnabled("RoseStacker");
|
||||
if (roseStackersEnabled) {
|
||||
log("Hooked into RoseStackers.");
|
||||
}
|
||||
}
|
||||
|
||||
// Check if UltimateStacker is enabled
|
||||
ultimateStackerEnabled = Bukkit.getPluginManager().isPluginEnabled("UltimateStacker");
|
||||
if (ultimateStackerEnabled) {
|
||||
log("Hooked into UltimateStacker.");
|
||||
if ( !settings.getDisabledPluginHooks().contains("UltimateStacker") ) {
|
||||
ultimateStackerEnabled = Bukkit.getPluginManager().isPluginEnabled("UltimateStacker");
|
||||
if (ultimateStackerEnabled) {
|
||||
log("Hooked into UltimateStacker.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package world.bentobox.level.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@ -126,6 +127,12 @@ public class ConfigSettings implements ConfigObject {
|
||||
@ConfigEntry(path = "include-shulkers-in-chest")
|
||||
private boolean includeShulkersInChest = false;
|
||||
|
||||
@ConfigComment("")
|
||||
@ConfigComment("Disables hooking with other plugins.")
|
||||
@ConfigComment("Example: disabled-plugin-hooks: [UltimateStacker, RoseStacker]")
|
||||
@ConfigEntry(path = "disabled-plugin-hooks")
|
||||
private List<String> disabledPluginHooks = new ArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
* @return the gameModes
|
||||
@ -404,4 +411,12 @@ public class ConfigSettings implements ConfigObject {
|
||||
public void setIncludeShulkersInChest(boolean includeShulkersInChest) {
|
||||
this.includeShulkersInChest = includeShulkersInChest;
|
||||
}
|
||||
|
||||
public List<String> getDisabledPluginHooks() {
|
||||
return disabledPluginHooks;
|
||||
}
|
||||
|
||||
public void setDisabledPluginHooks(List<String> disabledPluginHooks) {
|
||||
this.disabledPluginHooks = disabledPluginHooks;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user