aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0761-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch
blob: b5c3e252be9b9c01d16e205a6c7a5e1a90ca8e6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 12 Jul 2021 12:28:29 +0100
Subject: [PATCH] Use a CHM for StructureTemplate.Pallete cache

fixes a CME due to this collection being shared across threads

diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
index 9b82ff37faaafc3a799413f6949fb88a993aa9a0..866b01255e9dce8a45a3224a73becab7abd7eb1f 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
@@ -837,7 +837,7 @@ public class DefinedStructure {
         private final Map<Block, List<DefinedStructure.BlockInfo>> b;
 
         private a(List<DefinedStructure.BlockInfo> list) {
-            this.b = Maps.newHashMap();
+            this.b = Maps.newConcurrentMap(); // Paper - Use CHM
             this.a = list;
         }