mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-31 03:50:36 +01:00
Limit item frame cursors on maps (#5730)
Fixes an issue where you can have thousands of these and lag clients.
This commit is contained in:
parent
d49dc3f24b
commit
2667fd04c4
1 changed files with 37 additions and 0 deletions
37
Spigot-Server-Patches/Limit-item-frame-cursors-on-maps.patch
Normal file
37
Spigot-Server-Patches/Limit-item-frame-cursors-on-maps.patch
Normal file
|
@ -0,0 +1,37 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Yive <admin@yive.me>
|
||||
Date: Wed, 26 May 2021 15:09:33 -0700
|
||||
Subject: [PATCH] Limit item frame cursors on maps
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
private void allowUsingSignsInsideSpawnProtection() {
|
||||
allowUsingSignsInsideSpawnProtection = getBoolean("allow-using-signs-inside-spawn-protection", allowUsingSignsInsideSpawnProtection);
|
||||
}
|
||||
+
|
||||
+ public int mapItemFrameCursorLimit = 128;
|
||||
+ private void mapItemFrameCursorLimit() {
|
||||
+ mapItemFrameCursorLimit = getInt("map-item-frame-cursor-limit", mapItemFrameCursorLimit);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
||||
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
|
||||
|
||||
WorldMapFrame worldmapframe1 = new WorldMapFrame(blockposition, entityitemframe.getDirection().get2DRotationValue() * 90, entityitemframe.getId());
|
||||
|
||||
+ // Paper start
|
||||
+ if (this.decorations.size() < entityhuman.world.paperConfig.mapItemFrameCursorLimit) {
|
||||
this.a(MapIcon.Type.FRAME, entityhuman.world, "frame-" + entityitemframe.getId(), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.getDirection().get2DRotationValue() * 90), (IChatBaseComponent) null);
|
||||
this.n.put(worldmapframe1.e(), worldmapframe1);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
NBTTagCompound nbttagcompound = itemstack.getTag();
|
Loading…
Add table
Reference in a new issue