Cuberite Forum
SkyBlock v3 - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Releases (https://forum.cuberite.org/forum-2.html)
+--- Thread: SkyBlock v3 (/thread-1508.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16


RE: SkyBlock v1 - xoft - 07-20-2014

It is possible, although not too comfortable, to interact with the UI in the plugins - you can catch the PLAYER_USING_BLOCK hook and let it cancel the action, then let it simulate the chest opening by itself - Lua can open any kind of UI window with any items, using the cLuaWindow class. That one provides the callbacks you need that MCS calls when the player clicks inside the window.


RE: SkyBlock v1 - Seadragon91 - 07-20-2014

(07-20-2014, 05:21 PM)xoft Wrote: It is possible, although not too comfortable, to interact with the UI in the plugins - you can catch the PLAYER_USING_BLOCK hook and let it cancel the action, then let it simulate the chest opening by itself - Lua can open any kind of UI window with any items, using the cLuaWindow class. That one provides the callbacks you need that MCS calls when the player clicks inside the window.

Yes but how do you avoid that the player can take items out of the chest?


RE: SkyBlock v1 - NiLSPACE - 07-20-2014

Using the cLuaWindow:SetOnSlotChanged function. You give it a callback that gets called when a slot changes.


RE: SkyBlock v1 - Seadragon91 - 07-20-2014

(07-20-2014, 06:30 PM)STR_Warrior Wrote: Using the cLuaWindow:SetOnSlotChanged function. You give it a callback that gets called when a slot changes.

The callback is not cancel-able: "Any returned values are ignored."


RE: SkyBlock v1 - ThuGie - 07-21-2014

Seadragon nah just updating, and going to set it up on different port.
Should have time tomorrow to finish it up.


RE: SkyBlock v1 - Seadragon91 - 07-23-2014

Okay haven't found a nice way for creating a inventory for challenges. Have tought and tried a few different ideas, but the main problem is to disallow the player to take the items out, there I haven't found any way.

Will need to wait for a hook, where I can get the player and cancel the event.


RE: SkyBlock v1 - LO1ZB - 07-23-2014

You could use these 2 hooks:
HOOK_PLAYER_TOSSING_ITEM
http://mc-server.xoft.cz/LuaAPI/OnPlayerTossingItem.html
HOOK_PRE_CRAFTING
http://mc-server.xoft.cz/LuaAPI/OnPreCrafting.html
after that, player are only able to move items inside of thiere inventory.


RE: SkyBlock v1 - Seadragon91 - 07-24-2014

I will change the challenge system. Adding levels that contains the challenges and you need then to finish all or a configurable amount to unlock next level. Like in that way.

Level 1:
  1. Challenge 1
  2. Challenge 2
  3. ...
Level 2:
  1. Challenge 1
  2. ...
Level 3:
  1. Challenge 1
  2. ...



RE: SkyBlock v1 - Seadragon91 - 07-24-2014

-- removed --


RE: SkyBlock v1 - xoft - 07-24-2014

Whaaaa? What happened? So sudden!