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

Commit

Permalink
Shrink the diff
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonw4331 committed Oct 5, 2020
1 parent 6dd0610 commit 4271ff5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 31 deletions.
3 changes: 1 addition & 2 deletions resources/deu.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
; Updated time : 1/10/2020

; Popup when entering a plot
popup=Du hast das Grundstück {%0} betreten.
popup=Du hast das Grundstück {%0} betreten
popup.owner=Dieses Grundstück gehört {%0}
popup.forsale=Du kannst dieses Grundtück für ${%0} kaufen
popup.available=Dieses Grundstück ist verfügbar! Benutze /p claim, um es zu beanspruchen.
Expand All @@ -23,7 +23,6 @@ error=Ups! Irgendetwas ist falsch gelaufen!
notinplot=Du befindest dich nicht auf einem Grundstück.
notowner=Dieses Grundstück gehört dir nicht!
plugin.disabled=Dieses Plugin ist deaktiviert
noeconomy="Das Plugin benutzt kein valides Economy System. Um dieses Feture zu benutzen, stelle sicher dass du ein solches Plugin benutzt."

confirm=confirm

Expand Down
9 changes: 2 additions & 7 deletions resources/langtemplate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

; Popup when entering a plot
popup=
popup.buy=
popup.owner=
popup.forsale=
popup.available=
popup.denied=

Expand All @@ -26,7 +26,6 @@ error=
notinplot=
notowner=
plugin.disabled=
noeconomy=

confirm=confirm

Expand Down Expand Up @@ -293,18 +292,14 @@ kick.dropdown=
sell.name=
sell.desc=
sell.usage=
sell.unclaimed=
sell.already=
sell.minprice=
sell.success=

; the /p buy Subcommand
buy.name=
buy.desc=
buy.usage=
buy.noself=
buy.notinsale=
buy.nomoney=
buy.notforsale=
buy.confirm=
buy.success=
buy.sold=
4 changes: 2 additions & 2 deletions src/MyPlot/EventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ private function onEventOnMove(Player $player, $event) : void {
}
if(!$this->plugin->getConfig()->get("ShowPlotPopup", true))
return;
$popup = $this->plugin->getLanguage()->translateString("popup", [TextFormat::GREEN . $plot . TextFormat::RESET]);
$popup = $this->plugin->getLanguage()->translateString("popup", [TextFormat::GREEN . $plot]);
if(!empty($plot->owner)) {
$owner = TextFormat::GREEN . $plot->owner;
if($plot->price > 0) {
$ownerPopup = $this->plugin->getLanguage()->translateString("popup.buy", [$owner.TextFormat::RESET, $plot->price]);
$ownerPopup = $this->plugin->getLanguage()->translateString("popup.forsale", [$owner.TextFormat::RESET, $plot->price]);
}else{
$ownerPopup = $this->plugin->getLanguage()->translateString("popup.owner", [$owner]);
}
Expand Down
8 changes: 0 additions & 8 deletions src/MyPlot/provider/EconomyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
use pocketmine\Player;

interface EconomyProvider {

/**
* @param Player $player
*
* @return float
*/
public function getMoney(Player $player) : float;

/**
* @param Player $player
* @param float $amount
Expand Down
9 changes: 0 additions & 9 deletions src/MyPlot/provider/EconomySProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ public function __construct(EconomyAPI $plugin) {
$this->plugin = $plugin;
}

/**
* @param Player $player
*
* @return float
*/
public function getMoney(Player $player) : float {
return ($money = $this->plugin->myMoney($player)) === false ? 0 : $money;
}

/**
* @param Player $player
* @param float $amount
Expand Down
4 changes: 1 addition & 3 deletions src/MyPlot/provider/YAMLDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ 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) {
Expand Down Expand Up @@ -160,7 +159,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 = [];
Expand Down Expand Up @@ -205,7 +204,6 @@ 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);
}
}

0 comments on commit 4271ff5

Please sign in to comment.