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

Add Buying and selling plots #345

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 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
4271ff5
Shrink the diff
jasonw4331 Oct 5, 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
Match to master branch
jasonw4331 committed Oct 5, 2020
commit 72f8aa170f0685441a2df516b3d29813ccc143c7
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);
}
}