Skip to content
This repository has been archived by the owner on Oct 29, 2022. It is now read-only.

Add Plot buy/selling #343

Merged
merged 31 commits into from
Oct 6, 2020
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4e4052e
Add Plot Selling and Buying
DerDevHD Oct 1, 2020
2d0cb0a
Update JSON-Provider and done some fixes
DerDevHD Oct 2, 2020
5dd030c
Sorry Jason
DerDevHD Oct 2, 2020
6cad1d8
Revert "Sorry Jason"
DerDevHD Oct 2, 2020
0748172
Add Plot-Popup
DerDevHD Oct 3, 2020
0afe72d
Add german translations
DerDevHD Oct 3, 2020
e6ef831
Fix the quotes
DerDevHD Oct 4, 2020
d2d6832
fix quotes
DerDevHD Oct 4, 2020
9c8db2d
Submit requested changes
DerDevHD Oct 4, 2020
d55ca82
fix missing '='
DerDevHD Oct 4, 2020
a855666
Remove stuff which was outside of current PR
DerDevHD Oct 4, 2020
2dbf752
Only load economy related commands if economy is loaded
jasonw4331 Oct 4, 2020
5f81f32
when buying a plot without economy, refer to claim command
jasonw4331 Oct 4, 2020
923de21
Buy command changes
jasonw4331 Oct 4, 2020
7a7d67b
Sell command changes
jasonw4331 Oct 4, 2020
7dfa09c
sold plot popup changes
jasonw4331 Oct 4, 2020
14fcd7a
We don't do hypotheticals here
jasonw4331 Oct 4, 2020
8e3bf1e
Command is not registered without economy
jasonw4331 Oct 4, 2020
1fc8c30
use events in new API
jasonw4331 Oct 4, 2020
5a80add
Better doc descriptions
jasonw4331 Oct 4, 2020
5c1cdee
forgot this earlier
jasonw4331 Oct 4, 2020
30ece71
cannot sell if price is less than 0
jasonw4331 Oct 5, 2020
8da354e
We don't import functions like PocketMine
jasonw4331 Oct 5, 2020
72f8aa1
Match to master branch
jasonw4331 Oct 5, 2020
876afed
Shrinking the diff
jasonw4331 Oct 5, 2020
6dd0610
translation changes
jasonw4331 Oct 5, 2020
41accef
Shrink the diff
jasonw4331 Oct 5, 2020
cc16fa6
Updated time stamps and credit DerDevHD
jasonw4331 Oct 5, 2020
2793e6e
Load economy before commands
jasonw4331 Oct 6, 2020
18d7aa3
Display for-sale message to all except owner
jasonw4331 Oct 6, 2020
cdf9784
Display fail message when something goes wrong
jasonw4331 Oct 6, 2020
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
Prev Previous commit
Next Next commit
Update JSON-Provider and done some fixes
DerDevHD authored and jasonw4331 committed Oct 5, 2020
commit 2d0cb0a304afbe7facac5c6afb673fe852fee465
4 changes: 3 additions & 1 deletion src/MyPlot/provider/YAMLDataProvider.php
Original file line number Diff line number Diff line change
@@ -116,6 +116,7 @@ public function getPlotsByOwner(string $owner, string $levelName = "") : array {
if($levelName != "") {
/** @var int[] $levelKeys */
$levelKeys = array_keys($plots, $levelName);
/** @var int[] $ownerKeys */
$ownerKeys = array_keys($plots, $owner);
foreach($levelKeys as $levelKey) {
foreach($ownerKeys as $ownerKey) {
@@ -159,7 +160,7 @@ public function getPlotsByOwner(string $owner, string $levelName = "") : array {
*
* @return Plot|null
*/
public function getNextFreePlot(string $levelName, int $limitXZ = 0) : ?plot {
public function getNextFreePlot(string $levelName, int $limitXZ = 0) : ?Plot {
$plotsArr = $this->yaml->get("plots", []);
for($i = 0; $limitXZ <= 0 or $i < $limitXZ; $i++) {
$existing = [];
@@ -204,6 +205,7 @@ public function getNextFreePlot(string $levelName, int $limitXZ = 0) : ?plot {
}

public function close() : void {
$this->yaml->save(); // why don't save it on close??
unset($this->yaml);
}
}