Jump to content

Ernio

Forge Modder
  • Posts

    2638
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Ernio

  1. That's why I wrote about chained extending. I personally use same system as you (5x base of Tools) but just wanted to point out that you can get shorter code with this ,,chained" extending
  2. Since you want all items be stored in one file (or few), you can do this by either extending class (create ItemBase with stuff i wrote in prev. post, and then crate ItemPickaxe, ItemShovel, etc. that will extend ItemBase and get additional variables like those what it can harvest or so... But i would recommend using extend on ItemPickaxe to do so (you can even do chained extends that will shorten code to minimum)) or by making one BIG class like ItemTools that will hold EVERY data on IF statement with ,,checker" here: public ItemAxe(int id, String UName, String IGName, int type) and then call: (let's sat 1 is a pickaxe and 2 is a shovel) type == 1 ? pickaxe code type == 2 ? shovel code
  3. Okay, so (if I am right) you want to create structure like this: ItemAxe.class (which is builder for ALL axes) ModBase.class (which is loader of mod) and make all the axes loaded in ModBase use ItemAxe.class? its quite simple, if you would actually know java (I am guessing you are just ,,Minecarft from tutorial coder" - no offense, thats a good beginning ) So I ll just paste and comment the code. //Imports public class ItemAxe extends Item { public ItemAxe(int id, String UName, String IGName) //id - item ID, UName - Unlocalized Name, IGName - IngameName { super(id, UName); //This super will load item ID and UName setUnlocalizedName(UName); //This will set UName setCreativeTab(CreativeTabs.tabMisc); //Set Tab GameRegistry.registerItem(this, UName); //This is NOT required, you can actually remove registration part of your items in ModBase.class and plase it here (with many items its VERY code-shortening), this will load unlocalized name LanguageRegistry.addName(this, IGName); //Same as above, this will load ingame name } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { itemIcon = iconRegister.registerIcon("YourMod:"+this.getUnlocalizedName()); //Not sure if correctly written since I'm writing it here (not in Eclyple) //Here, you can actually remove all this spam of code and place it in one function } } Now you need to load whole stuff into a game (using ModBase of course). public class RoAMain { //Your ModBase structure public static final Item AxeBronze = new ItemAxe(1000, "AxeBronze", "Bronze Axe"); public static final Item AxeSteel = new ItemAxe(1001, "AxeSteel", "Steel Axe"); //Your ModBase structure } Note: You can do whatever you want with this kind of stuff. Eg.: Adding to ItemAxe this: public ItemAxe(int id, String UName, String IGName, int damage) //damage and this: public int getDamageVsEntity(Entity par1Entity) { return this.damage; } You can later set item damage, like this: public static final Item AxeSteel = new ItemAxe(1001, "AxeSteel", "Steel Axe", 20); Don't thank me, go learn java, I am just bored so I wrote it
  4. If I am right you want to get grass like in vanilia (Top Grass, Bottom Dirt, Side Grass-Drit). Here is how you do it: (how I done it) 1. In the beginning you add: @SideOnly(Side.CLIENT) private Icon TextureTop; //Top of grass @SideOnly(Side.CLIENT) private Icon TextureBottom; //Bottom of grass Since extending Block alredy gives you Side Texture you don't need to create it. 2. Now you register icons: @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("YourMod:Block_Side"); this.TextureTop = par1IconRegister.registerIcon("YourMod:Block_Top"); this.TextureBottom = par1IconRegister.registerIcon("YourMod:Block_Bottom"); } I don't know if it can be more clear... 3. Now you actually getIcon: @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.TextureTop : par1 == 0 ? this.TextureBottom : this.blockIcon; // 1 - Top, 0 - Bottom, else: Side } If you cannot understand this, I don't know if any coder on the world can help you... Hope you use your brain next time - just look into files, or do researches, there are sooooo many open sources! Best regards, Ernio
  5. I found it (yesterday) before your answer, but thanks anyway. Everything works fine, but one thing - what does this returns when you have nothing in your hand? private int ScrollID = 0; public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer player, int var6, float var7, float var8, float var9) { if (!player.isSneaking()) { Item item = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getItem(); if(item == Main.Plan) this.ScrollID = 11; player.openGui(Main.instance, this.ScrollID, var1, var2, var3, var4); this.ScrollID = 0; return true; } else { return false; } } When I rightclick with fist (empty hand) it crashes and says that ,,Item item = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getItem();" is a wrong call - NullPointer Also note: When this.ScrollID = 0; GuiHandler calls null. Thanks in advance, Ernio
  6. Hello, I have this question: How can I get the item ID the player is holding in hand and save it into variable with sub-blocks (itemDmg)? Whats the function for it and how to use it? Maybe eg. code? Best regards, Ernio
  7. You could use MCPC+ and install Bukkit plugin called Authme (or many others). Or you could just do TickHandler that would hold player in one position/prevent him from touching anything till he'd write command that data could be saved on MySQL or on server. Personally I'd recommend you using MCPC+.
  8. Ok, well - nevermind, it happened to be code problem, not Forge loading case. I just made typo in my Transformer class and since it was in " " , Eclipse hasn't recognised it. And yeah - Transformers sometimes do this weird thing that you actually cannot read the error from error-log, that why I asked here about loading.
  9. Hello, Quick question: If I had written Coremod that uses ASM (Transformers) and have big influence on files, and normal mod that is much more simplier (Blocks, Items, Mobs, GUIs), can I add required-after: SimplierMod to my Coremod? Or do I have to merge SiplierMod into Coremod? I mean: Are Coremods (using transformers) loaded before normal mods or just normally? I am asking because I don't know what's wrong with mine, and I'm trying to find solution. Thanks Best regards, Ernio
  10. Hello, Realms of Arcania Project is now closer to Pre-Beta opening . Because of that we decided to start looking for people who will deal with more In-game features. So... First things first: Official page: http://realmsofarcania.net/ Note: If you got any questions just ask on our website. CARTOGRAPHER Privileges: *As a Cartographer, you'll be part of Creators team (the highest possible rank). *Your job will be to create map via Terrain Control plugin. Map will be generated from .png image with total size of 40000x40000 blocks in-game. Map is divided into smaller world regions, which will be opened one after another. And yes - pre-map is alredy prepared, and personally I think that coding biomes will take more time. *As a cartographer you can recruit Architects. Req: *PATIENCE! *Experience with Terrain Control managment. *Creativity and ambitions. *Also a little bit of commitment - you won't drop project after few days. LOREMASTER Privileges: *As a Loremaster, you'll be part of Creators team (the highest possible rank). *Your job will be to create storyline of The Arcania using alredy existing templates. *As a Loremaster you can recruit Librarians. Req: *PATIENCE! *Experience with RPG and adventure games - VERY IMPORTANT! *BRAIN and IMAGINATION! *Creativity and ambitions, also very good english. *Also a little bit of commitment - you won't drop project after few days. Contact: Prefered (Fastest): *Skype: ernio333 Also: Mail: [email protected] [email protected] Or PM here. Hope we'll find someone to take those positions. Best regards, Ernio, Creator Note: I am out till friday (evening).
  11. Hello, Realms of Arcania Project is now closer to Pre-Beta opening . Because of that we decided to start looking for people who will deal with more In-game features. So... First things first: Official page: http://realmsofarcania.net/ Note: If you got any questions just ask on our website. CARTOGRAPHER Privileges: *As a Cartographer, you'll be part of Creators team (the highest possible rank). *Your job will be to create map via Terrain Control plugin. Map will be generated from .png image with total size of 40000x40000 blocks in-game. Map is divided into smaller world regions, which will be opened one after another. And yes - pre-map is alredy prepared, and personally I think that coding biomes will take more time. *As a cartographer you can recruit Architects. Req: *PATIENCE! *Experience with Terrain Control managment. *Creativity and ambitions. *Also a little bit of commitment - you won't drop project after few days. LOREMASTER Privileges: *As a Loremaster, you'll be part of Creators team (the highest possible rank). *Your job will be to create storyline of The Arcania using alredy existing templates. *As a Loremaster you can recruit Librarians. Req: *PATIENCE! *Experience with RPG and adventure games - VERY IMPORTANT! *BRAIN and IMAGINATION! *Creativity and ambitions, also very good english. *Also a little bit of commitment - you won't drop project after few days. Contact: Prefered (Fastest): *Skype: ernio333 Also: Mail: [email protected] [email protected] Or PM here. Hope we'll find someone to take those positions. Best regards, Ernio, Creator Note: I am out till friday (evening).
  12. Sir... You came to the RIGHT neighborhood! Just think for a while - You can both have Forge and Forge src - right? Here's what you do: 1. Set up NEW MCP. 2. Get src of Forge 3. Get new minecarft.jar 4. You put minecarft.jar into jars and then you install Forge on MCP 5. Now you open src and go to Minecarft.java 6. You change AppDir 7. Compile whole source and reobvuscate it 8. If you could just notice that Minecarft.java is just Minecraft.class... 9. I think you know what to do now? Just get obvuscated Minecarft.class - this is yourwhat I call ,,Redirector". 10. Only thing to do now is to get minecarft,jar, remove META-DATA, place Forge in it, and then get ,,Redirector" which will override old one you just installed. 11. The new redirector is THE SAME thing there is in Forge but has changed AppDir - since this is "name" change this will not affect on client-server communication. 12. The Last, but not least is that: Get down on your knees and pray to god I actually made myself wrote this. Hope i helped.
  13. Sir... You came to the RIGHT neighborhood! Just think for a while - You can both have Forge and Forge src - right? Here's what you do: 1. Set up NEW MCP. 2. Get src of Forge 3. Get new minecarft.jar 4. You put minecarft.jar into jars and then you install Forge on MCP 5. Now you open src and go to Minecarft.java 6. You change AppDir 7. Compile whole source and reobvuscate it 8. If you could just notice that Minecarft.java is just Minecraft.class... 9. I think you know what to do now? Just get obvuscated Minecarft.class - this is yourwhat I call ,,Redirector". 10. Only thing to do now is to get minecarft,jar, remove META-DATA, place Forge in it, and then get ,,Redirector" which will override old one you just installed. 11. The new redirector is THE SAME thing there is in Forge but has changed AppDir - since this is "name" change this will not affect on client-server communication. 12. The Last, but not least is that: Get down on your knees and pray to god I actually made myself wrote this. Hope i helped.
  14. Yeah... actually that was the first solution that came to my head so... But then I though that I've got like new 11 different ore drops (+standard ores from minecarft, so total is 18) and it would be stupid if i'd close every drop in just one MyStoneBlock minable by every pickaxe you want - even wooden one, so since I am investing much in realistic effects I decided to make the Y checker which will define if the block is placed deep or shallowly in ground. Thanks to this feature I've got ONE block that hardness and random drop is set by altitude. Then I got other idea - why would every drop appear everywhere? Then I made ifOcean and ifMountains checkers. ifMountain for ex. is made just by using this mc.theWorld.getHeightValue - this is also used in DebugScreen
  15. Yeah... actually that was the first solution that came to my head so... But then I though that I've got like new 11 different ore drops (+standard ores from minecarft, so total is 18) and it would be stupid if i'd close every drop in just one MyStoneBlock minable by every pickaxe you want - even wooden one, so since I am investing much in realistic effects I decided to make the Y checker which will define if the block is placed deep or shallowly in ground. Thanks to this feature I've got ONE block that hardness and random drop is set by altitude. Then I got other idea - why would every drop appear everywhere? Then I made ifOcean and ifMountains checkers. ifMountain for ex. is made just by using this mc.theWorld.getHeightValue - this is also used in DebugScreen
  16. If you are running forge with mods, all players playing there would have to download your mod pack (or use your launcher, which I guess you don't have - don't ask how to get one - this is rather for big servers or coder that have time to code one). So basically - yes, they need to have all mods included in /mods/ directory of server. Btw.: You can also drop (unpack) .zip/.jar mod into minecarft.jar (also server) - this would help you if you are going to distribute your modpack (only it you are not using mods that have they own resources) Also remember to ask author about redistributing his mod - ALWAYS.
  17. Mafia - I didn't ment to be mean to you. If you'd watch the movie you'd get ,,joke". but if you feel insulted then I am sorry. ;p Item: public class ItemIngot extends Item { public ItemIngot(int id) { super(id); maxStackSize = 64; setCreativeTab(CreativeTabs.tabMaterials); } } Main: public static final Item BarSilver = new ItemIngot(1000).setIconIndex(0).setItemName("SilverBar");
  18. So there are 2 options: *ModLoader (Oldschool - still god but just different than Forge) *Forge So I guess you are using Forge. Forge is an API that have alredy implemented FML (ForgeModLoader) which is nearly the same as normal ModLoader. This allows you to add mods on your client and server. How to install mods: 1. Get minecraft_server.jar (1.5.1) 2. Get NEW (clean) .minecraft (delete one in AppData and download new one) 3. Go here: http://www.minecraftforge.net/forum/index.php?action=files 4. Download *universal* - be sure to download lates version. 5. Open minecarft.jar and minecraft_server.jar and put downloaded forge in it. (NOTE: You only need Forge as it alredy has ModLoader in it, no nooed to instal ML separately) 6. Now only one thing you need to do is install mods: -You'll need to find mod you want to install (be sure it's SMP and has 1.5.1 FORGE support) -Most of mods are *Universal*, and if so, only one thing you'll need to do is put mod .zip (or .jar) file into: /.minecarft/mods/ and /server/mods/ -Launche the server and log in. -If mod isn't universal you just download Server Forge version of it, and Client Forge version. client v. in client. server v. in server.
  19. Use MCPC+ if you want plugins.
  20. ,,Just duplicate the item and assign it to the other creative tab, thats the easiest solution there is." You, sir, just went full retarded. Never go full retarded ;p So any other ideas? Maybe just some java command that would work here? (I tried some duble assign but doesn't work either).
  21. The sad truth is that - when i said ,,i tried many different ways to do it." i ment taht I also tried this one. :C When I add more than one declaration Item won't be shown in any of Tabs ;/ Any other ideas? (1.4.7)
  22. Yeah - that could help, I had Crafting Tables on 1.4.7 that worked, and I updated them to 1.5.1 - they still work so maybe I could find missing thing.
  23. Hello, I don't want to waste time on such little things but I can't find way to do this. How can I put ex. MyOre both to BlockTab and to MyTab? I tried to do this in different ways but if I declare (no mater how I do it) 2 CreativeTabs item is not viewed in any of them. Thanks, Ernio
  24. Hello, As most of you knows vanilia MC has some disadvantages, and when you try to butt-in with your mod you may get stuck on some things. Let's say I've got more (using Forge) EnumToolMaterials, and i want to implement them in game. Yeah - thats VERY easy, but there is one problem - i've got to obey some rules of vanilia code. We got Wood->Stone->Iron in vanilia, and i want to put, let's say: Copper, Steel, and Bronze between them. If we follow real life hardness it should be: Wood->Stone->Copper->Bronze->Iron->Steel, and i've done it so... BUT! But... i want for example change Diamond's (and others) Hardness, which is 12.0F, or its Durability (1561) to lower - I dunno how to do it without butting-in into Vanilia Code (and I don't want to). How can I use forge to override properties / vanilia code in minecarft? Second question (actually the same) - how can I use this overrides to ,,replace" IronBlock with MyIronBlock (or just override IronBlock properties) ex. When in mod you got: public static final Block OreIron = new MyOre(1001, 0, Material.rock).setHardness(2.0F).setBlockName("IronOre"); and in vanilia you got ,,something", I want minecarft to use MY OreIron, not the oryginal one (it needs to be done by minecraft itself - some of plugins - not mine - use IronBlock ID and I want this ID be automatically changed into my ID (and other properties as well). Sorry - I just write much - Hopefully everything is clear Thanks for help, Ernio
  25. Please - read about MCPC+ MCPC+ is running only on 1.4.7 but it allows you to use both Mods and plugins at the time. btw. - who needs 1.5.1 updates? Nothing new... http://mcportcentral.co.za/
×
×
  • Create New...

Important Information

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