diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index d645efa..378144a 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/Boss/MegaWither.java b/src/sig/plugin/TwosideKeeper/Boss/MegaWither.java index d621b10..9aef167 100644 --- a/src/sig/plugin/TwosideKeeper/Boss/MegaWither.java +++ b/src/sig/plugin/TwosideKeeper/Boss/MegaWither.java @@ -38,7 +38,11 @@ public class MegaWither extends EliteMonster{ private void randomlyDropDown() { if (last_dropdowntime+DROPDOWN_COOLDOWNTwosideKeeper.getServerTickTime()) { + m.setVelocity(m.getVelocity().setY(-20f)); + //m.teleport(m.getLocation().add(0,-5,0)); } } diff --git a/src/sig/plugin/TwosideKeeper/BossMonster.java b/src/sig/plugin/TwosideKeeper/BossMonster.java new file mode 100644 index 0000000..601542f --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/BossMonster.java @@ -0,0 +1,167 @@ +package sig.plugin.TwosideKeeper; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.boss.BarColor; +import org.bukkit.boss.BarFlag; +import org.bukkit.boss.BarStyle; +import org.bukkit.boss.BossBar; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Monster; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; + +import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; + +public class BossMonster { + private String name; + private double maxhp; + private double hp_regen; + private double damagereduction; + private double attackstrength; + private double movespd; + private LivingEntity m; + private Collection buffs; + protected BossBar bar = null; + protected List targetlist = new ArrayList(); + protected List participantlist = new ArrayList(); + protected HashMap dpslist = new HashMap(); + protected String arrow = "->"; + int scroll=0; + + public BossMonster(String name, double maxhp, double attackstrength, LivingEntity m) { + super(); + this.name = name; + this.maxhp = maxhp; + this.attackstrength = attackstrength; + this.m = m; + this.damagereduction=0.0; + this.buffs=null; + this.movespd=LivingEntityStructure.getLivingEntityStructure(m).original_movespd; + this.hp_regen=0; + this.bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SOLID, BarFlag.CREATE_FOG); + } + + public BossMonster(String name, double maxhp, double damagereduction, double attackstrength, LivingEntity m) { + super(); + this.name = name; + this.maxhp = maxhp; + this.damagereduction = damagereduction; + this.attackstrength = attackstrength; + this.m = m; + this.buffs=null; + this.movespd=LivingEntityStructure.getLivingEntityStructure(m).original_movespd; + this.hp_regen=0; + this.bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SOLID, BarFlag.CREATE_FOG); + } + + public BossMonster(String name, double maxhp, double damagereduction, double attackstrength, LivingEntity m, + Collection buffs) { + super(); + this.name = name; + this.maxhp = maxhp; + this.damagereduction = damagereduction; + this.attackstrength = attackstrength; + this.m = m; + this.buffs = buffs; + this.movespd=LivingEntityStructure.getLivingEntityStructure(m).original_movespd; + this.hp_regen=0; + this.bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SOLID, BarFlag.CREATE_FOG); + } + + public BossMonster(String name, double maxhp, double damagereduction, double attackstrength, double movespd, + LivingEntity m, Collection buffs) { + super(); + this.name = name; + this.maxhp = maxhp; + this.damagereduction = damagereduction; + this.attackstrength = attackstrength; + this.movespd = movespd; + this.m = m; + this.buffs = buffs; + this.hp_regen=0; + this.bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SOLID, BarFlag.CREATE_FOG); + } + + public BossMonster(String name, double maxhp, double hp_regen, double damagereduction, double attackstrength, + double movespd, LivingEntity m, Collection buffs) { + super(); + this.name = name; + this.maxhp = maxhp; + this.hp_regen = hp_regen; + this.damagereduction = damagereduction; + this.attackstrength = attackstrength; + this.movespd = movespd; + this.m = m; + this.buffs = buffs; + this.bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SOLID, BarFlag.CREATE_FOG); + } + public double getMaxhp() { + return maxhp; + } + public double getHp_regen() { + return hp_regen; + } + public double getDamagereduction() { + return damagereduction; + } + public double getAttackstrength() { + return attackstrength; + } + public double getMovespd() { + return movespd; + } + public LivingEntity getM() { + return m; + } + public Collection getBuffs() { + return buffs; + } + public String getName() { + return name; + } + + public void runTick() { + increaseBarTextScroll(); + createBossHealthbar(); + } + + protected void increaseBarTextScroll() { + scroll++; + switch (scroll%22) { + case 11:{ + arrow=" -"; + }break; + case 12:{ + arrow=" "; + }break; + case 13:{ + arrow="> "; + }break; + case 14:{ + arrow="->"; + }break; + } + } + + protected void createBossHealthbar() { + List currentplayers = bar.getPlayers(); + for (int i=0;i hitlist = new HashMap(); public HashMap glowcolorlist = new HashMap(); public long lastSpiderBallThrow = 0; + public BossMonster bm = null; public LivingEntityStructure(LivingEntity m) { target=null; @@ -35,6 +36,13 @@ public class LivingEntityStructure { this.m=m; this.original_movespd = m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue(); } + public LivingEntityStructure(LivingEntity m, LivingEntity target, BossMonster bm) { + this.target=target; + original_name=bm.getName(); + this.m=m; + this.bm=bm; + this.original_movespd = m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue(); + } public LivingEntity GetTarget() { if (this.target!=null && diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 9e03d43..19a3523 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -899,23 +899,33 @@ public class TwosideKeeper extends JavaPlugin implements Listener { ((org.bukkit.craftbukkit.v1_9_R1.entity.CraftLivingEntity)p).getHandle().setAbsorptionHearts(Float.valueOf(args[0])); }*/ if (args.length>0) { - ItemStack quiver = p.getInventory().getExtraContents()[0]; + switch (args[0]) { case "ADD":{ + ItemStack quiver = p.getInventory().getExtraContents()[0]; ArrowQuiver.addContents(ArrowQuiver.getID(quiver), p.getInventory().getItemInMainHand()); + ArrowQuiver.updateQuiverLore(quiver); }break; case "REMOVE":{ + ItemStack quiver = p.getInventory().getExtraContents()[0]; ArrowQuiver.removeContents(ArrowQuiver.getID(quiver), p.getInventory().getItemInMainHand()); + ArrowQuiver.updateQuiverLore(quiver); }break; case "GET":{ + ItemStack quiver = p.getInventory().getExtraContents()[0]; p.sendMessage("Quiver Mode: "+ArrowQuiver.getArrowQuiverMode(quiver)); + ArrowQuiver.updateQuiverLore(quiver); }break; case "SET":{ + ItemStack quiver = p.getInventory().getExtraContents()[0]; p.sendMessage("Quiver Mode: "+ArrowQuiver.setArrowQuiverMode(quiver, Integer.parseInt(args[1]))); p.sendMessage("Updated Quiver Mode: "+ArrowQuiver.getArrowQuiverMode(quiver)); + ArrowQuiver.updateQuiverLore(quiver); + }break; + case "WITHER":{ + Monster m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.WITHER), MonsterDifficulty.ELITE); }break; } - ArrowQuiver.updateQuiverLore(quiver); } /* StackTraceElement[] stacktrace = new Throwable().getStackTrace();