Skip to content

Commit

Permalink
Merge branch 'dev/4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyutsuki committed Sep 11, 2022
2 parents e9be444 + b13d4a0 commit aed83ff
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
9 changes: 8 additions & 1 deletion .github/changelogs/4.x/en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@

## 4.1.x

### 4.1.7

#### :bug: bug fixes

- Fixed a server crash with type mismatch when editing floating texts ([CrashArchive#7465119](https://crash.pmmp.io/view/7465119))
- Fixed a server crash when using uninitialized properties when moving floating texts ([CrashArchive#7479342](https://crash.pmmp.io/view/7479342))

### 4.1.6

#### :bug: バグ修正
#### :bug: bug fixes

- Fixed server crash when editing floating texts (#130)

Expand Down
7 changes: 7 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,13 @@

## 4.1.x

### 4.1.7

#### :bug: バグ修正

- 浮き文字の編集時に型の不一致でサーバーがクラッシュする問題を修正しました ([CrashArchive#7465119](https://crash.pmmp.io/view/7465119))
- 浮き文字の移動時に未初期化プロパティを使用してサーバーがクラッシュする問題を修正しました ([CrashArchive#7479342](https://crash.pmmp.io/view/7479342))

### 4.1.6

#### :bug: バグ修正
Expand Down
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Texter
prefix: Texter
main: jp\mcbe\fuyutsuki\Texter\Main
version: 4.1.6
version: 4.1.7
api: 4.7.0
softdepend:
# aieuo/Mineflow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use dktapps\pmforms\element\Label;
use dktapps\pmforms\element\StepSlider;
use dktapps\pmforms\element\Toggle;
use Exception;
use jp\mcbe\fuyutsuki\Texter\data\FloatingTextData;
use jp\mcbe\fuyutsuki\Texter\i18n\TexterLang;
use jp\mcbe\fuyutsuki\Texter\Main;
Expand Down Expand Up @@ -96,10 +95,10 @@ function(Player $player): void {
}

private function handleSubmit(Player $player, CustomFormResponse $response): void {
try {
if (!$this->session->isEdit()) {
$name = $response->getString(FormLabels::NAME);
$this->session->setName($name);
}catch (Exception $_) {}
}

$texts = $this->session->texts();
$this->session->setTexts([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,23 @@ function(Player $player, int $selected): void {
}

public function handleSubmit(Player $player, int $selected): void {
$selected = $this->keys[$selected];
if ($this->floatingTextData->existsFloatingText($selected)) {
$selectedKey = (string) $this->keys[$selected];
if ($this->floatingTextData->existsFloatingText($selectedKey)) {
if (!empty($this->action)) {
switch ($this->action) {
case EditSubCommand::NAME:
case EditSubCommand::ALIAS:
$subCommand = new EditSubCommand($selected);
$subCommand = new EditSubCommand($selectedKey);
$subCommand->execute($player);
return;

case MoveSubCommand::NAME:
case MoveSubCommand::ALIAS:
SelectMoveTargetForm::send($player, $selected);
SelectMoveTargetForm::send($player, $selectedKey);
return;
}
}
$form = new SelectActionForm($this->lang, $selected);
$form = new SelectActionForm($this->lang, $selectedKey);
$player->sendForm($form);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function execute(Player $player) {
$lang = TexterLang::fromLocale($player->getLocale());

if ($floatingTextData->existsFloatingText($this->name)) {
$position = $this->position->up()->round(1);
$position = $player->getPosition()->up()->round(1);
$floatingText = $floatingTextData->floatingText($this->name);
$floatingText->setPosition($position);
$floatingText->recalculatePosition();
Expand Down
2 changes: 1 addition & 1 deletion src/jp/mcbe/fuyutsuki/Texter/text/FloatingText.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function asPackets(Player $player, SendType $type): array {
break;

default:
throw new InvalidArgumentException("The SendType must be an integer value between 0 to 3");
throw new InvalidArgumentException("The SendType must be an enum value SendType::ADD, SendType::EDIT, SendType::MOVE or SendType::REMOVE");
}
return $pks;
}
Expand Down

0 comments on commit aed83ff

Please sign in to comment.