Commit Graph
11 Commits
Author SHA1 Message Date
gnembon 9f776167e3 22w42a 2022-10-20 14:33:36 +02:00
replaceitemandreplaceitem 3f6ddc43e5 Added screen handler system (#888)
* Added screen handler value

* Added screen handler constructor and function to show to player

* Made inventory_* functions work with screen handlers

* Event callbacks and some refactoring

* Exception if screen has no inventory

* Fixed NPE

* Close screen when null

* Added screen_property

* UNKNOWN_SCREEN throwable

* Fix error when not specifying click callback

* Access to non-container screen handler slots via the inventory_* functions

* Change lectern page

* Added button event

* Added 'close' event and refactoring callback

* Beacon and Brewing screens

* Cartography table screen

* Crafting screen

* Enchantment screen

* Grindstone

* Loom

* Merchant

* Shulkerbox

* Smithing table

* Stonecutter

* Use strings as screen type instead of ScreenHandlerType

* Remove support for multiple players

* Combining create_screen and open_screen and refactoring

* Allow modifying cursor stack

* Cleanup

* Docs

* Added multiple screen examples

* Rename to screen

* Added smoker and blast furnace

* Serialize screen content

* Store host name instead of context

* Add button value special cases to docs

* Spelling and grammar fixes by @James103

* Optimize screen inventory access

* Use -1 for slot click outside the screen

* As boolean, ScreenValue equals isOpen

* Revert "Use -1 for slot click outside the screen"

This reverts commit 68c113e71bb653191cedf4cc356ab7705838dc25.

* Rework of callback function

* Improve screen functionality with drop_item

* Editor keywords

* Only check syncId

* slot_update event callback

* Screem typo

* Mistake

* toTag returns "null" NBT for  closed screen

* Use null for slot index of -999

Co-authored-by: replaceitem <replaceitem.mc@gmail.com>
2022-01-12 22:52:38 +01:00
altrisi a155494d11 Allow some exceptions to be handled 2021-02-19 19:54:41 +01:00
gnembon a0067d0d61 added item_list, item_tags to support item tags as well as options for entities to support entity type tags. fixes #382 2020-12-07 00:12:55 -04:00
gnembon 79cb4a20d8 refactor for inventories, allowing for null types. 2020-11-26 00:33:09 -04:00
gnembon 201654ff44 adding support for equipment inventories as well as horse and pillager item inventories. 2020-11-25 17:52:17 -04:00
TheCatSaber 492d296446 Update Inventories.md 2020-10-05 12:52:35 +01:00
gnembon 4e797020d7 added smithing to the docs 2020-06-14 01:47:15 -03:00
gnembon 690c85f3b0 added __on_player_chooses_recipe and __on_player_switches_slot events 2020-06-14 01:15:10 -03:00
gnembon 2f08ee8c01 player inventories can be specified as strings
player enderchest inventories can also be specified as a single string.
2020-06-07 19:32:08 -03:00
gnembon d93a0dbdf4 moved scarpet docs to markdown files 2020-03-17 01:46:51 -03:00