mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-21 15:59:26 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@dc3ef2a Fix vanilla components not being translated (#9893) PaperMC/Paper@7e15d97 Remove no longer needed diff from adventure patch PaperMC/Paper@f1820dc Fix incorrect border collision detection PaperMC/Paper@de04cbc Updated Upstream (Bukkit/CraftBukkit) (#10034) PaperMC/Paper@ff26d54 send sound and particle packets immediately even if off main (#10033) PaperMC/Paper@e3140fb hotfix spawning item/xp in wrong spot PaperMC/Paper@0b95298 Make worldborder collisions consistent with Vanilla PaperMC/Paper@47b2c18 Don't fire the drop event on player deaths (#10046) PaperMC/Paper@8c007d9 properly read and store sus effect duration (#10050) PaperMC/Paper@5385b21 [ci skip] Make test results viewable in-browser and downloadable (#10055) PaperMC/Paper@086ca61 Fix world border edge collision (#10053) PaperMC/Paper@45e01a2 Use correct max stack size in crafter (#10057) PaperMC/Paper@d11a588 Remove duplicate code in chunk tick iteration (#10056) PaperMC/Paper@b4c9e7e add missing Experimental annotations (#10012)
28 lines
1.4 KiB
Diff
28 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
|
|
Date: Fri, 8 Dec 2023 18:12:20 +0000
|
|
Subject: [PATCH] Allow disabling random dispenser item selection
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
|
index 881379681c39230a00b3a1f11cd87498984396c7..73e6fbf818944e73885db9c528114b0ea684de47 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
|
@@ -73,8 +73,15 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
|
int j = 1;
|
|
|
|
for (int k = 0; k < this.items.size(); ++k) {
|
|
- if (!((ItemStack) this.items.get(k)).isEmpty() && random.nextInt(j++) == 0) {
|
|
+ // Sakura start - allow disabling dispenser random item selection
|
|
+ if (this.level.sakuraConfig().technical.dispenserRandomItemSelection || this instanceof DropperBlockEntity) {
|
|
+ if (!((ItemStack) this.items.get(k)).isEmpty() && random.nextInt(j++) == 0) {
|
|
+ i = k;
|
|
+ }
|
|
+ } else if (!this.items.get(k).isEmpty()) {
|
|
i = k;
|
|
+ break;
|
|
+ // Sakura end
|
|
}
|
|
}
|
|
|