1.3.3 rc2
This commit is contained in:
parent
56e6cac28f
commit
3c10cf735d
6 changed files with 38 additions and 35 deletions
5
pom.xml
5
pom.xml
|
@ -44,5 +44,10 @@
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
<version>3.36.0.3</version>
|
<version>3.36.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains</groupId>
|
||||||
|
<artifactId>annotations</artifactId>
|
||||||
|
<version>23.0.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -40,6 +40,7 @@ import net.tylermurphy.hideAndSeek.configuration.Config;
|
||||||
import net.tylermurphy.hideAndSeek.configuration.Localization;
|
import net.tylermurphy.hideAndSeek.configuration.Localization;
|
||||||
import net.tylermurphy.hideAndSeek.configuration.Items;
|
import net.tylermurphy.hideAndSeek.configuration.Items;
|
||||||
import net.tylermurphy.hideAndSeek.game.Board;
|
import net.tylermurphy.hideAndSeek.game.Board;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class Main extends JavaPlugin implements Listener {
|
public class Main extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
|
@ -77,11 +78,11 @@ public class Main extends JavaPlugin implements Listener {
|
||||||
UUIDFetcher.cleanup();
|
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);
|
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);
|
return TabCompleter.handleTabComplete(sender, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ package net.tylermurphy.hideAndSeek.game;
|
||||||
|
|
||||||
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
|
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
|
||||||
|
|
||||||
import net.tylermurphy.hideAndSeek.command.Join;
|
|
||||||
import net.tylermurphy.hideAndSeek.util.Status;
|
import net.tylermurphy.hideAndSeek.util.Status;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.attribute.Attribute;
|
import org.bukkit.attribute.Attribute;
|
||||||
|
|
|
@ -411,7 +411,7 @@ class Taunt {
|
||||||
protected void update() {
|
protected void update() {
|
||||||
if(delay == 0) {
|
if(delay == 0) {
|
||||||
if(running) launchTaunt();
|
if(running) launchTaunt();
|
||||||
else if(tauntLast || Board.size() > 1) executeTaunt();
|
else if(tauntLast || Board.sizeHider() > 1) executeTaunt();
|
||||||
} else {
|
} else {
|
||||||
delay--;
|
delay--;
|
||||||
delay = Math.max(delay, 0);
|
delay = Math.max(delay, 0);
|
||||||
|
@ -419,34 +419,31 @@ class Taunt {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executeTaunt() {
|
private void executeTaunt() {
|
||||||
Player taunted = null;
|
Optional<Player> rand = Board.getHiders().stream().skip(new Random().nextInt(Board.size())).findFirst();
|
||||||
int rand = (int) (Math.random()*Board.sizeHider());
|
if(!rand.isPresent()){
|
||||||
for(Player player : Board.getPlayers()) {
|
Main.plugin.getLogger().warning("Failed to select random seeker.");
|
||||||
if(Board.isHider(player)) {
|
return;
|
||||||
rand--;
|
|
||||||
if(rand==0) {
|
|
||||||
taunted = player;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
Player taunted = rand.get();
|
||||||
}
|
|
||||||
if(taunted != null) {
|
|
||||||
taunted.sendMessage(message("TAUNTED").toString());
|
taunted.sendMessage(message("TAUNTED").toString());
|
||||||
broadcastMessage(tauntPrefix + message("TAUNT"));
|
broadcastMessage(tauntPrefix + message("TAUNT"));
|
||||||
tauntPlayer = taunted.getName();
|
tauntPlayer = taunted.getName();
|
||||||
running = true;
|
running = true;
|
||||||
delay = 30;
|
delay = 30;
|
||||||
} else {
|
|
||||||
this.delay = tauntDelay;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void launchTaunt(){
|
private void launchTaunt(){
|
||||||
Player taunted1 = Board.getPlayer(tauntPlayer);
|
Player taunted = Board.getPlayer(tauntPlayer);
|
||||||
if(taunted1 != null) {
|
if(taunted != null) {
|
||||||
World world = taunted1.getLocation().getWorld();
|
World world = taunted.getLocation().getWorld();
|
||||||
assert world != null;
|
if(world == null){
|
||||||
Firework fw = (Firework) world.spawnEntity(taunted1.getLocation(), EntityType.FIREWORK);
|
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();
|
FireworkMeta fwm = fw.getFireworkMeta();
|
||||||
fwm.setPower(4);
|
fwm.setPower(4);
|
||||||
fwm.addEffect(FireworkEffect.builder()
|
fwm.addEffect(FireworkEffect.builder()
|
||||||
|
|
|
@ -26,11 +26,12 @@ import java.util.Random;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class VoidGenerator extends ChunkGenerator{
|
public class VoidGenerator extends ChunkGenerator{
|
||||||
|
|
||||||
public List<BlockPopulator> getDefaultPopulators(World world) {
|
public @NotNull List<BlockPopulator> getDefaultPopulators(@NotNull World world) {
|
||||||
return Collections.<BlockPopulator>emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shouldGenerateNoise() {
|
public boolean shouldGenerateNoise() {
|
||||||
|
@ -61,10 +62,11 @@ public class VoidGenerator extends ChunkGenerator{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSpawn(World world, int x, int z) {
|
public boolean canSpawn(@NotNull 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); }
|
// Backwards compatibility
|
||||||
|
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int x, int z, @NotNull BiomeGrid biome) { return createChunkData(world); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,6 @@ lobby:
|
||||||
max: 10
|
max: 10
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
|
||||||
# Changes the default plugin language. Currently, Supported localizations are:
|
# Changes the default plugin language. Currently, Supported localizations are:
|
||||||
# en-US (English - United States)
|
# en-US (English - United States)
|
||||||
# de-DE (German - Germany)
|
# de-DE (German - Germany)
|
||||||
|
|
Loading…
Reference in a new issue