Jump to content

Taji34

Forge Modder
  • Posts

    147
  • Joined

  • Last visited

Everything posted by Taji34

  1. Ahhhh, Okay. This is how I'm registering all my events currently: Troncraft.java:
  2. Sorry, I've been super scatter-brained trying to figure this one out. Events do seem like the way to go. However, the event seems to never be happening. This is my code: TajiEvents.java: My other event is working, however, the onCrafted event is never printing to the console, so it seems that it is never happening. Any Ideas?
  3. I tracked the issue down to a method in ContainerWorkbench called transferStackInSlot() which is called when the item is shift clicked. Problem is I'm not really sure how to change the behavior without making my own crafting bench. It seems to work with two instances of the itemstack, passing one or the other to different methods. If anyone has any ideas on how to help me change the behavior, that would be great, otherwise I'm just gonna change when my NBT tags get added.
  4. You know, I'm thinking this is more of an event problem then anything, I think when I am shift clicking into my inventory, it's passing the item stack differently, and that's where my problem is. I'm thinking this because after some testing, the only place onCreated() isn't being called is when taking the item out of the creative menu. I'm gonna explore the crafting handler and see if i can find how it handles shift clicking.
  5. So you're saying that when addInformation() is called, I should send a packet to the server? I'm a little confused at what all I should be sending to the server, could you explain a bit further? I'm reading up on using the SimpleNetworkWrapper for packet handling, and I understand what all goes into that, I'm just not sure how to translate it to my specific situation. Do I send the parameters of addInformation() over to the server and then repeat what I did in addInformation()? Or what? Something is just not clicking and I don't know what I need to send in the packet in order to tell the server what the client did. I'm sorry if I am missing something blatantly obvious.
  6. Alright, I think packets are the way to go cause after some experimenting, I'm getting three different behaviors and I think it just needs to be solved with packets to ensure the client and server both know what is happening. I haven't worked with packets and know that the packet system was recently just rewritten, could you point me to a tutorial that's updated (I'll look myself, but in case I can't find any)? Also, what exactly would I be doing with the packets, would I be sending a packet to the client saying that the item has been created and then send a packet from the client to the server with the info on what to do next?
  7. This is delving a bit further than my knowledge of forge. How would I make sure the tags are being shared? If I grab the item out of the creative inventory, it does not add the tag. I'm gonna play around with it a bit to see if I can find the exact reason why the tag is not getting added. I just noticed this happens with another item of mine as well. Even though onCreated() seems to be called, the tag is never made and the stackTagCompound seems to be null. I found this out because my other item uses info from the NBT tag to vary function, and when I used it, it threw a NullPointer Exception.
  8. Basically, I'm adding a tag to my item which denotes its owner (who crafted it) for later use in multiplayer functions. However, I noticed when I shift click the output of the crafting bench into my inventory, it does not add the NBT tag. When I click and drag it into my inventory it adds the tag fine. Any insights on to why this is happening? I though maybe onCreated() or addInformation() wasn't being called, but I found out that is not the case after using some print statements to find out when they were called. Here is my code for the specific item: IdentityDisc.java:
  9. SimonSlime, I believe what he means is, as you had to do with your X coordinate, you have to add the chunkZ to your Z variable. Does that make sense? I can give a further explanation if you do not understand why, it's important you understand why things work, not just that they do. diesieben07, is that what you meant?
  10. Could you please post your current code so I can see all of it?
  11. Excuse me if I'm wrong, but in the images currently posted, I don't see that error anywhere. And if it was there, the OP would be getting a runtime error and the minecraft client wouldn't even run. You aren't using the x, y, and z values you generated in each for loop. i.e. you should be calling this: (new WorldGenMinable(...)).generate(world, random, x, y, z); But instead you are calling this: (new WorldGenMinable(...)).generate(world, random, chunkX, chunkY, chunkZ); Even though these are technically valid coordinates in the world, they are not the coordinates you generated. The reason you can't find any ores is A) they are all spawning in the same area in each chunk, and B) chunkY is set to 0, therefore it is being spawned under bedrock, however, since ores can only be spawned in stone, it just isn't spawning anything. Does that make sense?
  12. Also, you never define a constructor in which you pass a parameter (i.e. a block) into it, you need to define that constructor.
  13. So i'm generating my custom fluid in the world and have run into a problem. I decided to use minecraft's built in WorldGenLakes() and WorldGenLiquids() methods, however, they seem to be crashing for some reason. All I can figure out is it's either my fluid's properties, can anybody help me decipher what is happening? Crash Report: https://gist.github.com/anonymous/383f9ffd293052295773 WorldGeneration.java: https://gist.github.com/anonymous/b56435b374d4946041e5 LiquidEnergyBlock.java: https://gist.github.com/anonymous/f3772330c063f04d0adc Troncraft.java: https://gist.github.com/anonymous/2109c5c3750b906c7d99 When I comment out the lines in WorldGeneration.java that contains WorldGenLakes() everything works perfectly, so it has to be something with what I'm putting into that line right?
  14. Hey, I'm trying to make a thrown item that does different blocks on however, I can't seem to figure out how to detect the type of block. here is my onImpact method: I'm trying to print to the console "true" when it hits leaves, however it always prints false. Any suggestions?
  15. Okay, so I am making an item that acts like a snowball on right click. I've got everything working how I want it except when the item is flying through the air, it is invisible. I know I have to tell minecraft how to render the entity, I just don't know how to do so. Could someone point me to a tutorial on/show me how to render an object like a snowball (i.e. it's 2D texture) and how to register that render? Thanks!
  16. Ok, the case issue makes sense, staying consistent and what not with standards. However, is there anything wrong with using fluid.getName() instead of "fluidname"?
  17. I mean, is doing it the way I have right now going to cause problems in the future?
  18. But I did register a fluid. This is the second line of my preint: FluidRegistry.registerFluid(liquidEnergy); Which I do before I call the getFluidStack. Does the name parameter need to be the localized or unlocalized name of my fluid? EDIT: I did some experimenting and figured it out! I needed to do liquidEnergy.getName() for the string name parameter.
  19. Someone correct me if I am wrong, but textures for blocks need to be in /src/main/resources/assets/yourMODID/textures/blocks/ not just /src/main/resources.
  20. So I have created a liquid and I'm creating a bucket for it, however, the fluid container registry line is throwing a null pointer exception. Troncraft.java: https://gist.github.com/anonymous/c6006d69a773edea63e5 Crash Report: https://gist.github.com/anonymous/fc4f35a84df9bab4d088 This line in particular is the one having the issue: FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("liquidEnergy", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(liquidEnergyBucket), new ItemStack(Items.bucket)); When I comment this line out, everything works fine, bucket functions normally. I figured this line was there to reqister how many mB it is and some other properties, so I need it correct? Every parameter appears to me to not be null, but obviously that's not the case, could someone help me figure this out? Again, it's not affecting the buckets functionality, I just figured this line was important since it was in the tutorial.
  21. Good Idea! I will do so shortly when I have time!
  22. Yeah, I realized that like an hour ago and just finished fixing it all up! I was actually editing my previous post when you replied.
  23. EDIT: Ok, got everything working! For those who stumble upon this thread, this is my code: Troncraft.java: LiquidEnergy.java: The use of an en_US.lang file is needed for naming. Original post before edits:
×
×
  • Create New...

Important Information

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