Skip to content

Commit

Permalink
Some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Feb 15, 2025
1 parent 947c407 commit 9a318c2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class AutoDeleteMods {
"io.github.reserveword.imblocker.IMBlocker" /*IMBlocker*/,
"me.towdium.jecharacters.JustEnoughCharacters" /*JustEnoughCharacters*/,
"com.lootbeams.LootBeams" /*LootBeams*/,
"icyllis.modernui.ModernUI" /*ModernUI*/,
"net.darkhax.maxhealthfix.MaxHealthFixForge " /*Max-Health-Fix*/,
"optifine.Differ" /*OptiFine*/));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2123,12 +2123,18 @@ public <T> void spawnParticle(Particle particle, Location location, int count, d

@Override
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
if (data != null) {
Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType());
}
ClientboundLevelParticlesPacket packetplayoutworldparticles = new ClientboundLevelParticlesPacket(CraftParticle.toNMS(particle, data), true, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count);
getHandle().connection.send(packetplayoutworldparticles);
spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true);
}

@Override
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data, force);
}

@Override
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
ClientboundLevelParticlesPacket packetplayoutworldparticles = new ClientboundLevelParticlesPacket(CraftParticle.toNMS(particle, data), force, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count);
getHandle().connection.send(packetplayoutworldparticles);
}

@Override
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/org/bukkit/entity/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,55 @@ public default void giveExp(int amount) {
*/
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data);

/**
* Spawns the particle (the number of times specified by count)
* at the target location. The position of each particle will be
* randomized positively and negatively by the offset parameters
* on each axis.
*
* @param <T> type of particle data (see {@link Particle#getDataType()}
* @param particle the particle to spawn
* @param location the location to spawn at
* @param count the number of particles
* @param offsetX the maximum random offset on the X axis
* @param offsetY the maximum random offset on the Y axis
* @param offsetZ the maximum random offset on the Z axis
* @param extra the extra data for this particle, depends on the
* particle used (normally speed)
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
* @param force whether to send the particle to the player in an extended
* range and encourage their client to render it regardless of
* settings
*/
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force);

/**
* Spawns the particle (the number of times specified by count)
* at the target location. The position of each particle will be
* randomized positively and negatively by the offset parameters
* on each axis.
*
* @param <T> type of particle data (see {@link Particle#getDataType()}
* @param particle the particle to spawn
* @param x the position on the x axis to spawn at
* @param y the position on the y axis to spawn at
* @param z the position on the z axis to spawn at
* @param count the number of particles
* @param offsetX the maximum random offset on the X axis
* @param offsetY the maximum random offset on the Y axis
* @param offsetZ the maximum random offset on the Z axis
* @param extra the extra data for this particle, depends on the
* particle used (normally speed)
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
* @param force whether to send the particle to the player in an extended
* range and encourage their client to render it regardless of
* settings
*/
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force);


/**
* Return the player's progression on the specified advancement.
*
Expand Down

0 comments on commit 9a318c2

Please sign in to comment.