mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
25 lines
1.5 KiB
Diff
25 lines
1.5 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] SparklyPaper: Allow throttling hopper checks if the target
|
|
container is full
|
|
|
|
Original project: https://github.com/SparklyPower/SparklyPaper
|
|
|
|
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
index c2c7832fbb207ecfd23c7a086ef72db9648f48f9..0ea3fef7cccbbeac608e87313e809fbc045a1bdf 100644
|
|
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
@@ -423,6 +423,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
|
} else {
|
|
Direction opposite = blockEntity.facing.getOpposite();
|
|
if (isFullContainer(attachedContainer, opposite)) {
|
|
+ // Leaf start - SparklyPaper - Throttle hopper when full
|
|
+ if (org.dreeam.leaf.config.modules.opt.ThrottleHopperWhenFull.enabled && org.dreeam.leaf.config.modules.opt.ThrottleHopperWhenFull.skipTicks > 0) {
|
|
+ blockEntity.setCooldown(org.dreeam.leaf.config.modules.opt.ThrottleHopperWhenFull.skipTicks);
|
|
+ }
|
|
+ // Leaf end - SparklyPaper - Throttle hopper when full
|
|
return false;
|
|
} else {
|
|
// Paper start - Perf: Optimize Hoppers
|