项目作者: MrMicky-FR

项目描述 :
Lightweight particle API for Bukkit plugins, with 1.7.10 to 1.17 support.
高级语言: Java
项目地址: git://github.com/MrMicky-FR/FastParticles.git
创建时间: 2018-09-15T15:44:40Z
项目社区:https://github.com/MrMicky-FR/FastParticles

开源协议:MIT License

下载


FastParticles

JitPack

Lightweight particle API for Bukkit plugins, compatible with all Minecraft versions starting with 1.7.10!

[!IMPORTANT]
If you don’t need 1.7/1.8 support, this library is not required, and you should just use the Bukkit methods Player#spawnParticle) and World#spawnParticle).

Features

  • Easy to use
  • No reflection on compatible Bukkit versions
  • Support all particle data on all versions for legacy particles
  • Works on 1.13 and higher servers, with and without legacy particles

Installation

Maven

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.apache.maven.plugins</groupId>
  5. <artifactId>maven-shade-plugin</artifactId>
  6. <version>3.3.0</version>
  7. <executions>
  8. <execution>
  9. <phase>package</phase>
  10. <goals>
  11. <goal>shade</goal>
  12. </goals>
  13. </execution>
  14. </executions>
  15. <configuration>
  16. <relocations>
  17. <relocation>
  18. <pattern>fr.mrmicky.fastparticles</pattern>
  19. <!-- Replace this with the package of your plugin! -->
  20. <shadedPattern>com.yourpackage.fastparticles</shadedPattern>
  21. </relocation>
  22. </relocations>
  23. </configuration>
  24. </plugin>
  25. </plugins>
  26. </build>
  27. <repositories>
  28. <repository>
  29. <id>jitpack.io</id>
  30. <url>https://jitpack.io</url>
  31. </repository>
  32. </repositories>
  33. <dependencies>
  34. <dependency>
  35. <groupId>fr.mrmicky</groupId>
  36. <artifactId>FastParticles</artifactId>
  37. <version>2.0.2</version>
  38. </dependency>
  39. </dependencies>

Gradle

  1. plugins {
  2. id 'com.gradleup.shadow' version '8.3.0'
  3. }
  4. repositories {
  5. maven { url 'https://jitpack.io' }
  6. }
  7. dependencies {
  8. implementation 'fr.mrmicky:FastParticles:2.0.2'
  9. }

Copy all the classes in your plugin.

Usage

Spawning particles

Use a method from FastParticle:

  1. // Get a ParticleType
  2. ParticleType flame = ParticleType.of("FLAME");
  3. ParticleType redstone = ParticleType.of("REDSTONE");
  4. ParticleType blockCrack = ParticleType.of("BLOCK_CRACK");
  5. // Spawn particle for a player
  6. flame.spawn(player, loc, 1);
  7. // Spawn particle for all players in the world
  8. flame.spawn(world, loc, 1);
  9. // Spawn colored particle to a player
  10. redstone.spawn(player, loc, 1, ParticleData.createDustOptions(Color.BLUE, 1));
  11. // Spawn block crack particle to a player
  12. blockCrack.spawn(player, loc, 1, ParticleData.createBlockData(Material.DIAMOND));

When you need to spawn a large number of particles, you can cache instances of ParticleType and ParticleData to slightly improve performances.