diff --git a/src/main/java/org/ultramine/commands/basic/TechCommands.java b/src/main/java/org/ultramine/commands/basic/TechCommands.java index 42dfced..c867ea3 100644 --- a/src/main/java/org/ultramine/commands/basic/TechCommands.java +++ b/src/main/java/org/ultramine/commands/basic/TechCommands.java @@ -412,13 +412,17 @@ if(worldgen != null) ctx.failure("command.genworld.already"); - int dim = ctx.getSenderAsPlayer().worldObj.provider.dimensionId; + WorldServer world = ctx.getSenderAsPlayer().getServerForPlayer(); + int dim = world.provider.dimensionId; int radius = ctx.contains("radius") ? ctx.get("radius").asInt(1) : -1; int cpt = ctx.contains("radius") ? ctx.get("radius").asInt(1) : 1; int x = MathHelper.floor_double(ctx.getSenderAsPlayer().posX); int z = MathHelper.floor_double(ctx.getSenderAsPlayer().posZ); + if(radius == -1 && world.getConfig().borders.length == 0) + ctx.failure("command.genworld.noborder"); + worldgen = radius == -1 ? new WorldGenerator(dim, cpt) : new WorldGenerator(dim, x, z, radius, cpt); FMLCommonHandler.instance().bus().register(worldgen); ctx.sendMessage("command.genworld.start"); @@ -515,7 +519,7 @@ } totalGenerated += counter; - if(totalGenerated % 600*chunksPerTick == 0) + if(totalGenerated % (600*chunksPerTick) == 0) MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentTranslation("command.genworld.process", totalGenerated)); if(borderInd >= (isBorder ? borders.length : 1)) diff --git a/src/main/resources/assets/ultramine/lang/en_US.lang b/src/main/resources/assets/ultramine/lang/en_US.lang index c7087ee..797237f 100644 --- a/src/main/resources/assets/ultramine/lang/en_US.lang +++ b/src/main/resources/assets/ultramine/lang/en_US.lang @@ -198,6 +198,7 @@ command.genworld.usage=/genworld [chunks per tick] OR /genworld [chunks per tick] OR /genworld stop command.genworld.description=Generateas area radially or inside world border command.genworld.already=World is now generating. Type "/genworld stop" before +command.genworld.noborder=The world don't contains any borders; add border or use radially generation command.genworld.start=World generation started command.genworld.stop=World generation stopped command.genworld.complete=World generation completed (generated %s chunks) diff --git a/src/main/resources/assets/ultramine/lang/ru_RU.lang b/src/main/resources/assets/ultramine/lang/ru_RU.lang index 0819985..b390fc8 100644 --- a/src/main/resources/assets/ultramine/lang/ru_RU.lang +++ b/src/main/resources/assets/ultramine/lang/ru_RU.lang @@ -198,6 +198,7 @@ command.genworld.usage=/genworld [чанков за тик] ИЛИ /genworld <радиус> [чанков за тик] ИЛИ /genworld stop command.genworld.description=Генерирует мир по радиусу или в пределах мирового барьера command.genworld.already=Генерауия мира уже запущена. Сначала введите "/genworld stop" +command.genworld.noborder=Мир не содержит барьера; добавьте барьер или используйте генерацию по радиусу command.genworld.start=Генерация мира остановлена запущена command.genworld.stop=Генерация мира остановлена command.genworld.complete=Генерация мира завершена (сгенерировано %s чанков)