mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2024-12-20 09:17:20 +08:00
新增音符盒权限控制
This commit is contained in:
parent
e3cd0a04a8
commit
c2caf96c03
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>Dominion</artifactId>
|
||||
<version>1.39.0-beta</version>
|
||||
<version>1.40.0-beta</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Dominion</name>
|
||||
|
@ -4,10 +4,8 @@ import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.dtos.Flag;
|
||||
import cn.lunadeer.dominion.dtos.GroupDTO;
|
||||
import cn.lunadeer.dominion.dtos.MemberDTO;
|
||||
import cn.lunadeer.dominion.utils.Particle;
|
||||
import cn.lunadeer.dominion.dtos.*;
|
||||
import cn.lunadeer.dominion.utils.BlueMapConnect;
|
||||
import cn.lunadeer.dominion.utils.MapRender;
|
||||
import cn.lunadeer.dominion.utils.Particle;
|
||||
import cn.lunadeer.dominion.utils.ResMigration;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.Scheduler;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cn.lunadeer.dominion.commands;
|
||||
|
||||
import cn.lunadeer.dominion.utils.BlueMapConnect;
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
|
@ -51,6 +51,7 @@ public enum Flag {
|
||||
MONSTER_KILLING("monster_killing", "对怪物造成伤害", "玩家是否可以对怪物造成伤害", false, false, true),
|
||||
MONSTER_SPAWN("monster_spawn", "怪物生成", "是否可以生成怪物", false, true, false),
|
||||
MOVE("move", "移动", "是否可以移动", true, false, true),
|
||||
NOTE_BLOCK("note_block", "点击音符盒", "红石音乐或者某些红石机器会用到...", false, false, true),
|
||||
PLACE("place", "放置方块", "是否可以放置方块(包括:一般方块、展示框、岩浆、水)", false, false, true),
|
||||
PRESSURE("pressure", "压力板交互", "是否可以触发各种材质的压力板", false, false, true),
|
||||
RIDING("riding", "骑乘载具", "是否可以骑乘各种载具", false, false, true),
|
||||
|
@ -566,6 +566,24 @@ public class PlayerEvents implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST) // note_block
|
||||
public void onNoteBlockClicked(PlayerInteractEvent event) {
|
||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
|
||||
return;
|
||||
}
|
||||
Block block = event.getClickedBlock();
|
||||
if (block == null) {
|
||||
return;
|
||||
}
|
||||
Material clicked = block.getType();
|
||||
if (clicked != Material.NOTE_BLOCK) {
|
||||
return;
|
||||
}
|
||||
Player player = event.getPlayer();
|
||||
DominionDTO dom = Cache.instance.getDominionByLoc(block.getLocation());
|
||||
checkFlag(dom, Flag.NOTE_BLOCK, player, event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST) // place
|
||||
public void onPlaceBlock(BlockPlaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
Loading…
Reference in New Issue
Block a user