Skip to content

Commit

Permalink
[+] Release 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LS-KR committed Aug 23, 2023
1 parent 6bacb31 commit f0b54fd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = 'io.github.elihuso'
version = '1.1.0'
version = '1.1.2'

repositories {
mavenCentral()
Expand Down
27 changes: 24 additions & 3 deletions src/main/java/io/github/elihuso/simpleteleport/SimpleTeleport.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.logging.Level;

public final class SimpleTeleport extends JavaPlugin {

public static ArrayList<String[]> req = new ArrayList<>();
public static ArrayList<UUID> progynova = new ArrayList<>();
public static FileConfiguration config = new YamlConfiguration();
int await = 5;

Expand Down Expand Up @@ -242,8 +243,28 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
}
}
if (command.getName().equalsIgnoreCase("🍥")) {
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 5, false, false, false));
player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 19, false, false, false));
if (progynova.contains(player.getUniqueId())) {
player.sendMessage(ChatColor.RED + "请等一会再来w~");
return true;
}
if (args.length == 0) {
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 5, false, false, false));
player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 19, false, false, false));
player.sendMessage(ChatColor.AQUA + "你吃掉了一颗补子!");
}
else {
Player target = getServer().getPlayer(args[0]);
if (target == null)
return false;
target.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 5, false, false, false));
target.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 19, false, false, false));
target.sendMessage(ChatColor.WHITE + player.getName() + ChatColor.AQUA + "喂给你了一颗补子!");
}
progynova.add(player.getUniqueId());
Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> {
progynova.remove(player.getUniqueId());
}, (long) await * 60 * 20);
return true;
}
return false;
}
Expand Down

0 comments on commit f0b54fd

Please sign in to comment.