Merge pull request #16 from tylermurphy534/1.3.2

1.3.2
This commit is contained in:
Tyler Murphy 2021-12-22 20:49:23 -05:00 committed by GitHub
commit e6f86145cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 25 deletions

View file

@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion>
<groupId>net.tylermurphy</groupId> <groupId>net.tylermurphy</groupId>
<artifactId>HideAndSeek</artifactId> <artifactId>HideAndSeek</artifactId>
<version>1.3.1</version> <version>1.3.2</version>
<name>Hide and Seek Plugin</name> <name>Hide and Seek Plugin</name>
<build> <build>
<plugins> <plugins>
@ -30,7 +30,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version> <version>1.18.1-R0.1-SNAPSHOT</version>
<type>jar</type> <type>jar</type>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>

View file

@ -2,6 +2,7 @@ package net.tylermurphy.hideAndSeek.bukkit;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -13,7 +14,7 @@ public class TabCompleter{
if(args.length == 1) { if(args.length == 1) {
return new ArrayList<String>(CommandHandler.COMMAND_REGISTER.keySet()) return new ArrayList<String>(CommandHandler.COMMAND_REGISTER.keySet())
.stream() .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()); .collect(Collectors.toList());
} else if(args.length > 1) { } else if(args.length > 1) {
if(!CommandHandler.COMMAND_REGISTER.containsKey(args[0].toLowerCase())) { if(!CommandHandler.COMMAND_REGISTER.containsKey(args[0].toLowerCase())) {

View file

@ -7,7 +7,7 @@ public class About implements ICommand {
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
sender.sendMessage( 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("%sAuthor: %s[KenshinEto]\n", ChatColor.GRAY, ChatColor.WHITE) +
String.format("%sHelp Command: %s/hs %shelp", ChatColor.GRAY, ChatColor.AQUA, ChatColor.WHITE) String.format("%sHelp Command: %s/hs %shelp", ChatColor.GRAY, ChatColor.AQUA, ChatColor.WHITE)
); );

View file

@ -19,6 +19,10 @@ public class ConfigManager {
this.file = new File(Main.plugin.getDataFolder(), filename); this.file = new File(Main.plugin.getDataFolder(), filename);
this.defaultFilename = file.getName(); this.defaultFilename = file.getName();
File folder = Main.plugin.getDataFolder();
if(!folder.exists())
folder.mkdirs();
if(!file.exists()){ if(!file.exists()){
saveDefaultConfiguration(); saveDefaultConfiguration();
} }
@ -60,7 +64,7 @@ public class ConfigManager {
private void saveDefaultConfiguration(){ private void saveDefaultConfiguration(){
try{ try{
InputStream input = Main.plugin.getResource(file.getName()); InputStream input = Main.plugin.getResource(defaultFilename);
java.nio.file.Files.copy(input, file.toPath()); java.nio.file.Files.copy(input, file.toPath());
input.close(); input.close();
} catch(IOException e){ } catch(IOException e){

View file

@ -2,6 +2,7 @@ package net.tylermurphy.hideAndSeek.world;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Random;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
@ -9,49 +10,42 @@ import org.bukkit.generator.ChunkGenerator;
public class VoidGenerator extends ChunkGenerator{ public class VoidGenerator extends ChunkGenerator{
@Override
public List<BlockPopulator> getDefaultPopulators(World world) { public List<BlockPopulator> getDefaultPopulators(World world) {
return Collections.<BlockPopulator>emptyList(); return Collections.<BlockPopulator>emptyList();
} }
@Override
public boolean shouldGenerateNoise() { public boolean shouldGenerateNoise() {
return false; return false;
} }
@Override
public boolean shouldGenerateSurface() { public boolean shouldGenerateSurface() {
return false; return false;
} }
@Override
public boolean shouldGenerateBedrock() { public boolean shouldGenerateBedrock() {
return false; return false;
} }
@Override
public boolean shouldGenerateCaves() { public boolean shouldGenerateCaves() {
return false; return false;
} }
@Override
public boolean shouldGenerateDecorations() { public boolean shouldGenerateDecorations() {
return false; return false;
} }
@Override
public boolean shouldGenerateMobs() { public boolean shouldGenerateMobs() {
return false; return false;
} }
@Override
public boolean shouldGenerateStructures() { public boolean shouldGenerateStructures() {
return false; return false;
} }
@Override
public boolean canSpawn(World world, int x, int z) { public boolean canSpawn(World world, int x, int z) {
return true; return true;
} }
public ChunkData generateChunkData(World world, Random random, int x, int z, BiomeGrid biome) { return createChunkData(world); }
} }

View file

@ -1,9 +1,9 @@
name: HideAndSeek name: HideAndSeek
main: net.tylermurphy.hideAndSeek.Main main: net.tylermurphy.hideAndSeek.Main
version: 1.3.1 version: 1.3.2
author: KenshinEto author: KenshinEto
load: STARTUP load: STARTUP
api-version: 1.17 api-version: 1.14
depend: [ProtocolLib] depend: [ProtocolLib]
commands: commands:
hideandseek: hideandseek: