Jump to content

magico13

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by magico13

  1. I believe winrar also can be used by command line. But I rarely use windows (I never use it for working on mods) so I won't be making a windows script (and my windows scripting skills are basically non-existent). But if someone else wanted to that'd be cool. It probably would be beneficial to a lot of the users on here, since I'm guessing they run windows. With fairly minor changes this script could be modified for mac, since it uses bash as well. The number one change would be changing the minecraft directory, which would be pretty much one line, and isn't even a necessary feature. Although I haven't tested that. (I need to get my friend who has a mac to actually try this and tell me what goes wrong.)
  2. I made a small script for myself to handle recompiling, reobfuscating, and creation of a .zip from the reobfuscated files for the small mods I'm working on and figured I'd share it for everyone here. As this isn't really Forge specific I'm putting it here. If it should be moved or removed, I will try to do so, or a moderator can do so. You have to manually enter the folder locations and names for the up to 9 directories it stores. Do that by opening the run.sh file with a text editor (if in Ubuntu, gedit works great) and copy and paste the folder location between the quotes in the path1="" line toward the top, or whatever path you are entering it for. Put the name you want it to be known as in the name1="" line. An example is there already, you can simply replace the example with your own name/path. To find a nice copyable path in Unity, just go to the folder in the file browser and press Ctrl-L. Make sure to include a final "/" at the end of the path, like in the example. Put the script in a directory where it will have permission to create/delete folders and files in it's own directory and in the directories where your mod's folders are. I suggest putting it in it's own folder. It makes two folders in the directory it is in called CopyToZip and reobf. It also temporarily makes a temp folder. I've only tested this in Ubuntu 12.04 x64, it should work in other versions of linux. It may work for Mac with modifications (don't quote me on that) Tips/warnings: WARNING: This script will DELETE EVERYTHING in MCP's reobf folder after it moves it to the reobf folder it makes. It (currently) doesn't check if it actually moved it, and it doesn't ask if you want to delete it. So don't store anything there you don't want to lose. (Why you would do that anyway, I don't know, but you've been warned) You can easily edit the script to not remove that directory by removing or commenting out the line (line 82): rm -rf "$path"reobf/minecraft/ Make sure you make the file executable. To do this using the gui in Ubuntu 12.04, right click on the file, go to the permissions tab, and check the box that says "Allow executing file as a program". Alternatively you may use the command: chmod +x /path/to/file You do not have to put ".zip" when making the zip, it does it for you automatically. For convenience the script makes a folder called CopyToZip in the directory it is in. Inside this folder are numbered folders for each path you've given a name in the script. Anything you put in the numbered folder will get copied into the final zip exactly as it is in the folder. The purpose of this is for textures. Ex. You have a terrain.png that goes to /magico13/mods/ExampleMod/terrain.png and ExampleMod is assigned to name2 and path2. Then put the terrain.png at /CopyToZip/2/magico13/mods/ExampleMod/terrain.png and it will be copied to the right place, and only when you recompile ExampleMod. It will ask if you want to copy the .zip to the .minecraft folder. Only "yes" and "y" will be interpreted as "yes", anything else is interpreted as "no". It will copy it to the mods folder (assuming your .minecraft folder is located in your home folder) but it will not delete any .zip files that have similar names, so you may have an older copy of your mod in there still. If they have the same name it should overwrite the old one. In Ubuntu, after making the script executable, you can run it by double clicking it and choosing "Run in Terminal". To edit it, instead press "Display" When it displays all of the names it has in storage and asks for you to "Enter your choice...", just enter the number that is next to the name you want and press "Enter" I haven't done much linux scripting so there are bound to be errors, I will attempt to help you with them. It has very little error checking. Someone may add more and upload their improved version here for everyone to use if they want. I may add more error checking later, but as this version was pretty much just written for my own use, I didn't need much error checking. The script is called run.sh, you can rename it to whatever you want. Download: http://www.mediafire.com/?ey2j8ry8f6zjknt You have permission to edit the script to better suit your needs and to upload it back to this topic for the purpose of letting others benefit from your improvements. I request that you mention me in the source as the original author if you share your modification. Please do not simply copy it and claim it as your own. And before someone asks how come this isn't doing anything on their Windows/Mac machines, and even though the topic specifically says [Linux], just to make it painfully obvious: THIS WILL NOT WORK PROPERLY OR POTENTIALLY AT ALL ON WINDOWS OR MAC MACHINES.
  3. Thank you Bandayd. I will give that a try tomorrow and let you know how it goes (about to go to bed, class in the morning ) The code from BlockOre.java is what I was trying to use (semi-successfully) in my BlockNetherOres.java (and it's just commented out for now since it wasn't functioning correctly for my purpose). The reason I need metadata is that I'm storing the redstone ore which needs to drop 4 to 5 redstone in the same ID as the other ores that need to drop just one block. So I need to know which block is being broken to define the amount of drops correctly (I don't want it dropping 4 to 5 iron, or only one redstone). I'm trying to just use one ID for the whole thing for convenience. But yeah, I'll try that out since it looks like it's exactly what I needed. Thanks again! Magico13 Update: I just (finally) got a chance to test it out and it's working exactly as I need it! Thank you. For anyone else who may come across this in the future with the same problem, I'll post my updated code: BlockNetherOres.java As you can see, all I had to do was use breakBlock to get the metadata, then used it in a switch statement under quantityDropped. There may be a better way to do this, but this appears to be fully functional! Thank you again Bandayd!
  4. Hello everyone. I'm trying to make a simple little mod that adds the normal overworld ores (and a custom one or two) to the nether (I know it's been done, but I'm also trying to learn Java/Forge modding). Most of the ores use a value of 1 in quantityDropped, but for one of my custom ores I want it to drop 1 to 2, and for the "Nether Redstone" I want it to drop 4 to 5. Since metadata isn't one of the parameters of quantityDropped I can't easily use it in a switch statement and all of the other functions using metadata I've looked at either aren't used when the block is being broken or (in the case of idDropped) are called afterward so I can't just put an integer in the class and call it in qunatityDropped. (It seems strange to me that idDropped would be after quantityDropped but when I was getting the metadata from that then mining a redstone I'd get 1 drop and then mining any of my other ores would result in 4 to 5 drops, hinting to me that it's called afterward). If anyone could either point me to something that has differing drop amounts based on metadata that I can look at, or can otherwise help me out it would be greatly appreciated Thank you. Here is my code (hopefully, I haven't really used many forums so don't know how to use spoiler tags) NetherOreMod.java BlockNetherOres.java ItemBlockNetherOres.java WorldGeneratorNetherOres.java (you probably don't need this, but just to be thorough) Also, if anyone knows how to change hardness and resistance for different metadata, that would be useful as well. The suggestion on the topic here: http://www.minecraftforum.net/topic/1482075-forgemetadata-hardnessresistance/ doesn't work, but this isn't a huge concern for me right now so I haven't looked too far into it. Thank you for your help, Magico13 P.S. In the preview the spoiler tags aren't opening. I have everything in code tags inside the spoilers, so not sure if that's an issue. Am going to post anyway and hope it works in the final post, if not I'll try to edit it so it does work.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.