|
@@ -60,9 +60,9 @@ public class WorldManager {
|
|
|
static RuntimeWorldHandle lobbyWorldHandle;
|
|
|
|
|
|
public static void createNewLobbyWorld(MinecraftServer server) {
|
|
|
- RegistryEntryLookup<Biome> biomeLookup = server.getRegistryManager().getOrThrow(RegistryKeys.BIOME);
|
|
|
- RegistryEntryLookup<StructureSet> structureSetLookup = server.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE_SET);
|
|
|
- RegistryEntryLookup<PlacedFeature> featuresLookup = server.getRegistryManager().getOrThrow(RegistryKeys.PLACED_FEATURE);
|
|
|
+ RegistryEntryLookup<Biome> biomeLookup = server.getRegistryManager().getWrapperOrThrow(RegistryKeys.BIOME);
|
|
|
+ RegistryEntryLookup<StructureSet> structureSetLookup = server.getRegistryManager().getWrapperOrThrow(RegistryKeys.STRUCTURE_SET);
|
|
|
+ RegistryEntryLookup<PlacedFeature> featuresLookup = server.getRegistryManager().getWrapperOrThrow(RegistryKeys.PLACED_FEATURE);
|
|
|
|
|
|
FlatChunkGeneratorConfig config = FlatChunkGeneratorConfig.getDefaultConfig(biomeLookup, structureSetLookup, featuresLookup);
|
|
|
List<FlatChunkGeneratorLayer> layers = new ArrayList<>() {{
|
|
@@ -89,16 +89,15 @@ public class WorldManager {
|
|
|
lobbyWorldHandle = fantasy.getOrOpenPersistentWorld(Identifier.of(MOD_ID, "lobby"), worldConfig);
|
|
|
|
|
|
ServerWorld world = lobbyWorldHandle.asWorld();
|
|
|
- world.setMobSpawnOptions(false);
|
|
|
+ world.setMobSpawnOptions(false, false);
|
|
|
world.setBlockState(new BlockPos(0, 13, 0), Blocks.ACACIA_BUTTON.getDefaultState());
|
|
|
|
|
|
for (Entity entity : world.iterateEntities()) {
|
|
|
- entity.teleport(world, 0, -999, 0, PositionFlag.VALUES, 0, 0, true);
|
|
|
+ entity.teleport(world, 0, -999, 0, PositionFlag.VALUES, 0, 0);
|
|
|
}
|
|
|
|
|
|
ClipboardFormat format = ClipboardFormats.findByAlias("schem");
|
|
|
|
|
|
-
|
|
|
try {
|
|
|
Utils.delay(100, () -> {
|
|
|
try {
|
|
@@ -144,16 +143,13 @@ public class WorldManager {
|
|
|
Random random = new Random();
|
|
|
int x = random.nextInt(-50, 50);
|
|
|
int z = random.nextInt(-50, 50);
|
|
|
- entity.teleport(runWorldHandle.asWorld(), x, 255, z, PositionFlag.VALUES, 0, 0, true);
|
|
|
+ entity.teleport(runWorldHandle.asWorld(), x, 255, z, PositionFlag.VALUES, 0, 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void teleportToLobbyWorld(MinecraftServer server) {
|
|
|
for (ServerPlayerEntity entity : server.getPlayerManager().getPlayerList()) {
|
|
|
- Random random = new Random();
|
|
|
- int x = random.nextInt(-3, 3);
|
|
|
- int z = random.nextInt(-3, 3);
|
|
|
- entity.teleport(lobbyWorldHandle.asWorld(), x - entity.getX(), 12 - entity.getY(), z - entity.getZ(), PositionFlag.VALUES, 0, 0, true);
|
|
|
+ teleportToLobbyWorld(entity);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -175,7 +171,7 @@ public class WorldManager {
|
|
|
Random random = new Random();
|
|
|
int x = random.nextInt(-3, 3);
|
|
|
int z = random.nextInt(-3, 3);
|
|
|
- entity.teleport(lobbyWorldHandle.asWorld(), x - entity.getX(), 12 - entity.getY(), z - entity.getZ(), PositionFlag.VALUES, 0, 0, true);
|
|
|
+ entity.teleport(lobbyWorldHandle.asWorld(), x, 12, z, PositionFlag.VALUES, 0, 0);
|
|
|
}
|
|
|
|
|
|
//This is required to remove every structure
|
|
@@ -191,11 +187,6 @@ public class WorldManager {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public boolean isBound() {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public Either<TagKey<StructureSet>, List<RegistryEntry<StructureSet>>> getStorage() {
|
|
|
return null;
|