Example usage for net.minecraftforge.common.util BlockSnapshot getBlockSnapshot

List of usage examples for net.minecraftforge.common.util BlockSnapshot getBlockSnapshot

Introduction

In this page you can find the example usage for net.minecraftforge.common.util BlockSnapshot getBlockSnapshot.

Prototype

public static BlockSnapshot getBlockSnapshot(IWorld world, BlockPos pos) 

Source Link

Usage

From source file:org.spongepowered.mod.mixin.core.event.player.MixinEventPlayerPlaceBlock.java

License:MIT License

@Inject(method = "<init>", at = @At("RETURN"))
public void onConstructed(BlockSnapshot blockSnapshot, IBlockState placedAgainst, EntityPlayer player,
        CallbackInfo ci) {/*from  w w  w .  jav a 2s .  c om*/
    this.blockOriginal = ((IMixinBlockSnapshot) blockSnapshot).createSpongeBlockSnapshot();
    this.blockReplacement = ((IMixinBlockSnapshot) BlockSnapshot.getBlockSnapshot(blockSnapshot.world,
            blockSnapshot.pos)).createSpongeBlockSnapshot();
    this.blockTransactions = new ImmutableList.Builder<BlockTransaction>()
            .add(new BlockTransaction(this.blockOriginal, this.blockReplacement)).build();
}