Inactive [MECH] NoMelt v0.5.1 - Build that snow base with no fear of melting [Config Added] [1.7_02] [953]

Discussion in 'Inactive/Unsupported Plugins' started by Vynlar, Jul 2, 2011.

  1. Offline

    Vynlar

    NoMelt
    Stops ice and snow from melting or forming​
    Version: 0.5.1

    This plugin will globally stop all melting of ice and snow (including snow blocks) from light sources (lava, glowstone, torch etc...) as well as stop ice from freezing in water. This will make ice drop blocks of ice too.
    To install, drop the NoMelt.jar into your bukkit plugins folder and restart/reload the server. If "Enabled NoMelt!" comes up in the console, you're good to go!

    Features:
    • Stops snow/ice from melting
    • Stops ice from freezing
    • Stops snow from gathering on the ground
    • Option to make ice not spawn water when broken
    • Makes ice drop ice blocks
    Download
    Source is in the jar

    Configuration:

    In the configuration file, which can be found in your plugins folder under "NoMelt/config.yml", there are options in a list. Setting one to true means it will be active, false means it will be inactive.

    Configuration Options:
    • icedrop: When true, ice will drop when an ice block is broken.
    • noMelting: When true, no ice or snow will melt from light sources such as torches or glowstone.
    • noFreeze: When true, no water will freeze and no snow will collect in your world
    • iceWater: When true, no water will spawn when ice is broken. This defaults to false!
    Media:
    A screenshot of some testing of the 'no melting' feature. This was after 20 minutes of the
    torches being placed.
    [​IMG]

    Our first user and tester xsolar66 made a video showcase of the plugin, explaining and showing off some of the features. Thanks for the support xsolar!



    If anyone has any media (video, pictures, etc.) of NoMelt in action, maybe some fantastical snow-covered streets or an overly lit up snow fortress, contact me on here and I'll add it to the post. Ill give you a free[diamond]! :D

    ToDo:
    • Add configuration file (Most important) Done
    • Add no-melt building mode, where nothing that you build with the mode on will melt, but everything else will
    • Add cuboid melting protection
    • Prevent snow from gathering on the ground Done
    • Suggestions welcome! [diamond]
    Bugs:
    • Anti-freeze seems not to be working at the moment, looking into it. Fixed in v0.4
    Change Log:
    v0.5.1
    • Fixed bug where no blocks would drop any loot when water spawning from ice break was on
    v0.5
    • Added option to turn off water spawning from broken ice in the config file
    v0.4
    • Configuration file
    • Fixed 'noFreeze' to actually stop freezing
    v0.3
    • Added ice block drops
    • Posted on forum
    v0.2
    • Added anti freeze on water
    v0.1
    • Started with canceling melting of ice, snow, and snow blocks
    Credits:
    Idea from this thread
    Thanks to Bone008 and xsolar66 for feature ideas
    And Bone008 for programming advice and help
    Thanks to Avous for requesting and coming up with the idea.
     
    crazycrafter likes this.
  2. Offline

    Tsikura

    Awesome! Have my spawn point in my world in a nice snowy area and this is perfect for the street lights that melts the snow.
     
  3. Offline

    Vynlar

    Hopefully the config will be out soon. Still figuring it out. Then the Cuboid anti-melting after words.
     
  4. Offline

    Augutus_Longeye

    You should put a space between a word and the start of a parenthesis (like that) not have them right next to each other(like this). Also, it should be "you're good to go" as your is possessive and you're is an abbreviation of 'you are'.
    Aside from that this looks like an interesting idea, and I may have to try it out.
    ~Longeye~
     
  5. Offline

    Vynlar

    Rofl, I read this over soooo many times trying to avoid grammar mistakes and good formatting but no. *shame on me*

    I'll fix it. Thanks :D

    Edit: Fixed, thanks again.
     
  6. Offline

    Augutus_Longeye

    No worries, like I say I think the mod is good and I would hate for people to be put off by grammar and syntax (small errors as they were, it might have happened)... little errors like that get through ALL the time, no matter how much you check it :p
    ~Longeye~
     
  7. Offline

    Vynlar

    You are now the official NoMelt grammar master! *knights longeye* :p

    Added a configuration file as well as fixed 'no freeze' to stop freezing. Pick up an updated copy and follow the config guide in the post. Feel free to post suggestions or ask for help here. Bug reports are always welcome.

    Thanks,
    Vynlar

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

    xsolar66

    brilliant, thanks. seems to work fine at the moment - however, one suggestion - is it possible to allow torches to be placed on ice blocks?

    edit: seems that when you destroy an ice block, the ice block is returned (dropped), however, water still appears - is it possible to prevent this?
     
  9. Offline

    Vynlar

    Updated with option to turn off water from broken ice

    Fixed a bug with the water turn off feature.

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

    xsolar66

  11. Offline

    Vynlar

    I'll take a look at the source of that plugin in the morning and work out the torches on ice.
     
  12. Offline

    xsolar66

    I'm uploading my first ever youtube video showcasing some of this amazing plugin. excuse the awkwardness, it'll be done in just under 2 hours
     
  13. That went pretty fast. Functionality looks nice so far. If you need any help/tips for the advanced features, feel free to PM me.

    Here's some stuff I would like to point out about your code:
    (put in a spoiler, so non-programmers don't get mad :p)
    Show Spoiler

    There is the method JavaPlugin.getConfiguration() that gives you a Configuration-instance of the default config file (/plugins/<PluginName>/config.yml). It automatically creates it when there is none (as well as the folder), so it saves a lot of coding work and makes stuff easier.
    Code:
        public void onEnable()
        {
            log.info("Enabled NoMelt!");
            PluginManager pm = this.getServer().getPluginManager();
            pm.registerEvent(Event.Type.BLOCK_FADE, blockListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.BLOCK_FORM, blockListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.BLOCK_CANBUILD, blockListener, Event.Priority.Normal, this);
    
            /*
             * Config stuff goes here
             */
            //new config
            Configuration config = getConfiguration();
            //add anti-melting
            noMelting = config.getBoolean("general.noMelting", true);
            //add ice drops
            iceDrop = config.getBoolean("general.icedrop", true);
            //add no ice/snow freezing
            noFreeze = config.getBoolean("general.noFreeze",true);
            //option for ice to spawn water or not
            iceWater = config.getBoolean("general.iceWater", false);
        }
    That would be the copmlete remaining onEnable-method. It's up to you if you want to use it, though ;)
    I also removed config.load() and config.save(). The data is automatically loaded upon creation, and since you don't change anything you shouldn't save it. Again, just a little detail ;)


    I dunno if the source for the /nomelt-command is complete, but you should register it in your plugin.yml. And you have to check if the CommandSender is a player before you cast it to one.
    E.g. if the command is sent from the console, it would now throw a ClassCastException. Use "instanceof" and send a message back if it's not a player.

    And a tiny little typo in toggleBuild ;)
    player.sendMessage("You have diabled no-melt building.");


    But these are only small things, the source looks pretty clean for your first plugin (except for the missing @Override's, but it seems like nobody is using them any more :|).
     
  14. Offline

    xsolar66

  15. Offline

    Vynlar

    The command stuff is only like a quarter done and i had it registered in the plugin.yml but removed it so if someone *happened* to type it, it couldn't cause anything that isn't released yet.I'll be sure to change the little things in the code.

    I'm unsure as to how to store cuboids in some sort of file. I've read posts about it but they never get into the detail, only concepts. What file type/database, and past that I can figure out how to detect if someone is in it and get input for new ones.
     
  16. @Vynlar
    I almost assumed that thing with the command.
    For the cuboid: You could take a look at the source of my plugin RoutePlanner, where I cover pretty much everything you need for your cuboids. The difference is that I check when a player moves into a region, and you would simply check if the block that is about to fade/form is in it.

    It might be a bit complicated to understand for an "outsider". Feel free to PM me. If you have Skype, I can help you there as well.

    Basically, the idea is to store the coordinates of the minimum and maximum point as integers (and ofc the world). You can take whatever filetype you want (I used YAML).
     
  17. Offline

    Vynlar

    Yeah, would I use the same configuration methods to store it or just write to the file?
     
  18. You can just create another Configuration-instance and use setProperty and the getXXX-methods.
    And please make sure you read from the file in onEnable and store the settings in a HashMap, so you don't always have to read from the file (performance thingy).
     
  19. Offline

    Vynlar

    Should I store the data like:

    region 1:
    x: 1.2434312
    y: 4.5653453
    z: 7.453434
    region 2: etc..?
     
  20. @Vynlar
    Did you read my post? A region isn't based on only one x/y/z-coordinate. There is a minimum and a maximum point to be stored. And since you are storing data about blocks, use integers instead of floats/doubles. Also you need to store the world(-name).

    This is how the regions of a finished route in RoutePlanner looks like (the relevant part):
    Show Spoiler
    Code:
        triggerRegions:
                r0:
                    pos1:
                    - -36
                    - 76
                    - 125
                    pos2:
                    - -29
                    - 82
                    - 134
                    world: world
                r1:
                    pos1:
                    - -40
                    - 78
                    - 131
                    pos2:
                    - -44
                    - 76
                    - 128
                    world: world
                r2:
                    pos1:
                    - -40
                    - 78
                    - 150
                    pos2:
                    - -45
                    - 76
                    - 145
                    world: world
                r3:
                    pos1:
                    - -56
                    - 79
                    - 152
                    pos2:
                    - -51
                    - 76
                    - 145
                    world: world
                r4:
                    pos1:
                    - -48
                    - 70
                    - 154
                    pos2:
                    - -58
                    - 66
                    - 152
                    world: world
     
  21. Offline

    Vynlar

    Yeah, derp for me. The setProperty() is being weird for me and not actually saving anything.

    Edit: had to add "regions.save()"
     
  22. Offline

    vrox

    Multiworld support for this would rock.
     
  23. Offline

    Vynlar

    Ill get to it when I'm done with cuboid protection.

    I'm extremely close to being finished with cuboid protection. Just have to make the checks to see of the melting/forming blocks are in the region and squash some little bugs that will most likely pop up. Get ready for area specific anti-melting. ;)

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

    xsolar66

    epic work! then the last few things is the multi world support and, for me, :p the ability to place torches on ice blocks: so one could have a big ice fortress made entirely of ice and still have it lit up with torches =p
     
  25. Offline

    Vynlar

    I looked into the torches but I'm just focusing on getting the cuboid code finalized so I don't have 2 sets of half done code at the same time. And so you all get an update sooner.
     
    xsolar66 likes this.
  26. Offline

    xsolar66

    Hi Vynlar - hows the cuboid coding going?
     
  27. Offline

    Vynlar

    I'm about 3/4 of the way through. Haven't been on my computer since yesterday afternoon. I know exactly what to do to finish it though, just have to find time to sit down and do it.
     
  28. Offline

    hiro24

    O.O !!!!

    I <3 you!!!

    ...though this REALLY would have came in handy a month ago when we did our ice world event.. the ice castle wouldn't have been so dark. :)
     
  29. Offline

    Vynlar

    Well it looks like you will have to have another one! You should invite me. ;) Rofl
     
  30. Offline

    hiro24

Share This Page