More refactoring

Replace some getters with lombok
Fix compile error in standalone mode
Exclude some unnecessary class files from the final jar
This commit is contained in:
GeorgH93 2020-08-16 03:32:22 +02:00
parent bd9d30804f
commit 1230e24755
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
4 changed files with 15 additions and 16 deletions

View File

@ -53,7 +53,7 @@
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
<configuration> <configuration>
<additionalparam>-Xdoclint:none</additionalparam> <doclint>none</doclint>
<source>8</source> <source>8</source>
</configuration> </configuration>
</execution> </execution>

View File

@ -170,6 +170,16 @@
<include>at.pcgamingfreaks:PluginLib</include> <include>at.pcgamingfreaks:PluginLib</include>
</includes> </includes>
</artifactSet> </artifactSet>
<filters>
<filter>
<artifact>at.pcgamingfreaks:PluginLib</artifact>
<excludes>
<exclude>at/pcgamingfreaks/Bukkit/Particles/**</exclude>
<exclude>at/pcgamingfreaks/Bungee/**</exclude>
<exclude>at/pcgamingfreaks/PluginLib/**</exclude>
</excludes>
</filter>
</filters>
<relocations> <relocations>
<relocation> <relocation>
<pattern>at.pcgf.libs</pattern> <pattern>at.pcgf.libs</pattern>

View File

@ -88,7 +88,7 @@ public boolean available()
public static @Nullable ConnectionProvider getGlobalConnectionProvider(final @NotNull Logger logger) public static @Nullable ConnectionProvider getGlobalConnectionProvider(final @NotNull Logger logger)
{ {
/*if[STANDALONE] /*if[STANDALONE]
plugin.getLogger().warning(ConsoleColor.RED + "The shared database connection option is not available in standalone mode!" + ConsoleColor.RESET); logger.warning(ConsoleColor.RED + "The shared database connection option is not available in standalone mode!" + ConsoleColor.RESET);
return null; return null;
else[STANDALONE]*/ else[STANDALONE]*/
at.pcgamingfreaks.PluginLib.Database.DatabaseConnectionPool pool = at.pcgamingfreaks.PluginLib.Bukkit.PluginLib.getInstance().getDatabaseConnectionPool(); at.pcgamingfreaks.PluginLib.Database.DatabaseConnectionPool pool = at.pcgamingfreaks.PluginLib.Bukkit.PluginLib.getInstance().getDatabaseConnectionPool();

View File

@ -78,8 +78,8 @@ public class Minepacks extends JavaPlugin implements MinepacksPlugin
private CommandManager commandManager; private CommandManager commandManager;
private InventoryClearCommand inventoryClearCommand; private InventoryClearCommand inventoryClearCommand;
private Collection<GameMode> gameModes; private Collection<GameMode> gameModes;
private CooldownManager cooldownManager = null; @Getter private CooldownManager cooldownManager = null;
private ItemFilter itemFilter = null; @Getter private ItemFilter itemFilter = null;
private Sound openSound = null; private Sound openSound = null;
private ItemShortcut shortcut = null; private ItemShortcut shortcut = null;
@ -363,7 +363,7 @@ public int getBackpackPermSize(final @NotNull Player player)
return 9; return 9;
} }
public WorldBlacklistMode isDisabled(final @NotNull Player player) public @NotNull WorldBlacklistMode isDisabled(final @NotNull Player player)
{ {
if(worldBlacklistMode == WorldBlacklistMode.None || (worldBlacklistMode != WorldBlacklistMode.NoPlugin && player.hasPermission(Permissions.IGNORE_WORLD_BLACKLIST))) return WorldBlacklistMode.None; if(worldBlacklistMode == WorldBlacklistMode.None || (worldBlacklistMode != WorldBlacklistMode.NoPlugin && player.hasPermission(Permissions.IGNORE_WORLD_BLACKLIST))) return WorldBlacklistMode.None;
if(worldBlacklist.contains(player.getWorld().getName().toLowerCase(Locale.ROOT))) return worldBlacklistMode; if(worldBlacklist.contains(player.getWorld().getName().toLowerCase(Locale.ROOT))) return worldBlacklistMode;
@ -376,17 +376,6 @@ public boolean isPlayerGameModeAllowed(final @NotNull Player player)
return gameModes.contains(player.getGameMode()) || player.hasPermission(Permissions.IGNORE_GAME_MODE); return gameModes.contains(player.getGameMode()) || player.hasPermission(Permissions.IGNORE_GAME_MODE);
} }
public @Nullable CooldownManager getCooldownManager()
{
return cooldownManager;
}
@Override
public @Nullable ItemFilter getItemFilter()
{
return itemFilter;
}
@Override @Override
public boolean isBackpackItem(final @Nullable ItemStack itemStack) public boolean isBackpackItem(final @Nullable ItemStack itemStack)
{ {