Skip to content

Commit

Permalink
Merge branch 'dev/v2.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
yuko fuyutsuki committed Nov 8, 2017
2 parents 3578c54 + d1a3731 commit 33add4c
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 472 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/config.yml
/*.json
/*.json
4 changes: 3 additions & 1 deletion .poggit.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
--- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/fuyutsuki/Texter
branches:
- master
- master
- dev/v2.2.5
projects:
Texter:
path: ""
icon: "/assets/Logo.png"
...
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<img src="/assets/Texter.png" width="400px">

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/fuyutsuki/Texter/blob/master/LICENSE)
[![Github All Releases](https://img.shields.io/github/downloads/fuyutsuki/Texter/total.svg)](https://github.com/fuyutsuki/Texter/releases)

Expand All @@ -8,10 +10,6 @@ Select Language: [English](#eng), [日本語](#jpn)
<a name="eng"></a>
## English

## Notice
This plugin is **fork** of *yuko fuyutsuki`s* plugin developed by *p-NLab*.
It is distributed under MIT license.

<!--
## !! Caution !!
This branch is under development.
Expand All @@ -20,13 +18,12 @@ It may have many bugs.

## Texter
Texter is plugin that displays and deletes FloatingTextPerticle supported to multi-world.
Latest: ver **2.2.4** _Papilio dehaanii(カラスアゲハ)_
Latest: ver **2.2.5** _Papilio dehaanii(カラスアゲハ)_

### Supporting
- [x] Multi-language (eng, jpn)
- [x] Multi-world display
- [x] Minecraft:PE v1.1.x
- [x] Minecraft(Bedrock) v1.2.0.x
- [x] Minecraft(Bedrock) v1.2.x

### Commands
#### General command
Expand Down Expand Up @@ -65,23 +62,18 @@ It is output as follows.
<a name="jpn"></a>
## 日本語

## お知らせ
このプラグインは *p-NLab* が開発する、*yuko fuyutsuki* さんのプラグインの**フォーク**です。
MITライセンスの下で配布されています。

<!--
## !! 注意 !!
このブランチは開発中です。多くのバグを含む可能性があります。
-->

## Texter
TexterはFloatingTextPerticleを複数ワールドに渡り表示、削除ができるプラグインです。
最新バージョン: **2.2.4** _Papilio dehaanii(カラスアゲハ)_
最新バージョン: **2.2.5** _Papilio dehaanii(カラスアゲハ)_

### 対応状況
- [x] 複数言語 (eng, jpn)
- [x] 複数ワールドの表示
- [x] Minecraft:PE v1.1.x
- [x] Minecraft(Bedrockエンジン) v1.2.x

### コマンド
Expand Down
Binary file added assets/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/Texter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Texter
main: Texter\Main
version: 2.2.4
api:
- 3.0.0
- 3.0.0-ALPHA8
- 3.0.0-ALPHA9 #pmmp/PocketMine-MP
version: 2.2.5
api: 3.0.0-ALPHA9 #pmmp/PocketMine-MP

author: yuko_fuyutsuki
authors:
Expand Down
20 changes: 3 additions & 17 deletions src/Texter/EventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
entity\EntityLevelChangeEvent};

# Texter
use Texter\task\{
WorldGetTask,
WorldGetTaskOld};
use Texter\task\WorldGetTask;
use Texter\text\{
CantRemoveFloatingText as CRFT,
FloatingText as FT};
Expand Down Expand Up @@ -64,20 +62,8 @@ public function onLevelChange(EntityLevelChangeEvent $e){
$ft->sendToPlayer($p, FT::SEND_TYPE_REMOVE);
}
}
switch (strtolower($this->main->getServer()->getName())) {
case 'pocketmine-mp':
$task = new WorldGetTask($this->main, $p);
$this->main->getServer()->getScheduler()->scheduleDelayedTask($task, 20);
break;

// NOTE: Confirmed
case 'genisyspro':
case 'leveryl':
default:
$task = new WorldGetTaskOld($this->main, $p);
$this->main->getServer()->getScheduler()->scheduleDelayedTask($task, 20);
break;
}
$task = new WorldGetTask($this->main, $p);
$this->main->getServer()->getScheduler()->scheduleDelayedTask($task, 20);
}
}
}
61 changes: 9 additions & 52 deletions src/Texter/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
use Texter\TexterApi;
use Texter\commands\{
TxtCommand,
TxtCommandOld,
TxtAdmCommand,
TxtAdmCommandOld};
TxtAdmCommand};
use Texter\language\Lang;
use Texter\text\{
CantRemoveFloatingText as CRFT,
Expand All @@ -66,13 +64,11 @@
class Main extends PluginBase {

const NAME = "Texter";
const VERSION = "v2.2.4";
const VERSION = "v2.2.5";
const CODENAME = "Papilio dehaanii(カラスアゲハ)";

const FILE_CONFIG = "config.yml";
const FILE_CRFTP = "crftps.json";// for old format
const FILE_CRFT = "crfts.json";
const FILE_FTP = "ftps.json";// for old format
const FILE_FT = "fts.json";

const CONFIG_VERSION = 22;
Expand Down Expand Up @@ -162,6 +158,9 @@ private function loadFiles(){
if(!file_exists($this->dir.self::FILE_CONFIG)){
file_put_contents($this->dir.self::FILE_CONFIG, $this->getResource(self::FILE_CONFIG));
}
if(!file_exists($this->dir.self::FILE_CRFT)){
file_put_contents($this->dir.self::FILE_CRFT, $this->getResource(self::FILE_CRFT));
}
// config.yml
$this->config = new Config($this->dir.self::FILE_CONFIG, Config::YAML);
// Lang
Expand All @@ -172,34 +171,6 @@ private function loadFiles(){
}else {
$this->getLogger()->error("Invalid language settings. If you have any questions, please contact the issue.");
}
if(!file_exists($this->dir.self::FILE_CRFT)){
if (!file_exists($this->dir.self::FILE_CRFTP)) {
file_put_contents($this->dir.self::FILE_CRFT, $this->getResource(self::FILE_CRFT));
}else {
$tmpOld = new Config($this->dir.self::FILE_CRFTP, Config::JSON);
$tmpOldData = $tmpOld->getAll();
file_put_contents($this->dir.self::FILE_CRFT, []);
$tmpNew = new Config($this->dir.self::FILE_CRFT, Config::JSON);
$tmpNew->setAll($tmpOldData);
$tmpNew->save();
unlink($this->dir.self::FILE_CRFTP);
$this->getLogger()->info(TF::GREEN.$this->language->transrateString("transfer.crftp"));
}
}
if(!file_exists($this->dir.self::FILE_FT)){
if (!file_exists($this->dir.self::FILE_FTP)) {
file_put_contents($this->dir.self::FILE_FT, $this->getResource(self::FILE_FT));
}else {
$tmpOld = new Config($this->dir.self::FILE_FTP, Config::JSON);
$tmpOldData = $tmpOld->getAll();
file_put_contents($this->dir.self::FILE_FT, []);
$tmpNew = new Config($this->dir.self::FILE_FT, Config::JSON);
$tmpNew->setAll($tmpOldData);
$tmpNew->save();
unlink($this->dir.self::FILE_FTP);
$this->getLogger()->info(TF::GREEN.$this->language->transrateString("transfer.ftp"));
}
}
// crfts.json
$crft_config = new Config($this->dir.self::FILE_CRFT, Config::JSON);
$this->crfts = $crft_config->getAll();
Expand All @@ -220,24 +191,10 @@ private function initApi(){
private function registerCommands(){
if ((bool)$this->config->get("canUseCommands")) {
$map = $this->getServer()->getCommandMap();
switch (strtolower($this->getServer()->getName())) {
case 'pocketmine-mp':
$commands = [
new TxtCommand($this),
new TxtAdmCommand($this)
];
break;

// NOTE: Confirmed
case 'genisyspro':
case 'leveryl':
default:
$commands = [
new TxtCommandOld($this),
new TxtAdmCommandOld($this)
];
break;
}
$commands = [
new TxtCommand($this),
new TxtAdmCommand($this)
];
$map->registerAll(self::NAME, $commands);
$this->getLogger()->info(TF::GREEN.$this->language->transrateString("commands.registered"));
}else {
Expand Down
4 changes: 2 additions & 2 deletions src/Texter/TexterApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
/**
* TexterApi
*/
class TexterAPI{
class TexterApi{

/** @var TexterAPI */
/** @var TexterApi */
private static $instance = null;
/** @var Config $crft_config */
private $crft_config = null;
Expand Down
8 changes: 0 additions & 8 deletions src/Texter/commands/TxtAdmCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ public function execute(CommandSender $sender, string $label, array $args){
default:
$sender->sendMessage(TF::AQUA . Lang::PREFIX . $this->help);
break;

case 'test':
if ($this->main->devmode) {
for ($i=1; $i<51; $i++) {
$ft = new FT($lev, $s->x+$i, $s->y, $s->z, "test", "§$i", $name);
}
}
break;
}
}else {
$sender->sendMessage(TF::AQUA . Lang::PREFIX . $this->help);
Expand Down
113 changes: 0 additions & 113 deletions src/Texter/commands/TxtAdmCommandOld.php

This file was deleted.

Loading

0 comments on commit 33add4c

Please sign in to comment.