Jump to content

Elyon

Members
  • Posts

    270
  • Joined

  • Last visited

Everything posted by Elyon

  1. Topic: [1.7.2] custom item model wont show up in first person. I am pretty sure sigurd4 wants to render a custom model. They need to either handle EQUIPPED_FIRST_PERSON or remove the switch statement, lest the custom model will not be rendered.
  2. Ah, that sounds interesting. Good luck with that! I am sure you can just make an exporter export all registered items (and subtypes of these), all oredictionary ores, all blocks, all recipes etc. I am not quite sure about the specifics of your current issue is, though.
  3. That is just the order in which they are registered. Pay no attention to that. As for items instead of blocks ... do you have metadata-differentiated items?
  4. Ah, right, thank you. A lot of the classes referenced are not in the repository, though - and as such, I cannot view them.
  5. If you are wondering how it works, have a look at some vanilla classes that implement the method, such as BlockWood .
  6. Try following a tutorial on how to add Items to the game. Your classes and methods are all over the place. Also, please start pasting code (preferably as gists) instead of screenshotting, and please paste entire classes. If those are your entire classes, start from scratch and follow a tutorial on basic modding
  7. You should not mind the Block IDs. You can call getSubBlocks with the third argument being a List . The method call will add all subblocks as ItemStacks to the provided list.
  8. You need to import the ItemStack class.
  9. Override getMaxItemUseDuration in your descendant of the ItemFood class.
  10. Lucky for you, you didn't crop that screenshot perfectly. I can tell you are calling GameRegistry.registerItem on the line above, meaning you are trying to define a method inside a method. That will not work - unless you go through some hoops or are using Java 8, which Forge (and possibly Minecraft) will not support yet. You must be new to this. I suggest reading some guides on how to program in Java and in general. For the time being, though, you can just move the hasEffect declaration/defintion out of what I assume to be the preinit method of your main mod class (what is it doing there?), into the base of a new class you make called ItemTwinkleTitanite , which you extend from Item . It is in this class that you will want to @Override the hasEffect method, simply by defining it and adding @Override on the line above the signature, as you have already done in your screenshot.
  11. Hi! I am toying around with rendering the main Minecraft framebuffer to a block. I have registered my BlockRenderingHandler implementing ISimpleBlockRenderingHandler , fetching a fresh renderId , overriding renderWorldBlock (and the other methods of ISimpleBlockRenderingHandler ), and aside from a few lighting issues, it works as expected, rendering the fully rendered Minecraft framebuffer to the quad ... for a few seconds, and/or as long as I stay within ~4 metres of the block. Returning to the block after having been more than ~4 metres away does not fix the texture, but breaking and replacing the block does. When the block stops rendering the given texture/framebuffer, the bound texture seems to simply become that of the dynamically assembled texture atlas for basic blocks. That is to say, there seems to be nothing wrong with my registering the rendering handler, or binding the framebuffer texture, or even drawing the quads. I cannot pinpoint any issues with the method or class, but I figured perhaps I am doing something wrong? In that case (which is very probably the case), what ought I do instead to render a custom texture - in this case the main Minecraft framebuffer, but it could just as well be any other procedural texture - to a Block/quad? BlockRenderingHandler.java Any help would be much appreciated. I am probably either doing something silly or overlooking something important. Thanks!
  12. You tried to give diesieben07 karma as well? Interesting! I assume your reply was meant for diesieben07. In that case, please be more elaborate than just saying "it gives me error". Specify what the error message says, and paste the relevant code - in this case, at least the hasEffect override you perform, and preferably the entire class.
  13. The file is red? How is it red? Is there a white cross in a red box on it? Your IDE should tell you why it can't compile the file, as well as where the issue is. Failing that, you can paste the main mod class as a gist, and we will have a look at it.
  14. There are not enough hours in the day for the amount of Karma I want to give you, diesieben07!
  15. Can you paste your main mod class, preferably as a gist?
  16. A screenshot of text code? Interesting ... Anyway, a quick and dirty way would be to add an enchantment to the item through an NBTTagCompound with the key "ench". Alternatively, I guess you could set up a custom item renderer. In that case, this is the raw code for the vanilla item glint (not glitter, that is something entirely different ):
  17. Assuming you inherit from ItemFood , the int and the boolean are healAmount and saturationModifier , respectively. Set them however you please
  18. I think you want to handle the render type EQUIPPED_FIRST_PERSON , as well.
  19. Stability is overrated I may as well prepare for the future. Plus, I don't like reading changelogs and then not get to play with the awesome new features right away!
  20. Have a look at Key Binding. You want to do something on the client that should be registered on the server? Sending a packet sounds like a good idea. Alternatively, you could cheat and check whether the player isSneaking() , but I don't know if that is true when falling. Assuming you want the sneak key to be the negate fall damage key. EDIT: diesieben07 said it.
  21. Hence diabolical! I can see how it could corrupt worlds, but what I am working on using reflection is merely a proof of concept. Once Forge for 1.7 supports replacing vanilla Blocks (if it ever will), I will port the code. For now, though, reflection seems to be the best way for me to test out my ideas as if that system was already in place. Thank you for the heads up, though!
  22. There is always GitHub for Windows. Anyway, I will take a look at your classes now. EDIT: I could be wrong, but wouldn't you want to write the attackTimer to NBT? I think there's just the one attackTimer shared between all your mobs, now, maybe? (I am not used to working with Entities). If so (and possibly in general), you set public void onLivingUpdate() { // ... if (this.attackTimer > 0) { --this.attackTimer; if (!this.worldObj.isRemote) { CreatePacketServerSide.sendS2CEntitySync(this); } } // ... } and public boolean attackEntityAsMob(Entity entity) { // ... if (this.attackTimer <= 2) { this.attackTimer = 8; } // ... } , which would mean your attackTimer is constantly going down from 8 to 0, sending a packet, then doing the same thing. If indeed the one attackTimer is shared between all your mobs when you don't use NBT instead, this would mean a large number of mobs would decrement the shared attackTimer once each, sending packets rather often. I don't know if I am on the right track here, as I don't have much experience with Entities. Just throwing suggestions out.
  23. I use reflection for my own diabolical ends (read: replacing vanilla Blocks). That seems to work well, for the most part, for now. Looking forward to a more recommended way of doing that, though
×
×
  • Create New...

Important Information

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