Skip to content

Commit

Permalink
新增了水晶爆炸保护
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdeZhang committed Mar 9, 2024
1 parent e1a11cb commit be3fd70
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.11.8-beta</version>
<version>1.11.9-beta</version>
<packaging>jar</packaging>

<name>Dominion</name>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/cn/lunadeer/dominion/Cache.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import cn.lunadeer.dominion.utils.XLogger;
import net.kyori.adventure.text.Component;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;

import javax.annotation.Nullable;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/cn/lunadeer/dominion/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import static cn.lunadeer.dominion.commands.Helper.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityDropItemEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityInteractEvent;
import org.bukkit.event.player.PlayerInteractEvent;

import java.util.Objects;
Expand All @@ -27,7 +26,11 @@ public class EnvironmentEvents implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) // creeper_explode
public void onEntityExplode(EntityExplodeEvent event) {
Entity entity = event.getEntity();
if (entity.getType() != EntityType.CREEPER && entity.getType() != EntityType.WITHER_SKULL) {
if (entity.getType() != EntityType.CREEPER
&& entity.getType() != EntityType.WITHER_SKULL
&& entity.getType() != EntityType.FIREBALL
&& entity.getType() != EntityType.ENDER_CRYSTAL
) {
return;
}
DominionDTO dom = Cache.instance.getDominion(event.getLocation());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityPlaceEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.inventory.InventoryType;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cn/lunadeer/dominion/tuis/DominionFlagInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ public static void show(CommandSender sender, String[] args) {
if (dominion.getCreeperExplode()) {
view.add(Line.create()
.append(Button.createGreen("☑", "/dominion set creeper_explode false " + dominion.getName() + " " + page))
.append("苦力怕/凋零头颅爆炸"));
.append("苦力怕/凋零头颅/水晶爆炸"));
} else {
view.add(Line.create()
.append(Button.createRed("☐", "/dominion set creeper_explode true " + dominion.getName() + " " + page))
.append("苦力怕/凋零头颅爆炸"));
.append("苦力怕/凋零头颅/水晶爆炸"));
}
if (dominion.getComparer()) {
view.add(Line.create()
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cn/lunadeer/dominion/tuis/ListDominion.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package cn.lunadeer.dominion.tuis;

import cn.lunadeer.dominion.utils.Notification;
import cn.lunadeer.dominion.utils.STUI.Button;
import cn.lunadeer.dominion.utils.STUI.Line;
import cn.lunadeer.dominion.utils.STUI.ListView;
Expand All @@ -11,7 +10,8 @@
import java.util.List;

import static cn.lunadeer.dominion.commands.Apis.playerOnly;
import static cn.lunadeer.dominion.commands.Helper.*;
import static cn.lunadeer.dominion.commands.Helper.playerAdminDominions;
import static cn.lunadeer.dominion.commands.Helper.playerOwnDominions;
import static cn.lunadeer.dominion.tuis.Apis.getPage;

public class ListDominion {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/cn/lunadeer/dominion/tuis/PrivilegeInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import org.bukkit.entity.Player;

import static cn.lunadeer.dominion.commands.Apis.playerOnly;
import static cn.lunadeer.dominion.tuis.Apis.*;
import static cn.lunadeer.dominion.tuis.Apis.getDominionNameArg_2;
import static cn.lunadeer.dominion.tuis.Apis.noAuthToManage;

public class PrivilegeInfo {
// /dominion privilege_info <玩家名称> [领地名称] [页码]
Expand Down

0 comments on commit be3fd70

Please sign in to comment.