Skip to content

Commit 15c51f9

Browse files
committed
fix for relocate check
1 parent 8065087 commit 15c51f9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>io.github.mooy1</groupId>
88
<artifactId>InfinityLib</artifactId>
9-
<version>1.2.2</version>
9+
<version>1.2.3</version>
1010

1111
<properties>
1212
<maven.compiler.source>1.8</maven.compiler.source>

src/main/java/io/github/mooy1/infinitylib/core/AbstractAddon.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ public AbstractAddon(JavaPluginLoader loader, PluginDescriptionFile description,
8989
}
9090

9191
private void validate() {
92-
if (environment == Environment.LIVE && InfinityLib.PACKAGE.contains("mooy1.infinitylib")) {
93-
throw new IllegalStateException("You must relocate InfinityLib to your own package!");
94-
}
95-
String addonPackage = getClass().getPackage().getName();
96-
if (!addonPackage.contains(InfinityLib.ADDON_PACKAGE)) {
97-
throw new IllegalStateException("Shade and relocate your own InfinityLib!");
92+
if (environment == Environment.LIVE) {
93+
if (InfinityLib.PACKAGE.contains("mooy1.infinitylib")) {
94+
throw new IllegalStateException("You must relocate InfinityLib to your own package!");
95+
}
96+
String addonPackage = getClass().getPackage().getName();
97+
if (!addonPackage.contains(InfinityLib.ADDON_PACKAGE)) {
98+
throw new IllegalStateException("Shade and relocate your own InfinityLib!");
99+
}
98100
}
99101
if (instance != null) {
100102
throw new IllegalStateException("Addon " + instance.getName() + " is already using this InfinityLib, Shade an relocate your own!");

0 commit comments

Comments
 (0)