Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tam2Main;
- import java.io.File;
- import java.io.IOException;
- import java.lang.reflect.Array;
- import java.lang.reflect.Field;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Set;
- import java.util.UUID;
- import javax.management.timer.Timer;
- import org.apache.commons.lang.ArrayUtils;
- import org.apache.commons.lang3.tuple.Pair;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Chunk;
- import org.bukkit.DyeColor;
- import org.bukkit.EntityEffect;
- import org.bukkit.GameMode;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.Sound;
- import org.bukkit.SoundCategory;
- import org.bukkit.World;
- import org.bukkit.attribute.Attribute;
- import org.bukkit.block.Block;
- import org.bukkit.block.CommandBlock;
- import org.bukkit.command.ConsoleCommandSender;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.craftbukkit.v1_12_R1.CraftServer;
- import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
- import org.bukkit.craftbukkit.v1_12_R1.CraftChunk;
- import org.bukkit.craftbukkit.v1_12_R1.entity.CraftZombie;
- import org.bukkit.craftbukkit.v1_12_R1.entity.CraftWolf;
- import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
- import org.bukkit.entity.AnimalTamer;
- import org.bukkit.entity.Arrow;
- import org.bukkit.entity.Entity;
- import org.bukkit.entity.EntityType;
- import org.bukkit.entity.Player;
- import org.bukkit.entity.Snowman;
- import org.bukkit.entity.Villager;
- import org.bukkit.entity.Wolf;
- import org.bukkit.entity.Zombie;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.entity.EntityDeathEvent;
- import org.bukkit.event.entity.EntityDamageByEntityEvent;
- import org.bukkit.event.entity.EntityDamageEvent;
- import org.bukkit.event.entity.PlayerDeathEvent;
- import org.bukkit.event.player.PlayerChatEvent;
- import org.bukkit.event.player.PlayerVelocityEvent;
- import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
- import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
- import org.bukkit.event.player.PlayerChangedMainHandEvent;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.event.player.PlayerJoinEvent;
- import org.bukkit.event.player.PlayerMoveEvent;
- import org.bukkit.event.player.PlayerQuitEvent;
- import org.bukkit.event.player.PlayerTeleportEvent;
- import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
- import org.bukkit.event.player.PlayerToggleSneakEvent;
- import org.bukkit.inventory.EntityEquipment;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- import org.bukkit.util.Vector;
- import com.google.common.collect.Sets;
- import com.mojang.authlib.GameProfile;
- import com.mojang.authlib.properties.Property;
- import net.minecraft.server.v1_12_R1.BlockPosition;
- import net.minecraft.server.v1_12_R1.Blocks;
- import net.minecraft.server.v1_12_R1.ControllerMove;
- import net.minecraft.server.v1_12_R1.EntityAgeable;
- import net.minecraft.server.v1_12_R1.EntityHuman;
- import net.minecraft.server.v1_12_R1.EntityLiving;
- import net.minecraft.server.v1_12_R1.EntityLlama;
- import net.minecraft.server.v1_12_R1.EntityPlayer;
- import net.minecraft.server.v1_12_R1.EntityVillager;
- import net.minecraft.server.v1_12_R1.EntityWolf;
- import net.minecraft.server.v1_12_R1.EntityZombie;
- import net.minecraft.server.v1_12_R1.EnumItemSlot;
- import net.minecraft.server.v1_12_R1.EnumItemSlot.Function;
- import net.minecraft.server.v1_12_R1.EnumMoveType;
- import net.minecraft.server.v1_12_R1.GenericAttributes;
- import net.minecraft.server.v1_12_R1.Item;
- import net.minecraft.server.v1_12_R1.ItemStack;
- import net.minecraft.server.v1_12_R1.MathHelper;
- import net.minecraft.server.v1_12_R1.MinecraftServer;
- import net.minecraft.server.v1_12_R1.PacketPlayInClientCommand;
- import net.minecraft.server.v1_12_R1.PacketPlayInClientCommand.EnumClientCommand;
- import net.minecraft.server.v1_12_R1.PacketPlayOutAnimation;
- import net.minecraft.server.v1_12_R1.PacketPlayOutEntity.PacketPlayOutEntityLook;
- import net.minecraft.server.v1_12_R1.PacketPlayOutEntityDestroy;
- import net.minecraft.server.v1_12_R1.PacketPlayOutEntityEquipment;
- import net.minecraft.server.v1_12_R1.PacketPlayOutEntityHeadRotation;
- import net.minecraft.server.v1_12_R1.PacketPlayOutEntityStatus;
- import net.minecraft.server.v1_12_R1.PacketPlayOutEntityTeleport;
- import net.minecraft.server.v1_12_R1.PacketPlayOutMapChunk;
- import net.minecraft.server.v1_12_R1.PacketPlayOutNamedEntitySpawn;
- import net.minecraft.server.v1_12_R1.PacketPlayOutSpawnEntityLiving;
- import net.minecraft.server.v1_12_R1.PathEntity;
- import net.minecraft.server.v1_12_R1.PathfinderGoalBeg;
- import net.minecraft.server.v1_12_R1.PathfinderGoalBreed;
- import net.minecraft.server.v1_12_R1.PathfinderGoalFloat;
- import net.minecraft.server.v1_12_R1.PathfinderGoalFollowOwner;
- import net.minecraft.server.v1_12_R1.PathfinderGoalHurtByTarget;
- import net.minecraft.server.v1_12_R1.PathfinderGoalLeapAtTarget;
- import net.minecraft.server.v1_12_R1.PathfinderGoalLookAtPlayer;
- import net.minecraft.server.v1_12_R1.PathfinderGoalMeleeAttack;
- import net.minecraft.server.v1_12_R1.PathfinderGoalMoveThroughVillage;
- import net.minecraft.server.v1_12_R1.PathfinderGoalMoveTowardsRestriction;
- import net.minecraft.server.v1_12_R1.PathfinderGoalNearestAttackableTarget;
- import net.minecraft.server.v1_12_R1.PathfinderGoalOwnerHurtByTarget;
- import net.minecraft.server.v1_12_R1.PathfinderGoalOwnerHurtTarget;
- import net.minecraft.server.v1_12_R1.PathfinderGoalRandomLookaround;
- import net.minecraft.server.v1_12_R1.PathfinderGoalRandomStroll;
- import net.minecraft.server.v1_12_R1.PathfinderGoalRandomStrollLand;
- import net.minecraft.server.v1_12_R1.PathfinderGoalSelector;
- import net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo;
- import net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
- import net.minecraft.server.v1_12_R1.WorldGenNetherPieces.WorldGenNetherPiece15;
- import net.minecraft.server.v1_12_R1.PlayerConnection;
- import net.minecraft.server.v1_12_R1.PlayerInteractManager;
- import net.minecraft.server.v1_12_R1.WorldServer;
- /**
- * @author user
- *
- */
- public class Main extends JavaPlugin implements Listener {
- String pn1;
- double px1;
- double py1;
- double pz1;
- double prx1;
- double pry1;
- double pvx1;
- double pvy1;
- double pvz1;
- double tpx1 = 0;
- double tpy1 = 0;
- double tpz1 = 0;
- double tprx1 = 0;
- double tpry1 = 0;
- double tpvx1 = 0;
- double tpvy1 = 0;
- double tpvz1 = 0;
- double xx1 = 0;
- double yy1 = 0;
- double zz1 = 0;
- float rxrx1 = 0;
- float ryry1 = 0;
- boolean em = false;
- boolean tr = false;
- int ot = 0;
- boolean tru;
- boolean end;
- Player p1;
- Zombie p15;
- Item p40;
- PluginDescriptionFile pdFile = this.getDescription();
- HashMap<String, Integer> ani = new HashMap<String, Integer>();
- HashMap<String, Integer> statu = new HashMap<String, Integer>();
- HashMap<String, EntityPlayer> np = new HashMap<String, EntityPlayer>();
- HashMap<String, Zombie> zp = new HashMap<String, Zombie>();
- HashMap<Zombie, Integer> zt = new HashMap<Zombie, Integer>();
- HashMap<Wolf, Integer> wt = new HashMap<Wolf, Integer>();
- HashMap<String, Integer> wa = new HashMap<String, Integer>();
- HashMap<String, Integer> wb = new HashMap<String, Integer>();
- HashMap<String, Location> wc = new HashMap<String, Location>();
- HashMap<Zombie, Integer> zk = new HashMap<Zombie, Integer>();
- HashMap<Zombie, Entity> ze = new HashMap<Zombie, Entity>();
- HashMap<String, Location> sloc = new HashMap<String, Location>();
- HashMap<String, Location> po = new HashMap<String, Location>();
- HashMap<Wolf, Integer> wd = new HashMap<Wolf, Integer>();
- // HashMap<String,Integer> zc = new HashMap<String,Integer>();
- HashMap<String, Location> loca = new HashMap<String, Location>();
- HashMap<String, Integer> o103i = new HashMap<String, Integer>();
- HashMap<String, Integer> o102i = new HashMap<String, Integer>();
- HashMap<String, Integer> o101i = new HashMap<String, Integer>();
- HashMap<String, Integer> o100i = new HashMap<String, Integer>();
- HashMap<String, Integer> o0i = new HashMap<String, Integer>();
- HashMap<String, Integer> o1i = new HashMap<String, Integer>();
- HashMap<Player, Location> from1 = new HashMap<Player, Location>();
- HashMap<Player, Location> to1 = new HashMap<Player, Location>();
- HashMap<Arrow, Integer> ar1 = new HashMap<Arrow, Integer>();
- HashMap<Player, Integer> cool = new HashMap<Player, Integer>();
- HashMap<Player, Boolean> tem = new HashMap<Player, Boolean>();
- Wolf w6 = null;
- EntityWolf w7 = null;
- /*
- * HashMap<String,ItemStack> o103i = new HashMap<String,ItemStack>();
- * HashMap<String,ItemStack> o102i = new HashMap<String,ItemStack>();
- * HashMap<String,ItemStack> o101i = new HashMap<String,ItemStack>();
- * HashMap<String,ItemStack> o100i = new HashMap<String,ItemStack>();
- * HashMap<String,ItemStack> o0i = new HashMap<String,ItemStack>();
- */
- String[] commands3 = new String[32301];
- int tick = 0;
- FileConfiguration Config = this.getConfig();
- @EventHandler
- public boolean onCom(PlayerChatEvent e) {
- String[] com = e.getMessage().split(" ");
- for (Entity ent1 : Bukkit.getWorlds().get(0).getEntities()) {
- w6 = null;
- w7 = null;
- String goy1 = "";
- if (ent1.getType().equals(EntityType.WOLF)) {
- if (ent1.getScoreboardTags().contains((Object) ("dig" + e.getPlayer().getName()))) {
- String tag1 = "buda";
- if (com.length>=2){
- if (ent1.getScoreboardTags().contains("goyu"+com[1])){
- tag1 = "goyu"+com[1];
- }
- if (ent1.getScoreboardTags().contains("bude"+com[1])){
- tag1 = "bude"+com[1];
- }
- }
- if (ent1.getScoreboardTags().contains(tag1)) {
- w6 = (Wolf) ent1;
- w7 = ((CraftWolf) w6).getHandle();
- for (Object j : w6.getScoreboardTags().toArray()) {
- String jj = ((String) j);
- if (jj.length() >= 4) {
- if (((Object) jj.substring(0, 4)).equals((Object) ("goyu"))) {
- goy1 = jj;
- }
- }
- }
- }
- if (w6 != null) {
- String[] com2 = com[0].split("!");
- if(com[0].equals("sit?"))
- {
- if(w6.isSitting()){
- e.getPlayer().sendMessage(goy1 + " : 앉아있음");
- } else {
- int wa1 = (int) wa.get(w6.getUniqueId().toString()+goy1+"_"+1).intValue()/20;
- if(wa1==0){
- e.getPlayer().sendMessage(goy1 + " : 서있음");
- } else {
- e.getPlayer().sendMessage(goy1 + " : \""+wa1+"\"초후에 앉을것임");
- }
- }
- }
- if(com[0].equals("m?"))
- {
- String arg = "";
- if(wd.get(w6)%10==1){
- arg = goy1 + " : 목표물에게먼저발사";
- }
- if(wd.get(w6)%10==2){
- arg = goy1 + " : 주인공격에조금이라도의심되는목표물에게발사";
- }
- if(wd.get(w6)%10==3){
- arg = goy1 + " : 주인공격에의심되는목표물에게발사";
- }
- if(wd.get(w6)%10==4){
- arg = goy1 + " : 목표물에게먼저물어뜯기";
- }
- if(wd.get(w6)%10==5){
- arg = goy1 + " : 주인공격에조금이라도의심되는목표물에게물어뜯기";
- }
- if(wd.get(w6)%10==6){
- arg = goy1 + " : 주인공격에의심되는목표물에게물어뜯기";
- }
- if(wd.get(w6)%10>=50){
- arg = goy1 + " : 공격안함";
- }
- e.getPlayer().sendMessage(arg);
- }
- if(com[0].equals("find?"))
- {
- if(w6.getTarget()!=null){
- if(w6.getTarget()!=null){
- e.getPlayer().sendMessage(goy1 + " : 앉아있음");
- }
- }
- }
- if(com[0].equals("info?"))
- {
- }
- for (int ii = 0; ii <= com2.length-1; ii++) {
- String com3 = com2[ii];
- int at = 0;
- int at2 = 0;
- Loop : for (int i = 0; i <= 4; i++) {
- if (i == 4) {
- at = -1;
- break Loop;
- }
- try {Double.parseDouble(Character.toString(com3.charAt(i)));} catch (NumberFormatException e1){
- if (i == 0) {
- at = -1;
- } else {
- at = (int) Double.parseDouble(com3.substring(0, i));
- }
- break Loop;
- }
- }
- Loop : for (int i = 0; i <= 4; i++) {
- if (i == 4) {
- at2 = -1;
- break Loop;
- }
- try {Double.parseDouble(Character.toString(com3.charAt(com3.length()-1-i)));} catch (NumberFormatException e1){
- if (i == 0) {
- at2 = -1;
- } else {
- at2 = (int) Double.parseDouble(com3.substring(com3.length()-i, com3.length()));
- }
- break Loop;
- }
- }
- String at11 = "";
- String at22 = "";
- String at33 = "";
- if (com3.charAt(0) == 'g') {
- List<Block> sight = e.getPlayer().getLineOfSight((Set) null, 256); //Get the blocks in the player's line of sight (the Set is null to not ignore any blocks)
- Location pl = null;
- for (Block block : sight) { //For each block in the list
- if (block.getType() != Material.AIR) { //If the block is not air -> obstruction reached, exit loop/seach
- pl = new Location(block.getWorld(),block.getX(),block.getY()+1,block.getZ());
- break;
- }
- }
- w7.getNavigation().a(pl.getX(),pl.getY(),pl.getZ(),1.0D);
- wc.put(w6.getUniqueId().toString()+goy1, pl);
- at33 = "g";
- }
- if (at != -1) {
- at11 = Integer.toString(at);
- at *= 20;
- } else {
- at = 3;
- }
- if (at2 != -1) {
- at22 = Integer.toString(at2);
- at2 *= 20;
- }
- // Bukkit.getPlayer("Kang").sendMessage(at11+"=="+at22+"=="+com3.substring(at11.length(),
- // com3.length() - at22.length()));
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("sit")) {
- Dsit(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("sits")) {
- Dsits(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("stand")) {
- Dstand(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("ma")) {
- Dma(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mb")) {
- Dmb(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mc")) {
- Dmc(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mx")) {
- Dmx(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("my")) {
- Dmy(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mz")) {
- Dmz(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mm")) {
- Dmm(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("finda")) {
- Dfinda(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("findb")) {
- Dfindb(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("looka")) {
- Dlooka(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("lookb")) {
- Dlookb(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("sad")) {
- Dsad(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("sads")) {
- Dsads(at33, goy1, w6, at, at2);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("shake")) {
- Dshake(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("shakes")) {
- Dshakes(at33, goy1, w6, at, at2);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("jump")) {
- Djump(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("jumps")) {
- Djumps(at33, goy1, w6, at, at2);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("roll")) {
- Droll(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("rolls")) {
- Drolls(at33, goy1, w6, at, at2);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("bomb")) {
- Dbomb(at33, goy1, w6, at);
- }
- if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("come")) {
- Dcome(at33, goy1, w6, at);
- }
- }
- }
- }
- }
- }
- if (e.getPlayer().isOp()) {
- if (com[0].charAt(0) == '#') {
- }
- if (com[0].equals("+help")) {
- e.getPlayer().sendMessage(ChatColor.GOLD + " help1 : 파일수정법");
- e.getPlayer().sendMessage(ChatColor.GOLD + " help2 : #명령어들");
- e.getPlayer().sendMessage(ChatColor.GOLD + " help3 : 플러그인 정보");
- }
- if (com[0].equals("+help1")) {
- e.getPlayer().sendMessage(ChatColor.GOLD + "----Minnim Plugin Help1----");
- e.getPlayer().sendMessage(ChatColor.GREEN + " list" + ChatColor.WHITE + " : 등록한것들을 보여줍니다.");
- e.getPlayer().sendMessage(ChatColor.GREEN + " ac" + ChatColor.DARK_RED + " a b" + ChatColor.WHITE
- + " : b명령어를 a번째에 등록하잖아 진짜 혼날래?");
- e.getPlayer().sendMessage(ChatColor.GREEN + " rc" + ChatColor.DARK_RED + " a" + ChatColor.WHITE
- + " : a번째를 지웁니다 그것도 모른대요 ㅉㅉ");
- e.getPlayer().sendMessage(ChatColor.GREEN + " sc" + ChatColor.WHITE + " : 등록한것들을 번호순서대로 정렬합니다.");
- e.getPlayer().sendMessage(ChatColor.GREEN + " mc" + ChatColor.DARK_RED + " a a2" + ChatColor.WHITE
- + " : a번째와 b번째 순서를 바꿉니다.");
- e.getPlayer().sendMessage(ChatColor.GREEN + " yc" + ChatColor.DARK_RED + " c" + ChatColor.WHITE
- + " : 1~32300까지 자연수 x번째를 c번째로 바꿉니다.");
- e.getPlayer()
- .sendMessage(ChatColor.DARK_PURPLE + " cs" + ChatColor.WHITE + " : 목록을 아래 커맨드블록으로 모두 바꿉니다.");
- e.getPlayer().sendMessage(
- ChatColor.DARK_PURPLE + " cl" + ChatColor.WHITE + " : 목록을 아래 커맨드블록으로 모두 불러옵니다.");
- e.getPlayer().sendMessage(" c에 @를 넣으면 x값이 나옵니다.");
- e.getPlayer().sendMessage(" 마지막으로 고추좀만져보자");
- }
- if (com[0].equals("+help2")) {
- e.getPlayer().sendMessage(ChatColor.GOLD + "----Minnim Plugin Help2----");
- e.getPlayer()
- .sendMessage(ChatColor.GREEN + " tp5" + ChatColor.DARK_RED
- + " a1 a2 a3 a4 a5 a6 a7 a8 a9 a10" + ChatColor.WHITE
- + " : a1에게 (x=a2,y=a3,z=a4,rx=a5,ry=a6,velx=a7,vely=a8,velz=a9)");
- e.getPlayer().sendMessage(" a1{@p=모든플레이어} , a2~a9첫글자{~,x,X,z,Z,s}");
- e.getPlayer()
- .sendMessage(ChatColor.GREEN + " tpnpc" + ChatColor.DARK_RED + " b a2 a3 a4 a5 a6 a7 a8 a9"
- + ChatColor.WHITE + " : b번째 분신에게 (x=a2,y=a3,z=a4,rx=a5,ry=a6,velx=a7,velz=a8)");
- e.getPlayer().sendMessage(" b{1~16}");
- e.getPlayer().sendMessage(
- ChatColor.GREEN + " denpc" + ChatColor.DARK_RED + " b" + ChatColor.WHITE + " : b번째 분신 삭제");
- e.getPlayer().sendMessage(ChatColor.GREEN + " flyon" + ChatColor.WHITE + " : 모든플레이어에게 날개가 생");
- e.getPlayer().sendMessage(ChatColor.GREEN + " flyon" + ChatColor.WHITE + " : 모든플레이어를 서바이벌에서 날기 off");
- e.getPlayer().sendMessage(
- ChatColor.GREEN + " sethp" + ChatColor.DARK_RED + " c" + ChatColor.WHITE + " : 체력을 c로만듬");
- e.getPlayer().sendMessage(
- ChatColor.GREEN + " sethg" + ChatColor.DARK_RED + " c" + ChatColor.WHITE + " : 허기를 c로만듬");
- e.getPlayer().sendMessage(ChatColor.GREEN + " hide" + ChatColor.WHITE + " : 투명화");
- e.getPlayer().sendMessage(ChatColor.GREEN + " show" + ChatColor.WHITE + " : 투명화해제");
- e.getPlayer().sendMessage(ChatColor.GREEN + " damage" + ChatColor.DARK_RED + " c" + ChatColor.WHITE
- + " : 데미지를 c만큼달게함");
- e.getPlayer().sendMessage(" detect @a를 넣어 조건을 달수있습니다.");
- e.getPlayer().sendMessage(" 하지만 @a에는 name,score_?,score_?_min 밖에 못씁니다.");
- e.getPlayer().sendMessage(" 마지막으로 불알좀만져보자");
- }
- if (com[0].equals("+help3")) {
- e.getPlayer().sendMessage(ChatColor.GOLD + "----Minnim Plugin Help2----");
- e.getPlayer().sendMessage(" 허스크는 바라보고있는방향으로 나아가는 미사일입니다.");
- e.getPlayer().sendMessage(" 철괴는 총입니다.");
- e.getPlayer().sendMessage(" 좀비 name{msl:미사일,그뒤에속도적으세요}tag{shoot:총쏨}");
- e.getPlayer().sendMessage(" 필수스코어보드:ilus,tp,yes,no");
- e.getPlayer().sendMessage(" 마지막으로 포경좀만져보자");
- }
- if (com[0].equals("+cs")) {
- ArrayList<String> la = new ArrayList<String>();
- Location l6 = e.getPlayer().getLocation();
- org.bukkit.World wo = Bukkit.getWorlds().get(0);
- Location locat = new Location(wo, l6.getX(), l6.getY() - 1, l6.getZ());
- if (wo.getBlockAt(locat).getType() == Material.COMMAND) {
- /*
- * for (int i = 0; i <= 32300; i++) { Config.set("com" + i,
- * null); }
- */
- CommandBlock cb = ((CommandBlock) wo.getBlockAt(locat).getState());
- String cbd = cb.getCommand().toString();
- cbd = cbd.replace("/", "걁/");
- cbd = cbd.replace("#", "걁#");
- int las = 0;
- for (int i = 0; i <= 32300; i++) {
- if (Config.contains("com" + i)) {
- las = i;
- }
- }
- for (String cbs : cbd.substring(1, cbd.length()).split("걁")) {
- la.add(cbs);
- Config.set("com" + (la.size() + las), la.get(la.size() - 1));
- }
- try {
- Config.save(getDataFolder() + File.separator + "config.yml");
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- }
- }
- if (com[0].equals("+cl")) {
- Location l6 = e.getPlayer().getLocation();
- org.bukkit.World wo = Bukkit.getWorlds().get(0);
- Location locat = new Location(wo, l6.getX(), l6.getY() - 1, l6.getZ());
- if (wo.getBlockAt(locat).getType() == Material.COMMAND) {
- CommandBlock cb = ((CommandBlock) wo.getBlockAt(locat).getState());
- cb.setCommand("");
- for (int i = 0; i <= 32300; i++) {
- if (Config.contains("com" + i)) {
- cb.setCommand(cb.getCommand().toString() + Config.get("com" + i).toString());
- cb.update();
- }
- }
- }
- }
- if (com[0].equals("+ac")) {
- String ar = "";
- for (int i = 2; i <= com.length - 1; i++) {
- ar = ar + com[i] + " ";
- }
- if (com[1].contains("~")) {
- int i1 = Integer.parseInt(com[1].split("~")[0]);
- int i2 = Integer.parseInt(com[1].split("~")[0]);
- if (i2 > i1) {
- for (int i = i1; i <= i2; i++) {
- Config.set("com" + i, ar);
- }
- }
- } else {
- Config.set("com" + com[1], ar);
- }
- try {
- Config.save(getDataFolder() + File.separator + "config.yml");
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return true;
- }
- if (com[0].equals("+rc")) {
- if (com[1].contains("~")) {
- int i1 = Integer.parseInt(com[1].split("~")[0]);
- int i2 = Integer.parseInt(com[1].split("~")[1]);
- if (i2 > i1) {
- for (int i = i1; i <= i2; i++) {
- Config.set("com" + i, null);
- }
- }
- } else {
- Config.set("com" + com[1], null);
- }
- try {
- Config.save(getDataFolder() + File.separator + "config.yml");
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return true;
- }
- if (com[0].equals("+sc")) {
- String[] str = new String[32301];
- for (int i = 0; i <= 32300; i++) {
- if (Config.contains("com" + i)) {
- str[i] = Config.get("com" + i).toString();
- } else {
- str[i] = "*null";
- }
- Config.set("com" + i, null);
- }
- for (int i = 0; i <= 32300; i++) {
- if (str[i] == "*null") {
- Config.set("com" + i, null);
- } else {
- Config.set("com" + i, str[i]);
- }
- }
- try {
- Config.save(getDataFolder() + File.separator + "config.yml");
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return true;
- }
- if (com[0].equals("+mc")) {
- String aa = "";
- String bb = "";
- aa = Config.get("com" + com[1]).toString();
- bb = Config.get("com" + com[2]).toString();
- Config.set("com" + com[1], bb);
- Config.set("com" + com[2], aa);
- try {
- Config.save(getDataFolder() + File.separator + "config.yml");
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return true;
- }
- if (com[0].equals("+yc")) {
- for (String i : Config.getKeys(true)) {
- Config.set(i,null);
- }
- try {
- Config.save(getDataFolder() + File.separator + "config.yml");
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return true;
- }
- if (com[0].equals("+list")) {
- for (String i : Config.getKeys(true)) {
- i = i.substring(3, i.length());
- e.getPlayer().sendMessage(i + " : " + Config.get("com" + i));
- }
- return true;
- }
- if (com[0].equals("+wolfadd")) {
- int dct = 1;
- for (Object j : e.getPlayer().getScoreboardTags().toArray()) {
- String jj = ((String) j);
- if (jj.length() >= 3) {
- if (((Object) jj.substring(0, 3)).equals((Object) ("dco"))) {
- dct += 1;
- }
- }
- }
- e.getPlayer().addScoreboardTag("dco" + Integer.toString(dct) + "_" + com[1]);
- e.getPlayer().addScoreboardTag("dna" + Integer.toString(dct) + "_" + com[2]);
- e.getPlayer().addScoreboardTag("dwd" + Integer.toString(dct) + "_" + 1);
- }
- if (com[0].equals("+wolfreset")) {
- for (Object j : e.getPlayer().getScoreboardTags().toArray()) {
- String jj = ((String) j);
- if (jj.length() >= 3) {
- if (((Object) jj.substring(0, 3)).equals((Object) ("dco"))) {
- e.getPlayer().removeScoreboardTag(jj);
- }
- if (((Object) jj.substring(0, 3)).equals((Object) ("dna"))) {
- e.getPlayer().removeScoreboardTag(jj);
- }
- if (((Object) jj.substring(0, 3)).equals((Object) ("dwd"))) {
- e.getPlayer().removeScoreboardTag(jj);
- }
- }
- }
- }
- if (com[0].equals("+eson")) {
- em=true;
- Bukkit.broadcastMessage("eson");
- }
- if (com[0].equals("+esoff")) {
- em=false;
- Bukkit.broadcastMessage("esoff");
- }
- }
- return false;
- }
- public void onEnable() {
- Bukkit.getPluginManager().registerEvents(this, this);
- Main main = this;
- // Bukkit.broadcastMessage(commands3.toString());
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
- @SuppressWarnings("deprecation")
- public void run() {
- if(em)
- {
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "scoreboard players add @e[type=Arrow] In 1 {inGround:1b}";
- Bukkit.dispatchCommand(console, command);
- command = "execute @e[score_In_min=1] ~ ~ ~ summon tnt";
- Bukkit.dispatchCommand(console, command);
- command = "kill @e[score_In_min=1]";
- Bukkit.dispatchCommand(console, command);}
- commands3 = new String[32301];
- for (String i : Config.getKeys(true)) {
- i = i.substring(3, i.length());
- commands3[Integer.parseInt(i)] = Config.getString(("com" + i).toString()).toString();
- }
- ////////////////////////////////
- tick += 1;
- if (tick >= 10) {
- for (Entity e4 : Bukkit.getWorlds().get(0).getEntities()) {
- if (e4.getType().equals(EntityType.WOLF)) {
- Wolf e5 = (Wolf) e4;
- if (e5.getScoreboardTags().contains("buda")) {
- EntityWolf wol = ((CraftWolf) e5).getHandle();
- String goy2 = "";
- for (Object j : e5.getScoreboardTags().toArray()) {
- String jj = ((String) j);
- if (jj.length() >= 4) {
- if (((Object) jj.substring(0, 4)).equals((Object) ("goyu"))) {
- goy2 = jj;
- }
- }
- }
- String s3 = e5.getUniqueId().toString() + goy2;
- if (wt.containsKey(e5) == false) {
- wt.put(e5, 10);
- } else {
- if (wt.get(e5) <= 0) {
- wt.put(e5, 10);
- } else {
- wt.put(e5, wt.get(e5) - 1);
- }
- }
- for (int i = 1; i <= 24; i++) {
- String s2 = e5.getUniqueId().toString() + goy2 + "_" + i;
- if (wa.containsKey(s2) == false) {
- wa.put(s2, 0);
- } else {
- if (wa.get(s2) >= 2) {
- wa.put(s2, wa.get(s2) - 1);
- }
- if (wa.get(s2) == 1) {
- if (wc.containsKey(s2)) {
- if(wc.get(e5.getUniqueId().toString() + goy2).distance(e5.getLocation())<=4) {
- if(wb.get(s2)<=10){
- wb.put(s2, 20);}
- wa.put(s2, 0);
- } else {
- if(wd.get(e5)<=20)
- {
- wgol(wol, wd.get(e5)+20);
- }
- }
- } else {
- if(wb.get(s2)<=10){
- wb.put(s2, 20);}
- wa.put(s2, 0);
- }
- }
- }
- }
- for (int i = 1; i <= 24; i++) {
- String s2 = e5.getUniqueId().toString() + goy2 + "_" + i;
- if (wb.containsKey(s2) == false) {
- wb.put(s2, 0);
- } else {
- if (wb.get(s2) >= 1) {
- if (wa.get(s2) == 0) {
- wb.put(s2, wb.get(s2) - 1);
- }
- }
- if (i == 1) {
- if (wb.get(s2) == 1) {
- wb.put(s2, 2);
- if (e5.getTarget() != null) {
- e5.setSitting(false);
- wb.put(s2, 0);
- }
- }
- if (wb.get(s2) == 19) {
- e5.setSitting(true);
- }
- }
- if (i == 2) {
- if (wb.get(s2) == 19) {
- e5.setSitting(true);
- }
- }
- if (i == 3) {
- if (wb.get(s2) == 19) {
- e5.setSitting(false);
- }
- }
- if (i == 4) {
- if (wb.get(s2) == 19) {
- wgol(wol, 1);
- }
- }
- if (i == 5) {
- if (wb.get(s2) == 19) {
- wgol(wol, 12);
- }
- }
- if (i == 6) {
- if (wb.get(s2) == 19) {
- wgol(wol, 13);
- }
- }
- if (i == 7) {
- if (wb.get(s2) == 19) {
- wgol(wol, 4);
- }
- }
- if (i == 8) {
- if (wb.get(s2) == 19) {
- wgol(wol, 15);
- }
- }
- if (i == 9) {
- if (wb.get(s2) == 19) {
- wgol(wol, 16);
- }
- }
- if (i == 10) {
- if (wb.get(s2) == 19) {
- wgol(wol, 50);
- }
- }
- if (i == 11) {
- if (wb.get(s2) == 19) {
- if(wd.get(e5)<=20)
- {
- wgol(wol, wd.get(e5)+20);
- }
- if(wd.get(e5)>=31)
- {
- wgol(wol, wd.get(e5)-10);
- }
- }
- if (wb.get(s2) == 6) {
- wb.put(s2, 16);
- }
- if (wb.get(s2) == 1) {
- if(wd.get(e5)<=40)
- {
- wgol(wol, wd.get(e5)-20);
- }
- }
- }
- if (i == 12) {
- if (wb.get(s2) == 19) {
- if(wd.get(e5)<=20)
- {
- wgol(wol, wd.get(e5)+20);
- }
- if(wd.get(e5)>=31)
- {
- wgol(wol, wd.get(e5)-10);
- }
- }
- if (wb.get(s2) == 6) {
- wb.put(s2, 16);
- }
- if (wb.get(s2) == 1) {
- if(wd.get(e5)<=40)
- {
- wgol(wol, wd.get(e5)-20);
- }
- wol.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(8);
- }
- }
- if (i == 13) {
- if (wb.get(s2) == 19) {
- if(wd.get(e5)<=20)
- {
- wgol(wol, wd.get(e5)+20);
- }
- if(wd.get(e5)>=31)
- {
- wgol(wol, wd.get(e5)-10);
- }
- }
- if (wb.get(s2) == 6) {
- wb.put(s2, 16);
- }
- if (wb.get(s2) == 1) {
- if(wd.get(e5)<=40)
- {
- wgol(wol, wd.get(e5)-20);
- }
- }
- }
- if (i == 14) {
- if (wb.get(s2) == 19) {
- if(wd.get(e5)<=20)
- {
- wgol(wol, wd.get(e5)+20);
- }
- if(wd.get(e5)>=31)
- {
- wgol(wol, wd.get(e5)-10);
- }
- }
- if (wb.get(s2) == 6) {
- wb.put(s2, 16);
- }
- if (wb.get(s2) == 1) {
- if(wd.get(e5)<=40)
- {
- wgol(wol, wd.get(e5)-20);
- }
- wol.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(8);
- }
- }
- if (i == 15) {
- if (wb.get(s2) >= 1) {
- wol.pitch = 90;
- }
- }
- if (i == 16) {
- if (wb.get(s2) >= 1) {
- wol.pitch = 90;
- }
- }
- if (i == 17 || i == 18) {
- if (wb.get(s2)%18 == 1) {
- e5.playEffect(EntityEffect.WOLF_SHAKE);
- }
- }
- if (i == 19 || i == 21) {
- if (wb.get(s2)%18 == 1) {
- wol.getControllerJump().a();
- }
- }
- if (i == 21 || i == 22) {
- String ndat = "";
- for (Object j : wol.getOwner().getBukkitEntity().getScoreboardTags().toArray()) {
- String jj = ((String) j);
- if (jj.length() >= 4) {
- if (((Object) jj.substring(0, 4))
- .equals((Object) ("dna" + goy2.substring(4, 5)))) {
- ndat = jj.substring(4+Integer.toString(i).length(), jj.length());
- }
- }
- }
- if (wb.get(s2)%18 == 17) {
- Double d1 = Math.random();
- if(d1<=0.1){e5.setCustomName(ChatColor.WHITE+("("+i+") ")+ChatColor.BLUE+ndat);}
- if(d1<=0.2 && d1>0.1){e5.setCustomName(ChatColor.RED+("("+i+") ")+ChatColor.DARK_RED+ndat);}
- if(d1<=0.3 && d1>0.2){e5.setCustomName(ChatColor.AQUA+("("+i+") ")+ChatColor.YELLOW+ndat);}
- if(d1<=0.5 && d1>0.4){e5.setCustomName(ChatColor.BLACK+("("+i+") ")+ChatColor.DARK_PURPLE+ndat);}
- if(d1<=0.6 && d1>0.5){e5.setCustomName(ChatColor.GOLD+"고추?"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
- if(d1<=0.7 && d1>0.6){e5.setCustomName(ChatColor.GOLD+"불알?"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
- if(d1<=0.8 && d1>0.7){e5.setCustomName(ChatColor.GOLD+"테스트?"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
- if(d1<=0.9 && d1>0.8){e5.setCustomName(ChatColor.GOLD+"포경?"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
- if(d1>0.9){e5.setCustomName(ChatColor.GOLD+"아잉"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
- e5.playEffect(EntityEffect.WOLF_SMOKE);
- }
- if (wb.get(s2)%18 == 1) {
- if (ndat != null) {
- e5.setCustomName(ChatColor.BLUE+("("+i+") ")+ChatColor.WHITE+ndat);
- }
- }
- }
- if (i == 23) {
- if (wb.get(s2) == 19) {
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "execute @e[tag="+goy2+",type=wolf] ~ ~ ~ summon creeper ~ ~ ~ {Fuse:0,powered:1b}";
- Bukkit.dispatchCommand(console, command);
- }
- }
- if (i == 24) {
- if (wb.get(s2) == 19) {
- e5.teleport(wol.getOwner().getBukkitEntity());
- wb.put(s3+"_"+15, 5);
- wb.put(s3+"_"+16, 5);
- wb.put(s3+"_"+17, 5);
- wb.put(s3+"_"+18, 5);
- wb.put(s3+"_"+19, 5);
- wb.put(s3+"_"+20, 5);
- wb.put(s3+"_"+21, 5);
- wb.put(s3+"_"+22, 5);
- wb.put(s3+"_"+23, 5);
- wc.remove(e5);
- }
- }
- }
- }
- if(wb.get(s3+"_"+12)==16) {
- wol.getControllerMove().a(wol.yaw, wol.pitch);
- wol.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(0);
- }
- if(wb.get(s3+"_"+14)==16) {
- wol.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(0);
- }
- if (wd.containsKey(e5)) {
- if(wd.get(e5)%10==2) {
- for (Entity e2 : Bukkit.getWorlds().get(0).getEntities()) {
- if(e2.getType().equals(EntityType.ZOMBIE)) {
- Zombie z2 = (Zombie) e2;
- Boolean ok1 = false;
- if(z2.getScoreboardTags().contains("mon"))
- {
- Location zl = z2.getLocation();
- Location pl = wol.getOwner().getBukkitEntity().getLocation();
- double dx = zl.getX() - pl.getX();
- double dy = zl.getY() - pl.getY();
- double dz = zl.getZ() - pl.getZ();
- float zlyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
- float zlpitch = (float) (Math.atan2(dy, Math.sqrt(dx * dx + dz * dz)) * 180
- / Math.PI);
- Location sl = new Location(zl.getWorld(),zl.getX(),zl.getY(),zl.getZ(),zlyaw,zlpitch);
- for(int i=0; i<=256; i++)
- {
- sl.add(sl.getDirection());
- if(pl.distance(sl)<=1)
- {
- ok1 = true;
- break;
- }
- if(Bukkit.getWorlds().get(0).getBlockAt(sl).getType()!=Material.AIR)
- {
- break;
- }
- }
- }
- if(ok1==true){
- e5.setTarget(z2);
- }
- }
- }
- }
- }
- if (e5.getTarget() != null && (wd.get(e5)%10==1 || wd.get(e5)%10==2 || wd.get(e5)%10==3)) {
- if (wt.get(e5) == 2) {
- Arrow ar = e5.launchProjectile(Arrow.class);
- ar.setKnockbackStrength(0);
- ar.setShooter(e5);
- Location zl = e5.getLocation();
- Location pl = e5.getTarget().getLocation();
- double dx = zl.getX() - pl.getX();
- double dy = zl.getY() - pl.getY();
- double dz = zl.getZ() - pl.getZ();
- float zlyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
- float zlpitch = (float) (Math.atan2(dy, Math.sqrt(dx * dx + dz * dz)) * 180
- / Math.PI);
- ar.setVelocity(new Location(zl.getWorld(), zl.getX(), zl.getY(), zl.getZ(),
- zlyaw, zlpitch).getDirection().multiply(10));
- //ar._INVALID_setShooter(e5);
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "playsound minecraft:entity.blaze.hurt record @a " + zl.getX()
- + " " + zl.getY() + " " + zl.getZ();
- Bukkit.dispatchCommand(console, command);
- }
- }
- }
- }
- if (e4.getType().equals(EntityType.SNOWMAN)) {
- Snowman e5 = (Snowman) e4;
- if(e5.getTarget()!=null){
- Arrow ar = e5.launchProjectile(Arrow.class);
- ar.setKnockbackStrength(0);
- ar.setShooter(e5);
- Location zl = e5.getLocation();
- Location pl = e5.getTarget().getLocation();
- double dx = zl.getX() - pl.getX();
- double dy = zl.getY() - pl.getY();
- double dz = zl.getZ() - pl.getZ();
- float zlyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
- float zlpitch = (float) (Math.atan2(dy,
- Math.sqrt(dx * dx + dz * dz)) * 180 / Math.PI);
- ar.setVelocity(new Location(zl.getWorld(),zl.getX(),zl.getY(),zl.getZ(),zlyaw,zlpitch).getDirection().multiply(10));
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "playsound minecraft:entity.blaze.hurt record @a " + zl.getX() + " "
- + zl.getY() + " " + zl.getZ();
- Bukkit.dispatchCommand(console, command);
- }
- }
- if (e4.getType().equals(EntityType.ZOMBIE)) {
- Zombie e5 = (Zombie) e4;
- if(e5.getCustomName()!=null){
- String en = e5.getCustomName().toString();
- if(en.length()>=3){
- if(en.substring(0, 3).equals("msl"))
- {
- e5.setVelocity(e5.getLocation().getDirection().multiply(Double.parseDouble(en.substring(3,en.length()))));
- }}}
- /*
- if(e5.getScoreboardTags().contains((Object) ("mon"))==true){
- EntityZombie zom = ((CraftZombie) e5).getHandle();
- if(zom.getGoalTarget().getBukkitEntity()!=null)
- {
- ze.put(e5, zom.getGoalTarget().getBukkitEntity());
- zk.put(e5, 140);
- }
- if(zk.containsKey(e5)){
- if(zk.get(e5)>=1)
- {
- Entity t = ze.get(e5);
- String tn = t.getName();
- Location tl = t.getLocation();
- Location tl2 = po.get(tn);
- if(tl.distance(tl2)>=5){
- po.put(tn, tl);
- List goalB = (List)getPrivateField("b", PathfinderGoalSelector.class, zom.goalSelector); goalB.clear();
- List goalC = (List)getPrivateField("c", PathfinderGoalSelector.class, zom.goalSelector); goalC.clear();
- //List targetB = (List)getPrivateField("b", PathfinderGoalSelector.class, zom.targetSelector); targetB.clear();
- //List targetC = (List)getPrivateField("c", PathfinderGoalSelector.class, zom.targetSelector); targetC.clear();
- zom.getNavigation().a(tl2.getX(), tl2.getY() , tl2.getZ(),e5.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getDefaultValue());
- }
- }else{
- zom.targetSelector.a(1, new PathfinderGoalHurtByTarget(zom, false));
- zom.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(zom, EntityHuman.class, true));
- zom.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(zom, EntityVillager.class,false));
- }
- }
- }*/
- //e5.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,10,200),true);
- for(int ii=1; ii<=16; ii++){
- if(zp.containsKey(e5.getUniqueId().toString()+ii)==false)
- {
- zp.remove(e5.getUniqueId().toString()+ii);
- }}
- if(e5.getScoreboardTags().contains((Object) ("mon"))==true){
- if(zt.containsKey(e5)==false){
- zt.put(e5, 5);
- } else {
- if(zt.get(e5)<=0)
- {
- zt.put(e5, 5);
- } else {
- zt.put(e5, zt.get(e5)-1);
- }
- }
- if(zk.containsKey(e5)==false){
- zk.put(e5,-1);
- } else {
- if(zk.get(e5)==0)
- {
- ze.remove(e5);
- }
- if(zk.get(e5)>=0) {
- zk.put(e5, zk.get(e5)-1);
- }
- }
- }
- if(e5.getScoreboardTags().contains((Object) ("shoot"))){
- if(e5.getTarget()!=null){
- if(zt.get(e5)==2){
- Arrow ar = e5.launchProjectile(Arrow.class);
- ar.setKnockbackStrength(0);
- ar.setShooter(e5);
- ar1.put(ar,4);
- Location zl = e5.getLocation();
- Location pl = e5.getTarget().getLocation();
- double dx = zl.getX() - pl.getX();
- double dy = zl.getY() - pl.getY();
- double dz = zl.getZ() - pl.getZ();
- float zlyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
- float zlpitch = (float) (Math.atan2(dy,
- Math.sqrt(dx * dx + dz * dz)) * 180 / Math.PI);
- ar.setVelocity(new Location(zl.getWorld(),zl.getX(),zl.getY(),zl.getZ(),zlyaw,zlpitch).getDirection().multiply(10));
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "playsound minecraft:entity.enderdragon.hurt record @a " + zl.getX() + " "
- + zl.getY() + " " + zl.getZ();
- Bukkit.dispatchCommand(console, command);
- }
- }
- }
- Boolean loq = false;
- for (Object j : e5.getScoreboardTags().toArray()) {
- if (((String) j).length() >= 4) {
- if (e5.getScoreboardTags().contains((Object) ("mon"))) {
- if (((Object) ((String) j).substring(0, 4)).equals((Object) ("ilus"))) {
- loq = true;
- String jj = ((String) j);
- e5.removeScoreboardTag((String) j);
- }
- }
- }
- }
- if(loq==false){
- for (int i = 1; i <= 16; i++) {
- if (zp.containsKey(e5.getUniqueId().toString() + "" + i)) {
- zp.get(e5.getUniqueId().toString() + "" + i).setHealth(0);
- }
- }
- }
- }
- if (e4.getType().equals(EntityType.HUSK)) {
- e4.setVelocity(e4.getLocation().getDirection().multiply(1.5));
- }
- }
- for (Player p3 : Bukkit.getOnlinePlayers()) {
- if (p3.getItemInHand().getType().equals(Material.BRICK) && p3.isSneaking()) {
- Arrow ar = p3.launchProjectile(Arrow.class);
- ar1.put(ar, 4);
- ar.setKnockbackStrength(0);
- ar.setShooter(p3);
- ar.setVelocity(p3.getLocation().getDirection().multiply(10));
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "execute @a[name=" + p3.getName().toString()
- + "] ~ ~ ~ playsound minecraft:entity.irongolem.attack record @a";
- Bukkit.dispatchCommand(console, command);
- Earrow(p3.getName().toString());
- }
- for (int i = 1; i <= 16; i++) {
- if (np.containsKey(p3.getName().toString() + "" + i)) {
- if (np.get(p3.getName().toString() + "" + i).isAlive() == false) {
- np.remove(p3.getName().toString() + "" + i);
- }
- }
- }
- org.bukkit.inventory.PlayerInventory inv = p3.getInventory();
- // ((CraftPlayer)p3).getHandle().getDataWatcher().set(new
- // DataWatcherObject<>(10, DataWatcherRegistry.b),0);
- /*
- * o103i.put(p3.getName().toString(),(Integer)
- * (p3.getEquipment().getArmorContents()[3].getTypeId())
- * ); o102i.put(p3.getName().toString(),(Integer)
- * (p3.getEquipment().getArmorContents()[2].getTypeId())
- * ); o101i.put(p3.getName().toString(),(Integer)
- * (p3.getEquipment().getArmorContents()[1].getTypeId())
- * ); o100i.put(p3.getName().toString(),(Integer)
- * (p3.getEquipment().getArmorContents()[0].getTypeId())
- * );
- */
- if (inv.getArmorContents()[3] != null) {
- o103i.put(p3.getName().toString(), (Integer) (inv.getArmorContents()[3].getTypeId()));
- }
- if (inv.getArmorContents()[3] == null) {
- o103i.put(p3.getName().toString(), 0);
- }
- if (inv.getArmorContents()[2] != null) {
- o102i.put(p3.getName().toString(), (Integer) (inv.getArmorContents()[2].getTypeId()));
- }
- if (inv.getArmorContents()[2] == null) {
- o102i.put(p3.getName().toString(), 0);
- }
- if (inv.getArmorContents()[1] != null) {
- o101i.put(p3.getName().toString(), (Integer) (inv.getArmorContents()[1].getTypeId()));
- }
- if (inv.getArmorContents()[1] == null) {
- o101i.put(p3.getName().toString(), 0);
- }
- if (inv.getArmorContents()[0] != null) {
- o100i.put(p3.getName().toString(), (Integer) (inv.getArmorContents()[0].getTypeId()));
- }
- if (inv.getArmorContents()[0] == null) {
- o100i.put(p3.getName().toString(), 0);
- }
- o0i.put(p3.getName().toString(), (Integer) (p3.getInventory().getItemInMainHand().getTypeId()));
- o1i.put(p3.getName().toString(), (Integer) (p3.getInventory().getItemInOffHand().getTypeId()));
- if (Bukkit.getScoreboardManager().getMainScoreboard().getObjective("ilus").getScore(p3)
- .getScore() == -1) {
- String pn5 = p3.getName().toString();
- for (String s1 : np.keySet()) {
- if(s1.length()>=pn5.length())
- if(s1.substring(0, pn5.length()).equals(pn5)){
- Edestroy(s1);
- }
- }
- }
- }
- for (Player p9 : Bukkit.getOnlinePlayers()) {
- if (cool.get(p9) >= 1) {
- cool.put(p9, cool.get(p9) - 1);
- }
- String pn9 = p9.getName().toString();
- for (int i = 1; i <= 16; i++) {
- if (o103i.get(pn9) != 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.HEAD, new ItemStack(Item.getById(o103i.get(pn9))));
- }
- if (o103i.get(pn9) == 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.HEAD, new ItemStack(Blocks.AIR));
- }
- if (o102i.get(pn9) != 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.CHEST, new ItemStack(Item.getById(o102i.get(pn9))));
- }
- if (o102i.get(pn9) == 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.CHEST, new ItemStack(Blocks.AIR));
- }
- if (o101i.get(pn9) != 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.LEGS, new ItemStack(Item.getById(o101i.get(pn9))));
- }
- if (o101i.get(pn9) == 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.LEGS, new ItemStack(Blocks.AIR));
- }
- if (o100i.get(pn9) != 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.FEET, new ItemStack(Item.getById(o100i.get(pn9))));
- }
- if (o100i.get(pn9) == 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.FEET, new ItemStack(Blocks.AIR));
- }
- if (o0i.get(pn9) != 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.MAINHAND, new ItemStack(Item.getById(o0i.get(pn9))));
- }
- if (o0i.get(pn9) == 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.MAINHAND, new ItemStack(Blocks.AIR));
- }
- if (o1i.get(pn9) != 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.OFFHAND, new ItemStack(Item.getById(o1i.get(pn9))));
- }
- if (o1i.get(pn9) == 0) {
- Eequip(pn9 + "" + i, EnumItemSlot.OFFHAND, new ItemStack(Blocks.AIR));
- }
- if (ani.containsKey(pn9)) {
- Eanimation(pn9 + "" + i, ani.get(pn9));
- }
- /*if (statu.containsKey(pn9)) {
- Estatus(pn9 + "" + i, statu.get(pn9));
- }*/
- // np.get(pn9 + "" + i).status(statu.get(pn9), pn9);
- }
- if (ani.containsKey(pn9)) {
- ani.remove(pn9);
- }
- statu.put(pn9, 1);
- }
- for (String command3 : commands3) {
- if (command3 != null) {
- if (command3.charAt(0) == '/') {
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = command3.substring(1, command3.length());
- Bukkit.dispatchCommand(console, command);
- }
- if (command3.charAt(0) == '#') {
- Location location1 = new Location(null,0,0,0);
- location1.setWorld(Bukkit.getWorlds().get(0));
- Vector vector1 = new Vector();
- String[] command4 = command3.substring(1, command3.length()).split(" ");
- end = false;
- Player p2 = null;
- for (Entity p10 : Bukkit.getWorlds().get(0).getEntities()) {
- p1 = null;
- p15 = null;
- p40 = null;
- if (p10.getType().equals(EntityType.PLAYER)) {
- p1 = (Player) p10;
- }
- if (p10.getType().equals(EntityType.ZOMBIE)) {
- p15 = (Zombie) p10;
- if(p15.getScoreboardTags().contains("mon")==false)
- {
- p15 = null;
- }
- }
- tru = true;
- /*
- * if(end==true) { break; }
- */
- if (command4[command4.length - 2].equals("detect")) {
- if (command4[command4.length - 1].charAt(0) == '@') {
- if (command4[command4.length - 1].charAt(1) == 'a') {
- p15 = null;
- }
- if (command4[command4.length - 1].charAt(1) == 'z') {
- p1 = null;
- }
- String command9 = (command4[command4.length - 1].substring(3,
- command4[command4.length - 1].length() - 1));
- String[] command5 = command9.split(",");
- for (String s : command5) {
- String[] command6 = s.split("=");
- String[] command7 = command6[0].split("_");
- // Bukkit.broadcastMessage(command7[0]+"=="+command7[1]+"=="+command6[0]+"=="+command6[1]+"=="+s);
- if (p15 != null) {
- if (command6[0].equals("tag")) {
- tru = false;
- for (Object h : p15.getScoreboardTags().toArray()) {
- if (h.equals((Object) command6[1])) {
- tru = true;
- }
- }
- }
- }
- if (p1 != null) {
- if (command6[0].equals("name")) {
- if (p1.getName().toString() != command6[1]) {
- tru = false;
- }
- }
- if (command7.length == 2) {
- if (command7[0].equals("score")) {
- if (p1.getScoreboard() != null && p1.getScoreboard()
- .getObjective(command7[1]) != null) {
- if (Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(command7[1]).getScore(p1)
- .getScore() > (int) Double
- .parseDouble(command6[1])) {
- tru = false;
- // Bukkit.broadcastMessage("1");
- }
- }
- }
- }
- if (command7.length == 3) {
- if (command7[0].equals("score")) {
- if (command7[2].equals("min")) {
- if (p1.getScoreboard() != null && p1.getScoreboard()
- .getObjective(command7[1]) != null) {
- if (Bukkit.getScoreboardManager()
- .getMainScoreboard()
- .getObjective(command7[1]).getScore(p1)
- .getScore() < (int) Double
- .parseDouble(command6[1])) {
- tru = false;
- // Bukkit.broadcastMessage("3");
- }
- }
- }
- }
- }
- }
- }
- }
- }
- // p1.sendTitle(Boolean.toString(tru),"2");
- if (tru == true) {
- // Bukkit.broadcastMessage(" ");
- if (p1 != null) {
- if (command4[0].equals("flyon")) {
- p1.setAllowFlight(true);
- }
- if (command4[0].equals("flyoff")) {
- p1.setAllowFlight(false);
- }
- if (command4[0].equals("denpc")) {
- Edestroy(p1.getName().toString() + command4[1]);
- }
- if (command4[0].equals("sethp")) {
- p1.setHealth((int) (Double.parseDouble(command4[1]) * 2));
- }
- if (command4[0].equals("setfd")) {
- p1.setFoodLevel((int) (Double.parseDouble(command4[1]) * 2));
- }
- if (command4[0].equals("hide")) {
- p1.hidePlayer(p1);
- }
- if (command4[0].equals("show")) {
- p1.showPlayer(p1);
- }
- if (command4[0].equals("damage")) {
- p1.damage(Double.parseDouble(command4[1]));
- }
- if (command4[0].equals("wolf")) {
- Byte cdat = null;
- String ndat = null;
- int ddat = 0;
- int dct = 0;
- for (Object j : p1.getScoreboardTags().toArray()) {
- String jj = ((String) j);
- if (jj.length() >= 3) {
- if (((Object) jj.substring(0, 3)).equals((Object) ("dco"))) {
- dct += 1;
- }
- }
- }
- Bukkit.getScoreboardManager().getMainScoreboard().getObjective("dcount")
- .getScore(p1).setScore(dct);
- if (dct >= 1) {
- for (int i = 1; i <= dct; i++) {
- Wolf w1 = (Wolf) Bukkit.getWorlds().get(0)
- .spawnEntity(p1.getLocation(), EntityType.WOLF);
- EntityWolf w11 = ((CraftWolf)w1).getHandle();
- w11.setOwnerUUID(p1.getUniqueId());
- w11.setTamed(true);
- w11.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(256);
- w11.getAttributeInstance(GenericAttributes.maxHealth).setValue(60);
- w11.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(8);
- w11.setHealth(60);
- w11.targetSelector.a(8, new PathfinderGoalNearestAttackableTarget(w11,
- EntityZombie.class, false));
- w1.addScoreboardTag("dig" + p1.getName());
- w1.addScoreboardTag("goyu" + i);
- w1.addScoreboardTag("buda");
- for (Object j : p1.getScoreboardTags().toArray()) {
- String jj = ((String) j);
- if (jj.length() >= 4) {
- if (((Object) jj.substring(0, 4))
- .equals((Object) ("dco" + i))) {
- cdat = (byte) Double
- .parseDouble(jj.substring(4+Integer.toString(i).length(), jj.length()));
- }
- if (((Object) jj.substring(0, 4))
- .equals((Object) ("dna" + i))) {
- ndat = jj.substring(4+Integer.toString(i).length(), jj.length());
- }
- if (((Object) jj.substring(0, 4))
- .equals((Object) ("dwd" + i))) {
- ddat = (int) Double
- .parseDouble(jj.substring(4+Integer.toString(i).length(), jj.length()));
- }
- }
- }
- if (cdat != null) {
- w1.setCollarColor(DyeColor.getByWoolData(cdat));
- }
- if (ndat != null) {
- w1.setCustomName(ChatColor.BLUE+("("+i+") ")+ChatColor.WHITE+ndat);
- w1.setCustomNameVisible(true);
- }
- if (ddat <= 4 && ddat >= 1) {
- wd.put(w1, ddat);
- wgol(w11 , ddat);
- }
- }
- }
- }
- }
- if (command4[0].equals("tp5")) {
- Zombie p17 = null;
- p2 = null;
- p17=null;
- if (command4[1].equals("@p")) {
- if (p1 != null) {
- /*xx1 = to1.get(p1).getX()-from1.get(p1).getX();
- yy1 = to1.get(p1).getY()-from1.get(p1).getY();
- zz1 = to1.get(p1).getZ()-from1.get(p1).getZ();
- rxrx1 = to1.get(p1).getPitch()-from1.get(p1).getPitch();
- ryry1 = to1.get(p1).getYaw()-from1.get(p1).getYaw();
- px1 += xx1;
- py1 += yy1;
- pz1 += zz1;
- prx1 += rxrx1;
- pry1 += ryry1;
- pvx1 += xx1;
- pvz1 += zz1;*/
- p2 = p1;
- }
- if (p15 != null) {
- p17 = p15;
- }
- }
- if (p2 != null || p17 != null) {
- pn1 = p1.getName().toString();
- px1 = p1.getLocation().getX();
- py1 = p1.getLocation().getY();
- pz1 = p1.getLocation().getZ();
- prx1 = p1.getLocation().getPitch();
- pry1 = p1.getLocation().getYaw();
- pvx1 = p1.getVelocity().getX();
- pvy1 = p1.getVelocity().getY();
- pvz1 = p1.getVelocity().getZ();
- tpx1 = 0;
- tpy1 = 0;
- tpz1 = 0;
- tprx1 = 0;
- tpry1 = 0;
- tpvx1 = 0;
- tpvy1 = 0;
- tpvz1 = 0;
- tr=false;
- tel(vector1,location1,p2,command4,pn1,px1,py1,pz1,prx1,pry1,pvx1,pvy1,pvz1,tpx1,tpy1,tpz1,tprx1,tpry1,tpvx1,tpvy1,tpvz1);
- if (p17 != null) {
- //p17.setVelocity(vector2);
- //p17.teleport(location2);
- }
- //end = true;
- //break;
- }
- }
- if (command4[0].equals("tpnpc")) {
- Zombie p18 = null;
- p2=null;
- p18=null;
- if (p1 != null) {
- pn1 = p1.getName().toString();
- px1 = p1.getLocation().getX();
- py1 = p1.getLocation().getY();
- pz1 = p1.getLocation().getZ();
- prx1 = p1.getLocation().getPitch();
- pry1 = p1.getLocation().getYaw();
- pvx1 = p1.getVelocity().getX();
- pvy1 = p1.getVelocity().getY();
- pvz1 = p1.getVelocity().getZ();
- tpx1 = 0;
- tpy1 = 0;
- tpz1 = 0;
- tprx1 = 0;
- tpry1 = 0;
- tpvx1 = 0;
- tpvy1 = 0;
- tpvz1 = 0;
- p2 = p1;
- }
- if (p15 != null) {
- pn1 = p15.getName().toString();
- px1 = p15.getLocation().getX();
- py1 = p15.getLocation().getY();
- pz1 = p15.getLocation().getZ();
- prx1 = p15.getLocation().getPitch();
- pry1 = p15.getLocation().getYaw();
- pvx1 = p15.getVelocity().getX();
- pvy1 = p15.getVelocity().getY();
- pvz1 = p15.getVelocity().getZ();
- tpx1 = 0;
- tpy1 = 0;
- tpz1 = 0;
- tprx1 = 0;
- tpry1 = 0;
- tpvx1 = 0;
- tpvy1 = 0;
- tpvz1 = 0;
- p18 = p15;
- }
- if (p2 != null || p18 != null) {
- if (command4[2].charAt(0) == '~') {
- tpx1 = px1 + Double.parseDouble(
- command4[2].substring(1, (command4[2].length())));
- } else if (command4[2].charAt(0) == 'x') {
- tpx1 = -px1 + Double.parseDouble(
- command4[2].substring(1, (command4[2].length())));
- } else if (command4[2].charAt(0) == 'z') {
- tpx1 = -pz1 + Double.parseDouble(
- command4[2].substring(1, (command4[2].length())));
- } else if (command4[2].charAt(0) == 'Z') {
- tpx1 = pz1 + Double.parseDouble(
- command4[2].substring(1, (command4[2].length())));
- } else {
- tpx1 = Double.parseDouble((command4[2]));
- }
- if (command4[3].charAt(0) == '~') {
- tpy1 = py1 + Double.parseDouble(
- command4[3].substring(1, (command4[3].length())));
- } else if (command4[3].charAt(0) == 'x') {
- tpy1 = -px1 + Double.parseDouble(
- command4[3].substring(1, (command4[3].length())));
- } else if (command4[3].charAt(0) == 'z') {
- tpy1 = -pz1 + Double.parseDouble(
- command4[3].substring(1, (command4[3].length())));
- } else {
- tpy1 = Double.parseDouble((command4[3]));
- }
- if (command4[4].charAt(0) == '~') {
- tpz1 = pz1 + Double.parseDouble(
- command4[4].substring(1, (command4[4].length())));
- } else if (command4[4].charAt(0) == 'x') {
- tpz1 = -px1 + Double.parseDouble(
- command4[4].substring(1, (command4[4].length())));
- } else if (command4[4].charAt(0) == 'z') {
- tpz1 = -pz1 + Double.parseDouble(
- command4[4].substring(1, (command4[4].length())));
- } else if (command4[4].charAt(0) == 'X') {
- tpz1 = px1 + Double.parseDouble(
- command4[4].substring(1, (command4[4].length())));
- } else {
- tpz1 = Double.parseDouble((command4[4]));
- }
- if (command4[5].charAt(0) == '~') {
- tprx1 = prx1 + Double.parseDouble(
- command4[5].substring(1, (command4[5].length())));
- } else if (command4[5].charAt(0) == 'x') {
- tprx1 = -prx1 + Double.parseDouble(
- command4[5].substring(1, (command4[5].length())));
- } else if (command4[5].charAt(0) == 'y') {
- tprx1 = -pry1 + Double.parseDouble(
- command4[5].substring(1, (command4[5].length())));
- } else if (command4[5].charAt(0) == 'Y') {
- tprx1 = pry1 + Double.parseDouble(
- command4[5].substring(1, (command4[5].length())));
- } else {
- tprx1 = Double.parseDouble((command4[5]));
- }
- if (command4[6].charAt(0) == '~') {
- tpry1 = pry1 + Double.parseDouble(
- command4[6].substring(1, (command4[6].length())));
- } else if (command4[6].charAt(0) == 'x') {
- tpry1 = -prx1 + Double.parseDouble(
- command4[6].substring(1, (command4[6].length())));
- } else if (command4[6].charAt(0) == 'y') {
- tpry1 = -pry1 + Double.parseDouble(
- command4[6].substring(1, (command4[6].length())));
- } else if (command4[6].charAt(0) == 'X') {
- tpry1 = prx1 + Double.parseDouble(
- command4[6].substring(1, (command4[6].length())));
- } else {
- tpry1 = Double.parseDouble((command4[6]));
- }
- if (command4[7].charAt(0) == '~') {
- tpvx1 = pvx1 + Double.parseDouble(
- command4[7].substring(1, (command4[7].length())));
- } else if (command4[7].charAt(0) == 'x') {
- tpvx1 = -pvx1 + Double.parseDouble(
- command4[7].substring(1, (command4[7].length())));
- } else if (command4[7].charAt(0) == 'z') {
- tpvx1 = -pvz1 + Double.parseDouble(
- command4[7].substring(1, (command4[7].length())));
- } else if (command4[7].charAt(0) == 'Z') {
- tpvx1 = pvz1 + Double.parseDouble(
- command4[7].substring(1, (command4[7].length())));
- } else {
- tpvx1 = Double.parseDouble((command4[7]));
- }
- if (command4[8].charAt(0) == '~') {
- tpvz1 = pvz1 + Double.parseDouble(
- command4[8].substring(1, (command4[8].length())));
- } else if (command4[8].charAt(0) == 'x') {
- tpvz1 = -pvx1 + Double.parseDouble(
- command4[8].substring(1, (command4[8].length())));
- } else if (command4[8].charAt(0) == 'z') {
- tpvz1 = -pvz1 + Double.parseDouble(
- command4[8].substring(1, (command4[8].length())));
- } else if (command4[8].charAt(0) == 'X') {
- tpvz1 = pvx1 + Double.parseDouble(
- command4[8].substring(1, (command4[8].length())));
- } else {
- tpvz1 = Double.parseDouble((command4[8]));
- }
- vector1.setX(tpvx1);
- vector1.setY(pvy1);
- vector1.setZ(tpvz1);
- location1.setX(tpx1);
- location1.setY(tpy1);
- location1.setZ(tpz1);
- location1.setPitch((float) tprx1);
- location1.setYaw((float) tpry1);
- if (p2 != null) {
- if (np.containsKey(pn1 + "" + command4[1]) == false) {
- Espawn(pn1 + "" + command4[1], location1 , pn1);
- } else {
- Eteleport(pn1 + "" + command4[1], location1);
- }
- //end = true;
- }
- if (p18 != null) {
- String un = p18.getUniqueId().toString();
- if (zp.containsKey(un + "" + command4[1]) == false) {
- Zspawn(un + "" + command4[1], location1);
- } else {
- Zteleport(un + "" + command4[1], location1);
- Zequip(un + "" + command4[1], p18.getEquipment(), p18.isBaby() ,p18.getScoreboardTags().toArray() , p18.getCustomName());
- for (Player p70 : Bukkit.getOnlinePlayers()) {
- Location zl = zp.get(un + "" + command4[1]).getLocation();
- Location pl = p70.getLocation();
- double dx = pl.getX() - zl.getX();
- double dy = pl.getY() - zl.getY();
- double dz = pl.getZ() - zl.getZ();
- float plyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
- float plpitch = (float) (Math.atan2(dy,
- Math.sqrt(dx * dx + dz * dz)) * 180 / Math.PI);
- double dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
- // p70.sendTitle(Float.toString(zlyaw)+"=="+Float.toString(pl.getYaw()),Float.toString(zlpitch)+"=="+Float.toString(pl.getPitch())+"=="+Double.toString(dist));
- int fal = 2;
- Location sl = pl;
- for(int i=0; i<=300; i++)
- {
- sl.add(p70.getLocation().getDirection().multiply(0.5));
- if(Bukkit.getWorlds().get(0).getBlockAt(sl).getType().equals(Material.AIR)==false)
- {
- fal -=1;
- }
- }
- if (Math.abs(plyaw - zl.getYaw()) % 360 <= 25
- && Math.abs(plpitch - pl.getPitch()) % 360 <= 25
- && fal >= 1) {
- // Bukkit.broadcastMessage("tps");
- p18.teleport(zp.get(un + "" + command4[1]));
- }
- if (dist <= 2) {
- // Bukkit.broadcastMessage("tps");
- p18.teleport(zp.get(un + "" + command4[1]));
- }
- }
- }
- //end = true;
- //break;
- }
- } // p2 null
- } // tp npc
- } // true
- } // p1for\
- } // #
- }
- }
- }
- }
- }, 1, 1);
- }
- protected void tel(Vector vector1, Location location1, Player p2, String[] command4, String pn12, double px12,
- double py12, double pz12, double prx12, double pry12, double pvx12, double pvy12, double pvz12,
- double tpx12, double tpy12, double tpz12, double tprx12, double tpry12, double tpvx12, double tpvy12,
- double tpvz12) {
- if (command4[2].charAt(0) == '~') {
- tpx1 = px1 + Double.parseDouble(
- command4[2].substring(1, (command4[2].length())));
- } else if (command4[2].charAt(0) == 'x') {
- tpx1 = -px1 + Double.parseDouble(
- command4[2].substring(1, (command4[2].length())));
- } else if (command4[2].charAt(0) == 'z') {
- tpx1 = -pz1 + Double.parseDouble(
- command4[2].substring(1, (command4[2].length())));
- } else if (command4[2].charAt(0) == 'Z') {
- tpx1 = pz1 + Double.parseDouble(
- command4[2].substring(1, (command4[2].length())));
- } else if (command4[2].charAt(0) == 's') {
- tpx1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(
- command4[2].substring(1, command4[2].length()))
- .getScore(p2).getScore();
- } else {
- tpx1 = Double.parseDouble((command4[2]));
- }
- if (command4[3].charAt(0) == '~') {
- tpy1 = py1 + Double.parseDouble(
- command4[3].substring(1, (command4[3].length())));
- } else if (command4[3].charAt(0) == 'x') {
- tpy1 = -px1 + Double.parseDouble(
- command4[3].substring(1, (command4[3].length())));
- } else if (command4[3].charAt(0) == 'z') {
- tpy1 = -pz1 + Double.parseDouble(
- command4[3].substring(1, (command4[3].length())));
- } else if (command4[3].charAt(0) == 's') {
- tpy1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(
- command4[3].substring(1, command4[3].length()))
- .getScore(p2).getScore();
- } else {
- tpy1 = Double.parseDouble((command4[3]));
- }
- if (command4[4].charAt(0) == '~') {
- tpz1 = pz1 + Double.parseDouble(
- command4[4].substring(1, (command4[4].length())));
- } else if (command4[4].charAt(0) == 'x') {
- tpz1 = -px1 + Double.parseDouble(
- command4[4].substring(1, (command4[4].length())));
- } else if (command4[4].charAt(0) == 'z') {
- tpz1 = -pz1 + Double.parseDouble(
- command4[4].substring(1, (command4[4].length())));
- } else if (command4[4].charAt(0) == 'X') {
- tpz1 = px1 + Double.parseDouble(
- command4[4].substring(1, (command4[4].length())));
- } else if (command4[4].charAt(0) == 's') {
- tpz1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(
- command4[4].substring(1, command4[4].length()))
- .getScore(p2).getScore();
- } else {
- tpz1 = Double.parseDouble((command4[4]));
- }
- if (command4[5].charAt(0) == '~') {
- tprx1 = prx1 + Double.parseDouble(
- command4[5].substring(1, (command4[5].length())));
- } else if (command4[5].charAt(0) == 'x') {
- tprx1 = -prx1 + Double.parseDouble(
- command4[5].substring(1, (command4[5].length())));
- } else if (command4[5].charAt(0) == 'y') {
- tprx1 = -pry1 + Double.parseDouble(
- command4[5].substring(1, (command4[5].length())));
- } else if (command4[5].charAt(0) == 'Y') {
- tprx1 = pry1 + Double.parseDouble(
- command4[5].substring(1, (command4[5].length())));
- } else if (command4[5].charAt(0) == 's') {
- tprx1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(
- command4[5].substring(1, command4[5].length()))
- .getScore(p2).getScore();
- } else {
- tprx1 = Double.parseDouble((command4[5]));
- }
- if (command4[6].charAt(0) == '~') {
- tpry1 = pry1 + Double.parseDouble(
- command4[6].substring(1, (command4[6].length())));
- } else if (command4[6].charAt(0) == 'x') {
- tpry1 = -prx1 + Double.parseDouble(
- command4[6].substring(1, (command4[6].length())));
- } else if (command4[6].charAt(0) == 'y') {
- tpry1 = -pry1 + Double.parseDouble(
- command4[6].substring(1, (command4[6].length())));
- } else if (command4[6].charAt(0) == 'X') {
- tpry1 = prx1 + Double.parseDouble(
- command4[6].substring(1, (command4[6].length())));
- } else if (command4[6].charAt(0) == 's') {
- tpry1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(
- command4[6].substring(1, command4[6].length()))
- .getScore(p2).getScore();
- } else {
- tpry1 = Double.parseDouble((command4[6]));
- }
- if (command4[7].charAt(0) == '~') {
- tpvx1 = pvx1 + Double.parseDouble(
- command4[7].substring(1, (command4[7].length())));
- } else if (command4[7].charAt(0) == 'x') {
- tpvx1 = -pvx1 + Double.parseDouble(
- command4[7].substring(1, (command4[7].length())));
- } else if (command4[7].charAt(0) == 'z') {
- tpvx1 = -pvz1 + Double.parseDouble(
- command4[7].substring(1, (command4[7].length())));
- } else if (command4[7].charAt(0) == 'Z') {
- tpvx1 = pvz1 + Double.parseDouble(
- command4[7].substring(1, (command4[7].length())));
- } else if (command4[7].charAt(0) == 's') {
- tpvx1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(
- command4[7].substring(1, command4[7].length()))
- .getScore(p2).getScore();
- } else {
- tpvx1 = Double.parseDouble((command4[7]));
- }
- /*
- if (command4[8].charAt(0) == '~') {
- tpvy1 = pvy1 + Double.parseDouble(
- command4[8].substring(1, (command4[8].length())));
- } else if (command4[8].charAt(0) == 's') {
- tpvy1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(
- command4[8].substring(1, command4[8].length()))
- .getScore(p2).getScore();
- } else {
- tpvy1 = Double.parseDouble((command4[8]));
- }*/
- if (command4[9].charAt(0) == '~') {
- tpvz1 = pvz1 + Double.parseDouble(
- command4[9].substring(1, (command4[9].length())));
- } else if (command4[9].charAt(0) == 'x') {
- tpvz1 = -pvx1 + Double.parseDouble(
- command4[9].substring(1, (command4[9].length())));
- } else if (command4[9].charAt(0) == 'z') {
- tpvz1 = -pvz1 + Double.parseDouble(
- command4[9].substring(1, (command4[9].length())));
- } else if (command4[9].charAt(0) == 'X') {
- tpvz1 = pvx1 + Double.parseDouble(
- command4[9].substring(1, (command4[9].length())));
- } else if (command4[9].charAt(0) == 's') {
- tpvz1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
- .getObjective(
- command4[9].substring(1, command4[9].length()))
- .getScore(p2).getScore();
- } else {
- tpvz1 = Double.parseDouble((command4[9]));
- }
- vector1.setX(tpvx1);
- vector1.setY(pvy1);
- vector1.setZ(tpvz1);
- location1.setWorld(p2.getWorld());
- location1.setX(tpx1);
- location1.setY(tpy1);
- location1.setZ(tpz1);
- location1.setPitch((float) tprx1);
- location1.setYaw((float) tpry1);
- p2.teleport(location1);
- p2.setVelocity(vector1);
- }
- @EventHandler
- public void ontk(PlayerTeleportEvent event) {
- from1.put(event.getPlayer(), event.getFrom());
- to1.put(event.getPlayer(), event.getTo());
- final Player p71 = event.getPlayer();
- if(!tem.get(p71))
- {event.setCancelled(true);
- double cx = 8*(event.getTo().getX()-event.getFrom().getX());
- double cy = 8*(event.getTo().getY()-event.getFrom().getY());
- double cz = 8*(event.getTo().getZ()-event.getFrom().getZ());
- tem.put(p71, true);
- p71.setVelocity(new Vector(cx, cy, cz));
- Bukkit.getScheduler().runTaskLater(Main.getPlugin(Main.class), new Runnable() {
- @Override
- public void run() {
- tem.put(p71, true);
- p71.teleport(event.getTo());
- }
- }, 1);
- tem.put(p71, false);
- }
- }
- @EventHandler
- public void onSneak(PlayerToggleSneakEvent event) {
- Player p = event.getPlayer();
- if (event.isSneaking()) {
- statu.put(p.getName().toString(), 0);
- }
- }
- @EventHandler
- public void onar(EntityDamageByEntityEvent event) {
- if(event.getDamager().getType().equals(EntityType.ARROW))
- {
- event.setDamage(ar1.get(event.getDamager()));
- if(em)
- {
- Entity ee = event.getEntity();
- ee.getWorld().createExplosion(ee.getLocation(),5);
- }
- }
- }
- @EventHandler
- public void onar(PlayerChangedMainHandEvent event)
- {
- Player p = event.getPlayer();
- if(p.getInventory().getItemInMainHand().getType().equals(Material.IRON_INGOT))
- {
- p.sendTitle("","AK-47");
- cool.put(p, 10);
- }
- if(p.getInventory().getItemInMainHand().getType().equals(Material.GOLD_INGOT))
- {
- p.sendTitle("","TRG-21");
- cool.put(p, 40);
- }
- if(p.getInventory().getItemInMainHand().getType().equals(Material.BRICK))
- {
- p.sendTitle("","p90");
- cool.put(p, 3);
- }
- }
- @EventHandler
- public void onact(PlayerInteractEvent event) {
- Player p = event.getPlayer();
- Action a = event.getAction();
- if (a.equals(Action.LEFT_CLICK_AIR)) {
- ani.put(p.getName().toString(), 0);
- }
- if (a.equals(Action.RIGHT_CLICK_BLOCK)) {
- if (event.getClickedBlock().getType().equals(Material.STONE_BUTTON)) {
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "scoreboard players set @a[name=" + p.getName().toString()
- + ",score_yes_min=0] yes -3";
- Bukkit.dispatchCommand(console, command);
- }
- if (event.getClickedBlock().getType().equals(Material.WOOD_BUTTON)) {
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "scoreboard players set @a[name=" + p.getName().toString() + ",score_no_min=0] no -3";
- Bukkit.dispatchCommand(console, command);
- }
- if (event.getClickedBlock().getType().equals(Material.BLUE_GLAZED_TERRACOTTA)) {
- if(p.getGameMode().equals(GameMode.ADVENTURE))
- p.teleport(new Location(p.getWorld(),p.getLocation().getX(),event.getClickedBlock().getY()-2,p.getLocation().getZ(),p.getLocation().getYaw(),p.getLocation().getPitch()));
- }
- }
- if (a.equals(Action.RIGHT_CLICK_AIR) || a.equals(Action.RIGHT_CLICK_BLOCK)) {
- if (p.getItemInHand().getType().equals(Material.BRICK)) {
- Arrow ar = p.launchProjectile(Arrow.class);
- ar1.put(ar, 4);
- ar.setKnockbackStrength(0);
- ar.setShooter(p);
- ar.setVelocity(p.getLocation().getDirection().multiply(10));
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "execute @a[name=" + p.getName().toString()
- + "] ~ ~ ~ playsound minecraft:entity.irongolem.attack record @a";
- Bukkit.dispatchCommand(console, command);
- Earrow(p.getName().toString());
- }
- if (cool.get(p) == 0) {
- if (p.getItemInHand().getType().equals(Material.IRON_INGOT)) {
- cool.put(p, 10);
- Arrow ar = p.launchProjectile(Arrow.class);
- ar1.put(ar, 8);
- ar.setKnockbackStrength(0);
- ar.setShooter(p);
- ar.setVelocity(p.getLocation().getDirection().multiply(10));
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "execute @a[name=" + p.getName().toString()
- + "] ~ ~ ~ playsound minecraft:entity.blaze.hurt record @a";
- Bukkit.dispatchCommand(console, command);
- Earrow(p.getName().toString());
- }
- if (p.getItemInHand().getType().equals(Material.GOLD_INGOT)) {
- cool.put(p, 40);
- Arrow ar = p.launchProjectile(Arrow.class);
- ar1.put(ar, 24);
- ar.setKnockbackStrength(0);
- ar.setShooter(p);
- ar.setVelocity(p.getLocation().getDirection().multiply(10));
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "execute @a[name=" + p.getName().toString()
- + "] ~ ~ ~ playsound minecraft:entity.enderdragon.hurt record @a";
- Bukkit.dispatchCommand(console, command);
- Earrow(p.getName().toString());
- }
- }
- }
- if (a.equals(Action.RIGHT_CLICK_AIR) || a.equals(Action.RIGHT_CLICK_BLOCK)) {
- if (p.getItemInHand().getType().equals(Material.RAW_FISH)) {
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "execute @a[name=" + p.getName().toString()
- + "] ~ ~ ~ playsound minecraft:entity.generic.eat record @a";
- Bukkit.dispatchCommand(console, command);
- Location l6 = p.getLocation();
- org.bukkit.World wo = Bukkit.getWorlds().get(0);
- Location locat = new Location(wo, l6.getX(), l6.getY() - 1, l6.getZ());
- if (l6.getPitch()<=88) {
- p.sendTitle("",ChatColor.DARK_GREEN+"[저장실패]"+ChatColor.RED+" 땅을 보고 저장해주세요.");
- } else if (wo.getBlockAt(locat).getType() == Material.STAINED_GLASS) {
- p.sendTitle("",ChatColor.RED+"땅이아닌곳에는 저장할수없어 멍청아");
- } else if (wo.getBlockAt(locat).getType() == Material.LADDER) {
- p.sendTitle("",ChatColor.RED+"땅이아닌곳에는 저장할수없어 멍청아");
- } else if (wo.getBlockAt(locat).getType() == Material.AIR) {
- p.sendTitle("",ChatColor.RED+"땅이아닌곳에는 저장할수없어 멍청아");
- } else {
- sloc.put(p.getName(),l6);
- p.sendTitle("",ChatColor.DARK_BLUE+"Save!");
- }
- }
- if (p.getItemInHand().getType().equals(Material.COOKED_FISH)) {
- if(sloc.containsKey(p.getName())){
- p.teleport(sloc.get(p.getName()));
- p.sendTitle("",ChatColor.GRAY+"Load!");
- } else {
- p.sendTitle("",ChatColor.DARK_GREEN+"[로드실패]"+ChatColor.RED+" 저장된 지점이 없습니다.");
- }
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "execute @a[name=" + p.getName().toString()
- + "] ~ ~ ~ playsound minecraft:entity.player.burp record @a";
- Bukkit.dispatchCommand(console, command);
- }
- }
- }
- @EventHandler
- public void onj(PlayerJoinEvent event) {
- String pnn = event.getPlayer().getName().toString();
- po.put(pnn, event.getPlayer().getLocation());
- cool.put(event.getPlayer(),0);
- tem.put(event.getPlayer(), false);
- for (String s5 : np.keySet()) {
- Edestroy(s5);
- }
- zp.clear();
- for (Entity e2 : Bukkit.getWorlds().get(0).getEntities()) {
- if(e2.getType().equals(EntityType.ZOMBIE))
- {
- Zombie e0 = (Zombie) e2;
- if(e0.getScoreboardTags().contains((Object) ("mon"))==false)
- {
- e0.setHealth(0);
- }
- }
- }
- }
- @EventHandler
- public void onq(PlayerQuitEvent event) {
- Player p = event.getPlayer();
- String pn = p.getName().toString();
- po.remove(pn);
- Location location = new Location(null, 0, 0, 0);
- location.setWorld(Bukkit.getWorlds().get(0));
- location.setX(p.getLocation().getX());
- location.setY(p.getLocation().getY());
- location.setZ(p.getLocation().getZ());
- for (int i = 1; i <= 16; i++) {
- Edestroy(pn + "" + i);
- }
- }
- @EventHandler
- public void ond(EntityDeathEvent event) {
- if(event.getEntityType().equals(EntityType.WOLF)) {
- Wolf w8 = (Wolf) event.getEntity();
- if(wt.containsKey(w8)){wt.remove(w8);wd.remove(w8);}
- for(String k2:wa.keySet()) {
- if(k2.substring(0,36)==w8.getUniqueId().toString()) {
- wa.put(k2, null);
- }
- }
- for(String k2:wb.keySet()) {
- if(k2.substring(0,36)==w8.getUniqueId().toString()) {
- wb.put(k2, null);
- }
- }
- for(String k2:wc.keySet()) {
- if(k2.substring(0,36)==w8.getUniqueId().toString()) {
- wc.put(k2, null);
- }
- }
- }
- for (Entity e7 : Bukkit.getWorlds().get(0).getEntities()) {
- if (e7.getType().equals(EntityType.ZOMBIE)) {
- Zombie e77 = (Zombie) e7;
- if(e77.getScoreboardTags().contains((Object) ("mon"))==false)
- {
- zp.clear();
- e77.setHealth(0);
- } else {
- zt.remove(e77);
- zk.remove(e77);
- }
- }
- }
- }
- @EventHandler
- public void onzxc(PlayerMoveEvent event) {
- from1.put(event.getPlayer(), event.getFrom());
- to1.put(event.getPlayer(), event.getTo());
- }
- @EventHandler
- public void ondam(EntityDamageEvent event) {
- if(event.getEntityType().equals(EntityType.ZOMBIE)){
- Zombie e77 = (Zombie) event.getEntity();
- for (Object j : e77.getScoreboardTags().toArray()) {
- String sj = (String) j;
- if (sj.length() >= 3) {
- if (((Object) sj.substring(0, 3)).equals((Object) ("tag"))) {
- Bukkit.getEntity(UUID.fromString(sj.substring(3,sj.length()-1))).teleport(zp.get(sj.substring(3,sj.length())));
- Zombie z = (Zombie) Bukkit.getEntity(UUID.fromString(sj.substring(3,sj.length()-1)));
- z.setHealth(z.getHealth()-(1000-zp.get(sj.substring(3,sj.length())).getHealth()));
- z.damage(0.01);
- zp.get(sj.substring(3,sj.length())).setHealth(1000);
- }
- }
- }
- }
- }
- public void Espawn(String nam, Location loc , String n1) {
- MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();
- WorldServer nmsWorld = ((CraftWorld) Bukkit.getWorlds().get(0)).getHandle();
- GameProfile gp = new GameProfile(UUID.fromString("6ab43178-89fd-4905-97f6-0f67d9d76fd9"), nam);
- //GameProfile gp = new GameProfile(UUID.fromString(uu), nam.substring(0,nam.length()-36));
- //String value = pgp.getProperties().get("texture").iterator().next().getValue();
- //String signatur = pgp.getProperties().get("texture").iterator().next().getSignature();
- //gp.getProperties().put("texture", new Property("textures", value, signatur));
- np.put(nam, new EntityPlayer(nmsServer, nmsWorld, gp, new PlayerInteractManager(nmsWorld)));
- np.get(nam).setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
- //np.get(nam).displayName = n1;
- for (Player p : Bukkit.getOnlinePlayers()) {
- PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
- connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, np.get(nam)));
- connection.sendPacket(new PacketPlayOutNamedEntitySpawn(np.get(nam)));
- connection.sendPacket(new PacketPlayOutSpawnEntityLiving(np.get(nam)));
- }
- Ehead(nam, loc.getYaw(), loc.getPitch());
- }
- public void Edestroy(String nam) {
- if (np.containsKey(nam)) {
- int idd = np.get(nam).getId();
- for (Player p : Bukkit.getOnlinePlayers()) {
- PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
- connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, np.get(nam)));
- connection.sendPacket(new PacketPlayOutEntityDestroy(idd));
- }
- np.remove(nam);
- }
- }
- public void Eequip(String nam, EnumItemSlot e1, ItemStack i1) {
- if (np.containsKey(nam)) {
- for (Player p : Bukkit.getOnlinePlayers()) {
- PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
- connection.sendPacket(new PacketPlayOutEntityEquipment(np.get(nam).getId(), e1, i1));
- }
- }
- }
- public void Eteleport(String nam, Location loc) {
- if (np.containsKey(nam)) {
- np.get(nam).setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
- for (Player p : Bukkit.getOnlinePlayers()) {
- PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
- connection.sendPacket(new PacketPlayOutEntityTeleport(np.get(nam)));
- }
- }
- Ehead(nam, loc.getYaw(), loc.getPitch());
- }
- public void Eanimation(String nam, int i) {
- if (np.containsKey(nam)) {
- for (Player p : Bukkit.getOnlinePlayers()) {
- PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
- connection.sendPacket(new PacketPlayOutAnimation(np.get(nam), i));
- }
- }
- }
- /*public void Estatus(String nam, int i) {
- if (np.containsKey(nam)) {
- for (Player p : Bukkit.getOnlinePlayers()) {
- PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
- connection.sendPacket(new PacketPlayOutEntityStatus(np.get(nam), (byte) i));
- }
- }
- }*/
- public void Ehead(String nam, float yaw, float pitch) {
- if (np.containsKey(nam)) {
- for (Player p : Bukkit.getOnlinePlayers()) {
- PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
- connection.sendPacket(new PacketPlayOutEntityLook(np.get(nam).getId(), getFixRotation(yaw),
- getFixRotation(pitch), true));
- connection.sendPacket(new PacketPlayOutEntityHeadRotation(np.get(nam), getFixRotation(yaw)));
- }
- }
- }
- public void Earrow(String nam) {
- for (int i = 1; i <= 16; i++) {
- if (np.containsKey(nam + i)) {
- Location lc = new Location(Bukkit.getWorlds().get(0), np.get(nam + i).locX, np.get(nam + i).locY + 1,
- np.get(nam + i).locZ, np.get(nam + i).yaw, np.get(nam + i).pitch);
- //Arrow ar = Bukkit.getWorlds().get(0).spawnArrow(lc.add(lc.getDirection().multiply(2)),
- //lc.getDirection().multiply(10), lc.getYaw(), lc.getPitch());
- Arrow ar = np.get(nam+i).getBukkitEntity().launchProjectile(Arrow.class);
- //ar._INVALID_setShooter(Bukkit.getPlayer(nam));
- ar.setVelocity(lc.getDirection().multiply(10));
- ar.setKnockbackStrength(0);
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "playsound minecraft:entity.blaze.hurt record @a " + np.get(nam + i).locX + " "
- + np.get(nam + i).locY + " " + np.get(nam + i).locZ;
- Bukkit.dispatchCommand(console, command);
- }
- }
- }
- public void Zspawn(String nam, Location loc) {
- Zombie z = (Zombie) Bukkit.getWorlds().get(0).spawnEntity(loc, EntityType.ZOMBIE);
- z.setAI(false);
- z.setMaxHealth(1000);
- z.setHealth(1000);
- zp.put(nam, z);
- }
- public void Zdestroy(String nam) {
- zp.get(nam).remove();
- zp.remove(nam);
- }
- public void Zteleport(String nam, Location loc) {
- zp.get(nam).teleport(loc);
- }
- public void Zequip(String nam, EntityEquipment eee, Boolean isb , Object[] ta , String na) {
- EntityEquipment ee = zp.get(nam).getEquipment();
- ee.setArmorContents(eee.getArmorContents());
- ee.setItemInMainHand(eee.getItemInMainHand());
- ee.setItemInOffHand(eee.getItemInOffHand());
- ee.setHelmetDropChance(0);
- ee.setChestplateDropChance(0);
- ee.setLeggingsDropChance(0);
- ee.setBootsDropChance(0);
- zp.get(nam).setBaby(isb);
- zp.get(nam).setCustomName(na);
- zp.get(nam).addScoreboardTag("tag"+nam);
- for(Object j : ta)
- {
- Boolean goa = true;
- if (((String) j).length() >= 1) {
- if (((Object) ((String) j).substring(0, 1)).equals((Object) ("i"))) {
- goa=false;
- }
- if (j.equals((Object) ("mon"))) {
- goa=false;
- }
- }
- if (goa==true) {
- zp.get(nam).addScoreboardTag(j.toString());
- }
- }
- }
- public void Zarrow(String nam) {
- for (int i = 1; i <= 16; i++) {
- if (zp.containsKey(nam + i)) {
- Location lc = zp.get(nam + i).getLocation();
- //Arrow ar = Bukkit.getWorlds().get(0).spawnArrow(lc.add(lc.getDirection().multiply(2)),
- //lc.getDirection().multiply(10), lc.getYaw(), lc.getPitch());
- Arrow ar = zp.get(nam+i).launchProjectile(Arrow.class);
- //sar._INVALID_setShooter(zp.get(nam+i));
- ar.setVelocity(lc.getDirection().multiply(10));
- ar.setKnockbackStrength(0);
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "playsound minecraft:entity.enderdragon.hurt record @a " + lc.getX() + " "
- + lc.getY() + " " + lc.getZ();
- Bukkit.dispatchCommand(console, command);
- }
- }
- }
- public byte getFixRotation(float yawpitch) {
- return (byte) ((int) (yawpitch * 256.0F / 360.0F));
- }
- public void Respawn(final Player player, int Time) {
- Bukkit.getScheduler().runTaskLater(Main.getPlugin(Main.class), new Runnable() {
- @Override
- public void run() {
- ((CraftPlayer) player).getHandle().playerConnection
- .a(new PacketPlayInClientCommand(EnumClientCommand.PERFORM_RESPAWN));
- }
- }, Time);
- }
- @EventHandler
- public void onDeath(PlayerDeathEvent event) {
- Player player = (Player) event.getEntity();
- for (int i = 1; i <= 16; i++) {
- Edestroy(player.getName().toString() + i);
- }
- String pn = event.getEntity().getName().toString();
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- String command = "stopsound @a[name=" + pn + "]";
- Bukkit.dispatchCommand(console, command);
- command = "scoreboard players set @a[name=" + pn + "] sound -3";
- Bukkit.dispatchCommand(console, command);
- command = "scoreboard players set @a[name=" + pn + "] ilus -15";
- Bukkit.dispatchCommand(console, command);
- Respawn(player, 1);
- }
- public static Object getPrivateField(String fieldName, Class clazz, Object object)
- {
- Field field;
- Object o = null;
- try
- {
- field = clazz.getDeclaredField(fieldName);
- field.setAccessible(true);
- o = field.get(object);
- }
- catch(NoSuchFieldException e)
- {
- e.printStackTrace();
- }
- catch(IllegalAccessException e)
- {
- e.printStackTrace();
- }
- return o;
- }
- public void Dsit(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+1, t0);
- }
- public void Dsits(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+2, t0);
- }
- public void Dstand(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+3, t0);
- }
- public void Dma(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+4, t0);
- }
- public void Dmb(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+5, t0);
- }
- public void Dmc(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+6, t0);
- }
- public void Dmx(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+7, t0);
- }
- public void Dmy(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+8, t0);
- }
- public void Dmz(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+9, t0);
- }
- public void Dmm(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+10, t0);
- }
- public void Dfinda(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+11, t0);
- }
- public void Dfindb(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+12, t0);
- }
- public void Dlooka(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+13, t0);
- }
- public void Dlookb(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+14, t0);
- }
- public void Dsad(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+15, t0);
- }
- public void Dsads(String g0,String u0,Wolf w0,int t0,int b0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+16, t0);
- wb.put(w0.getUniqueId().toString()+u0+"_"+16, b0);
- }
- public void Dshake(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+17, t0);
- }
- public void Dshakes(String g0,String u0,Wolf w0,int t0,int b0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+18, t0);
- wb.put(w0.getUniqueId().toString()+u0+"_"+18, b0);
- }
- public void Djump(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+19, t0);
- }
- public void Djumps(String g0,String u0,Wolf w0,int t0,int b0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+20, t0);
- wb.put(w0.getUniqueId().toString()+u0+"_"+20, b0);
- }
- public void Droll(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+21, t0);
- }
- public void Drolls(String g0,String u0,Wolf w0,int t0,int b0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+22, t0);
- wb.put(w0.getUniqueId().toString()+u0+"_"+22, b0);
- }
- public void Dbomb(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+23, t0);
- }
- public void Dcome(String g0,String u0,Wolf w0,int t0)
- {
- wa.put(w0.getUniqueId().toString()+u0+"_"+24, t0);
- }
- public void wgol(EntityWolf ewol , int i)
- {
- wd.put((Wolf) ewol.getBukkitEntity(), i);
- try {
- Field bField = PathfinderGoalSelector.class.getDeclaredField("b");
- bField.setAccessible(true);
- Field cField = PathfinderGoalSelector.class.getDeclaredField("c");
- cField.setAccessible(true);
- bField.set(ewol.goalSelector, Sets.newLinkedHashSet());
- bField.set(ewol.targetSelector, Sets.newLinkedHashSet());
- cField.set(ewol.goalSelector, Sets.newLinkedHashSet());
- cField.set(ewol.targetSelector, Sets.newLinkedHashSet());
- //this code clears fields B, C. so right now the mob wont walk
- } catch (Exception exc) {exc.printStackTrace();}
- if(i<=10){
- ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
- ewol.goalSelector.a(2, ewol.getGoalSit());
- ewol.goalSelector.a(4, new PathfinderGoalLeapAtTarget(ewol, 0.4F));
- ewol.goalSelector.a(5, new PathfinderGoalMeleeAttack(ewol, 1.0D, true));
- ewol.goalSelector.a(6, new PathfinderGoalFollowOwner(ewol, 1.0D, 10.0F, 2.0F));
- ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
- ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
- ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
- ewol.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(ewol));
- ewol.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(ewol));
- ewol.targetSelector.a(3, new PathfinderGoalHurtByTarget(ewol, true, new Class[0]));
- ewol.targetSelector.a(8, new PathfinderGoalNearestAttackableTarget(ewol, EntityZombie.class, false));
- return;
- }
- if(i<=20){
- ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
- ewol.goalSelector.a(2, ewol.getGoalSit());
- ewol.goalSelector.a(4, new PathfinderGoalLeapAtTarget(ewol, 0.4F));
- ewol.goalSelector.a(5, new PathfinderGoalMeleeAttack(ewol, 1.0D, true));
- ewol.goalSelector.a(6, new PathfinderGoalFollowOwner(ewol, 1.0D, 10.0F, 2.0F));
- ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
- ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
- ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
- ewol.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(ewol));
- ewol.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(ewol));
- ewol.targetSelector.a(3, new PathfinderGoalHurtByTarget(ewol, true, new Class[0]));
- return;}
- if(i<=30){
- ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
- ewol.goalSelector.a(2, ewol.getGoalSit());
- ewol.goalSelector.a(4, new PathfinderGoalLeapAtTarget(ewol, 0.4F));
- ewol.goalSelector.a(5, new PathfinderGoalMeleeAttack(ewol, 1.0D, true));
- ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
- ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
- ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
- ewol.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(ewol));
- ewol.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(ewol));
- ewol.targetSelector.a(3, new PathfinderGoalHurtByTarget(ewol, true, new Class[0]));
- ewol.targetSelector.a(8, new PathfinderGoalNearestAttackableTarget(ewol, EntityZombie.class, false));
- return;}
- if(i<=40){
- ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
- ewol.goalSelector.a(2, ewol.getGoalSit());
- ewol.goalSelector.a(4, new PathfinderGoalLeapAtTarget(ewol, 0.4F));
- ewol.goalSelector.a(5, new PathfinderGoalMeleeAttack(ewol, 1.0D, true));
- ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
- ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
- ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
- ewol.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(ewol));
- ewol.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(ewol));
- ewol.targetSelector.a(3, new PathfinderGoalHurtByTarget(ewol, true, new Class[0]));
- return;}
- ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
- ewol.goalSelector.a(2, ewol.getGoalSit());
- ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
- ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
- ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
- ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement