Fix Board Join Exceptions on 1.8, and fixed Failed to Select Seeker
This commit is contained in:
parent
71db93f2e2
commit
7a082c860e
3 changed files with 19 additions and 18 deletions
|
@ -104,9 +104,6 @@ public class Board {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addHider(Player player) {
|
public void addHider(Player player) {
|
||||||
if(!Main.getInstance().supports(9)){
|
|
||||||
player.spigot().setCollidesWithEntities(false);
|
|
||||||
}
|
|
||||||
Hider.add(player.getUniqueId().toString());
|
Hider.add(player.getUniqueId().toString());
|
||||||
Seeker.remove(player.getUniqueId().toString());
|
Seeker.remove(player.getUniqueId().toString());
|
||||||
Spectator.remove(player.getUniqueId().toString());
|
Spectator.remove(player.getUniqueId().toString());
|
||||||
|
@ -114,9 +111,6 @@ public class Board {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSeeker(Player player) {
|
public void addSeeker(Player player) {
|
||||||
if(!Main.getInstance().supports(9)){
|
|
||||||
player.spigot().setCollidesWithEntities(false);
|
|
||||||
}
|
|
||||||
Hider.remove(player.getUniqueId().toString());
|
Hider.remove(player.getUniqueId().toString());
|
||||||
Seeker.add(player.getUniqueId().toString());
|
Seeker.add(player.getUniqueId().toString());
|
||||||
Spectator.remove(player.getUniqueId().toString());
|
Spectator.remove(player.getUniqueId().toString());
|
||||||
|
@ -124,9 +118,6 @@ public class Board {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSpectator(Player player) {
|
public void addSpectator(Player player) {
|
||||||
if(!Main.getInstance().supports(9)){
|
|
||||||
player.spigot().setCollidesWithEntities(false);
|
|
||||||
}
|
|
||||||
Hider.remove(player.getUniqueId().toString());
|
Hider.remove(player.getUniqueId().toString());
|
||||||
Seeker.remove(player.getUniqueId().toString());
|
Seeker.remove(player.getUniqueId().toString());
|
||||||
Spectator.add(player.getUniqueId().toString());
|
Spectator.add(player.getUniqueId().toString());
|
||||||
|
@ -134,9 +125,6 @@ public class Board {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(Player player) {
|
public void remove(Player player) {
|
||||||
if(!Main.getInstance().supports(9)){
|
|
||||||
player.spigot().setCollidesWithEntities(true);
|
|
||||||
}
|
|
||||||
Hider.remove(player.getUniqueId().toString());
|
Hider.remove(player.getUniqueId().toString());
|
||||||
Seeker.remove(player.getUniqueId().toString());
|
Seeker.remove(player.getUniqueId().toString());
|
||||||
Spectator.remove(player.getUniqueId().toString());
|
Spectator.remove(player.getUniqueId().toString());
|
||||||
|
|
|
@ -107,10 +107,7 @@ public class Game {
|
||||||
public void start() {
|
public void start() {
|
||||||
try {
|
try {
|
||||||
Optional<Player> rand = board.getPlayers().stream().skip(new Random().nextInt(board.size())).findFirst();
|
Optional<Player> rand = board.getPlayers().stream().skip(new Random().nextInt(board.size())).findFirst();
|
||||||
Player picked = rand.orElse(board.getPlayers().get(0));
|
Player seeker = rand.orElse(board.getPlayers().get(0));
|
||||||
String seekerName = picked.getName();
|
|
||||||
Player temp = Bukkit.getPlayer(seekerName);
|
|
||||||
Player seeker = board.getPlayer(temp.getUniqueId());
|
|
||||||
start(seeker);
|
start(seeker);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
Main.getInstance().getLogger().warning("Failed to select random seeker.");
|
Main.getInstance().getLogger().warning("Failed to select random seeker.");
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@SuppressWarnings({"unused"})
|
@SuppressWarnings({"unused"})
|
||||||
public class VoidGenerator extends ChunkGenerator{
|
public class VoidGenerator extends ChunkGenerator {
|
||||||
|
|
||||||
// 1.14 And On
|
// 1.14 And On
|
||||||
public @NotNull List<BlockPopulator> getDefaultPopulators(@NotNull World world) {
|
public @NotNull List<BlockPopulator> getDefaultPopulators(@NotNull World world) {
|
||||||
|
@ -69,6 +69,22 @@ public class VoidGenerator extends ChunkGenerator{
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1.13 And Prev
|
// 1.13 And Prev
|
||||||
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int x, int z, @NotNull BiomeGrid biome) { return createChunkData(world); }
|
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int x, int z, @NotNull BiomeGrid biome) {
|
||||||
|
return createChunkData(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1.8
|
||||||
|
public byte[] generate(World world, Random random, int x, int z) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public short[][] generateExtBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[][] generateBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue