Exemplo n.º 1
0
 public void didPlaceBlock(
     World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack) {
   world.setBlockState(
       pos, state.withProperty(FACING, BlockPistonBase.func_180695_a(world, pos, player)), 2);
   world.withTileEntity(
       pos, TileEntityDispenser.class, t -> stack.withDisplayName(t::setCustomName));
 }
Exemplo n.º 2
0
 public IBlockState didPlaceBlock(
     World world,
     BlockPos pos,
     EnumDirection facing,
     float hitX,
     float hitY,
     float hitZ,
     int meta,
     EntityLivingBase player) {
   return this.getDefaultState()
       .withProperty(FACING, BlockPistonBase.func_180695_a(world, pos, player))
       .withProperty(TRIGGERED, false);
 }