Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Dobbermann2.BowButton;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Material;
- import org.bukkit.entity.EntityType;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.entity.ProjectileHitEvent;
- public class Listeners implements Listener {
- Main plugin;
- public Listeners(Main pl) {
- plugin = pl;
- }
- @EventHandler
- public void onProjectileHit(ProjectileHitEvent e) {
- if (plugin.jp.contains(e.getEntity().getShooter())) {
- Bukkit.broadcastMessage(ChatColor.RED + "1");
- if (e.getEntity().getType() == EntityType.ARROW) {
- Bukkit.broadcastMessage(ChatColor.RED + "2");
- if (e.getEntity().getLocation().getBlock().getType() == Material.WOOD_BUTTON) {
- Bukkit.broadcastMessage(ChatColor.RED + "3");
- if (plugin.jp.size() == 1) {
- if (e.getEntity().getShooter() == plugin.jp.get(0)) {
- plugin.jp
- .get(0)
- .getPlayer()
- .sendMessage(
- ChatColor.BLUE + "["
- + ChatColor.RED
- + "Bow Button"
- + ChatColor.BLUE + "]"
- + ChatColor.WHITE
- + "You know have "
- + plugin.points.get(0));
- plugin.points.put(plugin.jp.get(0), +1);
- if (plugin.points.get(plugin.jp.get(0)).equals(3)) {
- ChatUtilities.broadcast(ChatColor.YELLOW
- + plugin.jp.get(0).getName() + " "
- + ChatColor.GREEN + "won the game");
- plugin.Ending();
- }
- }
- }
- if (plugin.jp.size() == 1) {
- if (e.getEntity().getShooter() == plugin.jp.get(1)) {
- plugin.jp
- .get(1)
- .getPlayer()
- .sendMessage(
- ChatColor.BLUE + "["
- + ChatColor.RED
- + "Bow Button"
- + ChatColor.BLUE + "]"
- + ChatColor.WHITE
- + "You know have "
- + plugin.points.get(1));
- plugin.points.put(plugin.jp.get(1), +1);
- if (plugin.points.get(plugin.jp.get(1)).equals(3)) {
- ChatUtilities.broadcast(ChatColor.YELLOW
- + plugin.jp.get(0).getName() + " "
- + ChatColor.GREEN + "won the game");
- plugin.Ending();
- }
- }
- }
- if (plugin.jp.size() == 1) {
- if (e.getEntity().getShooter() == plugin.jp.get(2)) {
- plugin.jp
- .get(2)
- .getPlayer()
- .sendMessage(
- ChatColor.BLUE + "["
- + ChatColor.RED
- + "Bow Button"
- + ChatColor.BLUE + "]"
- + ChatColor.WHITE
- + "You know have "
- + plugin.points.get(2));
- plugin.points.put(plugin.jp.get(2), +1);
- if (plugin.points.get(plugin.jp.get(2)).equals(3)) {
- ChatUtilities.broadcast(ChatColor.YELLOW
- + plugin.jp.get(0).getName() + " "
- + ChatColor.GREEN + "won the game");
- plugin.Ending();
- }
- }
- }
- if (plugin.jp.size() == 1) {
- if (e.getEntity().getShooter() == plugin.jp.get(3)) {
- plugin.jp
- .get(3)
- .getPlayer()
- .sendMessage(
- ChatColor.BLUE + "["
- + ChatColor.RED
- + "Bow Button"
- + ChatColor.BLUE + "]"
- + ChatColor.WHITE
- + "You know have "
- + plugin.points.get(3));
- plugin.points.put(plugin.jp.get(3), +1);
- if (plugin.points.get(plugin.jp.get(3)).equals(3)) {
- ChatUtilities.broadcast(ChatColor.YELLOW
- + plugin.jp.get(0).getName() + " "
- + ChatColor.GREEN + "won the game");
- plugin.Ending();
- }
- }
- }
- if (plugin.jp.size() == 1) {
- if (e.getEntity().getShooter() == plugin.jp.get(4)) {
- plugin.jp
- .get(4)
- .getPlayer()
- .sendMessage(
- ChatColor.BLUE + "["
- + ChatColor.RED
- + "Bow Button"
- + ChatColor.BLUE + "]"
- + ChatColor.WHITE
- + "You know have "
- + plugin.points.get(4));
- plugin.points.put(plugin.jp.get(4), +1);
- if (plugin.points.get(plugin.jp.get(4)).equals(3)) {
- ChatUtilities.broadcast(ChatColor.YELLOW
- + plugin.jp.get(0).getName() + " "
- + ChatColor.GREEN + "won the game");
- plugin.Ending();
- }
- }
- }
- if (e.getEntity().getShooter() == null) {
- return;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement