Skip to content

Commit 9a318c2

Browse files
committed
Some fix
1 parent 947c407 commit 9a318c2

File tree

3 files changed

+60
-6
lines changed

3 files changed

+60
-6
lines changed

mohistlauncher/src/main/java/com/mohistmc/feature/AutoDeleteMods.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public class AutoDeleteMods {
2727
"io.github.reserveword.imblocker.IMBlocker" /*IMBlocker*/,
2828
"me.towdium.jecharacters.JustEnoughCharacters" /*JustEnoughCharacters*/,
2929
"com.lootbeams.LootBeams" /*LootBeams*/,
30-
"icyllis.modernui.ModernUI" /*ModernUI*/,
3130
"net.darkhax.maxhealthfix.MaxHealthFixForge " /*Max-Health-Fix*/,
3231
"optifine.Differ" /*OptiFine*/));
3332

src/main/java/org/bukkit/craftbukkit/v1_20_R1/entity/CraftPlayer.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,12 +2123,18 @@ public <T> void spawnParticle(Particle particle, Location location, int count, d
21232123

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

2129+
@Override
2130+
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
2131+
spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data, force);
2132+
}
2133+
2134+
@Override
2135+
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) {
2136+
ClientboundLevelParticlesPacket packetplayoutworldparticles = new ClientboundLevelParticlesPacket(CraftParticle.toNMS(particle, data), force, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count);
2137+
getHandle().connection.send(packetplayoutworldparticles);
21322138
}
21332139

21342140
@Override

src/main/java/org/bukkit/entity/Player.java

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,6 +1840,55 @@ public default void giveExp(int amount) {
18401840
*/
18411841
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);
18421842

1843+
/**
1844+
* Spawns the particle (the number of times specified by count)
1845+
* at the target location. The position of each particle will be
1846+
* randomized positively and negatively by the offset parameters
1847+
* on each axis.
1848+
*
1849+
* @param <T> type of particle data (see {@link Particle#getDataType()}
1850+
* @param particle the particle to spawn
1851+
* @param location the location to spawn at
1852+
* @param count the number of particles
1853+
* @param offsetX the maximum random offset on the X axis
1854+
* @param offsetY the maximum random offset on the Y axis
1855+
* @param offsetZ the maximum random offset on the Z axis
1856+
* @param extra the extra data for this particle, depends on the
1857+
* particle used (normally speed)
1858+
* @param data the data to use for the particle or null,
1859+
* the type of this depends on {@link Particle#getDataType()}
1860+
* @param force whether to send the particle to the player in an extended
1861+
* range and encourage their client to render it regardless of
1862+
* settings
1863+
*/
1864+
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);
1865+
1866+
/**
1867+
* Spawns the particle (the number of times specified by count)
1868+
* at the target location. The position of each particle will be
1869+
* randomized positively and negatively by the offset parameters
1870+
* on each axis.
1871+
*
1872+
* @param <T> type of particle data (see {@link Particle#getDataType()}
1873+
* @param particle the particle to spawn
1874+
* @param x the position on the x axis to spawn at
1875+
* @param y the position on the y axis to spawn at
1876+
* @param z the position on the z axis to spawn at
1877+
* @param count the number of particles
1878+
* @param offsetX the maximum random offset on the X axis
1879+
* @param offsetY the maximum random offset on the Y axis
1880+
* @param offsetZ the maximum random offset on the Z axis
1881+
* @param extra the extra data for this particle, depends on the
1882+
* particle used (normally speed)
1883+
* @param data the data to use for the particle or null,
1884+
* the type of this depends on {@link Particle#getDataType()}
1885+
* @param force whether to send the particle to the player in an extended
1886+
* range and encourage their client to render it regardless of
1887+
* settings
1888+
*/
1889+
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);
1890+
1891+
18431892
/**
18441893
* Return the player's progression on the specified advancement.
18451894
*

0 commit comments

Comments
 (0)