Jump to content

saxon564

Forge Modder
  • Posts

    490
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by saxon564

  1. With how I've found ticking to work, adding a method to the list of things to do seems to tick an extra time. Could just be some faulty testing, but if that is the case, then when it ticks the entity for a worldObj, it will return null because it cant find the entity so the worldObj would also be null. So even if it is talking about worldObj, it is only null because the entity is null. and because the entity is null and causing the NPE to throw, it tags Ticking Entity, if the BlockPos was null, but the entity wasnt, it should say something else. Now if I'm wrong, I'm sure one of the forum moderators will correct me, but I am speaking from all the NPEs I've has with the Ticking Entity tag.
  2. my experience while working with entities is that when you get an NPE with Ticking Entity, usually it is your entity that is null.
  3. take a look at any vanilla block file that is in the model.item package, it will give you a good idea on what to do
  4. Please show what you have for your main class. It is looking like you are using something in a crafting recipe before you have initialized it.
  5. As in, the line it is pointing to in the crash report? this.worldObj.createExplosion(this, mop.getBlockPos().getX(), mop.getBlockPos().getY(), mop.getBlockPos().getZ(), 1.5F, true); So only two possibilities are: worldObj is null(impossible), or mop.getBlockPos() is null(also impossible) Yeah, that is why I was stumped, too. Perhaps it will help figure it out that the following file for 1.7.10 worked. https://bitbucket.org/The_Fireplace/devons-random-things/src/f24522e68bb28fd2b065836a9f564eaf30e9dbc1/src/main/java/the_fireplace/devonmod/entities/EntityChargedCoal.java?at=master Then.. Try debugging to find exactly what is null. The crash tells you what is null! It is a NPE Ticking Entity. So the entity is null, try killing the entity after you create the explosion.
  6. oh, ok, I did need to take into account what he said, I was quickly reading it earlier, but after I read it again I made the adjustments.
  7. Im not using the look vectors y anyway. ive got everything working right now. Thanks for the help.
  8. Oh, derp I should have figured that! I think I knkw what I need to do now.
  9. The inventory model is obtained by making a json file in your item folder for your block, which uses your blocks block model as it's parent.
  10. Oh, ok, looking at that it makes perfect sence. This is something Ive never done before, so seeing the code has really helpped me understand what you are saying. Thank You guys for the help. I think this will work when Im at my computer and can try it. EDIT: He mentioned reversing the look vector, would that be adding/subtracting 180 or multiplying by -1?
  11. Extra Utilities seems to be outdated with the Buildcraft API, you will want to checm for a new version of Extra Utilies, if there isnt a new version, then you will want to find out what version of buildcraft you should have.
  12. Well overriding onLivingUpdate will stop the entity from moving, and chances are, he will be overriding onUdate anyway. Plus as long as you dont give the entity any tasks it wont try to move anyway.
  13. So you're saying to do float deltaZ = MathHelper.cos((float)(-yaw * 180.0/Math.PI - Math.PI)*2.0F); float deltaX = MathHelper.sin((float)(-yaw * 180.0/Math.PI - Math.PI)*2.0F); to spawn the particles at make the spawn 2 blocks behind the player once put into the x and y? If so, that doesnt make any sence as to how that would work.
  14. You can actually override onUpdate and onLivingUpdate, and that will stop it from acting like a living entity.
  15. As I said, I was spawning them on the player trying to figure out how to spawn behind them and that is where I left the code. Ok. My biggest issue is knowing how to convey the deltaX and deltaZ to player relational positions. Do I simply have to add them to the value of posX and posZ?
  16. What I need to do is spawn particles behind the player. I know I have seen topics on this, but I can never seem to find them when I start looking for them. So my question is, what is the best way to spawn particles behind the player? Here is the code I have right now for spawning particles, and it does it right on the player instead of behind them. https://github.com/saxon564/Flatulence/blob/master/src/main/java/me/saxon564/flatulence/events/FlatulenceEventHandler.java
  17. Sure you can: [nobbc][/nobbc]. [nobcc][nobbc][/nobbc][/nobbc] works like magic I wasnt event aware of that tag
  18. That would be a simple solution, yes. But there is no reason you should ever edit a base class. If you find yourself trying to edit a base class to do something, then you need a core mod. If you dont know how to make a core mod, then you should just stop trying what you are doing and go learn how to, or ask if there is another way to accomplish it.
  19. When making a new thread please state what version you are working with eg [1.7.10] or [1.8], this is make it easier for people to answer your questions accurately. This particular question cannot be answered 100% right unless we know what version you are using.
  20. meant to say, setting the block to air and playing the sound in your packet class. just to clarify where the server code gets run.
  21. If you're setting the block to air on the server and playing the sound in your Packet class, as well as canceling the event in your event handler, you're done. That's all you need to do, it will work on both server and client.
  22. take a look at my network proxy here: https://github.com/saxon564/MoChickens/blob/Dev/src/main/java/com/saxon564/mochickens/network/FireMessage.java and my event handler here: https://github.com/saxon564/MoChickens/blob/Dev/src/main/java/com/saxon564/mochickens/events/FireEventHandler.java You should cross check it with your code.
  23. For pos check it in the MouseEvent, thats where it has a possibility to be null, as for the fizz, you have to use packets to send the information to the server, on the server is when you play the fizz sound. You can look at my github for how I did it.
  24. if (pos != null) you just check it before you check for a block.
  25. To find if the block has a certain block next to it you would use Block#onNeighborBlockChange and check if the neighbor is the block you want it to be, then use World#setBlock to place the block you want placed, after which you would set your block to air to get rid of it. As to determining what block is crafted, you could make several different blocks for each possible block. Otherwise you would have to use NBT data because metadata isn't large enough to cover every possibility. Finally making it so you cannot mine it you can do what Ernio said, or you can let them mine it and set Block#getItemDropped to null. Note that all this is for 1.7.10 there are some differences in 1.8. As you do no specify what version you are using I can only assume you are with the majority that are still using 1.7.10.
×
×
  • Create New...

Important Information

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