From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MrPowerGamerBR 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