13
0

Removing check message

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-05-01 12:33:03 +02:00
Ursprung 29e0a9fb24
Commit 35ca32d0a0
2 geänderte Dateien mit 0 neuen und 35 gelöschten Zeilen

Datei anzeigen

@ -2,11 +2,9 @@ package de.steamwar.schematicsystem;
import de.steamwar.core.CommandRemover;
import de.steamwar.schematicsystem.commands.SchematicCommand;
import de.steamwar.schematicsystem.listener.PlayerJoinListener;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
@ -31,8 +29,5 @@ public class SchematicSystem extends JavaPlugin {
CommandRemover.removeAll("/schematic", "/schem", "//schematic", "//schem");
getCommand("schem").setExecutor(new SchematicCommand());
PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(new PlayerJoinListener(), this);
}
}

Datei anzeigen

@ -1,30 +0,0 @@
package de.steamwar.schematicsystem.listener;
import de.steamwar.schematicsystem.SchematicSystem;
import de.steamwar.sql.Schematic;
import de.steamwar.sql.SchematicType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import java.util.LinkedList;
import java.util.List;
public class PlayerJoinListener implements Listener {
@EventHandler
public void handlePlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
List<Schematic> uncheckedSchematics = new LinkedList<>();
for(SchematicType type : SchematicType.values()){
if(type.check())
uncheckedSchematics.addAll(Schematic.getSchemsOfType(player.getUniqueId(), type));
}
if(!uncheckedSchematics.isEmpty())
player.sendMessage(SchematicSystem.PREFIX + "§7Du hast noch §e" + uncheckedSchematics.size() + " §7ungeprüfte Schematic(s)!");
}
}