-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a076dc
commit 75c304b
Showing
8 changed files
with
603 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: PC-ShopSystem | ||
main: TheNote\ShopSystem\Main | ||
version: 1.0.0 | ||
api: | ||
- 5.3.0 | ||
author: TheNote/Rudolf2000/note3crafter | ||
description: PC-ShopSystem v.1.0.0 | ||
softdepend: | ||
- ProjectCore | ||
permissions: | ||
economy.sell.create: | ||
description: "create a sell sign" | ||
default: op | ||
economy.sell.sell: | ||
description: "sell a item" | ||
default: op | ||
economy.sell.remove: | ||
description: "remove a sell sign" | ||
default: op | ||
economy.shop.create: | ||
description: "create a shop sign" | ||
default: op | ||
economy.shop.buy: | ||
description: "buy a item" | ||
default: op | ||
economy.shop.remove: | ||
description: "remove a shop sign" | ||
default: op |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
GlowingSign: true #Enable or Disable Glowing Shop/Sellsigns | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"LanguageVersion": 0, | ||
"Version": "1.0.0", | ||
"EconomyShop": 0, | ||
"ShopNoPerm": "§cDu hast keine Berechtigung um einen Shop zu erstellen!", | ||
"ShopAmountNumb": "§cDie Menge muss in Zahlen angegeben werden", | ||
"ShopPriceNumb": "§cDer Preis muss in Zahlen angegeben werden", | ||
"ShopItemWrong": "§cDas Item wird nicht Unterstützt! §e", | ||
"ShopPlaceSucces": "§6Du hast den Verkaufsshop erfolgreich erstellt!", | ||
"ShopErrorCreative": "§cDu kannst nicht im Kreativmodus kaufen!", | ||
"ShopNoPermtoBuy": "§cDu hast keine Berechtigung um was zu kaufen!", | ||
"ShopInvFull": "§cDein Inventar ist voll! Leere es bevor du was Kaufst", | ||
"ShopNoMoney": "§cDu hast zu wenig Geld um dir was zu kaufen!", | ||
"ShopTabAgain": "§cDrücke erneut um was zu kaufen!", | ||
"ShopSucces": "§6Du hast erfolgreich was gekauft!", | ||
"ShopNoPermDestroy": "§cDu hast keine Berechtigung um diesen Shop zu zerstören!", | ||
"ShopDestroySucces": "§6Der Shop wurde erfolgreich entfernt.", | ||
|
||
"EconomySell": 0, | ||
"SellNoPerm": "§cDu hast keine Berechtigung um einen Verkaufsshop zu erstellen!", | ||
"SellAmountNumb": "§cDie Menge muss in Zahlen angegeben werden", | ||
"SellPriceNumb": "§cDer Preis muss in Zahlen angegeben werden", | ||
"SellItemWrong": "§cDas Item wird nicht Unterstützt! §e", | ||
"SellPlaceSucces": "§6Du hast den Verkaufsshop erfolgreich erstellt!", | ||
"SellErrorCreative": "§cDu kannst nicht im Kreativmodus verkaufen!", | ||
"SellNoPermSell": "§cDu hast keine Berechtigung um was zu verkaufen!", | ||
"SellTabAgain": "§cDrücke erneut um was zu verkaufen!", | ||
"SellItemInHand": "§cHalte das Item was du verkaufen willst in der Hand!", | ||
"SellSucces": "§6Du hast erfolgreich was verkauft!", | ||
"SellSelledAll": "§cDu hast bereits alles verkauft!", | ||
"SellNoPermDestroy": "§cDu hast keine Berechtigung um diesen Verkaufsshop zu zerstören!", | ||
"SellDestroySucces": "§6Der Verkaufsshop wurde erfolgreich entfernt." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"LanguageVersion": 0, | ||
"Version": "1.0.0", | ||
"EconomyShop": 0, | ||
"ShopNoPerm": "§cYou don't have permission to create a shop!", | ||
"ShopAmountNumb": "§cThe quantity must be specified in numbers", | ||
"ShopPriceNumb": "§cThe price must be specified in numbers", | ||
"ShopItemWrong": "§cThe item is not supported! §e", | ||
"ShopPlaceSucces": "§6You have successfully created the sales shop!", | ||
"ShopErrorCreative": "§cYou can't buy in creative mode!", | ||
"ShopNoPermtoBuy": "§cYou don't have permission to buy anything!", | ||
"ShopInvFull": "§cYour inventory is full! Clear it before making a purchase", | ||
"ShopNoMoney": "§cYou don't have enough money to buy that!", | ||
"ShopTabAgain": "§cPress again to buy something!", | ||
"ShopSucces": "§6You have successfully made a purchase!", | ||
"ShopNoPermDestroy": "§cYou don't have permission to destroy this shop!", | ||
"ShopDestroySucces": "§6The shop has been successfully removed.", | ||
|
||
"EconomySell": 0, | ||
"SellNoPerm": "§cYou don't have permission to create a sales shop!", | ||
"SellAmountNumb": "§cThe quantity must be specified in numbers", | ||
"SellPriceNumb": "§cThe price must be specified in numbers", | ||
"SellItemWrong": "§cThe item is not supported! §e", | ||
"SellPlaceSucces": "§6You have successfully created the sales shop!", | ||
"SellErrorCreative": "§cYou can't sell in creative mode!", | ||
"SellNoPermSell": "§cYou don't have permission to sell anything!", | ||
"SellTabAgain": "§cPress again to sell something!", | ||
"SellItemInHand": "§cHold the item you want to sell in your hand!", | ||
"SellSucces": "§6You have successfully sold something!", | ||
"SellSelledAll": "§cYou have already sold everything!", | ||
"SellNoPermDestroy": "§cYou don't have permission to destroy this sales shop!", | ||
"SellDestroySucces": "§6The sales shop has been successfully removed." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"LanguageVersion": 0, | ||
"Version": "1.0.0", | ||
"EconomyShop": 0, | ||
"ShopNoPerm": "§cNo tienes permiso para crear una tienda.", | ||
"ShopAmountNumb": "§cLa cantidad debe ser especificada en números.", | ||
"ShopPriceNumb": "§cEl precio debe ser especificado en números.", | ||
"ShopItemWrong": "§c¡Este objeto no está soportado! §e", | ||
"ShopPlaceSucces": "§6Has creado exitosamente la tienda de ventas.", | ||
"ShopErrorCreative": "§cNo puedes comprar en modo creativo.", | ||
"ShopNoPermtoBuy": "§cNo tienes permiso para comprar.", | ||
"ShopInvFull": "§cTu inventario está lleno. Vacíalo antes de comprar algo.", | ||
"ShopNoMoney": "§cNo tienes suficiente dinero para comprar eso.", | ||
"ShopTabAgain": "§cPresiona de nuevo para comprar algo.", | ||
"ShopSucces": "§6Has comprado con éxito.", | ||
"ShopNoPermDestroy": "§cNo tienes permiso para destruir esta tienda.", | ||
"ShopDestroySucces": "§6La tienda ha sido eliminada exitosamente.", | ||
|
||
"EconomySell": 0, | ||
"SellNoPerm": "§cNo tienes permiso para crear una tienda de ventas.", | ||
"SellAmountNumb": "§cLa cantidad debe ser especificada en números.", | ||
"SellPriceNumb": "§cEl precio debe ser especificado en números.", | ||
"SellItemWrong": "§c¡Este objeto no está soportado! §e", | ||
"SellPlaceSucces": "§6Has creado exitosamente la tienda de ventas.", | ||
"SellErrorCreative": "§cNo puedes vender en modo creativo.", | ||
"SellNoPermSell": "§cNo tienes permiso para vender.", | ||
"SellTabAgain": "§cPresiona de nuevo para vender algo.", | ||
"SellItemInHand": "§cSostén el objeto que deseas vender en tu mano.", | ||
"SellSucces": "§6Has vendido con éxito.", | ||
"SellSelledAll": "§cYa has vendido todo.", | ||
"SellNoPermDestroy": "§cNo tienes permiso para destruir esta tienda de ventas.", | ||
"SellDestroySucces": "§6La tienda de ventas ha sido eliminada exitosamente." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
// ╔═════╗ ╔═════╗ ╔═════╗ ╔═╗ ╔═════╗ ╔═════╗ ╔═════╗ ╔═════╗ ╔═════╗ ╔═════╗ ╔═════╗ | ||
// ║ ╔═╗ ║ ║ ╔═╗ ║ ║ ╔═╗ ║ ║ ║ ║ ╔═══╝ ║ ╔═══╝ ╚═╗ ╔═╝ ║ ╔═══╝ ║ ╔═╗ ║ ║ ╔═╗ ║ ║ ╔═══╝ | ||
// ║ ╚═╝ ║ ║ ╚═╝ ║ ║ ║ ║ ║ ║ ║ ║ ╚══╗ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ╚═╝ ║ ║ ╚══╗ | ||
// ║ ╔═══╝ ║ ╔╗ ╔╝ ║ ║ ║ ║ ╔═╗ ║ ║ ║ ╔══╝ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ╔╗ ╔╝ ║ ╔══╝ | ||
// ║ ║ ║ ║╚╗╚╗ ║ ╚═╝ ║ ║ ╚═╝ ║ ║ ╚═══╗ ║ ╚═══╗ ║ ║ ║ ╚═══╗ ║ ╚═╝ ║ ║ ║╚╗╚╗ ║ ╚═══╗ | ||
// ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ | ||
// Easy to Use! Written in Love! Project Core by TheNote\RetroRolf\Rudolf2000\note3crafter | ||
|
||
namespace TheNote\ShopSystem; | ||
|
||
use pocketmine\plugin\PluginBase; | ||
use pocketmine\utils\Config; | ||
use TheNote\core\CoreAPI; | ||
use TheNote\ShopSystem\events\EconomySell; | ||
use TheNote\ShopSystem\events\EconomyShop; | ||
|
||
class Main extends PluginBase | ||
{ | ||
public function onLoad(): void | ||
{ | ||
$projectcore = $this->getServer()->getPluginManager()->getPlugin("ProjectCore"); | ||
if ($projectcore === null) { | ||
$this->getLogger()->alert("This Plugin need ProjectCore! Please install ProjectCore before Using this Plugin!"); | ||
$this->getServer()->shutdown(); | ||
} | ||
@mkdir($this->getDataFolder() . "Lang"); | ||
$this->saveResource("Lang/LangDEU.json"); | ||
$this->saveResource("Lang/LangENG.json"); | ||
$this->saveResource("Lang/LangESP.json"); | ||
$this->saveResource("Config.yml"); | ||
} | ||
|
||
public function onEnable(): void | ||
{ | ||
$this->sellSign = new Config($this->getDataFolder() . "Lang/SellSign.yml", Config::YAML, array( | ||
"sell" => array( | ||
"§f[§cSell§f]", | ||
"§ePrice§f: {cost}§e$", | ||
"§eAmount §f: §e{amount}", | ||
"§e {item}" | ||
) | ||
)); | ||
$this->sellSign->save(); | ||
$this->shopSign = new Config($this->getDataFolder() . "Lang/ShopSign.yml", Config::YAML, array( | ||
"shop" => array( | ||
"§f[§aShop§f]", | ||
"§ePrice §f: {price}§e$", | ||
"§eAmount §f: §e{amount}", | ||
"§e {item}" | ||
) | ||
)); | ||
$this->shopSign->save(); | ||
$this->getServer()->getPluginManager()->registerEvents(new EconomySell($this), $this); | ||
$this->getServer()->getPluginManager()->registerEvents(new EconomyShop($this), $this); | ||
} | ||
public function getLang(string $player, $langkey) { | ||
$api = new CoreAPI(); | ||
$lang = new Config($this->getDataFolder() . "Lang/Lang" . $api->getUser($player, "language") . ".json", Config::JSON); | ||
return $lang->get($langkey); | ||
} | ||
} |
Oops, something went wrong.