Jump to content

Lunakki

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Lunakki

  1. What I resorted to was having people overwrite the BlockPane class file with my own version when installing my mod. This is obviously not an ideal solution, especially if you are distributing it to a lot of people. Fortunately my users are limited to my real life friends, so I can install it for them if they run into issues. There is an alternate method using access transformers, but I could never get it to work. Here is the tutorial I was working off of: http://www.minecraftforge.net/wiki/Using_Access_Transformers I also tried using Reflection but was unable to get that to work as well. Here's a tutorial I tried for that (looks outdated now): http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/ Here's a general Java Reflection tutorial: http://docs.oracle.com/javase/tutorial/reflect/ I imagine it's probably unnecessary in the current version since there are now colored panes in vanilla, but I haven't had the time to look into it myself yet. Let me know what you find out.
  2. Hi hydroflame, I was having the same problem as Channel_3, but setting up my files as you suggested fixed it. The only thing is I had to change the folder name and reference to lowercase. (And create all of the folders, of course.) Thanks!
  3. Really? That would be weird. I guess I could try that and see if it works. Is there some way to test that in Eclipse, or do you just add the mod and try it? I don't think it would compile.
  4. I didn't see that tutorial yet; I was looking at the one on the wiki. That's really helpful. Hmm.. it doesn't even mention making a mod container class for the access transformers. It only talks about it in a different section about making the mod show up in the mod list. Maybe that means I don't need to do it after all. I'll have to read that over some more and play with it. Thanks!
  5. I went through the tutorial on using access transformers, but I'm still unsure on some things. Basically I want to make the field inGround in EntityArrow protected instead of private, so that subclasses can access it. The config file and all that makes enough sense, but what about the mod container? Do I need to move everything in my mod class (that sets the modID, declares all the new items, etc.) to that class? If so, where exactly do I put my code currently in postInit? The tutorial says to use @subscribe in place of @Postinit, and says to "make sure you use the right event", but what is the right event? Do I even have to move anything? The class(es) that need access to inGround aren't explicitly a member of any particular mod, but I don't know what the purpose of the mod container class is. Is there some documentation somewhere that explains all that? Thanks in advance for any help.
  6. If you know the block/item IDs, then you should be able to use that to create ItemStacks of those items and then register recipes like you normally would. You would have to do it in postInit to make sure the other mods have loaded already though, I think. I haven't actually done anything like that, so I may be totally wrong, but that's what I would try to start with. It seems like it ought to work.
  7. RoboJack, thanks for posting your solution once you figured it out. I've been struggling with the same thing, and that was really helpful. Why did you pick the numbers 13 and 18 for the times? Is that the same timing for regular bows or your own timing?
  8. I have the latest version and getBlockTextureFromSideAndMetadata(...) is in mine and getIcon(...) is not.
  9. I have the latest version and getBlockTextureFromSideAndMetadata(...) is in mine and getIcon(...) is not.
  10. I'm pretty sure that's exactly what I tried in my code that didn't work... Your code has this: GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), new Object[] { "T T", "TTT", "TTT", 'T', baconiteIngot }); Which is not exactly the same. Try getting ride of the new Object[] {} part and see if it works then. I also don't see the baconiteIngot registered anywhere, so that might also be part of the issue. You should use GameRegistry.registerItem to register all of your items, just like you use GameRegistry.registerBlock to register your blocks.
  11. I'm pretty sure that's exactly what I tried in my code that didn't work... Your code has this: GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), new Object[] { "T T", "TTT", "TTT", 'T', baconiteIngot }); Which is not exactly the same. Try getting ride of the new Object[] {} part and see if it works then. I also don't see the baconiteIngot registered anywhere, so that might also be part of the issue. You should use GameRegistry.registerItem to register all of your items, just like you use GameRegistry.registerBlock to register your blocks.
  12. It's probably because it's not: public Icon getBlockTextureFromSideAndMetadata() It's: public Icon getBlockTextureFromSideAndMetadata(int side, int metadata). If the parameters are different, it's considered a completely different function. You can find the original function in the Block class. If it's not there, then you must've installed something wrong or deleted it somehow, because it is definitely supposed to be there.
  13. It's probably because it's not: public Icon getBlockTextureFromSideAndMetadata() It's: public Icon getBlockTextureFromSideAndMetadata(int side, int metadata). If the parameters are different, it's considered a completely different function. You can find the original function in the Block class. If it's not there, then you must've installed something wrong or deleted it somehow, because it is definitely supposed to be there.
  14. I wish I always found the answer to things after I posted a question. I'm jealous.
  15. tl;dr: I need to override a function in GlassPane that is declared public final. Removing the final label in GlassPane.java lets my game run exactly as I want it to. Is there some way to do this that won't interfere with other mods that may want to edit the same class? Long version which may give you an idea of a solution that I haven't thought of: I changed my panes to all be individual items so that they did not have to use metadata. To do this, I had to make a new class that extended Block instead of BlockPane. This is because I need them to connect to each other, and the canThisPaneConnectToThisBlockID cannot be overridden because it's final in BlockPane (why???) and it checks for opaque blocks and certain block IDs (including its own) to see if it can connect. Since my panes no longer all have the same blockID, they no longer connect with that method. It all looked good until I tried to place the block. Then I got this error: Unexpected error java.lang.ClassCastException: krv.minecraft.moreblocks.BlockThinTintedGlass cannot be cast to net.minecraft.block.BlockPane So now it can render the inventory icon correctly, but not the actual block. After looking at the rendering code, sure enough it requires a BlockPane to render as a pane, which my block obviously isn't. This would be easy to fix if I could just override that one function in BlockPane, because then I could just extend that class and it would all work. This is the function I need to override: public final boolean canThisPaneConnectToThisBlockID(int par1) { return Block.opaqueCubeLookup[par1] || par1 == this.blockID || par1 == Block.glass.blockID; } I want it to be this in my class: public boolean canThisPaneConnectToThisBlockID(int id) { for (int i = 0; i < 16; i++) { if (id == MoreBlocks.thinTintedGlass[i].blockID) return true; } return Block.opaqueCubeLookup[id] || id == Block.glass.blockID || id == MoreBlocks.tintedGlass.blockID; } What are my options here without actually editing any of the core files? Do I have any?
  16. You are right in that you do have to make an individual texture file for every item and block now. This tutorial is one of the few that is actually up to date, and I found it was pretty helpful: http://www.minecraftforge.net/wiki/Icons_and_Textures One thing that is not spelled out in that tutorial that took me awhile to figure out: The mods/ folder it refers to is inside of the root folder of minecraft.jar, so you have to put it in the root folder of your mod for the game to be able to find the textures inside of it.
  17. I created colored glass panes by extending the BlockPane class. All the colors share the same blockID but display different textures depending on their metadata, similar to wool. This works great except that the inventory, handheld item, and object on ground all use the texture for metadata 0. With some playing around, it seems to be a result of the getRenderType() returning 18 (aka pane). I looked through the function renderBlockAsItem in RenderBlocks, but it looks like it uses the function that returns a texture based on the metadata, so I don't know why it's not working. It appears that the metadata it's using for that function is passed into from somewhere else, and presumably it's correct or things like wool would not render correctly in the inventory, but yet it doesn't work for my panes... My objects all use the correct textures when placed, and they use the right textures in the inventory when using a different render type, so I'm pretty sure it's not me returning the wrong texture or anything like that. I can get around it by creating individual objects for each color, but I'd really rather not do it that way if I can help it. Any ideas on a more elegant solution?
  18. Haha, that's why I added it. All the previous topics I had found on the subject had no answer on how to fix the problems, so hopefully now one will. As a follow-up to my last post: I did get it to mostly work. You can't see the glass through ice and water, but you can see ice and water through the glass. (I was wrong when I posted before saying you can see the glass through ice. You can only see the frame, just like it says. It's just hard to tell because of the texture of ice.) Seeing glass through other glass is hit or miss, but it at least fixes the issue of looking out your window and seeing an empty hole where the ocean or a lake is supposed to be. I think that's as good as it's going to get with the current rendering engine in Minecraft.
  19. For anybody who looks at this topic later trying to do the same thing, Draco18s is correct. MCPatcher does add an extra render pass (two of them, actually), and it is possible to take advantage of this through their connected textures mod. For specifics from the author of MCPatcher, go to this link: http://www.minecraftforum.net/topic/1496369-151-147update-44-mcpatcher-hd-fix-303-01-245-04/, scroll down to "Information for Texture Pack Authors" and then scroll down to the section about Better Glass. You'll probably also have to read through the Connected Textures section as well, as setting that up is how you can take advantage of the extra rendering passes. The description mentions that the translucent part gets rendered over by things like ice, but it's not true. My game renders both glass behind ice and ice behind glass just fine. You may have to play with the property files, but it looks like it's possible to implement fully functional translucent blocks beyond regular glass.
  20. I would not be surprised if they hacked in a third render pass. Hmm, maybe. I noticed that I can see their glass through my glass, and their glass through their own glass. I wonder if they would tell me how to take advantage of whatever they did to make it work if I asked them.
  21. There must be some way to do it, because the glass with MCPatcher's BetterGlass mod lets you see water and other glass through it perfectly. I can't see it them in mine, though. I wonder what they did to accomplish that. Anybody have any ideas? It does look pretty lame.
  22. You're right, the problem is the textures. Somebody else made them for me (because they requested the colored glass mod in the first place) and I didn't even think to make sure they were done properly. After talking with the person that made them, they apparently assumed that it was taken care of in the code while I assumed they made the images transparent. I tested my class with the ice texture and it does work properly. Thanks for the help.
  23. There is a getRenderBlockPass function that returns 1 in BlockIce and 0 in BlockGlass. It has the comment " Returns which pass should this block be rendered on. 0 for solids and 1 for alpha" I tried overriding that function in my class so that it returned 1 as well, but it still isn't partially transparent. Is that the function you are talking about, or is there another one? I don't see one called renderType.
  24. I made a mod to make colored glass, but I cannot figure out how to make it partially transparent. I know MCPatcher does this, but it only does it for actual glass. I looked at the code for ice (since it is partially transparent) but I cannot find anything in the block class or its material that sets it to be partially transparent. I also tried searching these forums and Google, and could not find anything there either. Does anybody have any idea how to do this? Or, failing that, get MCPatcher to apply its "better glass" mod to my new class?
×
×
  • Create New...

Important Information

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