Paper/patches/server/0638-Allow-using-signs-inside-spawn-protection.patch

35 lines
2.7 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Anton Lindroth <ntoonio@gmail.com>
Date: Wed, 15 Apr 2020 01:54:02 +0200
Subject: [PATCH] Allow using signs inside spawn protection
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2021-06-17 10:37:27 +02:00
index 20eb4aea24cc6699747b18b2c00e5b01dafb47c6..acd61a9033fdfb91e29a5fa6a10b8983ed94baa5 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2021-06-17 10:37:27 +02:00
@@ -770,5 +770,10 @@ public class PaperWorldConfig {
2021-06-11 14:02:28 +02:00
fixWitherTargetingBug = getBoolean("fix-wither-targeting-bug", false);
log("Withers properly target players: " + fixWitherTargetingBug);
}
+
+ public boolean allowUsingSignsInsideSpawnProtection = false;
+ private void allowUsingSignsInsideSpawnProtection() {
+ allowUsingSignsInsideSpawnProtection = getBoolean("allow-using-signs-inside-spawn-protection", allowUsingSignsInsideSpawnProtection);
+ }
}
2021-06-15 04:59:31 +02:00
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 33ea50e1c8b2141a2c08dd18e708b7100885b569..a5502d3c6e0837e8d775cdf829be5795f2b578ae 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1701,7 +1701,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
2021-06-15 04:59:31 +02:00
int i = this.player.level.getMaxBuildHeight();
2021-06-11 14:02:28 +02:00
2021-06-15 04:59:31 +02:00
if (blockposition.getY() < i) {
2021-06-11 14:02:28 +02:00
- if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract((net.minecraft.world.entity.player.Player) this.player, blockposition)) {
2021-06-15 04:59:31 +02:00
+ if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && (worldserver.mayInteract((net.minecraft.world.entity.player.Player) this.player, blockposition) || (worldserver.paperConfig.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper
2021-06-11 14:02:28 +02:00
// CraftBukkit start - Check if we can actually do something over this large a distance
// Paper - move check up
this.player.stopUsingItem(); // SPIGOT-4706