mirror of
https://github.com/farcasclaudiu/QRcraft.git
synced 2026-06-29 13:01:29 +03:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7727a91d69 | |||
| 1d31b9e11d | |||
| 2a34b3f605 | |||
| d01098db1a | |||
| cb5037834d | |||
| 23ebcce081 | |||
| b52e8d3ecd | |||
| 6563ba887c |
@@ -1,6 +1,6 @@
|
||||
#QRcraft
|
||||
|
||||
Plugin for PocketMine-MP for creating QR panels (made from white and black wood blocks)
|
||||
Plugin for PocketMine-MP for creating QR code panels (made from white and black wool blocks)
|
||||
|
||||
Copyright (C) 2014 Clodyx <https://github.com/farcasclaudiu/QRcraft>
|
||||
|
||||
@@ -19,11 +19,11 @@ Plugin for PocketMine-MP for creating QR panels (made from white and black wood
|
||||
|
||||
ONLY OPs during gameplay (creative preferred)
|
||||
* `/qr` - shows help page
|
||||
* `/qrt <url>` - test QR text/url to count number of needed blocks (NxN)
|
||||
* `/qrc <url> [Auto|horizontal|vertical]` - create QR panel/block
|
||||
* `/qrl` - list QR panels IDs
|
||||
* `/qrd <ID>` - delete QR panel by ID (fills panel space with air)
|
||||
* `/qrp <ID>` - teleport you nearby QR panel with specified ID (IN WORK)
|
||||
* `/qrt <url>` - test QR code text/url to count number of needed blocks (NxN)
|
||||
* `/qrc <url> [Auto|horizontal|vertical]` - create QR code panel
|
||||
* `/qrl` - list QR code panels IDs
|
||||
* `/qrd <ID>` - delete QR code panel by ID (fills panel space with air)
|
||||
* `/qrp <ID>` - teleports the player nearby QR code panel with specified ID
|
||||
|
||||
Example:
|
||||
* `/qrt http://google.com`
|
||||
@@ -32,23 +32,23 @@ Example:
|
||||
```
|
||||
* `/qrc http://google.com` - begins the creation for specified url in auto mode
|
||||
```
|
||||
"QR block defined a (27x27) for 'http://google.com'"
|
||||
"QR panel defined a (27x27) for 'http://google.com'"
|
||||
"Touch a block to create it!"
|
||||
- NOW the player has to touch another block to create the QR planel.
|
||||
- NOW the player has to touch another block to create the QR code panel.
|
||||
- the new panel will be created above touched block and to the player right side.
|
||||
- in auto mode, is player is inclined forward pointing downwards,
|
||||
the QR panel will be generated horizontally,
|
||||
the QR code panel will be generated horizontally,
|
||||
otherwise it will be generated vertically.
|
||||
"QR block [1] created OK!"
|
||||
"QR panel [1] created OK!"
|
||||
```
|
||||
* `/qrc http://google.com h` - begins the creation for specified url in horizontal mode
|
||||
```
|
||||
"QR block defined h (27x27) for 'http://google.com'"
|
||||
"QR panel defined h (27x27) for 'http://google.com'"
|
||||
"Touch a block to create it!"
|
||||
- now the player touches the block to build above.
|
||||
"QR block [2] created OK!"
|
||||
"QR panel [2] created OK!"
|
||||
```
|
||||
* `/qrl` - list current defined QR panels
|
||||
* `/qrl` - list current defined QR code panels
|
||||
```
|
||||
"--------------"
|
||||
"QR LIST"
|
||||
@@ -61,9 +61,13 @@ Example:
|
||||
```
|
||||
"QR panel [2] deleted."
|
||||
```
|
||||
* `/qrp 2` - teleports the player nearby QR panel with ID 2
|
||||
```
|
||||
"You've been teleported nearby QR panel [2]."
|
||||
```
|
||||
|
||||
## Configuration
|
||||
No configuration needed for this moment.
|
||||
No configuration needed.
|
||||
|
||||
## Permissions
|
||||
|
||||
@@ -76,4 +80,9 @@ No configuration needed for this moment.
|
||||
PocketMine-MP version min 1.0.0
|
||||
|
||||
## Releases
|
||||
```
|
||||
[1.0.3] - fix backslash crash
|
||||
[1.0.2] - implemented teleport player nearby QR code panel
|
||||
[1.0.1] - improvements
|
||||
[1.0.0] - initial release
|
||||
```
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
name: QRcraft
|
||||
version: 1.0.1
|
||||
version: 1.0.4
|
||||
api: 1.0.0
|
||||
main: clodyx\qrcraft\QRcraftPlugIn
|
||||
author: Clodyx
|
||||
@@ -18,10 +18,10 @@ commands:
|
||||
description: "List QR panels IDs"
|
||||
permission: clodyx.plugin.qrcraft
|
||||
qrd:
|
||||
description: "delete QR panel by ID"
|
||||
description: "Delete QR panel by ID"
|
||||
permission: clodyx.plugin.qrcraft
|
||||
qrp:
|
||||
description: "teleport nearby QR panel by ID"
|
||||
description: "Teleport nearby QR panel by ID"
|
||||
permission: clodyx.plugin.qrcraft
|
||||
permissions:
|
||||
clodyx.plugin.qrcraft:
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace clodyx\qrcraft;
|
||||
use pocketmine\command\Command;
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\command\CommandExecutor;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\Player;
|
||||
|
||||
|
||||
@@ -105,7 +106,37 @@ class QRcraftCommand
|
||||
}
|
||||
break;
|
||||
case "qrp":
|
||||
//todo
|
||||
if (!isset($this->pgin->qrlist) || count($this->pgin->qrlist) == 0) {
|
||||
$player->sendMessage("QR panel list is empty!");
|
||||
} else {
|
||||
if (isset ($args [0])) {
|
||||
$idToTP = $args[0];
|
||||
$qrItem = null;
|
||||
foreach ($this->pgin->qrlist as $li) {
|
||||
if ($idToTP == $li[0]) {
|
||||
$qrItem = $li;
|
||||
}
|
||||
}
|
||||
if(isset($qrItem) && !is_null($qrItem) )
|
||||
{
|
||||
//get qr code panel coords
|
||||
$coord = $qrItem[3];
|
||||
$coord[0] = $coord[0] - 2;
|
||||
$coord[2] = $coord[2] - 2;
|
||||
//tp playr
|
||||
$player->teleport(new Vector3($coord[0], $coord[1], $coord[2]));
|
||||
$player->sendMessage("You've been teleported nearby QR panel [$idToTP].");
|
||||
}
|
||||
else
|
||||
{
|
||||
$player->sendMessage("QR panel [$idToTP] not found.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->showusage($sender);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->showusage($sender);
|
||||
@@ -124,7 +155,7 @@ class QRcraftCommand
|
||||
$player->sendMessage("QRcraft usage:");
|
||||
$player->sendMessage("/qr - help page");
|
||||
$player->sendMessage("/qrt <url> - test QR text size");
|
||||
$player->sendMessage("/qrc <url> [Auto|horizontal|vertical] - create qr panel");
|
||||
$player->sendMessage("/qrc <url> [Auto|horizontal|vertical] - create QR panel");
|
||||
$player->sendMessage("/qrl - list QR panels IDs");
|
||||
$player->sendMessage("/qrd <ID> - detele QR panel by ID");
|
||||
$player->sendMessage("/qrp <ID> - teleport nearby QR panel by ID");
|
||||
|
||||
@@ -45,10 +45,7 @@ class QRcraftPlugIn extends PluginBase implements CommandExecutor
|
||||
|
||||
public function loadConfiguration()
|
||||
{
|
||||
if (!file_exists($this->getDataFolder() . "config.yml")) {
|
||||
@mkdir($this->getDataFolder());
|
||||
file_put_contents($this->getDataFolder() . "config.yml", $this->getResource("config.yml"));
|
||||
}
|
||||
$this->saveDefaultConfig();
|
||||
}
|
||||
|
||||
public function onDisable()
|
||||
@@ -83,4 +80,4 @@ class QRcraftPlugIn extends PluginBase implements CommandExecutor
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
namespace clodyx\qrcraft;
|
||||
|
||||
|
||||
include(__DIR__ . "\..\..\clodyx\phpqrcode\phpqrcode.php");
|
||||
include(__DIR__ . "/../../clodyx/phpqrcode/phpqrcode.php");
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\block\Block as BlockAPI;
|
||||
@@ -201,7 +201,7 @@ class QRhelper
|
||||
$session["create"] = true;
|
||||
|
||||
|
||||
$player->sendMessage("QR block defined $orientation (" . $size . "x" . $size . ") for '" . $url . "'");
|
||||
$player->sendMessage("QR panel defined $orientation (" . $size . "x" . $size . ") for '" . $url . "'");
|
||||
$player->sendMessage("Touch a block to create it!");
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ class QRhelper
|
||||
$session["create"] = false;
|
||||
$session["size"] = 0;
|
||||
|
||||
$player->sendMessage("QR block [$qrID] created OK!");
|
||||
$player->sendMessage("QR panel [$qrID] created OK!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user