修复了重复点击事件的bug~
This commit is contained in:
@@ -24,7 +24,7 @@ public class PluginMain extends JavaPlugin implements Listener {
|
||||
/**
|
||||
* 调试模式
|
||||
*/
|
||||
public static final boolean DEBUG = true;
|
||||
public static final boolean DEBUG = false;
|
||||
/**
|
||||
* 日志类 - 仅在初始化后调用
|
||||
*/
|
||||
|
||||
@@ -27,13 +27,22 @@ public class EventListener implements Listener {
|
||||
return;
|
||||
}
|
||||
Player player = event.getPlayer();
|
||||
if (player.getInventory().getItemInMainHand().getType() != Material.GLOWSTONE_DUST) {
|
||||
if (event.getItem() == null ) {
|
||||
return;
|
||||
}
|
||||
if (event.getItem().getType() != Material.GLOWSTONE_DUST) {
|
||||
return;
|
||||
}
|
||||
if (event.getClickedBlock() != null && event.getClickedBlock().getType() != Material.REDSTONE_WIRE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// PluginMain.LOGGER.info(event.getEventName()
|
||||
// + " " + event.getInteractionPoint()
|
||||
// + " " + event.getItem()
|
||||
// + " " + event.getClickedBlock()
|
||||
// + " " + event.getAction());
|
||||
|
||||
Location location = event.getClickedBlock().getLocation();
|
||||
String structid = PluginMain.structureManager.match(location);
|
||||
if (structid == null) {
|
||||
|
||||
Reference in New Issue
Block a user