Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
cca2128
Update config.yml
skyss0fly Jun 3, 2023
71fcb21
Update Main.php
skyss0fly Jun 3, 2023
898e4bc
Update Main.php
skyss0fly Jun 3, 2023
8b23ca1
Update Main.php
skyss0fly Jun 3, 2023
376b974
Update config.yml
skyss0fly Jun 3, 2023
232d4d5
Update Main.php
skyss0fly Jun 3, 2023
07322ee
Update Main.php
skyss0fly Jun 3, 2023
7bdfa8c
Update Main.php
skyss0fly Jun 3, 2023
1c132c7
Update Main.php
skyss0fly Jun 3, 2023
af2fce4
Update config.yml
skyss0fly Jun 3, 2023
7affa11
Update Main.php
skyss0fly Jun 3, 2023
60a7785
Update Main.php
skyss0fly Jun 3, 2023
eb893c3
Update Main.php
skyss0fly Jun 3, 2023
5f55fec
Update Main.php
skyss0fly Jun 3, 2023
306537f
Update config.yml
skyss0fly Jun 3, 2023
dedb791
Create simpleform.php
skyss0fly Jun 3, 2023
b2896b7
Update simpleform.php
skyss0fly Jun 3, 2023
412af34
Create form.php
skyss0fly Jun 3, 2023
8679d7b
Rename src/skyss0fly/welcomemessage/simpleform.php to src/skyss0fly/w…
skyss0fly Jun 3, 2023
96fb1c5
Update Main.php
skyss0fly Jun 3, 2023
5c9f7b5
Update simpleform.php
skyss0fly Jun 3, 2023
2a27712
Update form.php
skyss0fly Jun 3, 2023
dead0c7
Update Main.php
skyss0fly Jun 3, 2023
19b57b7
Update Main.php
skyss0fly Jun 3, 2023
1e743b7
Update Main.php
skyss0fly Jun 3, 2023
f1a716a
Update Main.php
skyss0fly Jun 3, 2023
99659ed
Update Main.php
skyss0fly Jun 3, 2023
9823976
Update Main.php
skyss0fly Jun 3, 2023
2be1285
Update Main.php
skyss0fly Jun 3, 2023
217a447
Update Main.php
skyss0fly Jun 3, 2023
0abfa33
Update Main.php
skyss0fly Jun 3, 2023
7f3285a
Update config.yml
skyss0fly Jun 3, 2023
dd57897
Update plugin.yml
skyss0fly Jun 3, 2023
a4edebf
Update config.yml
skyss0fly Jun 14, 2023
6bc8bf3
Update Main.php
skyss0fly Jun 14, 2023
a7d4568
Update Main.php
skyss0fly Jun 15, 2023
1177c89
Create Rules.php
skyss0fly Jun 15, 2023
84199c6
Update Main.php
skyss0fly Jun 16, 2023
58daf33
Update Main.php
skyss0fly Jun 16, 2023
82d9ab1
Update Main.php
skyss0fly Jun 16, 2023
edd65af
Update Main.php
skyss0fly Jun 16, 2023
d334956
Delete Rules.php
skyss0fly Jun 16, 2023
4307501
Update Main.php
skyss0fly Jun 16, 2023
3999734
Update README.md
skyss0fly Jun 16, 2023
e57081d
Update Main.php
skyss0fly Jun 16, 2023
137ee22
Rename form.php to Form.php
skyss0fly Jun 16, 2023
0cd9854
Rename simpleform.php to SimpleForm.php
skyss0fly Jun 16, 2023
cef96a0
Update Main.php
skyss0fly Jun 16, 2023
5ae3e5c
Update Main.php
skyss0fly Jun 17, 2023
af08de3
Update Main.php
skyss0fly Jun 17, 2023
10ac2e4
Update Main.php
skyss0fly Jun 17, 2023
8df1cda
Scrapped 1.10 Update Until further Notice
skyss0fly Jun 17, 2023
ca439a4
Update README.md
skyss0fly Jun 17, 2023
c6bab10
Add files via upload
skyss0fly Jun 17, 2023
cf181a1
Update index.md
skyss0fly Jun 17, 2023
328500a
Pause 1.10 Development
skyss0fly Jun 17, 2023
8c74cab
Update Main.php
skyss0fly Jan 20, 2024
cea17ed
Update config.yml
skyss0fly Jan 20, 2024
a975905
Update Main.php
skyss0fly Jan 20, 2024
c6e510d
Merge pull request #10 from skyss0fly/Dev_1.10
skyss0fly Jan 20, 2024
d6e7e01
Update Main.php
skyss0fly Jan 20, 2024
1575179
Merge pull request #11 from skyss0fly/Dev_1.10
skyss0fly Jan 20, 2024
5207ccf
Update Main.php
skyss0fly Jan 20, 2024
f2b4f87
Merge pull request #12 from skyss0fly/Dev_1.10
skyss0fly Jan 20, 2024
dbe6bf9
Update Main.php
skyss0fly Jan 20, 2024
6a2c2ec
Merge pull request #13 from skyss0fly/Dev_1.10
skyss0fly Jan 20, 2024
e869bcb
Update Main.php
skyss0fly Jan 20, 2024
a8bfd30
Merge pull request #14 from skyss0fly/Dev_1.10
skyss0fly Jan 20, 2024
09913e9
Update config.yml
skyss0fly Dec 15, 2024
cf2d812
Rename ClassName and Implement 1.10 features
skyss0fly Dec 15, 2024
1abe6d9
Update Namespaces and File Names
skyss0fly Dec 15, 2024
bb6ab34
Fix typo
skyss0fly Dec 15, 2024
169a81b
Update Namespaces and File Names
skyss0fly Dec 15, 2024
adc0e3d
Add Configuration
skyss0fly Dec 15, 2024
ee28dc9
1.11 is Next
skyss0fly Dec 15, 2024
a3f454c
Update README.md
skyss0fly Dec 15, 2024
ad8d30e
Create 1.10.md
skyss0fly Dec 15, 2024
5e5fd17
Update Main.php
skyss0fly Dec 15, 2024
2c59157
Update Main.php
skyss0fly Dec 15, 2024
f47548c
Update Main.php
skyss0fly Dec 15, 2024
e1b8c87
Update Main.php
skyss0fly Dec 15, 2024
3c37e70
Update Main.php
skyss0fly Dec 15, 2024
11d1f0e
Merge pull request #15 from skyss0fly/Next-Update
skyss0fly Dec 15, 2024
d63de5d
Bump Version for Poggit. 2.1 Next Update
skyss0fly Dec 15, 2024
a91ca39
Semantic Versioning. 2.2 is Next
skyss0fly Dec 15, 2024
b68f67f
Rename 1.10.md to 2.1.md
skyss0fly Dec 15, 2024
62e8218
Update README.md
Zalgo-Dev Dec 27, 2024
35d2910
Merge pull request #20 from Zalgo-Dev/main
skyss0fly Feb 28, 2025
9f31e15
Update index.md
skyss0fly Feb 28, 2025
6fabefe
Update index.md
skyss0fly Feb 28, 2025
90f94d9
Bump version to 2.2 and API to 6.0.0
skyss0fly Oct 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions DOCS/1.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Documentation on Welcome Message

## Features in this Version:
> - Customisable:
> > Prefix, Message, ServerName

## How To Install:
> 1. Download the Plugin <a href="https://poggit.pmmp.io/p/WelcomeMessage/1.7">Here</a>
> 2. Put the Plugin in your Plugins Folder
> 3. Restart/Start/Stop & Start your Server
> 4. go to `plugin_data -> WelcomeMessage -> Config.yml` and Edit the values to how you like it
**Done**
12 changes: 12 additions & 0 deletions DOCS/1.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Documentation on Welcome Message

## Features in this Version:
> - Customisable:
> > Prefix, Message, ServerName, Whisper Or Broadcast

## How To Install:
> 1. Download the Plugin <a href="https://poggit.pmmp.io/p/WelcomeMessage/1.8">Here</a>
> 2. Put the Plugin in your Plugins Folder
> 3. Restart/Start/Stop & Start your Server
> 4. go to `plugin_data -> WelcomeMessage -> Config.yml` and Edit the values to how you like it
**Done**
18 changes: 18 additions & 0 deletions DOCS/1.9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Documentation on Welcome Message

## Features in this Version:
> - Customisable:
> > Prefix, Message, ServerName Customisable In a Form

## How To Install:
> 1. Download the Plugin <a href="https://poggit.pmmp.io/p/WelcomeMessage/1.9">Here</a>
> 2. Put the Plugin in your Plugins Folder
> 3. Restart/Start/Stop & Start your Server
> 4. go to `plugin_data -> WelcomeMessage -> Config.yml` and Edit the values to how you like it
>
**Done**

# Disclaimer
** if you have a previous version of this plugin you must delete the config in `plugin_data -> WelcomeMessage -> config.yml` and delete the prexesisting plugin phar file, then reinstall the plugin for it to work!**
** Required Dependencies:**
jojoe77777/FormAPI
20 changes: 20 additions & 0 deletions DOCS/2.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Documentation on Welcome Message

## Features in this Version:
> - Customisable Prefix,
> - Customisable Message,
> - Customisable ServerName Customisable In a Form,
> - The Ability to chose to have a leave message and if you want the welcome message in a form or chat

## How To Install:
> 1. Download the Plugin <a href="https://poggit.pmmp.io/p/WelcomeMessage/1.9">Here</a>
> 2. Put the Plugin in your Plugins Folder
> 3. Restart/Start/Stop & Start your Server
> 4. go to `plugin_data -> WelcomeMessage -> Config.yml` and Edit the values to how you like it
>
**Done**

# Disclaimer
** if you have a previous version of this plugin you must delete the config in `plugin_data -> WelcomeMessage -> config.yml` and delete the prexesisting plugin phar file, then reinstall the plugin for it to work!**
** Required Dependencies:**
jojoe77777/FormAPI
12 changes: 12 additions & 0 deletions DOCS/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Documentation for WelcomeMessage

> Click <a href="https://github.com/skyss0fly/WelcomeMessage/blob/main/DOCS/1.7.md">Here </a> For Documentation on V1.7 <br>
> Click <a href="https://github.com/skyss0fly/WelcomeMessage/blob/main/DOCS/1.8.md">Here </a> For Documentation on V1.8 <br>
> Click <a href="https://github.com/skyss0fly/WelcomeMessage/blob/main/DOCS/1.9.md">Here </a> For Documentation on V1.9 <br>
Click <a href="https://github.com/skyss0fly/WelcomeMessage/blob/main/DOCS/1.21.md">Here </a> For Documentation on V1.21 <br>

# Current Versions In Development:
**V1.22**
introduction of rules tab

# Development Has Been slowed due to me no longer having as much time to develop.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Simple on the fly customisable welcome message.
- 5.X.X

# thanks to the following for helping me construct this plugin:
- <a href="https://github.com/Zalgo-Dev">ZalgoDev</a>
- <a href="https://github.com/SOF3">SOFe</a>
- <a href="https://github.com/Inaay">Inaayat</a>
- RuzBenzy (kinda, just gave like 1 suggestion)
Expand All @@ -25,3 +26,6 @@ Simple on the fly customisable welcome message.
https://poggit.pmmp.io/p/WelcomeMessage
<p></p>
^^ Download the Latest Flavour of WelcomeMessage ^^



6 changes: 3 additions & 3 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: WelcomeMessage
main: skyss0fly\welcomemessage\Main
version: 1.8
api: 5.0.0
main: skyss0fly\WelcomeMessage\Main
version: 2.2
api: 6.0.0
author: ["skyss0fly", "Inaayat"]
description: A simple welcome message plugin thats customizable
21 changes: 15 additions & 6 deletions resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
#config
Form-Title: "Welcome!"
Submit-Msg: "Submit"
Form-Content: "Welcome"
Btn1: "Rules"

# Use {player} for the player name
# Use & for color
UseFormInsteadOfChat: true
# set to false if you want to use chat instead of form as welcoming..

Prefix: "&l&o&cName"
Message: "&aWelcome to our server, {player}! &cWe hope you enjoy your stay at "
ServerName: "&cName"
JoinMessage: "{player} Welcome to the Server"
# if the UseFormInsteadOfChat is false then this will show instead of form

BroadcastToServer: true

# Leave Message Values:
# {player} - gives player name

LeaveMessage: "{player} Has left the server"

LeaveMessageEnabled: true
56 changes: 56 additions & 0 deletions src/skyss0fly/WelcomeMessage/Form/Form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types = 1);

namespace skyss0fly\WelcomeMessage\Form;

use pocketmine\form\Form as IForm;
use pocketmine\player\Player;

abstract class Form implements IForm{

/** @var array */
protected array $data = [];
/** @var callable|null */
private $callable;

/**
* @param callable|null $callable
*/
public function __construct(?callable $callable) {
$this->callable = $callable;
}

/**
* @deprecated
* @see Player::sendForm()
*
* @param Player $sender
*/
public function sendToPlayer(Player $sender) : void {
$sender->sendForm($this);
}

public function getCallable() : ?callable {
return $this->callable;
}

public function setCallable(?callable $callable) {
$this->callable = $callable;
}

public function handleResponse(Player $sender, $data) : void {
$this->processData($data);
$callable = $this->getCallable();
if($callable !== null) {
$callable($sender, $data);
}
}

public function processData(mixed &$data) : void {
}

public function jsonSerialize():mixed{
return $this->data;
}
}
76 changes: 76 additions & 0 deletions src/skyss0fly/WelcomeMessage/Form/SimpleForm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

declare(strict_types = 1);

namespace skyss0fly\WelcomeMessage\Form;

class SimpleForm extends Form {

const IMAGE_TYPE_PATH = 0;
const IMAGE_TYPE_URL = 1;

/** @var string */
private $content = "";

private $labelMap = [];

/**
* @param callable|null $callable
*/
public function __construct(?callable $callable) {
parent::__construct($callable);
$this->data["type"] = "form";
$this->data["title"] = "";
$this->data["content"] = $this->content;
$this->data["buttons"] = [];
}

public function processData(mixed &$data): void {
$data = $this->labelMap[$data] ?? null;
}

/**
* @param string $title
*/
public function setTitle(string $title) : void {
$this->data["title"] = $title;
}

/**
* @return string
*/
public function getTitle() : string {
return $this->data["title"];
}

/**
* @return string
*/
public function getContent() : string {
return $this->data["content"];
}

/**
* @param string $content
*/
public function setContent(string $content) : void {
$this->data["content"] = $content;
}

/**
* @param string $text
* @param int $imageType
* @param string $imagePath
* @param string $label
*/
public function addButton(string $text, int $imageType = -1, string $imagePath = "", ?string $label = null) : void {
$content = ["text" => $text];
if($imageType !== -1) {
$content["image"]["type"] = $imageType === 0 ? "path" : "url";
$content["image"]["data"] = $imagePath;
}
$this->data["buttons"][] = $content;
$this->labelMap[] = $label ?? count($this->labelMap);
}

}
60 changes: 60 additions & 0 deletions src/skyss0fly/WelcomeMessage/Main.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

namespace skyss0fly\WelcomeMessage;

use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\event\player\{PlayerJoinEvent, PlayerQuitEvent};
use skyss0fly\WelcomeMessage\Form\{Form, SimpleForm};
use pocketmine\player\Player;

class Main extends PluginBase implements Listener {

public function onEnable(): void {
$this->saveDefaultConfig();
$this->getServer()->getPluginManager()->registerEvents($this, $this);
}

public function onPlayerJoin(PlayerJoinEvent $event): void {
$player = $event->getPlayer();
$config = $this->getConfig();

if ($config->get("UseFormInsteadOfChat") === true) {
$joinForm = new SimpleForm(function (Player $player, $data) {
if ($data !== null) {
$submitMessage = $this->getConfig()->get("Submit-Msg");
$player->sendMessage($submitMessage);
}
});

$formTitle = $config->get("Form-Title");
$formContent = $config->get("Form-Content");

$joinForm->setTitle($formTitle);
$joinForm->setContent($formContent);
$joinForm->addButton("§d§lSubmit!");
$player->sendForm($joinForm);
} else {
$rawMessage = $config->get("JoinMessage");
$message = str_replace("{player}", $player->getName(), $rawMessage);
$this->getServer()->broadcastMessage($message);
}
}

public function onPlayerLeave(PlayerQuitEvent $event): void {
$player = $event->getPlayer();
$config = $this->getConfig();
$leaveMessageEnabled = $config->get("LeaveMessageEnabled");

if ($leaveMessageEnabled === true) {
$rawMessage = $config->get("LeaveMessage");
$message = str_replace("{player}", $player->getName(), $rawMessage);
$this->getServer()->broadcastMessage($message);
} elseif ($leaveMessageEnabled === false) {
// No action required
} else {
$this->getLogger()->error("Invalid value for 'LeaveMessageEnabled'. Disabling plugin to protect the server.");
$this->getServer()->getPluginManager()->disablePlugin($this);
}
}
}
34 changes: 0 additions & 34 deletions src/skyss0fly/welcomemessage/Main.php

This file was deleted.