Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 102.94 KB | None | 0 0
  1. package tam2Main;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5. import java.lang.reflect.Array;
  6. import java.lang.reflect.Field;
  7. import java.util.ArrayList;
  8. import java.util.HashMap;
  9. import java.util.List;
  10. import java.util.Set;
  11. import java.util.UUID;
  12.  
  13. import javax.management.timer.Timer;
  14.  
  15. import org.apache.commons.lang.ArrayUtils;
  16. import org.apache.commons.lang3.tuple.Pair;
  17. import org.bukkit.Bukkit;
  18. import org.bukkit.ChatColor;
  19. import org.bukkit.Chunk;
  20. import org.bukkit.DyeColor;
  21. import org.bukkit.EntityEffect;
  22. import org.bukkit.GameMode;
  23. import org.bukkit.Location;
  24. import org.bukkit.Material;
  25. import org.bukkit.Sound;
  26. import org.bukkit.SoundCategory;
  27. import org.bukkit.World;
  28. import org.bukkit.attribute.Attribute;
  29. import org.bukkit.block.Block;
  30. import org.bukkit.block.CommandBlock;
  31. import org.bukkit.command.ConsoleCommandSender;
  32. import org.bukkit.configuration.file.FileConfiguration;
  33. import org.bukkit.craftbukkit.v1_12_R1.CraftServer;
  34. import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
  35. import org.bukkit.craftbukkit.v1_12_R1.CraftChunk;
  36. import org.bukkit.craftbukkit.v1_12_R1.entity.CraftZombie;
  37. import org.bukkit.craftbukkit.v1_12_R1.entity.CraftWolf;
  38. import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
  39. import org.bukkit.entity.AnimalTamer;
  40. import org.bukkit.entity.Arrow;
  41. import org.bukkit.entity.Entity;
  42. import org.bukkit.entity.EntityType;
  43. import org.bukkit.entity.Player;
  44. import org.bukkit.entity.Snowman;
  45. import org.bukkit.entity.Villager;
  46. import org.bukkit.entity.Wolf;
  47. import org.bukkit.entity.Zombie;
  48. import org.bukkit.event.EventHandler;
  49. import org.bukkit.event.Listener;
  50. import org.bukkit.event.block.Action;
  51. import org.bukkit.event.entity.EntityDeathEvent;
  52. import org.bukkit.event.entity.EntityDamageByEntityEvent;
  53. import org.bukkit.event.entity.EntityDamageEvent;
  54. import org.bukkit.event.entity.PlayerDeathEvent;
  55. import org.bukkit.event.player.PlayerChatEvent;
  56. import org.bukkit.event.player.PlayerVelocityEvent;
  57. import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
  58. import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
  59. import org.bukkit.event.player.PlayerChangedMainHandEvent;
  60. import org.bukkit.event.player.PlayerInteractEvent;
  61. import org.bukkit.event.player.PlayerJoinEvent;
  62. import org.bukkit.event.player.PlayerMoveEvent;
  63. import org.bukkit.event.player.PlayerQuitEvent;
  64. import org.bukkit.event.player.PlayerTeleportEvent;
  65. import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
  66. import org.bukkit.event.player.PlayerToggleSneakEvent;
  67. import org.bukkit.inventory.EntityEquipment;
  68. import org.bukkit.plugin.PluginDescriptionFile;
  69. import org.bukkit.plugin.java.JavaPlugin;
  70. import org.bukkit.potion.PotionEffect;
  71. import org.bukkit.potion.PotionEffectType;
  72. import org.bukkit.util.Vector;
  73.  
  74. import com.google.common.collect.Sets;
  75. import com.mojang.authlib.GameProfile;
  76. import com.mojang.authlib.properties.Property;
  77.  
  78. import net.minecraft.server.v1_12_R1.BlockPosition;
  79. import net.minecraft.server.v1_12_R1.Blocks;
  80. import net.minecraft.server.v1_12_R1.ControllerMove;
  81. import net.minecraft.server.v1_12_R1.EntityAgeable;
  82. import net.minecraft.server.v1_12_R1.EntityHuman;
  83. import net.minecraft.server.v1_12_R1.EntityLiving;
  84. import net.minecraft.server.v1_12_R1.EntityLlama;
  85. import net.minecraft.server.v1_12_R1.EntityPlayer;
  86. import net.minecraft.server.v1_12_R1.EntityVillager;
  87. import net.minecraft.server.v1_12_R1.EntityWolf;
  88. import net.minecraft.server.v1_12_R1.EntityZombie;
  89. import net.minecraft.server.v1_12_R1.EnumItemSlot;
  90. import net.minecraft.server.v1_12_R1.EnumItemSlot.Function;
  91. import net.minecraft.server.v1_12_R1.EnumMoveType;
  92. import net.minecraft.server.v1_12_R1.GenericAttributes;
  93. import net.minecraft.server.v1_12_R1.Item;
  94. import net.minecraft.server.v1_12_R1.ItemStack;
  95. import net.minecraft.server.v1_12_R1.MathHelper;
  96. import net.minecraft.server.v1_12_R1.MinecraftServer;
  97. import net.minecraft.server.v1_12_R1.PacketPlayInClientCommand;
  98. import net.minecraft.server.v1_12_R1.PacketPlayInClientCommand.EnumClientCommand;
  99. import net.minecraft.server.v1_12_R1.PacketPlayOutAnimation;
  100. import net.minecraft.server.v1_12_R1.PacketPlayOutEntity.PacketPlayOutEntityLook;
  101. import net.minecraft.server.v1_12_R1.PacketPlayOutEntityDestroy;
  102. import net.minecraft.server.v1_12_R1.PacketPlayOutEntityEquipment;
  103. import net.minecraft.server.v1_12_R1.PacketPlayOutEntityHeadRotation;
  104. import net.minecraft.server.v1_12_R1.PacketPlayOutEntityStatus;
  105. import net.minecraft.server.v1_12_R1.PacketPlayOutEntityTeleport;
  106. import net.minecraft.server.v1_12_R1.PacketPlayOutMapChunk;
  107. import net.minecraft.server.v1_12_R1.PacketPlayOutNamedEntitySpawn;
  108. import net.minecraft.server.v1_12_R1.PacketPlayOutSpawnEntityLiving;
  109. import net.minecraft.server.v1_12_R1.PathEntity;
  110. import net.minecraft.server.v1_12_R1.PathfinderGoalBeg;
  111. import net.minecraft.server.v1_12_R1.PathfinderGoalBreed;
  112. import net.minecraft.server.v1_12_R1.PathfinderGoalFloat;
  113. import net.minecraft.server.v1_12_R1.PathfinderGoalFollowOwner;
  114. import net.minecraft.server.v1_12_R1.PathfinderGoalHurtByTarget;
  115. import net.minecraft.server.v1_12_R1.PathfinderGoalLeapAtTarget;
  116. import net.minecraft.server.v1_12_R1.PathfinderGoalLookAtPlayer;
  117. import net.minecraft.server.v1_12_R1.PathfinderGoalMeleeAttack;
  118. import net.minecraft.server.v1_12_R1.PathfinderGoalMoveThroughVillage;
  119. import net.minecraft.server.v1_12_R1.PathfinderGoalMoveTowardsRestriction;
  120. import net.minecraft.server.v1_12_R1.PathfinderGoalNearestAttackableTarget;
  121. import net.minecraft.server.v1_12_R1.PathfinderGoalOwnerHurtByTarget;
  122. import net.minecraft.server.v1_12_R1.PathfinderGoalOwnerHurtTarget;
  123. import net.minecraft.server.v1_12_R1.PathfinderGoalRandomLookaround;
  124. import net.minecraft.server.v1_12_R1.PathfinderGoalRandomStroll;
  125. import net.minecraft.server.v1_12_R1.PathfinderGoalRandomStrollLand;
  126. import net.minecraft.server.v1_12_R1.PathfinderGoalSelector;
  127. import net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo;
  128. import net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
  129. import net.minecraft.server.v1_12_R1.WorldGenNetherPieces.WorldGenNetherPiece15;
  130. import net.minecraft.server.v1_12_R1.PlayerConnection;
  131. import net.minecraft.server.v1_12_R1.PlayerInteractManager;
  132. import net.minecraft.server.v1_12_R1.WorldServer;
  133.  
  134. /**
  135. * @author user
  136. *
  137. */
  138. public class Main extends JavaPlugin implements Listener {
  139.  
  140. String pn1;
  141. double px1;
  142. double py1;
  143. double pz1;
  144. double prx1;
  145. double pry1;
  146. double pvx1;
  147. double pvy1;
  148. double pvz1;
  149. double tpx1 = 0;
  150. double tpy1 = 0;
  151. double tpz1 = 0;
  152. double tprx1 = 0;
  153. double tpry1 = 0;
  154. double tpvx1 = 0;
  155. double tpvy1 = 0;
  156. double tpvz1 = 0;
  157. double xx1 = 0;
  158. double yy1 = 0;
  159. double zz1 = 0;
  160. float rxrx1 = 0;
  161. float ryry1 = 0;
  162. boolean em = false;
  163. boolean tr = false;
  164.  
  165. int ot = 0;
  166. boolean tru;
  167. boolean end;
  168. Player p1;
  169. Zombie p15;
  170. Item p40;
  171. PluginDescriptionFile pdFile = this.getDescription();
  172. HashMap<String, Integer> ani = new HashMap<String, Integer>();
  173. HashMap<String, Integer> statu = new HashMap<String, Integer>();
  174. HashMap<String, EntityPlayer> np = new HashMap<String, EntityPlayer>();
  175. HashMap<String, Zombie> zp = new HashMap<String, Zombie>();
  176. HashMap<Zombie, Integer> zt = new HashMap<Zombie, Integer>();
  177. HashMap<Wolf, Integer> wt = new HashMap<Wolf, Integer>();
  178. HashMap<String, Integer> wa = new HashMap<String, Integer>();
  179. HashMap<String, Integer> wb = new HashMap<String, Integer>();
  180. HashMap<String, Location> wc = new HashMap<String, Location>();
  181. HashMap<Zombie, Integer> zk = new HashMap<Zombie, Integer>();
  182. HashMap<Zombie, Entity> ze = new HashMap<Zombie, Entity>();
  183. HashMap<String, Location> sloc = new HashMap<String, Location>();
  184. HashMap<String, Location> po = new HashMap<String, Location>();
  185. HashMap<Wolf, Integer> wd = new HashMap<Wolf, Integer>();
  186. // HashMap<String,Integer> zc = new HashMap<String,Integer>();
  187. HashMap<String, Location> loca = new HashMap<String, Location>();
  188. HashMap<String, Integer> o103i = new HashMap<String, Integer>();
  189. HashMap<String, Integer> o102i = new HashMap<String, Integer>();
  190. HashMap<String, Integer> o101i = new HashMap<String, Integer>();
  191. HashMap<String, Integer> o100i = new HashMap<String, Integer>();
  192. HashMap<String, Integer> o0i = new HashMap<String, Integer>();
  193. HashMap<String, Integer> o1i = new HashMap<String, Integer>();
  194. HashMap<Player, Location> from1 = new HashMap<Player, Location>();
  195. HashMap<Player, Location> to1 = new HashMap<Player, Location>();
  196. HashMap<Arrow, Integer> ar1 = new HashMap<Arrow, Integer>();
  197. HashMap<Player, Integer> cool = new HashMap<Player, Integer>();
  198. HashMap<Player, Boolean> tem = new HashMap<Player, Boolean>();
  199.  
  200. Wolf w6 = null;
  201. EntityWolf w7 = null;
  202. /*
  203. * HashMap<String,ItemStack> o103i = new HashMap<String,ItemStack>();
  204. * HashMap<String,ItemStack> o102i = new HashMap<String,ItemStack>();
  205. * HashMap<String,ItemStack> o101i = new HashMap<String,ItemStack>();
  206. * HashMap<String,ItemStack> o100i = new HashMap<String,ItemStack>();
  207. * HashMap<String,ItemStack> o0i = new HashMap<String,ItemStack>();
  208. */
  209. String[] commands3 = new String[32301];
  210. int tick = 0;
  211. FileConfiguration Config = this.getConfig();
  212.  
  213. @EventHandler
  214. public boolean onCom(PlayerChatEvent e) {
  215. String[] com = e.getMessage().split(" ");
  216. for (Entity ent1 : Bukkit.getWorlds().get(0).getEntities()) {
  217. w6 = null;
  218. w7 = null;
  219. String goy1 = "";
  220. if (ent1.getType().equals(EntityType.WOLF)) {
  221. if (ent1.getScoreboardTags().contains((Object) ("dig" + e.getPlayer().getName()))) {
  222. String tag1 = "buda";
  223. if (com.length>=2){
  224. if (ent1.getScoreboardTags().contains("goyu"+com[1])){
  225. tag1 = "goyu"+com[1];
  226. }
  227. if (ent1.getScoreboardTags().contains("bude"+com[1])){
  228. tag1 = "bude"+com[1];
  229. }
  230. }
  231. if (ent1.getScoreboardTags().contains(tag1)) {
  232. w6 = (Wolf) ent1;
  233. w7 = ((CraftWolf) w6).getHandle();
  234. for (Object j : w6.getScoreboardTags().toArray()) {
  235. String jj = ((String) j);
  236. if (jj.length() >= 4) {
  237. if (((Object) jj.substring(0, 4)).equals((Object) ("goyu"))) {
  238. goy1 = jj;
  239. }
  240. }
  241. }
  242. }
  243.  
  244. if (w6 != null) {
  245. String[] com2 = com[0].split("!");
  246. if(com[0].equals("sit?"))
  247. {
  248. if(w6.isSitting()){
  249. e.getPlayer().sendMessage(goy1 + " : 앉아있음");
  250. } else {
  251. int wa1 = (int) wa.get(w6.getUniqueId().toString()+goy1+"_"+1).intValue()/20;
  252. if(wa1==0){
  253. e.getPlayer().sendMessage(goy1 + " : 서있음");
  254. } else {
  255. e.getPlayer().sendMessage(goy1 + " : \""+wa1+"\"초후에 앉을것임");
  256. }
  257. }
  258. }
  259. if(com[0].equals("m?"))
  260. {
  261. String arg = "";
  262. if(wd.get(w6)%10==1){
  263. arg = goy1 + " : 목표물에게먼저발사";
  264. }
  265. if(wd.get(w6)%10==2){
  266. arg = goy1 + " : 주인공격에조금이라도의심되는목표물에게발사";
  267. }
  268. if(wd.get(w6)%10==3){
  269. arg = goy1 + " : 주인공격에의심되는목표물에게발사";
  270. }
  271. if(wd.get(w6)%10==4){
  272. arg = goy1 + " : 목표물에게먼저물어뜯기";
  273. }
  274. if(wd.get(w6)%10==5){
  275. arg = goy1 + " : 주인공격에조금이라도의심되는목표물에게물어뜯기";
  276. }
  277. if(wd.get(w6)%10==6){
  278. arg = goy1 + " : 주인공격에의심되는목표물에게물어뜯기";
  279. }
  280. if(wd.get(w6)%10>=50){
  281. arg = goy1 + " : 공격안함";
  282. }
  283. e.getPlayer().sendMessage(arg);
  284. }
  285. if(com[0].equals("find?"))
  286. {
  287. if(w6.getTarget()!=null){
  288. if(w6.getTarget()!=null){
  289. e.getPlayer().sendMessage(goy1 + " : 앉아있음");
  290. }
  291. }
  292. }
  293. if(com[0].equals("info?"))
  294. {
  295. }
  296. for (int ii = 0; ii <= com2.length-1; ii++) {
  297. String com3 = com2[ii];
  298. int at = 0;
  299. int at2 = 0;
  300. Loop : for (int i = 0; i <= 4; i++) {
  301. if (i == 4) {
  302. at = -1;
  303. break Loop;
  304. }
  305. try {Double.parseDouble(Character.toString(com3.charAt(i)));} catch (NumberFormatException e1){
  306. if (i == 0) {
  307. at = -1;
  308. } else {
  309. at = (int) Double.parseDouble(com3.substring(0, i));
  310. }
  311. break Loop;
  312. }
  313. }
  314. Loop : for (int i = 0; i <= 4; i++) {
  315. if (i == 4) {
  316. at2 = -1;
  317. break Loop;
  318. }
  319. try {Double.parseDouble(Character.toString(com3.charAt(com3.length()-1-i)));} catch (NumberFormatException e1){
  320. if (i == 0) {
  321. at2 = -1;
  322. } else {
  323. at2 = (int) Double.parseDouble(com3.substring(com3.length()-i, com3.length()));
  324. }
  325. break Loop;
  326. }
  327. }
  328.  
  329. String at11 = "";
  330. String at22 = "";
  331. String at33 = "";
  332. if (com3.charAt(0) == 'g') {
  333. 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)
  334. Location pl = null;
  335. for (Block block : sight) { //For each block in the list
  336. if (block.getType() != Material.AIR) { //If the block is not air -> obstruction reached, exit loop/seach
  337. pl = new Location(block.getWorld(),block.getX(),block.getY()+1,block.getZ());
  338. break;
  339. }
  340. }
  341. w7.getNavigation().a(pl.getX(),pl.getY(),pl.getZ(),1.0D);
  342. wc.put(w6.getUniqueId().toString()+goy1, pl);
  343. at33 = "g";
  344. }
  345. if (at != -1) {
  346. at11 = Integer.toString(at);
  347. at *= 20;
  348. } else {
  349. at = 3;
  350. }
  351. if (at2 != -1) {
  352. at22 = Integer.toString(at2);
  353. at2 *= 20;
  354. }
  355. // Bukkit.getPlayer("Kang").sendMessage(at11+"=="+at22+"=="+com3.substring(at11.length(),
  356. // com3.length() - at22.length()));
  357. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("sit")) {
  358. Dsit(at33, goy1, w6, at);
  359. }
  360. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("sits")) {
  361. Dsits(at33, goy1, w6, at);
  362. }
  363. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("stand")) {
  364. Dstand(at33, goy1, w6, at);
  365. }
  366. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("ma")) {
  367. Dma(at33, goy1, w6, at);
  368. }
  369. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mb")) {
  370. Dmb(at33, goy1, w6, at);
  371. }
  372. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mc")) {
  373. Dmc(at33, goy1, w6, at);
  374. }
  375. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mx")) {
  376. Dmx(at33, goy1, w6, at);
  377. }
  378. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("my")) {
  379. Dmy(at33, goy1, w6, at);
  380. }
  381. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mz")) {
  382. Dmz(at33, goy1, w6, at);
  383. }
  384. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("mm")) {
  385. Dmm(at33, goy1, w6, at);
  386. }
  387. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("finda")) {
  388. Dfinda(at33, goy1, w6, at);
  389. }
  390. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("findb")) {
  391. Dfindb(at33, goy1, w6, at);
  392. }
  393. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("looka")) {
  394. Dlooka(at33, goy1, w6, at);
  395. }
  396. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("lookb")) {
  397. Dlookb(at33, goy1, w6, at);
  398. }
  399. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("sad")) {
  400. Dsad(at33, goy1, w6, at);
  401. }
  402. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("sads")) {
  403. Dsads(at33, goy1, w6, at, at2);
  404. }
  405. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("shake")) {
  406. Dshake(at33, goy1, w6, at);
  407. }
  408. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("shakes")) {
  409. Dshakes(at33, goy1, w6, at, at2);
  410. }
  411. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("jump")) {
  412. Djump(at33, goy1, w6, at);
  413. }
  414. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("jumps")) {
  415. Djumps(at33, goy1, w6, at, at2);
  416. }
  417. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("roll")) {
  418. Droll(at33, goy1, w6, at);
  419. }
  420. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("rolls")) {
  421. Drolls(at33, goy1, w6, at, at2);
  422. }
  423. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("bomb")) {
  424. Dbomb(at33, goy1, w6, at);
  425. }
  426. if (com3.substring(at11.length() + at33.length(), com3.length() - at22.length()).equals("come")) {
  427. Dcome(at33, goy1, w6, at);
  428. }
  429. }
  430. }
  431. }
  432. }
  433. }
  434.  
  435. if (e.getPlayer().isOp()) {
  436. if (com[0].charAt(0) == '#') {
  437.  
  438. }
  439. if (com[0].equals("+help")) {
  440. e.getPlayer().sendMessage(ChatColor.GOLD + " help1 : 파일수정법");
  441. e.getPlayer().sendMessage(ChatColor.GOLD + " help2 : #명령어들");
  442. e.getPlayer().sendMessage(ChatColor.GOLD + " help3 : 플러그인 정보");
  443. }
  444. if (com[0].equals("+help1")) {
  445. e.getPlayer().sendMessage(ChatColor.GOLD + "----Minnim Plugin Help1----");
  446. e.getPlayer().sendMessage(ChatColor.GREEN + " list" + ChatColor.WHITE + " : 등록한것들을 보여줍니다.");
  447. e.getPlayer().sendMessage(ChatColor.GREEN + " ac" + ChatColor.DARK_RED + " a b" + ChatColor.WHITE
  448. + " : b명령어를 a번째에 등록하잖아 진짜 혼날래?");
  449. e.getPlayer().sendMessage(ChatColor.GREEN + " rc" + ChatColor.DARK_RED + " a" + ChatColor.WHITE
  450. + " : a번째를 지웁니다 그것도 모른대요 ㅉㅉ");
  451. e.getPlayer().sendMessage(ChatColor.GREEN + " sc" + ChatColor.WHITE + " : 등록한것들을 번호순서대로 정렬합니다.");
  452. e.getPlayer().sendMessage(ChatColor.GREEN + " mc" + ChatColor.DARK_RED + " a a2" + ChatColor.WHITE
  453. + " : a번째와 b번째 순서를 바꿉니다.");
  454. e.getPlayer().sendMessage(ChatColor.GREEN + " yc" + ChatColor.DARK_RED + " c" + ChatColor.WHITE
  455. + " : 1~32300까지 자연수 x번째를 c번째로 바꿉니다.");
  456. e.getPlayer()
  457. .sendMessage(ChatColor.DARK_PURPLE + " cs" + ChatColor.WHITE + " : 목록을 아래 커맨드블록으로 모두 바꿉니다.");
  458. e.getPlayer().sendMessage(
  459. ChatColor.DARK_PURPLE + " cl" + ChatColor.WHITE + " : 목록을 아래 커맨드블록으로 모두 불러옵니다.");
  460. e.getPlayer().sendMessage(" c에 @를 넣으면 x값이 나옵니다.");
  461. e.getPlayer().sendMessage(" 마지막으로 고추좀만져보자");
  462. }
  463. if (com[0].equals("+help2")) {
  464. e.getPlayer().sendMessage(ChatColor.GOLD + "----Minnim Plugin Help2----");
  465. e.getPlayer()
  466. .sendMessage(ChatColor.GREEN + " tp5" + ChatColor.DARK_RED
  467. + " a1 a2 a3 a4 a5 a6 a7 a8 a9 a10" + ChatColor.WHITE
  468. + " : a1에게 (x=a2,y=a3,z=a4,rx=a5,ry=a6,velx=a7,vely=a8,velz=a9)");
  469. e.getPlayer().sendMessage(" a1{@p=모든플레이어} , a2~a9첫글자{~,x,X,z,Z,s}");
  470. e.getPlayer()
  471. .sendMessage(ChatColor.GREEN + " tpnpc" + ChatColor.DARK_RED + " b a2 a3 a4 a5 a6 a7 a8 a9"
  472. + ChatColor.WHITE + " : b번째 분신에게 (x=a2,y=a3,z=a4,rx=a5,ry=a6,velx=a7,velz=a8)");
  473. e.getPlayer().sendMessage(" b{1~16}");
  474. e.getPlayer().sendMessage(
  475. ChatColor.GREEN + " denpc" + ChatColor.DARK_RED + " b" + ChatColor.WHITE + " : b번째 분신 삭제");
  476. e.getPlayer().sendMessage(ChatColor.GREEN + " flyon" + ChatColor.WHITE + " : 모든플레이어에게 날개가 생");
  477. e.getPlayer().sendMessage(ChatColor.GREEN + " flyon" + ChatColor.WHITE + " : 모든플레이어를 서바이벌에서 날기 off");
  478. e.getPlayer().sendMessage(
  479. ChatColor.GREEN + " sethp" + ChatColor.DARK_RED + " c" + ChatColor.WHITE + " : 체력을 c로만듬");
  480. e.getPlayer().sendMessage(
  481. ChatColor.GREEN + " sethg" + ChatColor.DARK_RED + " c" + ChatColor.WHITE + " : 허기를 c로만듬");
  482. e.getPlayer().sendMessage(ChatColor.GREEN + " hide" + ChatColor.WHITE + " : 투명화");
  483. e.getPlayer().sendMessage(ChatColor.GREEN + " show" + ChatColor.WHITE + " : 투명화해제");
  484. e.getPlayer().sendMessage(ChatColor.GREEN + " damage" + ChatColor.DARK_RED + " c" + ChatColor.WHITE
  485. + " : 데미지를 c만큼달게함");
  486. e.getPlayer().sendMessage(" detect @a를 넣어 조건을 달수있습니다.");
  487. e.getPlayer().sendMessage(" 하지만 @a에는 name,score_?,score_?_min 밖에 못씁니다.");
  488. e.getPlayer().sendMessage(" 마지막으로 불알좀만져보자");
  489. }
  490. if (com[0].equals("+help3")) {
  491. e.getPlayer().sendMessage(ChatColor.GOLD + "----Minnim Plugin Help2----");
  492. e.getPlayer().sendMessage(" 허스크는 바라보고있는방향으로 나아가는 미사일입니다.");
  493. e.getPlayer().sendMessage(" 철괴는 총입니다.");
  494. e.getPlayer().sendMessage(" 좀비 name{msl:미사일,그뒤에속도적으세요}tag{shoot:총쏨}");
  495. e.getPlayer().sendMessage(" 필수스코어보드:ilus,tp,yes,no");
  496. e.getPlayer().sendMessage(" 마지막으로 포경좀만져보자");
  497. }
  498. if (com[0].equals("+cs")) {
  499. ArrayList<String> la = new ArrayList<String>();
  500. Location l6 = e.getPlayer().getLocation();
  501. org.bukkit.World wo = Bukkit.getWorlds().get(0);
  502. Location locat = new Location(wo, l6.getX(), l6.getY() - 1, l6.getZ());
  503. if (wo.getBlockAt(locat).getType() == Material.COMMAND) {
  504. /*
  505. * for (int i = 0; i <= 32300; i++) { Config.set("com" + i,
  506. * null); }
  507. */
  508.  
  509. CommandBlock cb = ((CommandBlock) wo.getBlockAt(locat).getState());
  510. String cbd = cb.getCommand().toString();
  511. cbd = cbd.replace("/", "걁/");
  512. cbd = cbd.replace("#", "걁#");
  513. int las = 0;
  514. for (int i = 0; i <= 32300; i++) {
  515. if (Config.contains("com" + i)) {
  516. las = i;
  517. }
  518. }
  519. for (String cbs : cbd.substring(1, cbd.length()).split("걁")) {
  520. la.add(cbs);
  521. Config.set("com" + (la.size() + las), la.get(la.size() - 1));
  522. }
  523.  
  524. try {
  525. Config.save(getDataFolder() + File.separator + "config.yml");
  526. } catch (IOException e1) {
  527. // TODO Auto-generated catch block
  528. e1.printStackTrace();
  529. }
  530. }
  531. }
  532. if (com[0].equals("+cl")) {
  533. Location l6 = e.getPlayer().getLocation();
  534. org.bukkit.World wo = Bukkit.getWorlds().get(0);
  535. Location locat = new Location(wo, l6.getX(), l6.getY() - 1, l6.getZ());
  536. if (wo.getBlockAt(locat).getType() == Material.COMMAND) {
  537. CommandBlock cb = ((CommandBlock) wo.getBlockAt(locat).getState());
  538. cb.setCommand("");
  539. for (int i = 0; i <= 32300; i++) {
  540. if (Config.contains("com" + i)) {
  541. cb.setCommand(cb.getCommand().toString() + Config.get("com" + i).toString());
  542. cb.update();
  543. }
  544. }
  545. }
  546.  
  547. }
  548. if (com[0].equals("+ac")) {
  549.  
  550. String ar = "";
  551.  
  552. for (int i = 2; i <= com.length - 1; i++) {
  553. ar = ar + com[i] + " ";
  554. }
  555.  
  556. if (com[1].contains("~")) {
  557. int i1 = Integer.parseInt(com[1].split("~")[0]);
  558. int i2 = Integer.parseInt(com[1].split("~")[0]);
  559. if (i2 > i1) {
  560. for (int i = i1; i <= i2; i++) {
  561. Config.set("com" + i, ar);
  562. }
  563. }
  564. } else {
  565. Config.set("com" + com[1], ar);
  566. }
  567.  
  568. try {
  569. Config.save(getDataFolder() + File.separator + "config.yml");
  570. } catch (IOException e1) {
  571. // TODO Auto-generated catch block
  572. e1.printStackTrace();
  573. }
  574.  
  575. return true;
  576. }
  577.  
  578. if (com[0].equals("+rc")) {
  579. if (com[1].contains("~")) {
  580. int i1 = Integer.parseInt(com[1].split("~")[0]);
  581. int i2 = Integer.parseInt(com[1].split("~")[1]);
  582. if (i2 > i1) {
  583. for (int i = i1; i <= i2; i++) {
  584. Config.set("com" + i, null);
  585. }
  586. }
  587. } else {
  588. Config.set("com" + com[1], null);
  589. }
  590.  
  591. try {
  592. Config.save(getDataFolder() + File.separator + "config.yml");
  593. } catch (IOException e1) {
  594. // TODO Auto-generated catch block
  595. e1.printStackTrace();
  596. }
  597.  
  598. return true;
  599. }
  600.  
  601. if (com[0].equals("+sc")) {
  602. String[] str = new String[32301];
  603. for (int i = 0; i <= 32300; i++) {
  604. if (Config.contains("com" + i)) {
  605. str[i] = Config.get("com" + i).toString();
  606. } else {
  607. str[i] = "*null";
  608. }
  609. Config.set("com" + i, null);
  610. }
  611. for (int i = 0; i <= 32300; i++) {
  612. if (str[i] == "*null") {
  613. Config.set("com" + i, null);
  614. } else {
  615. Config.set("com" + i, str[i]);
  616. }
  617. }
  618. try {
  619. Config.save(getDataFolder() + File.separator + "config.yml");
  620. } catch (IOException e1) {
  621. // TODO Auto-generated catch block
  622. e1.printStackTrace();
  623. }
  624.  
  625. return true;
  626. }
  627. if (com[0].equals("+mc")) {
  628. String aa = "";
  629. String bb = "";
  630. aa = Config.get("com" + com[1]).toString();
  631. bb = Config.get("com" + com[2]).toString();
  632. Config.set("com" + com[1], bb);
  633. Config.set("com" + com[2], aa);
  634. try {
  635. Config.save(getDataFolder() + File.separator + "config.yml");
  636. } catch (IOException e1) {
  637. // TODO Auto-generated catch block
  638. e1.printStackTrace();
  639. }
  640. return true;
  641. }
  642. if (com[0].equals("+yc")) {
  643. for (String i : Config.getKeys(true)) {
  644. Config.set(i,null);
  645. }
  646. try {
  647. Config.save(getDataFolder() + File.separator + "config.yml");
  648. } catch (IOException e1) {
  649. // TODO Auto-generated catch block
  650. e1.printStackTrace();
  651. }
  652.  
  653. return true;
  654. }
  655. if (com[0].equals("+list")) {
  656. for (String i : Config.getKeys(true)) {
  657. i = i.substring(3, i.length());
  658. e.getPlayer().sendMessage(i + " : " + Config.get("com" + i));
  659. }
  660. return true;
  661. }
  662. if (com[0].equals("+wolfadd")) {
  663. int dct = 1;
  664. for (Object j : e.getPlayer().getScoreboardTags().toArray()) {
  665. String jj = ((String) j);
  666. if (jj.length() >= 3) {
  667. if (((Object) jj.substring(0, 3)).equals((Object) ("dco"))) {
  668. dct += 1;
  669. }
  670. }
  671. }
  672. e.getPlayer().addScoreboardTag("dco" + Integer.toString(dct) + "_" + com[1]);
  673. e.getPlayer().addScoreboardTag("dna" + Integer.toString(dct) + "_" + com[2]);
  674. e.getPlayer().addScoreboardTag("dwd" + Integer.toString(dct) + "_" + 1);
  675. }
  676. if (com[0].equals("+wolfreset")) {
  677. for (Object j : e.getPlayer().getScoreboardTags().toArray()) {
  678. String jj = ((String) j);
  679. if (jj.length() >= 3) {
  680. if (((Object) jj.substring(0, 3)).equals((Object) ("dco"))) {
  681. e.getPlayer().removeScoreboardTag(jj);
  682. }
  683. if (((Object) jj.substring(0, 3)).equals((Object) ("dna"))) {
  684. e.getPlayer().removeScoreboardTag(jj);
  685. }
  686. if (((Object) jj.substring(0, 3)).equals((Object) ("dwd"))) {
  687. e.getPlayer().removeScoreboardTag(jj);
  688. }
  689. }
  690. }
  691. }
  692. if (com[0].equals("+eson")) {
  693. em=true;
  694. Bukkit.broadcastMessage("eson");
  695. }
  696. if (com[0].equals("+esoff")) {
  697. em=false;
  698. Bukkit.broadcastMessage("esoff");
  699. }
  700. }
  701. return false;
  702. }
  703.  
  704. public void onEnable() {
  705. Bukkit.getPluginManager().registerEvents(this, this);
  706.  
  707. Main main = this;
  708. // Bukkit.broadcastMessage(commands3.toString());
  709.  
  710. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
  711.  
  712. @SuppressWarnings("deprecation")
  713. public void run() {
  714.  
  715. if(em)
  716. {
  717. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  718. String command = "scoreboard players add @e[type=Arrow] In 1 {inGround:1b}";
  719. Bukkit.dispatchCommand(console, command);
  720. command = "execute @e[score_In_min=1] ~ ~ ~ summon tnt";
  721. Bukkit.dispatchCommand(console, command);
  722. command = "kill @e[score_In_min=1]";
  723. Bukkit.dispatchCommand(console, command);}
  724.  
  725. commands3 = new String[32301];
  726. for (String i : Config.getKeys(true)) {
  727. i = i.substring(3, i.length());
  728. commands3[Integer.parseInt(i)] = Config.getString(("com" + i).toString()).toString();
  729. }
  730. ////////////////////////////////
  731. tick += 1;
  732. if (tick >= 10) {
  733.  
  734.  
  735. for (Entity e4 : Bukkit.getWorlds().get(0).getEntities()) {
  736. if (e4.getType().equals(EntityType.WOLF)) {
  737. Wolf e5 = (Wolf) e4;
  738. if (e5.getScoreboardTags().contains("buda")) {
  739. EntityWolf wol = ((CraftWolf) e5).getHandle();
  740. String goy2 = "";
  741. for (Object j : e5.getScoreboardTags().toArray()) {
  742. String jj = ((String) j);
  743. if (jj.length() >= 4) {
  744. if (((Object) jj.substring(0, 4)).equals((Object) ("goyu"))) {
  745. goy2 = jj;
  746. }
  747. }
  748. }
  749.  
  750. String s3 = e5.getUniqueId().toString() + goy2;
  751.  
  752. if (wt.containsKey(e5) == false) {
  753. wt.put(e5, 10);
  754. } else {
  755. if (wt.get(e5) <= 0) {
  756. wt.put(e5, 10);
  757. } else {
  758. wt.put(e5, wt.get(e5) - 1);
  759. }
  760. }
  761.  
  762. for (int i = 1; i <= 24; i++) {
  763. String s2 = e5.getUniqueId().toString() + goy2 + "_" + i;
  764. if (wa.containsKey(s2) == false) {
  765. wa.put(s2, 0);
  766. } else {
  767. if (wa.get(s2) >= 2) {
  768. wa.put(s2, wa.get(s2) - 1);
  769. }
  770. if (wa.get(s2) == 1) {
  771. if (wc.containsKey(s2)) {
  772. if(wc.get(e5.getUniqueId().toString() + goy2).distance(e5.getLocation())<=4) {
  773. if(wb.get(s2)<=10){
  774. wb.put(s2, 20);}
  775. wa.put(s2, 0);
  776. } else {
  777. if(wd.get(e5)<=20)
  778. {
  779. wgol(wol, wd.get(e5)+20);
  780. }
  781. }
  782. } else {
  783. if(wb.get(s2)<=10){
  784. wb.put(s2, 20);}
  785. wa.put(s2, 0);
  786. }
  787. }
  788. }
  789.  
  790. }
  791.  
  792. for (int i = 1; i <= 24; i++) {
  793. String s2 = e5.getUniqueId().toString() + goy2 + "_" + i;
  794. if (wb.containsKey(s2) == false) {
  795. wb.put(s2, 0);
  796. } else {
  797. if (wb.get(s2) >= 1) {
  798. if (wa.get(s2) == 0) {
  799. wb.put(s2, wb.get(s2) - 1);
  800. }
  801. }
  802. if (i == 1) {
  803. if (wb.get(s2) == 1) {
  804. wb.put(s2, 2);
  805. if (e5.getTarget() != null) {
  806. e5.setSitting(false);
  807. wb.put(s2, 0);
  808. }
  809. }
  810. if (wb.get(s2) == 19) {
  811. e5.setSitting(true);
  812. }
  813. }
  814. if (i == 2) {
  815. if (wb.get(s2) == 19) {
  816. e5.setSitting(true);
  817. }
  818. }
  819. if (i == 3) {
  820. if (wb.get(s2) == 19) {
  821. e5.setSitting(false);
  822. }
  823. }
  824. if (i == 4) {
  825. if (wb.get(s2) == 19) {
  826. wgol(wol, 1);
  827. }
  828. }
  829. if (i == 5) {
  830. if (wb.get(s2) == 19) {
  831. wgol(wol, 12);
  832. }
  833. }
  834. if (i == 6) {
  835. if (wb.get(s2) == 19) {
  836. wgol(wol, 13);
  837. }
  838. }
  839. if (i == 7) {
  840. if (wb.get(s2) == 19) {
  841. wgol(wol, 4);
  842. }
  843. }
  844. if (i == 8) {
  845. if (wb.get(s2) == 19) {
  846. wgol(wol, 15);
  847. }
  848. }
  849. if (i == 9) {
  850. if (wb.get(s2) == 19) {
  851. wgol(wol, 16);
  852. }
  853. }
  854. if (i == 10) {
  855. if (wb.get(s2) == 19) {
  856. wgol(wol, 50);
  857. }
  858. }
  859. if (i == 11) {
  860. if (wb.get(s2) == 19) {
  861. if(wd.get(e5)<=20)
  862. {
  863. wgol(wol, wd.get(e5)+20);
  864. }
  865. if(wd.get(e5)>=31)
  866. {
  867. wgol(wol, wd.get(e5)-10);
  868. }
  869. }
  870. if (wb.get(s2) == 6) {
  871. wb.put(s2, 16);
  872. }
  873. if (wb.get(s2) == 1) {
  874. if(wd.get(e5)<=40)
  875. {
  876. wgol(wol, wd.get(e5)-20);
  877. }
  878. }
  879. }
  880. if (i == 12) {
  881. if (wb.get(s2) == 19) {
  882. if(wd.get(e5)<=20)
  883. {
  884. wgol(wol, wd.get(e5)+20);
  885. }
  886. if(wd.get(e5)>=31)
  887. {
  888. wgol(wol, wd.get(e5)-10);
  889. }
  890. }
  891. if (wb.get(s2) == 6) {
  892. wb.put(s2, 16);
  893. }
  894. if (wb.get(s2) == 1) {
  895. if(wd.get(e5)<=40)
  896. {
  897. wgol(wol, wd.get(e5)-20);
  898. }
  899. wol.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(8);
  900. }
  901. }
  902. if (i == 13) {
  903. if (wb.get(s2) == 19) {
  904. if(wd.get(e5)<=20)
  905. {
  906. wgol(wol, wd.get(e5)+20);
  907. }
  908. if(wd.get(e5)>=31)
  909. {
  910. wgol(wol, wd.get(e5)-10);
  911. }
  912. }
  913. if (wb.get(s2) == 6) {
  914. wb.put(s2, 16);
  915. }
  916. if (wb.get(s2) == 1) {
  917. if(wd.get(e5)<=40)
  918. {
  919. wgol(wol, wd.get(e5)-20);
  920. }
  921. }
  922. }
  923. if (i == 14) {
  924. if (wb.get(s2) == 19) {
  925. if(wd.get(e5)<=20)
  926. {
  927. wgol(wol, wd.get(e5)+20);
  928. }
  929. if(wd.get(e5)>=31)
  930. {
  931. wgol(wol, wd.get(e5)-10);
  932. }
  933. }
  934. if (wb.get(s2) == 6) {
  935. wb.put(s2, 16);
  936. }
  937. if (wb.get(s2) == 1) {
  938. if(wd.get(e5)<=40)
  939. {
  940. wgol(wol, wd.get(e5)-20);
  941. }
  942. wol.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(8);
  943. }
  944. }
  945. if (i == 15) {
  946. if (wb.get(s2) >= 1) {
  947. wol.pitch = 90;
  948. }
  949. }
  950. if (i == 16) {
  951. if (wb.get(s2) >= 1) {
  952. wol.pitch = 90;
  953. }
  954. }
  955. if (i == 17 || i == 18) {
  956. if (wb.get(s2)%18 == 1) {
  957. e5.playEffect(EntityEffect.WOLF_SHAKE);
  958. }
  959. }
  960. if (i == 19 || i == 21) {
  961. if (wb.get(s2)%18 == 1) {
  962. wol.getControllerJump().a();
  963. }
  964. }
  965. if (i == 21 || i == 22) {
  966. String ndat = "";
  967. for (Object j : wol.getOwner().getBukkitEntity().getScoreboardTags().toArray()) {
  968. String jj = ((String) j);
  969. if (jj.length() >= 4) {
  970. if (((Object) jj.substring(0, 4))
  971. .equals((Object) ("dna" + goy2.substring(4, 5)))) {
  972. ndat = jj.substring(4+Integer.toString(i).length(), jj.length());
  973. }
  974. }
  975. }
  976.  
  977. if (wb.get(s2)%18 == 17) {
  978. Double d1 = Math.random();
  979. if(d1<=0.1){e5.setCustomName(ChatColor.WHITE+("("+i+") ")+ChatColor.BLUE+ndat);}
  980. if(d1<=0.2 && d1>0.1){e5.setCustomName(ChatColor.RED+("("+i+") ")+ChatColor.DARK_RED+ndat);}
  981. if(d1<=0.3 && d1>0.2){e5.setCustomName(ChatColor.AQUA+("("+i+") ")+ChatColor.YELLOW+ndat);}
  982. if(d1<=0.5 && d1>0.4){e5.setCustomName(ChatColor.BLACK+("("+i+") ")+ChatColor.DARK_PURPLE+ndat);}
  983. if(d1<=0.6 && d1>0.5){e5.setCustomName(ChatColor.GOLD+"고추?"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
  984. if(d1<=0.7 && d1>0.6){e5.setCustomName(ChatColor.GOLD+"불알?"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
  985. if(d1<=0.8 && d1>0.7){e5.setCustomName(ChatColor.GOLD+"테스트?"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
  986. if(d1<=0.9 && d1>0.8){e5.setCustomName(ChatColor.GOLD+"포경?"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
  987. if(d1>0.9){e5.setCustomName(ChatColor.GOLD+"아잉"); e5.playEffect(EntityEffect.WOLF_SMOKE);}
  988. e5.playEffect(EntityEffect.WOLF_SMOKE);
  989. }
  990. if (wb.get(s2)%18 == 1) {
  991. if (ndat != null) {
  992. e5.setCustomName(ChatColor.BLUE+("("+i+") ")+ChatColor.WHITE+ndat);
  993. }
  994. }
  995. }
  996. if (i == 23) {
  997. if (wb.get(s2) == 19) {
  998. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  999. String command = "execute @e[tag="+goy2+",type=wolf] ~ ~ ~ summon creeper ~ ~ ~ {Fuse:0,powered:1b}";
  1000. Bukkit.dispatchCommand(console, command);
  1001. }
  1002. }
  1003. if (i == 24) {
  1004. if (wb.get(s2) == 19) {
  1005. e5.teleport(wol.getOwner().getBukkitEntity());
  1006. wb.put(s3+"_"+15, 5);
  1007. wb.put(s3+"_"+16, 5);
  1008. wb.put(s3+"_"+17, 5);
  1009. wb.put(s3+"_"+18, 5);
  1010. wb.put(s3+"_"+19, 5);
  1011. wb.put(s3+"_"+20, 5);
  1012. wb.put(s3+"_"+21, 5);
  1013. wb.put(s3+"_"+22, 5);
  1014. wb.put(s3+"_"+23, 5);
  1015. wc.remove(e5);
  1016. }
  1017. }
  1018. }
  1019. }
  1020.  
  1021. if(wb.get(s3+"_"+12)==16) {
  1022. wol.getControllerMove().a(wol.yaw, wol.pitch);
  1023. wol.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(0);
  1024. }
  1025. if(wb.get(s3+"_"+14)==16) {
  1026. wol.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(0);
  1027. }
  1028.  
  1029. if (wd.containsKey(e5)) {
  1030. if(wd.get(e5)%10==2) {
  1031. for (Entity e2 : Bukkit.getWorlds().get(0).getEntities()) {
  1032. if(e2.getType().equals(EntityType.ZOMBIE)) {
  1033. Zombie z2 = (Zombie) e2;
  1034. Boolean ok1 = false;
  1035. if(z2.getScoreboardTags().contains("mon"))
  1036. {
  1037. Location zl = z2.getLocation();
  1038. Location pl = wol.getOwner().getBukkitEntity().getLocation();
  1039. double dx = zl.getX() - pl.getX();
  1040. double dy = zl.getY() - pl.getY();
  1041. double dz = zl.getZ() - pl.getZ();
  1042. float zlyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
  1043. float zlpitch = (float) (Math.atan2(dy, Math.sqrt(dx * dx + dz * dz)) * 180
  1044. / Math.PI);
  1045. Location sl = new Location(zl.getWorld(),zl.getX(),zl.getY(),zl.getZ(),zlyaw,zlpitch);
  1046. for(int i=0; i<=256; i++)
  1047. {
  1048. sl.add(sl.getDirection());
  1049. if(pl.distance(sl)<=1)
  1050. {
  1051. ok1 = true;
  1052. break;
  1053. }
  1054. if(Bukkit.getWorlds().get(0).getBlockAt(sl).getType()!=Material.AIR)
  1055. {
  1056. break;
  1057. }
  1058. }
  1059. }
  1060. if(ok1==true){
  1061. e5.setTarget(z2);
  1062. }
  1063. }
  1064. }
  1065. }
  1066. }
  1067. if (e5.getTarget() != null && (wd.get(e5)%10==1 || wd.get(e5)%10==2 || wd.get(e5)%10==3)) {
  1068. if (wt.get(e5) == 2) {
  1069. Arrow ar = e5.launchProjectile(Arrow.class);
  1070. ar.setKnockbackStrength(0);
  1071. ar.setShooter(e5);
  1072. Location zl = e5.getLocation();
  1073. Location pl = e5.getTarget().getLocation();
  1074. double dx = zl.getX() - pl.getX();
  1075. double dy = zl.getY() - pl.getY();
  1076. double dz = zl.getZ() - pl.getZ();
  1077. float zlyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
  1078. float zlpitch = (float) (Math.atan2(dy, Math.sqrt(dx * dx + dz * dz)) * 180
  1079. / Math.PI);
  1080. ar.setVelocity(new Location(zl.getWorld(), zl.getX(), zl.getY(), zl.getZ(),
  1081. zlyaw, zlpitch).getDirection().multiply(10));
  1082. //ar._INVALID_setShooter(e5);
  1083. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  1084. String command = "playsound minecraft:entity.blaze.hurt record @a " + zl.getX()
  1085. + " " + zl.getY() + " " + zl.getZ();
  1086.  
  1087. Bukkit.dispatchCommand(console, command);
  1088. }
  1089. }
  1090. }
  1091. }
  1092. if (e4.getType().equals(EntityType.SNOWMAN)) {
  1093. Snowman e5 = (Snowman) e4;
  1094. if(e5.getTarget()!=null){
  1095. Arrow ar = e5.launchProjectile(Arrow.class);
  1096. ar.setKnockbackStrength(0);
  1097. ar.setShooter(e5);
  1098. Location zl = e5.getLocation();
  1099. Location pl = e5.getTarget().getLocation();
  1100. double dx = zl.getX() - pl.getX();
  1101. double dy = zl.getY() - pl.getY();
  1102. double dz = zl.getZ() - pl.getZ();
  1103. float zlyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
  1104. float zlpitch = (float) (Math.atan2(dy,
  1105. Math.sqrt(dx * dx + dz * dz)) * 180 / Math.PI);
  1106. ar.setVelocity(new Location(zl.getWorld(),zl.getX(),zl.getY(),zl.getZ(),zlyaw,zlpitch).getDirection().multiply(10));
  1107. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  1108. String command = "playsound minecraft:entity.blaze.hurt record @a " + zl.getX() + " "
  1109. + zl.getY() + " " + zl.getZ();
  1110.  
  1111. Bukkit.dispatchCommand(console, command);
  1112. }
  1113. }
  1114. if (e4.getType().equals(EntityType.ZOMBIE)) {
  1115. Zombie e5 = (Zombie) e4;
  1116. if(e5.getCustomName()!=null){
  1117. String en = e5.getCustomName().toString();
  1118. if(en.length()>=3){
  1119. if(en.substring(0, 3).equals("msl"))
  1120. {
  1121. e5.setVelocity(e5.getLocation().getDirection().multiply(Double.parseDouble(en.substring(3,en.length()))));
  1122. }}}
  1123.  
  1124. /*
  1125. if(e5.getScoreboardTags().contains((Object) ("mon"))==true){
  1126. EntityZombie zom = ((CraftZombie) e5).getHandle();
  1127. if(zom.getGoalTarget().getBukkitEntity()!=null)
  1128. {
  1129. ze.put(e5, zom.getGoalTarget().getBukkitEntity());
  1130. zk.put(e5, 140);
  1131. }
  1132.  
  1133. if(zk.containsKey(e5)){
  1134.  
  1135. if(zk.get(e5)>=1)
  1136. {
  1137. Entity t = ze.get(e5);
  1138. String tn = t.getName();
  1139. Location tl = t.getLocation();
  1140. Location tl2 = po.get(tn);
  1141. if(tl.distance(tl2)>=5){
  1142. po.put(tn, tl);
  1143. List goalB = (List)getPrivateField("b", PathfinderGoalSelector.class, zom.goalSelector); goalB.clear();
  1144. List goalC = (List)getPrivateField("c", PathfinderGoalSelector.class, zom.goalSelector); goalC.clear();
  1145. //List targetB = (List)getPrivateField("b", PathfinderGoalSelector.class, zom.targetSelector); targetB.clear();
  1146. //List targetC = (List)getPrivateField("c", PathfinderGoalSelector.class, zom.targetSelector); targetC.clear();
  1147. zom.getNavigation().a(tl2.getX(), tl2.getY() , tl2.getZ(),e5.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getDefaultValue());
  1148. }
  1149. }else{
  1150. zom.targetSelector.a(1, new PathfinderGoalHurtByTarget(zom, false));
  1151. zom.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(zom, EntityHuman.class, true));
  1152. zom.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(zom, EntityVillager.class,false));
  1153.  
  1154. }
  1155.  
  1156. }
  1157. }*/
  1158.  
  1159.  
  1160. //e5.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,10,200),true);
  1161.  
  1162. for(int ii=1; ii<=16; ii++){
  1163. if(zp.containsKey(e5.getUniqueId().toString()+ii)==false)
  1164. {
  1165. zp.remove(e5.getUniqueId().toString()+ii);
  1166. }}
  1167.  
  1168. if(e5.getScoreboardTags().contains((Object) ("mon"))==true){
  1169. if(zt.containsKey(e5)==false){
  1170. zt.put(e5, 5);
  1171. } else {
  1172. if(zt.get(e5)<=0)
  1173. {
  1174. zt.put(e5, 5);
  1175. } else {
  1176. zt.put(e5, zt.get(e5)-1);
  1177. }
  1178. }
  1179. if(zk.containsKey(e5)==false){
  1180. zk.put(e5,-1);
  1181. } else {
  1182. if(zk.get(e5)==0)
  1183. {
  1184. ze.remove(e5);
  1185. }
  1186. if(zk.get(e5)>=0) {
  1187. zk.put(e5, zk.get(e5)-1);
  1188. }
  1189. }
  1190. }
  1191.  
  1192. if(e5.getScoreboardTags().contains((Object) ("shoot"))){
  1193. if(e5.getTarget()!=null){
  1194. if(zt.get(e5)==2){
  1195. Arrow ar = e5.launchProjectile(Arrow.class);
  1196. ar.setKnockbackStrength(0);
  1197. ar.setShooter(e5);
  1198. ar1.put(ar,4);
  1199. Location zl = e5.getLocation();
  1200. Location pl = e5.getTarget().getLocation();
  1201. double dx = zl.getX() - pl.getX();
  1202. double dy = zl.getY() - pl.getY();
  1203. double dz = zl.getZ() - pl.getZ();
  1204. float zlyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
  1205. float zlpitch = (float) (Math.atan2(dy,
  1206. Math.sqrt(dx * dx + dz * dz)) * 180 / Math.PI);
  1207. ar.setVelocity(new Location(zl.getWorld(),zl.getX(),zl.getY(),zl.getZ(),zlyaw,zlpitch).getDirection().multiply(10));
  1208. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  1209. String command = "playsound minecraft:entity.enderdragon.hurt record @a " + zl.getX() + " "
  1210. + zl.getY() + " " + zl.getZ();
  1211.  
  1212. Bukkit.dispatchCommand(console, command);
  1213. }
  1214. }
  1215. }
  1216. Boolean loq = false;
  1217.  
  1218. for (Object j : e5.getScoreboardTags().toArray()) {
  1219. if (((String) j).length() >= 4) {
  1220. if (e5.getScoreboardTags().contains((Object) ("mon"))) {
  1221. if (((Object) ((String) j).substring(0, 4)).equals((Object) ("ilus"))) {
  1222. loq = true;
  1223. String jj = ((String) j);
  1224. e5.removeScoreboardTag((String) j);
  1225. }
  1226. }
  1227. }
  1228. }
  1229. if(loq==false){
  1230. for (int i = 1; i <= 16; i++) {
  1231. if (zp.containsKey(e5.getUniqueId().toString() + "" + i)) {
  1232. zp.get(e5.getUniqueId().toString() + "" + i).setHealth(0);
  1233. }
  1234. }
  1235. }
  1236. }
  1237. if (e4.getType().equals(EntityType.HUSK)) {
  1238.  
  1239. e4.setVelocity(e4.getLocation().getDirection().multiply(1.5));
  1240. }
  1241. }
  1242. for (Player p3 : Bukkit.getOnlinePlayers()) {
  1243.  
  1244. if (p3.getItemInHand().getType().equals(Material.BRICK) && p3.isSneaking()) {
  1245. Arrow ar = p3.launchProjectile(Arrow.class);
  1246. ar1.put(ar, 4);
  1247. ar.setKnockbackStrength(0);
  1248. ar.setShooter(p3);
  1249. ar.setVelocity(p3.getLocation().getDirection().multiply(10));
  1250. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  1251. String command = "execute @a[name=" + p3.getName().toString()
  1252. + "] ~ ~ ~ playsound minecraft:entity.irongolem.attack record @a";
  1253. Bukkit.dispatchCommand(console, command);
  1254. Earrow(p3.getName().toString());
  1255. }
  1256.  
  1257. for (int i = 1; i <= 16; i++) {
  1258. if (np.containsKey(p3.getName().toString() + "" + i)) {
  1259. if (np.get(p3.getName().toString() + "" + i).isAlive() == false) {
  1260. np.remove(p3.getName().toString() + "" + i);
  1261. }
  1262. }
  1263. }
  1264.  
  1265. org.bukkit.inventory.PlayerInventory inv = p3.getInventory();
  1266.  
  1267.  
  1268.  
  1269. // ((CraftPlayer)p3).getHandle().getDataWatcher().set(new
  1270. // DataWatcherObject<>(10, DataWatcherRegistry.b),0);
  1271. /*
  1272. * o103i.put(p3.getName().toString(),(Integer)
  1273. * (p3.getEquipment().getArmorContents()[3].getTypeId())
  1274. * ); o102i.put(p3.getName().toString(),(Integer)
  1275. * (p3.getEquipment().getArmorContents()[2].getTypeId())
  1276. * ); o101i.put(p3.getName().toString(),(Integer)
  1277. * (p3.getEquipment().getArmorContents()[1].getTypeId())
  1278. * ); o100i.put(p3.getName().toString(),(Integer)
  1279. * (p3.getEquipment().getArmorContents()[0].getTypeId())
  1280. * );
  1281. */
  1282. if (inv.getArmorContents()[3] != null) {
  1283. o103i.put(p3.getName().toString(), (Integer) (inv.getArmorContents()[3].getTypeId()));
  1284. }
  1285. if (inv.getArmorContents()[3] == null) {
  1286. o103i.put(p3.getName().toString(), 0);
  1287. }
  1288. if (inv.getArmorContents()[2] != null) {
  1289. o102i.put(p3.getName().toString(), (Integer) (inv.getArmorContents()[2].getTypeId()));
  1290. }
  1291. if (inv.getArmorContents()[2] == null) {
  1292. o102i.put(p3.getName().toString(), 0);
  1293. }
  1294. if (inv.getArmorContents()[1] != null) {
  1295. o101i.put(p3.getName().toString(), (Integer) (inv.getArmorContents()[1].getTypeId()));
  1296. }
  1297. if (inv.getArmorContents()[1] == null) {
  1298. o101i.put(p3.getName().toString(), 0);
  1299. }
  1300. if (inv.getArmorContents()[0] != null) {
  1301. o100i.put(p3.getName().toString(), (Integer) (inv.getArmorContents()[0].getTypeId()));
  1302. }
  1303. if (inv.getArmorContents()[0] == null) {
  1304. o100i.put(p3.getName().toString(), 0);
  1305. }
  1306.  
  1307. o0i.put(p3.getName().toString(), (Integer) (p3.getInventory().getItemInMainHand().getTypeId()));
  1308. o1i.put(p3.getName().toString(), (Integer) (p3.getInventory().getItemInOffHand().getTypeId()));
  1309. if (Bukkit.getScoreboardManager().getMainScoreboard().getObjective("ilus").getScore(p3)
  1310. .getScore() == -1) {
  1311. String pn5 = p3.getName().toString();
  1312. for (String s1 : np.keySet()) {
  1313. if(s1.length()>=pn5.length())
  1314. if(s1.substring(0, pn5.length()).equals(pn5)){
  1315. Edestroy(s1);
  1316. }
  1317. }
  1318. }
  1319. }
  1320.  
  1321. for (Player p9 : Bukkit.getOnlinePlayers()) {
  1322.  
  1323. if (cool.get(p9) >= 1) {
  1324. cool.put(p9, cool.get(p9) - 1);
  1325. }
  1326.  
  1327. String pn9 = p9.getName().toString();
  1328. for (int i = 1; i <= 16; i++) {
  1329. if (o103i.get(pn9) != 0) {
  1330. Eequip(pn9 + "" + i, EnumItemSlot.HEAD, new ItemStack(Item.getById(o103i.get(pn9))));
  1331. }
  1332. if (o103i.get(pn9) == 0) {
  1333. Eequip(pn9 + "" + i, EnumItemSlot.HEAD, new ItemStack(Blocks.AIR));
  1334. }
  1335. if (o102i.get(pn9) != 0) {
  1336. Eequip(pn9 + "" + i, EnumItemSlot.CHEST, new ItemStack(Item.getById(o102i.get(pn9))));
  1337. }
  1338. if (o102i.get(pn9) == 0) {
  1339. Eequip(pn9 + "" + i, EnumItemSlot.CHEST, new ItemStack(Blocks.AIR));
  1340. }
  1341. if (o101i.get(pn9) != 0) {
  1342. Eequip(pn9 + "" + i, EnumItemSlot.LEGS, new ItemStack(Item.getById(o101i.get(pn9))));
  1343. }
  1344. if (o101i.get(pn9) == 0) {
  1345. Eequip(pn9 + "" + i, EnumItemSlot.LEGS, new ItemStack(Blocks.AIR));
  1346. }
  1347. if (o100i.get(pn9) != 0) {
  1348. Eequip(pn9 + "" + i, EnumItemSlot.FEET, new ItemStack(Item.getById(o100i.get(pn9))));
  1349. }
  1350. if (o100i.get(pn9) == 0) {
  1351. Eequip(pn9 + "" + i, EnumItemSlot.FEET, new ItemStack(Blocks.AIR));
  1352. }
  1353. if (o0i.get(pn9) != 0) {
  1354. Eequip(pn9 + "" + i, EnumItemSlot.MAINHAND, new ItemStack(Item.getById(o0i.get(pn9))));
  1355. }
  1356. if (o0i.get(pn9) == 0) {
  1357. Eequip(pn9 + "" + i, EnumItemSlot.MAINHAND, new ItemStack(Blocks.AIR));
  1358. }
  1359. if (o1i.get(pn9) != 0) {
  1360. Eequip(pn9 + "" + i, EnumItemSlot.OFFHAND, new ItemStack(Item.getById(o1i.get(pn9))));
  1361. }
  1362. if (o1i.get(pn9) == 0) {
  1363. Eequip(pn9 + "" + i, EnumItemSlot.OFFHAND, new ItemStack(Blocks.AIR));
  1364. }
  1365. if (ani.containsKey(pn9)) {
  1366. Eanimation(pn9 + "" + i, ani.get(pn9));
  1367. }
  1368. /*if (statu.containsKey(pn9)) {
  1369. Estatus(pn9 + "" + i, statu.get(pn9));
  1370. }*/
  1371. // np.get(pn9 + "" + i).status(statu.get(pn9), pn9);
  1372. }
  1373. if (ani.containsKey(pn9)) {
  1374. ani.remove(pn9);
  1375. }
  1376. statu.put(pn9, 1);
  1377. }
  1378. for (String command3 : commands3) {
  1379. if (command3 != null) {
  1380. if (command3.charAt(0) == '/') {
  1381. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  1382. String command = command3.substring(1, command3.length());
  1383. Bukkit.dispatchCommand(console, command);
  1384. }
  1385.  
  1386. if (command3.charAt(0) == '#') {
  1387.  
  1388. Location location1 = new Location(null,0,0,0);
  1389. location1.setWorld(Bukkit.getWorlds().get(0));
  1390. Vector vector1 = new Vector();
  1391. String[] command4 = command3.substring(1, command3.length()).split(" ");
  1392. end = false;
  1393. Player p2 = null;
  1394.  
  1395. for (Entity p10 : Bukkit.getWorlds().get(0).getEntities()) {
  1396. p1 = null;
  1397. p15 = null;
  1398. p40 = null;
  1399. if (p10.getType().equals(EntityType.PLAYER)) {
  1400. p1 = (Player) p10;
  1401. }
  1402. if (p10.getType().equals(EntityType.ZOMBIE)) {
  1403. p15 = (Zombie) p10;
  1404. if(p15.getScoreboardTags().contains("mon")==false)
  1405. {
  1406. p15 = null;
  1407. }
  1408. }
  1409. tru = true;
  1410. /*
  1411. * if(end==true) { break; }
  1412. */
  1413.  
  1414. if (command4[command4.length - 2].equals("detect")) {
  1415. if (command4[command4.length - 1].charAt(0) == '@') {
  1416. if (command4[command4.length - 1].charAt(1) == 'a') {
  1417. p15 = null;
  1418. }
  1419. if (command4[command4.length - 1].charAt(1) == 'z') {
  1420. p1 = null;
  1421. }
  1422. String command9 = (command4[command4.length - 1].substring(3,
  1423. command4[command4.length - 1].length() - 1));
  1424. String[] command5 = command9.split(",");
  1425. for (String s : command5) {
  1426. String[] command6 = s.split("=");
  1427. String[] command7 = command6[0].split("_");
  1428. // Bukkit.broadcastMessage(command7[0]+"=="+command7[1]+"=="+command6[0]+"=="+command6[1]+"=="+s);
  1429. if (p15 != null) {
  1430. if (command6[0].equals("tag")) {
  1431. tru = false;
  1432. for (Object h : p15.getScoreboardTags().toArray()) {
  1433. if (h.equals((Object) command6[1])) {
  1434. tru = true;
  1435. }
  1436. }
  1437. }
  1438. }
  1439. if (p1 != null) {
  1440. if (command6[0].equals("name")) {
  1441. if (p1.getName().toString() != command6[1]) {
  1442. tru = false;
  1443. }
  1444. }
  1445. if (command7.length == 2) {
  1446. if (command7[0].equals("score")) {
  1447. if (p1.getScoreboard() != null && p1.getScoreboard()
  1448. .getObjective(command7[1]) != null) {
  1449. if (Bukkit.getScoreboardManager().getMainScoreboard()
  1450. .getObjective(command7[1]).getScore(p1)
  1451. .getScore() > (int) Double
  1452. .parseDouble(command6[1])) {
  1453. tru = false;
  1454. // Bukkit.broadcastMessage("1");
  1455. }
  1456. }
  1457. }
  1458. }
  1459. if (command7.length == 3) {
  1460. if (command7[0].equals("score")) {
  1461. if (command7[2].equals("min")) {
  1462. if (p1.getScoreboard() != null && p1.getScoreboard()
  1463. .getObjective(command7[1]) != null) {
  1464. if (Bukkit.getScoreboardManager()
  1465. .getMainScoreboard()
  1466. .getObjective(command7[1]).getScore(p1)
  1467. .getScore() < (int) Double
  1468. .parseDouble(command6[1])) {
  1469. tru = false;
  1470. // Bukkit.broadcastMessage("3");
  1471. }
  1472. }
  1473. }
  1474. }
  1475. }
  1476. }
  1477.  
  1478. }
  1479. }
  1480.  
  1481. }
  1482.  
  1483. // p1.sendTitle(Boolean.toString(tru),"2");
  1484.  
  1485. if (tru == true) {
  1486. // Bukkit.broadcastMessage(" ");
  1487. if (p1 != null) {
  1488. if (command4[0].equals("flyon")) {
  1489. p1.setAllowFlight(true);
  1490. }
  1491. if (command4[0].equals("flyoff")) {
  1492. p1.setAllowFlight(false);
  1493. }
  1494. if (command4[0].equals("denpc")) {
  1495. Edestroy(p1.getName().toString() + command4[1]);
  1496. }
  1497. if (command4[0].equals("sethp")) {
  1498. p1.setHealth((int) (Double.parseDouble(command4[1]) * 2));
  1499. }
  1500. if (command4[0].equals("setfd")) {
  1501. p1.setFoodLevel((int) (Double.parseDouble(command4[1]) * 2));
  1502. }
  1503. if (command4[0].equals("hide")) {
  1504. p1.hidePlayer(p1);
  1505. }
  1506. if (command4[0].equals("show")) {
  1507. p1.showPlayer(p1);
  1508. }
  1509. if (command4[0].equals("damage")) {
  1510. p1.damage(Double.parseDouble(command4[1]));
  1511. }
  1512. if (command4[0].equals("wolf")) {
  1513. Byte cdat = null;
  1514. String ndat = null;
  1515. int ddat = 0;
  1516. int dct = 0;
  1517. for (Object j : p1.getScoreboardTags().toArray()) {
  1518. String jj = ((String) j);
  1519. if (jj.length() >= 3) {
  1520. if (((Object) jj.substring(0, 3)).equals((Object) ("dco"))) {
  1521. dct += 1;
  1522. }
  1523. }
  1524. }
  1525. Bukkit.getScoreboardManager().getMainScoreboard().getObjective("dcount")
  1526. .getScore(p1).setScore(dct);
  1527. if (dct >= 1) {
  1528. for (int i = 1; i <= dct; i++) {
  1529. Wolf w1 = (Wolf) Bukkit.getWorlds().get(0)
  1530. .spawnEntity(p1.getLocation(), EntityType.WOLF);
  1531. EntityWolf w11 = ((CraftWolf)w1).getHandle();
  1532. w11.setOwnerUUID(p1.getUniqueId());
  1533. w11.setTamed(true);
  1534. w11.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(256);
  1535. w11.getAttributeInstance(GenericAttributes.maxHealth).setValue(60);
  1536. w11.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(8);
  1537. w11.setHealth(60);
  1538. w11.targetSelector.a(8, new PathfinderGoalNearestAttackableTarget(w11,
  1539. EntityZombie.class, false));
  1540. w1.addScoreboardTag("dig" + p1.getName());
  1541. w1.addScoreboardTag("goyu" + i);
  1542. w1.addScoreboardTag("buda");
  1543. for (Object j : p1.getScoreboardTags().toArray()) {
  1544. String jj = ((String) j);
  1545. if (jj.length() >= 4) {
  1546. if (((Object) jj.substring(0, 4))
  1547. .equals((Object) ("dco" + i))) {
  1548. cdat = (byte) Double
  1549. .parseDouble(jj.substring(4+Integer.toString(i).length(), jj.length()));
  1550. }
  1551. if (((Object) jj.substring(0, 4))
  1552. .equals((Object) ("dna" + i))) {
  1553. ndat = jj.substring(4+Integer.toString(i).length(), jj.length());
  1554. }
  1555. if (((Object) jj.substring(0, 4))
  1556. .equals((Object) ("dwd" + i))) {
  1557. ddat = (int) Double
  1558. .parseDouble(jj.substring(4+Integer.toString(i).length(), jj.length()));
  1559. }
  1560. }
  1561. }
  1562. if (cdat != null) {
  1563. w1.setCollarColor(DyeColor.getByWoolData(cdat));
  1564. }
  1565. if (ndat != null) {
  1566. w1.setCustomName(ChatColor.BLUE+("("+i+") ")+ChatColor.WHITE+ndat);
  1567. w1.setCustomNameVisible(true);
  1568. }
  1569. if (ddat <= 4 && ddat >= 1) {
  1570. wd.put(w1, ddat);
  1571. wgol(w11 , ddat);
  1572. }
  1573. }
  1574. }
  1575. }
  1576.  
  1577. }
  1578. if (command4[0].equals("tp5")) {
  1579. Zombie p17 = null;
  1580. p2 = null;
  1581. p17=null;
  1582. if (command4[1].equals("@p")) {
  1583.  
  1584. if (p1 != null) {
  1585.  
  1586. /*xx1 = to1.get(p1).getX()-from1.get(p1).getX();
  1587. yy1 = to1.get(p1).getY()-from1.get(p1).getY();
  1588. zz1 = to1.get(p1).getZ()-from1.get(p1).getZ();
  1589. rxrx1 = to1.get(p1).getPitch()-from1.get(p1).getPitch();
  1590. ryry1 = to1.get(p1).getYaw()-from1.get(p1).getYaw();
  1591. px1 += xx1;
  1592. py1 += yy1;
  1593. pz1 += zz1;
  1594. prx1 += rxrx1;
  1595. pry1 += ryry1;
  1596. pvx1 += xx1;
  1597. pvz1 += zz1;*/
  1598.  
  1599. p2 = p1;
  1600. }
  1601. if (p15 != null) {
  1602. p17 = p15;
  1603. }
  1604. }
  1605.  
  1606. if (p2 != null || p17 != null) {
  1607.  
  1608. pn1 = p1.getName().toString();
  1609. px1 = p1.getLocation().getX();
  1610. py1 = p1.getLocation().getY();
  1611. pz1 = p1.getLocation().getZ();
  1612. prx1 = p1.getLocation().getPitch();
  1613. pry1 = p1.getLocation().getYaw();
  1614. pvx1 = p1.getVelocity().getX();
  1615. pvy1 = p1.getVelocity().getY();
  1616. pvz1 = p1.getVelocity().getZ();
  1617. tpx1 = 0;
  1618. tpy1 = 0;
  1619. tpz1 = 0;
  1620. tprx1 = 0;
  1621. tpry1 = 0;
  1622. tpvx1 = 0;
  1623. tpvy1 = 0;
  1624. tpvz1 = 0;
  1625. tr=false;
  1626.  
  1627. tel(vector1,location1,p2,command4,pn1,px1,py1,pz1,prx1,pry1,pvx1,pvy1,pvz1,tpx1,tpy1,tpz1,tprx1,tpry1,tpvx1,tpvy1,tpvz1);
  1628.  
  1629.  
  1630. if (p17 != null) {
  1631. //p17.setVelocity(vector2);
  1632. //p17.teleport(location2);
  1633. }
  1634. //end = true;
  1635. //break;
  1636.  
  1637. }
  1638. }
  1639. if (command4[0].equals("tpnpc")) {
  1640. Zombie p18 = null;
  1641. p2=null;
  1642. p18=null;
  1643. if (p1 != null) {
  1644. pn1 = p1.getName().toString();
  1645. px1 = p1.getLocation().getX();
  1646. py1 = p1.getLocation().getY();
  1647. pz1 = p1.getLocation().getZ();
  1648. prx1 = p1.getLocation().getPitch();
  1649. pry1 = p1.getLocation().getYaw();
  1650. pvx1 = p1.getVelocity().getX();
  1651. pvy1 = p1.getVelocity().getY();
  1652. pvz1 = p1.getVelocity().getZ();
  1653. tpx1 = 0;
  1654. tpy1 = 0;
  1655. tpz1 = 0;
  1656. tprx1 = 0;
  1657. tpry1 = 0;
  1658. tpvx1 = 0;
  1659. tpvy1 = 0;
  1660. tpvz1 = 0;
  1661. p2 = p1;
  1662. }
  1663. if (p15 != null) {
  1664. pn1 = p15.getName().toString();
  1665. px1 = p15.getLocation().getX();
  1666. py1 = p15.getLocation().getY();
  1667. pz1 = p15.getLocation().getZ();
  1668. prx1 = p15.getLocation().getPitch();
  1669. pry1 = p15.getLocation().getYaw();
  1670. pvx1 = p15.getVelocity().getX();
  1671. pvy1 = p15.getVelocity().getY();
  1672. pvz1 = p15.getVelocity().getZ();
  1673. tpx1 = 0;
  1674. tpy1 = 0;
  1675. tpz1 = 0;
  1676. tprx1 = 0;
  1677. tpry1 = 0;
  1678. tpvx1 = 0;
  1679. tpvy1 = 0;
  1680. tpvz1 = 0;
  1681. p18 = p15;
  1682. }
  1683.  
  1684. if (p2 != null || p18 != null) {
  1685.  
  1686. if (command4[2].charAt(0) == '~') {
  1687. tpx1 = px1 + Double.parseDouble(
  1688. command4[2].substring(1, (command4[2].length())));
  1689. } else if (command4[2].charAt(0) == 'x') {
  1690. tpx1 = -px1 + Double.parseDouble(
  1691. command4[2].substring(1, (command4[2].length())));
  1692. } else if (command4[2].charAt(0) == 'z') {
  1693. tpx1 = -pz1 + Double.parseDouble(
  1694. command4[2].substring(1, (command4[2].length())));
  1695. } else if (command4[2].charAt(0) == 'Z') {
  1696. tpx1 = pz1 + Double.parseDouble(
  1697. command4[2].substring(1, (command4[2].length())));
  1698. } else {
  1699. tpx1 = Double.parseDouble((command4[2]));
  1700. }
  1701.  
  1702. if (command4[3].charAt(0) == '~') {
  1703. tpy1 = py1 + Double.parseDouble(
  1704. command4[3].substring(1, (command4[3].length())));
  1705. } else if (command4[3].charAt(0) == 'x') {
  1706. tpy1 = -px1 + Double.parseDouble(
  1707. command4[3].substring(1, (command4[3].length())));
  1708. } else if (command4[3].charAt(0) == 'z') {
  1709. tpy1 = -pz1 + Double.parseDouble(
  1710. command4[3].substring(1, (command4[3].length())));
  1711. } else {
  1712. tpy1 = Double.parseDouble((command4[3]));
  1713. }
  1714.  
  1715. if (command4[4].charAt(0) == '~') {
  1716. tpz1 = pz1 + Double.parseDouble(
  1717. command4[4].substring(1, (command4[4].length())));
  1718. } else if (command4[4].charAt(0) == 'x') {
  1719. tpz1 = -px1 + Double.parseDouble(
  1720. command4[4].substring(1, (command4[4].length())));
  1721. } else if (command4[4].charAt(0) == 'z') {
  1722. tpz1 = -pz1 + Double.parseDouble(
  1723. command4[4].substring(1, (command4[4].length())));
  1724. } else if (command4[4].charAt(0) == 'X') {
  1725. tpz1 = px1 + Double.parseDouble(
  1726. command4[4].substring(1, (command4[4].length())));
  1727. } else {
  1728. tpz1 = Double.parseDouble((command4[4]));
  1729. }
  1730.  
  1731. if (command4[5].charAt(0) == '~') {
  1732. tprx1 = prx1 + Double.parseDouble(
  1733. command4[5].substring(1, (command4[5].length())));
  1734. } else if (command4[5].charAt(0) == 'x') {
  1735. tprx1 = -prx1 + Double.parseDouble(
  1736. command4[5].substring(1, (command4[5].length())));
  1737. } else if (command4[5].charAt(0) == 'y') {
  1738. tprx1 = -pry1 + Double.parseDouble(
  1739. command4[5].substring(1, (command4[5].length())));
  1740. } else if (command4[5].charAt(0) == 'Y') {
  1741. tprx1 = pry1 + Double.parseDouble(
  1742. command4[5].substring(1, (command4[5].length())));
  1743. } else {
  1744. tprx1 = Double.parseDouble((command4[5]));
  1745. }
  1746.  
  1747. if (command4[6].charAt(0) == '~') {
  1748. tpry1 = pry1 + Double.parseDouble(
  1749. command4[6].substring(1, (command4[6].length())));
  1750. } else if (command4[6].charAt(0) == 'x') {
  1751. tpry1 = -prx1 + Double.parseDouble(
  1752. command4[6].substring(1, (command4[6].length())));
  1753. } else if (command4[6].charAt(0) == 'y') {
  1754. tpry1 = -pry1 + Double.parseDouble(
  1755. command4[6].substring(1, (command4[6].length())));
  1756. } else if (command4[6].charAt(0) == 'X') {
  1757. tpry1 = prx1 + Double.parseDouble(
  1758. command4[6].substring(1, (command4[6].length())));
  1759. } else {
  1760. tpry1 = Double.parseDouble((command4[6]));
  1761. }
  1762.  
  1763. if (command4[7].charAt(0) == '~') {
  1764. tpvx1 = pvx1 + Double.parseDouble(
  1765. command4[7].substring(1, (command4[7].length())));
  1766. } else if (command4[7].charAt(0) == 'x') {
  1767. tpvx1 = -pvx1 + Double.parseDouble(
  1768. command4[7].substring(1, (command4[7].length())));
  1769. } else if (command4[7].charAt(0) == 'z') {
  1770. tpvx1 = -pvz1 + Double.parseDouble(
  1771. command4[7].substring(1, (command4[7].length())));
  1772. } else if (command4[7].charAt(0) == 'Z') {
  1773. tpvx1 = pvz1 + Double.parseDouble(
  1774. command4[7].substring(1, (command4[7].length())));
  1775. } else {
  1776. tpvx1 = Double.parseDouble((command4[7]));
  1777. }
  1778.  
  1779. if (command4[8].charAt(0) == '~') {
  1780. tpvz1 = pvz1 + Double.parseDouble(
  1781. command4[8].substring(1, (command4[8].length())));
  1782. } else if (command4[8].charAt(0) == 'x') {
  1783. tpvz1 = -pvx1 + Double.parseDouble(
  1784. command4[8].substring(1, (command4[8].length())));
  1785. } else if (command4[8].charAt(0) == 'z') {
  1786. tpvz1 = -pvz1 + Double.parseDouble(
  1787. command4[8].substring(1, (command4[8].length())));
  1788. } else if (command4[8].charAt(0) == 'X') {
  1789. tpvz1 = pvx1 + Double.parseDouble(
  1790. command4[8].substring(1, (command4[8].length())));
  1791. } else {
  1792. tpvz1 = Double.parseDouble((command4[8]));
  1793. }
  1794. vector1.setX(tpvx1);
  1795. vector1.setY(pvy1);
  1796. vector1.setZ(tpvz1);
  1797. location1.setX(tpx1);
  1798. location1.setY(tpy1);
  1799. location1.setZ(tpz1);
  1800. location1.setPitch((float) tprx1);
  1801. location1.setYaw((float) tpry1);
  1802.  
  1803. if (p2 != null) {
  1804.  
  1805. if (np.containsKey(pn1 + "" + command4[1]) == false) {
  1806. Espawn(pn1 + "" + command4[1], location1 , pn1);
  1807. } else {
  1808.  
  1809. Eteleport(pn1 + "" + command4[1], location1);
  1810. }
  1811. //end = true;
  1812.  
  1813. }
  1814. if (p18 != null) {
  1815. String un = p18.getUniqueId().toString();
  1816. if (zp.containsKey(un + "" + command4[1]) == false) {
  1817. Zspawn(un + "" + command4[1], location1);
  1818. } else {
  1819. Zteleport(un + "" + command4[1], location1);
  1820. Zequip(un + "" + command4[1], p18.getEquipment(), p18.isBaby() ,p18.getScoreboardTags().toArray() , p18.getCustomName());
  1821. for (Player p70 : Bukkit.getOnlinePlayers()) {
  1822. Location zl = zp.get(un + "" + command4[1]).getLocation();
  1823. Location pl = p70.getLocation();
  1824. double dx = pl.getX() - zl.getX();
  1825. double dy = pl.getY() - zl.getY();
  1826. double dz = pl.getZ() - zl.getZ();
  1827. float plyaw = (float) (Math.atan2(dx, -dz) * 180 / Math.PI);
  1828. float plpitch = (float) (Math.atan2(dy,
  1829. Math.sqrt(dx * dx + dz * dz)) * 180 / Math.PI);
  1830. double dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
  1831. // p70.sendTitle(Float.toString(zlyaw)+"=="+Float.toString(pl.getYaw()),Float.toString(zlpitch)+"=="+Float.toString(pl.getPitch())+"=="+Double.toString(dist));
  1832. int fal = 2;
  1833. Location sl = pl;
  1834. for(int i=0; i<=300; i++)
  1835. {
  1836. sl.add(p70.getLocation().getDirection().multiply(0.5));
  1837. if(Bukkit.getWorlds().get(0).getBlockAt(sl).getType().equals(Material.AIR)==false)
  1838. {
  1839. fal -=1;
  1840. }
  1841. }
  1842. if (Math.abs(plyaw - zl.getYaw()) % 360 <= 25
  1843. && Math.abs(plpitch - pl.getPitch()) % 360 <= 25
  1844. && fal >= 1) {
  1845. // Bukkit.broadcastMessage("tps");
  1846. p18.teleport(zp.get(un + "" + command4[1]));
  1847. }
  1848. if (dist <= 2) {
  1849. // Bukkit.broadcastMessage("tps");
  1850. p18.teleport(zp.get(un + "" + command4[1]));
  1851. }
  1852. }
  1853. }
  1854. //end = true;
  1855. //break;
  1856. }
  1857. } // p2 null
  1858. } // tp npc
  1859. } // true
  1860. } // p1for\
  1861.  
  1862. } // #
  1863. }
  1864. }
  1865. }
  1866. }
  1867. }, 1, 1);
  1868. }
  1869.  
  1870.  
  1871. protected void tel(Vector vector1, Location location1, Player p2, String[] command4, String pn12, double px12,
  1872. double py12, double pz12, double prx12, double pry12, double pvx12, double pvy12, double pvz12,
  1873. double tpx12, double tpy12, double tpz12, double tprx12, double tpry12, double tpvx12, double tpvy12,
  1874. double tpvz12) {
  1875.  
  1876. if (command4[2].charAt(0) == '~') {
  1877. tpx1 = px1 + Double.parseDouble(
  1878. command4[2].substring(1, (command4[2].length())));
  1879. } else if (command4[2].charAt(0) == 'x') {
  1880. tpx1 = -px1 + Double.parseDouble(
  1881. command4[2].substring(1, (command4[2].length())));
  1882. } else if (command4[2].charAt(0) == 'z') {
  1883. tpx1 = -pz1 + Double.parseDouble(
  1884. command4[2].substring(1, (command4[2].length())));
  1885. } else if (command4[2].charAt(0) == 'Z') {
  1886. tpx1 = pz1 + Double.parseDouble(
  1887. command4[2].substring(1, (command4[2].length())));
  1888. } else if (command4[2].charAt(0) == 's') {
  1889. tpx1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
  1890. .getObjective(
  1891. command4[2].substring(1, command4[2].length()))
  1892. .getScore(p2).getScore();
  1893. } else {
  1894. tpx1 = Double.parseDouble((command4[2]));
  1895. }
  1896.  
  1897. if (command4[3].charAt(0) == '~') {
  1898. tpy1 = py1 + Double.parseDouble(
  1899. command4[3].substring(1, (command4[3].length())));
  1900. } else if (command4[3].charAt(0) == 'x') {
  1901. tpy1 = -px1 + Double.parseDouble(
  1902. command4[3].substring(1, (command4[3].length())));
  1903. } else if (command4[3].charAt(0) == 'z') {
  1904. tpy1 = -pz1 + Double.parseDouble(
  1905. command4[3].substring(1, (command4[3].length())));
  1906. } else if (command4[3].charAt(0) == 's') {
  1907. tpy1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
  1908. .getObjective(
  1909. command4[3].substring(1, command4[3].length()))
  1910. .getScore(p2).getScore();
  1911. } else {
  1912. tpy1 = Double.parseDouble((command4[3]));
  1913. }
  1914.  
  1915. if (command4[4].charAt(0) == '~') {
  1916. tpz1 = pz1 + Double.parseDouble(
  1917. command4[4].substring(1, (command4[4].length())));
  1918. } else if (command4[4].charAt(0) == 'x') {
  1919. tpz1 = -px1 + Double.parseDouble(
  1920. command4[4].substring(1, (command4[4].length())));
  1921. } else if (command4[4].charAt(0) == 'z') {
  1922. tpz1 = -pz1 + Double.parseDouble(
  1923. command4[4].substring(1, (command4[4].length())));
  1924. } else if (command4[4].charAt(0) == 'X') {
  1925. tpz1 = px1 + Double.parseDouble(
  1926. command4[4].substring(1, (command4[4].length())));
  1927. } else if (command4[4].charAt(0) == 's') {
  1928. tpz1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
  1929. .getObjective(
  1930. command4[4].substring(1, command4[4].length()))
  1931. .getScore(p2).getScore();
  1932. } else {
  1933. tpz1 = Double.parseDouble((command4[4]));
  1934. }
  1935.  
  1936. if (command4[5].charAt(0) == '~') {
  1937. tprx1 = prx1 + Double.parseDouble(
  1938. command4[5].substring(1, (command4[5].length())));
  1939. } else if (command4[5].charAt(0) == 'x') {
  1940. tprx1 = -prx1 + Double.parseDouble(
  1941. command4[5].substring(1, (command4[5].length())));
  1942. } else if (command4[5].charAt(0) == 'y') {
  1943. tprx1 = -pry1 + Double.parseDouble(
  1944. command4[5].substring(1, (command4[5].length())));
  1945. } else if (command4[5].charAt(0) == 'Y') {
  1946. tprx1 = pry1 + Double.parseDouble(
  1947. command4[5].substring(1, (command4[5].length())));
  1948. } else if (command4[5].charAt(0) == 's') {
  1949. tprx1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
  1950. .getObjective(
  1951. command4[5].substring(1, command4[5].length()))
  1952. .getScore(p2).getScore();
  1953. } else {
  1954. tprx1 = Double.parseDouble((command4[5]));
  1955. }
  1956.  
  1957. if (command4[6].charAt(0) == '~') {
  1958. tpry1 = pry1 + Double.parseDouble(
  1959. command4[6].substring(1, (command4[6].length())));
  1960. } else if (command4[6].charAt(0) == 'x') {
  1961. tpry1 = -prx1 + Double.parseDouble(
  1962. command4[6].substring(1, (command4[6].length())));
  1963. } else if (command4[6].charAt(0) == 'y') {
  1964. tpry1 = -pry1 + Double.parseDouble(
  1965. command4[6].substring(1, (command4[6].length())));
  1966. } else if (command4[6].charAt(0) == 'X') {
  1967. tpry1 = prx1 + Double.parseDouble(
  1968. command4[6].substring(1, (command4[6].length())));
  1969. } else if (command4[6].charAt(0) == 's') {
  1970. tpry1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
  1971. .getObjective(
  1972. command4[6].substring(1, command4[6].length()))
  1973. .getScore(p2).getScore();
  1974. } else {
  1975. tpry1 = Double.parseDouble((command4[6]));
  1976. }
  1977.  
  1978. if (command4[7].charAt(0) == '~') {
  1979. tpvx1 = pvx1 + Double.parseDouble(
  1980. command4[7].substring(1, (command4[7].length())));
  1981. } else if (command4[7].charAt(0) == 'x') {
  1982. tpvx1 = -pvx1 + Double.parseDouble(
  1983. command4[7].substring(1, (command4[7].length())));
  1984. } else if (command4[7].charAt(0) == 'z') {
  1985. tpvx1 = -pvz1 + Double.parseDouble(
  1986. command4[7].substring(1, (command4[7].length())));
  1987. } else if (command4[7].charAt(0) == 'Z') {
  1988. tpvx1 = pvz1 + Double.parseDouble(
  1989. command4[7].substring(1, (command4[7].length())));
  1990. } else if (command4[7].charAt(0) == 's') {
  1991. tpvx1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
  1992. .getObjective(
  1993. command4[7].substring(1, command4[7].length()))
  1994. .getScore(p2).getScore();
  1995. } else {
  1996. tpvx1 = Double.parseDouble((command4[7]));
  1997. }
  1998. /*
  1999. if (command4[8].charAt(0) == '~') {
  2000. tpvy1 = pvy1 + Double.parseDouble(
  2001. command4[8].substring(1, (command4[8].length())));
  2002. } else if (command4[8].charAt(0) == 's') {
  2003. tpvy1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
  2004. .getObjective(
  2005. command4[8].substring(1, command4[8].length()))
  2006. .getScore(p2).getScore();
  2007. } else {
  2008. tpvy1 = Double.parseDouble((command4[8]));
  2009. }*/
  2010.  
  2011. if (command4[9].charAt(0) == '~') {
  2012. tpvz1 = pvz1 + Double.parseDouble(
  2013. command4[9].substring(1, (command4[9].length())));
  2014. } else if (command4[9].charAt(0) == 'x') {
  2015. tpvz1 = -pvx1 + Double.parseDouble(
  2016. command4[9].substring(1, (command4[9].length())));
  2017. } else if (command4[9].charAt(0) == 'z') {
  2018. tpvz1 = -pvz1 + Double.parseDouble(
  2019. command4[9].substring(1, (command4[9].length())));
  2020. } else if (command4[9].charAt(0) == 'X') {
  2021. tpvz1 = pvx1 + Double.parseDouble(
  2022. command4[9].substring(1, (command4[9].length())));
  2023. } else if (command4[9].charAt(0) == 's') {
  2024. tpvz1 = (double) Bukkit.getScoreboardManager().getMainScoreboard()
  2025. .getObjective(
  2026. command4[9].substring(1, command4[9].length()))
  2027. .getScore(p2).getScore();
  2028. } else {
  2029. tpvz1 = Double.parseDouble((command4[9]));
  2030. }
  2031.  
  2032. vector1.setX(tpvx1);
  2033. vector1.setY(pvy1);
  2034. vector1.setZ(tpvz1);
  2035. location1.setWorld(p2.getWorld());
  2036. location1.setX(tpx1);
  2037. location1.setY(tpy1);
  2038. location1.setZ(tpz1);
  2039. location1.setPitch((float) tprx1);
  2040. location1.setYaw((float) tpry1);
  2041.  
  2042. p2.teleport(location1);
  2043. p2.setVelocity(vector1);
  2044.  
  2045. }
  2046.  
  2047. @EventHandler
  2048. public void ontk(PlayerTeleportEvent event) {
  2049. from1.put(event.getPlayer(), event.getFrom());
  2050. to1.put(event.getPlayer(), event.getTo());
  2051. final Player p71 = event.getPlayer();
  2052. if(!tem.get(p71))
  2053. {event.setCancelled(true);
  2054. double cx = 8*(event.getTo().getX()-event.getFrom().getX());
  2055. double cy = 8*(event.getTo().getY()-event.getFrom().getY());
  2056. double cz = 8*(event.getTo().getZ()-event.getFrom().getZ());
  2057. tem.put(p71, true);
  2058. p71.setVelocity(new Vector(cx, cy, cz));
  2059. Bukkit.getScheduler().runTaskLater(Main.getPlugin(Main.class), new Runnable() {
  2060. @Override
  2061. public void run() {
  2062. tem.put(p71, true);
  2063. p71.teleport(event.getTo());
  2064. }
  2065. }, 1);
  2066. tem.put(p71, false);
  2067. }
  2068. }
  2069.  
  2070. @EventHandler
  2071. public void onSneak(PlayerToggleSneakEvent event) {
  2072. Player p = event.getPlayer();
  2073. if (event.isSneaking()) {
  2074. statu.put(p.getName().toString(), 0);
  2075. }
  2076. }
  2077. @EventHandler
  2078. public void onar(EntityDamageByEntityEvent event) {
  2079. if(event.getDamager().getType().equals(EntityType.ARROW))
  2080. {
  2081. event.setDamage(ar1.get(event.getDamager()));
  2082. if(em)
  2083. {
  2084. Entity ee = event.getEntity();
  2085. ee.getWorld().createExplosion(ee.getLocation(),5);
  2086. }
  2087. }
  2088. }
  2089.  
  2090. @EventHandler
  2091. public void onar(PlayerChangedMainHandEvent event)
  2092. {
  2093. Player p = event.getPlayer();
  2094. if(p.getInventory().getItemInMainHand().getType().equals(Material.IRON_INGOT))
  2095. {
  2096. p.sendTitle("","AK-47");
  2097. cool.put(p, 10);
  2098. }
  2099. if(p.getInventory().getItemInMainHand().getType().equals(Material.GOLD_INGOT))
  2100. {
  2101. p.sendTitle("","TRG-21");
  2102. cool.put(p, 40);
  2103. }
  2104. if(p.getInventory().getItemInMainHand().getType().equals(Material.BRICK))
  2105. {
  2106. p.sendTitle("","p90");
  2107. cool.put(p, 3);
  2108. }
  2109. }
  2110.  
  2111. @EventHandler
  2112. public void onact(PlayerInteractEvent event) {
  2113. Player p = event.getPlayer();
  2114. Action a = event.getAction();
  2115. if (a.equals(Action.LEFT_CLICK_AIR)) {
  2116. ani.put(p.getName().toString(), 0);
  2117. }
  2118. if (a.equals(Action.RIGHT_CLICK_BLOCK)) {
  2119. if (event.getClickedBlock().getType().equals(Material.STONE_BUTTON)) {
  2120. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2121. String command = "scoreboard players set @a[name=" + p.getName().toString()
  2122. + ",score_yes_min=0] yes -3";
  2123. Bukkit.dispatchCommand(console, command);
  2124. }
  2125. if (event.getClickedBlock().getType().equals(Material.WOOD_BUTTON)) {
  2126. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2127. String command = "scoreboard players set @a[name=" + p.getName().toString() + ",score_no_min=0] no -3";
  2128. Bukkit.dispatchCommand(console, command);
  2129. }
  2130. if (event.getClickedBlock().getType().equals(Material.BLUE_GLAZED_TERRACOTTA)) {
  2131. if(p.getGameMode().equals(GameMode.ADVENTURE))
  2132. p.teleport(new Location(p.getWorld(),p.getLocation().getX(),event.getClickedBlock().getY()-2,p.getLocation().getZ(),p.getLocation().getYaw(),p.getLocation().getPitch()));
  2133. }
  2134. }
  2135. if (a.equals(Action.RIGHT_CLICK_AIR) || a.equals(Action.RIGHT_CLICK_BLOCK)) {
  2136.  
  2137. if (p.getItemInHand().getType().equals(Material.BRICK)) {
  2138. Arrow ar = p.launchProjectile(Arrow.class);
  2139. ar1.put(ar, 4);
  2140. ar.setKnockbackStrength(0);
  2141. ar.setShooter(p);
  2142. ar.setVelocity(p.getLocation().getDirection().multiply(10));
  2143. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2144. String command = "execute @a[name=" + p.getName().toString()
  2145. + "] ~ ~ ~ playsound minecraft:entity.irongolem.attack record @a";
  2146. Bukkit.dispatchCommand(console, command);
  2147. Earrow(p.getName().toString());
  2148. }
  2149.  
  2150. if (cool.get(p) == 0) {
  2151. if (p.getItemInHand().getType().equals(Material.IRON_INGOT)) {
  2152. cool.put(p, 10);
  2153. Arrow ar = p.launchProjectile(Arrow.class);
  2154. ar1.put(ar, 8);
  2155. ar.setKnockbackStrength(0);
  2156. ar.setShooter(p);
  2157. ar.setVelocity(p.getLocation().getDirection().multiply(10));
  2158. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2159. String command = "execute @a[name=" + p.getName().toString()
  2160. + "] ~ ~ ~ playsound minecraft:entity.blaze.hurt record @a";
  2161. Bukkit.dispatchCommand(console, command);
  2162. Earrow(p.getName().toString());
  2163. }
  2164.  
  2165. if (p.getItemInHand().getType().equals(Material.GOLD_INGOT)) {
  2166. cool.put(p, 40);
  2167. Arrow ar = p.launchProjectile(Arrow.class);
  2168. ar1.put(ar, 24);
  2169. ar.setKnockbackStrength(0);
  2170. ar.setShooter(p);
  2171. ar.setVelocity(p.getLocation().getDirection().multiply(10));
  2172. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2173. String command = "execute @a[name=" + p.getName().toString()
  2174. + "] ~ ~ ~ playsound minecraft:entity.enderdragon.hurt record @a";
  2175. Bukkit.dispatchCommand(console, command);
  2176. Earrow(p.getName().toString());
  2177. }
  2178. }
  2179. }
  2180.  
  2181. if (a.equals(Action.RIGHT_CLICK_AIR) || a.equals(Action.RIGHT_CLICK_BLOCK)) {
  2182. if (p.getItemInHand().getType().equals(Material.RAW_FISH)) {
  2183. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2184. String command = "execute @a[name=" + p.getName().toString()
  2185. + "] ~ ~ ~ playsound minecraft:entity.generic.eat record @a";
  2186. Bukkit.dispatchCommand(console, command);
  2187.  
  2188. Location l6 = p.getLocation();
  2189. org.bukkit.World wo = Bukkit.getWorlds().get(0);
  2190. Location locat = new Location(wo, l6.getX(), l6.getY() - 1, l6.getZ());
  2191. if (l6.getPitch()<=88) {
  2192. p.sendTitle("",ChatColor.DARK_GREEN+"[저장실패]"+ChatColor.RED+" 땅을 보고 저장해주세요.");
  2193. } else if (wo.getBlockAt(locat).getType() == Material.STAINED_GLASS) {
  2194. p.sendTitle("",ChatColor.RED+"땅이아닌곳에는 저장할수없어 멍청아");
  2195. } else if (wo.getBlockAt(locat).getType() == Material.LADDER) {
  2196. p.sendTitle("",ChatColor.RED+"땅이아닌곳에는 저장할수없어 멍청아");
  2197. } else if (wo.getBlockAt(locat).getType() == Material.AIR) {
  2198. p.sendTitle("",ChatColor.RED+"땅이아닌곳에는 저장할수없어 멍청아");
  2199. } else {
  2200. sloc.put(p.getName(),l6);
  2201. p.sendTitle("",ChatColor.DARK_BLUE+"Save!");
  2202. }
  2203. }
  2204. if (p.getItemInHand().getType().equals(Material.COOKED_FISH)) {
  2205. if(sloc.containsKey(p.getName())){
  2206. p.teleport(sloc.get(p.getName()));
  2207. p.sendTitle("",ChatColor.GRAY+"Load!");
  2208. } else {
  2209. p.sendTitle("",ChatColor.DARK_GREEN+"[로드실패]"+ChatColor.RED+" 저장된 지점이 없습니다.");
  2210. }
  2211.  
  2212. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2213. String command = "execute @a[name=" + p.getName().toString()
  2214. + "] ~ ~ ~ playsound minecraft:entity.player.burp record @a";
  2215. Bukkit.dispatchCommand(console, command);
  2216. }
  2217. }
  2218. }
  2219. @EventHandler
  2220. public void onj(PlayerJoinEvent event) {
  2221. String pnn = event.getPlayer().getName().toString();
  2222. po.put(pnn, event.getPlayer().getLocation());
  2223. cool.put(event.getPlayer(),0);
  2224. tem.put(event.getPlayer(), false);
  2225. for (String s5 : np.keySet()) {
  2226. Edestroy(s5);
  2227. }
  2228. zp.clear();
  2229. for (Entity e2 : Bukkit.getWorlds().get(0).getEntities()) {
  2230. if(e2.getType().equals(EntityType.ZOMBIE))
  2231. {
  2232. Zombie e0 = (Zombie) e2;
  2233. if(e0.getScoreboardTags().contains((Object) ("mon"))==false)
  2234. {
  2235. e0.setHealth(0);
  2236. }
  2237. }
  2238. }
  2239. }
  2240.  
  2241. @EventHandler
  2242. public void onq(PlayerQuitEvent event) {
  2243. Player p = event.getPlayer();
  2244. String pn = p.getName().toString();
  2245. po.remove(pn);
  2246. Location location = new Location(null, 0, 0, 0);
  2247. location.setWorld(Bukkit.getWorlds().get(0));
  2248. location.setX(p.getLocation().getX());
  2249. location.setY(p.getLocation().getY());
  2250. location.setZ(p.getLocation().getZ());
  2251. for (int i = 1; i <= 16; i++) {
  2252. Edestroy(pn + "" + i);
  2253. }
  2254. }
  2255.  
  2256. @EventHandler
  2257. public void ond(EntityDeathEvent event) {
  2258. if(event.getEntityType().equals(EntityType.WOLF)) {
  2259. Wolf w8 = (Wolf) event.getEntity();
  2260. if(wt.containsKey(w8)){wt.remove(w8);wd.remove(w8);}
  2261. for(String k2:wa.keySet()) {
  2262. if(k2.substring(0,36)==w8.getUniqueId().toString()) {
  2263. wa.put(k2, null);
  2264. }
  2265. }
  2266. for(String k2:wb.keySet()) {
  2267. if(k2.substring(0,36)==w8.getUniqueId().toString()) {
  2268. wb.put(k2, null);
  2269. }
  2270. }
  2271. for(String k2:wc.keySet()) {
  2272. if(k2.substring(0,36)==w8.getUniqueId().toString()) {
  2273. wc.put(k2, null);
  2274. }
  2275. }
  2276. }
  2277. for (Entity e7 : Bukkit.getWorlds().get(0).getEntities()) {
  2278. if (e7.getType().equals(EntityType.ZOMBIE)) {
  2279. Zombie e77 = (Zombie) e7;
  2280. if(e77.getScoreboardTags().contains((Object) ("mon"))==false)
  2281. {
  2282. zp.clear();
  2283. e77.setHealth(0);
  2284. } else {
  2285. zt.remove(e77);
  2286. zk.remove(e77);
  2287. }
  2288. }
  2289. }
  2290. }
  2291.  
  2292.  
  2293.  
  2294. @EventHandler
  2295. public void onzxc(PlayerMoveEvent event) {
  2296. from1.put(event.getPlayer(), event.getFrom());
  2297. to1.put(event.getPlayer(), event.getTo());
  2298. }
  2299. @EventHandler
  2300. public void ondam(EntityDamageEvent event) {
  2301. if(event.getEntityType().equals(EntityType.ZOMBIE)){
  2302. Zombie e77 = (Zombie) event.getEntity();
  2303. for (Object j : e77.getScoreboardTags().toArray()) {
  2304. String sj = (String) j;
  2305. if (sj.length() >= 3) {
  2306. if (((Object) sj.substring(0, 3)).equals((Object) ("tag"))) {
  2307. Bukkit.getEntity(UUID.fromString(sj.substring(3,sj.length()-1))).teleport(zp.get(sj.substring(3,sj.length())));
  2308. Zombie z = (Zombie) Bukkit.getEntity(UUID.fromString(sj.substring(3,sj.length()-1)));
  2309. z.setHealth(z.getHealth()-(1000-zp.get(sj.substring(3,sj.length())).getHealth()));
  2310. z.damage(0.01);
  2311. zp.get(sj.substring(3,sj.length())).setHealth(1000);
  2312. }
  2313. }
  2314. }
  2315. }
  2316. }
  2317. public void Espawn(String nam, Location loc , String n1) {
  2318. MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();
  2319. WorldServer nmsWorld = ((CraftWorld) Bukkit.getWorlds().get(0)).getHandle();
  2320. GameProfile gp = new GameProfile(UUID.fromString("6ab43178-89fd-4905-97f6-0f67d9d76fd9"), nam);
  2321. //GameProfile gp = new GameProfile(UUID.fromString(uu), nam.substring(0,nam.length()-36));
  2322. //String value = pgp.getProperties().get("texture").iterator().next().getValue();
  2323. //String signatur = pgp.getProperties().get("texture").iterator().next().getSignature();
  2324. //gp.getProperties().put("texture", new Property("textures", value, signatur));
  2325. np.put(nam, new EntityPlayer(nmsServer, nmsWorld, gp, new PlayerInteractManager(nmsWorld)));
  2326. np.get(nam).setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
  2327. //np.get(nam).displayName = n1;
  2328. for (Player p : Bukkit.getOnlinePlayers()) {
  2329. PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
  2330. connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, np.get(nam)));
  2331. connection.sendPacket(new PacketPlayOutNamedEntitySpawn(np.get(nam)));
  2332. connection.sendPacket(new PacketPlayOutSpawnEntityLiving(np.get(nam)));
  2333. }
  2334. Ehead(nam, loc.getYaw(), loc.getPitch());
  2335. }
  2336.  
  2337. public void Edestroy(String nam) {
  2338. if (np.containsKey(nam)) {
  2339. int idd = np.get(nam).getId();
  2340. for (Player p : Bukkit.getOnlinePlayers()) {
  2341. PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
  2342. connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, np.get(nam)));
  2343. connection.sendPacket(new PacketPlayOutEntityDestroy(idd));
  2344. }
  2345. np.remove(nam);
  2346. }
  2347. }
  2348.  
  2349. public void Eequip(String nam, EnumItemSlot e1, ItemStack i1) {
  2350. if (np.containsKey(nam)) {
  2351. for (Player p : Bukkit.getOnlinePlayers()) {
  2352. PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
  2353. connection.sendPacket(new PacketPlayOutEntityEquipment(np.get(nam).getId(), e1, i1));
  2354. }
  2355. }
  2356. }
  2357.  
  2358. public void Eteleport(String nam, Location loc) {
  2359. if (np.containsKey(nam)) {
  2360. np.get(nam).setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
  2361. for (Player p : Bukkit.getOnlinePlayers()) {
  2362. PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
  2363. connection.sendPacket(new PacketPlayOutEntityTeleport(np.get(nam)));
  2364. }
  2365. }
  2366. Ehead(nam, loc.getYaw(), loc.getPitch());
  2367. }
  2368.  
  2369. public void Eanimation(String nam, int i) {
  2370. if (np.containsKey(nam)) {
  2371. for (Player p : Bukkit.getOnlinePlayers()) {
  2372. PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
  2373. connection.sendPacket(new PacketPlayOutAnimation(np.get(nam), i));
  2374. }
  2375. }
  2376. }
  2377.  
  2378. /*public void Estatus(String nam, int i) {
  2379. if (np.containsKey(nam)) {
  2380. for (Player p : Bukkit.getOnlinePlayers()) {
  2381. PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
  2382. connection.sendPacket(new PacketPlayOutEntityStatus(np.get(nam), (byte) i));
  2383. }
  2384. }
  2385. }*/
  2386.  
  2387. public void Ehead(String nam, float yaw, float pitch) {
  2388. if (np.containsKey(nam)) {
  2389. for (Player p : Bukkit.getOnlinePlayers()) {
  2390. PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
  2391. connection.sendPacket(new PacketPlayOutEntityLook(np.get(nam).getId(), getFixRotation(yaw),
  2392. getFixRotation(pitch), true));
  2393. connection.sendPacket(new PacketPlayOutEntityHeadRotation(np.get(nam), getFixRotation(yaw)));
  2394. }
  2395. }
  2396. }
  2397.  
  2398. public void Earrow(String nam) {
  2399. for (int i = 1; i <= 16; i++) {
  2400. if (np.containsKey(nam + i)) {
  2401.  
  2402. Location lc = new Location(Bukkit.getWorlds().get(0), np.get(nam + i).locX, np.get(nam + i).locY + 1,
  2403. np.get(nam + i).locZ, np.get(nam + i).yaw, np.get(nam + i).pitch);
  2404. //Arrow ar = Bukkit.getWorlds().get(0).spawnArrow(lc.add(lc.getDirection().multiply(2)),
  2405. //lc.getDirection().multiply(10), lc.getYaw(), lc.getPitch());
  2406. Arrow ar = np.get(nam+i).getBukkitEntity().launchProjectile(Arrow.class);
  2407. //ar._INVALID_setShooter(Bukkit.getPlayer(nam));
  2408. ar.setVelocity(lc.getDirection().multiply(10));
  2409. ar.setKnockbackStrength(0);
  2410. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2411. String command = "playsound minecraft:entity.blaze.hurt record @a " + np.get(nam + i).locX + " "
  2412. + np.get(nam + i).locY + " " + np.get(nam + i).locZ;
  2413.  
  2414. Bukkit.dispatchCommand(console, command);
  2415. }
  2416. }
  2417. }
  2418.  
  2419. public void Zspawn(String nam, Location loc) {
  2420. Zombie z = (Zombie) Bukkit.getWorlds().get(0).spawnEntity(loc, EntityType.ZOMBIE);
  2421. z.setAI(false);
  2422. z.setMaxHealth(1000);
  2423. z.setHealth(1000);
  2424. zp.put(nam, z);
  2425. }
  2426.  
  2427. public void Zdestroy(String nam) {
  2428. zp.get(nam).remove();
  2429. zp.remove(nam);
  2430. }
  2431.  
  2432. public void Zteleport(String nam, Location loc) {
  2433. zp.get(nam).teleport(loc);
  2434. }
  2435.  
  2436. public void Zequip(String nam, EntityEquipment eee, Boolean isb , Object[] ta , String na) {
  2437. EntityEquipment ee = zp.get(nam).getEquipment();
  2438. ee.setArmorContents(eee.getArmorContents());
  2439. ee.setItemInMainHand(eee.getItemInMainHand());
  2440. ee.setItemInOffHand(eee.getItemInOffHand());
  2441. ee.setHelmetDropChance(0);
  2442. ee.setChestplateDropChance(0);
  2443. ee.setLeggingsDropChance(0);
  2444. ee.setBootsDropChance(0);
  2445. zp.get(nam).setBaby(isb);
  2446. zp.get(nam).setCustomName(na);
  2447. zp.get(nam).addScoreboardTag("tag"+nam);
  2448. for(Object j : ta)
  2449. {
  2450. Boolean goa = true;
  2451. if (((String) j).length() >= 1) {
  2452. if (((Object) ((String) j).substring(0, 1)).equals((Object) ("i"))) {
  2453. goa=false;
  2454. }
  2455. if (j.equals((Object) ("mon"))) {
  2456. goa=false;
  2457. }
  2458. }
  2459. if (goa==true) {
  2460. zp.get(nam).addScoreboardTag(j.toString());
  2461. }
  2462. }
  2463. }
  2464.  
  2465. public void Zarrow(String nam) {
  2466. for (int i = 1; i <= 16; i++) {
  2467. if (zp.containsKey(nam + i)) {
  2468. Location lc = zp.get(nam + i).getLocation();
  2469. //Arrow ar = Bukkit.getWorlds().get(0).spawnArrow(lc.add(lc.getDirection().multiply(2)),
  2470. //lc.getDirection().multiply(10), lc.getYaw(), lc.getPitch());
  2471. Arrow ar = zp.get(nam+i).launchProjectile(Arrow.class);
  2472. //sar._INVALID_setShooter(zp.get(nam+i));
  2473. ar.setVelocity(lc.getDirection().multiply(10));
  2474. ar.setKnockbackStrength(0);
  2475. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2476. String command = "playsound minecraft:entity.enderdragon.hurt record @a " + lc.getX() + " "
  2477. + lc.getY() + " " + lc.getZ();
  2478.  
  2479. Bukkit.dispatchCommand(console, command);
  2480. }
  2481. }
  2482. }
  2483.  
  2484. public byte getFixRotation(float yawpitch) {
  2485. return (byte) ((int) (yawpitch * 256.0F / 360.0F));
  2486. }
  2487.  
  2488. public void Respawn(final Player player, int Time) {
  2489. Bukkit.getScheduler().runTaskLater(Main.getPlugin(Main.class), new Runnable() {
  2490.  
  2491. @Override
  2492. public void run() {
  2493. ((CraftPlayer) player).getHandle().playerConnection
  2494. .a(new PacketPlayInClientCommand(EnumClientCommand.PERFORM_RESPAWN));
  2495. }
  2496. }, Time);
  2497. }
  2498.  
  2499. @EventHandler
  2500. public void onDeath(PlayerDeathEvent event) {
  2501. Player player = (Player) event.getEntity();
  2502. for (int i = 1; i <= 16; i++) {
  2503. Edestroy(player.getName().toString() + i);
  2504. }
  2505. String pn = event.getEntity().getName().toString();
  2506. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  2507. String command = "stopsound @a[name=" + pn + "]";
  2508. Bukkit.dispatchCommand(console, command);
  2509. command = "scoreboard players set @a[name=" + pn + "] sound -3";
  2510. Bukkit.dispatchCommand(console, command);
  2511. command = "scoreboard players set @a[name=" + pn + "] ilus -15";
  2512. Bukkit.dispatchCommand(console, command);
  2513. Respawn(player, 1);
  2514. }
  2515.  
  2516. public static Object getPrivateField(String fieldName, Class clazz, Object object)
  2517. {
  2518. Field field;
  2519. Object o = null;
  2520.  
  2521. try
  2522. {
  2523. field = clazz.getDeclaredField(fieldName);
  2524.  
  2525. field.setAccessible(true);
  2526.  
  2527. o = field.get(object);
  2528. }
  2529. catch(NoSuchFieldException e)
  2530. {
  2531. e.printStackTrace();
  2532. }
  2533. catch(IllegalAccessException e)
  2534. {
  2535. e.printStackTrace();
  2536. }
  2537.  
  2538. return o;
  2539. }
  2540.  
  2541. public void Dsit(String g0,String u0,Wolf w0,int t0)
  2542. {
  2543. wa.put(w0.getUniqueId().toString()+u0+"_"+1, t0);
  2544. }
  2545. public void Dsits(String g0,String u0,Wolf w0,int t0)
  2546. {
  2547. wa.put(w0.getUniqueId().toString()+u0+"_"+2, t0);
  2548. }
  2549. public void Dstand(String g0,String u0,Wolf w0,int t0)
  2550. {
  2551. wa.put(w0.getUniqueId().toString()+u0+"_"+3, t0);
  2552. }
  2553. public void Dma(String g0,String u0,Wolf w0,int t0)
  2554. {
  2555. wa.put(w0.getUniqueId().toString()+u0+"_"+4, t0);
  2556. }
  2557. public void Dmb(String g0,String u0,Wolf w0,int t0)
  2558. {
  2559. wa.put(w0.getUniqueId().toString()+u0+"_"+5, t0);
  2560. }
  2561. public void Dmc(String g0,String u0,Wolf w0,int t0)
  2562. {
  2563. wa.put(w0.getUniqueId().toString()+u0+"_"+6, t0);
  2564. }
  2565. public void Dmx(String g0,String u0,Wolf w0,int t0)
  2566. {
  2567. wa.put(w0.getUniqueId().toString()+u0+"_"+7, t0);
  2568. }
  2569. public void Dmy(String g0,String u0,Wolf w0,int t0)
  2570. {
  2571. wa.put(w0.getUniqueId().toString()+u0+"_"+8, t0);
  2572. }
  2573. public void Dmz(String g0,String u0,Wolf w0,int t0)
  2574. {
  2575. wa.put(w0.getUniqueId().toString()+u0+"_"+9, t0);
  2576. }
  2577. public void Dmm(String g0,String u0,Wolf w0,int t0)
  2578. {
  2579. wa.put(w0.getUniqueId().toString()+u0+"_"+10, t0);
  2580. }
  2581. public void Dfinda(String g0,String u0,Wolf w0,int t0)
  2582. {
  2583. wa.put(w0.getUniqueId().toString()+u0+"_"+11, t0);
  2584. }
  2585. public void Dfindb(String g0,String u0,Wolf w0,int t0)
  2586. {
  2587. wa.put(w0.getUniqueId().toString()+u0+"_"+12, t0);
  2588. }
  2589. public void Dlooka(String g0,String u0,Wolf w0,int t0)
  2590. {
  2591. wa.put(w0.getUniqueId().toString()+u0+"_"+13, t0);
  2592. }
  2593. public void Dlookb(String g0,String u0,Wolf w0,int t0)
  2594. {
  2595. wa.put(w0.getUniqueId().toString()+u0+"_"+14, t0);
  2596. }
  2597. public void Dsad(String g0,String u0,Wolf w0,int t0)
  2598. {
  2599. wa.put(w0.getUniqueId().toString()+u0+"_"+15, t0);
  2600. }
  2601. public void Dsads(String g0,String u0,Wolf w0,int t0,int b0)
  2602. {
  2603. wa.put(w0.getUniqueId().toString()+u0+"_"+16, t0);
  2604. wb.put(w0.getUniqueId().toString()+u0+"_"+16, b0);
  2605. }
  2606. public void Dshake(String g0,String u0,Wolf w0,int t0)
  2607. {
  2608. wa.put(w0.getUniqueId().toString()+u0+"_"+17, t0);
  2609. }
  2610. public void Dshakes(String g0,String u0,Wolf w0,int t0,int b0)
  2611. {
  2612. wa.put(w0.getUniqueId().toString()+u0+"_"+18, t0);
  2613. wb.put(w0.getUniqueId().toString()+u0+"_"+18, b0);
  2614. }
  2615. public void Djump(String g0,String u0,Wolf w0,int t0)
  2616. {
  2617. wa.put(w0.getUniqueId().toString()+u0+"_"+19, t0);
  2618. }
  2619. public void Djumps(String g0,String u0,Wolf w0,int t0,int b0)
  2620. {
  2621. wa.put(w0.getUniqueId().toString()+u0+"_"+20, t0);
  2622. wb.put(w0.getUniqueId().toString()+u0+"_"+20, b0);
  2623. }
  2624. public void Droll(String g0,String u0,Wolf w0,int t0)
  2625. {
  2626. wa.put(w0.getUniqueId().toString()+u0+"_"+21, t0);
  2627. }
  2628. public void Drolls(String g0,String u0,Wolf w0,int t0,int b0)
  2629. {
  2630. wa.put(w0.getUniqueId().toString()+u0+"_"+22, t0);
  2631. wb.put(w0.getUniqueId().toString()+u0+"_"+22, b0);
  2632. }
  2633. public void Dbomb(String g0,String u0,Wolf w0,int t0)
  2634. {
  2635. wa.put(w0.getUniqueId().toString()+u0+"_"+23, t0);
  2636. }
  2637. public void Dcome(String g0,String u0,Wolf w0,int t0)
  2638. {
  2639. wa.put(w0.getUniqueId().toString()+u0+"_"+24, t0);
  2640. }
  2641.  
  2642. public void wgol(EntityWolf ewol , int i)
  2643. {
  2644. wd.put((Wolf) ewol.getBukkitEntity(), i);
  2645. try {
  2646. Field bField = PathfinderGoalSelector.class.getDeclaredField("b");
  2647. bField.setAccessible(true);
  2648. Field cField = PathfinderGoalSelector.class.getDeclaredField("c");
  2649. cField.setAccessible(true);
  2650. bField.set(ewol.goalSelector, Sets.newLinkedHashSet());
  2651. bField.set(ewol.targetSelector, Sets.newLinkedHashSet());
  2652. cField.set(ewol.goalSelector, Sets.newLinkedHashSet());
  2653. cField.set(ewol.targetSelector, Sets.newLinkedHashSet());
  2654. //this code clears fields B, C. so right now the mob wont walk
  2655.  
  2656. } catch (Exception exc) {exc.printStackTrace();}
  2657.  
  2658. if(i<=10){
  2659. ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
  2660. ewol.goalSelector.a(2, ewol.getGoalSit());
  2661. ewol.goalSelector.a(4, new PathfinderGoalLeapAtTarget(ewol, 0.4F));
  2662. ewol.goalSelector.a(5, new PathfinderGoalMeleeAttack(ewol, 1.0D, true));
  2663. ewol.goalSelector.a(6, new PathfinderGoalFollowOwner(ewol, 1.0D, 10.0F, 2.0F));
  2664. ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
  2665. ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
  2666. ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
  2667. ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
  2668. ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
  2669. ewol.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(ewol));
  2670. ewol.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(ewol));
  2671. ewol.targetSelector.a(3, new PathfinderGoalHurtByTarget(ewol, true, new Class[0]));
  2672. ewol.targetSelector.a(8, new PathfinderGoalNearestAttackableTarget(ewol, EntityZombie.class, false));
  2673. return;
  2674. }
  2675. if(i<=20){
  2676. ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
  2677. ewol.goalSelector.a(2, ewol.getGoalSit());
  2678. ewol.goalSelector.a(4, new PathfinderGoalLeapAtTarget(ewol, 0.4F));
  2679. ewol.goalSelector.a(5, new PathfinderGoalMeleeAttack(ewol, 1.0D, true));
  2680. ewol.goalSelector.a(6, new PathfinderGoalFollowOwner(ewol, 1.0D, 10.0F, 2.0F));
  2681. ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
  2682. ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
  2683. ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
  2684. ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
  2685. ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
  2686. ewol.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(ewol));
  2687. ewol.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(ewol));
  2688. ewol.targetSelector.a(3, new PathfinderGoalHurtByTarget(ewol, true, new Class[0]));
  2689. return;}
  2690. if(i<=30){
  2691. ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
  2692. ewol.goalSelector.a(2, ewol.getGoalSit());
  2693. ewol.goalSelector.a(4, new PathfinderGoalLeapAtTarget(ewol, 0.4F));
  2694. ewol.goalSelector.a(5, new PathfinderGoalMeleeAttack(ewol, 1.0D, true));
  2695. ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
  2696. ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
  2697. ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
  2698. ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
  2699. ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
  2700. ewol.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(ewol));
  2701. ewol.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(ewol));
  2702. ewol.targetSelector.a(3, new PathfinderGoalHurtByTarget(ewol, true, new Class[0]));
  2703. ewol.targetSelector.a(8, new PathfinderGoalNearestAttackableTarget(ewol, EntityZombie.class, false));
  2704. return;}
  2705. if(i<=40){
  2706. ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
  2707. ewol.goalSelector.a(2, ewol.getGoalSit());
  2708. ewol.goalSelector.a(4, new PathfinderGoalLeapAtTarget(ewol, 0.4F));
  2709. ewol.goalSelector.a(5, new PathfinderGoalMeleeAttack(ewol, 1.0D, true));
  2710. ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
  2711. ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
  2712. ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
  2713. ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
  2714. ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
  2715. ewol.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(ewol));
  2716. ewol.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(ewol));
  2717. ewol.targetSelector.a(3, new PathfinderGoalHurtByTarget(ewol, true, new Class[0]));
  2718. return;}
  2719.  
  2720. ewol.goalSelector.a(1, new PathfinderGoalFloat(ewol));
  2721. ewol.goalSelector.a(2, ewol.getGoalSit());
  2722. ewol.goalSelector.a(7, new PathfinderGoalBreed(ewol, 1.0D));
  2723. ewol.goalSelector.a(8, new PathfinderGoalRandomStrollLand(ewol, 1.0D));
  2724. ewol.goalSelector.a(9, new PathfinderGoalBeg(ewol, 8.0F));
  2725. ewol.goalSelector.a(10, new PathfinderGoalLookAtPlayer(ewol, EntityHuman.class, 8.0F));
  2726. ewol.goalSelector.a(10, new PathfinderGoalRandomLookaround(ewol));
  2727. return;
  2728. }
  2729. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement