File tree Expand file tree Collapse file tree 4 files changed +14
-14
lines changed
src/main/java/net/techcable/spawnshield Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 4444 <groupId >net.techcable.spawnshield</groupId >
4545 <artifactId >worldguard6</artifactId >
4646 <version >${project.parent.version} </version >
47+ <optional >true</optional >
4748 </dependency >
4849 <!-- CombatTag Plugin Compatibility -->
4950 <dependency >
5051 <groupId >net.techcable.spawnshield</groupId >
5152 <artifactId >combat-tag</artifactId >
5253 <version >${project.parent.version} </version >
53- <scope >provided</scope >
54+ <scope >compile</scope >
55+ <optional >true</optional >
5456 </dependency >
5557 <dependency >
5658 <groupId >net.techcable.spawnshield</groupId >
5759 <artifactId >combat-tag-plus</artifactId >
5860 <version >${project.parent.version} </version >
59- <scope >provided</scope >
61+ <scope >compile</scope >
62+ <optional >true</optional >
6063 </dependency >
6164 <dependency >
6265 <groupId >net.techcable.spawnshield</groupId >
6366 <artifactId >pvp-manager</artifactId >
6467 <version >${project.parent.version} </version >
65- <scope >provided</scope >
68+ <scope >compile</scope >
69+ <optional >true</optional >
6670 </dependency >
6771 </dependencies >
6872</project >
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public int getValue() {
128128
129129 @ Override
130130 protected void shutdown () {
131- getSettings ().save ();
131+ if ( getSettings () != null ) getSettings ().save ();
132132 }
133133
134134 @ Override
Original file line number Diff line number Diff line change 4343import java .util .UUID ;
4444
4545import net .techcable .techutils .Reflection ;
46+ import org .reflections .ReflectionUtils ;
4647import org .reflections .Reflections ;
48+ import org .reflections .util .ClasspathHelper ;
4749
4850import javax .annotation .Nullable ;
4951
@@ -93,17 +95,11 @@ public static long getRemainingTagTime(Player player) {
9395
9496 public static Set <CombatTagPlugin > findInstalled () {
9597 Set <CombatTagPlugin > installed = new HashSet <>();
96- String className = MultiPluginCombatTagPlugin .class .getName ();
98+ String className = CombatTagHelper .class .getName ();
9799 String packageName = className .substring (0 , className .lastIndexOf ('.' ) - 1 );
98- Reflections reflections = new Reflections (packageName );
99- Set <Class <? extends CombatTagPlugin >> pluginTypes = reflections .getSubTypesOf (CombatTagPlugin .class );
100- pluginTypes = Sets .filter (pluginTypes , new Predicate <Class <? extends CombatTagPlugin >>() {
101- @ Override
102- public boolean apply (@ Nullable Class <? extends CombatTagPlugin > aClass ) {
103- return !MultiPluginCombatTagPlugin .class .isAssignableFrom (aClass );
104- }
105- });
100+ Set <Class <? extends CombatTagPlugin >> pluginTypes = new Reflections (packageName ).getSubTypesOf (CombatTagPlugin .class );
106101 for (Class <? extends CombatTagPlugin > pluginType : pluginTypes ) {
102+ if (pluginType == MultiPluginCombatTagPlugin .class ) continue ;
107103 CombatTagPlugin plugin ;
108104 try {
109105 Constructor <? extends CombatTagPlugin > c = pluginType .getConstructor ();
Original file line number Diff line number Diff line change 3737import java .util .Set ;
3838
3939@ RequiredArgsConstructor
40- public class MultiPluginCombatTagPlugin implements CombatTagPlugin {
40+ public final class MultiPluginCombatTagPlugin implements CombatTagPlugin {
4141 private final Set <CombatTagPlugin > plugins ;
4242
4343 @ Override
You can’t perform that action at this time.
0 commit comments