Skip to content

Commit

Permalink
Merge branch 'dev/4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyutsuki committed Jul 15, 2023
2 parents 134d9cb + ae97b16 commit dcb5d05
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 59 deletions.
6 changes: 6 additions & 0 deletions .github/changelogs/4.x/en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## 4.2.x

### 4.2.1

#### :arrow_heading_up: follow PMMP changes

- Added support for PMMP 5.3.x (Minecraft 1.20.10~)

### 4.2.0

#### :arrow_heading_up: follow PMMP changes
Expand Down
6 changes: 6 additions & 0 deletions .github/changelogs/4.x/ja_jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## 4.2.x

### 4.2.1

#### :arrow_heading_up: PMMPの変更に追従

- PMMP 5.3.x (Minecraft 1.20.10~) に対応しました

### 4.2.0

#### :arrow_heading_up: PMMPの変更に追従
Expand Down
4 changes: 1 addition & 3 deletions .poggit.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
--- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/fuyutsuki/Texter
branches:
- master
- dev/4.2
branches: []
projects:
Texter:
path: ""
Expand Down
10 changes: 2 additions & 8 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
name: Texter
prefix: Texter
main: jp\mcbe\fuyutsuki\Texter\Main
version: 4.2.0
api: 5.1.2
softdepend:
# aieuo/Mineflow
- Mineflow # >= 2.0
virions:
# dktapps-pm-pl/pmforms
- pmforms # ^2.0.0
version: 4.2.1
api: 5.3.0

author: yuko fuyutsuki
authors:
Expand Down
1 change: 0 additions & 1 deletion resources/language/en_us.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ form.list.description.1=Lists editable FloatingTexts within 10 blocks of straigh
form.list.description.2=Specified FloatingText name: {%0}\nPlease select the operation to do for this.
error.on.enable.not.packaged=Please use the phar file downloaded from PoggitCI (https://poggit.pmmp.io/p/Texter).
error.on.enable.not.found.virions=Can't find the {%0} in the virions folder. Please download {%0} and install it correctly.
error.ft.name.not.specified=A FloatingText name is not specified
error.ft.name.exists=A FloatingText with the specified name: {%0} already exists.
error.ft.name.not.exists=No FloatingText with the specified name: {%0} does not exist.
Expand Down
1 change: 0 additions & 1 deletion resources/language/es_mx.ini
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ form.remove.description=Elimina el TextoFloatante
form.list.description.1=Enumera los TextosFloatantes editables dentro de 10 bloques de distancia en línea recta de usted.\nSi no, no se muestra nada.
form.list.description.2=Nombre de TextoFloatante especificado: {%0}\nSeleccione la operación a realizar para esto.
error.on.enable.not.packaged=Utilice el archivo phar descargado de PoggitCI (https://poggit.pmmp.io/p/Texter).
error.on.enable.not.found.virions=No se pudo encontrar {%0} en la carpeta de viriones. Por favor descargue {%0} e instalalo correctamente.
error.ft.name.not.specified=Un nombre para el TextoFloatante no fue especificado
error.ft.name.exists=Un TextoFloatante con el nombre especificado: {%0} ya existe.
error.ft.name.not.exists=No existe un TextoFloatante con el nombre: {%0}.
Expand Down
1 change: 0 additions & 1 deletion resources/language/id_id.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ form.list.description.1=Mendaftarkan teks melayang yang dapat di edit dalam 10 b
form.list.description.2=nama teks melayang: {%0}\nPilih operasi yang dilakukan untuk ini.

error.on.enable.not.packaged=Mohon gunakan file .phar yang didownload dari PoggitCI (https://poggit.pmmp.io/p/Texter).
error.on.enable.not.found.libformapi=Tidak dapat menemukan libFormAPI di folder virions. Mohon download libFormAPI dan install secara benar.
error.ft.name.not.specified=Nama teks melayang tidak di pilih
error.ft.name.exists=Teks melayang dengan nama: {%0} sudah ada.
error.ft.name.not.exists=Teks melayang dengan nama: {%0} tidak ada.
Expand Down
1 change: 0 additions & 1 deletion resources/language/ja_jp.ini
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ form.list.description.1=自分から直線距離10ブロック以内の編集可
form.list.description.2=指定された浮き文字: "{%0}"\nこの浮き文字に行う操作を選択して下さい。

error.on.enable.not.packaged=PoggitCI(https://poggit.pmmp.io/p/Texter)からダウンロードしたpharファイルを使ってください。
error.on.enable.not.found.virions=virionsフォルダに{%0}が見つかりません。{%0}をダウンロードし、正しく導入してください。
error.ft.name.not.specified=浮き文字の名前が指定されていません
error.ft.name.exists=このワールドには"{%0}"の名前を持つ浮き文字が既に存在します。
error.ft.name.not.exists=このワールドには"{%0}"の名前を持つ浮き文字は存在しません。
Expand Down
1 change: 0 additions & 1 deletion resources/language/ko_kr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ form.list.description.1=현제 위치에서부터 10블럭 이내에있는 홀
form.list.description.2=홀로그램 이름: {%0}\n아래 옵션을 선택하세요

error.on.enable.not.packaged=PoggitCI 의 .phar 파일을 사용하세요! (https://poggit.pmmp.io/p/Texter).
error.on.enable.not.found.libformapi=libFormAPI을 virions 폴더에서 찾을수 없습니다. libFormAPI 다운후 제대로 설치해주세요
error.ft.name.not.specified=홀로그램 이름을 적어주세요
error.ft.name.exists=홀로그램 이름: {%0} 이 이미 있습니다
error.ft.name.not.exists=홀로그램 이름: {%0} 이 없습니다
Expand Down
1 change: 0 additions & 1 deletion resources/language/ru_ru.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ form.list.description.1=Список изменяемых летающих те
form.list.description.2=Выбран летающий текст: {%0}\nПожалуйста, выберите действие:

error.on.enable.not.packaged=Пожалуйста, используйте phar-файл скачанный с PoggitCI (https://poggit.pmmp.io/p/Texter).
error..libformapi=Не получается найти libFormAPI в папке virions. Пожалуйста, скачайте libFormAPI и установите корректно.
error.ft.name.not.specified=Название летающего текста не указано.
error.ft.name.exists=Летающий текст с названием: {%0} уже существует.
error.ft.name.not.exists=Летающий текст с названием: {%0} не существует.
Expand Down
1 change: 0 additions & 1 deletion resources/language/tr_tr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ form.list.description.1=Kendinizden düz çizgi mesafesinin 10 blok içersindeki
form.list.description.2=Belirtilen Uçan Metin metni adı: {%0} \nLütfen bunun için yapılacak işlemi seçin.

error.on.enable.not.packaged=Lütfen PoggitCI'den indirilen phar dosyasını kullanın (https://poggit.pmmp.io/p/Texter).
error.on.enable.not.found.libformapi=libFormAPI virions klasöründe bulunamadı. Lütfen libFormAPI'yi indirin ve doğru şekilde kurun.
error.ft.name.not.specified=Bir UçanMetin adı belirtilmedi
error.ft.name.exists=Belirtilen ada sahip bir UçanMetin: {%0} zaten var.
error.ft.name.not.exists=Belirtilen ada sahip UçanMetin yok: {%0} mevcut değil.
Expand Down
1 change: 0 additions & 1 deletion resources/language/vi_vn.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ form.list.description.1=Liệt kê các chữ nổi có thể chỉnh sửa tron
form.list.description.2=Tên của chữ nổi được chỉ định: {%0}\nVui lòng chọn thao tác cần thực hiện.
error.on.enable.not.packaged=Vui lòng dùng tệp có định dạng Phar có thể tải từ PoggitCI (https://poggit.pmmp.io/p/Texter).
error.on.enable.not.found.libformapi=Không thể tìm thấy libFormAPI trong thư mục virions. Vui lòng tải libFormAPI.
error.ft.name.not.specified=Tên của chữ nổi không được ghi rõ
error.ft.name.exists=Chữ nổi có tên: {%0} đã được dùng.
error.ft.name.not.exists=Không có chữ nổi nào có tên: {%0}.
Expand Down
3 changes: 1 addition & 2 deletions resources/language/zh_cn.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ form.add.more.ft=添加更多浮空字
form.add.spacing.description=浮空字之间的间距可以在坐标中指定,其中-0.3 (Y)大约是一行的间距。
form.add.spacing.x=间距(X)
form.add.spacing.y=间距(Y)
form.add.spacing.z=间距(Z
form.add.spacing.z=间距(Z
form.add.text=文本 #{%0}
form.add.error.no.texts=你不能在没有一个浮空字的情况下添加任何东西。
form.edit=编辑
Expand All @@ -62,7 +62,6 @@ form.list.description.1=列出可编辑的浮空字在10块直线距离内。\n
form.list.description.2=指定浮空字名称名称: {%0}\n请为此选择要做的操作。

error.on.enable.not.packaged=请使用从PoggitCI下载的phar文件 (https://poggit.pmmp.io/p/Texter).
error.on.enable.not.found.libformapi=无法在病毒粒子文件夹中找到 {%0} 。请下载并正确安装 {%0} 。
error.ft.name.not.specified=没有指定浮点文本名称
error.ft.name.exists=指定名称的浮空字: {%0} 已经存在。
error.ft.name.not.exists=没有指定名称的浮空字: {%0} 不存在。
Expand Down
55 changes: 19 additions & 36 deletions src/jp/mcbe/fuyutsuki/Texter/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@
use pocketmine\utils\TextFormat;
use pocketmine\utils\VersionString;
use function array_key_last;
use function class_exists;
use function explode;
use function file_exists;
use function glob;
use function implode;
use function is_dir;
use function mkdir;
use function str_starts_with;

Expand Down Expand Up @@ -205,42 +204,18 @@ public function compareVersion(bool $success, ?VersionString $latest = null, str
}

private function checkPackaged(): bool {
if (str_starts_with($this->getFile(), self::PHAR_HEADER)) {
if (class_exists(Dependencies::PACKAGED_LIBRARY_NAMESPACE . Dependencies::PMFORMS)) {
return true;// PoggitCI
}elseif (Main::canLoadDependencyFromComposer()) {
Main::loadDependency();
return true;// GitHubActions
}else {
$message = $this->lang->translateString("error.on.enable.not.packaged");
$this->getLogger()->critical($message);
return false;
}
}else {
$plugins = $this->getServer()->getPluginManager()->getPlugins();
if (isset($plugins["DEVirion"])) {
if (class_exists(Dependencies::PMFORMS)) {
return true;// developer
} else {
$message = $this->lang->translateString("error.on.enable.not.found.virions", [implode(", ", ["pmforms"])]);
$this->getLogger()->critical($message);
return false;
}
}elseif (Main::canLoadDependencyFromComposer()) {
Main::loadDependency();
if (class_exists(Dependencies::PMFORMS)) {
return true;// developer
} else {
$message = $this->lang->translateString("error.on.enable.not.found.virions", [implode(", ", ["pmforms"])]);
$this->getLogger()->critical($message);
return false;
}
}else {
$message = $this->lang->translateString("error.on.enable.not.packaged");
$this->getLogger()->critical($message);
return false;
if ($this->isPhar() && $this->isPackagedByPharynx()) {
return true; // pharynx
}elseif (Main::canLoadDependencyFromComposer()) {
Main::loadDependency();
if (class_exists(Dependencies::PMFORMS)) {
return true; // developer
}
}

$message = $this->lang->translateString("error.on.enable.not.packaged");
$this->getLogger()->critical($message);
return false;
}

private function unlinkRecursive(string $dir): bool {
Expand Down Expand Up @@ -270,6 +245,14 @@ private function findWorldsPath(): array {
return glob($this->getWorldsPath() . "*");
}

private function isPhar(): bool {
return str_starts_with($this->getFile(), self::PHAR_HEADER);
}

private function isPackagedByPharynx(): bool {
return is_dir($this->getFile() . Dependencies::PHARYNX_LIBRARY_DIR);
}

public static function prefix(): string {
return self::$prefix;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ public function __construct(Player $player) {
}

if (count($this->session->texts()) >= 2) {
$spacing = $this->session->spacing()->add(0, -0.3, 0);
$spacing = $this->session->spacing();
if ($spacing->equals(Vector3::zero())) {
$spacing = $spacing->add(0, -0.3, 0);
}
$range = range(-30, 30);
foreach ($range as $k => $v) {
$range[$k] = (string)($v/10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class Dependencies {

public const PLUGIN_NAMESPACE = "\\jp\\mcbe\\fuyutsuki\\Texter";

public const PACKAGED_LIBRARY_NAMESPACE = self::PLUGIN_NAMESPACE . "\\libs";
public const PHARYNX_LIBRARY_DIR = "\\libs";
public const PMFORMS = "\\dktapps\\pmforms\\BaseForm";

}

0 comments on commit dcb5d05

Please sign in to comment.