Shulker spawn from bullet options

(0 - 1) / 5.0 = -0.2  (can never happen because self is included in count)
(1 - 1) / 5.0 = 0.0    1.0 - 0.0 = 1.0    100% (just self)
(2 - 1) / 5.0 = 0.2    1.0 - 0.2 = 0.8     80% (1 other shulker)
(3 - 1) / 5.0 = 0.4    1.0 - 0.4 = 0.6     60% (2 other shulkers)
(4 - 1) / 5.0 = 0.6    1.0 - 0.6 = 0.4     40% (3 other shulkers)
(5 - 1) / 5.0 = 0.8    1.0 - 0.8 = 0.2     20% (4 other shulkers)
(6 - 1) / 5.0 = 1.0    1.0 - 1.0 = 0.0      0% (5 other shulkers)
(7 - 1) / 5.0 = 1.2    1.0 - 1.2 = -0.2     0% (6 other shulkers)
This commit is contained in:
William Blake Galbreath
2025-01-11 22:55:10 -08:00
committed by granny
parent d760f5436f
commit e09623ae80
4 changed files with 68 additions and 97 deletions

View File

@@ -0,0 +1,13 @@
--- a/net/minecraft/world/item/DyeColor.java
+++ b/net/minecraft/world/item/DyeColor.java
@@ -123,4 +_,10 @@
private static CraftingInput makeCraftColorInput(DyeColor first, DyeColor second) {
return CraftingInput.of(2, 1, List.of(new ItemStack(DyeItem.byColor(first)), new ItemStack(DyeItem.byColor(second))));
}
+
+ // Purpur start - Shulker spawn from bullet options
+ public static DyeColor random(net.minecraft.util.RandomSource random) {
+ return values()[random.nextInt(values().length)];
+ }
+ // Purpur end - Shulker spawn from bullet options
}