1.3.3 rc2

This commit is contained in:
Tyler Murphy 2021-12-28 11:53:55 -05:00
parent 56e6cac28f
commit 3c10cf735d
6 changed files with 38 additions and 35 deletions

View file

@ -44,5 +44,10 @@
<artifactId>sqlite-jdbc</artifactId>
<version>3.36.0.3</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
</dependency>
</dependencies>
</project>

View file

@ -40,6 +40,7 @@ import net.tylermurphy.hideAndSeek.configuration.Config;
import net.tylermurphy.hideAndSeek.configuration.Localization;
import net.tylermurphy.hideAndSeek.configuration.Items;
import net.tylermurphy.hideAndSeek.game.Board;
import org.jetbrains.annotations.NotNull;
public class Main extends JavaPlugin implements Listener {
@ -77,11 +78,11 @@ public class Main extends JavaPlugin implements Listener {
UUIDFetcher.cleanup();
}
public boolean onCommand(CommandSender sender, Command cmd,String label, String[] args) {
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, String[] args) {
return CommandHandler.handleCommand(sender, args);
}
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
return TabCompleter.handleTabComplete(sender, args);
}

View file

@ -21,7 +21,6 @@ package net.tylermurphy.hideAndSeek.game;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import net.tylermurphy.hideAndSeek.command.Join;
import net.tylermurphy.hideAndSeek.util.Status;
import org.bukkit.*;
import org.bukkit.attribute.Attribute;

View file

@ -411,7 +411,7 @@ class Taunt {
protected void update() {
if(delay == 0) {
if(running) launchTaunt();
else if(tauntLast || Board.size() > 1) executeTaunt();
else if(tauntLast || Board.sizeHider() > 1) executeTaunt();
} else {
delay--;
delay = Math.max(delay, 0);
@ -419,34 +419,31 @@ class Taunt {
}
private void executeTaunt() {
Player taunted = null;
int rand = (int) (Math.random()*Board.sizeHider());
for(Player player : Board.getPlayers()) {
if(Board.isHider(player)) {
rand--;
if(rand==0) {
taunted = player;
break;
}
}
}
if(taunted != null) {
taunted.sendMessage(message("TAUNTED").toString());
broadcastMessage(tauntPrefix + message("TAUNT"));
tauntPlayer = taunted.getName();
running = true;
delay = 30;
} else {
this.delay = tauntDelay;
Optional<Player> rand = Board.getHiders().stream().skip(new Random().nextInt(Board.size())).findFirst();
if(!rand.isPresent()){
Main.plugin.getLogger().warning("Failed to select random seeker.");
return;
}
Player taunted = rand.get();
taunted.sendMessage(message("TAUNTED").toString());
broadcastMessage(tauntPrefix + message("TAUNT"));
tauntPlayer = taunted.getName();
running = true;
delay = 30;
}
private void launchTaunt(){
Player taunted1 = Board.getPlayer(tauntPlayer);
if(taunted1 != null) {
World world = taunted1.getLocation().getWorld();
assert world != null;
Firework fw = (Firework) world.spawnEntity(taunted1.getLocation(), EntityType.FIREWORK);
Player taunted = Board.getPlayer(tauntPlayer);
if(taunted != null) {
World world = taunted.getLocation().getWorld();
if(world == null){
Main.plugin.getLogger().severe("Game world is null while trying to launch taunt.");
tauntPlayer = "";
running = false;
delay = tauntDelay;
return;
}
Firework fw = (Firework) world.spawnEntity(taunted.getLocation(), EntityType.FIREWORK);
FireworkMeta fwm = fw.getFireworkMeta();
fwm.setPower(4);
fwm.addEffect(FireworkEffect.builder()

View file

@ -26,11 +26,12 @@ import java.util.Random;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import org.jetbrains.annotations.NotNull;
public class VoidGenerator extends ChunkGenerator{
public List<BlockPopulator> getDefaultPopulators(World world) {
return Collections.<BlockPopulator>emptyList();
public @NotNull List<BlockPopulator> getDefaultPopulators(@NotNull World world) {
return Collections.emptyList();
}
public boolean shouldGenerateNoise() {
@ -61,10 +62,11 @@ public class VoidGenerator extends ChunkGenerator{
return false;
}
public boolean canSpawn(World world, int x, int z) {
public boolean canSpawn(@NotNull World world, int x, int z) {
return true;
}
public ChunkData generateChunkData(World world, Random random, int x, int z, BiomeGrid biome) { return createChunkData(world); }
// Backwards compatibility
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int x, int z, @NotNull BiomeGrid biome) { return createChunkData(world); }
}

View file

@ -90,7 +90,6 @@ lobby:
max: 10
enabled: true
# Changes the default plugin language. Currently, Supported localizations are:
# en-US (English - United States)
# de-DE (German - Germany)