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-12-01 02:31:13 +01:00
|
|
|
index a94cb1ffe034a00f9d3cf2dc190862b906abd8dc..716747f86cb7b4ee811c5e128c00b5319959cb64 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-12-01 02:31:13 +01:00
|
|
|
@@ -789,4 +789,9 @@ public class PaperWorldConfig {
|
2021-11-29 12:55:13 +01:00
|
|
|
delayChunkUnloadsBy *= 20;
|
|
|
|
}
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean allowUsingSignsInsideSpawnProtection = false;
|
|
|
|
+ private void allowUsingSignsInsideSpawnProtection() {
|
|
|
|
+ allowUsingSignsInsideSpawnProtection = getBoolean("allow-using-signs-inside-spawn-protection", allowUsingSignsInsideSpawnProtection);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2021-11-24 21:15:19 +01:00
|
|
|
index f9490e629b8aa94158724850812414ede2df7e92..91ed360b7e326ddac93abd61dfbaf6b8e83bb6e6 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
|
2021-11-24 21:15:19 +01:00
|
|
|
@@ -1728,7 +1728,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-11-24 21:15:19 +01: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(this.player, blockposition)) {
|
|
|
|
+ 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(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
|