9
0
mirror of https://github.com/SparklyPower/SparklyPaper.git synced 2025-12-19 15:09:27 +00:00
Files
SparklyPaperMC/patches/server/0022-Allow-throttling-hopper-checks-if-the-target-contain.patch

20 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Fri, 23 Aug 2024 16:20:45 -0300
Subject: [PATCH] Allow throttling hopper checks if the target container is
full
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index cab403efd471bb61835224eea4e99570d34dcaaa..f074e9b9fbd7faf9502a83c1ed347f028a81021c 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -441,6 +441,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
Direction enumdirection = blockEntity.facing.getOpposite();
if (HopperBlockEntity.isFullContainer(iinventory, enumdirection)) {
+ if (world.sparklyPaperConfig.getTicksPer().getHopperCooldownWhenTargetContainerIsFull() != 0) blockEntity.setCooldown(world.sparklyPaperConfig.getTicksPer().getHopperCooldownWhenTargetContainerIsFull()); // SparklyPaper - Allow throttling hopper checks if the target container is full
return false;
} else {
// Paper start - Perf: Optimize Hoppers