Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #21 from JaxkDev/1.4.1
Browse files Browse the repository at this point in the history
Release 1.4.1
  • Loading branch information
JaxkDev authored Dec 4, 2019
2 parents edf6c21 + de09109 commit 300f1b3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .poggit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/Jackthehaxk21/MCPE_DISCORD
---
branches:
- master
projects:
Expand Down
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/jackthehack21/MCPEToDiscord.svg?branch=master)](https://travis-ci.org/jackthehack21/MCPEToDiscord) [![HitCount](http://hits.dwyl.io/Jackthehack21/MCPEToDiscord.svg)](http://hits.dwyl.io/Jackthehack21/MCPEToDiscord)
[![Build Status](https://travis-ci.org/JaxkDev/MCPEToDiscord.svg?branch=master)](https://travis-ci.org/JaxkDev/MCPEToDiscord) [![HitCount](http://hits.dwyl.io/JaxkDev/MCPEToDiscord.svg)](http://hits.dwyl.io/JaxkDev/MCPEToDiscord)

<a href="https://tiny.cc/JaxksDC"><img src="https://discordapp.com/api/guilds/554059221847638040/embed.png" alt="Discord server"/></a>

Expand All @@ -11,16 +11,10 @@

- NiekertDev (Async Tasks) (https://github.com/NiekertDev)

## Whats new in 1.4
## Whats new in 1.4.1

- Traditional and simplified chinise support split into two files
- Added PurePerms Support to add the {group} variable
- Added FactionsPro Support to add the {faction} and {fac_rank} variables

We smashed 4 Bugs:
- No more 'send' being sent with message
- Removed the odd true & false bug
- Smashed back end glitches
- No more pings for you mister...
- Banned words list now in config.

### Known Bugs:
- No known Bugs at the current time of writing this.
Expand Down
8 changes: 3 additions & 5 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
name: MCPEToDiscord
author: Jackthehaxk21
version: 1.4
api:
- 3.0.0
- 3.1.1
author: JaxkDev
version: 1.4.1
api: 3.0.0
main: Jack\DiscordMCPE\Main

commands:
Expand Down
4 changes: 4 additions & 0 deletions resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ discord: true
pureperms: false
factions: false

banned_list:
- '@here'
- '@everyone'

webhook_url: ""
webhook_name: "MCPE Webhook"
webhook_playerChat?: true
Expand Down
43 changes: 16 additions & 27 deletions src/Jack/DiscordMCPE/Main.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
<?php

# +-------------------------------------------------+
# | MCPEToDiscord - VER 1.4 |
# |-------------------------------------------------|
# | |
# | Made by : Jackthehack21 ([email protected]) |
# | |
# | Version : 1.4 |
# | |
# | Details : This plugin is aimed to give players |
# | A simple but fun view of what plugins |
# | Can do to modify your MCPE experience.|
# | |
# +-------------------------------------------------+

namespace Jack\DiscordMCPE;

use pocketmine\plugin\PluginBase;
Expand All @@ -32,12 +18,7 @@
class Main extends PluginBase implements Listener{

public function onEnable(){
if (!is_dir($this->getDataFolder())) {
@mkdir($this->getDataFolder());
//Use default, not PM.
}
$this->build = "187A";
$this->version = "1.4";
$this->version = "1.4.1";
$this->saveResource("config.yml");
$this->saveResource("help.txt");
$this->cfg = new Config($this->getDataFolder()."config.yml", Config::YAML, []);
Expand Down Expand Up @@ -130,14 +111,12 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar
if($this->cfg->get('debug')){
$this->getLogger()->info(C::GOLD."=== DETAILS ===");
$this->getLogger()->info(C::GREEN."Name ".C::GOLD.":: ".C::AQUA."MCPEToDiscord");
$this->getLogger()->info(C::GREEN."Build ".C::GOLD.":: ".C::AQUA.$this->build);
$this->getLogger()->info(C::GREEN."Version ".C::GOLD.":: ".C::AQUA.$this->version);
$this->getLogger()->info(C::GREEN."Release ".C::GOLD.":: ".C::AQUA."Public Release - ".$this->build);
$this->getLogger()->info(C::GOLD.$this->responses->get('info_note'));
$sender->sendMessage(C::GOLD.$this->responses->get('debug_info_response'));
break;
} else {
$sender->sendMessage("Build - ".$this->build);
$sender->sendMessage("Versoon - ".$this->version);
break;
}
break;
Expand Down Expand Up @@ -215,7 +194,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar
break;

case 'credits':
$sender->sendMessage(C::GOLD.'— Credits —\n'.C::AQUA."NiekertDev (AsyncTasks)\n".C::GREEN."View his plugin on github and poggit !");
$sender->sendMessage(C::GOLD.'— Credits —\n'.C::AQUA."NiekertDev (AsyncTasks)\n".C::GREEN."View his plugin on github");
break;

default:
Expand Down Expand Up @@ -376,13 +355,23 @@ public function sendMessage(string $player = "nolog", string $msg){
}
$name = $this->cfg->get("webhook_name");
$webhook = $this->cfg->get("webhook_url");
$cleanMsg = $this->cleanMessage($msg);
$curlopts = [
"content" => $msg,
"content" => $cleanMsg,
"username" => $name
];

if($cleanMsg === ""){
$this->getLogger()->warning(C::RED."Warning: Empty message cannot be sent to discord.");
return;
}

$this->getServer()->getAsyncPool()->submitTask(new tasks\SendAsync($player, $webhook, serialize($curlopts)));
# OLD $this->getServer()->getScheduler()->scheduleAsyncTask(new tasks\SendAsync($player, $webhook, serialize($curlopts)));
return true;
return;
}

public function cleanMessage(string $msg) : string{
$banned = $this->cfg->get("banned_list", []);
return str_replace($banned,'',$msg);
}
}
15 changes: 0 additions & 15 deletions travis.sh

This file was deleted.

0 comments on commit 300f1b3

Please sign in to comment.