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
|
2022-06-07 19:03:07 +02:00
|
|
|
index 2eef459c0512122425db1374f59935b0bebfc754..883c8d42c471eefe4ddf68196fac0d69428dbabd 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
|
2022-06-06 02:17:27 +02:00
|
|
|
@@ -858,4 +858,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
|
2022-06-07 19:03:07 +02:00
|
|
|
index 8b2c246f60886053beb9c4baf18c867910b9a8fd..62ed17858f8571f66c7605e2d5b447d774a53713 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
|
2022-03-16 16:57:51 +01:00
|
|
|
@@ -1756,7 +1756,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
2022-03-01 06:43:03 +01:00
|
|
|
int i = this.player.level.getMaxBuildHeight();
|
2021-06-11 14:02:28 +02:00
|
|
|
|
2022-03-01 06:43:03 +01:00
|
|
|
if (blockposition.getY() < i) {
|
|
|
|
- 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 - sign check
|
|
|
|
this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
|
|
|
|
InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
2022-02-12 14:20:33 +01:00
|
|
|
|