explosion - added entity context.

This commit is contained in:
gnembon committed 2020-05-12 14:16:19 -03:00
1 parent 5a746cc3c4
commit 5cee4e9958
2 files changed
+8 -7

No files matched your search

@@ -243,14 +243,15 @@ public class OptimizedExplosion
{
BlockEntity blockEntity = block.hasBlockEntity() ? world.getBlockEntity(blockpos) : null;
LootContext.Builder lootBuilder = new LootContext.Builder((ServerWorld) eAccess.getWorld())
.setRandom(eAccess.getWorld().random)
.put(LootContextParameters.POSITION, blockpos)
.put(LootContextParameters.TOOL, ItemStack.EMPTY)
.putNullable(LootContextParameters.BLOCK_ENTITY, blockEntity);
LootContext.Builder lootBuilder = (new LootContext.Builder((ServerWorld)eAccess.getWorld()))
.random(eAccess.getWorld().random)
.parameter(LootContextParameters.POSITION, blockpos)
.parameter(LootContextParameters.TOOL, ItemStack.EMPTY)
.optionalParameter(LootContextParameters.BLOCK_ENTITY, blockEntity)
.optionalParameter(LootContextParameters.THIS_ENTITY, eAccess.getEntity());
if (eAccess.getDestructionType() == Explosion.DestructionType.DESTROY)
lootBuilder.put(LootContextParameters.EXPLOSION_RADIUS, eAccess.getPower());
lootBuilder.parameter(LootContextParameters.EXPLOSION_RADIUS, eAccess.getPower());
state.getDroppedStacks(lootBuilder).forEach((itemStackx) -> {
method_24023(objectArrayList, itemStackx, blockpos.toImmutable());