|
31 | 31 |
|
32 | 32 | public class VesselBlockEntity extends BlockEntity implements AspectContainer { |
33 | 33 | public final static int MAX_SLUDGE_AMOUNT = 96; |
| 34 | + private final static float SLUDGE_CHANCE = 0.05f; |
| 35 | + |
34 | 36 | private final AspectMap aspects = new AspectMap(); |
35 | 37 | private final AspectMap sludgeAspects = new AspectMap(); |
36 | 38 | private boolean boiling = false; |
@@ -108,16 +110,14 @@ public void processItemForAspects(ServerWorld world) { |
108 | 110 | if (noSludge) { |
109 | 111 | aspects.modifyAspectLevel(entry.getKey(), totalAmount); |
110 | 112 | } else { |
111 | | - int part_a = totalAmount / 2; |
112 | | - int part_b = totalAmount - part_a; |
113 | | - |
114 | | - if (world.getRandom().nextBoolean()) { |
115 | | - aspects.modifyAspectLevel(entry.getKey(), part_a); |
116 | | - sludgeAspects.modifyAspectLevel(entry.getKey(), part_b); |
117 | | - } else { |
118 | | - aspects.modifyAspectLevel(entry.getKey(), part_b); |
119 | | - sludgeAspects.modifyAspectLevel(entry.getKey(), part_a); |
| 113 | + float sludgeAmountFloat = totalAmount * SLUDGE_CHANCE; |
| 114 | + int sludgeAmountInteger = (int) sludgeAmountFloat; |
| 115 | + if (world.getRandom().nextFloat() < (sludgeAmountFloat - (float) sludgeAmountInteger)) { |
| 116 | + sludgeAmountInteger = sludgeAmountInteger + 1; |
120 | 117 | } |
| 118 | + int aspectAmountInteger = totalAmount - sludgeAmountInteger; |
| 119 | + aspects.modifyAspectLevel(entry.getKey(), aspectAmountInteger); |
| 120 | + sludgeAspects.modifyAspectLevel(entry.getKey(), sludgeAmountInteger); |
121 | 121 | } |
122 | 122 | } |
123 | 123 | if (processItems.getCount() <= 1) { |
|
0 commit comments