Jump to content

EducationalPurposes

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by EducationalPurposes

  1. Use the mod's API. Specifically for NEI, use its API: https://bitbucket.org/ChickenBones/notenoughitems/src/8986f98aef1e38bc09f9ea5c5ebed4af6aa05d27/codechicken/nei/api/?at=default You want to use API#hideItem(int id)
  2. You have to spawn lightning on server and client. On the server because the damage, and the client to have the rendering So, you just have to remove: if(!world.isRemote) { return itemstack }
  3. .... THAT IS NOT A CONSTRUCTOR!
  4. Look at the bold. <init> is the constructor. Please go back to learning Java and stop "copy & paste modding." YOU CANNOT DO SHIT IN THE CONSTRUCTOR OF YOUR MAIN MOD FILE. Oh, and Pahimar is definitely not doing all this in the constructor, you are just blind. Have a read: http://www.homeandlearn.co.uk/java/write_your_own_java_classes.html
  5. At this point the system is almost complete to have 'External NBT data.' I just need to optimize my code and then Im ready for a build! Thanks again Draco & Diesieben!
  6. You can get it via reflection, and dont edit the minecraft source
  7. As I mentioned in the initial post, I am writing a framework for ComputerCraft. It basically is just passing around interfaces and some annotations and wrap around those to hook into the API of ComputerCraft. To make a long story short: ComputerCraft then uses these hooks when a block is next to the computer and checks if its an TileEntity. Then it calls the API for help so-to-say and gets my hook. In fact, that system is done and the bugfixing is mostly done. I am also writing a mod at the same time which is based on that framework. While writing that I discovered that having NBT data access is really handy. So I decided to try and get a system around that basically does the same as normal NBT, but not on the actual TileEntity, because that is just asking for issues. In order to pass around those NBT data I was wondering how MC did it, and based on that I would write my own. Meanwhile I figured I should use the MinecraftForge events: net.minecraftforge.event.world.ChunkEvent(.load & .unload) because it makes it more easy for me to find those TileEntity's and pass them to my interfaces. I think I can manage to do it, especially since Draco18s just posted an example code: So, thank you for both of your time! If Im getting issues while writing that system, I will post them to this relevant post. If not, I will lock this topic on my own. Thanks again You guys helped me out!
  8. Yeah I know NBT is a data format, I guess I didnt formulate it properly. Since I posted this topic, I ironically found the class you mentioned. It definitely will help, but since Im getting into creating my own NBT file (I guess that is the proper way to formulate it), I also want to see what calls TileEntity.readFromNBT & TileEntity.writeToNBT. That way I can see how minecraft does it, and maybe I can add my own twist to that (though I doubt that, why wouldnt the mc class wouldnt perfect for it? I will see what Im going to do with it). So, thanks Diesieben for the quick help already! My other question, which is the final question in this topic for me, is: from what classes are TileEntity.readFromNBT & TileEntity.writeToNBT getting called? If I know that, then I can do it, since I can look up the imports and such etc. Thank you in advance for the help (again ) - EducationalPurposes
  9. Hello community, I am currently making a framework for the mod called "ComputerCraft." You dont have to know what it is to answer my question, since it is NBT related. So, I know how I can use NBT with the TileEntity's. That is not the issue at all, I am more interested in how the NBT gets saved. I couldnt find the source code to the classes/package(s) which actually save the NBT. Im interested in that, because I need to simulate the NBT without a TileEntity, and to do that I need the code on how to save the NBT. I am going to make my own file of course and probably remake that system to not really get copyright shizzle So, where can I find that code? Thank you in advance, - EducationalPurposes
  10. Apparently you have to override it in your block class: https://github.com/MinecraftForge/MinecraftForge/blob/master/src/main/java/net/minecraftforge/common/ForgeHooks.java Line 99 -> method canToolHarvestBlock(Block block, int metadata, ItemStack stack) You can see that block#getHarvestTool(metadata) & block.getHarvestLevel(metadata) are getting called. From that I can conclude you have to override it As for setting a custom tool class, I couldnt find it as quickly as this. (I spent 5 minutes )
  11. That really is the most important thing of mc modding.. not just the registering part. Enough tutorials: http://bit.ly/1bQy70T Look at the vanilla classes, you can figure it out. Btw, we are not google, sounds rough, but do your frikkin research
  12. That is the exact same deal with people who dont want to upgrade their consoles (xbox360, px3 etc.). In my close environment they are complaining that they now only going to make games on the next gen consoles. It's like, why don't we compare squirrel with an elephant? Its pointless, most of the time you should use the latest versions on anything. Though there exceptions.
  13. You might want to refresh your workspace, especially when using eclipse. Eclipse is awfull with updating files around, so try to refresh it. You refresh it like so: 1. select your project and hit F5 2. relaunch Eclipse
  14. It is in the rendering of the enderman, not the model!
  15. You want to open the gui on both server and client. I know it sounds strange, but it is for the container and all. Your code only opens the container of the GUI [spoiler=so, this code] public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){ if(!world.isRemote){ FMLNetworkHandler.openGui(player, AntiOres.instance, Ids.guiIdAntiFurnace, world, x, y, z); } return true; } Dont check for a side: @Override public boolean onBlockActivated(World, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { player.openGui(AntiOres.instance, Ids.guiIdAntiFurnace, world, x, y, z) //Same as: FMLNetworkHandler.openGui(player, AntiOres.instance, Ids.guiIdAntiFurnace, world, x, y, z); though one less import return true; }
  16. are you sure you are replacing with Block.netherrack?
  17. its a good approach for basic items. If you want to do some complex stuff with behaviour of an item, then you have to make it a class. So you can override onItemUse in item A and onItemRightClick in class B. In the end it really, really depends what you want that item to be able to do. If it's just a show item, you found the best approach.
  18. You actually can generate it in your current method. I generated multiple ores in the nether like this:
  19. You can see it in the log. Something like: "Missing texture, using blablblablabla"
  20. Thank you!This did the trick Thing is, I find those tutorials lacking. I only could find tutorials on how to render it in the inventory, not how the player it is holding. However this question already has been resolved, I would like to know how to this "with my own code." Just for future reference!
  21. Simply use WorldGenMinable, instead of your own created class
  22. Hi, Im currently in a team that is developing a mod and where I am head-modder. Dont ask how I became a head-modder, because I dont know half of the possibilities you can do with MC modding. But anyway: I currently got an item that should look like the player is actually holding it in his hand. Because this is the current rendering of it: As you can see in the spoiler, Steve isnt holding the item actually in his hand. I figured I should use IItemRender, but from there I have no idea how to even properly render it. Please link me to a tutorial or something, because I couldnt find one about this, unfortunately. Thanks for the help in advance, - EducationalPurposes
  23. Okay, you are obviously the "copy & paste modder." You need a metadata sensitive WorldGenMinable, which is there. Look in that class and use the correct constructor.
  24. its a (that decimal) Float value. Google up on Java float values and you probably find the best answer ;3
  25. You dont need a tickhandler. Look here for the code that TGG suggested: http://pastebin.com/p4naGZA0 Though Im unsure why you need to make sure you are calling it on the server, since we also need the visual update?
×
×
  • Create New...

Important Information

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