Workaround for buggy items
This commit is contained in:
parent
2738bc3647
commit
99c92fae5c
4
pom.xml
4
pom.xml
|
@ -5,8 +5,8 @@
|
|||
<version>master</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.5</maven.compiler.source>
|
||||
<maven.compiler.target>1.5</maven.compiler.target>
|
||||
<maven.compiler.source>1.6</maven.compiler.source>
|
||||
<maven.compiler.target>1.6</maven.compiler.target>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
|
|
@ -20,17 +20,18 @@ import pw.kaboom.weapons.modules.weapons.WeaponSniper;
|
|||
public final class PlayerUseWeapon implements Listener {
|
||||
@EventHandler
|
||||
void onPlayerInteract(final PlayerInteractEvent event) {
|
||||
if (event.hasItem()
|
||||
&& event.getItem().getItemMeta().hasDisplayName()) {
|
||||
final Action action = event.getAction();
|
||||
final Material item = event.getMaterial();
|
||||
if (event.hasItem()) {
|
||||
String name = "";
|
||||
|
||||
try {
|
||||
name = event.getItem().getItemMeta().getDisplayName();
|
||||
} catch (Exception ignored) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Action action = event.getAction();
|
||||
final Material item = event.getMaterial();
|
||||
|
||||
if (action == Action.LEFT_CLICK_AIR
|
||||
|| action == Action.LEFT_CLICK_BLOCK) {
|
||||
WeaponAnvilDropper.leftClick(item, name, event);
|
||||
|
|
Loading…
Reference in New Issue