diff --git a/pom.xml b/pom.xml
index 4afc8db..070a146 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
me.lanzhi
BluestarGame
- 3.3.1
+ 3.3.2
jar
BluestarGame
@@ -78,6 +78,10 @@
placeholderapi
https://repo.extendedclip.com/content/repositories/placeholderapi/
+
+ dmulloy2-repo
+ https://repo.dmulloy2.net/repository/public/
+
@@ -85,7 +89,7 @@
org.spigotmc
spigot-api
- 1.18.2-R0.1-SNAPSHOT
+ 1.19.1-R0.1-SNAPSHOT
provided
-->
@@ -99,6 +103,7 @@
net.kyori
adventure-api
4.11.0
+ provided
@@ -110,7 +115,7 @@
com.github.lanzhi6
BluestarAPI
- 2.5.2
+ 2.6.3
provided
@@ -151,6 +156,7 @@
system
${project.basedir}/lib/purpur-1.19.jar
+
\ No newline at end of file
diff --git a/src/main/java/me/lanzhi/bluestargame/BluestarGamePlugin.java b/src/main/java/me/lanzhi/bluestargame/BluestarGamePlugin.java
index c5812ec..1eb5f08 100644
--- a/src/main/java/me/lanzhi/bluestargame/BluestarGamePlugin.java
+++ b/src/main/java/me/lanzhi/bluestargame/BluestarGamePlugin.java
@@ -18,6 +18,8 @@
import org.bukkit.ChatColor;
import org.bukkit.command.PluginCommand;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
+import org.bukkit.event.server.PluginDisableEvent;
+import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;
@@ -106,10 +108,10 @@ public void onEnable()
@Override
public void onDisable()
{
+ Bukkit.getScheduler().cancelTasks(this);
this.spongeTask.cancel();
this.bedrockTask.cancel();
- getBluestarGameManager().getRandomEventManger().end();
- getBluestarGameManager().getRandomEventManger().all(false);
+ getBluestarGameManager().stop();
recipeRegister.cancellationRecipes();
Data.set("superSponges",getBluestarGameManager().getSuperSpongeManager().getSponges());
Data.save();
diff --git a/src/main/java/me/lanzhi/bluestargame/commands/BluestarItemCommand.java b/src/main/java/me/lanzhi/bluestargame/commands/BluestarItemCommand.java
index 15179d2..fd80472 100644
--- a/src/main/java/me/lanzhi/bluestargame/commands/BluestarItemCommand.java
+++ b/src/main/java/me/lanzhi/bluestargame/commands/BluestarItemCommand.java
@@ -2,6 +2,8 @@
import de.tr7zw.nbtapi.NBTCompound;
import de.tr7zw.nbtapi.NBTItem;
+import de.tr7zw.nbtapi.NBTReflectionUtil;
+import de.tr7zw.nbtapi.NBTType;
import me.lanzhi.bluestarapi.api.GradientColor;
import me.lanzhi.bluestarapi.api.RGBColor;
import me.lanzhi.bluestargame.BluestarGamePlugin;
@@ -18,7 +20,6 @@
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import java.util.*;
@@ -76,7 +77,7 @@ public BluestarItemCommand(BluestarGamePlugin plugin)
@Override
public boolean onCommand(@NotNull CommandSender sender,@NotNull Command command,@NotNull String label,@NotNull String[] args)
{
- if (!(sender instanceof Player))
+ if (!(sender instanceof Player player))
{
sender.sendMessage(ChatColor.RED+"此命令仅允许玩家输入!");
return false;
@@ -86,7 +87,6 @@ public boolean onCommand(@NotNull CommandSender sender,@NotNull Command command,
sender.sendMessage(ChatColor.RED+"格式错误!");
return false;
}
- Player player=(Player) sender;
switch (args[0])
{
case "watersponge":
@@ -356,8 +356,7 @@ public boolean onCommand(@NotNull CommandSender sender,@NotNull Command command,
}
else
{
- NBTCompound nbtCompound=item.addCompound("BluestarGame").addCompound(mod.name()).addCompound(
- type.getName());
+ NBTCompound nbtCompound=item.addCompound("BluestarGame").addCompound(mod.name()).addCompound(type.getName());
nbtCompound.setInteger("s",l);
nbtCompound.setInteger("time",time*20);
}
@@ -434,6 +433,23 @@ public boolean onCommand(@NotNull CommandSender sender,@NotNull Command command,
player.getInventory().setItemInMainHand(itemStack);
return true;
}
+ case "getnbt":
+ {
+ ItemStack itemStack=player.getInventory().getItemInMainHand();
+ if (itemStack==null||itemStack.getType().isAir())
+ {
+ player.sendMessage(plugin.getErrorMessageHead()+"请手持任意物品");
+ return true;
+ }
+ NBTItem nbtItem=new NBTItem(itemStack);
+ player.sendMessage(plugin.getMessageHead()+"物品NBT:");
+ List ls=getNBT(nbtItem,ChatColor.GOLD.toString());
+ for (String s: ls)
+ {
+ player.sendMessage(s);
+ }
+ return true;
+ }
default:
{
player.sendMessage(plugin.getErrorMessageHead()+"格式错误");
@@ -448,8 +464,18 @@ public List onTabComplete(@NotNull CommandSender sender,@NotNull Command
{
if (args.length==1)
{
- return Arrays.asList("watersponge","lavasponge","usedwatersponge","usedlavasponge","effect","effectEvent",
- "sword","bow","setname","addlore","clearlore");
+ return Arrays.asList("watersponge",
+ "lavasponge",
+ "usedwatersponge",
+ "usedlavasponge",
+ "effect",
+ "effectEvent",
+ "sword",
+ "bow",
+ "setname",
+ "addlore",
+ "clearlore",
+ "getnbt");
}
if ("bow".equals(args[0]))
{
@@ -518,8 +544,8 @@ private ItemStack setLore(ItemStack itemStack)
NBTCompound compound=bluestarGame.getCompound("effect");
for (String i: compound.getKeys())
{
- lore.add(ChatColor.GRAY+effectLang.getString(i.toLowerCase(),i.toLowerCase())+" "+compound.getInteger(
- i));
+ lore.add(ChatColor.GRAY+effectLang.getString(i.toLowerCase(),
+ i.toLowerCase())+" "+compound.getInteger(i));
}
}
for (effectEventType i: effectEventType.values())
@@ -531,8 +557,8 @@ private ItemStack setLore(ItemStack itemStack)
for (String j: compound.getKeys())
{
lore.add(ChatColor.GRAY+effectLang.getString(j.toLowerCase(),
- j.toLowerCase())+" "+compound.addCompound(
- j).getInteger("s")+" 时间: "+(compound.addCompound(j).getInteger("time")/20));
+ j.toLowerCase())+" "+compound.addCompound(j).getInteger(
+ "s")+" 时间: "+(compound.addCompound(j).getInteger("time")/20));
}
}
}
@@ -568,4 +594,75 @@ private ItemStack setLore(ItemStack itemStack)
itemStack.setItemMeta(meta);
return itemStack;
}
+
+ private List getNBT(Object object,String prefix)
+ {
+ List list=new ArrayList<>();
+ if (object instanceof List> ls)
+ {
+ for (Object o: ls)
+ {
+ if (!(o instanceof List>)&&!(o instanceof NBTCompound))
+ {
+ list.add(prefix+"- "+ChatColor.AQUA+getToString(o));
+ continue;
+ }
+ list.add(prefix+"-");
+ list.addAll(getNBT(o,prefix+" "));
+ }
+ return list;
+ }
+ if (object instanceof NBTCompound compound)
+ {
+ for (String s: compound.getKeys())
+ {
+ Object o=null;
+ switch (compound.getType(s))
+ {
+ case NBTTagByte -> o=compound.getByte(s);
+ case NBTTagInt -> o=compound.getInteger(s);
+ case NBTTagShort -> o=compound.getShort(s);
+ case NBTTagLong -> o=compound.getLong(s);
+ case NBTTagFloat -> o=compound.getFloat(s);
+ case NBTTagDouble -> o=compound.getDouble(s);
+ case NBTTagByteArray -> o=compound.getByteArray(s);
+ case NBTTagString -> o=compound.getString(s);
+ case NBTTagList -> {
+ switch (compound.getListType(s))
+ {
+ case NBTTagCompound -> o=compound.getCompoundList(s);
+ case NBTTagLong -> o=compound.getLongList(s);
+ case NBTTagInt -> o=compound.getIntegerList(s);
+ case NBTTagDouble -> o=compound.getDoubleList(s);
+ case NBTTagFloat -> o=compound.getFloatList(s);
+ case NBTTagString -> o=compound.getStringList(s);
+ case NBTTagIntArray -> o=compound.getIntArrayList(s);
+ }
+ }
+ case NBTTagCompound -> o=compound.getCompound(s);
+ case NBTTagIntArray -> o=compound.getIntArray(s);
+ case NBTTagEnd -> o=compound.getObject(s,Object.class);
+ }
+ if (!(o instanceof List>)&&!(o instanceof NBTCompound))
+ {
+ list.add(prefix+s+": "+ChatColor.AQUA+getToString(o));
+ continue;
+ }
+ int[] is=new int[100];
+ Arrays.toString(is);
+ list.add(prefix+s+":");
+ list.addAll(getNBT(o,prefix+" "));
+ }
+ return list;
+ }
+ return Collections.singletonList(prefix+object);
+ }
+ private String getToString(Object object)
+ {
+ if (object instanceof Object[])
+ {
+ return Arrays.toString((Object[])object);
+ }
+ return object.toString();
+ }
}
diff --git a/src/main/java/me/lanzhi/bluestargame/commands/setNickCommand.java b/src/main/java/me/lanzhi/bluestargame/commands/setNickCommand.java
index ed75e86..57c9fec 100644
--- a/src/main/java/me/lanzhi/bluestargame/commands/setNickCommand.java
+++ b/src/main/java/me/lanzhi/bluestargame/commands/setNickCommand.java
@@ -2,9 +2,11 @@
import me.lanzhi.bluestarapi.api.GradientColor;
import me.lanzhi.bluestarapi.api.RGBColor;
+import me.lanzhi.bluestarapi.api.player.input.PlayerChatInput;
import me.lanzhi.bluestargame.BluestarGamePlugin;
import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.economy.Economy;
+import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -22,12 +24,20 @@ public class setNickCommand implements CommandExecutor, TabExecutor
private final BluestarGamePlugin plugin;
private final Chat chat;
private final Economy economy;
+ private final PlayerChatInput.Builder setNickInput;
public setNickCommand(BluestarGamePlugin plugin)
{
this.plugin=plugin;
chat=plugin.getChat();
economy=plugin.getEcon();
+
+ setNickInput=PlayerChatInput.builder();
+ setNickInput.sendValueMessage(ChatColor.GREEN+"请在聊天区域输入昵称,输入"+ChatColor.RED+"cancel"+ChatColor.GREEN+"取消")
+ .setValue((player1,s)->s)
+ .onCancel(p->p.sendMessage(plugin.getMessageHead()+"你已取消设置昵称"))
+ .plugin(plugin)
+ .onFinish(this::setNick);
}
@Override
@@ -38,10 +48,9 @@ public boolean onCommand(@NotNull CommandSender sender,@NotNull Command command,
sender.sendMessage(plugin.getErrorMessageHead()+"此指令仅允许玩家输入!");
return true;
}
- List players=plugin.getBluestarGameManager().getSettingNickPlayer();
- if (players.remove(player))
+ if (PlayerChatInput.isInputing(player.getUniqueId()))
{
- player.sendMessage(plugin.getMessageHead()+"已取消设置昵称");
+ player.sendMessage(plugin.getErrorMessageHead()+"您正在进行其他输入,请完成后再试");
return true;
}
if (!economy.has(player,1000))
@@ -49,13 +58,14 @@ public boolean onCommand(@NotNull CommandSender sender,@NotNull Command command,
player.sendMessage(plugin.getErrorMessageHead()+"错误,你的钱不足1000");
return true;
}
- player.sendMessage(plugin.getMessageHead()+"请在聊天区直接发送昵称,支持颜色");
- player.sendMessage(
- plugin.getMessageHead()+"支持颜色符号:§1&1§2&2§3&3§4&4§5&5§6&6§7&7§8&8§9&9§0&0§a&a§b&b§c&c§d&d§e&e§f&f"+ChatColor.GOLD+",支持RGB:"+RGBColor.setColor(
- "#098765")+"#098765"+ChatColor.GOLD+"支持渐变色: #abcdef-654321<"+GradientColor.colorText("abcdef","654321","需要染色的文本")+ChatColor.GOLD+">");
+ player.sendMessage(plugin.getMessageHead()+"请在 聊天中 直接发送昵称,支持颜色");
+ player.sendMessage(plugin.getMessageHead()+"支持颜色符号:§1&1§2&2§3&3§4&4§5&5§6&6§7&7§8&8§9&9§0&0§a&a§b&b§c&c§d&d§e&e§f&f"+ChatColor.GOLD+",支持RGB:"+RGBColor.setColor(
+ "#098765")+"#098765"+ChatColor.GOLD+"支持渐变色: #abcdef-654321<"+GradientColor.colorText("abcdef",
+ "654321",
+ "需要染色的文本")+ChatColor.GOLD+">");
player.sendMessage(plugin.getErrorMessageHead()+"设置昵称将花费1000,在聊天区发送需要的昵称后立即生效,概不退款。再次设置昵称可以覆盖,需要重新付款");
- player.sendMessage(plugin.getErrorMessageHead()+"若想取消此操作,请再次输入指令");
- players.add(player);
+
+ setNickInput.open(player);
return false;
}
@@ -65,4 +75,31 @@ public List onTabComplete(@NotNull CommandSender commandSender,@NotNull
{
return Collections.emptyList();
}
+
+ private void setNick(Player player,String nick)
+ {
+ if (!plugin.getEcon().has(player,1000))
+ {
+ player.sendMessage(plugin.getErrorMessageHead()+"你的钱不足1000");
+ return;
+ }
+ if (plugin.getEcon()
+ .withdrawPlayer(player,1000).type!=EconomyResponse.ResponseType.SUCCESS)
+ {
+ player.sendMessage(plugin.getErrorMessageHead()+"出现错误,请重试,或通知腐竹");
+ return;
+ }
+ if (nick.indexOf(' ')>=0)
+ {
+ player.sendMessage(plugin.getErrorMessageHead()+"错误!,名称中不能饱和空格");
+ return;
+ }
+ if (ChatColor.stripColor(nick).length()>10)
+ {
+ player.sendMessage(plugin.getErrorMessageHead()+"错误.昵称长度(去除颜色符号后)不应超过10");
+ return;
+ }
+ chat.setPlayerPrefix(player,nick);
+ player.sendMessage(plugin.getMessageHead()+"设置成功");
+ }
}
diff --git a/src/main/java/me/lanzhi/bluestargame/listener/elevatorListener.java b/src/main/java/me/lanzhi/bluestargame/listener/elevatorListener.java
index 296f247..68416ff 100644
--- a/src/main/java/me/lanzhi/bluestargame/listener/elevatorListener.java
+++ b/src/main/java/me/lanzhi/bluestargame/listener/elevatorListener.java
@@ -14,7 +14,7 @@
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
-import org.bukkit.scheduler.BukkitRunnable;
+import org.jetbrains.annotations.NotNull;
public final class elevatorListener implements Listener
{
@@ -34,27 +34,13 @@ public void onPlayerMove(PlayerMoveEvent event)
}
Location loc=event.getPlayer().getLocation();
Player player=event.getPlayer();
- new BukkitRunnable()
+ Location to=getTeleportLocation(loc,1);
+ if (to!=null)
{
- @Override
- public void run()
- {
- Location to=getTeleportLocation(loc,1);
- if (to!=null)
- {
- new BukkitRunnable()
- {
- @Override
- public void run()
- {
- player.teleport(to,PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
- event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR,new TextComponent(ChatColor.GREEN+"UP UPP UPPP!"));
- event.getPlayer().playSound(event.getPlayer().getLocation(),Sound.ENTITY_PLAYER_LEVELUP,1,1);
- }
- }.runTask(plugin);
- }
- }
- }.runTaskAsynchronously(plugin);
+ player.teleport(to,PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
+ event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR,new TextComponent(ChatColor.GREEN+"UP UPP UPPP!"));
+ event.getPlayer().playSound(event.getPlayer().getLocation(),Sound.ENTITY_PLAYER_LEVELUP,1,1);
+ }
}
@EventHandler(priority=EventPriority.MONITOR)
@@ -66,27 +52,13 @@ public void onPlayerSneak(PlayerToggleSneakEvent event)
}
Location loc=event.getPlayer().getLocation();
Player player=event.getPlayer();
- new BukkitRunnable()
+ Location to=getTeleportLocation(loc,-1);
+ if (to!=null)
{
- @Override
- public void run()
- {
- Location to=getTeleportLocation(loc,-1);
- if (to!=null)
- {
- new BukkitRunnable()
- {
- @Override
- public void run()
- {
- player.teleport(to,PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
- event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR,new TextComponent(ChatColor.GREEN+"DOWN DOWWN DOWWWN!"));
- event.getPlayer().playSound(event.getPlayer().getLocation(),Sound.ENTITY_PLAYER_LEVELUP,1,1);
- }
- }.runTask(plugin);
- }
- }
- }.runTaskAsynchronously(plugin);
+ player.teleport(to,PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
+ event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR,new TextComponent(ChatColor.GREEN+"DOWN DOWWN DOWWWN!"));
+ event.getPlayer().playSound(event.getPlayer().getLocation(),Sound.ENTITY_PLAYER_LEVELUP,1,1);
+ }
}
private Location getTeleportLocation(Location loc,long cnt)
@@ -100,7 +72,8 @@ private Location getTeleportLocation(Location loc,long cnt)
locc.setY(y);
Location loccc=loc.clone();
loccc.setY(y-1);
- if ((!locc.getBlock().getType().isSolid()||locc.getBlock().getType().name().endsWith("SIGN"))&&(loccc.getBlock().getType().isSolid()&&!loccc.getBlock().getType().name().endsWith("SIGN")))
+ if ((!locc.getBlock().getType().isSolid()||locc.getBlock().getType().name().endsWith("SIGN"))&&(loccc.getBlock().getType().isSolid()&&!loccc.getBlock().getType().name().endsWith(
+ "SIGN")))
{
return locc;
}
diff --git a/src/main/java/me/lanzhi/bluestargame/listener/randoms/randDamageListener.java b/src/main/java/me/lanzhi/bluestargame/listener/randoms/randDamageListener.java
index ee759f6..f997ae0 100644
--- a/src/main/java/me/lanzhi/bluestargame/listener/randoms/randDamageListener.java
+++ b/src/main/java/me/lanzhi/bluestargame/listener/randoms/randDamageListener.java
@@ -41,7 +41,7 @@ synchronized public void onEntityDamage(EntityDamageEvent event)
Entity entity=event.getEntity();
double hurt=(Math.random()-0.3D)*event.getDamage()*5.0D;
entity.sendMessage(plugin.getMessageHead()+"随机伤害");
- entity.sendMessage(ChatColor.YELLOW+"原伤害:"+event.getDamage()+",随机伤害:"+hurt);
+ entity.sendMessage(ChatColor.YELLOW+"原伤害:"+event.getDamage()+",随机伤害:"+String.format("%.2f",hurt));
if (hurt>0.0D)
{
event.setDamage(hurt);
diff --git a/src/main/java/me/lanzhi/bluestargame/listener/setNickListener.java b/src/main/java/me/lanzhi/bluestargame/listener/setNickListener.java
deleted file mode 100644
index 3220b0b..0000000
--- a/src/main/java/me/lanzhi/bluestargame/listener/setNickListener.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package me.lanzhi.bluestargame.listener;
-
-import me.lanzhi.bluestarapi.api.GradientColor;
-import me.lanzhi.bluestarapi.api.RGBColor;
-import me.lanzhi.bluestargame.BluestarGamePlugin;
-import net.milkbowl.vault.economy.EconomyResponse;
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.AsyncPlayerChatEvent;
-import org.bukkit.event.player.PlayerQuitEvent;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.List;
-
-public class setNickListener implements Listener
-{
- private final Listplayers;
- private final BluestarGamePlugin plugin;
- public setNickListener(@NotNull BluestarGamePlugin plugin)
- {
- this.plugin=plugin;
- this.players=plugin.getBluestarGameManager().getSettingNickPlayer();
- }
- @EventHandler(priority=EventPriority.LOWEST)
- public void onPlayerMessage(@NotNull AsyncPlayerChatEvent event)
- {
- if (players.remove(event.getPlayer()))
- {
- event.setCancelled(true);
- if (!plugin.getEcon().has(event.getPlayer(),1000))
- {
- event.getPlayer().sendMessage(plugin.getErrorMessageHead()+"你的钱不足1000");
- return;
- }
- if (plugin.getEcon().withdrawPlayer(event.getPlayer(),1000).type!=EconomyResponse.ResponseType.SUCCESS)
- {
- event.getPlayer().sendMessage(plugin.getErrorMessageHead()+"出现错误,请重试,或通知腐竹");
- return;
- }
- String nick=GradientColor.setColor(event.getMessage());
- if (nick.indexOf(' ')>=0)
- {
- event.getPlayer().sendMessage(plugin.getErrorMessageHead()+"错误!,名称中不能饱和空格");
- return;
- }
- if (ChatColor.stripColor(nick).length()>10)
- {
- event.getPlayer().sendMessage(plugin.getErrorMessageHead()+"错误.昵称长度(去除颜色符号后)不应超过10");
- return;
- }
- plugin.getChat().setPlayerPrefix(event.getPlayer(),nick);
- event.getPlayer().sendMessage(plugin.getMessageHead()+"设置成功");
- }
- }
- @EventHandler(priority=EventPriority.MONITOR)
- public void onPlayerQuite(@NotNull PlayerQuitEvent event)
- {
- plugin.getBluestarGameManager().getSettingNickPlayer().remove(event.getPlayer());
- }
-}
diff --git a/src/main/java/me/lanzhi/bluestargame/managers/BluestarGameManager.java b/src/main/java/me/lanzhi/bluestargame/managers/BluestarGameManager.java
index 29ff4f9..83a08c7 100644
--- a/src/main/java/me/lanzhi/bluestargame/managers/BluestarGameManager.java
+++ b/src/main/java/me/lanzhi/bluestargame/managers/BluestarGameManager.java
@@ -30,7 +30,6 @@ public final class BluestarGameManager implements BluestarGameManagerInterface
private final RandomEventManger randomEventManger;
private final SuperSpongeManager superSpongeManager;
private final BukkitTask effectTask;
- private final ArrayList settingNick;
public BluestarGameManager(BluestarGamePlugin plugin)
{
@@ -43,11 +42,6 @@ public BluestarGameManager(BluestarGamePlugin plugin)
this.randomEventManger=new RandomEventManger(plugin);
this.superSpongeManager=new SuperSpongeManager(plugin);
this.effectTask=new Effect().runTaskTimer(plugin,0,95);
- this.settingNick=new ArrayList<>();
- }
- public ArrayList getSettingNickPlayer()
- {
- return settingNick;
}
@Override
@@ -105,6 +99,13 @@ public BluestarGamePlugin getPlugin()
return plugin;
}
+ public void stop()
+ {
+ effectTask.cancel();
+ getRandomEventManger().end();
+ getRandomEventManger().all(false);
+ }
+
public static class Effect extends BukkitRunnable
{
private static void set(Player player,ItemStack itemStack)
diff --git a/src/main/java/me/lanzhi/bluestargame/managers/RandomEventsChange.java b/src/main/java/me/lanzhi/bluestargame/managers/RandomEventsChange.java
index 4b266a5..b8becbc 100644
--- a/src/main/java/me/lanzhi/bluestargame/managers/RandomEventsChange.java
+++ b/src/main/java/me/lanzhi/bluestargame/managers/RandomEventsChange.java
@@ -32,7 +32,7 @@ public void run()
}
if (on==0)
{
- on=Bluestar.randomInt(12)+1;
+ on=Bluestar.getMainManager().randomInt(13)+1;
if (Bukkit.getServer().getOnlinePlayers().size()<=0&&on!=4)
{
randomEventManger.randomEvents=new RandomEventsChange(plugin,on);
@@ -75,7 +75,8 @@ public synchronized void change(boolean b)
case 9 -> randomEventManger.moreemerald(b);
case 10 -> randomEventManger.morelapis(b);
case 11 -> randomEventManger.moreiron(b);
- case 12 -> randomEventManger.respawn(b);
+ case 12 -> randomEventManger.moreredstone(b);
+ case 13 -> randomEventManger.oneHealth(b);
default -> {}
}
}
diff --git a/src/main/java/me/lanzhi/bluestargame/register/CommandRegister.java b/src/main/java/me/lanzhi/bluestargame/register/CommandRegister.java
index ae4053d..af649cf 100644
--- a/src/main/java/me/lanzhi/bluestargame/register/CommandRegister.java
+++ b/src/main/java/me/lanzhi/bluestargame/register/CommandRegister.java
@@ -23,5 +23,6 @@ public void registerCommands()
plugin.getCommand("xiaomobank").setExecutor(new XiaoMoBankCommand(plugin));
plugin.getCommand("cmdbag").setExecutor(new CmdBagCommand());
plugin.getCommand("setnick").setExecutor(new setNickCommand(plugin));
+ //plugin.getCommand("test").setExecutor(new TestCommand(plugin));
}
}
diff --git a/src/main/java/me/lanzhi/bluestargame/register/ListenersRegister.java b/src/main/java/me/lanzhi/bluestargame/register/ListenersRegister.java
index 8f60c38..7252d3d 100644
--- a/src/main/java/me/lanzhi/bluestargame/register/ListenersRegister.java
+++ b/src/main/java/me/lanzhi/bluestargame/register/ListenersRegister.java
@@ -25,7 +25,6 @@ public void registerListeners()
registerlistener(new superSpongeListener(plugin));
registerlistener(new opSwordListener(plugin));
registerlistener(new elevatorListener(plugin));
- registerlistener(new setNickListener(plugin));
registerlistener(new arrowListener());
registerlistener(new breakBedrockListener());
registerlistener(new effectListener());
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 3924283..fa6baef 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -6,6 +6,7 @@ website: https://github.com/lanzhi6/BluestarGame
author: lanzhi
commands:
test:
+ permission: bluestargame.lanzhi
bluestargame:
aliases:
- bsgame