OvercastNetwork / SportBukkit

CraftBukkit and Bukkit modifications that improve stability and add new features
100 stars 85 forks source link

Bulk read/write of cuboid block volumes #167

Closed jedediah closed 9 years ago

jedediah commented 9 years ago

Adds a new type BlockImage which is effectively a cuboid volume of BlockStates (though it is not implemented that way). These can be copied to and from Worlds fairly efficiently, much more so than copying each block individually through the Bukkit API.

Currently, there are three operations: copy, cut, and paste. Masking is limited to choosing whether or not to include air. This could be expanded in the future, but this will do for now.

The block copying code is derived from the code for the /clone command, so it should already be fairly robust. It properly handles tile entities, attached blocks, and physics updates.

jedediah commented 9 years ago

Well, SportBukkit now has regions. It was the easiest way to get this working how we need it to. We need to use one BlockImage as a mask for another one, which means we need a way to pass masks around, which means.. regions. Anyway, it's ready, deploying soon.