Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to v1.0.4-11 #18

Merged
merged 11 commits into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 53 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Create a festival with this custom area events plugin for Pocketmine Server ALPH
### Manage area's and run commmands attachted to area events.


![Festival command usage overview](https://genboy.net/wp-content/uploads/2018/03/festival_usage_1.0.3-11.png)
![Festival command usage overview](https://genboy.net/wp-content/uploads/2018/03/festival_usage_1.0.4-11.png)

###### Copyright [Genboy](https://genboy.net) 2018

---

## Info

# Festival

[![](https://poggit.pmmp.io/shield.api/Festival)](https://poggit.pmmp.io/p/Festival) [![](https://poggit.pmmp.io/shield.state/Festival)](https://poggit.pmmp.io/p/Festival)
Expand All @@ -41,13 +41,15 @@ Area

Flags

- Set flags true for players not to
- Set area flags true means

- edit: disallow building/breaking
- god: deny players god mode
- touch: disallow interaction with chests etc.
- msg: hide enter/leave messages
- edit: area is save from building/breaking
- god: players in the area are save in god mode
- touch: area is save from player interaction with chests/signs etc.
- msg: do not display area enter/leave messages
- passage: no passage for non-whitelisted players! (previously barrier flag)
- perms: player permissions are used to determine area command execution (experiment)
- drop: players can not drop things

Default & world specific flags in config.yml

Expand All @@ -62,7 +64,9 @@ Events
- list area commands (ordered by event)
- change event of area commands

Note! Area event commands are executed with op permission by players from the area.
Area event commands are executed by default with op permission by players from the area.
In v1.0.4-11 an experimental perms flag is added, functionality may change in the future;
perms flag true: area uses the player permissions (= without permission no commands/messages are triggered)

Config

Expand Down Expand Up @@ -96,12 +100,11 @@ Config

#### set the area flags (!defaults in config.yml)

/fe flag(f) <AREANAME> god/build/touch/msg/pass <true/false>
/fe flag(f) <AREANAME> <god/build/touch/drop/msg/pass/perms> <true/false>
#### fast flag toggle
/fe god/build/touch/msg/pass <AREANAME> (<true/false>)

/fe <god/build/touch/drop/msg/pass/perms> <AREANAME> (<true/false>)

#### see info on the area's you're in

Expand Down Expand Up @@ -171,7 +174,44 @@ The Festival plugin is in active development.

##### Development on [github.com/genboy/Festival](https://github.com/genboy/Festival)

### Log
#### Milestones

v1.0.0-11
- [x] area protection and flag management is stable
(core [iProtector](https://github.com/poggit-orphanage/iProtector), [9876ca3](https://github.com/poggit-orphanage/iProtector/commit/9876ca3acd48830599b3715346a1cf8ac964bdbd) Dec 2017)
- [x] Area messages and msg/description management are stable
- [x] Commands can be attachted to specific events at the area:
- [x] enter: on entering the area
- [x] center: when in the center of the area
- [x] leave: when leaving the area

v1.0.1-11
- [x] Submit to poggit
- [x] Testing expected possibilities; use as portals and shields, design a minigame park, create a quest/parcour..

v1.0.2-11 - v1.0.3-11
- [x] Passage flag; turning the area into a barrier, no one in, no one out.
- [x] /fe tp <areaname> now sends player to the area top-center and prevents fall damage

v1.0.4-11
- [x] Perms flag to use custom player permissions for area commands


If you like to help improve this plugin;

- download/use the plugin and give your feedback
- look at the code and give feedback
- both by submitting [issues @ github](https://github.com/genboy/Festival/issues) and/or [reviews @ poggit](https://poggit.pmmp.io/p/Festival)

or send an email to msg @ genboy.net

Thank you


---

### History


- 4 3 2018
- Release version 1.0.3-11 from [Dev Build #12](https://poggit.pmmp.io/ci/genboy/Festival/Festival/12)
Expand Down Expand Up @@ -226,6 +266,7 @@ The Festival plugin is in active development.
- add multiple commandstrings with id attachted to enter, leave or center area event
- list area extended info and manage event commands


#### Milestones

- [x] area protection and flag management is stable
Expand Down
6 changes: 3 additions & 3 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Festival
author: Genboy
version: 1.0.3-11
version: 1.0.4-11
main: genboy\Festival\Main
load: POSTWORLD
api: [3.0.0-ALPHA10,3.0.0-ALPHA11,3.0.0-ALPHA12]
api: [3.0.0-ALPHA10,3.0.0-ALPHA11]
website: "https://github.com/genboy/Festival"
commands:
fe:
description: "Allows you to manage Festival area's and events."
usage: "/fe <pos1/pos2/create/desc-flag-command-tp/here/list/delete> <AREANAME> <-add/enter/leave/center/list/edit/event/del-god/edit/touch/msg/barrier> <COMMANDID-true/false> <COMMANDSTRING-enter/leave/center>"
usage: "See info: /fe <list/here>; Create area: select 2 positions /fe <pos1/pos2>, then /fe create <AREANAME>; Toggle flags: /fe <FLAGNAME> <AREANAME>; Set commands: /fe command <AREANAME> <add/enter/center/leave> <COMMANDID> <COMMANDSTRING>; (Edit)del command: /fe command <AREANAME> <(edit)/del> <COMMANDID> (<COMMANDSTRING>); Change command event: /fe command <AREANAME> event <COMMANDID> <enter/center/leave>"
permission: festival.command.fe
permissions:
festival:
Expand Down
38 changes: 30 additions & 8 deletions resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@

# Festival options
Options:
# Messages tip or pop

# Messages (tip/pop)
Msgtype: pop

# Messages persist display to ops (off/op/on)
Msgdisplay: off

# Settings for unprotected areas in worlds without specific settings:
Default:

# Keep players from getting hurt?
# Keep players from getting hurt?
God: false

# Keep players from editing the world?
Edit: false
Edit: false

# Keep players from touching blocks and activating things like chests?
Touch: false
Expand All @@ -23,13 +27,19 @@ Default:
# Prevent players enter/leaving the area? Deny passage (previously barrier)
Passage: false

# Prevent players drop items in the area? Deny drop
Drop: false

# Player permission overwrite for area event command execution
Perms: false

# Settings for unprotected areas in individual worlds:
Worlds:

DEFAULT:

# Keep players from getting hurt?
God: false
# Keep players from getting hurt?
God: false

# Keep players from editing the world?
Edit: false
Expand All @@ -43,9 +53,15 @@ Worlds:
# Prevent players from enter/leaving the area? (previously barrier)
Passage: false

World:
# Prevent players drop items in the area? Deny drop
Drop: false

# Player permission overwrite for area event command execution
Perms: false

# Keep players from getting hurt?
World:

# Keep players from getting hurt?
God: false

# Keep players from editing the world?
Expand All @@ -59,3 +75,9 @@ Worlds:

# Prevent players from enter/leaving the area? (previously barrier)
Passage: false

# Prevent players drop items in the area? Deny drop
Drop: false

# Player permission overwrite for area event command execution
Perms: false
37 changes: 29 additions & 8 deletions src/genboy/Festival/Area.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
/** src/genboy/Festival/Area.php */
<?php declare(strict_types = 1);

declare(strict_types = 1);
/** src/genboy/Festival/Area.php */

namespace genboy\Festival;

Expand Down Expand Up @@ -112,9 +111,21 @@ public function setFlag(string $flag, bool $value) : bool{

/**
* @return string[]
*
* @return array
*/
public function getCommands() : array{
return $this->commands;

$arr = [];
if(is_array($this->commands)){
foreach($this->commands as $id => $cmd){
if( $cmd != '' && $cmd != ' ' && $cmd != 'null' ){
$arr[$id] = $cmd;
}
}
}
return $arr;

}

/**
Expand All @@ -133,9 +144,21 @@ public function getCommand(string $id) : bool{

/**
* @return string[]
*
* @return array
*/
public function getEvents() : array{
return $this->events;

$arr = [];
if(is_array($this->events)){
foreach($this->events as $nm => $ids){
if( $ids != '' && $ids != ' ' && $ids != 'null' ){
$arr[$nm] = $ids;
}
}
}

return $arr;
}

/**
Expand All @@ -145,11 +168,9 @@ public function setEvent( string $type, string $cmdid) : array{
return true;
}



/**
* @param Vector3 $pos
* @param string $levelName
* @param string $levelName
*
* @return bool
*/
Expand Down
Loading