Skip to content

Commit

Permalink
Data restored
Browse files Browse the repository at this point in the history
  • Loading branch information
yuko fuyutsuki committed Nov 7, 2017
1 parent 102a912 commit 2619773
Show file tree
Hide file tree
Showing 27 changed files with 3,242 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# http://editorconfig.org/
root = yes

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/config.yml
/*.json
34 changes: 34 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
### 必須項目 (Required items)
<!--
もし提案などの場合は下の項目は無視して構いません。
If you propose a suggestion, you can ignore the items below.
-->
<!--
サーバー機のOSをご記入ください。例: Win10Home, CentOS6.2...
Please write here your machine OS. example: Win10Home, CentOS6.2 ...
-->
* ServerOS:

<!--
PHPのバージョンをご記入ください。例: php7.0.6 (64bit)
Please write your PHP-version. example: php7.0.9 (64bit)
-->
* PHP version:

<!--
お使いのマインクラフトのバージョンをご記入ください。例: MC:Win10Ed. v1.1.5
Please write the version of Minecraft you are using. example: MC:Win10Ed. v1.1.5
-->
* Minecraft version:

<!--
お使いのTexterのバージョンをご記入ください。 例: Texter v2.2.0
Please write the version of Texter you are using. Example: Texter v 2.2.0
-->
* Texter version:

<!--
問題をできるだけ詳しく以下にご記入ください。
Please report the problem below in detail.
-->
* issue(s):
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 yuko fuyutsuki

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
123 changes: 121 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,121 @@
# Texter
This is a PocketMine-MP plugin that can add, remove and update FloatingTextParticle.
[![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)

## Overview
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.
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(カラスアゲハ)_

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

### Commands
#### General command
| \ |command|argument|alias|
|:--:|:--:|:--:|:--:|
|Add text|`/txt add`|`<title> [text]`|`/txt a`|
|Remove text|`/txt remove`|`<ID>`|`/txt r`|
|Update text|`/txt update`|`<title, text> <ID> <message>`|`/txt u`|
|Help|`/txt or /txt help`|`none`|`/txt ?`|

#### Management command
| \ |command|argument|alias|
|:--:|:--:|:--:|:--:|
|Remove all|`/txtadm allremove`|`none`|`/tadm ar`|
|Remove texts/user|`/txtadm userremove`|`<username>`|`/tadm ur`|
|Info|`/txtadm info`|`none`|`/tadm i`|
|Help|`/txtadm or /txtadm help`|`none`|`/tadm ?`|

**Please use `#` for line breaks.**

### json notation
```json
anythingUniqueValue: {
"WORLD" : "worldName",
"Xvec" : 128,
"Yvec" : 90,
"Zvec" : 128,
"TITLE" : "title",
"TEXT" : "1st Line#2nd Line..."
}
```
It is output as follows.
<img src="https://cloud.githubusercontent.com/assets/16377174/24609877/642d64f6-18b7-11e7-9b38-488e0ada3f1e.JPG" width="320px">

***
<a name="jpn"></a>
## 日本語

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

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

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

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

### コマンド
#### 一般用コマンド
| \ |コマンド|引数|エイリアス|
|:--:|:--:|:--:|:--:|
|浮き文字追加|`/txt add`|`<タイトル> [テキスト]`|`/txt a`|
|浮き文字削除|`/txt remove`|`<ID>`|`/txt r`|
|浮き文字更新|`/txt update`|`<タイトル, テキスト> <ID> <メッセージ>`|`/txt u`|
|ヘルプ|`/txt or /txt help`|`無し`|`/txt ?`|

#### 管理用コマンド
| \ |コマンド|引数|エイリアス|
|:--:|:--:|:--:|:--:|
|浮き文字すべて削除|`/txtadm allremove`|`none`|`/tadm ar`|
|ユーザーの浮き文字を削除|`/txtadm userremove`|`<username>`|`/tadm ur`|
|浮き文字の各種情報を見る|`/txtadm info`|`none`|`/tadm i`|
|ヘルプ|`/txtadm or /txtadm help`|`none`|`/tadm ?`|

**改行の際には `#` を使用してください。**

### json記法
```json
{
"一意な文字列": {
"WORLD" : "world",
"Xvec" : 128,
"Yvec" : 90,
"Zvec" : 128,
"TITLE" : "title",
"TEXT" : "1st Line#2nd Line"
}
}
```

こう書くことで以下のように出力されます。
<img src="https://cloud.githubusercontent.com/assets/16377174/24609877/642d64f6-18b7-11e7-9b38-488e0ada3f1e.JPG" width="320px">
Binary file added 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.
35 changes: 35 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Texter
main: Texter\Main
version: 2.2.4
api:
- 3.0.0
- 3.0.0-ALPHA8
- 3.0.0-ALPHA9 #pmmp/PocketMine-MP

author: yuko_fuyutsuki
authors:
# SpecialThanks(敬称略)
- mfmfnek0
- onebone
- ogiwara
- Shootsta_ERU0531
- Toganon
- ShadowArt
- Marron0421
website: https://twitter.com/_riu_m

permissions:
texter.*:
default: op
description: "permission that allows player to use texter"
children:
texter.command.*:
default: op
description: "permission that allows player to use texter"
children:
texter.command.txt:
default: true # もしopのみ実行させたい場合は op と記述してください
description: "permission that allows player to use /txt"
texter.command.txtadm:
default: op
description: "permission that allows player to use /txtadm"
38 changes: 38 additions & 0 deletions resources/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
configVersion: 22

# 日本語 ガイド
# eng guide

# Texter 設定ファイル
# Texter config file

# 言語を設定してください (eng or jpn)
# set language (eng or jpn)
language: jpn

# タイムゾーンを設定してください
# set timezone
timezone: Asia/Tokyo

# もし起動時にアップデートの通知が必要ならtrue, 必要ないならfalseにしてください
# When set to true, update notification is displayed at startup
checkUpdate: true

# コマンドを使用不可にしたい場合はfalseにしてください
# If you want to disable the command, prease set it to false
canUseCommands: true

# 文字数の制限をする場合は文字数を, 不要なら -1 にしてください
# To limit the number of characters, set it to that, if unnecessary, set it to -1.
limit: 50

# 改行数の制限をする場合は改行回数を、不要なら -1 にしてください
# To limit the number of line feeds, set it to that, if unnecessary, set it to -1.
feed: 3

# テキストを設置不可能なワールドを設定する場合はワールド名を指定してください
# Please specify the world name when setting the world where text can not be set up
world:
# example
# - world
# - world-2
26 changes: 26 additions & 0 deletions resources/crfts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"0":{
"WORLD": "world",
"Xvec": 128,
"Yvec": 90,
"Zvec": 128,
"TITLE": "タイトル",
"TEXT": "テキスト(\nを入れると改行)"
},
"1":{
"WORLD": "world",
"Xvec": 128,
"Yvec": 90,
"Zvec": 130,
"TITLE": "タイトル",
"TEXT": "テキスト(\nを入れると改行)"
},
"2":{
"WORLD": "world",
"Xvec": 128,
"Yvec": 90,
"Zvec": 132,
"TITLE": "タイトル",
"TEXT": "テキスト(\nを入れると改行)"
}
}
2 changes: 2 additions & 0 deletions resources/fts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
83 changes: 83 additions & 0 deletions src/Texter/EventListener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
namespace Texter;

# Pocketmine
use pocketmine\Player;
use pocketmine\event\{
Listener,
player\PlayerJoinEvent,
entity\EntityLevelChangeEvent};

# Texter
use Texter\task\{
WorldGetTask,
WorldGetTaskOld};
use Texter\text\{
CantRemoveFloatingText as CRFT,
FloatingText as FT};

/**
* EventListener
*/
class EventListener implements Listener{

/** @var Main $main */
private $main = null;
/** @var TexterApi $api */
private $api = null;

public function __construct(Main $main){
$this->main = $main;
$this->api = $main->getApi();
}

public function onJoin(PlayerJoinEvent $e){
$p = $e->getPlayer();
$lev = $p->getLevel();
$crfts = $this->api->getCrftsByLevel($lev);
if (!empty($crfts)) {
foreach ($crfts as $crft) {
$crft->sendToPlayer($p, CRFT::SEND_TYPE_ADD);
}
}
$fts = $this->api->getFtsByLevel($lev);
if (!empty($fts)) {
foreach ($fts as $ft) {
$ft->sendToPlayer($p, FT::SEND_TYPE_ADD);
}
}
}

public function onLevelChange(EntityLevelChangeEvent $e){
$p = $e->getEntity();
if ($p instanceof Player) {
$lev = $p->getLevel();
$crfts = $this->api->getCrftsByLevel($lev);
if (!empty($crfts)) {
foreach ($crfts as $crft) {
$crft->sendToPlayer($p, CRFT::SEND_TYPE_REMOVE);
}
}
$fts = $this->api->getFtsByLevel($lev);
if (!empty($fts)) {
foreach ($fts as $ft) {
$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;
}
}
}
}
Loading

0 comments on commit 2619773

Please sign in to comment.