Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add Locations of differing worlds #5

Open
stitchinger opened this issue Aug 12, 2024 · 2 comments
Open

Cannot add Locations of differing worlds #5

stitchinger opened this issue Aug 12, 2024 · 2 comments

Comments

@stitchinger
Copy link

Trying to get the spiral working with this code:

            hm.zelha.particlesfx.particles.parents.Particle cherry = new ParticleCherryLeaves(0, 0, 0, 2);
            World world = player.getWorld();
            Location loc = player.getLocation();
            LocationSafe locationSafe = new LocationSafe(world, loc.getX(), loc.getY(),loc.getZ());
            CircleInfo circle1 = new CircleInfo(locationSafe,1);
            LocationSafe locationSafe2 = new LocationSafe(world, loc.getX(), loc.getY() + 2,loc.getZ());
            CircleInfo circle2 = new CircleInfo(locationSafe2,2);


            ParticleSpiral spiral = new ParticleSpiral(cherry, 2, 10, circle1, circle2);
            spiral.display();

and getting this error. Do I use it wrong?

Caused by: java.lang.IllegalArgumentException: Cannot add Locations of differing worlds
	at org.bukkit.Location.add(Location.java:360) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
	at Particle-API_1.21.jar/hm.zelha.particlesfx.shapers.parents.RotationHandler.calculateCentroid(RotationHandler.java:192) ~[Particle-API_1.21.jar:?]
	at Particle-API_1.21.jar/hm.zelha.particlesfx.shapers.parents.RotationHandler.recalculateIfNeeded(RotationHandler.java:143) ~[Particle-API_1.21.jar:?]
	at Particle-API_1.21.jar/hm.zelha.particlesfx.shapers.ParticleSpiral.recalculateIfNeeded(ParticleSpiral.java:194) ~[Particle-API_1.21.jar:?]
	at Particle-API_1.21.jar/hm.zelha.particlesfx.shapers.ParticleSpiral.setWorld(ParticleSpiral.java:227) ~[Particle-API_1.21.jar:?]
	at Particle-API_1.21.jar/hm.zelha.particlesfx.shapers.ParticleSpiral.<init>(ParticleSpiral.java:37) ~[Particle-API_1.21.jar:?]
	at Particle-API_1.21.jar/hm.zelha.particlesfx.shapers.ParticleSpiral.<init>(ParticleSpiral.java:42) ~[Particle-API_1.21.jar:?]
	at Particle-API_1.21.jar/io.georgeous.particle_api.PapiCommand.onCommand(PapiCommand.java:106) ~[Particle-API_1.21.jar:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
	... 26 more
@KazakEz
Copy link

KazakEz commented Aug 22, 2024

Same exception.
Solution: Replace https://github.com/hmzel/ParticleSFX/blob/master/src/main/java/hm/zelha/particlesfx/shapers/parents/RotationHandler.java#L192 to centroid.add(locations.get(i).toVector());
Explanation: this method have checks if world is not similar and all these fields can use only in default world "world"
img
img

@stitchinger
Copy link
Author

Same exception. Solution: Replace https://github.com/hmzel/ParticleSFX/blob/master/src/main/java/hm/zelha/particlesfx/shapers/parents/RotationHandler.java#L192 to centroid.add(locations.get(i).toVector()); Explanation: this method have checks if world is not similar and all these fields can use only in default world "world" img img

Thank you very much.
I cloned the repo locally, made the chage you suggested and built the jar.
But how do I use it? The minecraft server says it is missing the plugin.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants