修复了重复点击事件的bug~

This commit is contained in:
2026-02-17 13:50:42 +08:00
parent 3b9ffb8a95
commit 81be418af6
4 changed files with 17 additions and 6 deletions

1
.idea/gradle.xml generated
View File

@@ -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>

View File

@@ -1,5 +1,6 @@
TODO List:
- 修复已知bugnoclear不生效萤石不足的提示会出现两次
- 优化(匹配结构的方式)
- 为action的执行添加参数(ActionParam)
- 增加更多好看的东西好不好玩另说awa
- [x] 修复已知bugnoclear不生效萤石不足的提示会出现两次
- [ ] 优化(匹配结构的方式)
- [ ] 为action的执行添加参数(ActionParam)
- [ ] 增加更多好看的东西好不好玩另说awa
- [ ] 法术吟唱!

View File

@@ -24,7 +24,7 @@ public class PluginMain extends JavaPlugin implements Listener {
/**
* 调试模式
*/
public static final boolean DEBUG = true;
public static final boolean DEBUG = false;
/**
* 日志类 - 仅在初始化后调用
*/

View File

@@ -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) {