Sorry for the double post, but could you explain the parameters for WorldServer.func_147487_a to me please. I can't find anything about the params on the web too. Thanks.
You can look at the data flow from the parameters to the S2APacketParticles field to the World#spawnParticle calls in NetHandlerPlayClient#handleParticles. You can also look at the corresponding method in newer versions (WorldServer#spawnParticle).
The full parameter list is as follows: (String particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed)
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
You can look at the data flow from the parameters to the S2APacketParticles field to the World#spawnParticle calls in NetHandlerPlayClient#handleParticles. You can also look at the corresponding method in newer versions (WorldServer#spawnParticle).
The full parameter list is as follows: (String particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed)
, but eclipse tells me that I can't make a static reference to a non static method. (You can safely call me a retard)
Also what exactly do the xOffset, yOffset and zOffset serve for? Is there any way to direct the movement of the particles?
The notation Foo#bar refers to an instance field/method of the class Foo called bar. The notation Foo.bar refers to a static field/method.
WorldServer#func_147487_a is an instance method, it must be called on an instance of WorldServer. On the server side (when World#isRemote is false), every World instance is a WorldServer.
The offset arguments are the maximum distance away from the specified coordinates that particles can be spawned.
For each particle spawned, the offset arguments are each multiplied by a random positive or negative number (generated with Random#nextGaussian) and added to the corresponding coordinates to obtain the position of that particle.
An offset of 0 means that the particles will all be spawned at the exact coordinates you specified. The larger the offset, the further away each particle can be spawned.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The notation Foo#bar refers to an instance field/method of the class Foo called bar. The notation Foo.bar refers to a static field/method.
WorldServer#func_147487_a is an instance method, it must be called on an instance of WorldServer. On the server side (when World#isRemote is false), every World instance is a WorldServer.
The offset arguments are the maximum distance away from the specified coordinates that particles can be spawned.
For each particle spawned, the offset arguments are each multiplied by a random positive or negative number (generated with Random#nextGaussian) and added to the corresponding coordinates to obtain the position of that particle.
An offset of 0 means that the particles will all be spawned at the exact coordinates you specified. The larger the offset, the further away each particle can be spawned.
Thanks a lot, this pretty much cleared up all I wanted to know, but from what I gathered there is no way to direct the motion of a particle? So in this case I would need to use my own packets?
Thanks a lot, this pretty much cleared up all I wanted to know, but from what I gathered there is no way to direct the motion of a particle? So in this case I would need to use my own packets?
For each particle spawned, the particleSpeed argument is multiplied by a random number for each axis to obtain the velocity of the particle on that axis.
If you want to specify the velocity yourself, you'll need your own packet, yes.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
For each particle spawned, the particleSpeed argument is multiplied by a random number for each axis to obtain the velocity of the particle on that axis.
If you want to specify the velocity yourself, you'll need your own packet, yes.
There's only one World on the client: Minecraft#theWorld.
Side note: Always annotate override methods with @Override so you get a compilation error if they don't actually override/implement a super method.
Please use Pastebin/Gist to post code, the code formatting here is terrible.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Although you have to use Minecraft#getMinecraft()#theWorld right? Just so it's correct for those reading.
It is an instance field, hence the use of the hash (#) in my post. The hash isn't actually part of the Java syntax (and thus you can't use it in your code), it's simply a notation to distinguish instance and static members.
Minecraft.getMinecraft returns the Minecraft instance, which you can use to access the theWorld field. You can store the Minecraft instance in a field/variable like any other value (though it's not required here) and access the theWorld field on that.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
It is an instance field, hence the use of the hash (#) in my post. The hash isn't actually part of the Java syntax (and thus you can't use it in your code), it's simply a notation to distinguish instance and static members.
Oh haha, I thought people used the hash instead of a period in general incase the text gets automatically converted to a link! My bad... Sounds a bit silly that I had thought that before.
It is an instance field, hence the use of the hash (#) in my post. The hash isn't actually part of the Java syntax (and thus you can't use it in your code), it's simply a notation to distinguish instance and static members.
Minecraft.getMinecraft returns the Minecraft instance, which you can use to access the theWorld field. You can store the Minecraft instance in a field/variable like any other value (though it's not required here) and access the theWorld field on that.
Ok so I came across another problem.
I have an entity which is supposed to spawn particles and then die (it has no model, so it's invisible) http://pastebin.com/94yfCU0G
But it seems that even with the new packet method it doesn't spawn any particles. (Before you ask, I have tested it with an item and it does work.)
And a quick note to the previous topic. Minecraft.getMinecraft().theWorld cannot be called inside the handler. I had to create a method in my proxies that returns theWorld on client side and null on server side.
What I imagine they actually told you, was you shouldn't get an instance of Minecraft. Unless you really need to, and here - you really need to.
He told my precisely that minecraft.getMinecraft is client side only and that I should call it from the client proxy and return null on the server proxy.
And that's completely correct. Your packet will be client-side only too, so there's no problem. However I have no objections to using the proxy, but it's good for you to understand what you're doing.
He told my precisely that minecraft.getMinecraft is client side only and that I should call it from the client proxy and return null on the server proxy.
Yeah it Is clientSide only, but you don't have to return null on the server side, that's unused code.
A whole bunch of doubles, an int and a string. Obviously the string is the particle name, but the rest I'm not really sure.
quite the same as the command
There are way more params in the command than in the func :/
You can look at the data flow from the parameters to the S2APacketParticles field to the World#spawnParticle calls in NetHandlerPlayClient#handleParticles. You can also look at the corresponding method in newer versions (WorldServer#spawnParticle).
The full parameter list is as follows: (String particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed)
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Alright so I tried to incorporate this:
, but eclipse tells me that I can't make a static reference to a non static method. (You can safely call me a retard)
Also what exactly do the xOffset, yOffset and zOffset serve for? Is there any way to direct the movement of the particles?
The notation Foo#bar refers to an instance field/method of the class Foo called bar. The notation Foo.bar refers to a static field/method.
WorldServer#func_147487_a is an instance method, it must be called on an instance of WorldServer. On the server side (when World#isRemote is false), every World instance is a WorldServer.
The offset arguments are the maximum distance away from the specified coordinates that particles can be spawned.
For each particle spawned, the offset arguments are each multiplied by a random positive or negative number (generated with Random#nextGaussian) and added to the corresponding coordinates to obtain the position of that particle.
An offset of 0 means that the particles will all be spawned at the exact coordinates you specified. The larger the offset, the further away each particle can be spawned.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thanks a lot, this pretty much cleared up all I wanted to know, but from what I gathered there is no way to direct the motion of a particle? So in this case I would need to use my own packets?
For each particle spawned, the particleSpeed argument is multiplied by a random number for each axis to obtain the velocity of the particle on that axis.
If you want to specify the velocity yourself, you'll need your own packet, yes.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ok. So I made a packet for the particle info:
and the handler to it:
But I can't spawn the particle because eclipse is telling to initialize the 'world' variable which I don't how to. Thanks.
EDIT: Forgot to mention that I registered the packet too:
There's only one World on the client: Minecraft#theWorld.
Side note: Always annotate override methods with @Override so you get a compilation error if they don't actually override/implement a super method.
Please use Pastebin/Gist to post code, the code formatting here is terrible.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Although you have to use Minecraft#getMinecraft()#theWorld right? Just so it's correct for those reading.
It is an instance field, hence the use of the hash (#) in my post. The hash isn't actually part of the Java syntax (and thus you can't use it in your code), it's simply a notation to distinguish instance and static members.
Minecraft.getMinecraft returns the Minecraft instance, which you can use to access the theWorld field. You can store the Minecraft instance in a field/variable like any other value (though it's not required here) and access the theWorld field on that.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh haha, I thought people used the hash instead of a period in general incase the text gets automatically converted to a link! My bad... Sounds a bit silly that I had thought that before.
Ok so I came across another problem.
I have an entity which is supposed to spawn particles and then die (it has no model, so it's invisible)
http://pastebin.com/94yfCU0G
But it seems that even with the new packet method it doesn't spawn any particles. (Before you ask, I have tested it with an item and it does work.)
And a quick note to the previous topic. Minecraft.getMinecraft().theWorld cannot be called inside the handler. I had to create a method in my proxies that returns theWorld on client side and null on server side.
Uuuhhh, and why can't you get the world with that? You can call it anywhere - they're public.
No idea. An experienced coder told me.
What I imagine they actually told you, was you shouldn't get an instance of Minecraft. Unless you really need to, and here - you really need to.
He told my precisely that minecraft.getMinecraft is client side only and that I should call it from the client proxy and return null on the server proxy.
And that's completely correct. Your packet will be client-side only too, so there's no problem. However I have no objections to using the proxy, but it's good for you to understand what you're doing.
Yeah it Is clientSide only, but you don't have to return null on the server side, that's unused code.