Skip to content

Commit fdab289

Browse files
v0.2.6 - Add relocation check at startup
1 parent 3398655 commit fdab289

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
allprojects {
88
apply plugin: 'java'
99

10-
version = '0.2.5'
10+
version = '0.2.6'
1111

1212
repositories {
1313

common/src/main/java/com/tcoded/folialib/FoliaLib.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import org.bukkit.plugin.java.JavaPlugin;
66

77
import java.lang.reflect.InvocationTargetException;
8+
import java.util.List;
9+
import java.util.logging.Logger;
810

911
public class FoliaLib {
1012

@@ -59,6 +61,18 @@ public FoliaLib(JavaPlugin plugin) {
5961
"Forks of server software may not all be supported. If you are using an unofficial fork, " +
6062
"please report this to the fork's developers first.");
6163
}
64+
65+
// Check for valid relocation
66+
// Runtime replace to avoid relocations changing this string too
67+
String originalLocation = "com,tcoded,folialib,".replace(",", ".");
68+
if (this.getClass().getName().startsWith(originalLocation)) {
69+
Logger logger = this.plugin.getLogger();
70+
logger.severe("****************************************************************");
71+
logger.severe("FoliaLib is not be relocated correctly! This will cause conflicts");
72+
logger.severe("with other plugins using FoliaLib. Please contact the developers");
73+
logger.severe(String.format("of '%s' and inform them of this issue immediately!", this.plugin.getDescription().getName()));
74+
logger.severe("****************************************************************");
75+
}
6276
}
6377

6478
private ServerImplementation createServerImpl(String implName) {

0 commit comments

Comments
 (0)