2020-04-15 00:25:35 +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-03-16 13:04:28 +00:00
|
|
|
index 3e6132211912d29e34c94042b0819f11a3bd123e..921253a06daa414aed7dc6824effc65db09ea7a5 100644
|
2020-04-15 00:25:35 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
@@ -810,4 +810,9 @@ public class PaperWorldConfig {
|
|
|
|
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-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
2021-03-26 04:52:46 +00:00
|
|
|
index 60b72fc3cf859fab80aba310882b0309fd68ff37..4a3f6f26da0d99ee2ff6942c2ff7d0595b53b684 100644
|
2021-03-16 07:19:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
2021-03-16 13:04:28 +00:00
|
|
|
@@ -143,6 +143,7 @@ import net.minecraft.world.level.GameRules;
|
|
|
|
import net.minecraft.world.level.IWorldReader;
|
|
|
|
import net.minecraft.world.level.World;
|
|
|
|
import net.minecraft.world.level.block.BlockCommand;
|
|
|
|
+import net.minecraft.world.level.block.BlockSign;
|
|
|
|
import net.minecraft.world.level.block.Blocks;
|
|
|
|
import net.minecraft.world.level.block.entity.TileEntity;
|
|
|
|
import net.minecraft.world.level.block.entity.TileEntityCommand;
|
|
|
|
@@ -1689,7 +1690,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
2021-03-09 19:07:11 +00:00
|
|
|
|
2020-04-15 00:25:35 +00:00
|
|
|
this.player.resetIdleTimer();
|
|
|
|
if (blockposition.getY() < this.minecraftServer.getMaxBuildHeight()) {
|
|
|
|
- if (this.teleportPos == null && this.player.h((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
|
2021-03-26 04:52:46 +00:00
|
|
|
+ if (this.teleportPos == null && this.player.h((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && (worldserver.a((EntityHuman) this.player, blockposition) || (worldserver.paperConfig.allowUsingSignsInsideSpawnProtection && worldserver.getType(blockposition).getBlock() instanceof BlockSign))) { // Paper
|
2020-04-15 00:25:35 +00:00
|
|
|
// CraftBukkit start - Check if we can actually do something over this large a distance
|
|
|
|
// Paper - move check up
|
|
|
|
this.player.clearActiveItem(); // SPIGOT-4706
|