forked from isXander/Debugify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStructureTemplateMixin.java
More file actions
31 lines (27 loc) · 1.19 KB
/
Copy pathStructureTemplateMixin.java
File metadata and controls
31 lines (27 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package dev.isxander.debugify.mixins.basic.mc271899;
import com.google.common.collect.Maps;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
import java.util.Map;
@BugFix(id = "MC-271899", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "StructureTemplate Palette's caches are not thread safe")
@Mixin(StructureTemplate.Palette.class)
public class StructureTemplateMixin {
@Mutable
@Shadow
@Final
private Map<Block, List<StructureTemplate.StructureBlockInfo>> cache;
@Inject(method = "<init>", at = @At(value = "TAIL"))
private void newHashMap(List list, CallbackInfo ci) {
this.cache = Maps.newConcurrentMap();
}
}