ubc-minetest-classroom / minetest_classroom

Repo for Mintest Classroom game
GNU General Public License v3.0
10 stars 6 forks source link

Defined item stacks for realms #171

Open pauldpickell opened 2 years ago

pauldpickell commented 2 years ago

Is your feature request related to a problem? Please describe. Items need to be managed to ensure players are not taking items between realms that do not belong there. This will also help to keep the spawn realm tidy to prevent folks from dropping items everywhere that they may have collected from another realm and also to prevent students from sharing items that they shouldn't (thinking ah a customs and immigration checkpoint, if you will. Besides tidiness, items can currently be lost or left behind, and it would be great to be able to get the needed items again in the context of the realm.

Describe the solution you'd like The ability to define item stacks for realms so that when a player joins a realm with a defined item stack, they receive the tools, items, nodes, entities, etc. in their inventory. Related to this, players should have access to (at least) the default set of nodes when they create an instanced realm for design and sandbox play.

Describe alternatives you've considered Leaving everything as-is, which limits our control over movement of items and nodes between realms and makes it difficult for players to get items unless they are laying around the world or the teacher places them in a chest ahead of time. mc_toolhandler serves this purpose for tools, but it uses the player context instead of the realm context. Maybe mc_toolhandler needs to be refreshed with realm context in mind, but this might be a significant refactor since it is designed to only handle a single copy of the tool, whereas we might want to give spawning players various amounts of different items for a given task. The built-in Minetest inventory methods already solve the problem, so we just need to associate these with realms.