fix dupe bug and safelog

This commit is contained in:
NewGarbo 2016-01-23 13:40:49 +00:00
parent bf6f1a1701
commit 1f7e1fb6cf
4 changed files with 41 additions and 32 deletions

View File

@ -11,6 +11,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilFile;
import mineplex.core.common.util.UtilFile.ChunkType;
@ -105,6 +106,9 @@ public class SafeLog extends MiniPlugin
public void onPlayerKicked(PlayerKickEvent event)
{
if (event.isCancelled()) return;
if (event.getPlayer().getItemInHand() != null && event.getPlayer().getItemInHand().getItemMeta() != null && (C.cGold + "Wind Blade").equals(event.getPlayer().getItemInHand().getItemMeta().getDisplayName()))
if (event.getReason().contains("flying is not enabled"))
return;
event.setLeaveMessage(F.sys("Quit", event.getPlayer().getName()));

View File

@ -72,15 +72,10 @@ public class NPCManager extends MiniPlugin
{
if (!hasLogoutNpc(player))
{
runSyncLater(() -> {
if (!player.isOnline())
{
CombatLogNPC npc = new CombatLogNPC(player, _clansManager.getDisguiseManager(), _hologramManager, player.getGameMode().equals(GameMode.CREATIVE), _clansManager.UserDataDir);
npc.spawn();
_logoutNpcs.add(npc);
log(String.format("Spawned combat log NPC for %s!", player.getName()));
}
}, 10L);
CombatLogNPC npc = new CombatLogNPC(player, _clansManager.getDisguiseManager(), _hologramManager, player.getGameMode().equals(GameMode.CREATIVE), _clansManager.UserDataDir);
npc.spawn();
_logoutNpcs.add(npc);
log(String.format("Spawned combat log NPC for %s!", player.getName()));
}
}

View File

@ -5,11 +5,9 @@ import mineplex.game.clans.items.attributes.ItemAttribute;
import mineplex.game.clans.items.generation.ValueDistribution;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import org.bukkit.entity.Entity;
public class InverseAttribute extends ItemAttribute
{
private static ValueDistribution knockbackGen = generateDistribution(-0.5d, 1.0d);
private static ValueDistribution knockbackGen = generateDistribution(0.d, 1.d);
private double _knockbackModifier;
@ -29,7 +27,7 @@ private static ValueDistribution knockbackGen = generateDistribution(-0.5d, 1.0d
@Override
public String getDescription()
{
return String.format("Reverse knockback and modify amount to %.2f percent", (1.0d + _knockbackModifier) * 100d);
return String.format("Reverse knockback and modify amount to %.2f percent", (.5d + _knockbackModifier) * 100d);
}
@Override

View File

@ -1,33 +1,33 @@
package mineplex.minecraft.game.classcombat.Skill.Assassin;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
public class Recall extends Skill
{
private HashMap<Player, LinkedList<Location>> _locMap = new HashMap<Player, LinkedList<Location>>();
@ -111,7 +111,19 @@ public class Recall extends Skill
current = current.add(UtilAlg.getTrajectory(current, target).multiply(0.1));
}
}
@EventHandler
public void closeInv(InventoryCloseEvent event)
{
if (getLevel(event.getPlayer()) == 0)
{
return;
}
event.getPlayer().getInventory().addItem(event.getPlayer().getItemOnCursor());
event.getPlayer().setItemOnCursor(null);
}
@EventHandler
public void storeLocation(UpdateEvent event)
{