mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
44 lines
3.3 KiB
Diff
44 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Encode42 <me@encode42.dev>
|
|
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/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
|
index 1d82cfe7af0dc42f88901fb0c44896771fdf8a93..43dd972b374daa1072608f3a68e812e7fb733a2b 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
|
@@ -95,7 +95,7 @@ public class NoteBlock extends Block {
|
|
}
|
|
|
|
private void playNote(@Nullable Entity entity, BlockState state, Level world, BlockPos pos) {
|
|
- if (((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).worksAboveNoteBlock() || world.getBlockState(pos.above()).isAir()) {
|
|
+ if (world.purpurConfig.noteBlockIgnoreAbove || ((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).worksAboveNoteBlock() || world.getBlockState(pos.above()).isAir()) { // Purpur
|
|
// CraftBukkit start
|
|
// org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, state.getValue(NoteBlock.INSTRUMENT), state.getValue(NoteBlock.NOTE));
|
|
// if (event.isCancelled()) {
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index aae7ee1641e4b1aa08bf2e018e4b7f6558bff513..6b691fef240a3eefa59f82dacbd0bc80cf0e350d 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -118,6 +118,7 @@ public class PurpurWorldConfig {
|
|
public boolean entitiesPickUpLootBypassMobGriefing = false;
|
|
public boolean fireballsBypassMobGriefing = false;
|
|
public boolean milkCuresBadOmen = true;
|
|
+ public boolean noteBlockIgnoreAbove = false;
|
|
public boolean persistentDroppableEntityDisplayNames = true;
|
|
public boolean projectilesBypassMobGriefing = false;
|
|
public double tridentLoyaltyVoidReturnHeight = 0.0D;
|
|
@@ -133,6 +134,7 @@ public class PurpurWorldConfig {
|
|
entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
|
|
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);
|
|
persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames);
|
|
projectilesBypassMobGriefing = getBoolean("gameplay-mechanics.projectiles-bypass-mob-griefing", projectilesBypassMobGriefing);
|
|
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
|