Jump to content

timoteo2000

Forge Modder
  • Posts

    30
  • Joined

  • Last visited

Everything posted by timoteo2000

  1. Thank you so much! Another thing I had to do was have EntityPlayer.inventory rather than InventoryPlayer when I called Container and GuiEnhancementTable. Also, I have no clue why I was making sure the world was remote, but before removing that I couldn't remove the items so yeah. Thanks again :3
  2. Sorry to bump, but I still really need to know how to do this. At the time, I have no more information or ideas for a fix for this.
  3. As I said before, I'm not saving any data to the block, it is not an inventory. I already have all the transfer stuff setup for shift clicking and the for loops I had were exactly the same. I am still running into both of my problems. Thank you though, I may need these later.
  4. Hey guys! I was recently working with a block in my mod that opens a GUI when rightclicked. I successfully added 1 slot in the upper part of the GUI (the part that would be special to the block.) After that, I snooped in the enchantment table GUI code and added all the inventory slots. I've encountered 2 problems though: The slots do not display the real inventory items, but it seems I can pick up items and place them back down in a glitchy manner. The slots are offset by 1 row down, causing the hotbar items to be inaccessible and a blank row to exist. I've already looked through the Gits of a few other mods with containers to see if they have anything different than I do in any relevant classes, but to no avail. Here are some links to gits for my mod: BlockEnhancementTable ContainerEnhancementTable GuiHandler GuiEnhancementTable TileEntityEnhancementTable (Currently empty, and it doesn't implement IInventory because this table acts like a crafting bench, dropping items when closed) I know that the place all the inventory slots are added in is the 2 for loops in ContainerEnhancementTable's constructor (the first is for the inventory, the second the hotbar) but this is exactly how it was done in the Enchanting Table's Container class. I also see no other methods in the Enchanting Table's container class that make the items appear. Thanks in advance for the help, and if you need to look at any other classes in the project, everything is available in this repo.
  5. Hello people of the internet! Looking for an LP that's just starting up? Want to help me start up my channel? You can do both of those if you watch this LP! [embed=640,360]http://www.youtube.com/watch?v=PyXkKgliDFU[/embed] It would be very cool that, if you liked this video, and want to see more, that you like, comment and subscribe. I've already got 3 episodes, the first is only 13 minutes, but the other two are 30 minutes. I talk about myself a bit in this video. Watch, and enjoy!
  6. Hello people of the internet! Looking for an LP that's just starting up? Want to help me start up my channel? You can do both of those if you watch this LP! [embed=640,360]http://www.youtube.com/watch?v=PyXkKgliDFU[/embed] It would be very cool that, if you liked this video, and want to see more, that you like, comment and subscribe. I've already got 3 episodes, the first is only 13 minutes, but the other two are 30 minutes. I talk about myself a bit in this video. Watch, and enjoy!
  7. I guess I really didn't think of that >.< Well, don't I still need to tell the client something? Edit: Yay! it finally works! So, I changed the first thing that defined Set<BlockQueue> as queue into a public static rather than void and it all works fine. I right click a block with Fire Powder, and believe it or not, 1/2 a second later the fire that appeared went away! Thanks for all your help diesie, and I hope to release this mod before 1.5 comes out. Now to add the items that Fire Powder crafts into
  8. Here it is: I had to make the first method just public because the void there gave me errors, saying "volatile expected."
  9. Okay, so that all helped. But, the code stopped right at the tick() method. I know this, as I put a println() inside of tick() and one inside of if(ticks == 10) and the one in tick responded but not the one in the if statement. So it doesn't increment the ticks, I guess? Also, I had to change one thing to the thing you wanted me to put in onItemUse. It didn't work, and it threw errors, so I turned it from: YourMod.getTickHandler().addElement(new BlockQueue(world, x, y, z)); to ClientTickHandler.addElement(new BlockQueue(world, x, y, z)); And it didn't throw errors, luckily, but still didn't clear the fire, as it never reached the if statement. So either the Set isn't enumerating the object I gave it or the ticks never increment.
  10. So what method in Set would I use? I thought .add(Object) was right, but you can't store 3 co-ords at one time (x, y, z) only a single one (x) (y) (z). I have a wrapper class, and it's pretty much what you showed me with a different name. package com.lesterhouse.timo; import net.minecraft.world.World; public class BlockQueue { public final World w; public final int x; public final int y; public final int z; private int ticks; public BlockQueue(World w, int x, int y, int z) { this.w = w; this.x = x; this.y = y; this.z = z; } public boolean tick() { ticks++; if (ticks == 10) { //All 80 instances of w.setBlock that mimics the 80 in ItemFirePowder, but with air return true; } else { return false; } } } So I guess all I'm asking is: Where would I implement my new set and how to record the three different set co-ords of the block right clicked, which if the user isn't stupid is right below them.
  11. Thanks for that, but again, how am I supposed to tell it all of the coordinates of the block? Since I have exactly 80 times a block needs to be set to fire, it would be rather annoying to use a Set.add() method for all of them, but I'm assuming that is what I'll have to do. I can't do, say "Set.add(x + 0, y + 1, z + 0)" because it only wants one object, or "Set.add(x + 0); [next line] Set.add(y + 1); [next line] Set.add(z + 0);" because it won't see that as one object. I do know it's probably somewhat irritating dealing with my still-learning intelligence level, and I am sorry for that.
  12. So something like this? public boolean blockWait(Set<Object> s, Object obj){ //s.add methods here return true; if(tickCounter == 0){ tickCounter ++; } if(tickCounter >= 10){ s.clear(); } } This is in ItemFirePowder. Also:
  13. Oh... that makes a lot more sense than what I was thinking of... I thought I could store what all my 30 or so lines said. But after I've stored it, how can I replace all of them with air in 10 ticks? (Also, I do mean 10 ticks, or 1/2 a second.) Edit: Also, how can I store all three co-ords at once? The Set.add() method only likes to have one object.
  14. So how am I supposed to list all my 30 or so fire blocks in the List<> thing?
  15. Okay, you were helpful before, but now you are kind of getting in the way I really just want to know what I would do, not what I can't. I understand how his wouldn't work kinda, but what do you mean only a single use? The item is a single use item.
  16. Do I really need to define that par4 is x, par5 is y, and par6 is z? I'm pretty sure that onItemUse already knows that, as I have overridden that.
  17. So would this be something appropriate for onTickInGame() ? And, as I said before, I am not very good at this stuff. But this is the only obstacle I'm hitting with a struggle.
  18. Mm... that makes sense. But how would I make it call it again? If that is possible, of course, which it looks like it's not.
  19. Okay, I'll tell you, I'm not very good at coding. In fact, I'm quite a noob, my first mod only having ores and tools/swords. I'm also new to ForgeModLoader and I don't understand in the slightest how any of these classes work, like my CommonTickHandler or my ClientTickHandler. I just want a straightforward explanation of how I can use TickHandlers to make it wait for the fire to be replaced by air.
  20. Now you're the one confused. Do you understand what I want to happen? Nothing will happen until I right click with this item. When that happens, the onItemUse method is called, doing many World.setBlock() command around me to make fire in that area. 10 ticks later, in that same method of onItemUse, it will call World.setBlock() but instead fill all those areas with air. But the problem is I do not understand what method I can use for that. And if the basic java stuff you're talking about is wait() or Thread.*(), those are wrong because those crash/lag the whole system and end up not replacing the fire with air.
  21. I still need help... None of these methods work for what I'm looking for. Refer to the previous post to see my problem.
  22. Thanks. So now, between those two methods of setBlock, I've added something. Let's say var1 is the ClientTickHandler and var2 is the Common one. I have var1.onTickInGame(); there. What would make the system wait 10 ticks?
  23. Bringing this back, as I am still having trouble. The class TickHandler doesn't exist, according to my Eclipse. I really don't want to make a custom fire just for this. Also, all I need it to do is for my system to wait 10 ticks between placing fire around me to replacing that with air. After re-reading your posts, it doesn't look like you have the same idea as me
  24. Okay, so something like this: This is just getting a bit more confusing every time
  25. So for every .setBlock() method of fire, I have to have one of those? Also, where is this telling the system to wait 10 ticks to replace the fire with air?
×
×
  • Create New...

Important Information

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