• 0

    posted a message on Should I use metadata for my item?

    Well, I decided to use metadata.

    Can't say if it's helped yet as I've not even begun working on the scroll equip system as of now (working on this damned mana system), but it's definitely cleaned up the project.

    Thanks!

    Posted in: Modification Development
  • 0

    posted a message on Should I use metadata for my item?
    Quote from sky_01»

    In 1.8+ it takes a lot more work with the JSON files, but it's pretty easy in 1.7.10 to make items change texture based on metadata. I do it in my Nomadic Tents mod, with one tent item using metadata for 9 different textures and behaviors.


    For best results, override getUnlocalizedName(ItemStack stack) to return super.getUnlocalizedName(stack) + "." + variant where variant is some unique String for each metadata value.

    Also override getSubItems to add an ItemStack to the list for each metadata value (this is used for creative-tabs), and call this.setHasSubtypes(true) in the constructor.


    Because 1.7.10 uses IIcons, override registerIcons and getIconFromDamage along with an IIcon[ ]


    You can see all of this here.


    Thank you for this information, but I was also wondering if this would assist in the concept I have concerning equipping spells onto a staff, mainly, would this make it easier for me to determine exactly what spell is currently on the staff, and have that alter the onItemRightClick
    function to have a different effect?

    I'm also a bit concerned about what you said about it taking more work in 1.8, in case I ever want to update my mod for any reason.

    Anyway, thank you for your time.
    Posted in: Modification Development
  • 0

    posted a message on Should I use metadata for my item?

    I'm working on a Dark Souls-styled mod, based around catalysts (basically magic staves). Of course, I took a few artistic liberties so it isn't exactly the same as the game itself.

    My idea is that scrolls must be equipped onto a catalyst, in a similar fashion to placing an item into a chest, before you can cast anything.

    I made a different class for each scroll. Yes, I know this is dumb, but seeing as I'm not really experienced with metadata and damage values and such, I didn't really want to push it.

    Now I'm wondering if I should have just used item metadata, and if this would even make equipping spells onto catalysts easier.

    Posted in: Modification Development
  • 0

    posted a message on Not Sure Where to Put This, But I Need Some Help on Improving my Terraforming

    (TL;DR is at the bottom)


    Have you ever seen projects like these:



    If you haven't, you have now. Do you see how smooth yet full of detail the terrain is? The tree's roots included too. That's kind of what I want to achieve. However, when I use Voxelsniper (which was apparently used by the person that created the terrain above)'s default smooth brush, along with some gunpowder + /b e melt , I get this:




    I can't tell if it's the angle I've got it at, or the angle the other person's got it at, or even just because I'm using a bad method to smooth? Any tips at all would be greatly appreciated... Thank you so much for your time.


    TL;DR My terraformed terrain looks terrible when I smooth it, other people's terrain looks great when they smooth theirs.

    Posted in: Maps Discussion
  • 0

    posted a message on How Do You Add and Subtract NBT Values?

    SOLUTION:


    Okay, so I think I found how to do it...



    @Override
    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
    {
    if(itemstack.getTagCompound().getInteger("CurrentMana")>=itemstack.getTagCompound().getInteger("EquippedScrollCost"))
    {
    itemstack.getTagCompound().setInteger("CurrentMana", itemstack.getTagCompound().getInteger("CurrentMana") - itemstack.getTagCompound().getInteger("EquippedScrollCost"));
    }
    return itemstack;
    }


    The solution area is marked in red.

    Posted in: Modification Development
  • 0

    posted a message on How Do You Add and Subtract NBT Values?

    I'm a bit new to the whole NBT thing... please forgive me. I'm trying to make a staff that has a current amount of mana that regenerates every tick, and a maximum amount of mana. Every time it's used, the current amount will go down according to what scroll is in the staff's inventory. How would I go about subtracting the value of the scroll's cost from the current mana cost..?


    Current Code:


    @Override
    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
    {
    if(itemstack.getTagCompound().getInteger("CurrentMana")>=itemstack.getTagCompound().getInteger("EquippedScrollCost"))
    {
    // funny stuff here
    }
    return itemstack;
    }


    I've tried doing


    itemstack.getTagCompound().getInteger("CurrentMana") - itemstack.getTagCompound.getInteger("EquippedScrollCost"));


    But it doesn't seem to work. What should I be using? Thanks.

    Posted in: Modification Development
  • 0

    posted a message on MoreMine


    A long time ago, I began working on a Minecraft mod. At the time, I didn't exactly know what I was getting into. It led to me never finishing the mod, as it felt too daunting to complete, and multiple setbacks took place throughout my time working on the project (at one point I lost the files when my hard drive broke, another time my workspace got corrupted, etc.). I recently began working on it again, and it is now complete. I present to you, ladies and gentlemen, MoreMine for Minecraft 1.7.10!


    DISCLAIMER: Seeing as this is my first mod , I would like people interested in this mod to know that I am not quite as experienced yet as other modders with both programming mods expertly, and with handling the release of a mod. Although I will do my best to provide support for this mod, I must ask of you to have patience with me, as this mod is mostly a learning experience for me. I also cannot guarantee that this mod will function on a server with forge support.


    Description:


    The mod aims to add more to Minecraft, without quite divulging from the feel of vanilla Minecraft. It does this by adding onto already existing materials rather than adding its own.


    This mod adds:


    - Emerald Toolset and Armor

    - Lapis Lazuli Toolset and Armor

    - Ender Toolset and Armor

    - Obsidian Toolset

    - Blaze Toolset and Armor

    - A recurve bow for you to 360 noscope some noobs! By noobs, I mean sheep.

    - New (additional) arrow and string crafting recipes

    - Sheep now drop Mutton, which can be cooked!


    Recipes:


    Emerald and ender tools and armor can be crafted like vanilla tools and armor, replacing any tool materials (wood, stone, iron, diamond, etc). with emerald and ender pearls, respectively. The other additions are not quite as simple.


    To obtain Lapis tools (honestly not quite worth it, a bit better than stone. I might change it in the future depending on feedback), one must first refine the dye into a solid substance.


    These can then be used in place of tool materials to create Lapis tools:


    For obsidian tools to be created, one must first create a handle strong enough to carry the weight of obsidian without breaking in half. Perhaps, one of iron..?


    Now we can support the obsidian, but a whole block of obsidian is still too much weight for one man. Breaking it down will make it more bearable.


    And with that, we can now make an obsidian tool.


    In order to create an item that can harness the power of a Blaze, you must obtain the source of its power, the Blaze Rod. Using these in conjunction with iron will allow you to harness its powers.


    The recurve bow can be crafted as follows:

    Similar to FatherToast's old Dungeon Crawler mod (shoutout to FatherToast, who
    does some pretty good mods), you can now make arrows using quartz
    instead of flint, in case you're ever in the Nether, use bows a lot of
    the time, and apparently forgot to bring flint.



    Wool can now be reverse-engineered into string.



    Concerning armor sets, all of them can be created by using their associated materials


    | Emerald Armor - Emerald

    | Lapis Armor - Refined Lapis

    | Ender Armor - Ender Pearls

    | Blaze Armor - Blaze Rods


    in place of the vanilla armor materials.


    Tool and Armor Abilities:


    In the case of the Blaze Pickaxe, you can do something like this:


    smelting whatever it breaks (Note that this does not smelt stone when broken, as the stone block itself has no smelting result. It will, however, smelt cobblestone when it is broken).


    The Blaze Sword inherits Fire Aspect by default. Other Blaze tools currently do not have any special functionality (suggestions welcome).


    The Ender Sword, when right-clicked, fires an ender pearl (note that this still damages you).

    Well, my aim is off... but if you're skilled with throwing ender pearls, you will be able to use this with ease.


    Some armor sets provide bonuses to you when the full set is equipped. Namely, the Ender set, and the Blaze set.



    Installation Process:


    STEP 1: Download forge from this link right here

    STEP 2: Launch the installer

    STEP 3: Let it do its thing

    STEP 4: ???

    STEP 5: Profit.

    STEP 4: Download my mod (link is somewhere below)

    STEP 5: Drag that .jar into your mods folder. This location will differ from OS to OS.

    WINDOWS: C:\Users\(yournamehere)\AppData\Roaming\.minecraft

    MAC: /Users/<User>/Library/Application Support/minecraft


    That's pretty much it. If I've forgotten anything, I'll probably edit in later, somehow.


    Oh, wait. Where's the download?


    Here it is.



    1.7.10 (First Release! Min Forge version is 1.7.10-10.13.4.1558-1.7.10):


    https://www.dropbox.com/s/22476ns20zc21ba/MoreMine-1.0b-mc1.7.10.jar?dl=0


    CLOSING NOTE:

    Although this mod is in beta, and in 1.7.10... I intend to update it (both what is in the mod and what version it is compatible with), although I might skip 1.8, and instead wait for the release of 1.9. Either way, I would like to thank you for taking interest in this mod. Have fun!

    Posted in: WIP Mods
  • 0

    posted a message on Checking For Specific Blocks and the Player who Broke Them (Question)
    Quote from Hajto»
    In Block class (that you probably have to inherit from) has method:

    //Called right before being destroyed
    public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_) {}

    // I would use this one
    public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest)
    {
    return removedByPlayer(world, player, x, y, z);
    }

    //You can get this snipper in Intellij by hitting alt+insert, clicking override methods and selecting that name
    It would be something like that
    public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest)
    {
    //Do fancyStuff here
    return removedByPlayer(world, player, x, y, z);
    }


    Ah, thanks! That really helped! However if I break a block using a tool, can I check by using the tool itself with some code?

    For example,

    if (blockBrokenWithThisTool = block.Stoneorsomething) {
    }

    else

    {other stuff}
    Posted in: Modification Development
  • 0

    posted a message on Checking For Specific Blocks and the Player who Broke Them (Question)
    Quote from Hajto»
    Everything is possible when it comes to programming. Could you explain more briefly what you want to do?

    For example you want to post a message when someone breaks x block with displayName of player.

    Hi! Thanks for taking an interest in helping me out. (There's a TLDR at the end if the text below looks long)

    Specifically, I am trying to create a team - based mod. Each team has a base block which when broken will create another block in its place, a "damaged version" of it. However, I would like to send out a message to players whose base block is damaged, "PLAYER has damaged your base block!" or something similar to that.


    I am also using it in another mod, since one of my tools keeps crashing when running my autosmelt code and I am too lazy to actually fix it, I am trying to find a way to scan what block was broken to prevent the code from launching on specific blocks like stone, since it is not a "smeltable" block.

    TL, DR; Fancy blocks that say who broke them out loud to specific players in the chat.
    Posted in: Modification Development
  • 0

    posted a message on Checking For Specific Blocks and the Player who Broke Them (Question)
    Hello!

    I haven't been modding or practicing coding for a while, so I'm a wee bit rusty. Forgive me for asking, but is it possible to check for specific blocks and the player who broke them? Prefferably using a hook of some sort?

    Thanks,
    ShadowedEclipsis
    Posted in: Modification Development
  • 0

    posted a message on Mods and Adventure Maps.
    Err... Bump I guess? There's really no solution here?
    Posted in: Mods Discussion
  • 0

    posted a message on Mods and Adventure Maps.
    NOTE: In a hurry or don't wanna read that wall of text? Skip to the TL;DR explanation at the end of the post.

    This isn't actually a mod, or a request for one, more of a question about mods. Specifically, mods and adventure maps. Now, imagine if I were to download a sweet adventure map with pre-generated ores, and a custom landscape. Now keep in mind that this map was only made with vanilla tools (Worldedit, VoxelSniper, WorldPainter, etc., etc.). I load up the world on my heavily modded client with mods that add new landscape generation features, like Metallurgy with the new ores, only to find that the ores from these mods are nowhere to be found in the map! And this brings about my question: How can you add ores from a mod onto a premade adventure map? I'm not sure if there's a feature like this, and unlike normal worlds where you can delete level.dat to bring about new generation (different biomes than normal, but still keeping trees, ravines and the like), deleting level.dat corrupts the save. Any help?

    BTW, I've tried Google, and that didn't bring up any answers.
    Thanks in advance!

    TL;DR: How do you put ores from a mod into an adventure map?
    Posted in: Mods Discussion
  • 0

    posted a message on HELP! How can i work on 2 separate mods at the same time in eclipse
    I don't understand this question. Do you want to set up another workspace for a mod or work on two mods in the same workspace? Doing the latter is nigh impossible.
    Posted in: Modification Development
  • 0

    posted a message on Enchanted Weapons?
    Quote from Fir3will»
    Correct but that checks if the item is in any way enchanted already, this might glitch out when an ItemStack starts with an enchantment beforehand. (before updating)

    @RuiisuMizokami
    Here's what I think you should do:
     @Override
    public void onUpdate(ItemStack stack, World world, Entity entity, int a, boolean B)
    {
     if(!hasEnchantment(stack, Enchantment.sharpness, 1, false))
     {
     stack.addEnchantment(Enchantment.sharpness, 1);
     }
    }
    Replace the previous method with this one.

    This works as well.
    Posted in: Modification Development
  • To post a comment, please or register a new account.