修复了重复点击事件的bug~
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
|
||||
9
TODO.md
9
TODO.md
@@ -1,5 +1,6 @@
|
||||
TODO List:
|
||||
- 修复已知bug(noclear不生效,萤石不足的提示会出现两次)
|
||||
- 优化(匹配结构的方式)
|
||||
- 为action的执行添加参数(ActionParam)
|
||||
- 增加更多好看的东西(好不好玩另说awa)
|
||||
- [x] 修复已知bug(noclear不生效,萤石不足的提示会出现两次)
|
||||
- [ ] 优化(匹配结构的方式)
|
||||
- [ ] 为action的执行添加参数(ActionParam)
|
||||
- [ ] 增加更多好看的东西(好不好玩另说awa)
|
||||
- [ ] 法术吟唱!
|
||||
@@ -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