Merge pull request #264 from Vazkii/patch-2
Better fake player checking.
This commit is contained in:
commit
660c1f66bd
1 changed files with 2 additions and 17 deletions
|
@ -313,25 +313,10 @@ public class SpellHelper
|
||||||
return isFakePlayer(player);
|
return isFakePlayer(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Pattern FAKE_PLAYER_PATTERN = Pattern.compile("^(?:\\[.*\\])|(?:ComputerCraft)$");
|
||||||
public static boolean isFakePlayer(EntityPlayer player)
|
public static boolean isFakePlayer(EntityPlayer player)
|
||||||
{
|
{
|
||||||
if (player instanceof FakePlayer || SpellHelper.getUsername(player).equals("[CoFH]") || SpellHelper.getUsername(player).startsWith("[Thaumcraft"))
|
return player instanceof FakePlayer || FAKE_PLAYER_PATTERN.matcher(SpellHelper.getUsername(player)).matches();
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
String str = player.getClass().getSimpleName();
|
|
||||||
if (str.contains("GC"))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.getClass().equals(EntityPlayerMP.class))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void smashBlock(World world, int posX, int posY, int posZ)
|
public static void smashBlock(World world, int posX, int posY, int posZ)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue