9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-archived-patches/unapplied/server/minecraft-patches/features/0040-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch
Dreeam 236010caba Cooking Tutorial
1. Wet the drys
2. Dry the wets
3. Wet the drys
4. Dry the wets
5. Wet the drys
6. Now dust the wets
2025-03-28 03:11:27 -04:00

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 2549dd08b60cd81dcbf3412ed71cfc40729ae468..fe1dba198fced6f23556d95ba2f8fbc9200d878a 100644
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -419,6 +419,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