@@ -313,10 +313,18 @@ class BukkitPlayer(val player: Player) : ProxyPlayer {
313
313
}
314
314
315
315
override fun playSound (location : Location , sound : String , volume : Float , pitch : Float ) {
316
+ if (volume == - 1f && pitch == - 1f ) {
317
+ player.stopSound(sound)
318
+ return
319
+ }
316
320
player.playSound(location.toBukkitLocation(), Sound .valueOf(sound), volume, pitch)
317
321
}
318
322
319
323
override fun playSoundResource (location : Location , sound : String , volume : Float , pitch : Float ) {
324
+ if (volume == - 1f && pitch == - 1f ) {
325
+ player.stopSound(sound)
326
+ return
327
+ }
320
328
player.playSound(location.toBukkitLocation(), sound, volume, pitch)
321
329
}
322
330
@@ -380,9 +388,11 @@ class BukkitPlayer(val player: Player) : ProxyPlayer {
380
388
data.size
381
389
)
382
390
}
391
+
383
392
is ProxyParticle .DustData -> {
384
393
Particle .DustOptions (Color .fromRGB(data.color.red, data.color.green, data.color.blue), data.size)
385
394
}
395
+
386
396
is ProxyParticle .ItemData -> {
387
397
val item = ItemStack (Material .valueOf(data.material))
388
398
val itemMeta = item.itemMeta!!
@@ -398,26 +408,31 @@ class BukkitPlayer(val player: Player) : ProxyPlayer {
398
408
}
399
409
item
400
410
}
411
+
401
412
is ProxyParticle .BlockData -> {
402
413
if (bukkitParticle.dataType == MaterialData ::class .java) {
403
414
MaterialData (Material .valueOf(data.material), data.data.toByte())
404
415
} else {
405
416
Material .valueOf(data.material).createBlockData()
406
417
}
407
418
}
419
+
408
420
is ProxyParticle .VibrationData -> {
409
421
Vibration (
410
422
data.origin.toBukkitLocation(), when (val destination = data.destination) {
411
423
is ProxyParticle .VibrationData .LocationDestination -> {
412
424
Vibration .Destination .BlockDestination (destination.location.toBukkitLocation())
413
425
}
426
+
414
427
is ProxyParticle .VibrationData .EntityDestination -> {
415
428
Vibration .Destination .EntityDestination (Bukkit .getEntity(destination.entity)!! )
416
429
}
430
+
417
431
else -> error(" out of case" )
418
432
}, data.arrivalTime
419
433
)
420
434
}
435
+
421
436
else -> null
422
437
}
423
438
player.spawnParticle(bukkitParticle, location.toBukkitLocation(), count, offset.x, offset.y, offset.z, speed, bukkitData)
0 commit comments