Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.youki300.eronyatest;
- import org.bukkit.Bukkit;
- import org.bukkit.scheduler.BukkitRunnable;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Date;
- import java.util.Locale;
- public class TesTRefresh extends BukkitRunnable {
- @Override
- public void run() {
- verifDate("lundi", 22, 40, "broadcast TEST 22h40");
- }
- public void verifDate(String jour, int heure, int min, String command){
- Calendar now2 = Calendar.getInstance();
- Date now = new Date();
- String date = new SimpleDateFormat("EEEE", Locale.FRANCE).format(now).replace(".", "");
- if(date.equalsIgnoreCase(jour)){
- if(now2.get(Calendar.HOUR_OF_DAY) == heure){
- if(now2.get(Calendar.MINUTE) == min && (now2.get(Calendar.SECOND) == (0) || now2.get(Calendar.SECOND) == (1))){
- Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command);
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement