mirror of
https://github.com/kaboomserver/weapons.git
synced 2025-08-03 11:25:48 +00:00
Handle invalid translations
This commit is contained in:
parent
33f6f3cb28
commit
2738bc3647
1 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,12 @@ public final class PlayerUseWeapon implements Listener {
|
||||||
&& event.getItem().getItemMeta().hasDisplayName()) {
|
&& event.getItem().getItemMeta().hasDisplayName()) {
|
||||||
final Action action = event.getAction();
|
final Action action = event.getAction();
|
||||||
final Material item = event.getMaterial();
|
final Material item = event.getMaterial();
|
||||||
final String name = event.getItem().getItemMeta().getDisplayName();
|
String name = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
name = event.getItem().getItemMeta().getDisplayName();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
if (action == Action.LEFT_CLICK_AIR
|
if (action == Action.LEFT_CLICK_AIR
|
||||||
|| action == Action.LEFT_CLICK_BLOCK) {
|
|| action == Action.LEFT_CLICK_BLOCK) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue