List of usage examples for net.minecraftforge.common.util BlockSnapshot getBlockSnapshot
public static BlockSnapshot getBlockSnapshot(IWorld world, BlockPos pos)
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(); }