mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 14:38:47 +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
+18
-3
No files matched your search
@@ -545,10 +545,17 @@ public class Backend
|
||||
// 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());
|
||||
boolean solid = false;
|
||||
if(head.getTypeId() != 0)
|
||||
{
|
||||
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(head.getRelative(BlockFace.SOUTH).getTypeId() != 0)
|
||||
|
||||
@@ -171,7 +171,11 @@ public class UserManager
|
||||
else if (result.equalsIgnoreCase("KICK"))
|
||||
{
|
||||
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"))
|
||||
{
|
||||
@@ -185,7 +189,11 @@ public class UserManager
|
||||
{
|
||||
user.getPlayer().setBanned(true);
|
||||
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]
|
||||
startup: postworld
|
||||
url: http://gravitydevelopment.net
|
||||
version: ${project.version}
|
||||
version: ${project.version}-{build.number}-DEV
|
||||
commands:
|
||||
anticheat:
|
||||
description: Control and view info about AntiCheat
|
||||
|
||||
Reference in new issue
Block a user