Skip to content

Commit

Permalink
null
Browse files Browse the repository at this point in the history
  • Loading branch information
nullaqua committed Feb 26, 2022
1 parent ebe5ffd commit d6fa185
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>com.github.lanzhi6</groupId>
<artifactId>BluestarAPI</artifactId>
<version>1.0</version>
<version>1.2</version>
</dependency>
</dependencies>
</project>
3 changes: 0 additions & 3 deletions src/main/java/me/lanzhi/bluestargame/Ctrls/CTRL.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import me.lanzhi.bluestargame.BluestarGame;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitTask;

public class CTRL
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/lanzhi/bluestargame/Ctrls/CtrlSponge.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.lanzhi.bluestargame.Ctrls;

import me.lanzhi.bluestarapi.Bluestar;
import me.lanzhi.bluestarapi.Api.Bluestar;
import me.lanzhi.bluestargame.BluestarGame;
import me.lanzhi.bluestargame.Type.superSponge;
import org.bukkit.Location;
Expand Down
37 changes: 20 additions & 17 deletions src/main/java/me/lanzhi/bluestargame/commands/maincommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

import static me.lanzhi.bluestargame.BluestarGame.config;

Expand Down Expand Up @@ -270,21 +268,19 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
if (args[0].equals("newsponge")&&sender.hasPermission("bluestargame.lanzhi"))
{
List<superSponge> sponges = (List<superSponge>)config.getConfig().getList("superSponges");
int r = 0;
try
{
r = Integer.valueOf(args[1]).intValue();
}
catch (NumberFormatException e)
{
sender.sendMessage(ChatColor.RED + "错误!");
return false;
}
int r;
r=Integer.parseInt(args[1]);
Location locc=((Player)(sender)).getLocation();
Location loc=new Location(locc.getWorld(),locc.getBlockX(),locc.getBlockY(),locc.getBlockZ());
sponges.add(new superSponge(r,loc,(Player)sender,true,true));
return true;
}
if ("boom".equals(args[0])&&sender.hasPermission("bluestargame.lanzhi"))
{
Location location=((Player)sender).getLocation();
location.getWorld().createExplosion(location,Integer.parseInt(args[1]),true,true);
return true;
}
sender.sendMessage(ChatColor.RED + "格式错误!");
return false;
}
Expand Down Expand Up @@ -314,20 +310,27 @@ public List<String> onTabComplete(CommandSender sender, Command command, String
if(sender.hasPermission("bluestargame.lanzhi"))
{
tablist.add("newsponge");
tablist.add("boom");
}
return tablist;
}
if ((args.length == 2) && !(args[0].equals("spongeR")||args[0].equals("newsponge")))
if(("spongeR".equals(args[0])||"newsponge".equals(args[0]))&&args.length==2)
{
List<String> tablist = new ArrayList();
tablist.add("true");
tablist.add("false");
tablist.add("超级海绵吸水范围");
return tablist;
}
if (args.length == 2)
if (args.length==2&&"boom".equals(args[0]))
{
List<String> tablist = new ArrayList();
tablist.add("超级海绵吸水范围");
tablist.add("爆炸威力");
return tablist;
}
if ((args.length == 2))
{
List<String> tablist = new ArrayList();
tablist.add("true");
tablist.add("false");
return tablist;
}
List<String> tablist = new ArrayList();
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/me/lanzhi/bluestargame/listener.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockDropItemEvent;
Expand Down Expand Up @@ -120,7 +119,7 @@ public void onChatFor24(AsyncPlayerChatEvent event)
org.bukkit.Bukkit.getServer().broadcastMessage(ChatColor.YELLOW + "[BluestarGame]" + event.getPlayer().getName() + "答案正确!");
org.bukkit.Bukkit.getServer().broadcastMessage(ChatColor.YELLOW + "[BluestarGame]获得1000!");
CTRL.the24end = true;
me.lanzhi.bluestarapi.Bluestar.useCommand(org.bukkit.Bukkit.getConsoleSender(), "eco give " + event.getPlayer().getName() + " 1000");
me.lanzhi.bluestarapi.Api.Bluestar.useCommand(org.bukkit.Bukkit.getConsoleSender(), "eco give "+event.getPlayer().getName()+" 1000",BluestarGame.config);
}
}

Expand Down Expand Up @@ -367,6 +366,10 @@ public void onPlayerPlaceBlock(BlockPlaceEvent event)
{
ItemStack item = event.getItemInHand();
NBTCompound bluestar = new NBTItem(item).getCompound("BluestarGame");
if (bluestar==null)
{
return;
}
if (!bluestar.getBoolean("waterSponge")&&!bluestar.getBoolean("lavaSponge"))
{
return;
Expand Down

0 comments on commit d6fa185

Please sign in to comment.