From daa9efa89faab44cee4fe5a34c7f827e8ae511b2 Mon Sep 17 00:00:00 2001 From: HeshamTB <38921037+HeshamTB@users.noreply.github.com> Date: Sat, 5 May 2018 01:17:01 +0300 Subject: [PATCH] Update and fixed bed leave ev. --- bin/i/hesh/greet/events.class | Bin 3066 -> 3479 bytes builds/greet.jar | Bin 4777 -> 4936 bytes src/i/hesh/greet/commands.java | 2 +- src/i/hesh/greet/events.java | 46 +++++++++++++++++++++------------ 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/bin/i/hesh/greet/events.class b/bin/i/hesh/greet/events.class index c5a8c0da341111de954ae2401707157a9fbb91cc..1a148b97cff96c32031423a86d6c310934f5d97c 100644 GIT binary patch literal 3479 zcma)8>t7t@6@Fe=m}MCgvxyjTDHE;AE!h}i+6Eg71QOx`2_(d5tsU4Gm}GVaXJ?62 zTYIq=d)3-jYg@G!Z%uDfS%S8yZT;jw(BH40`*+knXLc6`LW&=D=biU`&pFRI=Q-!h z2mgKN8i2!i-$0GRb|*8V3p1JNK3V3?vk8zG%<6w=vM*|9Kiyy<2JJJof70m{AD(r}XSutc{7fh<{IdiT@?(Z?N7ayZpdv;cPIfebLG4INe z>28Z{l^w2F>`ua>>ko;h+eFjt>l9SNb7KVp_YM+6b_m&kd)OS6OAy%#$glpL^e*0_FRyoPnft#HnwIR zPY)OK6FN9+PqrdM5xE(n1UfE29GfqL_mh1+6Vsh(eqckgYw#M@t@hww6t1#h| z?|A(}!){4$^JtMY$?I{a;Luo)=lP)>I=)9+E!S&`1W(#t&LyQ%=s}->UWL12nf`w! zO&mwRLc_EU%d}M3!yv|`*N|4?bizafQjHkI{RU1c?7Y!!6In^n7AimP6vXFYJ5TBk z;)T7_qaaO9~9P<$usgiA6(4IH(fZ#ERrwZgj z6A#H=W9Vo7%R1<@3p$C1sm8j}g6( zFzF|?>-ts_ESu&|>%4X+{k*n9e~lUeGi730v@{l2V=F2g24%!^Y1k^KqhK9P;S%x& zT!n41K=(!+$%F@=GW4h{R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`F0^S@_5vsGRlVakqGN!hN?R-^y5=fdDOJ@xagnHWqg4zDN1UT!(uY$ zteJZ4OmpGxqcZ;r-$?kHG|63mlW_&#x*hE7N$GmGCNk;^?W^eV<9m`xX)(>X(q>u) zVVBd3?v5g72y~e#tB>!|L`4*(-!Gd4XOz=RE1#|cx**-3#c zc@1*quP8op4JG4PJb~rGRTH>t9EupOb%*ZkdKyk(f(FOttKv|50d$!HaS@@~?!B!NlTDWOgR zedkGZgkm>Ay@FR~ClRL!MijtqO5$s6^T^(tBKUVQ*}IrqNNb7AI_$!FH!LNMoe7IZ z7x2Ct);2FJQCuH*1wHC<2@{tO+k&55$7g{_T+UCYKT9k4U5@r?0zondLIhrc5>%p^ zepwRXDH35K@qKlgZER3W X1qJ{B000I61^|2k000*e00000j&~4Z diff --git a/src/i/hesh/greet/commands.java b/src/i/hesh/greet/commands.java index f45f2e9..9e0566b 100644 --- a/src/i/hesh/greet/commands.java +++ b/src/i/hesh/greet/commands.java @@ -23,10 +23,10 @@ public class commands extends JavaPlugin { public boolean onCommand(CommandSender sender, Command cmd, String commandlabel, String[] args) { + String greetprefix = ChatColor.AQUA + "[" + ChatColor.BLUE + "greet" + ChatColor.AQUA + "] "; //[ greet ] Player p = (Player) sender; - //use sender class if(cmd.getName().equalsIgnoreCase("opcheck")) { String pName = p.getDisplayName(); diff --git a/src/i/hesh/greet/events.java b/src/i/hesh/greet/events.java index 43cff28..7442cab 100644 --- a/src/i/hesh/greet/events.java +++ b/src/i/hesh/greet/events.java @@ -5,43 +5,57 @@ import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerBedEnterEvent; +import org.bukkit.event.player.PlayerBedLeaveEvent; +import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; public class events implements Listener { - String prefix = ChatColor.AQUA + "[" + ChatColor.BLUE + "5radl" + ChatColor.AQUA + "] "; //[ 5radl ] + private final String PREFIX = ChatColor.AQUA + "[" + ChatColor.BLUE + "5radl" + ChatColor.AQUA + "] "; //[ 5radl ] + Player p; + ChatColor aqua = ChatColor.AQUA; + ChatColor gray = ChatColor.GRAY; @EventHandler public void player(PlayerJoinEvent e) { - Player p = e.getPlayer(); + p = e.getPlayer(); String pName = p.getDisplayName(); - e.setJoinMessage(prefix + ChatColor.GRAY + p.getName().toLowerCase() + ChatColor.AQUA + " joined 5radl Server!"); - p.sendMessage(ChatColor.AQUA +"Hello " + pName + ", Welcome to 5radl Server"); - p.sendMessage(ChatColor.GRAY + "Online Players :"); + e.setJoinMessage(PREFIX + gray + p.getName().toLowerCase() + aqua + " joined 5radl Server!"); + p.sendMessage(aqua +"Hello " + pName + ", Welcome to 5radl Server"); + p.sendMessage(gray + "Online Players :"); int i = 1; for(Player player : Bukkit.getOnlinePlayers()) { p.sendMessage(ChatColor.RED + "" + i + "- " + player.getName()); i++; } - - p.sendMessage(ChatColor.AQUA +"Type"+ ChatColor.GREEN +" (/help greet) "+ ChatColor.AQUA+ "for list of new commands"); - } - @EventHandler - public void Quit(PlayerQuitEvent e ) { - Player p = e.getPlayer(); - e.setQuitMessage(prefix +ChatColor.GRAY + p.getName().toLowerCase() + ChatColor.DARK_RED + " left the server"); + + //p.sendMessage(aqua +"Type"+ ChatColor.GREEN +" (/help greet) "+ aqua+ "for list of new commands"); } - public void player(PlayerBedEnterEvent e) { //Changed TRY! - Player p = e.getPlayer(); - Bukkit.getWorld("world").setFullTime(1); - p.sendMessage(prefix+" Good Morning!"); + @EventHandler + public void Quit(PlayerQuitEvent e ) { + p = e.getPlayer(); + e.setQuitMessage(PREFIX + gray + p.getName().toLowerCase() + ChatColor.DARK_RED + " left the server"); } + + @EventHandler + public void player(PlayerBedLeaveEvent e) { + + p = e.getPlayer(); + Bukkit.getWorld("world").setFullTime(1); + p.sendMessage(PREFIX+" Good Morning!"); + + } + @EventHandler + public void player(PlayerItemConsumeEvent e) {e.getPlayer().sendMessage(ChatColor.BOLD+"nom nom nom!");} + + }