|
46 | 46 | import novamachina.exnihilosequentia.world.level.block.InfestedLeavesBlock; |
47 | 47 |
|
48 | 48 | import org.jetbrains.annotations.Nullable; |
| 49 | + |
49 | 50 | import java.util.*; |
50 | 51 |
|
51 | 52 | public class ExNihiloSequentiaAddon implements ExNihiloProvider { |
@@ -133,6 +134,10 @@ public List<ItemStack> rollHammerRewards(Level level, BlockState state, ItemStac |
133 | 134 |
|
134 | 135 | @Override |
135 | 136 | public boolean isSiftableWithMesh(Level level, BlockState sieveState, BlockState state, SieveMeshRegistryEntry sieveMesh) { |
| 137 | + if (state.isEmpty()) { |
| 138 | + return false; |
| 139 | + } |
| 140 | + |
136 | 141 | boolean waterlogged = sieveState.hasProperty(BlockStateProperties.WATERLOGGED) && sieveState.getValue(BlockStateProperties.WATERLOGGED); |
137 | 142 | MeshType mesh = sieveMesh != null ? (MeshType) sieveMesh.getBackingMesh() : MeshType.NONE; |
138 | 143 | return ExNihiloRegistries.SIEVE_REGISTRY.isBlockSiftable(state.getBlock(), mesh, waterlogged); |
@@ -225,7 +230,10 @@ public LootTable generateHeavySieveLootTable(Level level, BlockState sieveState, |
225 | 230 | ItemStack itemStack = recipe.getDrop(); |
226 | 231 | for (MeshWithChance roll : recipe.getRolls()) { |
227 | 232 | LootPool.Builder poolBuilder = LootPool.lootPool(); |
228 | | - poolBuilder.name("excompressum-heavysieve-" + Balm.getRegistries().getKey(source.asItem()).toString().replace(':', '-') + "-" + UUID.randomUUID()); |
| 233 | + poolBuilder.name("excompressum-heavysieve-" + Balm.getRegistries() |
| 234 | + .getKey(source.asItem()) |
| 235 | + .toString() |
| 236 | + .replace(':', '-') + "-" + UUID.randomUUID()); |
229 | 237 | poolBuilder.setRolls(ConstantValue.exactly(times)); |
230 | 238 | LootPoolSingletonContainer.Builder<?> entryBuilder = buildLootEntry(itemStack); |
231 | 239 | entryBuilder.when(LootItemRandomChanceCondition.randomChance(roll.getChance())); |
|
0 commit comments