{
TileEntity tileentity = worldserver.getTileEntity(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e());
if (tileentity instanceof TileEntitySign)
{
TileEntitySign tileentitysign = (TileEntitySign)tileentity;
if (!tileentitysign.func_145914_a() || tileentitysign.func_145911_b() != net.playerEntity)
{
net.serverController.logWarning("Player " + net.playerEntity.getCommandSenderName() + " just tried to change non-editable sign");
return;
}
}
int i;
int j;
for (j = 0; j < 4; ++j)
{
boolean flag = true;
if (p_147343_1_.func_149589_f()[j].length() > 15)
{
flag = false;
}
else
{
for (i = 0; i < p_147343_1_.func_149589_f()[j].length(); ++i)
{
if (!ChatAllowedCharacters.isAllowedCharacter(p_147343_1_.func_149589_f()[j].charAt(i)))
{
flag = false;
}
}
}
if (!flag)
{
p_147343_1_.func_149589_f()[j] = "!?";
}
}
if (tileentity instanceof TileEntitySign)
{
j = p_147343_1_.func_149588_c();
int k = p_147343_1_.func_149586_d();
i = p_147343_1_.func_149585_e();
TileEntitySign tileentitysign1 = (TileEntitySign)tileentity;
System.arraycopy(Preconditions.checkNotNull(onSignEditEvent(net, p_147343_1_)), 0, tileentitysign1.signText, 0, 4);
tileentitysign1.markDirty();
worldserver.markBlockForUpdate(j, k, i);
}
}
}