9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-23 16:59:23 +00:00
Files
Gale/patches/server/0050-Don-t-trigger-lootable-refresh-for-non-player-intera.patch
2024-04-28 08:17:49 -04:00

27 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Thu, 24 Nov 2022 22:07:56 +0100
Subject: [PATCH] Don't trigger lootable refresh for non-player interaction
License: MIT (https://opensource.org/licenses/MIT)
Gale - https://galemc.org
This patch is based on the following patch:
"Don't trigger Lootable Refresh for non player interaction"
By: Aikar <aikar@aikar.co>
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
Licensed under: MIT (https://opensource.org/licenses/MIT)
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 17da915ffa638500a83b67db0940a7b9a9b333a1..e47c9481f39426e1767e73275edbf9a1d298caea 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
@@ -74,6 +74,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
@Override
public void unpackLootTable(@org.jetbrains.annotations.Nullable final Player player) {
+ if (player == null) return; // Gale - EMC - don't trigger lootable refresh 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();