Quick fixes.

This commit is contained in:
sigonasr2 2016-08-12 22:52:30 -05:00
parent 041f24076b
commit 39e7e2c53f
3 changed files with 22 additions and 15 deletions

Binary file not shown.

View File

@ -149,9 +149,8 @@ public class EliteMonster {
}
private void retargetInAir() {
if (Math.random()<=0.2) {
Player p = ChooseRandomTarget();
if (p!=null) {
if (Math.random()<=0.2 && !p.isOnGround()) {
//p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31));
p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,20*5,-1));
p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7));
@ -164,7 +163,6 @@ public class EliteMonster {
p.playSound(p.getLocation(), Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f);
}
}
}
private void weakenTeam() {
if (last_burstcheck_time+BURST_TIME<=TwosideKeeper.getServerTickTime()) {

View File

@ -128,6 +128,7 @@ import org.bukkit.event.player.PlayerItemBreakEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerPickupArrowEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
@ -3304,6 +3305,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
public void onPlayerKick(PlayerKickEvent ev) {
if (DeathManager.deathStructureExists(ev.getPlayer())) {
DeathManager.removeDeathStructure(ev.getPlayer());
}
}
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
public void onInventoryClick(InventoryClickEvent ev) {
final Player player = (Player)ev.getWhoClicked();
@ -3324,7 +3332,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
//player.getInventory().addItem(ev.getCurrentItem());
if (ev.getCurrentItem()!=null &&
ev.getCurrentItem().getType()!=Material.AIR) {
player.getLocation().getWorld().dropItemNaturally(player.getLocation(), ev.getCurrentItem()).setPickupDelay(0);
//player.getLocation().getWorld().dropItemNaturally(player.getLocation(), ev.getCurrentItem()).setPickupDelay(0);
GenericFunctions.giveItem(player, ev.getCurrentItem());
ev.setCurrentItem(new ItemStack(Material.AIR));
final DecimalFormat df = new DecimalFormat("0.00");