From b1ad58c089c21eff01c5e14b9e79c7321ff0b4ca Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Mon, 17 Feb 2020 21:47:41 -0800 Subject: [PATCH] Fix an NPE with music discs Fixes an NPE I found while playing around with music discs. Changes the "soundIn" parameter in the playRecord function in IBlockUpdateListener nullable which is safe because the parameter never gets used. This fixes the NPE because somehow taking a music disc out of the jukebox passes null for the playRecord function, which causes a crash when it shouldn't. --- src/main/kotlin/mods/betterfoliage/client/chunk/Overlay.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/mods/betterfoliage/client/chunk/Overlay.kt b/src/main/kotlin/mods/betterfoliage/client/chunk/Overlay.kt index ef3e9c2..e97a57b 100644 --- a/src/main/kotlin/mods/betterfoliage/client/chunk/Overlay.kt +++ b/src/main/kotlin/mods/betterfoliage/client/chunk/Overlay.kt @@ -118,7 +118,7 @@ interface IBlockUpdateListener : IWorldEventListener { override fun notifyLightSet(pos: BlockPos) {} override fun spawnParticle(particleID: Int, ignoreRange: Boolean, xCoord: Double, yCoord: Double, zCoord: Double, xSpeed: Double, ySpeed: Double, zSpeed: Double, vararg parameters: Int) {} override fun spawnParticle(id: Int, ignoreRange: Boolean, minimiseParticleLevel: Boolean, x: Double, y: Double, z: Double, xSpeed: Double, ySpeed: Double, zSpeed: Double, vararg parameters: Int) {} - override fun playRecord(soundIn: SoundEvent, pos: BlockPos) {} + override fun playRecord(soundIn: SoundEvent?, pos: BlockPos) {} override fun sendBlockBreakProgress(breakerId: Int, pos: BlockPos, progress: Int) {} override fun markBlockRangeForRenderUpdate(x1: Int, y1: Int, z1: Int, x2: Int, y2: Int, z2: Int) {} -} \ No newline at end of file +}