From 01937e432bd7e330eb08774e0735c301fa9ac384 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 22 Dec 2021 20:48:13 -0500 Subject: [PATCH] 1.3.2 --- pom.xml | 4 +-- .../hideAndSeek/bukkit/TabCompleter.java | 3 +- .../hideAndSeek/command/About.java | 2 +- .../configuration/ConfigManager.java | 6 +++- .../hideAndSeek/world/VoidGenerator.java | 30 ++++++++----------- src/main/resources/plugin.yml | 4 +-- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 320e622..544d3bb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ 4.0.0 net.tylermurphy HideAndSeek - 1.3.1 + 1.3.2 Hide and Seek Plugin @@ -30,7 +30,7 @@ org.spigotmc spigot-api - 1.17.1-R0.1-SNAPSHOT + 1.18.1-R0.1-SNAPSHOT jar provided diff --git a/src/main/java/net/tylermurphy/hideAndSeek/bukkit/TabCompleter.java b/src/main/java/net/tylermurphy/hideAndSeek/bukkit/TabCompleter.java index 2a88178..2f7dbd4 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/bukkit/TabCompleter.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/bukkit/TabCompleter.java @@ -2,6 +2,7 @@ package net.tylermurphy.hideAndSeek.bukkit; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.stream.Collectors; import org.bukkit.command.Command; @@ -13,7 +14,7 @@ public class TabCompleter{ if(args.length == 1) { return new ArrayList(CommandHandler.COMMAND_REGISTER.keySet()) .stream() - .filter(handle -> sender.hasPermission("hideandseek."+handle.toLowerCase())) + .filter(handle -> sender.hasPermission("hideandseek."+handle.toLowerCase()) && handle.toLowerCase().startsWith(args[0].toLowerCase(Locale.ROOT))) .collect(Collectors.toList()); } else if(args.length > 1) { if(!CommandHandler.COMMAND_REGISTER.containsKey(args[0].toLowerCase())) { diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/About.java b/src/main/java/net/tylermurphy/hideAndSeek/command/About.java index 897a9a0..c341666 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/About.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/About.java @@ -7,7 +7,7 @@ public class About implements ICommand { public void execute(CommandSender sender, String[] args) { sender.sendMessage( - String.format("%s%sHide and Seek %s(1.3.1%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY,ChatColor.WHITE,ChatColor.GRAY) + + String.format("%s%sHide and Seek %s(1.3.2%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY,ChatColor.WHITE,ChatColor.GRAY) + String.format("%sAuthor: %s[KenshinEto]\n", ChatColor.GRAY, ChatColor.WHITE) + String.format("%sHelp Command: %s/hs %shelp", ChatColor.GRAY, ChatColor.AQUA, ChatColor.WHITE) ); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java index dee1643..c1757d1 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java @@ -19,6 +19,10 @@ public class ConfigManager { this.file = new File(Main.plugin.getDataFolder(), filename); this.defaultFilename = file.getName(); + File folder = Main.plugin.getDataFolder(); + if(!folder.exists()) + folder.mkdirs(); + if(!file.exists()){ saveDefaultConfiguration(); } @@ -60,7 +64,7 @@ public class ConfigManager { private void saveDefaultConfiguration(){ try{ - InputStream input = Main.plugin.getResource(file.getName()); + InputStream input = Main.plugin.getResource(defaultFilename); java.nio.file.Files.copy(input, file.toPath()); input.close(); } catch(IOException e){ diff --git a/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java b/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java index d03fd17..46636cf 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java @@ -2,56 +2,50 @@ package net.tylermurphy.hideAndSeek.world; import java.util.Collections; import java.util.List; +import java.util.Random; import org.bukkit.World; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; public class VoidGenerator extends ChunkGenerator{ - - @Override + public List getDefaultPopulators(World world) { return Collections.emptyList(); } - - @Override + public boolean shouldGenerateNoise() { return false; } - - @Override + public boolean shouldGenerateSurface() { return false; } - - @Override + public boolean shouldGenerateBedrock() { return false; } - - @Override + public boolean shouldGenerateCaves() { return false; } - - @Override + public boolean shouldGenerateDecorations() { return false; } - - @Override + public boolean shouldGenerateMobs() { return false; } - - @Override + public boolean shouldGenerateStructures() { return false; } - - @Override + public boolean canSpawn(World world, int x, int z) { return true; } + + public ChunkData generateChunkData(World world, Random random, int x, int z, BiomeGrid biome) { return createChunkData(world); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index ad5b2e3..ce62925 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,9 +1,9 @@ name: HideAndSeek main: net.tylermurphy.hideAndSeek.Main -version: 1.3.1 +version: 1.3.2 author: KenshinEto load: STARTUP -api-version: 1.17 +api-version: 1.14 depend: [ProtocolLib] commands: hideandseek: