Skip to content

Commit

Permalink
Improved async join calls to only run when user is admin and added co…
Browse files Browse the repository at this point in the history
…rnflower

Signed-off-by: David Mayr <davidliebtkekse@gmail.com>
  • Loading branch information
davidmayr committed May 30, 2021
1 parent f450bed commit 0b6d542
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>at.toastiii</groupId>
<artifactId>CraftFlowers</artifactId>
<version>0.7.1-SNAPSHOT</version>
<version>0.7.2-SNAPSHOT</version>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ public PlayerJoinListener(CraftFlowers flowers) {
@EventHandler
public void joinPlayer(PlayerJoinEvent event) {
Player player = event.getPlayer();
if (!player.hasPermission("craftflowers.admin"))
return;

updateService.submit(() -> {
if (player.hasPermission("craftflowers.admin")) {
if (!flowers.getVersionChecker().isOutdated())
return;
player.sendMessage(ChatColor.DARK_RED + "------------------[craftFlowers]------------------");
player.sendMessage(ChatColor.RED + " Plugin is outdated!");
player.sendMessage(ChatColor.DARK_RED + " Current version: " + ChatColor.RED + CraftFlowers.plugin.getDescription().getVersion() + ChatColor.DARK_GREEN + " The newest version: " + ChatColor.GREEN + flowers.getVersionChecker().getNewestVersion());
player.sendMessage(ChatColor.GOLD + "Download new version: " + ChatColor.YELLOW + "https://www.spigotmc.org/resources/craftflowers-1-16-port-allowed-by-main-developer.82407/");
player.sendMessage(ChatColor.DARK_RED + "--------------------------------------------------");
}
if (!flowers.getVersionChecker().isOutdated())
return;
player.sendMessage(ChatColor.DARK_RED + "------------------[craftFlowers]------------------");
player.sendMessage(ChatColor.RED + " Plugin is outdated!");
player.sendMessage(ChatColor.DARK_RED + " Current version: " + ChatColor.RED + CraftFlowers.plugin.getDescription().getVersion() + ChatColor.DARK_GREEN + " The newest version: " + ChatColor.GREEN + flowers.getVersionChecker().getNewestVersion());
player.sendMessage(ChatColor.GOLD + "Download new version: " + ChatColor.YELLOW + "https://www.spigotmc.org/resources/craftflowers-1-16-port-allowed-by-main-developer.82407/");
player.sendMessage(ChatColor.DARK_RED + "--------------------------------------------------");
});
}
}
1 change: 1 addition & 0 deletions src/main/java/cm/ptks/craftflowers/util/GuiGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private void init() {
putItem(71, Material.TUBE_CORAL_FAN, "§2Tube Coral fan");

putItem(72, Material.COCOA, Material.COCOA_BEANS, "§2Cocoa");
putItem(73, Material.CORNFLOWER,"§2Cornflower");

}

Expand Down

0 comments on commit 0b6d542

Please sign in to comment.