From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Sun, 5 Nov 2023 12:03:06 +0900 Subject: [PATCH] Do not refresh LootTable for non player interaction diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java index b41635dd0569ff7df909df492d3e850aef7214be..afc567b789ee003e1b10059db2864a423c682669 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java @@ -68,6 +68,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc @Override public void unpackLootTable(@org.jetbrains.annotations.Nullable final Player player) { + if (player == null && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.refreshLootTableForNonPlayerInteraction) return; // Plazma - Do not refresh LootTable for non player interaction // Copied from super with changes, always check the original method net.minecraft.world.level.Level level = this.getLevel(); BlockPos blockPos = this.getBlockPos(); diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java index be9e364a02eb872940443e3ba3349c3ccad3cb0f..472069754c6e297474578ff237ae8d02c827b61c 100644 --- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java @@ -66,6 +66,7 @@ public class GlobalConfiguration extends ConfigurationPart { public boolean reduceRandom = OPTIMIZE; public boolean ignoreThreadSafeRandom = false; + public boolean refreshLootTableForNonPlayerInteraction = !OPTIMIZE; }