Uploaded image for project: 'Minecraft API'
  1. Minecraft API
  2. MCAPI-141

Multiblock Object Support

    XMLWordPrintable

    Details

      Description

      Proposed Addition:
      Methods for plugins to create and/or affect a collection of blocks as a whole. I will call them Multi Block Object or MBO from here on.

      Specific features:

      Essential features:

      • Batch operations to copy and paste a collection of blocks including tile entities and metadata.
      • Method to reposition a collection of blocks as a whole, to a different position on the world grid. (basically a cut&paste operation)
      • Support for collision detection, being able to cancel the attempted movement if a block is in the way.
      • Metadata/tile entities belonging to blocks should be moved along with the blocks.
      • Method for rotation by 90-degree intervals.

      Features for MBO movements of 1 distance along the X, Y or Z axes:

      • Animated rather than instant movement, similar to how pistons move single blocks and frames in Redpower can move as whole objects.
      • Ability to make entities move with the MBO if it is moved in this fashion.

      Persistency features:

      • Create an MBO out of one or more blocks
      • Add or remove blocks to it
      • Stored with the world
      • Can store metadata specific to the MBO
      • Ability to find out which MBO a block belongs to
      • Ability to find out whether an MBO has been damaged (one or more of its blocks have been destroyed or replaced)
      • (possibly) Ability to keep an MBO from being damaged by players/explosions/other destructive influences

      Other:

      • (possibly) Creating larger MBOs out of smaller MBO sections, with the possibility to move the entire thing as a whole or moving just one section relative to the rest.

      Challenges Faced:

      • Keeping track of collections of multiple blocks and storing them with the world
      • Collision detection, which blocks is the MBO about to move into? Which types of blocks is the MBO allowed to overwrite? A car might only move through air but a submarine might want to move through both air and water. Snow and long grass might not be an obstruction either for most machines.
      • Efficiently updating the world when an MBO moves and keeping the number of physics checks from exploding. This would be much more feasible for the minecraft core than for a plugin manipulating the world from outside.
      • What happens when part of an MBO is in an unloaded part of the world?

      Justification:
      Enable plugins to easily create machines made up out of multiple blocks that can move about and take action.

      Keeping track of a multi-block object is a set of complex tasks:

      • Ensuring it is intact before acting on it
      • Calculating the diffsets required for collision detection and clearing away the blocks left empty after the move.
      • Updating the world block by block, where blocks attached to another object (such as a torch) are automatically dropped as an item if updated in the wrong order. Updating with physics disabled works for this but would also create other artifacts in the process like with fluids or lighting.

      There is no standard way to do this currently in Bukkit or Forge that I'm aware of, and API support for this could really bring a new dimension to Minecraft. Support for even just the essential features would make a large difference.

      Use Cases:
      Plugins could more easily realize things like:

      • A mining machine that can be constructed differently depending on the shape of tunnel the player wants it to dig.
      • Retractable bridge or moving platform.
      • A gate/portcullis that can open and close.
      • Static buildings that serve a function for as long as they remain whole. (For example serving as an objective to be destroyed in a pvp game or serving as a power plant for some energy system)
      • Large vehicles whose construction is only limited by the blocks available in Minecraft and the players' imagination, from cars and ships to full blown floating, moving cities.

      Background:
      I'm the creator of a Bukkit plugin called MachinaCraft. My goal with the plugin has been bringing the blocks to life when combined in a certain way. They act like machines such as a mining drill or an automatic block builder.

      Having tried out various popular Forge mods, a common thing I see is "one block wonders" that can, seemingly magically, do things in a large radius around them like planting and harvesting things, building objects, strip mining a whole area down to bedrock.

      I think these are in part the result of the difficulties encountered when trying to realize a multi block machine with a plugin. I would like to see these types of big tasks being done by appropriately sized machines, not to mention see plugins do amazing things like moving vehicles, gates/bridges or even robots. Abstracting away the bookkeeping required for the creation and manipulation of a multi block object would help a lot with this.

      Edit:

      • Added bullet point for a method to rotate an MBO and a point for storing metadata with an MBO in the persistency features
      • Refined the proposal a bit, separating out the animation portion from the core functionality.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lyneira Lyneira
              • Votes:
                8 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: