mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-28 11:29:17 +00:00
增加安全检查
This commit is contained in:
@@ -27,6 +27,7 @@ public class ChimeBlockBehavior extends BukkitBlockBehavior {
|
||||
|
||||
@Override
|
||||
public void onProjectileHit(Object thisBlock, Object[] args, Callable<Object> superMethod) {
|
||||
if (hitSounds.isEmpty()) return;
|
||||
Pair<SoundData, Float> hitSound = hitSounds.get(RandomUtils.generateRandomInt(0, hitSounds.size()));
|
||||
Object blockPos = FastNMS.INSTANCE.field$BlockHitResult$blockPos(args[2]);
|
||||
Object sound = FastNMS.INSTANCE.constructor$SoundEvent(KeyUtils.toResourceLocation(hitSound.left().id()), Optional.empty());
|
||||
|
||||
Reference in New Issue
Block a user