use of org.spongepowered.common.block.SpongeBlockSnapshot in project SpongeCommon by SpongePowered.
the class MixinBlockDispenser method onDispenseHead.
@Inject(method = "dispense", at = @At(value = "HEAD"))
public void onDispenseHead(World worldIn, BlockPos pos, CallbackInfo ci) {
final IBlockState state = worldIn.getBlockState(pos);
final SpongeBlockSnapshot spongeBlockSnapshot = ((IMixinWorldServer) worldIn).createSpongeBlockSnapshot(state, state, pos, BlockChangeFlags.ALL);
final IMixinChunk mixinChunk = (IMixinChunk) worldIn.getChunkFromBlockCoords(pos);
this.context = BlockPhase.State.DISPENSE.createPhaseContext().source(spongeBlockSnapshot).owner(() -> mixinChunk.getBlockOwner(pos)).notifier(() -> mixinChunk.getBlockNotifier(pos)).buildAndSwitch();
}
Aggregations