mirror of
https://github.com/BX-Team/DivineMC.git
synced 2026-01-04 15:31:43 +00:00
25 lines
1.6 KiB
Diff
25 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Sat, 12 Apr 2025 17:40:53 +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 15d4f60942c0cc612c1468b4c0fda886867a67cb..f0d53f83f7d3b4d8aa7d21bd7e3627a7052535aa 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)) {
|
|
+ // DivineMC start - SparklyPaper: Allow throttling hopper checks if the target container is full
|
|
+ if (org.bxteam.divinemc.config.DivineConfig.PerformanceCategory.hopperThrottleWhenFull && org.bxteam.divinemc.config.DivineConfig.PerformanceCategory.hopperThrottleSkipTicks > 0) {
|
|
+ blockEntity.setCooldown(org.bxteam.divinemc.config.DivineConfig.PerformanceCategory.hopperThrottleSkipTicks);
|
|
+ }
|
|
+ // DivineMC end - SparklyPaper: Allow throttling hopper checks if the target container is full
|
|
return false;
|
|
} else {
|
|
// Paper start - Perf: Optimize Hoppers
|