From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Encode42 Date: Fri, 8 Jan 2021 16:07:32 -0500 Subject: [PATCH] Config to allow Note Block sounds when blocked Allows for Note Blocks to ignore whether or not there's air above them to play. Normally, the sounds will only play when the block directly above is air. With this patch enabled, players can place any block above the Note Block and it will still work. diff --git a/src/main/java/net/minecraft/world/level/block/BlockNote.java b/src/main/java/net/minecraft/world/level/block/BlockNote.java index feec1db88b22a4d13ffd3034633da79ed41b94fe..4882046f46c33a8d828d13325af17237ae07cd86 100644 --- a/src/main/java/net/minecraft/world/level/block/BlockNote.java +++ b/src/main/java/net/minecraft/world/level/block/BlockNote.java @@ -59,7 +59,7 @@ public class BlockNote extends Block { } private void play(World world, BlockPosition blockposition, IBlockData data) { // CraftBukkit - if (world.getType(blockposition.up()).isAir()) { + if (world.purpurConfig.noteBlockIgnoreAbove || world.getType(blockposition.up()).isAir()) { // CraftBukkit start org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.get(BlockNote.INSTRUMENT), data.get(BlockNote.NOTE)); if (!event.isCancelled()) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java index 9fae36ee7c25a0cf3a7677223a7aa55617797970..c992521116d7aadebd43d2793d5ea1875841d51d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -254,6 +254,7 @@ public class PurpurWorldConfig { public boolean entitiesCanUsePortals = true; public boolean fireballsBypassMobGriefing = false; public boolean milkCuresBadOmen = true; + public boolean noteBlockIgnoreAbove = false; public boolean persistentTileEntityDisplayNames = false; public boolean persistentDroppableEntityDisplayNames = false; public double tridentLoyaltyVoidReturnHeight = 0.0D; @@ -269,6 +270,7 @@ public class PurpurWorldConfig { entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals); fireballsBypassMobGriefing = getBoolean("gameplay-mechanics.fireballs-bypass-mob-griefing", fireballsBypassMobGriefing); milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen); + noteBlockIgnoreAbove = getBoolean("gameplay-mechanics.note-block-ignore-above", noteBlockIgnoreAbove); persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames); persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames); tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);