Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PATCHED.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
| Basic | [MC-224729](https://bugs.mojang.com/browse/MC-224729) | Partially generated chunks are not saved in some situations |
| Basic | [MC-231743](https://bugs.mojang.com/browse/MC-231743) | minecraft.used:minecraft.POTTABLE_PLANT doesn't increase when placing plants into flower pots |
| Basic | [MC-232869](https://bugs.mojang.com/browse/MC-232869) | Adult striders can spawn with saddles in peaceful mode |
| Basic | [MC-271899](https://bugs.mojang.com/browse/MC-271899) | StructureTemplate Palette's caches are not thread safe |

## Previously patched
Bugs that this mod has patched but has been superseded by a vanilla update.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"))
Comment thread
isXander marked this conversation as resolved.
Outdated
private void newHashMap(List list, CallbackInfo ci) {
this.cache = Maps.newConcurrentMap();
}
}
1 change: 1 addition & 0 deletions src/main/resources/debugify.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"basic.mc224729.ChunkMapMixin",
"basic.mc231743.FlowerPotBlockMixin",
"basic.mc232869.StriderMixin",
"basic.mc271899.StructureTemplateMixin",
"basic.mc30391.LivingEntityMixin",
"basic.mc69216.ServerPlayerMixin",
"basic.mc7569.RconConsoleSourceMixin",
Expand Down