Facebook
From Voluminous Cassowary, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 209
  1.     @EventHandler
  2.     public void onExplode(final EntityExplodeEvent e) {
  3.         final SimpleDateFormat df = new SimpleDateFormat("HH");
  4.         final String time = df.format(System.currentTimeMillis());
  5.         time.contains("20");
  6.         e.setCancelled(true);
  7.         time.contains("21");
  8.         e.setCancelled(true);
  9.         time.contains("22");
  10.         e.setCancelled(true);
  11.         if (time.contains("23")) {
  12.             e.setCancelled(true);
  13.         }
  14.         if (time.contains("00")) {
  15.             e.setCancelled(true);
  16.         }
  17.         if (time.contains("01")) {
  18.             e.setCancelled(true);
  19.         }
  20.         if (time.contains("02")) {
  21.             e.setCancelled(true);
  22.         }
  23.         if (time.contains("03")) {
  24.             e.setCancelled(true);
  25.         }
  26.         if (time.contains("04")) {
  27.             e.setCancelled(true);
  28.         }
  29.         if (time.contains("05")) {
  30.             e.setCancelled(true);
  31.         }
  32.         if (time.contains("06")) {
  33.             e.setCancelled(true);
  34.         }
  35.         if (time.contains("07")) {
  36.             e.setCancelled(true);
  37.         }
  38.         if (time.contains("10")) {
  39.             e.setCancelled(true);
  40.         }
  41.         if (time.contains("11")) {
  42.             e.setCancelled(true);
  43.         }
  44.         if (time.contains("12")) {
  45.             e.setCancelled(true);
  46.         }
  47.         if (time.contains("13")) {
  48.             e.setCancelled(true);
  49.         }
  50.         if (time.contains("14")) {
  51.             e.setCancelled(true);
  52.         }
  53.     }
  54.    
  55.     @EventHandler
  56.     public void onPlace(final BlockPlaceEvent e) {
  57.         if (e.getBlock().getType() != Material.TNT) {
  58.             return;
  59.         }
  60.         final SimpleDateFormat df = new SimpleDateFormat("HH");
  61.         final String time = df.format(System.currentTimeMillis());
  62.         if (time.contains("20")) {
  63.             e.setCancelled(true);
  64.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  65.         }
  66.         if (time.contains("21")) {
  67.             e.setCancelled(true);
  68.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  69.         }
  70.         if (time.contains("22")) {
  71.             e.setCancelled(true);
  72.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  73.         }
  74.         if (time.contains("23")) {
  75.             e.setCancelled(true);
  76.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  77.         }
  78.         if (time.contains("00")) {
  79.             e.setCancelled(true);
  80.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  81.         }
  82.         if (time.contains("01")) {
  83.             e.setCancelled(true);
  84.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  85.         }
  86.         if (time.contains("02")) {
  87.             e.setCancelled(true);
  88.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  89.         }
  90.         if (time.contains("03")) {
  91.             e.setCancelled(true);
  92.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  93.         }
  94.         if (time.contains("04")) {
  95.             e.setCancelled(true);
  96.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  97.         }
  98.         if (time.contains("05")) {
  99.             e.setCancelled(true);
  100.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  101.         }
  102.         if (time.contains("06")) {
  103.             e.setCancelled(true);
  104.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  105.         }
  106.         if (time.contains("07")) {
  107.             e.setCancelled(true);
  108.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  109.         }
  110.         if (time.contains("08")) {
  111.             e.setCancelled(true);
  112.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  113.         }
  114.         if (time.contains("09")) {
  115.             e.setCancelled(true);
  116.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  117.         }
  118.         if (time.contains("10")) {
  119.             e.setCancelled(true);
  120.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  121.         }
  122.         if (time.contains("11")) {
  123.             e.setCancelled(true);
  124.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  125.         }
  126.         if (time.contains("12")) {
  127.             e.setCancelled(true);
  128.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  129.         }
  130.         if (time.contains("13")) {
  131.             e.setCancelled(true);
  132.             e.getPlayer().sendMessage("§4TNT dziala w godzinach 14:00 - 22:00");
  133.         }
  134.     }
  135. }