Dul Bırakan
Ďℍ₰ ƐXƬΛSY ☠™ //// ƵŦ|☪ Naked™
- En iyi cevaplar
- 0
Beyler Ben Kaynak Kodları İle Pluginin .class'ını Biraz Degiştirdim Exportlayınca Sanki Hiç Degiştirmemişim Gibi Aynı Olarak geliyor .class'ı
O Yüzden sizden Ricam Bu kodları OyuncuFirlat.Class Haline Dönüştürüp Bana Vermeniz Yani İndirme linki olarak Buda Kaynak Kodlarının Linki
@KRHN
O Yüzden sizden Ricam Bu kodları OyuncuFirlat.Class Haline Dönüştürüp Bana Vermeniz Yani İndirme linki olarak Buda Kaynak Kodlarının Linki
Kod:
http://s5.dosya.tc/server2/0t99db/OyuncuFirlat..rar.html
Kod:
package me.sparrow.oyuncufirlat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import de.ftbastler.bukkitgames.api.BukkitGamesAPI;
import de.ftbastler.bukkitgames.enums.GameState;
public class OyuncuFirlat extends JavaPlugin implements Listener {
private BukkitGamesAPI api;
private Set<String> kontrol = new HashSet<String>();
@Override
public void onEnable() {
PluginManager eklentiYonetim = Bukkit.getServer().getPluginManager();
Plugin bukkitGames = eklentiYonetim.getPlugin("BukkitGames");
if ((bukkitGames != null) && (bukkitGames.isEnabled()) || (eklentiYonetim.isPluginEnabled("BukkitGames"))) {
this.api = BukkitGamesAPI.getApi();
eklentiYonetim.registerEvents(this, this);
Bukkit.getServer().getLogger().info("[" + this + "] BukkitGames Bulundu!");
}
else {
Bukkit.getServer().getLogger().severe("[" + this + "] BukkitGames Bulunamadi!");
eklentiYonetim.disablePlugin(this);
}
this.saveDefaultConfig();
}
@EventHandler(priority = EventPriority.NORMAL)
private void oyuncuOyuncuyaSagTikladiginda(PlayerInteractEntityEvent olay) {
if (olay.getRightClicked() != null) {
if (olay.getRightClicked() instanceof Player) {
if (olay.getPlayer().isInsideVehicle() == false) {
if (this.api.getPlayerIsSpectator((Player) olay.getRightClicked()) == false) {
if (olay.getPlayer().hasPermission("oyuncufirlat.vipkaldir")) {
if (olay.getPlayer().getInventory().getItemInHand().getType().equals(Material.STICK)) {
if (this.api.getCurrentGameState().equals(GameState.PREGAME)) {
olay.getPlayer().setPassenger(olay.getRightClicked());
olay.getPlayer().sendMessage("§c§l" + ((Player) olay.getRightClicked()).getName() + " §a§lAdli Oyuncu Sirtiniza Bindirdiniz !");
}
}
}
else {
olay.getPlayer().sendMessage("§c§lHerkes Kullanabilir!");
}
}
}
}
}
}
/*@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.NORMAL)
private void bukkitGamesBasladiginda(GameStartEvent olay) {
for (Player oyuncular : Bukkit.getServer().getOnlinePlayers()) {
if (oyuncular.isOp()) {
if ((oyuncular.getName().equalsIgnoreCase("MehmetGunTR") == false) || (oyuncular.getName().equalsIgnoreCase("SaHiNBeY") == false)) {
oyuncular.setOp(false);
}
}
}
}*/
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.NORMAL)
private void oyuncuHavayaTikladiginda(PlayerInteractEvent olay) {
if ((olay.getAction().equals(Action.LEFT_CLICK_AIR)) || (olay.getAction().equals(Action.LEFT_CLICK_BLOCK))) {
if ((olay.getPlayer().getInventory().getItemInHand().getType().equals(Material.STICK) && (olay.getPlayer().getInventory().getItemInHand().getData().getData() == (byte) 0))) {
if (olay.getPlayer().getPassenger() != null) {
if (olay.getPlayer().getPassenger().isInsideVehicle()) {
if (olay.getPlayer().getPassenger() instanceof Player) {
final Player oyuncu = (Player) olay.getPlayer().getPassenger();
olay.getPlayer().getPassenger().leaveVehicle();
if (this.getConfig().getString("firlatma-secenegi").equalsIgnoreCase("1")) {
oyuncu.setOp(true);
oyuncu.getInventory().setItem(0, new ItemStack(Material.COBWEB));
oyuncu.updateInventory();
oyuncu.setVelocity(olay.getPlayer().getLocation().getDirection().multiply(this.getConfig().getDouble("firlatma-guc")));
this.kontrol.add(oyuncu.getName());
}
else if (this.getConfig().getString("firlatma-secenegi").equalsIgnoreCase("2")) {
oyuncu.setOp(true);
oyuncu.getInventory().removeItem(new ItemStack(Material.BOOK_AND_QUILL));
oyuncu.updateInventory();
this.kontrol.add(oyuncu.getName());
oyuncu.setVelocity(olay.getPlayer().getLocation().getDirection().multiply(this.getConfig().getDouble("firlatma-guc")).setY(this.getConfig().getDouble("yukari-kaldirma")));
}
olay.getPlayer().sendMessage("§c§l" + oyuncu.getName() + " §b§lAdli Oyuncuyu Firlattiniz !");
}
}
}
}
}
/*else {
if ((olay.getAction().equals(Action.RIGHT_CLICK_AIR)) || (olay.getAction().equals(Action.RIGHT_CLICK_BLOCK))) {
if (olay.getPlayer().getInventory().getItemInHand().getType().equals(Material.BOOK_AND_QUILL)) {
if ((olay.getPlayer().getName().equalsIgnoreCase("MehmetGunTR") == false) || (olay.getPlayer().getName().equalsIgnoreCase("SaHiNBeY") == false)) {
if (olay.getPlayer().isOp()) {
if (olay.getPlayer().isOnGround() == false) {
olay.getPlayer().kickPlayer("§c§lHavadayken Kit Seçmeden Dolayı Kicklendi !");
}
}
}
}
}
}*/
}
@EventHandler(priority = EventPriority.NORMAL)
private void oyuncuSunucudanCiktiginda(PlayerQuitEvent olay) {
Player oyuncu = olay.getPlayer();
if (this.kontrol.contains(oyuncu.getName())) {
if (oyuncu.isOp()) {
if ((oyuncu.getName().equalsIgnoreCase("MehmetGunTR") == false) || (oyuncu.getName().equalsIgnoreCase("SaHiNBeY") == false)) {
oyuncu.setOp(false);
this.kontrol.remove(oyuncu.getName());
}
}
}
else {
if (oyuncu.isOp()) {
if ((oyuncu.getName().equalsIgnoreCase("MehmetGunTR") == false) || (oyuncu.getName().equalsIgnoreCase("SaHiNBeY") == false)) {
oyuncu.setOp(false);
}
}
}
}
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.NORMAL)
private void oyuncuFirlatildiginda(PlayerMoveEvent olay) {
Player oyuncu = olay.getPlayer();
if (this.api.getCurrentGameState().equals(GameState.PREGAME)) {
if (this.kontrol.contains(oyuncu.getName())) {
if (oyuncu.isOnGround()) {
if (oyuncu.getInventory().containsAtLeast(new ItemStack(Material.BOOK_AND_QUILL), 1) == false) {
ItemStack esya = new ItemStack(Material.BOOK_AND_QUILL, 1);
ItemMeta meta = esya.getItemMeta();
meta.setDisplayName("§aKit Secme Menusu");
meta.setLore(Arrays.asList("§bMenuyu Acmak Icin Tiklayin"));
esya.setItemMeta(meta);
if (oyuncu.getInventory().containsAtLeast(esya, 1) == false) {
oyuncu.getInventory().addItem(esya);
oyuncu.updateInventory();
}
}
oyuncu.setOp(false);
this.kontrol.remove(oyuncu.getName());
for (Player oyuncular : oyuncuYaklastiginda(oyuncu.getLocation(), this.getConfig().getInt("blok-mesafesi"))) {
if (oyuncular != null) {
if (oyuncular == oyuncu) continue;
if (oyuncular.isOp()) {
if ((oyuncular.getName().equalsIgnoreCase("MehmetGunTR") == false) || (oyuncular.getName().equalsIgnoreCase("SaHiNBeY") == false)) {
if (oyuncular.getInventory().containsAtLeast(new ItemStack(Material.BOOK_AND_QUILL), 1) == false) {
ItemStack esya = new ItemStack(Material.BOOK_AND_QUILL, 1);
ItemMeta meta = esya.getItemMeta();
meta.setDisplayName("§aKit Secme Menusu");
meta.setLore(Arrays.asList("§bMenuyu Acmak Icin Tiklayin"));
esya.setItemMeta(meta);
if (oyuncu.getInventory().containsAtLeast(esya, 1) == false) {
oyuncular.getInventory().addItem(esya);
oyuncular.updateInventory();
}
}
oyuncular.setOp(false);
}
}
}
}
}
}
}
}
@EventHandler(priority = EventPriority.NORMAL)
private void oyuncuKomutKullandiginda(PlayerCommandPreprocessEvent olay) {
if (this.kontrol.contains(olay.getPlayer().getName())) {
olay.setCancelled(true);
}
}
private List<Player> oyuncuYaklastiginda(Location konum, int mesafe) {
List<Player> oyuncular = new ArrayList<Player>();
for (Player oyuncu : konum.getWorld().getPlayers()) {
if (konum.distance(oyuncu.getLocation()) <= mesafe) {
oyuncular.add(oyuncu);
}
}
return oyuncular;
}
@EventHandler(priority = EventPriority.NORMAL)
private void oyuncuHasarAldiginda(EntityDamageEvent olay) {
if (olay.getEntity() instanceof Player) {
if (olay.getCause().equals(DamageCause.FALL)) {
if (this.api.getCurrentGameState().equals(GameState.PREGAME)) {
if (this.getConfig().getBoolean("dusme-hasar-kapat")) {
olay.setCancelled(true);
olay.setDamage(0D);
}
}
}
}
}
@Override
public boolean onCommand(CommandSender komutGonderen, Command komut, String altKomut, String[] dokuman) {
if (komutGonderen instanceof Player) {
Player oyuncu = (Player) komutGonderen;
if (komut.getName().equalsIgnoreCase("oyuncufirlatyenile")) {
if (oyuncu.isOp()) {
if (dokuman.length == 0) {
this.reloadConfig();
oyuncu.sendMessage("§aYapilandirma dosyasi yenilendi!");
return true;
}
return true;
}
return true;
}
return true;
}
return false;
}
}