Michael-Zinn / SlimeIt

Minecraft Bukkit plugin that consolidates some redundant gameplay elements into one.
Other
1 stars 1 forks source link

Define a block interaction markup language #11

Open Michael-Zinn opened 11 years ago

Michael-Zinn commented 11 years ago

How blocks and items interact should be defined in config files. Bukkit uses YAML, other options are YAST and JSON (please add other nice markup languages to the comments).

The difficult question is what to model. But lets discuss the (conflicting) requirements first:

There are several things that could be modelled, here are some ideas (these are somewhat mutually exclusive):

blocks define what can be done with them and what happens.

It might be best to do a combination of the two. For example, slime balls and torches are passive objects, so they could be defined from the perspective of the block they attach to: mossycobblestone { is=cobblestone sides=slimeball } jackolantern { is=pumpkin front=torch } This is enough to define that you can attach slime to a cobblestone or a torch to the front of a pumpkin. Things like pickaxedamage could be a special thing, like this: crackedstonebrick { is=stonebrick sides=PICKAXEDAMAGE } And the plugin code specifies what this special PICKAXEDAMAGE thing is.

Also, the block definitions themselves should be in a config file, e.g. (values made up):

pumpkin { id = 86 data { 0 = { front = 2 } 1 = { front = 3 } 2 = { front = 0 } 3 = { front = 1 } } }

// Inheritance might be overkill here, though. jackolanternt < pumpkin { id = 91 }

stonebrick { id = 98 data = 0 } crackedstonebrick { id = 98 data = 1 } mossystonebrick { id = 98 data = 2 }

This makes it very easy to adapt the plugin to new versions of minecraft.

Please contribute your ideas in the comments.