mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 7232d8f2a EntityLoadCrossbowEvent#shouldConsumeItem 4740bd6c8 Mark PlayerInventory#getItem as nullable bd9ace578 Add a config option to limit the number of entities of each type to load/save in a chunk (#4792) 6bafeb5a9 Move logic from last patch into correct place 9668118fd disable entity ticking flag after watchdog obliteration
44 lines
3.1 KiB
Diff
44 lines
3.1 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/server/BlockNote.java b/src/main/java/net/minecraft/server/BlockNote.java
|
|
index df69d00d3a38417e53f433cd1eb1f6cf3ec9b55b..6bb6e229c8734d7b9f4e3cd3dd1b4b646bca1777 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockNote.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockNote.java
|
|
@@ -37,7 +37,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 c1ece0add6f186a6aa8b462d47e05a6fea28d033..fc5b4f1ec8bbe50522cdbcb74e5870e79ed15070 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -236,6 +236,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;
|
|
@@ -251,6 +252,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);
|