mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes:26c37d99d5create random seeds for features using SecureRandom589bf2f1bfUpgrade gson to 2.8.8 (Closes #6370)0a6103597bGet entity default attributes (#6449)40057019e0Correctly inflate villager activation bounding box (#6798)e5f9241d15Left handed API (#6775)40ee63496cAdd advancement display API (#6175)9d570042edAdd ItemFactory#getMonsterEgg API (#6772)55ca459515rename method to getSpawnEggbb397ba74cAdd critical damage API (#6275)f47aeafe00Add Horse Animation API (#5599)7a0886180fAT & Mapping fixes (#6809)5553432644docs: Update gradle instructions for Java 16 (#6811) [ci skip]a1f49e4c60Fix command suggestion leak (#6592)9472d38f3cFix method name for Critical damage (#6813)
44 lines
3.2 KiB
Diff
44 lines
3.2 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 59ae3bb34678cdb5241f691915c96d6568363d3b..f6c0c9fca005f72c3764a4a4f8df05825796e950 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
|
@@ -62,7 +62,7 @@ public class NoteBlock extends Block {
|
|
}
|
|
|
|
private void play(Level world, BlockPos blockposition, BlockState data) { // CraftBukkit
|
|
- if (world.getBlockState(blockposition.above()).isAir()) {
|
|
+ if (world.purpurConfig.noteBlockIgnoreAbove || world.getBlockState(blockposition.above()).isAir()) { // Purpur
|
|
// CraftBukkit start
|
|
org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.getValue(NoteBlock.INSTRUMENT), data.getValue(NoteBlock.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 c73c77a22317631da7f8f52037103744bf9b8024..c70a804b8b7a30411f6cfa72bb2f36d411e0af30 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -384,6 +384,7 @@ public class PurpurWorldConfig {
|
|
public boolean entitiesPickUpLootBypassMobGriefing = false;
|
|
public boolean fireballsBypassMobGriefing = false;
|
|
public boolean milkCuresBadOmen = true;
|
|
+ public boolean noteBlockIgnoreAbove = false;
|
|
public boolean persistentTileEntityDisplayNames = false;
|
|
public boolean persistentDroppableEntityDisplayNames = false;
|
|
public boolean projectilesBypassMobGriefing = false;
|
|
@@ -401,6 +402,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);
|
|
persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
|
|
persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames);
|
|
projectilesBypassMobGriefing = getBoolean("gameplay-mechanics.projectiles-bypass-mob-griefing", projectilesBypassMobGriefing);
|