Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Everything posted by KGS

  1. I extend vanilla stairs with my own class. I create a few instances of it. The problem is that the lighting is wrong on nearby blocks. Vanilla stairs: My stairs: As you can see, the light level is completely wrong. public class BaseStairs extends BlockStairs { public BaseStairs(Block block, int someInt) { super(block, someInt); } @Override public boolean isOpaqueCube() { return false; } @Override public boolean renderAsNormalBlock() { return false; } } Someone on the #minecraftforge c
  2. Are you trying to be deliberately unhelpful?
  3. The versions of forge which use gradle include minecraft source as a library rather than as sourcecode. This means it cannot be changed.
  4. Are there tutorials or documentation for IRecipe? I wouldn't really use something as undocumented as the IRecipe unless I really had to, and now I do. I want a recipe that accepts any of my custom types of wood, but the output of the recipe depends on the type of wood put into it (i have several variants). Normally I could make a recipe for each type of wood, but that would not be feasible in the long run for practical reason. I have subtypes of wood, and these must be preserved.
  5. I don't understand what you mean. You can store anything you like in a TileEntity. You write the NBT serialisation code yourself and can put whatever you need into it. TileEntities are specifically designed for exactly what it sounds like you're trying to do. Oh that's interesting. I haven't actually dealt with tile entities yet but now that I think about it's obvious they can store anything, seeing that they store inventory data for containers and such. I will look into using tile entities. Fair enough :-) Actually this is probably pretty easy since yo
  6. Thanks for the replies people. I think you'll find the real issues are memory and speed. How long does it take to generate a hash ? How long does it take to retrieve a set of values (from the hash table) for a single block ? How many blocks in world ? How much memory total for the number of blocks ? Even if you have a single one of your blocks visible, you need to have the data for all of them in memory. Also where do you plan to store the data itself ? Using a TileEntity is a much simpler method, especially if you need to add extra values for each block.
  7. I'm planning on implementing some new features into my mod and for that I need more metadata per block. Only about a byte per block but I might end up using more than that for other things later. I figured out a way to do it which some people would probably consider extremely hacky. I'm pretty certain it will work in singleplayer, but I don't know much about the multiplayer aspects of MC modding so I come here to ask the question... Would this work? I have a hash table where the value is an int or byte, and the key is a tuple of 4 elements. Block coordinates x, y, z and dimension id
  8. My custom doors will need to drop items given certain metadata conditions, meaning that I need to implement the getItemDropped method. The problem with that method is that it needs to return an item, and when you create ItemBlocks they have no accesible instance. (you pass the class name to the register method which invokes the constructor internally). Edit: Solved. I found this: Item.getItemFromBlock(KGBlocks.blockArtDecoDoor1)
  9. http://i6.photobucket.com/albums/y207/KGanryuS/2013-12-31_023648_zps0a0d02f3.png~original[/img] This is an aesthetics mod. It features new doors, a particular utility block to be explained further down, and stuff that will be implemented later in development. Fear the darkness no more! With the mobstopper, your darkest and most foreboding castles (or any other constructions, really) will be safe from mobs. What you see is a few of the doors currently implemented in this mod. 4 doors from the Art Deco set, and 2 doors from the Fancy Door set. Note that the door in the middle of t
  10. Check if the library is still there. Do this by opening the "referenced libraries" folder in eclipse and check if you see a file named something like forgesrc at the top. Another thing you should make sure is that you ran the setupDecompWorkspace command with gradle. This command give you the source included. There's another command that does not give you the source files.
  11. I removed all the set texture code and I made sure only the Block was registered with a creative tab. Still does not show up... I can get normal blocks to show up, and items to show up, but not itemblocks...
  12. I have this block that does not appear in the game (in creative tabs). I will not post all code here, but only that which is relevant... I know some code (texture, most likely) will not work because I'm in the process of porting this from 1.6.4 to 1.7.2 (and these classes are still in development, hence some weird constructor stuff). Any idea what might be wrong? Edit: The block did show up in 1.6.4 before I made some change to support 1.7.2. This is the Item which extends a base item. public class ItemDoorArtDeco1 extends ItemBaseDoor { public ItemDoorArtDeco1(Block block)
  13. I'm porting a mod to 1.7.2 from 1.6.4. There's some odd problems with the NBT, though. For some reason it seems to fail to read from it properly. I have a class called a Tracker which extends WorldSavedEvent. It contains a hash table that is read and saved to the NBT. Certain things in the game modify the hash table and it is supposed to be persistent between game sessions, but it isn't. The readFromNBT is executed, but does not actually reach the for loop. @Override public void readFromNBT(NBTTagCompound nbt) { NBTTagList tagList = nbt.getTagList("tracker", Constants.NBT.TAG_INT
  14. So I've attempted to follow at least three different tutorials. I follow them to the letter and I get the same errors every time. Edit: NEVERMIND WHAT WAS HERE BEFORE. I have now solved that previous issue... It was quite stupid :I However, i still get this error message "Project 'Minecraft' is missing required library: 'C:\MinecraftModding\ForgeN\unresolved dependency - forgeSrc 1.7.2-'"
  15. Edit: The bug is fixed. Now I have another problem. Previously my doors had an Item an a Block. The Block had a texture consisting of two pieces and the item had another texture that was flat projected like vanilla doors. However, now that I changed the Item to an ItemBlock, it now uses the lower Block texture. This is not right at all! I even pass the ItemBlock the texture it SHOULD use, but it seems to override it.
  16. What do you mean? Each door has an Item and an associated Block. This is how vanilla does doors. When you use the item, the associated block is placed.
  17. Is there any way to fix this without using the NEI API? I have a set of custom door blocks and items for placing them, and NEI wants to list both blocks AND their items (which it interestingly enough does not do with vanilla doors).
  18. I changed the forWorld method to the following and it worked
  19. Not entirely clear on what you mean. My guess is you mean that I should remove this: instance = result; (?)
  20. So I have a problem. Let me explain WHAT I want to do, what actually happens, and what I actually do (the code), in that order... What I want to do: I have a block called the Stopper. When a stopper block is placed, it sends its coordinates to a Tracker. The Tracker is a class extending WorldSavedData and it keeps track of the location of all placed stoppers and in which chunk they are stored. The Tracker saves its own data to the NBT. Note that the Tracker is "global" for all dimensions, so the "coordinates" fed to the Tracker is of the x, y, z, w format, where w is the dimension id
  21. Huh... For some reason it works as it should when I test it today... But... It seems that the Tracker stays in memory when you exit the world to the main menu. So when I start a new game in a new world, the old Tracker remains. I probably need to clear the Tracker somehow. This might actually explain why I didn't see the NBT read/write behavior yesterday. For some reason those methods were not called and it looked as if things were working correctly because the Tracker retains data between worlds... Edit: Will restart this topic in a new thread with better focus. Consider this c
  22. Figured code would make little sense in this scenario given that I know the code executes, it just does not show up in stdout. Here you go. This code is from the Tracker. The code correctly reads and writes to the NBT: @Override public void readFromNBT(NBTTagCompound nbt) { System.out.println("----------------------------------------------------------Reading Tracker from NBT"); // this does not show up NBTTagList tagList = nbt.getTagList("tracker"); for (int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = (NBTTagCompound)tagList.tagAt(i); int[] arr = tag.getI
  23. I have a class, Tracker, which contains a hashtable and some other data. Tracker extends WorldSavedData and reads and writes correctly from and to the NBT. The tracker stores locations of some mod related blocks so that I can quickly find out if one of these blocks exist in some particular chunk. There's a mysteriou issue, however: The read and write NBT methods both output a message along the lines of "Tracker saved to NBT" and "Tracker loaded from NBT" (System.out.println())... But the weird thing is that this does not always happen. This indicates either that the code does not al
  24. I have a particular block whose locations are tracked by a separate class. Whenever my custom block is placed, the tracker is updated. The problem is handling the block being removed. Is there some Block function that runs whenever that block is removed? Something that is guaranteed? I only found one that triggesr when the player destroys a block, and one that triggers when the block explodes. For safety's sake I want something that covers absolutely EVERY scenario possible.
  25. I can imagine a hack for this. Seeing that you only occasionally will want to investigate whether a block is natural or placed, you can use an octree structure. The octree would represent the status of some particular block as a boolean where the tree would simply return "false" if a search finds no node at that point. The big problem is how to update the octree whenever a player places a block. There might be a block placement event or something like that you can use. Whenever that event is triggered, update the tree.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.