Windowy is a transaction-focused temporary inventory generator made for PocketMine-MP

Overview


Last Commit

About

How to use

  • Windowy comes with 3 registered inventories
use DayKoala\inventory\WindowFactory;

$id = WindowFactory::CHEST;
$id = WindowFactory::DOUBLE_CHEST;
$id = WindowFactory::FURNACE;
  • You can get the desired inventory using:
$window = WindowFactory::getInstance()->get($player, $id, $name);
  • If you want to simplify:
use DayKoala\Windowy;

$window = Windowy::getWindow($player, $id, $name);

Registering inventory

  • If you want to register an inventory, use:
$window = new MyWindow(WindowTypes::CONTAINER, 27, Tile:class, BlockLegacyIds::Block);
  • You can also set a fixed transaction for inventory, before or after registering, using:
setTransaction($transaction); ">
use DayKoala\inventory\action\WindowTransaction;

$transaction = function(WindowTransaction $action) : Bool{
   $player = $action->getPlayer();
   $player->sendMessage("I won't let you take this item haha!");
   return false;
};

$window->setTransaction($transaction);
You might also like...
Runtime Code Generator like Lombok for PocketMine-MP
Runtime Code Generator like Lombok for PocketMine-MP

PlumbokPM Runtime Code Generator like Lombok for PocketMine-MP. Code generation starts when additional autoloader detects class uses PlumbokPM annotat

A plugin manager for PocketMine-MP downloads plugin from PocketMine-MP official plugin repository

oh-my-pmmp A plugin manager for PocketMine-MP Getting Started Prerequisites Your server MUST RUN the latest version of PocketMine. Installation From P

PHP Regular expressions made easy

PHPVerbalExpressions ported from VerbalExpressions VerbalExpressions is a PHP library that helps to construct hard regular expressions. Installation T

All in one Video Downloader - Download videos from facebook twitter youtube tiktok and 1000+ other sites .. made by Vijay Kumar

VKRdownloader Video Downloader by @TherealVKR Vijay Kumar .... Download Video From YouTube , Facebook , Twitter , Instagram , TikTok , And 1000+ Other

Economy made easy for Minecraft: Bedrock

BedrockEconomy Economy made easy for Minecraft Bedrock Commands Name Description Usage Permission balance Show your and others balance balance [player

The simplest way to create a dynamic sitemap for your self-coded website which you have made by using PHP/HTML/CSS/Js etc... Scripts.

Sitemap_index.xml The simplest way to create a dynamic sitemap for your self-coded website which you have made by using PHP/HTML/CSS/Js etc... Scripts

This module aims to validate if the pilot made his flights online on the IVAO and VATSIM networks

SMPirepValidator This module aims to validate if the pilot made his flights online on the IVAO and VATSIM networks SMPirepValidator v.1.0 for phpVMS (

Advanced algorithmic PHP applications I've made
Advanced algorithmic PHP applications I've made

Advanced algorithmic PHP applications I've made

Laravel Integration for Switchover PHP SDK. Feature Toggle Management made easy.

Switchover Laravel Integration Switchover Switchover is a Software-As-A-Service for managing feature toggles (aka switches, flags or feature flips) in

Comments
  • [BUG] Items with lore doesn't execute any callback

    [BUG] Items with lore doesn't execute any callback

    Hi! im here again, im used your plugin because it's a very good plugin, but when im try to set an item lore, the item callback doesn't work anymore, this is my code:

    public static function showKitTypes(CustomWindow &$inventory): void
    {
        $basic = ItemFactory::getInstance()->get(ItemIds::GRASS);
        $basic->setCustomName("§r§8 - Default kits");
        $basic->setLore(array("", "§7Click here to view all", "§7default kits on the server", ""));
    
        $vips = ItemFactory::getInstance()->get(ItemIds::CHEST);
        $vips->setCustomName("§r§5 - Kits VIP");
        $vips->setLore(array("", "§7Click here to view all", "§7vip kits on the server", ""));
    
        $inventory->setItem(15, $vips, function (WindowTransaction $action) {
            $action->cancel();
    
            $w = $action->getInventory();
            $w->clearAll();
    
            // public static function showKits(Player $player, CustomWindow &$inventory, int $type): void
            self::showKits($action->getPlayer(), $w, Kit::TYPE_VIP);
        });
    
        $inventory->setItem(11, $basic, function (WindowTransaction $action) {
            $action->cancel();
    
            $w = $action->getInventory();
            $w->clearAll();
    
            // public static function showKits(Player $player, CustomWindow &$inventory, int $type): void
            self::showKits($action->getPlayer(), $w, Kit::TYPE_BASIC);
        });
    }
    

    I really enjoy your plugin, but this is bad and im using \n on the item name to make a lore

    Extra information:

    Device: Samsung Galaxy a30 PocketMine-MP Version: 4.2.1 PHP Version: 8.0 Running on: localhost:19132

    duplicate 
    opened by ghost 1
  • [BUG] The callback isn't called on interact with an item

    [BUG] The callback isn't called on interact with an item

    When you set an item with transaction, in certain circustances the callback isn't called, a code example:

    $back = ItemFactory::getInstance()->get(ItemIds::BARRIER);
    $back->setCustomName("§4§c Back ");
    
    $inventory->setItem(22, $back, function (WindowTransaction $action) {
      // Kit::get() -> Kit (PluginBase)
      Kit::get()
        ->getLogger()
        ->info("Item clicked!");
    
      $action->cancel();
    
      $inventory = $action->getInventory();
      $inventory->clearAll();
    
      // public static function showKitTypes(Window &$window): void
      self::showKitTypes($inventory);
    });
    

    But, clicking the item don't show anything on console and the cancel action doesn't work

    • Platform: Android
    • PocketMine-MP Version: 4.2.0
    • Minecraft BE Version: 1.18.10
    • PHP Version: 8.0
    opened by ghost 1
Releases(latest)
Owner
DayKoala ʕ•ᴥ•ʔ
A Brazilian Developer
DayKoala ʕ•ᴥ•ʔ
InventoryUI - the PocketMine virion that implements the dummy inventory

InventoryUI This is the PocketMine virion that implements the dummy inventory. Differences from previous APIs Chests and other blocks are not placed.

tedo0627 10 Nov 16, 2022
Container Open Inventory ID send bug fix PocketMine-MP plugin

ContainerOpenFixed Container Open Inventory ID send bug fix PocketMine-MP plugin Example use skh6075\containeropenfixed\IWindowType; use pocketmine\ne

avas 2 May 20, 2022
This composer plugin is a temporary implementation of using symbolic links to local packages as dependencies to allow a parallel work process

Composer symlinker A Composer plugin to install packages as local symbolic links. This plugin is a temporary implementation of using symbolic links to

Pierre Cassat 18 Nov 9, 2021
yform 4 usability addon (temporary until yform gets its own)

massif_usability Package für REDAXO CMS >= 5.10.0 temporäres Ersatz-Plugin für yform_usability für yform >=4 – bietet ähnliche Funktionalität wie yfor

Yves Torres 6 Mar 4, 2022
Laravel Pipeline with DB transaction support, events and additional methods

Laravel Enhanced Pipeline Laravel Pipeline with DB transaction support, events and additional methods #StandWithUkraine Installation Install the packa

Michael Rubél 33 Dec 3, 2022
Inventory manager - Light Bootstrap Dashboard

Light Bootstrap Dashboard is an admin dashboard template designed to be beautiful and simple. It is built on top of Bootstra

Ranaivonampoizina Mikajy 1 Nov 17, 2021
Simple Plugin To Get EXP Directly To Inventory.

Simple Plugin To Get EXP Directly To Inventory.

HenryDM 6 Nov 21, 2022
✨An Ultimate NPC plugin made by brokiem for PocketMine-MP.

SimpleNPC An Ultimate NPC plugin made by brokiem for PocketMine-MP. ✨ Features Migration from Slapper supported! ✔ Right click to interact! ✔ NPC can

broki 53 Jan 1, 2023
A Lotto plugin made with Pocketmine.

LottoPlugin Features Compatibility with Pocketmine 3.X.X Full Customization Automatic Launch Automatic Draw Usage Initialisation You have to install P

null 3 Nov 20, 2022
Allows the connection of Minecraft: JE clients to PocketMine servers. Made for PM4

JavaPlayer Allows the connection of Minecraft: JE clients to PocketMine servers. Made for PM4 MCJE VER: 1.18.2 Need implemented Chunks (convert proble

kanison konkla 30 Dec 7, 2022