mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Catch instance where enderman's head is in a block, also handle having no ban broadcast string gracefully
This commit is contained in:
1 parent
308062aebb
commit
8f47edd61e
3 files changed
+20
-5
No files matched your search
@@ -545,9 +545,16 @@ public class Backend
|
|||||||
// Check to make sure the entity's head is not surrounded
|
// Check to make sure the entity's head is not surrounded
|
||||||
Block head = entity.getWorld().getBlockAt((int)entity.getLocation().getX(), (int)((CraftEntity)entity).getHandle().getHeadHeight(), (int)entity.getLocation().getZ());
|
Block head = entity.getWorld().getBlockAt((int)entity.getLocation().getX(), (int)((CraftEntity)entity).getHandle().getHeadHeight(), (int)entity.getLocation().getZ());
|
||||||
boolean solid = false;
|
boolean solid = false;
|
||||||
if(head.getRelative(BlockFace.NORTH).getTypeId() != 0)
|
if(head.getTypeId() != 0)
|
||||||
{
|
{
|
||||||
solid = net.minecraft.server.Block.byId[head.getRelative(BlockFace.NORTH).getTypeId()].material.isSolid();
|
solid = net.minecraft.server.Block.byId[head.getTypeId()].material.isSolid();
|
||||||
|
}
|
||||||
|
if(!solid)
|
||||||
|
{
|
||||||
|
if(head.getRelative(BlockFace.NORTH).getTypeId() != 0)
|
||||||
|
{
|
||||||
|
solid = net.minecraft.server.Block.byId[head.getRelative(BlockFace.NORTH).getTypeId()].material.isSolid();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!solid)
|
if(!solid)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -171,7 +171,11 @@ public class UserManager
|
|||||||
else if (result.equalsIgnoreCase("KICK"))
|
else if (result.equalsIgnoreCase("KICK"))
|
||||||
{
|
{
|
||||||
user.getPlayer().kickPlayer(RED + lang.getKickReason());
|
user.getPlayer().kickPlayer(RED + lang.getKickReason());
|
||||||
Bukkit.broadcastMessage(RED + lang.getKickBroadcast().replaceAll("&player", name));
|
String msg = RED + lang.getKickBroadcast().replaceAll("&player", name);
|
||||||
|
if(!msg.equals(""))
|
||||||
|
{
|
||||||
|
Bukkit.broadcastMessage(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (result.equalsIgnoreCase("WARN"))
|
else if (result.equalsIgnoreCase("WARN"))
|
||||||
{
|
{
|
||||||
@@ -185,7 +189,11 @@ public class UserManager
|
|||||||
{
|
{
|
||||||
user.getPlayer().setBanned(true);
|
user.getPlayer().setBanned(true);
|
||||||
user.getPlayer().kickPlayer(RED + lang.getBanReason());
|
user.getPlayer().kickPlayer(RED + lang.getBanReason());
|
||||||
user.getPlayer().getServer().broadcastMessage(RED + lang.getBanBroadcast().replaceAll("&player", name));
|
String msg = RED + lang.getBanBroadcast().replaceAll("&player", name);
|
||||||
|
if(!msg.equals(""))
|
||||||
|
{
|
||||||
|
Bukkit.broadcastMessage(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ name: AntiCheat
|
|||||||
softdepend: [AntiCheat]
|
softdepend: [AntiCheat]
|
||||||
startup: postworld
|
startup: postworld
|
||||||
url: http://gravitydevelopment.net
|
url: http://gravitydevelopment.net
|
||||||
version: ${project.version}
|
version: ${project.version}-{build.number}-DEV
|
||||||
commands:
|
commands:
|
||||||
anticheat:
|
anticheat:
|
||||||
description: Control and view info about AntiCheat
|
description: Control and view info about AntiCheat
|
||||||
|
|||||||
Reference in new issue
Block a user