Clean up PlotPlatform a bit and make the placeholder registry injectible

This commit is contained in:
Alexander Söderberg
2020-12-05 18:41:25 +01:00
parent 60b5f5fe48
commit c8ad936d26
64 changed files with 266 additions and 261 deletions

View File

@ -220,7 +220,7 @@ import java.util.Objects;
e.printStackTrace();
}
Objects.requireNonNull(PlotSquared.platform()).getWorldManager()
Objects.requireNonNull(PlotSquared.platform()).worldManager()
.handleWorldCreation(builder.worldName(), builder.generatorName());
if (Bukkit.getWorld(world) != null) {

View File

@ -128,7 +128,7 @@ public class BukkitUtil extends WorldUtil {
* @return PlotSquared player
*/
@Nonnull public static BukkitPlayer adapt(@Nonnull final Player player) {
final PlayerManager<?, ?> playerManager = PlotSquared.platform().getPlayerManager();
final PlayerManager<?, ?> playerManager = PlotSquared.platform().playerManager();
return ((BukkitPlayerManager) playerManager).getPlayer(player);
}
@ -317,7 +317,7 @@ public class BukkitUtil extends WorldUtil {
} else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) {
facing = BlockFace.SOUTH;
}
if (PlotSquared.platform().getServerVersion()[1] == 13) {
if (PlotSquared.platform().serverVersion()[1] == 13) {
block.setType(Material.valueOf("WALL_SIGN"), false);
} else {
block.setType(Material.valueOf("OAK_WALL_SIGN"), false);

View File

@ -38,7 +38,7 @@ import java.util.ArrayList;
public class SetGenCB {
public static void setGenerator(World world) throws Exception {
PlotSquared.platform().getSetupUtils().updateGenerators();
PlotSquared.platform().setupUtils().updateGenerators();
PlotSquared.get().removePlotAreas(world.getName());
ChunkGenerator gen = world.getGenerator();
if (gen == null) {