mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
Replace with Kyori
This commit is contained in:
parent
41f4029877
commit
e258e27814
@ -3,6 +3,7 @@ package dev.plex.world;
|
|||||||
import dev.plex.Plex;
|
import dev.plex.Plex;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.WorldCreator;
|
import org.bukkit.WorldCreator;
|
||||||
@ -37,16 +38,17 @@ public class CustomWorld extends WorldCreator
|
|||||||
{
|
{
|
||||||
boolean existed = new File(name).exists();
|
boolean existed = new File(name).exists();
|
||||||
World world = super.generate();
|
World world = super.generate();
|
||||||
|
|
||||||
if (!existed)
|
if (!existed)
|
||||||
{
|
{
|
||||||
Block block = world.getBlockAt(0, world.getHighestBlockYAt(0, 0) + 1, 0);
|
Block block = world.getBlockAt(0, world.getHighestBlockYAt(0, 0) + 1, 0);
|
||||||
block.setType(Material.OAK_SIGN);
|
block.setType(Material.OAK_SIGN);
|
||||||
BlockState state = block.getState();
|
BlockState state = block.getState();
|
||||||
if (state instanceof Sign)
|
if (state instanceof Sign sign)
|
||||||
{
|
{
|
||||||
Sign sign = (Sign)state;
|
sign.line(1, Component.text(
|
||||||
sign.setLine(1, Objects.requireNonNull(plugin.config.getString("worlds." + name + ".name")));
|
Objects.requireNonNull(plugin.config.getString("worlds." + name + ".name"))));
|
||||||
sign.setLine(2, "- 0, 0 -");
|
sign.line(2, Component.text("- 0, 0 -"));
|
||||||
sign.update();
|
sign.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user