[Formatted]StartupBlockSwitcher

Discussion in 'Archived: Plugin Requests' started by 1cec0ld, Aug 21, 2012.

  1. Offline

    1cec0ld

    Plugin category: World Generators/Editors

    Suggested name: BlockSwitch?

    What I want: I've found almost exactly what I need in github.com/NuclearW/NoMobSpawners
    But, it only Removes the items on startup, and for some reason the new version doesn't work, as it was supposed to fix a bug with the spawn area.

    So the premise is: Change all of a list of blocks into another type, when the server starts, and only on loaded chunks. New chunks don't need to be affected. I'll be using worldBorder to generate them beforehand.

    Config Example:
    #Worlds to edit, separate with commas. Leave blocks-strip empty if you don't want any changed, otherwise separate the blocks you want with commas.
    #Tue Aug 21 21:20:14 PDT 2012
    active-worlds=world #not a required feature
    blocks-strip=2,17,18
    block-replace=49
    #changes grass, log, and leaf into obsidian. Error if there is more than one block-replace, for simplicity. If you want to code a percent chance based on the quantity, that's personal.

    Ideas for commands: No commands needed, just the start button and config.

    Ideas for permissions: None needed.

    When I'd like it by: Whenever you can, I left that github link up in case it could help inspire. I tried editing just one section so setTypeId(0) changes to setTypeId(49) but it just didn't work, so I'd suggest coding from scratch using that for a reference, rather than trying to clone the git repo.

    Thank you for any effort, and I wouldn't use Worldedit or VoxelSniper, because I'm talking about an entire world, top to bottom, not just one or two chunks in specified places.
     
  2. Offline

    1cec0ld

    Is this really so hard? Or does no one just want to do it... I could... compensate for the effort. Not implying anything, but I am willing to return the favor however I... can.
     
  3. Offline

    Barinade

  4. Offline

    1cec0ld

    If I knew anything useful about bukkit development, I'd be able to answer, but I barely know how to follow the inheritance of an Event, no chance I'd know which event to use for this kind of job. :-/ Thats part of why I provided the github link, so people could see what Nuclear had in mind. Thanks for the interest though.
     
  5. Offline

    QuantumDev

    Hmm, I'll see what I can do, give me some time...

    Well it works, but only for new chunks, I'll think of something :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  6. Offline

    1cec0ld

    It could work if I just added it before I started the server for the first time? Does it affect spawn as well? It would take out the need for WorldBorder altogether.
     
  7. Offline

    QuantumDev

    I'll make a new world and see...

    Crap. It looks like the plugins don't enable until AFTER the world generation. You could make a new world, then travel a really far distance (away from the non-"fixed" spawn) then reset your spawn point to there. What do you think?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  8. Offline

    1cec0ld

    As long as the target block is settable, and the object blocks are listable, I guess it could work. WorldBorder will just get a workout deleting the old spawn chunks :)
     
  9. Offline

    QuantumDev

    Proof just for fun: (I turned all grass and stone into sponge, which puts quite some stress on the server lol)

    [​IMG]

    Anywho, here's the link just extract in your plugins folder, and edit the config file and try it out :)

    Tell me if anything goes wrong (though it shouldn't)

    https://dl.dropbox.com/s/oo7662tuw8q0e6f/BlockSwitch.zip?dl=1

    Thoughts?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
    WarmakerT and pigplushy like this.
  10. Offline

    Barinade

    I made a plugin for my server that changed ores of new chunks to stone, that way we could restrict ores to regenerating mines, the world generates a number of chunks around spawn before any plugins are enabled. We just used WorldEdit to replace ores with stone for these chunks.

    It's pretty much what you want, but without a config.
     
  11. Offline

    1cec0ld

    Code:
    2012-08-22 22:36:31 [INFO] Starting minecraft server version 1.3.1
    2012-08-22 22:36:31 [INFO] Loading properties
    2012-08-22 22:36:31 [INFO] Default game type: SURVIVAL
    2012-08-22 22:36:31 [INFO] Generating keypair
    2012-08-22 22:36:31 [INFO] Starting Minecraft server on *:25565
    2012-08-22 22:36:31 [INFO] This server is running CraftBukkit version git-Bukkit-1.3.1-R2.0-b2340jnks (MC: 1.3.1) (Implementing API version 1.3.1-R2.0)
    2012-08-22 22:36:32 [INFO] [BlockSwitch] Loading BlockSwitch v1.0.0
    2012-08-22 22:36:32 [INFO] [EnderThrow] Loading EnderThrow v0.1
    2012-08-22 22:36:32 [INFO] Preparing level "world"
    2012-08-22 22:36:32 [INFO] Preparing start region for level 0 (Seed: -9013333656416267233)
    2012-08-22 22:36:33 [INFO] Preparing start region for level 1 (Seed: -9013333656416267233)
    2012-08-22 22:36:33 [INFO] Preparing spawn area: 3%
    2012-08-22 22:36:34 [INFO] Preparing start region for level 2 (Seed: -9013333656416267233)
    2012-08-22 22:36:34 [INFO] Preparing spawn area: 52%
    2012-08-22 22:36:34 [INFO] [BlockSwitch] Enabling BlockSwitch v1.0.0
    2012-08-22 22:36:34 [INFO] [EnderThrow] Enabling EnderThrow v0.1
    2012-08-22 22:36:34 [INFO] Server permissions file permissions.yml is empty, ignoring it
    2012-08-22 22:36:34 [INFO] Done (2.472s)! For help, type "help" or "?"
    config:
    Code:
    #Seperate the block-strips with commas
    #Wed Aug 22 23:41:14 CDT 2012
    replace-with=49
    blocks-strip=18,17
    [​IMG]

    I didn't have to fly far to see the first few obsidian trees, but these just randomly popped up. It's spastic, and impossible to have been pre-existing, since there are obsidian trees all around them, in non-chunk shaped areas...?
     
  12. Offline

    QuantumDev

    It could do with the metadata of leaves, I'll add a special case for leaves (just set the blocks-strip=leaves once I update it).
     
  13. Offline

    1cec0ld

    The logs are also visible... Could you just make it ignore all metadata?
     
  14. Offline

    QuantumDev

    Hmm, it's not metadata. The server might change/generate the trees after the initial loading... Not sure.

    I went through a forest of solid obsidian trees, then in a couple types of biomes, it's half and half...

    It has to do with the trees themselves, when I did the grass and stone replacement, that worked fine with no hiccups. I don't see any tree events though, so I don't know what's going on...

    I'll work on this tomorrow, I have to go now.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  15. Offline

    1cec0ld

    I understand, I had to sleep as well. That tree and other feature generation might be why Nuclear made it happen to Loaded Chunks only, not to new ones.
     
  16. Offline

    QuantumDev

    I looked through the Javadocs for bukkit and couldn't find anything useful about tree creation...
     
  17. Offline

    1cec0ld

    So what are the odds it could work on loaded chunks, instead?
     
  18. Offline

    QuantumDev

    None, because if you load new chunks, then restart the server, those half leaves/logs blocks will still be there and won't change. Right now the plugin changes both loaded and new chunks.
     
  19. Offline

    1cec0ld

    Right after you said this, I restarted and relogged in, the half-trees were completely converted. I flew a bit farther, saw regular trees semi-form, and restarted again. They were completely converted upon looking again. It does exactly what I asked for, the new-chunk feature is really an extra that just makes it better than I expected.
    Unless you have something else to add to my observations, I think this is a job well done?
     
  20. Offline

    QuantumDev

    I suppose so, as long as you're planning on bordering the world, it should work perfectly :)

    If you ever need anything else, feel free to PM me :) (or tag me in a post)

    Ooh, thank you for your generous donation :)
     
  21. Offline

    Hoolean

  22. Offline

    QuantumDev

  23. Offline

    Hoolean

    The plugin above, changing the blocks.
     
  24. Offline

    QuantumDev

    I made it?
     
  25. Offline

    -_Husky_-

    He wants the source
     
  26. Offline

    QuantumDev

    -_Husky_- likes this.

Share This Page