mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-29 17:58:25 +00:00
Don't throw NPE on broken sign state, just allow block to break.
This commit is contained in:
parent
a738e49e3c
commit
d76fe946b7
1 changed files with 10 additions and 4 deletions
|
@ -19,7 +19,6 @@ public class EssentialsSign
|
||||||
{
|
{
|
||||||
private static final Set<Material> EMPTY_SET = new HashSet<Material>();
|
private static final Set<Material> EMPTY_SET = new HashSet<Material>();
|
||||||
protected static final BigDecimal MINTRANSACTION = new BigDecimal("0.01");
|
protected static final BigDecimal MINTRANSACTION = new BigDecimal("0.01");
|
||||||
|
|
||||||
protected transient final String signName;
|
protected transient final String signName;
|
||||||
|
|
||||||
public EssentialsSign(final String signName)
|
public EssentialsSign(final String signName)
|
||||||
|
@ -231,6 +230,8 @@ public class EssentialsSign
|
||||||
{
|
{
|
||||||
final Block signblock = block.getRelative(blockFace);
|
final Block signblock = block.getRelative(blockFace);
|
||||||
if (signblock.getType() == Material.WALL_SIGN)
|
if (signblock.getType() == Material.WALL_SIGN)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
final org.bukkit.material.Sign signMat = (org.bukkit.material.Sign)signblock.getState().getData();
|
final org.bukkit.material.Sign signMat = (org.bukkit.material.Sign)signblock.getState().getData();
|
||||||
if (signMat != null && signMat.getFacing() == blockFace && isValidSign(new BlockSign(signblock)))
|
if (signMat != null && signMat.getFacing() == blockFace && isValidSign(new BlockSign(signblock)))
|
||||||
|
@ -238,6 +239,11 @@ public class EssentialsSign
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (NullPointerException ex)
|
||||||
|
{
|
||||||
|
// Sometimes signs enter a state of being semi broken, having no text or state data, usually while burning.
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue