This commit is contained in:
Chiss 2014-04-11 10:33:56 +10:00
parent a26894fda6
commit 2adf0395a1
8 changed files with 23 additions and 15 deletions

View File

@ -8,6 +8,8 @@ import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@ -385,6 +387,14 @@ public class UtilPlayer
return name;
}
public static boolean isChargingBow(Player player)
{
if (!UtilGear.isMat(player.getItemInHand(), Material.BOW))
return false;
return (((CraftEntity)player).getHandle().getDataWatcher().getByte(0) & 1 << 4) != 0;
}
/*

View File

@ -10,6 +10,7 @@ import mineplex.core.MiniPlugin;
import mineplex.core.antihack.types.*;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
@ -70,8 +71,8 @@ public class AntiHack extends MiniPlugin
Punish = punish;
Portal = portal;
_repository = new AntiHackRepository(plugin.getConfig().getString("serverstatus.name"));
_repository.initialize();
//_repository = new AntiHackRepository(plugin.getConfig().getString("serverstatus.name"));
//_repository.initialize();
_detectors = new ArrayList<Detector>();
@ -198,8 +199,8 @@ public class AntiHack extends MiniPlugin
_suspicion.get(player).get(type).add(System.currentTimeMillis());
for (Player admin : UtilServer.getPlayers())
if (admin.isOp() && admin.getGameMode() == GameMode.CREATIVE)
UtilPlayer.message(admin, C.cGold + C.Bold + player.getName() + " suspected for " + type + ".");
if (admin.isOp() && UtilGear.isMat(admin.getItemInHand(), Material.PAPER))
UtilPlayer.message(admin, C.cRed + C.Bold + player.getName() + " suspected for " + type + ".");
// Print (Debug)
System.out.println("[Offense] " + player.getName() + " received suspicion for " + type + ".");

View File

@ -48,7 +48,7 @@ public class Fly extends MiniPlugin implements Detector
}
updateHover(player);
updateRise(player);
//updateRise(player);
updateMomentum(player, event);
}

View File

@ -6,6 +6,7 @@ import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -95,8 +96,11 @@ public abstract class SkillChargeBow extends SkillCharge implements Listener
}
// Client sends a packet when you stop charging a bow and sets this datawatcher value.
if ((((CraftEntity)cur).getHandle().getDataWatcher().getByte(0) & 1 << 4) == 0)
if (!UtilPlayer.isChargingBow(cur))
{
_charge.remove(cur);
continue;
}
//Flags
if (!_canChargeInAir && !UtilEnt.isGrounded(cur))

View File

@ -7,7 +7,6 @@ public interface IItem
Material GetType();
int GetAmount();
int GetGemCost();
boolean IsFree();
int GetSalesPackageId();
String GetName();
String[] GetDesc();

View File

@ -77,12 +77,6 @@ public class Item implements IItem, Listener
event.SetCancelled("Item Damage Cancel");
}
@Override
public boolean IsFree()
{
return _free;
}
public void Update(ItemToken itemToken)
{
_salesPackageId = itemToken.SalesPackage.GameSalesPackageId;

View File

@ -39,7 +39,7 @@ import mineplex.minecraft.game.core.damage.DamageManager;
import nautilus.game.arcade.game.GameServerConfig;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

View File

@ -95,7 +95,7 @@ public class Dominate extends TeamGame
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
}
@Override
@Override
public void ParseData()
{
for (String pointName : WorldData.GetAllCustomLocs().keySet())