[INACTIVE][DEV/MECH] Magickraft v0.1.0.0 - A rune framework for Bukkit [326]

Discussion in 'Inactive/Unsupported Plugins' started by cvpcs, Feb 20, 2011.

  1. Offline

    cvpcs

    Magickraft - A rune framework for bukkit
    Version: v0.1.0.0

    After noticing that there are many Rune plugins available for bukkit, I was thinking it would be nice to make a development framework that makes it easy to add/remove runes that you want to have on your server. And lo, Magickraft was born!

    Magickraft is a framework that allows developers to create what are known as "Rune Sets", these are sets of runes, packages as an independant JAR file, that when thrown into the plugins/Magickraft/runesets folder, are dynamically loaded and inserted into the global list of runes. Each rune is then able to be individually enabled/disabled through the use of the plugins/Magickraft/config.yaml file.

    Magickraft is completely open source and was originally forked from the work done by Eeketh for his EekRunes plugin. I forked that code and began rewriting it with the idea of making a framework by which other developers can create rune sets without having to rewrite the base code that actually runs the runes themselves.

    How to Use (for Users):
    The first step is to download the Magickraft Bukkit Plugin and run it. This will generate the various configs and directories used by the system. The structure will look like this:

    Code:
    plugins/
        Magickraft.jar
        Magickraft/
            config.yaml
            runesets/
    
    You now want to add runesets to the runesets/ directory. Simply place the desired runesets into the directory and reload the Magickraft plugin and it should automatically detect and load that runeset.

    On first load of the runeset, Magickraft will auto-enable all runes and place this default configuration into the config.yaml file. You can then enable/disable runes individually as you see fit. This is particularly useful when using runesets that have conflicting runes, as you can enable the one you want to use and disable the other.

    How to Use (for Developers):
    You will need to download the Magickraft plugin JAR and link it to your project so that you can reference the various APIs available.

    I don't have any docs written up yet but you can see how the provided Runesets for Magickraft and Runecraft are constructed by going to http://github.com/cvpcs/Magickraft under the Magickraft.Magickraft and Magickraft.Runecraft directories respectively. They are constructed in the exact same format as a Bukkit Plugin, only their main class is designed to return lists of runes that are implemented in that set.

    I will be adding javadocs soon to help assist in development, and many runes are available to look through at the moment.

    Provided Rune Sets:
    I have provided 2 rune sets already for use with this system.
    • Runecraft: a runecraft recreation set. Information about the structure of the runes can be found at http://www.minecraftwiki.net/wiki/Runecraft. Currently the following runes are implemented:
      • Chrono Trigger
      • Compass
      • Hidden Door (with redstone activation, so it can act as a flood gate)
      • Freezer
      • Magic Beacon
      • Mineshaft
      • Oracle
    • Magickraft (requires Runecraft set): an extension of the runecraft set (as it uses the tier system), it provides the following runes (description of how these runes are constructed soon to come):
      • Aeroga - raise an entire continent into the air
        (rune is in the form of the classical symbol for air, pointing vertically into the sky)
        [air] [air] [air] [ironore] [air] [air] [air]
        [air] [air] [ironore] [obsidian] [ironore] [air] [air]
        [air] [air] [ironore] [obsidian] [ironore] [air] [air]
        [ironore] [ironore] [ironore] [diamondblock] [ironore] [ironore] [ironore]
        [air] [ironore] [obsidian] [obsidian] [obsidian] [ironore] [air]
        [ironore] [obsidian] [obsidian] [obsidian] [obsidian] [obsidian] [ironore]
        [ironore] [ironore] [ironore] [ironore] [ironore] [ironore] [ironore]
        Where:
        [obsidian] = any teired block (all of the same type). the higher the teir the larger the effect
        [ironore] = solid iron blocks
        [diamondblock] = solid diamond block
        Then right click on the diamond block to activate it.
      • Firega - burn the crap out of everything within a given radius of you and make it look nether-ish
        (rune is in the form of the classical symbol for fire, pointing vertically into the sky)
        [air] [air] [air] [ironore] [air] [air] [air]
        [air] [air] [ironore] [obsidian] [ironore] [air] [air]
        [air] [air] [ironore] [obsidian] [ironore] [air] [air]
        [air] [ironore] [obsidian] [diamondblock] [obsidian] [ironore] [air]
        [air] [ironore] [obsidian] [obsidian] [obsidian] [ironore] [air]
        [ironore] [obsidian] [obsidian] [obsidian] [obsidian] [obsidian] [ironore]
        [ironore] [ironore] [ironore] [ironore] [ironore] [ironore] [ironore]
        Where:
        [obsidian] = any teired block (all of the same type). the higher the teir the larger the effect
        [ironore] = solid iron blocks
        [diamondblock] = solid diamond block
        Then right click on the diamond block to activate it.
      • Waypoints - custom implementation of waypoints
    Features:
    • Provides an open-source framework for adding runes to a server.
    • Runes can be added in the form of "sets"
    • Runes can be individually shut off and turned on
    • Hope to provide a central way of implementing runes instead of scattering implementations across several plugins.
    Download:

    The core plugin: https://github.com/cvpcs/Magickraft/blob/master/Magickraft/dist/Magickraft.jar?raw=true

    Rune Sets:
    Code:
    All code for the Magickraft base plugin as well as the provided rune sets is open source and available at my github:

    http://github.com/cvpcs/Magickraft

    Changelog:
    Version 0.1.0.0
    • Initial release
    --- merged: Feb 22, 2011 3:49 AM ---
    added some rune descriptions for the Magickraft rune set
     
    NoFear13 likes this.
  2. Offline

    rm_you

    I like the way this is organized, but the rune definition is a little bit painful. I was going to write a parser for some less painful format for defining runes, but it's actually extremely difficult even to read them as they are now. Can you give some sort of explicit definition for how exactly the setup for IRuneNode is done?

    An alternative might be to define them as a file and parse that. Right now, Compass is:

    Code:
    new RuneStructure(3, 3)
                    .setRuneMap(new IRuneNode[][]{
                            {
                                RNComplexAnd.getInstance(
                                        RNTier.getInstance(),
                                        RNMaterialGroup.getInstance(0)),
    
                                RNMaterial.getInstance(Material.AIR),
    
                                RNComplexAnd.getInstance(
                                        RNTier.getInstance(),
                                        RNMaterialGroup.getInstance(0)),
                            },
                            {
                                RNMaterial.getInstance(Material.AIR),
    
                                RNComplexAnd.getInstance(
                                        RNTier.getInstance(),
                                        RNMaterialGroup.getInstance(0)),
    
                                RNMaterial.getInstance(Material.AIR)
                            },
                            {
                                RNComplexAnd.getInstance(
                                        RNTier.getInstance(),
                                        RNMaterialGroup.getInstance(0)),
    
                                RNMaterial.getInstance(Material.AIR),
    
                                RNComplexAnd.getInstance(
                                        RNTier.getInstance(),
                                        RNMaterialGroup.getInstance(0)),
                            },
                        })
    
    I'd like it to look more like... Maybe a file named Compass.rune:
    Code:
    
    3	3	1	//Dimensions W/L/H (X/Y/Z)
    0	A	0
    A	0	A
    0	A	0
    
    
    That could be loaded like this:
    Code:
    
    File runeFile = new File("Compass.rune");
    Scanner s;
    int w,l,h;
    String[][][] runeFormat;
    try {
    	s = new Scanner(runeFile);
    	w = s.nextInt(); l = s.nextInt(); h = s.nextInt();
    	s.nextLine(); //Force Scanner to next line
    	runeFormat = new String[h][l][w]; 
    	
    	for (int z = 0; z < h; z++) {
    		for (int y = 0; y < l; y++) {
    			for (int x = 0; x < w; x++) {
    				runeFormat[z][y][x] = "" + s.next();
    			}
    			if (s.hasNextLine())
    				s.nextLine(); //Force Scanner to next line
    		}
    	}
    	System.out.println(w + " " + l + " " + h);
    	System.out.println("Rune Format:" + runeFormat.toString()); //Doesn't really work... Check in debugger
    } catch (FileNotFoundException e) {
    	e.printStackTrace();
    }
    
    With that data, the parser could go on to create the RuneStructure programatically.

    It could be done without a format definition file, or in a different style, or whatever. Just saying it would be neat if it weren't defined quite like it is now. :)

    Apart from that, I'm going to switch to this very soon from the current runemod I'm using. Nice work!
     
  3. Offline

    cvpcs

    Well, the reason IRuneNode is done is so that each "part" of a rune can be identified differently, and accepted on different terms. For instance, RNAnything accepts any type of block in that "part" of the rune. RNMaterial only accepts a particular type of block. RNTier only accepts block that are at or above a given tier. RNMaterialGroup is a little more complicated, essentially it says "all other blocks of the same group number have to be the same type". RNComplexAnd, RNComplexOr, RNComplexNot are meta-types that are based on other types, so you can use RNComplexAnd to say "this block must be at least Tier 3 AND be part of this material group.

    I agree that it can be hard to read right now, mostly because the naming conventions are kind of long. I do the ".getInstance()" thing so that I can just reuse rune nodes of the same type rather than loading tons of duplicate types into memory.

    I'm up for coming up with a better way to define it, but I would prefer that we leave the current implementation in place because it's extremely extensible, and then maybe create a parser that essentially fills in this data for you from an easier format, or something along those lines.
    --- merged: Feb 22, 2011 4:36 AM ---
    I should also explain that the setRuneMap() function either takes a 3-dim array for 3d runes, or a 2-dim array for 2d runes. they are then organized as you would expect, where 2d slices are x/y for each node:

    Code:
    {{node, node, node},
    {node, node, node},
    {node, node, node}}
    
    and 3d has each sliced defined the same way, with the definition of each slice being from bottom-up.

    the slices in the compass rune above look a little funny because i expanded the arrays to:

    Code:
    {
        {
            node,
            node,
            node
        },
        {
            node,
            node,
            node
        },
        {
            node,
            node,
            node
        }
    }
    
    Also, i should mention that by default it is assumed that you must click the block on the bottom slice in the exact center to activate a rune. You can increase the height by setting the click height.
     
  4. Offline

    Soul Reaper

    Is it possible to port the waypoint runes from EekRunes to this?
     
  5. Offline

    Dreamskiller

    Hey, really interesting plugin (I'd rather use this one than the original runecraft).

    Does it support waypoint/teleport ?
     
  6. Offline

    Soul Reaper

    according to op it is
     
  7. Offline

    Rogem

    Can't seem to load Magickraft Runeset... Any help? I have the runesets in proper folder.
    Do I need to modify the Config file or sthing?
     
  8. Offline

    Dreamskiller

    Ok, I'll try this mod so. With mcMMO and Craftbook, we will got everything to play :D (except more monsters, monsters which descruct blocks, challenges ...)

    Edit; Runecraft (off) has a bukkit plugin now.
     
  9. Offline

    cvpcs

    Sorry for my absence in the last few days, I've been moving to a new place and have not had teh internetz.
    --- merged: Feb 28, 2011 6:21 PM ---
    I intend to get rid of the waypoint rune from the Magickraft set and add waypoints to the runecraft rune set instead.
    --- merged: Feb 28, 2011 6:23 PM ---
    There is a problem with loading runesets that are interdependent on each other. Magickraft depends on Runecraft for the Tier system (this has since been fixed and in an upcoming update it will not have any dependencies), but the problem is that rune sets are loaded alphabetically, so Magickraft loads before Runecraft and can't find the classes it needs.

    The interim solution is to rename the Magickraft rune set .jar to something like "SMagickraft.jar" so that it will be loaded after the Runecraft set.
     
    Rogem likes this.
  10. Offline

    Soul Reaper

    Thanks, runecraft is still real buggy for me so I need another solution :D
     
  11. Offline

    Rogem

    Thanks, cvps

    Works great now... been spamming my friends to insanity with floating islands, lol!
     
  12. Offline

    cvpcs

    lol Aeroga is definitely my favorite rune so far. Also going to make a Waterga rune that does a mspaint style fill downward of water, so think of it as like "damn this canyon would make an awesome lake" and BAM suddenly it is.
     
  13. Offline

    testerossa

    hi, can you update to new recommended build? (CB493)
    thanks
     
  14. Offline

    cvpcs

    Yes, I will update sometime this weekend. I just got my internet back and apparently my minecraft server that I use for testing decided to go nutz and fry itself.
    --- merged: Mar 4, 2011 5:46 PM ---
    On an unrelated note, your name reminded me of Teletha "Tessa" Testarossa, which made me smile, and I thank you for that. :D
     
  15. Offline

    nekosune

    I have actually fixed this for the changes that today broke, and fixed a few minor niggles that occured. Due to my method of fixing stuff (copy pasting it until I get parts that look wrong) it is in a different namespace however, would you wish a copy uploaded somewhere, or shall I just keep it to myself?
     
  16. Offline

    Nytemare3701

    Can you tie the runes to permissions, so only certain people can use specific runes?
     
  17. Offline

    kerbe

    I
    I'm interested in this plugin and chances it present. So if you could share your fix, i could perhaps get it working for me too, and can check out if I'm able to do anything with this.
     
  18. Offline

    nekosune

    I will share, if the devel is not online for longer, or he says is okay, this is not a copy programmed similar, this is basically his work, but altered to work with the new version, so I feel is best I get at very least permission to upload

    Will point out this is 568 altered for.

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

    bizzybusk

    are there any permissions support to this ? because i would like donators to have the ability to use these kind of things :)

    quote this please!
     
  20. Offline

    nekosune

    Dosn't seem to be in code, as I said, i am not the creator, just someone who wanted to use this, so alterd it to fit XD
     
  21. Offline

    kerbe

    Well, I creator of this plugin has forked it from another plugin (shown in github). He has also said that his code is open source, so I take that as quite clear sign that he won't mind if fixes are shared. :) So I at least don't see reason why we all should do same fixes if one has already done them :)
    Good way of course would be to make fork on github and upload your fix there, pretty easy for him to adopt those fixes for his repo afterwards. Who knows how glorious collaboration it ends up being :)
     
  22. Offline

    nekosune

    True, I will just have to put it all back into his namespace first. Actually, does anyone know if it will be okay to upload a fork that is in a different namespace?
     
  23. Offline

    kerbe

    I would say it is ok. After all it'll need some tweaking to get it back in his repo, and if his absence extends, easiest method for you to keep your fork up to date is of course best :)
     
  24. Offline

    nekosune

    kerbe likes this.
  25. Offline

    kerbe

    Good job. :) Now I'll have to get my own bukkit dev enviroment up so I can actually get use of that. Main developer being absent was good excuse to postbone it. :p
     
    nekosune likes this.
  26. Offline

    nekosune

    Well sorry to postpone the escuse *laughs* I was going to fix it for the current recommended build, but I saw that that was about to massively be broken and stuff.
     
  27. Offline

    Kajiro

    is this going to get fixed or not? :p
     
  28. Offline

    nekosune

    The version in the link I gave, works with the current recommended build, use
    https://github.com/nekosune/Magick
    instead of the link in OP until OP fixes it.
     
  29. Offline

    kerbe

    Now there is just wait for bukkit to update. :) New version of MC released a while ago. :) I have already updated my vanilla servers for it. :)
    On topic, I hope to get time at weekend / next week for this plugin... Or then I end up coding own game, but hopefully there is time for this. :) Wouldn't mind seeing original author(s) to come back too. :)
     
  30. Offline

    nekosune

    just waiting for bukkit, though there WAS a build 1 hour ago
     

Share This Page