Majora's Masks

Discussion in 'Plugin Requests' started by Knucklesfan, Sep 18, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Knucklesfan

    Plugin category: Video game based.

    Suggested name: Majora's Masks

    What I want:
    Majora's mask. A game filled with horror. Adventure. Time. Alot of time. A moon. A kid wearing a mask. That is what makes majora's mask the best. And people will argue about this like "oh meh gawd. Majorahz mahsk sux. Buhrn it!" but, it is undoutfully in our hearts and probaly wont come out. But, what if, the mask mechanic made it to minecraft. It would be huge!! And that is what my idea is. This plugin will mostly concent of 4 main masks, which will do probaly the most of them. First off is the deku mask.
    [​IMG]
    This mask will turn the player into a deku scrub, changing his outfit and head. Sorta like this:
    [​IMG]
    It will soon provite the player to do a deku flower jump (which is done by crouching) , which will teleport the player into the ground. When they jump, the player will be launched into the air and will drift slowly down to the ground. To return to your prior form, is by playing the song of healing, or if you werent transformed, you'll just take off the mask from your head slot. Next, is the zora mask, which looks like this:
    [​IMG]
    and yet again, youll look like this (sorta, with leather armor)
    [​IMG]
    Now, with this ability, you get nightvision when your underwater. You can move much faster underwater, and can swim faster too. You can also shoot explosive squids, which will blow up and do a creeper explosion, so it can be toggled with /gamerule MobGreifing false. Next, and the final one, The goron mask.
    [​IMG]
    and youll look kinda like this:
    [​IMG]
    Now, this mask lets you pick up blocks by right clicking them. You can through blocks and they will smash.
    This mask is also immune to fire. The last mask is called the fierce deity mask. It will look like this. [​IMG] The skin will look like this: [​IMG] The mask will give you strength 2, and regen 5. It will also give you more hearts, and the capibility to shoot light arrows, which deal twice the damage of a normal arrow. Now for the most cool part: The config masks. Theese masks are completly configurable! In the mask.yml file, there will be some basic ones, just default ones, and you can create ones that give you potion effects and particles. You can even set the skin that the mask will use, by setting this value:
    mask-skin:http://static.planetminecraft.com/f...review/GoronLinkzG_minecraft_skin-3246260.jpg (this is the goron skin just for an example, and isnt a real skin)
    use-mask-skin:1
    the above must be on to use the mask skins. The last and final mask, is majoras mask. This mask is evil. The mask will say evil sayings, which is configurable in the settings. But, you can curse players. You can permanently (until they craft an ocarina) turn a player into a specified mask type. It will open a gui, and will have the main 4 mask selections. There is no way to reverse the effect of the mask. Your stuck the way it is, unless you play the song of healing.

    Ideas for commands:
    /mm help | General help page
    /mm give | Gives a specified mask
    /mm list | Lists the masks

    Ideas for permissions:
    mask.canuse. Set it to false if they can't use the masks
    mask.admin. Alows usage of the /mm command
    mask.* Does everything in the mask plugin
    When I'd like it by: End of 2015. Dont rush yourself
    Dependacnys: OcarinaSong for the song of healing
     
    Last edited: Sep 19, 2015
  2. Offline

    Knucklesfan

    someone please reply. I would really like this made
     
  3. Offline

    Knucklesfan

  4. Offline

    timtower Administrator Administrator Moderator

    @Knucklesfan Skins are impossible to use unless you find a player that is using that skin right now.
     
  5. Offline

    Knucklesfan

    Indeed. I know that. Use freshcoal. It has alot of majora mask masks on the site. Please try. Nobody has ever made one of my plugins. Please get this done.
     
  6. Offline

    mrCookieSlime

    That is incorrect.
    You can in fact use any Skin that WAS or IS being used by a Player. Whether it is that Player's current Skin does not matter.
    You just need the Base64 encoded JSON-String containing its timestamp and Image Link.
    And that is easy to retrieve using Code.
     
  7. Offline

    timtower Administrator Administrator Moderator

    Learned something then.
     
  8. Offline

    mrCookieSlime

    @timtower
    Now that I am on my PC I could give you a Snippet on how to create a custom GameProfile using this Base64 encoded JSON-String as it is part of CS-CoreLib.
    However I used Reflection and to improve the performance I cached all classes, constructors and methods, so the Snippet would look extremely messy.
     
  9. Offline

    timtower Administrator Administrator Moderator

  10. Offline

    mrCookieSlime

    @timtower
    It isn't really messy. It just may seem like a wall of text to anyone who is unfamiliar with Reflection.
    And undocumented, since I am providing a Background-Method which is private and not publicly accessible. However I could make it public for this particular Plugin.
    (Disclaimer: Before anyone asks, no I am not interested in doing this.)

    Creepy Code inside (open)


    Code:
    public class CustomSkull {
       
        private static Method tileentity, gameprofile, property, insert_property, map_list, get_name, get_value, getOwner;
        private static Constructor<?> position, profile_constructor, property_constructor;
        private static Class<?> profile_class, property_class, map_class;
       
        static {
            try {
                if (ReflectionUtils.getVersion().startsWith("v1_7_")) {
                    profile_class = Class.forName("net.minecraft.util.com.mojang.authlib.GameProfile");
                    property_class = Class.forName("net.minecraft.util.com.mojang.authlib.properties.Property");
                    map_class = Class.forName("net.minecraft.util.com.mojang.authlib.properties.PropertyMap");
                }
                else {
                    profile_class = Class.forName("com.mojang.authlib.GameProfile");
                    property_class = Class.forName("com.mojang.authlib.properties.Property");
                    map_class = Class.forName("com.mojang.authlib.properties.PropertyMap");
                }
               
                profile_constructor = ReflectionUtils.getConstructor(profile_class, UUID.class, String.class);
                property = ReflectionUtils.getMethod(profile_class, "getProperties");
                property_constructor = ReflectionUtils.getConstructor(property_class, String.class, String.class);
                insert_property = ReflectionUtils.getMethod(map_class, "put", String.class, property_class);
                map_list = ReflectionUtils.getMethod(map_class, "get", String.class);
                gameprofile = ReflectionUtils.getClass(PackageName.NMS, "TileEntitySkull").getMethod("setGameProfile", profile_class);
               
                getOwner = ReflectionUtils.getMethod(profile_class, "getName");
                get_name = ReflectionUtils.getMethod(property_class, "getName");
                get_value = ReflectionUtils.getMethod(property_class, "getValue");
               
                if (ReflectionUtils.getVersion().startsWith("v1_8_")) {
                    position = ReflectionUtils.getConstructor(ReflectionUtils.getClass(PackageName.NMS, "BlockPosition"), int.class, int.class, int.class);
                    tileentity = ReflectionUtils.getClass(PackageName.NMS, "WorldServer").getMethod("getTileEntity", ReflectionUtils.getClass(PackageName.NMS, "BlockPosition"));
                }
                else {
                    tileentity = ReflectionUtils.getClass(PackageName.NMS, "WorldServer").getMethod("getTileEntity", int.class, int.class, int.class);
                }
            }  catch (Exception e) {
                e.printStackTrace();
            }
        }
       
        private static Object createProfile(String texture) throws Exception {
            if (!CSCoreLib.getLib().getCfg().contains("skulls.uuids." + texture)) {
                CSCoreLib.getLib().getCfg().setValue("skulls.uuids." + texture, UUID.randomUUID().toString());
                CSCoreLib.getLib().getCfg().save();
            }
            Object profile = profile_constructor.newInstance(UUID.fromString(CSCoreLib.getLib().getCfg().getString("skulls.uuids." + texture)), "CSCoreLib");
            Object properties = property.invoke(profile);
            insert_property.invoke(properties, "textures", property_constructor.newInstance("textures", texture));
            return profile;
        }
    }
     
  11. Offline

    Knucklesfan

    woah..... that is alot of code.... :eek:

    man.... I really wish i could code now :p

    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 26, 2015
Thread Status:
Not open for further replies.

Share This Page