2021-06-11 12:02:28 +00: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-15 14:07:27 +00:00
|
|
|
index 7ef033def7bf5bfc7b9f054e3c4dd9914a0d2146..c0e4f56dc0d17322ab1ea8923f9f215e2eaa210f 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-06-15 14:07:27 +00:00
|
|
|
@@ -732,5 +732,10 @@ public class PaperWorldConfig {
|
2021-06-11 12:02:28 +00: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 02:59:31 +00:00
|
|
|
|
2021-06-11 12:02:28 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2021-06-16 00:50:38 +00:00
|
|
|
index 703c5de24d2be2462cffe597f3a05d766075b128..f6cd3c60f1d07b48ce953b1e2eb71121b3790730 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2021-06-15 02:59:31 +00:00
|
|
|
@@ -1723,7 +1723,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
|
|
|
int i = this.player.level.getMaxBuildHeight();
|
2021-06-11 12:02:28 +00:00
|
|
|
|
2021-06-15 02:59:31 +00:00
|
|
|
if (blockposition.getY() < i) {
|
2021-06-11 12:02:28 +00: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 02:59:31 +00: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 12:02:28 +00:00
|
|
|
// CraftBukkit start - Check if we can actually do something over this large a distance
|
|
|
|
// Paper - move check up
|
|
|
|
this.player.stopUsingItem(); // SPIGOT-4706
|