Giter VIP home page Giter VIP logo

customsizedinvmenu's Introduction

CustomSizedInvMenu

To be able to build custom-sized InvMenu instances, you must install the tedo0627/InventoryUIResourcePack resource pack on your server.

A custom-sized InvMenu provides several advantages over traditional ways of displaying menus (InvMenu::TYPE_CHEST, InvMenu::TYPE_DOUBLE_CHEST):

  1. Dynamic: To create a menu that can hold n items, you need not know the size of a chest or a double chest inventory. Instead, simply create a menu of the preferred size: CustomSizedInvMenu::create(n).
  2. Block-less: Backed by an invisible entity, this menu does not require rendering a chest block strategically placed behind a player. Besides, rendering a chest block opens the server to an exploit where players can 'levitate' in the air by standing onto a fake chest block.
  3. More Portable: Backed by an invisible entity, this menu can be sent to players anywhere, regardless of their Y-axis position. Block-backed menus can only be sent when the player's Y value falls within the world's minimum and maximum block height (because blocks cannot be set outside world bounds).
  4. Low Latency: CustomSizedInvMenu renders right away, no delay necessary. On the other hand, InvMenu::TYPE_DOUBLE_CHEST is notoriously slow due to a 'delay' that is necessary to let the game render 'two individual chests transforming into a double chest'.

Example API Usage

To build a 5-slot InvMenu, use CustomSizedInvMenu::create(5):

/** @var Player $player */
$menu = CustomSizedInvMenu::create(5);
$menu->setName("This is a 5-slot Inventory");
$menu->send($player);

Example Command Usage

Run /cinvmenu <numSlots> [title] to open an InvMenu of numSlots number of slots:

  • /cinvmenu 36 "36-slot Inventory"

    image

  • /cinvmenu 59 "59-slot Inventory"

    image

Resources

customsizedinvmenu's People

Contributors

muqsit avatar poggit-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

customsizedinvmenu's Issues

InventoryUIResourcePack Not Work

InventoryUIResourcePack.mcpack not work, he doesn't put the correct inventory, we always get a simple chest inventory, and the command /cinvmenu [title] not work, she always send the usage message
Edit: the Pack work just on pocket ui profile, not in classic ui profile (in settings)

Bug when using the command and its API

I'm having problems using this plugin or using the API of this plugin, when I try to use the /cinvmenu command the first time I get the window ok, but when I close and try again nothing appears, when I create a window using the API, when I execute the command that triggers its creation, I don't get anything, and I have a buggy inventory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.