Jump to content

Differentiation

Members
  • Posts

    606
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Differentiation

  1. EntityEvent fires for any updates with entities. Yes, you should...
  2. @diesieben07 This thread is old...
  3. Hey! I was curious, what is the difference between World::rand and Random rand = new Random();? And which is better to use? Thanks!
  4. Yeah... or just add the @Nonnull annotation
  5. By the way, can you catch NullPointerException? Just curious. ItemStack stack = null; try { hoe.damageItem(1, playerIn); } catch (NullPointerException exception) { System.out.println("NullPointerException caught!"); }
  6. Hey! So every time I run the Java Application (Minecraft Client), it gives me the following error which doesn't crash the game but concerns me a lot. Error: https://pastebin.com/j0ane0J6 Is this important or do I just leave it? Thanks!
  7. Are you positive that you cancelled the event CLIENT-SIDE so that none of that renders?
  8. Is there a documentary I can learn from? I use Eclipse and I tried the debug lines, but I didn't know how to further continue...
  9. Yes, log the side to the console so that I could visually see what current side is running. I know I can make the if statement more condensed and shorter that way, but are there any other methods?
  10. Hey, I need to test for the running side on certain methods or blocks of methods all the time to keep me informed. So I made a method (which I'm currently using) which looks like this: public void getSide(World worldIn) { if (worldIn.isRemote) { Log.info("CLIENT"); } if (!worldIn.isRemote) { Log.info("SERVER"); } } Is there a more enhanced way to accomplish this? Any suggestions are welcome. Thanks!
  11. you don't have to make that static though.
  12. 1. Post the FML Log to get help. 2. You shouldn't be using ProjectL and OldAnimations mod. Use Orange Marshall's 1.7 Animations mod instead.
  13. I can relate. @Greyscail, your code is very mixed between sides. I would see this documentation by Forge and this video by MineMaarten, both of which explain sides in detail. But please actually read the documentation and watch the video. When I only started modding it took me a good chunk of time and effort to understand sides. I'm finished helping here! Until next time! ~Differentiation
  14. I gotta go to sleep, I'll help more tomorrow! Try to figure it out while I'm gone!
  15. For example: public class PacketSpawnParticle extends LocationDoublePacket<PacketSpawnParticle>{ private double dx, dy, dz; private int particleId; public PacketSpawnParticle(){} public PacketSpawnParticle(EnumParticleTypes particle, double x, double y, double z, double dx, double dy, double dz){ super(x, y, z); particleId = particle.ordinal(); this.dx = dx; this.dy = dy; this.dz = dz; } @Override public void toBytes(ByteBuf buffer){ super.toBytes(buffer); buffer.writeInt(particleId); buffer.writeDouble(dx); buffer.writeDouble(dy); buffer.writeDouble(dz); } @Override public void fromBytes(ByteBuf buffer){ super.fromBytes(buffer); particleId = buffer.readInt(); dx = buffer.readDouble(); dy = buffer.readDouble(); dz = buffer.readDouble(); } @Override public void handleClientSide(PacketSpawnParticle message, EntityPlayer player){ player.worldObj.spawnParticle(EnumParticleTypes.values()[message.particleId], message.x, message.y, message.z, message.dx, message.dy, message.dz); } @Override public void handleServerSide(PacketSpawnParticle message, EntityPlayer player){} }
  16. It doesn't have to be integers. It can be booleans and other values...
  17. ya... you only need to notify the server of that boolean statement at that specific time. This can easily be accomplished via player capabilities.
  18. ONLY this is supposed to be sent to the server, NOT the whole method.
  19. It's a bit ambiguous, especially for me, being an old man and all, skimming through these large chunks of code. I'll need the help of others. @jabelar, please. @Draco18s
×
×
  • Create New...

Important Information

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