Quickest way to load blocks

Discussion in 'Spigot Plugin Development' started by BananaPuncher714, May 4, 2017.

  1. BananaPuncher714

    Supporter

    So I want to load a bunch of blocks from a file as quickly as possible. I know that you can do it several ways, with NMS, world edit schematics, and other schematic classes. But what way would be the quickest way if I had to save and load them a lot, like on Super Minecraft Maker?
     
  2. Choco

    Moderator

    Ideally you would store instances of some object in memory to hold the locations and their respective MaterialData's. No need to read/write to file mid-runtime unless absolutely necessary
     
  3. if you're seeing on which way to place them is fastest, i'd say through nms.
     
  4. FastAsyncWorldEdit would be fastest and easiest unless you want to do some very advanced NMS experimentation.
    If it is only a few hundred blocks, just doing it with bukkit or simple NMS is fine
     
  5. Fastest way to place a block is using NMS. But, simply "using NMS" isn't going to make it fast. What make it fast is you have the ability to set blocks in the world without physics and light updates which makes it extremely fast, which is a pro. There are cons to this, however, like dark spots, bright spots, floating falling blocks, redstone issues, double blocks, just to name a few. This is why World edit comes with a /fast command to turn off fastmode, which pretty much changes block placement from nms to bukkit api mode. It's there for the things that the fast place method breaks, or doesn't do good with (like placing doors/beds).
     
    • Informative Informative x 2
    • Useful Useful x 1
  6. BananaPuncher714

    Supporter

    I'm trying to make a kind of dungeon plugin that requires quick loading and saving to files somewhat constantly because I'm going to be storing hundreds if not thousands of blocks at once. I need to clear an old dungeon and replace it with a new one as fast as possible. I can't hold them in memory because that would be too many blocks.
     
  7. Depends on the size of the dungeon, but a chunk has what, 65k blocks and servers have hundreds of chunks loaded in at anyone time. (Depending on the server of course) A few thousand blocks really isn't gonna make that much of a difference.
     
  8. BananaPuncher714

    Supporter

    Even if I don't need to save the blocks often, I still need to load them from files and paste them in the world quickly. If I had hundreds of dungeons, and each dungeon were around more than several thousand blocks large, that would be very memory intensive.
     
  9. Save them as a world edit schematic? Then load it from the schematic folder to the position
     
  10. BananaPuncher714

    Supporter

    I know, but I wasn't sure if that was the fastest and most efficient way possible.